@nocobase/app 2.1.0-alpha.16 → 2.1.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/client-v2/src/.plugins/index.ts +14 -3
  2. package/client-v2/src/.plugins/packageMap.json +129 -0
  3. package/client-v2/src/.plugins/packages/nocobase_example_plugin_acl_allow.ts +1 -0
  4. package/client-v2/src/.plugins/packages/nocobase_example_plugin_acl_middleware.ts +1 -0
  5. package/client-v2/src/.plugins/packages/nocobase_example_plugin_action_group.ts +1 -0
  6. package/client-v2/src/.plugins/packages/nocobase_example_plugin_block_custom_resource.ts +1 -0
  7. package/client-v2/src/.plugins/packages/nocobase_example_plugin_block_filter_collection.ts +1 -0
  8. package/client-v2/src/.plugins/packages/nocobase_example_plugin_block_timeline.ts +1 -0
  9. package/client-v2/src/.plugins/packages/nocobase_example_plugin_collection_block.ts +1 -0
  10. package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_details_block.ts +1 -0
  11. package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_form_block.ts +1 -0
  12. package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block.ts +1 -0
  13. package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block_action_group.ts +1 -0
  14. package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block_field.ts +1 -0
  15. package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block_resource.ts +1 -0
  16. package/client-v2/src/.plugins/packages/nocobase_example_plugin_data_block.ts +1 -0
  17. package/client-v2/src/.plugins/packages/nocobase_example_plugin_field_simple.ts +1 -0
  18. package/client-v2/src/.plugins/packages/nocobase_example_plugin_nested_action.ts +1 -0
  19. package/client-v2/src/.plugins/packages/nocobase_example_plugin_nested_block.ts +1 -0
  20. package/client-v2/src/.plugins/packages/nocobase_example_plugin_simple_action.ts +1 -0
  21. package/client-v2/src/.plugins/packages/nocobase_example_plugin_simple_block.ts +1 -0
  22. package/client-v2/src/.plugins/packages/nocobase_example_plugin_simple_popup_action.ts +1 -0
  23. package/client-v2/src/.plugins/packages/nocobase_plugin_acl.ts +1 -0
  24. package/client-v2/src/.plugins/packages/nocobase_plugin_action_bulk_edit.ts +1 -0
  25. package/client-v2/src/.plugins/packages/nocobase_plugin_action_bulk_update.ts +1 -0
  26. package/client-v2/src/.plugins/packages/nocobase_plugin_action_custom_request.ts +1 -0
  27. package/client-v2/src/.plugins/packages/nocobase_plugin_action_duplicate.ts +1 -0
  28. package/client-v2/src/.plugins/packages/nocobase_plugin_action_export.ts +1 -0
  29. package/client-v2/src/.plugins/packages/nocobase_plugin_action_import.ts +1 -0
  30. package/client-v2/src/.plugins/packages/nocobase_plugin_action_print.ts +1 -0
  31. package/client-v2/src/.plugins/packages/nocobase_plugin_ai.ts +1 -0
  32. package/client-v2/src/.plugins/packages/nocobase_plugin_ai_gigachat.ts +1 -0
  33. package/client-v2/src/.plugins/packages/nocobase_plugin_api_doc.ts +1 -0
  34. package/client-v2/src/.plugins/packages/nocobase_plugin_api_keys.ts +1 -0
  35. package/client-v2/src/.plugins/packages/nocobase_plugin_async_task_manager.ts +1 -0
  36. package/client-v2/src/.plugins/packages/nocobase_plugin_audit_logs.ts +1 -0
  37. package/client-v2/src/.plugins/packages/nocobase_plugin_auth.ts +1 -0
  38. package/client-v2/src/.plugins/packages/nocobase_plugin_auth_sms.ts +1 -0
  39. package/client-v2/src/.plugins/packages/nocobase_plugin_backup_restore.ts +1 -0
  40. package/client-v2/src/.plugins/packages/nocobase_plugin_block_grid_card.ts +1 -0
  41. package/client-v2/src/.plugins/packages/nocobase_plugin_block_iframe.ts +1 -0
  42. package/client-v2/src/.plugins/packages/nocobase_plugin_block_list.ts +1 -0
  43. package/client-v2/src/.plugins/packages/nocobase_plugin_block_markdown.ts +1 -0
  44. package/client-v2/src/.plugins/packages/nocobase_plugin_block_multi_step_form.ts +1 -0
  45. package/client-v2/src/.plugins/packages/nocobase_plugin_block_template.ts +1 -0
  46. package/client-v2/src/.plugins/packages/nocobase_plugin_block_tree.ts +1 -0
  47. package/client-v2/src/.plugins/packages/nocobase_plugin_block_workbench.ts +1 -0
  48. package/client-v2/src/.plugins/packages/nocobase_plugin_calendar.ts +1 -0
  49. package/client-v2/src/.plugins/packages/nocobase_plugin_charts.ts +1 -0
  50. package/client-v2/src/.plugins/packages/nocobase_plugin_client.ts +1 -0
  51. package/client-v2/src/.plugins/packages/nocobase_plugin_collection_fdw.ts +1 -0
  52. package/client-v2/src/.plugins/packages/nocobase_plugin_collection_sql.ts +1 -0
  53. package/client-v2/src/.plugins/packages/nocobase_plugin_collection_tree.ts +1 -0
  54. package/client-v2/src/.plugins/packages/nocobase_plugin_comments.ts +1 -0
  55. package/client-v2/src/.plugins/packages/nocobase_plugin_custom_variables.ts +1 -0
  56. package/client-v2/src/.plugins/packages/nocobase_plugin_data_source_main.ts +1 -0
  57. package/client-v2/src/.plugins/packages/nocobase_plugin_data_source_manager.ts +1 -0
  58. package/client-v2/src/.plugins/packages/nocobase_plugin_data_visualization.ts +1 -0
  59. package/client-v2/src/.plugins/packages/nocobase_plugin_data_visualization_echarts.ts +1 -0
  60. package/client-v2/src/.plugins/packages/nocobase_plugin_departments.ts +1 -0
  61. package/client-v2/src/.plugins/packages/nocobase_plugin_disable_pm_add.ts +1 -0
  62. package/client-v2/src/.plugins/packages/nocobase_plugin_embed.ts +1 -0
  63. package/client-v2/src/.plugins/packages/nocobase_plugin_environment_variables.ts +1 -0
  64. package/client-v2/src/.plugins/packages/nocobase_plugin_error_handler.ts +1 -0
  65. package/client-v2/src/.plugins/packages/nocobase_plugin_field_attachment_url.ts +1 -0
  66. package/client-v2/src/.plugins/packages/nocobase_plugin_field_china_region.ts +1 -0
  67. package/client-v2/src/.plugins/packages/nocobase_plugin_field_code.ts +1 -0
  68. package/client-v2/src/.plugins/packages/nocobase_plugin_field_formula.ts +1 -0
  69. package/client-v2/src/.plugins/packages/nocobase_plugin_field_m2m_array.ts +1 -0
  70. package/client-v2/src/.plugins/packages/nocobase_plugin_field_markdown_vditor.ts +1 -0
  71. package/client-v2/src/.plugins/packages/nocobase_plugin_field_sequence.ts +1 -0
  72. package/client-v2/src/.plugins/packages/nocobase_plugin_field_sort.ts +1 -0
  73. package/client-v2/src/.plugins/packages/nocobase_plugin_file_manager.ts +1 -0
  74. package/client-v2/src/.plugins/packages/nocobase_plugin_file_previewer_office.ts +1 -0
  75. package/client-v2/src/.plugins/packages/nocobase_plugin_flow_engine.ts +1 -0
  76. package/client-v2/src/.plugins/packages/nocobase_plugin_form_drafts.ts +1 -0
  77. package/client-v2/src/.plugins/packages/nocobase_plugin_gantt.ts +1 -0
  78. package/client-v2/src/.plugins/packages/nocobase_plugin_graph_collection_manager.ts +1 -0
  79. package/client-v2/src/.plugins/packages/nocobase_plugin_hello.ts +1 -0
  80. package/client-v2/src/.plugins/packages/nocobase_plugin_idp_oauth.ts +1 -0
  81. package/client-v2/src/.plugins/packages/nocobase_plugin_kanban.ts +1 -0
  82. package/client-v2/src/.plugins/packages/nocobase_plugin_license.ts +1 -0
  83. package/client-v2/src/.plugins/packages/nocobase_plugin_locale_tester.ts +1 -0
  84. package/client-v2/src/.plugins/packages/nocobase_plugin_localization.ts +1 -0
  85. package/client-v2/src/.plugins/packages/nocobase_plugin_logger.ts +1 -0
  86. package/client-v2/src/.plugins/packages/nocobase_plugin_map.ts +1 -0
  87. package/client-v2/src/.plugins/packages/nocobase_plugin_mcp_server.ts +1 -0
  88. package/client-v2/src/.plugins/packages/nocobase_plugin_mobile.ts +1 -0
  89. package/client-v2/src/.plugins/packages/nocobase_plugin_mobile_client.ts +1 -0
  90. package/client-v2/src/.plugins/packages/nocobase_plugin_mock_collections.ts +1 -0
  91. package/client-v2/src/.plugins/packages/nocobase_plugin_multi_app_manager.ts +1 -0
  92. package/client-v2/src/.plugins/packages/nocobase_plugin_multi_app_share_collection.ts +1 -0
  93. package/client-v2/src/.plugins/packages/nocobase_plugin_multi_keyword_filter.ts +1 -0
  94. package/client-v2/src/.plugins/packages/nocobase_plugin_notification_email.ts +1 -0
  95. package/client-v2/src/.plugins/packages/nocobase_plugin_notification_in_app_message.ts +1 -0
  96. package/client-v2/src/.plugins/packages/nocobase_plugin_notification_manager.ts +1 -0
  97. package/client-v2/src/.plugins/packages/nocobase_plugin_notifications.ts +1 -0
  98. package/client-v2/src/.plugins/packages/nocobase_plugin_public_forms.ts +1 -0
  99. package/client-v2/src/.plugins/packages/nocobase_plugin_snapshot_field.ts +1 -0
  100. package/client-v2/src/.plugins/packages/nocobase_plugin_system_settings.ts +1 -0
  101. package/client-v2/src/.plugins/packages/nocobase_plugin_text_copy.ts +1 -0
  102. package/client-v2/src/.plugins/packages/nocobase_plugin_theme_editor.ts +1 -0
  103. package/client-v2/src/.plugins/packages/nocobase_plugin_ui_schema_storage.ts +1 -0
  104. package/client-v2/src/.plugins/packages/nocobase_plugin_ui_templates.ts +1 -0
  105. package/client-v2/src/.plugins/packages/nocobase_plugin_user_data_sync.ts +1 -0
  106. package/client-v2/src/.plugins/packages/nocobase_plugin_users.ts +1 -0
  107. package/client-v2/src/.plugins/packages/nocobase_plugin_verification.ts +1 -0
  108. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow.ts +1 -0
  109. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_action_trigger.ts +1 -0
  110. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_aggregate.ts +1 -0
  111. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_cc.ts +1 -0
  112. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_custom_action_trigger.ts +1 -0
  113. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_date_calculation.ts +1 -0
  114. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_delay.ts +1 -0
  115. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_dynamic_calculation.ts +1 -0
  116. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_javascript.ts +1 -0
  117. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_json_query.ts +1 -0
  118. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_json_variable_mapping.ts +1 -0
  119. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_loop.ts +1 -0
  120. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_mailer.ts +1 -0
  121. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_manual.ts +1 -0
  122. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_notification.ts +1 -0
  123. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_parallel.ts +1 -0
  124. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_request.ts +1 -0
  125. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_request_interceptor.ts +1 -0
  126. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_response_message.ts +1 -0
  127. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_sql.ts +1 -0
  128. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_test.ts +1 -0
  129. package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_variable.ts +1 -0
  130. package/dist/client/assets/{index-8e933cba.js → index-27c2e9bc.js} +84 -84
  131. package/dist/client/assets/{vendor-misc-4fd76bfe.js → vendor-misc-5f2d5dc4.js} +6 -6
  132. package/dist/client/index.html +1 -1
  133. package/dist/client/index.html.tpl +1 -1
  134. package/package.json +7 -6
  135. package/dist/client/v2/assets/1020-0212416d.js +0 -2
  136. package/dist/client/v2/assets/1020-0212416d.js.LICENSE.txt +0 -7
  137. package/dist/client/v2/assets/1222-49e8dadb.css +0 -1
  138. package/dist/client/v2/assets/1222-c8810ac8.js +0 -2
  139. package/dist/client/v2/assets/1222-c8810ac8.js.LICENSE.txt +0 -9
  140. package/dist/client/v2/assets/1310-21e5c8a8.js +0 -59
  141. package/dist/client/v2/assets/1331-9092cf22.js +0 -1
  142. package/dist/client/v2/assets/1425-a2b446a6.js +0 -42
  143. package/dist/client/v2/assets/1507-a673a0c0.js +0 -7
  144. package/dist/client/v2/assets/158-6a033567.js +0 -23
  145. package/dist/client/v2/assets/1676-5db7433e.js +0 -9
  146. package/dist/client/v2/assets/1725-6f5b8d53.js +0 -83
  147. package/dist/client/v2/assets/1786-8969223a.js +0 -16
  148. package/dist/client/v2/assets/1951-f63bc4b3.js +0 -55
  149. package/dist/client/v2/assets/2017-b35f125d.js +0 -26
  150. package/dist/client/v2/assets/212-59d29e60.js +0 -18
  151. package/dist/client/v2/assets/2131-a150fed4.js +0 -1
  152. package/dist/client/v2/assets/22-9d12a303.js +0 -1
  153. package/dist/client/v2/assets/2203-9aa79271.js +0 -4
  154. package/dist/client/v2/assets/2335-1d33c3cf.js +0 -22
  155. package/dist/client/v2/assets/2555-dee484a1.js +0 -31
  156. package/dist/client/v2/assets/2702-8d5ab2a8.js +0 -5
  157. package/dist/client/v2/assets/2710-93d67bf0.js +0 -36
  158. package/dist/client/v2/assets/2726-f6cc5db9.js +0 -23
  159. package/dist/client/v2/assets/2861-48106fd8.js +0 -3
  160. package/dist/client/v2/assets/2898-2a7d5793.js +0 -17
  161. package/dist/client/v2/assets/2958-5a85effa.js +0 -27
  162. package/dist/client/v2/assets/3018-fc630932.js +0 -3
  163. package/dist/client/v2/assets/3117-3d38bb4d.js +0 -33
  164. package/dist/client/v2/assets/3279-1f24fe26.js +0 -1
  165. package/dist/client/v2/assets/338-2f192edd.js +0 -3
  166. package/dist/client/v2/assets/3475-c42974e1.js +0 -1
  167. package/dist/client/v2/assets/3660-27f9c6c5.js +0 -6
  168. package/dist/client/v2/assets/3662-135bbea1.js +0 -28
  169. package/dist/client/v2/assets/3690-4a8bdf43.js +0 -12
  170. package/dist/client/v2/assets/3727-b74fc29b.js +0 -44
  171. package/dist/client/v2/assets/3916-ba5b43b5.js +0 -6
  172. package/dist/client/v2/assets/3937-af967d62.js +0 -3
  173. package/dist/client/v2/assets/3989-e72345bb.js +0 -27
  174. package/dist/client/v2/assets/4222-29a8147d.js +0 -5
  175. package/dist/client/v2/assets/4313-9687f912.js +0 -28
  176. package/dist/client/v2/assets/5064-93d8e29e.js +0 -10
  177. package/dist/client/v2/assets/5501-a3b5b97f.js +0 -17
  178. package/dist/client/v2/assets/5721-f00ddbf2.js +0 -18
  179. package/dist/client/v2/assets/5759-d5b1d946.js +0 -47
  180. package/dist/client/v2/assets/5761-8ab1974d.js +0 -28
  181. package/dist/client/v2/assets/6064-1517304e.js +0 -2
  182. package/dist/client/v2/assets/6064-1517304e.js.LICENSE.txt +0 -236
  183. package/dist/client/v2/assets/6269-35e90156.js +0 -1
  184. package/dist/client/v2/assets/6373-9d047c6b.js +0 -13
  185. package/dist/client/v2/assets/6437-2f91d29a.js +0 -12
  186. package/dist/client/v2/assets/6581-51c928bf.js +0 -21
  187. package/dist/client/v2/assets/6738-eb09fa59.js +0 -20
  188. package/dist/client/v2/assets/700-5f166286.js +0 -15
  189. package/dist/client/v2/assets/7021-01608dc5.js +0 -45
  190. package/dist/client/v2/assets/7201-8e6e91a3.js +0 -14
  191. package/dist/client/v2/assets/7211-b8c71ed2.js +0 -9
  192. package/dist/client/v2/assets/7492-5c593f52.js +0 -5
  193. package/dist/client/v2/assets/754-41b763b9.js +0 -17
  194. package/dist/client/v2/assets/7761-637067c6.js +0 -123
  195. package/dist/client/v2/assets/7876-673cbc3c.js +0 -6
  196. package/dist/client/v2/assets/7946-09b77e08.js +0 -13
  197. package/dist/client/v2/assets/7959-ab57fce2.js +0 -40
  198. package/dist/client/v2/assets/8138-704104a5.js +0 -24
  199. package/dist/client/v2/assets/8262-7a324b59.js +0 -9
  200. package/dist/client/v2/assets/8434-79232eec.js +0 -25
  201. package/dist/client/v2/assets/8438-9d210970.js +0 -37
  202. package/dist/client/v2/assets/8562-215edc37.js +0 -17
  203. package/dist/client/v2/assets/9811-52d18c3d.js +0 -1
  204. package/dist/client/v2/assets/9827-d1f02095.js +0 -9
  205. package/dist/client/v2/assets/9836-288424d8.js +0 -22
  206. package/dist/client/v2/assets/index-e2c0ebd2.js +0 -261
  207. package/dist/client/v2/assets/index-e2c0ebd2.js.LICENSE.txt +0 -1
  208. package/dist/client/v2/assets/runtime-6f58b646.js +0 -1
  209. package/dist/client/v2/assets/vendor-antd-05d1c710.js +0 -451
  210. package/dist/client/v2/assets/vendor-antd-ecosystem-1ffc870c.js +0 -2
  211. package/dist/client/v2/assets/vendor-antd-ecosystem-1ffc870c.js.LICENSE.txt +0 -1
  212. package/dist/client/v2/assets/vendor-antd-icons-db04cf76.js +0 -2
  213. package/dist/client/v2/assets/vendor-antd-icons-db04cf76.js.LICENSE.txt +0 -1621
  214. package/dist/client/v2/assets/vendor-lodash-831bd1b8.js +0 -2
  215. package/dist/client/v2/assets/vendor-lodash-831bd1b8.js.LICENSE.txt +0 -8
  216. package/dist/client/v2/assets/vendor-moment-84b317dc.js +0 -2
  217. package/dist/client/v2/assets/vendor-moment-84b317dc.js.LICENSE.txt +0 -631
  218. package/dist/client/v2/assets/vendor-ses-b7bccbcd.js +0 -23
  219. package/dist/client/v2/browser-checker.js +0 -186
  220. package/dist/client/v2/favicon/favicon.ico +0 -0
  221. package/dist/client/v2/file-placeholder/ai-200-200.png +0 -0
  222. package/dist/client/v2/file-placeholder/audio-200-200.png +0 -0
  223. package/dist/client/v2/file-placeholder/docx-200-200.png +0 -0
  224. package/dist/client/v2/file-placeholder/eps-200-200.png +0 -0
  225. package/dist/client/v2/file-placeholder/gif-200-200.png +0 -0
  226. package/dist/client/v2/file-placeholder/jpeg-200-200.png +0 -0
  227. package/dist/client/v2/file-placeholder/pdf-200-200.png +0 -0
  228. package/dist/client/v2/file-placeholder/png-200-200.png +0 -0
  229. package/dist/client/v2/file-placeholder/pptx-200-200.png +0 -0
  230. package/dist/client/v2/file-placeholder/psd-200-200.png +0 -0
  231. package/dist/client/v2/file-placeholder/svg-200-200.png +0 -0
  232. package/dist/client/v2/file-placeholder/unknown-200-200.png +0 -0
  233. package/dist/client/v2/file-placeholder/video-200-200.png +0 -0
  234. package/dist/client/v2/file-placeholder/xlsx-200-200.png +0 -0
  235. package/dist/client/v2/file-placeholder/zip-200-200.png +0 -0
  236. package/dist/client/v2/global.css +0 -63
  237. package/dist/client/v2/index.html +0 -19
  238. package/dist/client/v2/nocobase.png +0 -0
  239. package/dist/client/v2/robots.txt +0 -2
  240. /package/dist/client/assets/{index-8e933cba.js.LICENSE.txt → index-27c2e9bc.js.LICENSE.txt} +0 -0
  241. /package/dist/client/assets/{vendor-misc-4fd76bfe.js.LICENSE.txt → vendor-misc-5f2d5dc4.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 1020-0212416d.js.LICENSE.txt */
2
- export const __rspack_esm_id="1020";export const __rspack_esm_ids=["1020"];export const __webpack_modules__={43144(e){var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},n={"–":"\\--","—":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"};e.exports=function(e){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.preserveFormatting,o=i.escapeMapFn,s=String(e),u="",c=(void 0===o?function(e,r){return t({},e,r)}:o)(t({},r),void 0!==a&&a?t({},n):{}),l=Object.keys(c);s;)!function(){var e=!1;l.forEach(function(t,r){!e&&s.length>=t.length&&s.slice(0,t.length)===t&&(u+=c[l[r]],s=s.slice(t.length,s.length),e=!0)}),e||(u+=s.slice(0,1),s=s.slice(1,s.length))}();return u}},31880(e){e.exports=function e(t,r){"use strict";var n,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},p=l(t).replace(o,"")||"",f=l(r).replace(o,"")||"",d=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=f.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=parseInt(p.match(u),16)||1!==d.length&&p.match(s)&&Date.parse(p),g=parseInt(f.match(u),16)||h&&f.match(s)&&Date.parse(f)||null;if(g){if(h<g)return -1;else if(h>g)return 1}for(var y=0,v=Math.max(d.length,m.length);y<v;y++){if(n=!(d[y]||"").match(c)&&parseFloat(d[y])||d[y]||0,i=!(m[y]||"").match(c)&&parseFloat(m[y])||m[y]||0,isNaN(n)!==isNaN(i))return isNaN(n)?1:-1;if(typeof n!=typeof i&&(n+="",i+=""),n<i)return -1;if(n>i)return 1}return 0}},7391(e,t,r){var n=r(7180),i=r(43181),a=r(43031),o=r(9067),s=r(96833),u=r(43717),c=r(74801);c.alea=n,c.xor128=i,c.xorwow=a,c.xorshift7=o,c.xor4096=s,c.tychei=u,e.exports=c},7180(e,t,r){!function(e,t){function r(e){var t,r=this,n=(t=0xefc8249d,function(e){e=String(e);for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));t=n>>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=0x100000000*n}return(t>>>0)*23283064365386963e-26});r.next=function(){var e=2091639*r.s0+23283064365386963e-26*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1)}function n(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var i=new r(e),a=t&&t.state,o=i.next;return o.int32=function(){return 0x100000000*i.next()|0},o.double=function(){return o()+(2097152*o()|0)*11102230246251565e-32},o.quick=o,a&&("object"==typeof a&&n(a,i),o.state=function(){return n(i,{})}),o}e&&e.exports?e.exports=i:t&&t.amd?t(function(){return i}):this.alea=i}(e=r.nmd(e),"function"==typeof define&&define)},43717(e,t,r){!function(e,t){function r(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,i=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-0x61c88647,t.d=0x517cc1b7,e===Math.floor(e)?(t.a=e/0x100000000|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=r.charCodeAt(n),t.next()}function n(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function i(e,t){var i=new r(e),a=t&&t.state,o=function(){return(i.next()>>>0)/0x100000000};return o.double=function(){do var e=((i.next()>>>11)+(i.next()>>>0)/0x100000000)/2097152;while(0===e);return e},o.int32=i.next,o.quick=o,a&&("object"==typeof a&&n(a,i),o.state=function(){return n(i,{})}),o}e&&e.exports?e.exports=i:t&&t.amd?t(function(){return i}):this.tychei=i}(e=r.nmd(e),"function"==typeof define&&define)},43181(e,t,r){!function(e,t){function r(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=r.charCodeAt(n),t.next()}function n(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function i(e,t){var i=new r(e),a=t&&t.state,o=function(){return(i.next()>>>0)/0x100000000};return o.double=function(){do var e=((i.next()>>>11)+(i.next()>>>0)/0x100000000)/2097152;while(0===e);return e},o.int32=i.next,o.quick=o,a&&("object"==typeof a&&n(a,i),o.state=function(){return n(i,{})}),o}e&&e.exports?e.exports=i:t&&t.amd?t(function(){return i}):this.xor128=i}(e=r.nmd(e),"function"==typeof define&&define)},96833(e,t,r){!function(e,t){function r(e){var t=this;t.next=function(){var e,r,n=t.w,i=t.X,a=t.i;return t.w=n=n+0x61c88647|0,r=i[a+34&127],e=i[a=a+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=i[a]=r^e,t.i=a,r+(n^n>>>16)|0},!function(e,t){var r,n,i,a,o,s=[],u=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,u=Math.max(u,t.length)),i=0,a=-32;a<u;++a)t&&(n^=t.charCodeAt((a+32)%t.length)),0===a&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,a>=0&&(o=o+0x61c88647|0,i=0==(r=s[127&a]^=n+o)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,a=512;a>0;--a)n=s[i+34&127],r=s[i=i+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[i]=n^r;e.w=o,e.X=s,e.i=i}(t,e)}function n(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var i=new r(e),a=t&&t.state,o=function(){return(i.next()>>>0)/0x100000000};return o.double=function(){do var e=((i.next()>>>11)+(i.next()>>>0)/0x100000000)/2097152;while(0===e);return e},o.int32=i.next,o.quick=o,a&&(a.X&&n(a,i),o.state=function(){return n(i,{})}),o}e&&e.exports?e.exports=i:t&&t.amd?t(function(){return i}):this.xor4096=i}(e=r.nmd(e),"function"==typeof define&&define)},9067(e,t,r){!function(e,t){function r(e){var t=this;t.next=function(){var e,r,n=t.x,i=t.i;return e=n[i],e^=e>>>7,r=e^e<<24^((e=n[i+1&7])^e>>>10)^((e=n[i+3&7])^e>>>3)^((e=n[i+4&7])^e<<7),e=n[i+7&7],e^=e<<13,r^=e^e<<9,n[i]=r,t.i=i+1&7,r};var r,n=e,i=[];if(n===(0|n))i[0]=n;else for(r=0,n=""+n;r<n.length;++r)i[7&r]=i[7&r]<<15^n.charCodeAt(r)+i[r+1&7]<<13;for(;i.length<8;)i.push(0);for(r=0;r<8&&0===i[r];++r);for(8==r?i[7]=-1:i[r],t.x=i,t.i=0,r=256;r>0;--r)t.next()}function n(e,t){return t.x=e.x.slice(),t.i=e.i,t}function i(e,t){null==e&&(e=+new Date);var i=new r(e),a=t&&t.state,o=function(){return(i.next()>>>0)/0x100000000};return o.double=function(){do var e=((i.next()>>>11)+(i.next()>>>0)/0x100000000)/2097152;while(0===e);return e},o.int32=i.next,o.quick=o,a&&(a.x&&n(a,i),o.state=function(){return n(i,{})}),o}e&&e.exports?e.exports=i:t&&t.amd?t(function(){return i}):this.xorshift7=i}(e=r.nmd(e),"function"==typeof define&&define)},43031(e,t,r){!function(e,t){function r(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^(e^e<<1))|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function n(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var i=new r(e),a=t&&t.state,o=function(){return(i.next()>>>0)/0x100000000};return o.double=function(){do var e=((i.next()>>>11)+(i.next()>>>0)/0x100000000)/2097152;while(0===e);return e},o.int32=i.next,o.quick=o,a&&("object"==typeof a&&n(a,i),o.state=function(){return n(i,{})}),o}e&&e.exports?e.exports=i:t&&t.amd?t(function(){return i}):this.xorwow=i}(e=r.nmd(e),"function"==typeof define&&define)},74801(e,t,r){!function(t,n,i){var a,o="random",s=i.pow(256,6),u=i.pow(2,52),c=2*u;function l(e,r,l){var h=[],g=d(function e(t,r){var n,i=[],a=typeof t;if(r&&"object"==a)for(n in t)try{i.push(e(t[n],r-1))}catch(e){}return i.length?i:"string"==a?t:t+"\0"}((r=!0==r?{entropy:!0}:r||{}).entropy?[e,m(n)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(256):(e=new Uint8Array(256),(t.crypto||t.msCrypto).getRandomValues(e)),m(e)}catch(e){var r=t.navigator,i=r&&r.plugins;return[+new Date,t,i,t.screen,m(n)]}}():e,3),h),y=new p(h),v=function(){for(var e=y.g(6),t=s,r=0;e<u;)e=(e+r)*256,t*=256,r=y.g(1);for(;e>=c;)e/=2,t/=2,r>>>=1;return(e+r)/t};return v.int32=function(){return 0|y.g(4)},v.quick=function(){return y.g(4)/0x100000000},v.double=v,d(m(y.S),n),(r.pass||l||function(e,t,r,n){return(n&&(n.S&&f(n,y),e.state=function(){return f(y,{})}),r)?(i[o]=e,t):e})(v,g,"global"in r?r.global:this==i,r.state)}function p(e){var t,r=e.length,n=this,i=0,a=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);i<256;)o[i]=i++;for(i=0;i<256;i++)o[i]=o[a=255&a+e[i%r]+(t=o[i])],o[a]=t;(n.g=function(e){for(var t,r=0,i=n.i,a=n.j,o=n.S;e--;)t=o[i=255&i+1],r=256*r+o[255&(o[i]=o[a=255&a+t])+(o[a]=t)];return n.i=i,n.j=a,r})(256)}function f(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function d(e,t){for(var r,n=e+"",i=0;i<n.length;)t[255&i]=255&(r^=19*t[255&i])+n.charCodeAt(i++);return m(t)}function m(e){return String.fromCharCode.apply(0,e)}if(d(i.random(),n),e.exports){e.exports=l;try{a=r(9845)}catch(e){}}else"function"==typeof define&&define.amd?define(function(){return l}):i["seed"+o]=l}("u">typeof self?self:this,[],Math)},51504(e){function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var a=0,o=n.length;a<o;a++)n[a].fn!==t&&n[a].fn._!==t&&i.push(n[a]);return i.length?r[e]=i:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},62369(e){e.exports=function(){"use strict";function e(){return!0}function t(){return!1}function r(){}let n="Argument is not a typed-function.";return function i(){let a,o;function s(e){return"object"==typeof e&&null!==e&&e.constructor===Object}let u=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],c={name:"any",test:e,isAny:!0},l=0,p={createCount:0};function f(e){let t,r=a.get(e);if(r)return r;let n='Unknown type "'+e+'"',i=e.toLowerCase();for(t of o)if(t.toLowerCase()===i){n+='. Did you mean "'+t+'" ?';break}throw TypeError(n)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any",r=t?f(t).index:o.length,n=[];for(let t=0;t<e.length;++t){if(!e[t]||"string"!=typeof e[t].name||"function"!=typeof e[t].test)throw TypeError("Object with properties {name: string, test: function} expected");let i=e[t].name;if(a.has(i))throw TypeError('Duplicate type name "'+i+'"');n.push(i),a.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:r+t,conversionsTo:[]})}let i=o.slice(r);o=o.slice(0,r).concat(n).concat(i);for(let e=r+n.length;e<o.length;++e)a.get(o[e]).index=e}function m(){a=new Map,o=[],l=0,d([c],!1)}function h(e){let t=o.filter(t=>{let r=a.get(t);return!r.isAny&&r.test(e)});return t.length?t:["any"]}function g(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function y(e,t,r){let i,a;if(!g(e))throw TypeError(n);let o=r&&r.exact,s=D(Array.isArray(t)?t.join(","):t),u=v(s);if(!o||u in e.signatures){let t=e._typedFunctionData.signatureMap.get(u);if(t)return t}let c=s.length;if(o){let t;for(t in i=[],e.signatures)i.push(e._typedFunctionData.signatureMap.get(t))}else i=e._typedFunctionData.signatures;for(let e=0;e<c;++e){let t,r=s[e],n=[];for(t of i){let i=A(t.params,e);if(i&&(!r.restParam||i.restParam)){if(!i.hasAny){let e=b(i);if(r.types.some(t=>!e.has(t.name)))continue}n.push(t)}}if(0===(i=n).length)break}for(a of i)if(a.params.length<=c)return a;throw TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+v(s,", ")+"))")}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map(e=>e.name).join(t)}function x(e){let t=function(e){if(0===e.length)return[];let t=e.map(f);if(1===e.length)return t[0].conversionsTo;let r=new Set(e),n=new Set;for(let e=0;e<t.length;++e)for(let i of t[e].conversionsTo)r.has(i.from)||n.add(i.from);let i=[];for(let e of n){let r=l+1,n=null;for(let i=0;i<t.length;++i)for(let a of t[i].conversionsTo)a.from===e&&a.index<r&&(r=a.index,n=a);i.push(n)}return i}(e.types.map(e=>e.name)),r=e.hasAny,n=e.name,i=t.map(function(e){let t=f(e.from);return r=t.isAny||r,n+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:n,hasAny:r,hasConversion:i.length>0,restParam:e.restParam}}function b(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach(t=>e.typeSet.add(t.name))),e.typeSet}function D(e){let t=[];if("string"!=typeof e)throw TypeError("Signatures must be strings");let r=e.trim();if(""===r)return t;let n=r.split(",");for(let e=0;e<n.length;++e){let r=function(e){let t=0===e.indexOf("..."),r=(t?e.length>3?e.slice(3):"any":e).split("|").map(e=>f(e.trim())),n=!1,i=t?"...":"";return{types:r.map(function(e){return n=e.isAny||n,i+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:t}}(n[e].trim());if(r.restParam&&e!==n.length-1)throw SyntaxError('Unexpected rest parameter "'+n[e]+'": only allowed for the last parameter');if(0===r.types.length)return null;t.push(r)}return t}function N(e){let t=q(e);return!!t&&t.restParam}function w(t){if(!t||0===t.types.length)return e;if(1===t.types.length)return f(t.types[0].name).test;if(2===t.types.length){let e=f(t.types[0].name).test,r=f(t.types[1].name).test;return function(t){return e(t)||r(t)}}{let e=t.types.map(function(e){return f(e.name).test});return function(t){for(let r=0;r<e.length;r++)if(e[r](t))return!0;return!1}}}function A(e,t){return t<e.length?e[t]:N(e)?q(e):null}function E(e,t){let r=A(e,t);return r?b(r):new Set}function S(e){return null===e.conversion||void 0===e.conversion}function C(e,t){let r=new Set;return e.forEach(e=>{let n;for(n of E(e.params,t))r.add(n)}),r.has("any")?["any"]:Array.from(r)}function M(e,t,r){let n,i,a,o=e||"unnamed",s=r;for(a=0;a<t.length;a++){let e=[];if(s.forEach(r=>{let n=w(A(r.params,a));(a<r.params.length||N(r.params))&&n(t[a])&&e.push(r)}),0===e.length){if((i=C(s,a)).length>0){let e=h(t[a]);return(n=TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+a+")")).data={category:"wrongType",fn:o,index:a,actual:e,expected:i},n}}else s=e}let u=s.map(function(e){return N(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,u))return(n=TypeError("Too few arguments in function "+o+" (expected: "+(i=C(s,a)).join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:o,index:t.length,expected:i},n;let c=Math.max.apply(null,u);if(t.length>c)return(n=TypeError("Too many arguments in function "+o+" (expected: "+c+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:c},n;let l=[];for(let e=0;e<t.length;++e)l.push(h(t[e]).join("|"));return(n=TypeError('Arguments of type "'+l.join(", ")+'" do not match any of the defined signatures of function '+o+".")).data={category:"mismatch",actual:l},n}function F(e){let t=o.length+1;for(let r=0;r<e.types.length;r++)t=Math.min(t,e.types[r].typeIndex);return t}function T(e){let t=l+1;for(let r=0;r<e.types.length;r++)S(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function B(e,t){let r,n,i=e.params,a=t.params,o=q(i),s=q(a),u=N(i),c=N(a);if(u&&o.hasAny){if(!c||!s.hasAny)return 1e7}else if(c&&s.hasAny)return -1e7;let l=0,p=0;for(r of i)r.hasAny&&++l,r.hasConversion&&++p;let f=0,d=0;for(r of a)r.hasAny&&++f,r.hasConversion&&++d;if(l!==f)return(l-f)*1e6;if(u&&o.hasConversion){if(!c||!s.hasConversion)return 1e5}else if(c&&s.hasConversion)return -1e5;if(p!==d)return(p-d)*1e4;if(u){if(!c)return 1e3}else if(c)return -1e3;let m=(i.length-a.length)*(u?-100:100);if(0!==m)return m;let h=[],g=0;for(let e=0;e<i.length;++e){let t=function(e,t){if(e.hasAny){if(!t.hasAny)return .1}else if(t.hasAny)return -.1;if(e.restParam){if(!t.restParam)return .01}else if(t.restParam)return -.01;let r=F(e)-F(t);if(r<0)return -.001;if(r>0)return .001;let n=T(e),i=T(t);if(e.hasConversion){if(!t.hasConversion)return(1+n)*1e-6}else if(t.hasConversion)return-(1e-6*(1+i));let a=n-i;return a<0?-1e-7:1e-7*(a>0)}(i[e],a[e]);h.push(t),g+=t}if(0!==g)return(g<0?-10:10)+g;let y=9,v=9/(h.length+1);for(n of h){if(0!==n)return(n<0?-y:y)+n;y-=v}return 0}function O(e){let t,r,n,i,a=[],o=[],s="";e.types.forEach(function(e){e.conversion&&(s+=e.conversion.from+"~>"+e.conversion.to+",",a.push(f(e.conversion.from).test),o.push(e.conversion.convert))}),s=s?s.slice(0,-1):"pass";let u=e=>e;switch(o.length){case 0:break;case 1:t=a[0],n=o[0],u=function(e){return t(e)?n(e):e};break;case 2:t=a[0],r=a[1],n=o[0],i=o[1],u=function(e){return t(e)?n(e):r(e)?i(e):e};break;default:u=function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}return Object.defineProperty(u,"name",{value:s}),u}function _(e,t,r){throw M(e,t,r)}function z(e){return I(e,0,e.length-1)}function q(e){return e[e.length-1]}function I(e,t,r){return Array.prototype.slice.call(e,t,r)}function k(e,t){return{referTo:{references:e,callback:t}}}function R(e){if("function"!=typeof e)throw TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function P(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function U(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function j(e,t){if(!e)return t;if(t&&t!==e){let r=Error("Function names do not match (expected: "+e+", actual: "+t+")");throw r.data={actual:t,expected:e},r}return e}m(),d(u);let L=p;function H(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return(p=function(e){let n="string"==typeof e,i=+!!n,a=n?e:"",o={};for(let e=i;e<arguments.length;++e){let t,r=arguments[e],i={};if("function"==typeof r?(t=r.name,"string"==typeof r.signature?i[r.signature]=r:g(r)&&(i=r.signatures)):s(r)&&(i=r,n||(t=function(e){let t;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(g(e[r])||"string"==typeof e[r].signature)&&(t=j(t,e[r].name));return t}(r))),0===Object.keys(i).length){let t=TypeError("Argument to 'typed' at index "+e+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw t.data={index:e,argument:r},t}n||(a=j(a,t)),function(e,t){let r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r in e&&t[r]!==e[r]){let n=Error('Signature "'+r+'" is defined twice');throw n.data={signature:r,sourceFunction:t[r],destFunction:e[r]},n}e[r]=t[r]}}(o,i)}return function(e,n){let i,a,o;if(p.createCount++,0===Object.keys(n).length)throw SyntaxError("No signatures provided");p.warnAgainstDeprecatedThis&&(o=/\bthis(\(|\.signatures\b)/,Object.keys(n).forEach(e=>{let t=n[e];if(o.test(t.toString()))throw SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}));let s=[],u=[],c={},l=[];for(i in n){let e;if(!Object.prototype.hasOwnProperty.call(n,i))continue;let t=D(i);if(!t)continue;s.forEach(function(e){if(function(e,t){let r=Math.max(e.length,t.length);for(let n=0;n<r;n++){let r,i=E(e,n),a=E(t,n),o=!1;for(r of a)if(i.has(r)){o=!0;break}if(!o)return!1}let n=e.length,i=t.length,a=N(e),o=N(t);return a?o?n===i:i>=n:o?n>=i:n===i}(e,t))throw TypeError('Conflicting signatures "'+v(e)+'" and "'+v(t)+'".')}),s.push(t);let r=u.length;for(e of(u.push(n[i]),function e(t,r,n){if(!(r<t.length))return[n];{var i,a;let o=t[r],s=[];if(o.restParam){let e=o.types.filter(S);e.length<o.types.length&&s.push({types:e,name:"..."+e.map(e=>e.name).join("|"),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),s.push(o)}else s=o.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return i=s,a=function(i){return e(t,r+1,n.concat([i]))},Array.prototype.concat.apply([],i.map(a))}}(t.map(x),0,[]))){let t=v(e);l.push({params:e,name:t,fn:r}),e.every(e=>!e.hasConversion)&&(c[t]=r)}}l.sort(B);let f=function(e,t,r){let n=e.map(e=>U(e)?R(e.referToSelf.callback):P(e)?k(e.referTo.references,e.referTo.callback):e),i=Array(n.length).fill(!1),a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<n.length;++o){if(i[o])continue;let s=n[o];if(U(s))n[o]=s.referToSelf.callback(r),n[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(P(s)){let r=function(e,t,r){let n,i=[];for(n of e){let e=r[n];if("number"!=typeof e)throw TypeError('No definition for referenced signature "'+n+'"');if("function"!=typeof(e=t[e]))return!1;i.push(e)}return i}(s.referTo.references,n,t);r?(n[o]=s.referTo.callback.apply(this,r),n[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw SyntaxError("Circular reference detected in resolving typed.referTo")}return n}(u,c,ef);for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(c[a]=f[c[a]]);let d=[],m=new Map;for(a of l)m.has(a.name)||(a.fn=f[a.fn],d.push(a),m.set(a.name,a));let h=d[0]&&d[0].params.length<=2&&!N(d[0].params),g=d[1]&&d[1].params.length<=2&&!N(d[1].params),y=d[2]&&d[2].params.length<=2&&!N(d[2].params),b=d[3]&&d[3].params.length<=2&&!N(d[3].params),A=d[4]&&d[4].params.length<=2&&!N(d[4].params),C=d[5]&&d[5].params.length<=2&&!N(d[5].params);for(let e=0;e<d.length;++e)d[e].test=function(e){let t,r,n;if(N(e)){let r=(t=z(e).map(w)).length,n=w(q(e)),i=function(e){for(let t=r;t<e.length;t++)if(!n(e[t]))return!1;return!0};return function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return i(e)&&e.length>=r+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=w(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=w(e[0]),n=w(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(w),function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return e.length===t.length})}(d[e].params);let M=h?w(d[0].params[0]):t,F=g?w(d[1].params[0]):t,T=y?w(d[2].params[0]):t,_=b?w(d[3].params[0]):t,j=A?w(d[4].params[0]):t,L=C?w(d[5].params[0]):t,H=h?w(d[0].params[1]):t,$=g?w(d[1].params[1]):t,G=y?w(d[2].params[1]):t,Z=b?w(d[3].params[1]):t,V=A?w(d[4].params[1]):t,W=C?w(d[5].params[1]):t;for(let e=0;e<d.length;++e)d[e].implementation=function(e,t){let r=t,n="";if(e.some(e=>e.hasConversion)){let i=N(e),a=e.map(O);n=a.map(e=>e.name).join(";"),r=function(){let e=[],r=i?arguments.length-1:arguments.length;for(let t=0;t<r;t++)e[t]=a[t](arguments[t]);return i&&(e[r]=arguments[r].map(a[r])),t.apply(this,e)}}let i=r;if(N(e)){let t=e.length-1;i=function(){return r.apply(this,I(arguments,0,t).concat([I(arguments,t)]))}}return n&&Object.defineProperty(i,"name",{value:n}),i}(d[e].params,d[e].fn);let J=h?d[0].implementation:r,Q=g?d[1].implementation:r,X=y?d[2].implementation:r,Y=b?d[3].implementation:r,K=A?d[4].implementation:r,ee=C?d[5].implementation:r,et=h?d[0].params.length:-1,er=g?d[1].params.length:-1,en=y?d[2].params.length:-1,ei=b?d[3].params.length:-1,ea=A?d[4].params.length:-1,eo=C?d[5].params.length:-1,es=6*!!(h&&g&&y&&b&&A&&C),eu=d.length,ec=d.map(e=>e.test),el=d.map(e=>e.implementation),ep=function(){for(let e=es;e<eu;e++)if(ec[e](arguments))return el[e].apply(this,arguments);return p.onMismatch(e,arguments,d)};function ef(e,t){return arguments.length===et&&M(e)&&H(t)?J.apply(this,arguments):arguments.length===er&&F(e)&&$(t)?Q.apply(this,arguments):arguments.length===en&&T(e)&&G(t)?X.apply(this,arguments):arguments.length===ei&&_(e)&&Z(t)?Y.apply(this,arguments):arguments.length===ea&&j(e)&&V(t)?K.apply(this,arguments):arguments.length===eo&&L(e)&&W(t)?ee.apply(this,arguments):ep.apply(this,arguments)}try{Object.defineProperty(ef,"name",{value:e})}catch(e){}return ef.signatures=c,ef._typedFunctionData={signatures:d,signatureMap:m},ef}(a||"",o)}).create=i,p.createCount=L.createCount,p.onMismatch=_,p.throwMismatchError=_,p.createError=M,p.clear=m,p.clearConversions=function(){let e;for(e of o)a.get(e).conversionsTo=[];l=0},p.addTypes=d,p._findType=f,p.referTo=function(){let e=z(arguments).map(e=>v(D(e))),t=q(arguments);if("function"!=typeof t)throw TypeError("Callback function expected as last argument");return k(e,t)},p.referToSelf=R,p.convert=function(e,t){let r=f(t);if(r.test(e))return e;let n=r.conversionsTo;if(0===n.length)throw Error("There are no conversions to "+t+" defined.");for(let t=0;t<n.length;t++)if(f(n[t].from).test(e))return n[t].convert(e);throw Error("Cannot convert "+e+" to "+t)},p.findSignature=y,p.find=function(e,t,r){return y(e,t,r).implementation},p.isTypedFunction=g,p.warnAgainstDeprecatedThis=!0,p.addType=function(e,t){let r="any";!1!==t&&a.has("Object")&&(r="Object"),p.addTypes([e],r)},p.addConversion=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{override:!1};H(e);let r=f(e.to),n=r.conversionsTo.find(t=>t.from===e.from);if(n)if(t&&t.override)p.removeConversion({from:n.from,to:e.to,convert:n.convert});else throw Error('There is already a conversion from "'+e.from+'" to "'+r.name+'"');r.conversionsTo.push({from:e.from,to:r.name,convert:e.convert,index:l++})},p.addConversions=function(e,t){e.forEach(e=>p.addConversion(e,t))},p.removeConversion=function(e){H(e);let t=f(e.to),r=function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r]}(t.conversionsTo,t=>t.from===e.from);if(!r)throw Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(r.convert!==e.convert)throw Error("Conversion to remove does not match existing conversion");let n=t.conversionsTo.indexOf(r);t.conversionsTo.splice(n,1)},p.resolve=function(e,t){if(!g(e))throw TypeError(n);let r=e._typedFunctionData.signatures;for(let e=0;e<r.length;++e)if(r[e].test(t))return r[e];return null},p}()}()},56999(e,t,r){r.r(t),r.d(t,{parseDependencies:()=>ND,createLyap:()=>dm,atanh:()=>dK,createOrTransform:()=>xG,dotDivide:()=>ge,isMatrix:()=>E,createMolarMassC12:()=>nN,compile:()=>bx,createDeepEqual:()=>cg,firstRadiationDependencies:()=>wq,toDependencies:()=>Se,isPositive:()=>h_,meanDependencies:()=>NM,createSpeedOfLight:()=>rL,partitionSelect:()=>gm,planckTemperature:()=>yZ,setDifferenceDependencies:()=>Eq,deuteronMassDependencies:()=>N4,rowTransformDependencies:()=>ES,atanDependencies:()=>Dr,createUppercasePi:()=>rR,createAcoth:()=>uS,nthRootDependencies:()=>AV,setCartesian:()=>g_,lyapDependencies:()=>Aw,acoshDependencies:()=>bX,forEachDependencies:()=>wI,isNumeric:()=>mm,leafCountDependencies:()=>Au,createRandomInt:()=>uo,_true:()=>dz,coulomb:()=>yn,createQuantileSeq:()=>fm,createSetIntersect:()=>f8,isBigNumber:()=>v,max:()=>hR,nuclearMagnetonDependencies:()=>AJ,SymbolNodeDependencies:()=>Nd,setIntersect:()=>yW,ImmutableDenseMatrix:()=>gi,asech:()=>dQ,createSmaller:()=>c8,sizeDependencies:()=>Db,csc:()=>d9,createSetSize:()=>fJ,printTransformDependencies:()=>Eu,isInteger:()=>hm,isNode:()=>K,bigintDependencies:()=>DP,sylvester:()=>vr,createMapSlices:()=>uK,sinhDependencies:()=>E$,planckTimeDependencies:()=>Ea,createRightArithShift:()=>c4,createCtranspose:()=>u_,IndexDependencies:()=>D7,varianceDependencies:()=>EK,createLusolve:()=>fo,boltzmannDependencies:()=>DX,qrDependencies:()=>wu,unequal:()=>gU,acscDependencies:()=>b0,eDependencies:()=>wr,createDeuteronMass:()=>nt,pickRandomDependencies:()=>A7,createPlanckTemperature:()=>nM,createAtanh:()=>a_,Spa:()=>gy,createNorm:()=>fL,createConditionalNode:()=>vO,medianDependencies:()=>AE,ObjectNodeDependencies:()=>Ng,bohrMagneton:()=>g9,octDependencies:()=>AK,symbolicEqualDependencies:()=>E8,setMultiplicity:()=>g3,AccessorNode:()=>bf,matrixDependencies:()=>bL,createAcos:()=>aa,createSum:()=>pp,nullishDependencies:()=>AX,smallerEqDependencies:()=>Nt,createSetUnion:()=>du,stirlingS2:()=>yQ,createMapTransform:()=>xC,indexTransformDependencies:()=>wX,setUnion:()=>y4,falseDependencies:()=>wA,mapSlicesTransformDependencies:()=>AT,cosh:()=>mV,createEqualText:()=>lz,erfDependencies:()=>wx,FibonacciHeap:()=>gr,sec:()=>mT,createFaraday:()=>np,expm1:()=>mi,createRangeClass:()=>nX,ceilDependencies:()=>Dp,rowDependencies:()=>EE,secondRadiationDependencies:()=>E_,createBignumber:()=>sH,sumTransformDependencies:()=>E5,createBohrMagneton:()=>rY,molarMassDependencies:()=>AU,ImmutableDenseMatrixDependencies:()=>D8,hex:()=>ml,sinDependencies:()=>wp,stringDependencies:()=>E3,docs:()=>xv,sackurTetrodeDependencies:()=>ET,leafCount:()=>bb,createVariance:()=>fY,bigint:()=>d0,rotationMatrixDependencies:()=>Ew,versionDependencies:()=>Sl,RangeDependencies:()=>Eh,createRightLogShift:()=>l5,filterDependencies:()=>wO,DimensionError:()=>n6,countDependencies:()=>NU,createSmallerEq:()=>pZ,createStd:()=>f6,zetaDependencies:()=>Sm,createOnes:()=>ui,createMatrixFromFunction:()=>s9,createRange:()=>fg,secDependencies:()=>EB,gasConstantDependencies:()=>wP,variance:()=>yO,distanceDependencies:()=>N7,vacuumImpedanceDependencies:()=>Su,asinDependencies:()=>b9,Help:()=>bw,SQRT2:()=>dj,createMode:()=>o4,createCompile:()=>v7,OperatorNode:()=>x9,atan:()=>dY,lusolve:()=>gJ,phi:()=>dM,createHelp:()=>xb,createStefanBoltzmann:()=>nx,rationalize:()=>bT,acoth:()=>ha,isHelp:()=>_,klitzingDependencies:()=>At,bitOrTransformDependencies:()=>DG,unaryMinus:()=>hw,setSize:()=>yM,create:()=>Sv,createArrayNode:()=>vM,createClone:()=>a2,setPowerset:()=>gI,IndexError:()=>n7,createFloor:()=>cS,orDependencies:()=>A1,RangeNode:()=>ba,createSackurTetrode:()=>ny,derivativeDependencies:()=>N3,nullishTransformDependencies:()=>AY,complex:()=>d5,pi:()=>dP,rightArithShift:()=>h$,log1pDependencies:()=>Af,reshapeDependencies:()=>wl,thomsonCrossSectionDependencies:()=>E9,pinv:()=>gB,smallerEq:()=>gk,acotDependencies:()=>bY,column:()=>yt,dotPow:()=>yk,detDependencies:()=>DE,createAcsc:()=>aA,createMatrixClass:()=>nQ,createFunctionNode:()=>vK,LOG2E:()=>mg,createLOG10E:()=>rz,xor:()=>hQ,multiplyScalarDependencies:()=>Dg,faraday:()=>yP,createAsech:()=>aF,mad:()=>ym,_NaN:()=>dS,planckTime:()=>yw,asec:()=>m$,splitUnitDependencies:()=>EJ,createCosh:()=>sW,createReducedPlanckConstant:()=>rG,quantileSeqTransformDependencies:()=>Ep,solveODEDependencies:()=>EG,createHasNumericValue:()=>sK,symbolicEqual:()=>bC,createGamma:()=>p9,coshDependencies:()=>Nz,sort:()=>gR,slu:()=>gg,createNullishTransform:()=>xq,classicalElectronRadius:()=>y8,createUnitClass:()=>fT,createGravity:()=>nw,diag:()=>hl,schurDependencies:()=>AD,createCsc:()=>oi,piDependencies:()=>A6,EDependencies:()=>So,bohrRadius:()=>yq,createSqrt:()=>uh,mapTransformDependencies:()=>AB,createOct:()=>sn,typeOfDependencies:()=>w7,prod:()=>hb,printDependencies:()=>Es,coulombConstantDependencies:()=>NR,bohrMagnetonDependencies:()=>DJ,corr:()=>yI,trace:()=>gb,schur:()=>y7,createTo:()=>le,gravityDependencies:()=>wL,size:()=>m_,createWienDisplacement:()=>nb,createPinv:()=>pq,IndexNodeDependencies:()=>Nh,filterTransformDependencies:()=>w_,rangeTransformDependencies:()=>Eg,setIsSubsetDependencies:()=>ER,transpose:()=>hr,isBigInt:()=>x,createMeanTransform:()=>x2,createPlanckConstant:()=>r$,createSymbolicEqual:()=>xd,hypotDependencies:()=>wW,atan2:()=>hY,all:()=>Sg,createBin:()=>uF,planckChargeDependencies:()=>Ee,_false:()=>dv,createEfimovFactor:()=>ns,Index:()=>ga,createStirlingS2:()=>f9,invmodDependencies:()=>w3,OperatorNodeDependencies:()=>Ny,createHelpClass:()=>xa,squeezeDependencies:()=>EY,ResultSetDependencies:()=>DV,clone:()=>d3,createQuantumOfCirculation:()=>nn,kron:()=>hh,createSetSymDifference:()=>fw,kronDependencies:()=>Ar,createLeftShift:()=>cZ,simplifyConstant:()=>bv,createFactorial:()=>fk,RelationalNodeDependencies:()=>Nb,createGetMatrixDataType:()=>oT,isConditionalNode:()=>V,dotDependencies:()=>DD,rydbergDependencies:()=>EC,version:()=>dq,createRationalize:()=>xN,ArrayNodeDependencies:()=>b8,createBoltzmann:()=>nl,varianceTransformDependencies:()=>Sc,compareNaturalDependencies:()=>Ns,createCot:()=>on,createBitAnd:()=>ll,createIsFinite:()=>s1,sylvesterDependencies:()=>AN,createRangeNode:()=>vz,createExp:()=>oy,fermiCoupling:()=>yc,parser:()=>bE,HelpDependencies:()=>wG,numberDependencies:()=>Ds,createBohrRadius:()=>r4,binDependencies:()=>DU,indexDependencies:()=>wQ,catalan:()=>h2,isBoundedDependencies:()=>Nl,isSparseMatrix:()=>M,kldivergence:()=>gW,createMagneticFluxQuantum:()=>r1,loschmidtDependencies:()=>Ad,setUnionDependencies:()=>EH,createSinh:()=>uf,createIdentity:()=>uV,electronMassDependencies:()=>wg,molarMassC12:()=>yH,sparse:()=>m7,_null:()=>dC,powDependencies:()=>DC,createIndexTransform:()=>xX,mean:()=>gQ,transposeDependencies:()=>NG,isBoolean:()=>B,createPhi:()=>rT,isNegative:()=>mY,coulombDependencies:()=>Nk,coth:()=>hu,unit:()=>yX,isSymbolNode:()=>ea,createFermiCoupling:()=>r6,acsch:()=>mH,BigNumberDependencies:()=>bB,createPi:()=>rC,createOperatorNode:()=>vN,subtractDependencies:()=>NT,unequalDependencies:()=>Si,lgamma:()=>my,LN10:()=>dw,createIndexNode:()=>v$,acot:()=>dZ,cumsumDependencies:()=>NJ,lyap:()=>vn,createUnit:()=>yi,isBounded:()=>mf,createTypeOf:()=>sI,equalScalar:()=>mt,subtractScalar:()=>mR,createCompareNatural:()=>pw,createComposition:()=>lw,molarMassC12Dependencies:()=>Aj,createEigs:()=>fq,asinhDependencies:()=>De,_Infinity:()=>dN,tan:()=>mP,ArrayNode:()=>br,createAccessorNode:()=>vW,createMaxTransform:()=>xH,sechDependencies:()=>EO,identity:()=>hd,rotateDependencies:()=>EA,deepEqualDependencies:()=>NX,createKron:()=>uX,matrixFromColumns:()=>hv,createRotationMatrix:()=>fV,createAbs:()=>an,equalText:()=>gt,ctranspose:()=>hc,hexDependencies:()=>wV,createErf:()=>op,setMultiplicityDependencies:()=>EP,diffDependencies:()=>N8,createFilterTransform:()=>xM,createNull:()=>rA,ConditionalNode:()=>bi,createSylvester:()=>df,sqrtDependencies:()=>NF,createResolve:()=>v2,im:()=>mp,RelationalNode:()=>bt,createDet:()=>lS,createDivideScalar:()=>cv,molarMass:()=>yg,quantumOfCirculation:()=>yV,reducedPlanckConstantDependencies:()=>Ev,addScalarDependencies:()=>bj,quantileSeqDependencies:()=>El,createMad:()=>fR,FunctionAssignmentNode:()=>bu,distance:()=>h9,createReshape:()=>ce,createBitOrTransform:()=>xV,createRowTransform:()=>x1,vacuumImpedance:()=>g6,electronMass:()=>ys,rationalizeDependencies:()=>Ey,matrixFromRowsDependencies:()=>A_,combinations:()=>d4,traceDependencies:()=>Sr,unaryMinusDependencies:()=>DA,createConstantNode:()=>vL,rightLogShiftDependencies:()=>EN,subsetDependencies:()=>bW,bitAnd:()=>hK,flatten:()=>mo,neutronMassDependencies:()=>AZ,permutationsDependencies:()=>A5,compositionDependencies:()=>NA,oct:()=>mE,createSech:()=>ul,createDotDivide:()=>lO,stirlingS2Dependencies:()=>DI,createDistance:()=>lT,cube:()=>me,createSparse:()=>um,subset:()=>gv,columnTransformDependencies:()=>Ni,rightLogShift:()=>gh,csch:()=>mW,isNegativeDependencies:()=>DB,compareText:()=>h4,sqrt:()=>m9,conjDependencies:()=>Dx,isFunctionNode:()=>X,createHartreeEnergy:()=>r9,reviver:()=>bo,deepEqual:()=>hM,createFreqz:()=>p6,efimovFactor:()=>dk,flattenDependencies:()=>wi,conductanceQuantum:()=>yr,createLN2:()=>rB,inverseConductanceQuantum:()=>yj,corrDependencies:()=>NO,createAtan2:()=>lu,polynomialRoot:()=>gY,reshape:()=>hD,setSizeDependencies:()=>Ej,nthRoot:()=>hU,createTrace:()=>pf,bellNumbersDependencies:()=>Dk,createZpk2tf:()=>pg,row:()=>g1,ArgumentsError:()=>us,hasNumericValue:()=>mQ,gravitationConstantDependencies:()=>wj,numeric:()=>hx,crossDependencies:()=>NL,tanhDependencies:()=>E7,conductanceQuantumDependencies:()=>NS,factorial:()=>yu,imDependencies:()=>wa,createNthRoots:()=>l1,createDiag:()=>uq,dot:()=>mJ,inverseConductanceQuantumDependencies:()=>w0,isIndexNode:()=>Y,largerDependencies:()=>Dq,sech:()=>m8,nthRootsDependencies:()=>AW,createDot:()=>sX,loschmidt:()=>yd,zeros:()=>hi,createAddScalar:()=>aS,createClassicalElectronRadius:()=>r5,createDotPow:()=>f4,parse:()=>bg,bignumber:()=>mG,createAvogadro:()=>nc,ConditionalNodeDependencies:()=>Nc,acothDependencies:()=>bK,createFlatten:()=>ow,createBitNot:()=>aY,createPow:()=>pI,multiplyScalar:()=>mN,isZero:()=>mK,acsc:()=>dV,createMatrixFromRows:()=>lY,isParenthesisNode:()=>er,format:()=>mu,createPrint:()=>sp,createFractionClass:()=>nJ,createInverseConductanceQuantum:()=>r0,ones:()=>m3,qr:()=>hH,createFineStructure:()=>r7,maxTransformDependencies:()=>Aq,createRandom:()=>sh,SQRT1_2:()=>dB,isDenseMatrix:()=>C,signDependencies:()=>ws,replacer:()=>dU,zerosDependencies:()=>bV,createStdTransform:()=>x3,matrixFromColumnsDependencies:()=>wo,createNode:()=>va,equalScalarDependencies:()=>bP,resolve:()=>by,floor:()=>hB,stefanBoltzmann:()=>yT,erf:()=>mr,notDependencies:()=>b2,toBestDependencies:()=>St,zpk2tfDependencies:()=>Sh,mod:()=>hP,compareNatural:()=>gA,resizeDependencies:()=>Ex,rotationMatrix:()=>yE,subtract:()=>hZ,createFft:()=>p5,createSimplifyCore:()=>xr,asinh:()=>dX,createMatrix:()=>s6,larger:()=>hz,AccessorNodeDependencies:()=>bJ,createConj:()=>oe,derivative:()=>bM,fractionDependencies:()=>Do,lgammaDependencies:()=>Al,dotMultiplyDependencies:()=>we,BlockNodeDependencies:()=>DW,atomicMass:()=>g7,createFibonacciHeapClass:()=>lq,createMultiplyScalar:()=>o5,isComplex:()=>b,sum:()=>gx,electricConstant:()=>yK,createBitOr:()=>lf,createPermutations:()=>f$,createElectricConstant:()=>rV,createFunctionAssignmentNode:()=>vR,createSplitUnit:()=>sE,parserDependencies:()=>A4,magneticConstantDependencies:()=>AC,BigNumber:()=>dh,bitNotDependencies:()=>DH,log10Dependencies:()=>Ap,pow:()=>gO,neutronMass:()=>y$,planckConstant:()=>yD,randomInt:()=>m4,chain:()=>bc,acosDependencies:()=>bQ,createFraction:()=>uG,createResultSet:()=>nY,orTransformDependencies:()=>A2,matrix:()=>m0,createProd:()=>u7,isMap:()=>R,setDifference:()=>g2,createZeta:()=>f0,mapSlicesDependencies:()=>AF,SparseMatrixDependencies:()=>bU,compareTextDependencies:()=>Nu,createFix:()=>pC,createSec:()=>sy,map:()=>mb,isNumber:()=>y,ifft:()=>gV,tanDependencies:()=>E6,matrixFromFunction:()=>m1,createSize:()=>sN,unaryPlusDependencies:()=>NW,createSubtract:()=>c9,usolveDependencies:()=>wf,createComplexClass:()=>rf,evaluate:()=>bN,createParenthesisNode:()=>vA,createCompareText:()=>lD,createMapSlicesTransform:()=>xB,createUsolve:()=>li,hypot:()=>gn,resize:()=>m5,eigsDependencies:()=>wm,createAnd:()=>p1,setDistinctDependencies:()=>EI,createPlanckTime:()=>nS,createLeafCount:()=>xe,cotDependencies:()=>Nq,string:()=>mk,LOG10EDependencies:()=>Aa,createNot:()=>st,createRelationalNode:()=>vS,boltzmann:()=>ye,det:()=>h6,forEach:()=>ms,LOG2EDependencies:()=>Ao,createTan:()=>sO,createWeakMixingAngle:()=>no,createNthRoot:()=>cY,fft:()=>g$,sqrtmDependencies:()=>EQ,isZeroDependencies:()=>Dv,createGravitationConstant:()=>rH,typed:()=>dL,concatDependencies:()=>bG,resolveDependencies:()=>NK,createBitAndTransform:()=>xR,SQRT1_2Dependencies:()=>EM,or:()=>hL,leftShift:()=>hI,SQRT2Dependencies:()=>EF,planckConstantDependencies:()=>Et,createMagneticConstant:()=>rZ,Complex:()=>dg,lsolveAllDependencies:()=>Ah,AssignmentNode:()=>bd,bitAndTransformDependencies:()=>DL,matrixFromRows:()=>gp,sackurTetrode:()=>dO,createIm:()=>oO,ChainDependencies:()=>D1,isNaNDependencies:()=>w8,createSubset:()=>po,createToBest:()=>sz,setSymDifference:()=>g4,to:()=>hV,intersectDependencies:()=>wK,createCsch:()=>sQ,FibonacciHeapDependencies:()=>wB,createGasConstant:()=>nm,madDependencies:()=>AS,setIntersectDependencies:()=>Ek,createAdd:()=>lo,createSubsetTransform:()=>xZ,sign:()=>mB,LN2Dependencies:()=>Ai,createBitXor:()=>lm,config:()=>eg,createIndex:()=>pF,protonMassDependencies:()=>Ec,createAndTransform:()=>xO,helpDependencies:()=>wZ,isArrayNode:()=>$,createBlockNode:()=>vT,bitNot:()=>d1,diffTransformDependencies:()=>N6,modeDependencies:()=>AP,createLup:()=>p_,numericDependencies:()=>Du,createRe:()=>sg,equalDependencies:()=>bH,createSecondRadiation:()=>nv,fix:()=>gS,createParserClass:()=>xo,forEachTransformDependencies:()=>wk,createNullish:()=>c0,minTransformDependencies:()=>AR,kldivergenceDependencies:()=>Ae,createInfinity:()=>rE,xgcd:()=>hn,intersect:()=>go,FractionDependencies:()=>bq,number:()=>mA,typedDependencies:()=>bI,createCumSumTransform:()=>xz,createMolarMass:()=>nD,isBlockNode:()=>Z,createSort:()=>pJ,nullish:()=>hj,createComplex:()=>a7,createLog:()=>lW,createSqueeze:()=>uy,log:()=>gc,argDependencies:()=>b5,equalTextDependencies:()=>wv,getMatrixDataTypeDependencies:()=>D6,fermiCouplingDependencies:()=>wS,isAssignmentNode:()=>G,divide:()=>gL,boolean:()=>d2,isObjectWrappingMap:()=>U,zpk2tf:()=>gN,createProtonMass:()=>ne,unitDependencies:()=>Sa,createFirstRadiation:()=>nf,sin:()=>mO,complexDependencies:()=>Nw,solveODE:()=>g5,zeta:()=>y_,createConcatTransform:()=>xP,avogadro:()=>yz,columnDependencies:()=>Nn,createMinTransform:()=>x$,dotDivideDependencies:()=>N9,ceil:()=>gw,createUnitFunction:()=>dt,isUndefined:()=>L,createCreateUnit:()=>fz,createHex:()=>oB,lsolveAll:()=>gl,createCount:()=>cm,norm:()=>yx,createLsolveAll:()=>lQ,createImmutableDenseMatrixClass:()=>lR,permutations:()=>yb,range:()=>g0,createCatalan:()=>lg,UnitDependencies:()=>DM,createPlanckCharge:()=>nC,ComplexDependencies:()=>bO,efimovFactorDependencies:()=>wn,filter:()=>ma,isIndex:()=>T,isResultSet:()=>O,log1p:()=>gF,logDependencies:()=>w9,bernoulliDependencies:()=>DR,addScalar:()=>dW,smallerDependencies:()=>D5,createMap:()=>o2,DenseMatrix:()=>dI,compileDependencies:()=>NN,atan2Dependencies:()=>Dn,createAcot:()=>aN,Node:()=>x6,asin:()=>ho,createIfft:()=>ft,createMolarPlanckConstant:()=>nh,createXgcd:()=>uN,isNaN:()=>md,isPrimeDependencies:()=>w6,planckCharge:()=>yG,createCoulomb:()=>rJ,polynomialRootDependencies:()=>Eo,stdDependencies:()=>E0,sumDependencies:()=>NB,gammaDependencies:()=>D_,LOG10E:()=>dA,createNumber:()=>sr,matrixFromFunctionDependencies:()=>AO,createFilter:()=>ob,planckTemperatureDependencies:()=>Ei,createVersion:()=>rU,createForEach:()=>oE,i:()=>dD,createPolynomialRoot:()=>ff,leftShiftDependencies:()=>Ac,AssignmentNodeDependencies:()=>Dt,maxDependencies:()=>Az,createUppercaseE:()=>rP,isNull:()=>j,gcd:()=>hO,createTrue:()=>rN,bellNumbers:()=>yY,fineStructureDependencies:()=>wz,createCbrt:()=>cl,SpaDependencies:()=>Ag,createLargerEq:()=>lG,speedOfLight:()=>yF,createPartitionSelect:()=>l3,compareDependencies:()=>No,createFormat:()=>oM,pinvDependencies:()=>A9,Parser:()=>bA,quantumOfCirculationDependencies:()=>Ef,multiplyDependencies:()=>DN,magneticConstant:()=>yL,isDate:()=>q,tanh:()=>ht,createAtan:()=>aB,cloneDependencies:()=>D4,meanTransformDependencies:()=>AI,reviverDependencies:()=>Eb,createSin:()=>sb,lcm:()=>hq,createBoolean:()=>a0,molarVolumeDependencies:()=>AH,identityDependencies:()=>Dy,InfinityDependencies:()=>wY,quantileSeq:()=>gK,rotate:()=>y3,roundDependencies:()=>Dl,createIsPrime:()=>oL,partitionSelectDependencies:()=>AA,squareDependencies:()=>EX,createIsNaN:()=>oR,round:()=>hN,std:()=>yJ,createMax:()=>cQ,equal:()=>hp,weakMixingAngle:()=>dH,Unit:()=>g8,asecDependencies:()=>b6,isRelationalNode:()=>ei,isIntegerDependencies:()=>b$,largerEq:()=>gu,MatrixDependencies:()=>b_,createRow:()=>fy,createIsNumeric:()=>oU,sqrtm:()=>gP,createTyped:()=>iz,asechDependencies:()=>b7,createThomsonCrossSection:()=>na,tau:()=>d_,ConstantNodeDependencies:()=>Np,deuteronMass:()=>ya,isObject:()=>k,createSign:()=>sx,booleanDependencies:()=>DY,smaller:()=>hG,createRydberg:()=>ni,acschDependencies:()=>b1,createReviver:()=>vq,createDenseMatrixClass:()=>iB,createDerivative:()=>xh,planckLength:()=>y2,SymbolNode:()=>bm,phiDependencies:()=>A8,ObjectNode:()=>x7,createIsPositive:()=>ck,createPrintTransform:()=>xk,bitAndDependencies:()=>Dj,createKlitzing:()=>r3,abs:()=>d$,createCombinationsWithRep:()=>sG,createSimplify:()=>xp,createChain:()=>vU,createDiff:()=>lM,isFunctionAssignmentNode:()=>Q,xgcdDependencies:()=>w2,createEqualScalar:()=>ol,LN10Dependencies:()=>An,createSetCartesian:()=>pR,isCollection:()=>S,createPlanckLength:()=>nA,fineStructure:()=>dx,classicalElectronRadiusDependencies:()=>D3,createRotate:()=>da,planckMassDependencies:()=>En,simplifyConstantDependencies:()=>N0,createNuclearMagneton:()=>r2,createHypot:()=>lk,isConstantNode:()=>W,lupDependencies:()=>Ay,composition:()=>h5,createMedian:()=>fl,cbrtDependencies:()=>D0,createNumeric:()=>u5,protonMass:()=>vt,isPrime:()=>mh,createUsolveAll:()=>pm,bitOr:()=>h0,modDependencies:()=>w1,cbrt:()=>hE,splitUnit:()=>mq,square:()=>mI,createZeros:()=>uA,createOr:()=>c1,combinationsWithRepDependencies:()=>Na,createLog10:()=>oK,expmDependencies:()=>wN,median:()=>gX,magneticFluxQuantumDependencies:()=>AM,IndexNode:()=>bp,createCos:()=>or,lsolve:()=>hk,Fraction:()=>db,ParserDependencies:()=>A3,createSymbolNode:()=>vX,cubeDependencies:()=>NV,createMod:()=>cM,dotMultiply:()=>hT,isObjectNode:()=>ee,reDependencies:()=>wc,createSetDistinct:()=>pU,usolveAll:()=>gD,re:()=>mF,isPositiveDependencies:()=>D9,randomDependencies:()=>Ed,createXor:()=>la,sortDependencies:()=>EZ,PIDependencies:()=>Ss,createMatrixFromColumns:()=>u2,gcdDependencies:()=>wU,secondRadiation:()=>yC,SparseMatrix:()=>mz,createExpm:()=>p4,sparseDependencies:()=>EV,usolveAllDependencies:()=>wd,createCompare:()=>lv,createKldivergence:()=>fn,LN2:()=>dR,createElectronMass:()=>r8,simplifyDependencies:()=>N2,largerEqDependencies:()=>Ne,freqzDependencies:()=>wR,createResize:()=>uu,createSetDifference:()=>fx,createLog1p:()=>pO,createQr:()=>c2,createUnequal:()=>pK,unaryPlus:()=>hW,createQuantileSeqTransform:()=>xY,dotPowDependencies:()=>wt,cosDependencies:()=>N_,atanhDependencies:()=>Di,createLsolve:()=>cJ,isNumericDependencies:()=>Dh,minDependencies:()=>Ak,combinationsDependencies:()=>DO,isPartitionedMap:()=>P,cumsumTransformDependencies:()=>NQ,createAssignmentNode:()=>vQ,createIntersect:()=>lj,planckLengthDependencies:()=>Er,molarPlanckConstant:()=>yy,setIsSubset:()=>gq,createElementaryCharge:()=>rX,createRangeTransform:()=>xK,isArray:()=>A,cos:()=>d6,tauDependencies:()=>wF,createSetMultiplicity:()=>fD,hartreeEnergyDependencies:()=>wH,createRound:()=>cn,createSchur:()=>dl,createIsInteger:()=>uJ,avogadroDependencies:()=>DT,bitOrDependencies:()=>D$,combinationsWithRep:()=>mZ,createMin:()=>lK,createCoulombConstant:()=>rQ,expDependencies:()=>wD,help:()=>bF,isFinite:()=>mX,normDependencies:()=>Ab,simplify:()=>bS,typeOf:()=>mj,mode:()=>mD,trueDependencies:()=>Sn,e:()=>dy,speedOfLightDependencies:()=>EW,random:()=>mM,wienDisplacement:()=>y5,diagDependencies:()=>N5,fixDependencies:()=>Dd,createBernoulli:()=>cs,concatTransformDependencies:()=>NE,gravity:()=>yp,rangeDependencies:()=>Nr,bignumberDependencies:()=>Da,bitXorDependencies:()=>DZ,conj:()=>d8,createAcsch:()=>sU,createDotMultiply:()=>cN,createAcosh:()=>sR,isChain:()=>eo,createIsBounded:()=>oz,createConcat:()=>cf,faradayDependencies:()=>wE,isFunction:()=>z,createEqual:()=>uH,createNaN:()=>rS,ResultSet:()=>dT,eigs:()=>yo,createInvmod:()=>lH,randomIntDependencies:()=>Em,ParenthesisNode:()=>be,bin:()=>hs,FunctionAssignmentNodeDependencies:()=>Nf,freqz:()=>gG,setSymDifferenceDependencies:()=>EL,createUnaryPlus:()=>lr,xorDependencies:()=>Sd,atomicMassDependencies:()=>DF,createAtomicMass:()=>nu,createAsin:()=>uM,arg:()=>dJ,klitzing:()=>yf,RangeNodeDependencies:()=>Nx,createAsinh:()=>aT,createBellNumbers:()=>dn,gamma:()=>gZ,stdTransformDependencies:()=>E1,isRangeNode:()=>en,acosh:()=>mL,createIsZero:()=>s5,factory:()=>tP,multinomial:()=>yv,createCoth:()=>uB,cumsum:()=>gE,replacerDependencies:()=>NY,usolve:()=>hJ,isRegExp:()=>I,cross:()=>h8,createSetPowerset:()=>p$,createSqrtm:()=>pX,hartreeEnergy:()=>yU,isFiniteDependencies:()=>w5,min:()=>gf,createNeutronMass:()=>nr,diff:()=>h7,createForEachTransform:()=>xF,divideScalarDependencies:()=>Dc,molarPlanckConstantDependencies:()=>AL,bernoulli:()=>hA,thomsonCrossSection:()=>yB,createSQRT1_2:()=>rq,wienDisplacementDependencies:()=>Sf,andDependencies:()=>b3,createSquare:()=>sC,print:()=>mC,ctransposeDependencies:()=>NZ,lup:()=>gT,Chain:()=>bs,createMultiply:()=>un,createSpaClass:()=>pi,createColumnTransform:()=>x0,Matrix:()=>dE,cschDependencies:()=>N$,createLOG2E:()=>r_,createLoschmidt:()=>nd,createPickRandom:()=>su,toBest:()=>mU,createBigNumberClass:()=>tL,rydberg:()=>yS,chainDependencies:()=>D2,ifftDependencies:()=>wJ,createString:()=>sF,isRange:()=>F,magneticFluxQuantum:()=>yh,pickRandom:()=>mS,squeeze:()=>he,cscDependencies:()=>NH,bitXor:()=>h1,and:()=>gj,fftDependencies:()=>wT,createObjectNode:()=>vs,invmod:()=>gs,index:()=>gC,firstRadiation:()=>y0,multinomialDependencies:()=>A$,BlockNode:()=>bn,createTanh:()=>uv,subtractScalarDependencies:()=>Dw,stefanBoltzmannDependencies:()=>E2,createUnitDependencies:()=>Nj,createSimplifyConstant:()=>v8,createPlanckMass:()=>nE,divideScalar:()=>hF,floorDependencies:()=>Df,simplifyCoreDependencies:()=>N1,mapSlices:()=>hg,lsolveDependencies:()=>Am,createTau:()=>rM,NodeDependencies:()=>bR,createParse:()=>v1,expm:()=>gH,molarVolume:()=>y6,sinh:()=>m6,createCross:()=>lE,factorialDependencies:()=>Dz,weakMixingAngleDependencies:()=>Sp,createCeil:()=>pb,createParser:()=>xu,createConductanceQuantum:()=>rK,apply:()=>hy,cothDependencies:()=>NI,createCube:()=>oo,getMatrixDataType:()=>mc,addDependencies:()=>bZ,evaluateDependencies:()=>wb,absDependencies:()=>bk,createFalse:()=>rw,exp:()=>mn,createVarianceTransform:()=>xQ,createMolarVolume:()=>ng,createDiffTransform:()=>xL,lcmDependencies:()=>As,electricConstantDependencies:()=>wh,createMultinomial:()=>fU,coulombConstant:()=>y9,createAsec:()=>sL,divideDependencies:()=>NC,gasConstant:()=>yl,sluDependencies:()=>Av,DenseMatrixDependencies:()=>bz,createBigint:()=>az,invDependencies:()=>DS,createColumn:()=>fO,createCumSum:()=>pE,compare:()=>h3,createIndexClass:()=>lP,createChainClass:()=>vI,createInv:()=>pT,createTranspose:()=>ub,nullDependencies:()=>AQ,elementaryCharge:()=>yR,expm1Dependencies:()=>ww,formatDependencies:()=>Dm,setCartesianDependencies:()=>Ez,count:()=>hC,createLarger:()=>cP,isString:()=>w,isAccessorNode:()=>H,hasNumericValueDependencies:()=>w$,createSparseMatrixClass:()=>sw,nthRoots:()=>gd,catalanDependencies:()=>DK,createSumTransform:()=>xW,setPowersetDependencies:()=>EU,planckMass:()=>yN,simplifyCore:()=>bD,Range:()=>dF,andTransformDependencies:()=>b4,cot:()=>d7,isFraction:()=>D,prodDependencies:()=>NP,NaNDependencies:()=>AG,createCombinations:()=>a8,log2Dependencies:()=>wM,createLgamma:()=>oJ,gravitationConstant:()=>ve,add:()=>hX,createCorr:()=>f2,createGcd:()=>cq,createArg:()=>aC,acos:()=>dG,log10:()=>mv,mapDependencies:()=>w4,nuclearMagneton:()=>y1,lusolveDependencies:()=>Ax,multiply:()=>m2,concat:()=>hS,createSlu:()=>pn,createMean:()=>fu,reducedPlanckConstant:()=>yA,createSQRT2:()=>rI,onesDependencies:()=>A0,createDivide:()=>p2,isOperatorNode:()=>et,setDistinct:()=>gz,FunctionNode:()=>bh,createEvaluate:()=>xi,elementaryChargeDependencies:()=>wy,FunctionNodeDependencies:()=>Nm,createReplacer:()=>iO,createSubtractScalar:()=>sB,createVacuumImpedance:()=>rW,bohrRadiusDependencies:()=>DQ,iDependencies:()=>wC,fraction:()=>hf,isUnit:()=>N,not:()=>mw,log2:()=>mx,createIsNegative:()=>s3,ParenthesisNodeDependencies:()=>Nv,createLN10:()=>rO,createSolveODE:()=>fC,ConstantNode:()=>bl,createExpm1:()=>ox,inv:()=>gM,subsetTransformDependencies:()=>E4,createLcm:()=>cL,createSetIsSubset:()=>pL,createLog2:()=>o1,createE:()=>rF,createI:()=>rk,createUnaryMinus:()=>ca,rightArithShiftDependencies:()=>ED});var n={};function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}r.r(n),r.d(n,{createAbs:()=>an,createAccessorNode:()=>vW,createAcos:()=>aa,createAcosh:()=>sR,createAcot:()=>aN,createAcoth:()=>uS,createAcsc:()=>aA,createAcsch:()=>sU,createAdd:()=>lo,createAddScalar:()=>aS,createAnd:()=>p1,createAndTransform:()=>xO,createArg:()=>aC,createArrayNode:()=>vM,createAsec:()=>sL,createAsech:()=>aF,createAsin:()=>uM,createAsinh:()=>aT,createAssignmentNode:()=>vQ,createAtan:()=>aB,createAtan2:()=>lu,createAtanh:()=>a_,createAtomicMass:()=>nu,createAvogadro:()=>nc,createBellNumbers:()=>dn,createBernoulli:()=>cs,createBigNumberClass:()=>tL,createBigint:()=>az,createBignumber:()=>sH,createBin:()=>uF,createBitAnd:()=>ll,createBitAndTransform:()=>xR,createBitNot:()=>aY,createBitOr:()=>lf,createBitOrTransform:()=>xV,createBitXor:()=>lm,createBlockNode:()=>vT,createBohrMagneton:()=>rY,createBohrRadius:()=>r4,createBoltzmann:()=>nl,createBoolean:()=>a0,createCatalan:()=>lg,createCbrt:()=>cl,createCeil:()=>pb,createChain:()=>vU,createChainClass:()=>vI,createClassicalElectronRadius:()=>r5,createClone:()=>a2,createColumn:()=>fO,createColumnTransform:()=>x0,createCombinations:()=>a8,createCombinationsWithRep:()=>sG,createCompare:()=>lv,createCompareNatural:()=>pw,createCompareText:()=>lD,createCompile:()=>v7,createComplex:()=>a7,createComplexClass:()=>rf,createComposition:()=>lw,createConcat:()=>cf,createConcatTransform:()=>xP,createConditionalNode:()=>vO,createConductanceQuantum:()=>rK,createConj:()=>oe,createConstantNode:()=>vL,createCorr:()=>f2,createCos:()=>or,createCosh:()=>sW,createCot:()=>on,createCoth:()=>uB,createCoulomb:()=>rJ,createCoulombConstant:()=>rQ,createCount:()=>cm,createCreateUnit:()=>fz,createCross:()=>lE,createCsc:()=>oi,createCsch:()=>sQ,createCtranspose:()=>u_,createCube:()=>oo,createCumSum:()=>pE,createCumSumTransform:()=>xz,createDeepEqual:()=>cg,createDenseMatrixClass:()=>iB,createDerivative:()=>xh,createDet:()=>lS,createDeuteronMass:()=>nt,createDiag:()=>uq,createDiff:()=>lM,createDiffTransform:()=>xL,createDistance:()=>lT,createDivide:()=>p2,createDivideScalar:()=>cv,createDot:()=>sX,createDotDivide:()=>lO,createDotMultiply:()=>cN,createDotPow:()=>f4,createE:()=>rF,createEfimovFactor:()=>ns,createEigs:()=>fq,createElectricConstant:()=>rV,createElectronMass:()=>r8,createElementaryCharge:()=>rX,createEqual:()=>uH,createEqualScalar:()=>ol,createEqualText:()=>lz,createErf:()=>op,createEvaluate:()=>xi,createExp:()=>oy,createExpm:()=>p4,createExpm1:()=>ox,createFactorial:()=>fk,createFalse:()=>rw,createFaraday:()=>np,createFermiCoupling:()=>r6,createFft:()=>p5,createFibonacciHeapClass:()=>lq,createFilter:()=>ob,createFilterTransform:()=>xM,createFineStructure:()=>r7,createFirstRadiation:()=>nf,createFix:()=>pC,createFlatten:()=>ow,createFloor:()=>cS,createForEach:()=>oE,createForEachTransform:()=>xF,createFormat:()=>oM,createFraction:()=>uG,createFractionClass:()=>nJ,createFreqz:()=>p6,createFunctionAssignmentNode:()=>vR,createFunctionNode:()=>vK,createGamma:()=>p9,createGasConstant:()=>nm,createGcd:()=>cq,createGetMatrixDataType:()=>oT,createGravitationConstant:()=>rH,createGravity:()=>nw,createHartreeEnergy:()=>r9,createHasNumericValue:()=>sK,createHelp:()=>xb,createHelpClass:()=>xa,createHex:()=>oB,createHypot:()=>lk,createI:()=>rk,createIdentity:()=>uV,createIfft:()=>ft,createIm:()=>oO,createImmutableDenseMatrixClass:()=>lR,createIndex:()=>pF,createIndexClass:()=>lP,createIndexNode:()=>v$,createIndexTransform:()=>xX,createInfinity:()=>rE,createIntersect:()=>lj,createInv:()=>pT,createInverseConductanceQuantum:()=>r0,createInvmod:()=>lH,createIsBounded:()=>oz,createIsFinite:()=>s1,createIsInteger:()=>uJ,createIsNaN:()=>oR,createIsNegative:()=>s3,createIsNumeric:()=>oU,createIsPositive:()=>ck,createIsPrime:()=>oL,createIsZero:()=>s5,createKldivergence:()=>fn,createKlitzing:()=>r3,createKron:()=>uX,createLN10:()=>rO,createLN2:()=>rB,createLOG10E:()=>rz,createLOG2E:()=>r_,createLarger:()=>cP,createLargerEq:()=>lG,createLcm:()=>cL,createLeafCount:()=>xe,createLeftShift:()=>cZ,createLgamma:()=>oJ,createLog:()=>lW,createLog10:()=>oK,createLog1p:()=>pO,createLog2:()=>o1,createLoschmidt:()=>nd,createLsolve:()=>cJ,createLsolveAll:()=>lQ,createLup:()=>p_,createLusolve:()=>fo,createLyap:()=>dm,createMad:()=>fR,createMagneticConstant:()=>rZ,createMagneticFluxQuantum:()=>r1,createMap:()=>o2,createMapSlices:()=>uK,createMapSlicesTransform:()=>xB,createMapTransform:()=>xC,createMatrix:()=>s6,createMatrixClass:()=>nQ,createMatrixFromColumns:()=>u2,createMatrixFromFunction:()=>s9,createMatrixFromRows:()=>lY,createMax:()=>cQ,createMaxTransform:()=>xH,createMean:()=>fu,createMeanTransform:()=>x2,createMedian:()=>fl,createMin:()=>lK,createMinTransform:()=>x$,createMod:()=>cM,createMode:()=>o4,createMolarMass:()=>nD,createMolarMassC12:()=>nN,createMolarPlanckConstant:()=>nh,createMolarVolume:()=>ng,createMultinomial:()=>fU,createMultiply:()=>un,createMultiplyScalar:()=>o5,createNaN:()=>rS,createNeutronMass:()=>nr,createNode:()=>va,createNorm:()=>fL,createNot:()=>st,createNthRoot:()=>cY,createNthRoots:()=>l1,createNuclearMagneton:()=>r2,createNull:()=>rA,createNullish:()=>c0,createNullishTransform:()=>xq,createNumber:()=>sr,createNumeric:()=>u5,createObjectNode:()=>vs,createOct:()=>sn,createOnes:()=>ui,createOperatorNode:()=>vN,createOr:()=>c1,createOrTransform:()=>xG,createParenthesisNode:()=>vA,createParse:()=>v1,createParser:()=>xu,createParserClass:()=>xo,createPartitionSelect:()=>l3,createPermutations:()=>f$,createPhi:()=>rT,createPi:()=>rC,createPickRandom:()=>su,createPinv:()=>pq,createPlanckCharge:()=>nC,createPlanckConstant:()=>r$,createPlanckLength:()=>nA,createPlanckMass:()=>nE,createPlanckTemperature:()=>nM,createPlanckTime:()=>nS,createPolynomialRoot:()=>ff,createPow:()=>pI,createPrint:()=>sp,createPrintTransform:()=>xk,createProd:()=>u7,createProtonMass:()=>ne,createQr:()=>c2,createQuantileSeq:()=>fm,createQuantileSeqTransform:()=>xY,createQuantumOfCirculation:()=>nn,createRandom:()=>sh,createRandomInt:()=>uo,createRange:()=>fg,createRangeClass:()=>nX,createRangeNode:()=>vz,createRangeTransform:()=>xK,createRationalize:()=>xN,createRe:()=>sg,createReducedPlanckConstant:()=>rG,createRelationalNode:()=>vS,createReplacer:()=>iO,createReshape:()=>ce,createResize:()=>uu,createResolve:()=>v2,createResultSet:()=>nY,createReviver:()=>vq,createRightArithShift:()=>c4,createRightLogShift:()=>l5,createRotate:()=>da,createRotationMatrix:()=>fV,createRound:()=>cn,createRow:()=>fy,createRowTransform:()=>x1,createRydberg:()=>ni,createSQRT1_2:()=>rq,createSQRT2:()=>rI,createSackurTetrode:()=>ny,createSchur:()=>dl,createSec:()=>sy,createSech:()=>ul,createSecondRadiation:()=>nv,createSetCartesian:()=>pR,createSetDifference:()=>fx,createSetDistinct:()=>pU,createSetIntersect:()=>f8,createSetIsSubset:()=>pL,createSetMultiplicity:()=>fD,createSetPowerset:()=>p$,createSetSize:()=>fJ,createSetSymDifference:()=>fw,createSetUnion:()=>du,createSign:()=>sx,createSimplify:()=>xp,createSimplifyConstant:()=>v8,createSimplifyCore:()=>xr,createSin:()=>sb,createSinh:()=>uf,createSize:()=>sN,createSlu:()=>pn,createSmaller:()=>c8,createSmallerEq:()=>pZ,createSolveODE:()=>fC,createSort:()=>pJ,createSpaClass:()=>pi,createSparse:()=>um,createSparseMatrixClass:()=>sw,createSpeedOfLight:()=>rL,createSplitUnit:()=>sE,createSqrt:()=>uh,createSqrtm:()=>pX,createSquare:()=>sC,createSqueeze:()=>uy,createStd:()=>f6,createStdTransform:()=>x3,createStefanBoltzmann:()=>nx,createStirlingS2:()=>f9,createString:()=>sF,createSubset:()=>po,createSubsetTransform:()=>xZ,createSubtract:()=>c9,createSubtractScalar:()=>sB,createSum:()=>pp,createSumTransform:()=>xW,createSylvester:()=>df,createSymbolNode:()=>vX,createSymbolicEqual:()=>xd,createTan:()=>sO,createTanh:()=>uv,createTau:()=>rM,createThomsonCrossSection:()=>na,createTo:()=>le,createToBest:()=>sz,createTrace:()=>pf,createTranspose:()=>ub,createTrue:()=>rN,createTypeOf:()=>sI,createTyped:()=>iz,createUnaryMinus:()=>ca,createUnaryPlus:()=>lr,createUnequal:()=>pK,createUnitClass:()=>fT,createUnitFunction:()=>dt,createUppercaseE:()=>rP,createUppercasePi:()=>rR,createUsolve:()=>li,createUsolveAll:()=>pm,createVacuumImpedance:()=>rW,createVariance:()=>fY,createVarianceTransform:()=>xQ,createVersion:()=>rU,createWeakMixingAngle:()=>no,createWienDisplacement:()=>nb,createXgcd:()=>uN,createXor:()=>la,createZeros:()=>uA,createZeta:()=>f0,createZpk2tf:()=>pg});var a={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null,legacySubset:!1};function o(e,t){if(u(e,t))return e[t];if("function"==typeof e[t]&&c(e,t))throw Error('Cannot access method "'+t+'" as a property');throw Error('No access to property "'+t+'"')}function s(e,t,r){if(u(e,t))return e[t]=r,r;throw Error('No access to property "'+t+'"')}function u(e,t){var r;return(!!("object"==typeof(r=e)&&r&&r.constructor===Object)||!!Array.isArray(e))&&(!!ef(l,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function c(e,t){return!(null==e||"function"!=typeof e[t]||ef(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!ef(p,t)||!(t in Object.prototype)&&!(t in Function.prototype))}var l={length:!0,name:!0},p={toString:!0,valueOf:!0,toLocaleString:!0};class f{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return o(this.wrappedObject,e)}set(e,t){return s(this.wrappedObject,e,t),this}has(e){return u(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return m(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){u(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class d{constructor(e,t,r){this.a=e,this.b=t,this.bKeys=r,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,t){return this.bKeys.has(e)?this.b.set(e,t):this.a.set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return m(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function m(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function h(){return new Map}function g(e){if(!e)return h();if(R(e))return e;if(k(e))return new f(e);throw Error("createMap can create maps from objects or Maps")}function y(e){return"number"==typeof e}function v(e){return!!e&&"object"==typeof e&&"function"==typeof e.constructor&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function x(e){return"bigint"==typeof e}function b(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function D(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function N(e){return e&&!0===e.constructor.prototype.isUnit||!1}function w(e){return"string"==typeof e}var A=Array.isArray;function E(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function S(e){return Array.isArray(e)||E(e)}function C(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function M(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function F(e){return e&&!0===e.constructor.prototype.isRange||!1}function T(e){return e&&!0===e.constructor.prototype.isIndex||!1}function B(e){return"boolean"==typeof e}function O(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function _(e){return e&&!0===e.constructor.prototype.isHelp||!1}function z(e){return"function"==typeof e}function q(e){return e instanceof Date}function I(e){return e instanceof RegExp}function k(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!b(e)&&!D(e))}function R(e){return!!e&&(e instanceof Map||e instanceof f||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function P(e){return R(e)&&R(e.a)&&R(e.b)}function U(e){return R(e)&&k(e.wrappedObject)}function j(e){return null===e}function L(e){return void 0===e}function H(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function G(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function Z(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function V(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function W(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function J(e){return W(e)||et(e)&&1===e.args.length&&W(e.args[0])&&"-+~".includes(e.op)}function Q(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function X(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function Y(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function K(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function ee(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function et(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function er(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function en(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function ei(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function ea(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function eo(e){return e&&!0===e.constructor.prototype.isChain||!1}function es(e){var t=typeof e;return"object"===t?null===e?"null":v(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function eu(e){var t=typeof e;if("number"===t||"bigint"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(function(e){return eu(e)});if(e instanceof Date)return new Date(e.valueOf());if(v(e))return e;if(k(e)){var r=e,n=eu,i={};for(var a in r)ef(r,a)&&(i[a]=n(r[a]));return i}if("function"===t)return e;throw TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function ec(e,t){for(var r in t)ef(t,r)&&(e[r]=t[r]);return e}function el(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!el(e[n],t[n]))return!1;return!0}if("function"==typeof e)return e===t;if(!(e instanceof Object))return e===t;if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!el(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}function ep(e,t,r){var n,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(n=r(),i=!1),n},set:function(e){n=e,i=!1},configurable:!0,enumerable:!0})}function ef(e,t){return e&&Object.hasOwnProperty.call(e,t)}var ed=["Matrix","Array"],em=["number","BigNumber","bigint","Fraction"];function eh(e,t,r){void 0===e[t]||r.includes(e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(e=>JSON.stringify(e)).join(", ")+".")}var eg=function(e){if(e)throw Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n import { create, all } from 'mathjs';\n const mathjs = create(all);\n mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(a)};i(eg,a,{MATRIX_OPTIONS:ed,NUMBER_OPTIONS:em});var ey,ev,ex="0123456789abcdef",eb="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",eD="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",eN={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},ew=!0,eA="[DecimalError] ",eE=eA+"Invalid argument: ",eS=eA+"Precision limit exceeded",eC=eA+"crypto unavailable",eM="[object Decimal]",eF=Math.floor,eT=Math.pow,eB=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,eO=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,e_=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ez=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,eq=eb.length-1,eI=eD.length-1,ek={toStringTag:eM};function eR(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(a+=eJ(r)),a+=n;(r=7-(n=(o=e[t])+"").length)&&(a+=eJ(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return a+o}function eP(e,t,r){if(e!==~~e||e<t||e>r)throw Error(eE+e)}function eU(e,t,r,n){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),a=eT(10,7-t),s=e[i]%a|0,null==n?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),o=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):o=(r<4&&s+1==a||r>3&&s+1==a/2)&&(e[i+1]/a/100|0)==eT(10,t-2)-1||(s==a/2||0==s)&&(e[i+1]/a/100|0)==0:t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),o=(n||r<4)&&9999==s||!n&&r>3&&4999==s):o=((n||r<4)&&s+1==a||!n&&r>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==eT(10,t-3)-1,o}function ej(e,t,r){for(var n,i,a=[0],o=0,s=e.length;o<s;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=ex.indexOf(e.charAt(o++)),n=0;n<a.length;n++)a[n]>r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}ek.absoluteValue=ek.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),eH(e)},ek.ceil=function(){return eH(new this.constructor(this),this.e+1,2)},ek.clampedTo=ek.clamp=function(e,t){var r=this.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(eE+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new r(this)},ek.comparedTo=ek.cmp=function(e){var t,r,n,i,a=this.d,o=(e=new this.constructor(e)).d,s=this.s,u=e.s;if(!a||!o)return s&&u?s!==u?s:a===o?0:!a^s<0?1:-1:NaN;if(!a[0]||!o[0])return a[0]?s:o[0]?-u:0;if(s!==u)return s;if(this.e!==e.e)return this.e>e.e^s<0?1:-1;for(t=0,r=(n=a.length)<(i=o.length)?n:i;t<r;++t)if(a[t]!==o[t])return a[t]>o[t]^s<0?1:-1;return n===i?0:n>i^s<0?1:-1},ek.cosine=ek.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/e4(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=e3(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,e5(n,r)),n.precision=e,n.rounding=t,eH(2==ev||3==ev?r.neg():r,e,t,!0)):new n(1):new n(NaN)},ek.cubeRoot=ek.cbrt=function(){var e,t,r,n,i,a,o,s,u,c,l=this.constructor;if(!this.isFinite()||this.isZero())return new l(this);for(ew=!1,(a=this.s*eT(this.s*this,1/3))&&Math.abs(a)!=1/0?n=new l(a.toString()):(r=eR(this.d),(a=((e=this.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=eT(r,1/3),e=eF((e+1)/3)-(e%3==(e<0?-1:2)),(n=new l(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=this.s),o=(e=l.precision)+3;;)if(n=eL((c=(u=(s=n).times(s).times(s)).plus(this)).plus(this).times(s),c.plus(u),o+2,1),eR(s.d).slice(0,o)===(r=eR(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(eH(n,e+1,1),t=!n.times(n).times(n).eq(this));break}if(!i&&(eH(s,e+1,0),s.times(s).times(s).eq(this))){n=s;break}o+=4,i=1}return ew=!0,eH(n,e,l.rounding,t)},ek.decimalPlaces=ek.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-eF(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},ek.dividedBy=ek.div=function(e){return eL(this,new this.constructor(e))},ek.dividedToIntegerBy=ek.divToInt=function(e){var t=this.constructor;return eH(eL(this,new t(e),0,1,1),t.precision,t.rounding)},ek.equals=ek.eq=function(e){return 0===this.cmp(e)},ek.floor=function(){return eH(new this.constructor(this),this.e+1,3)},ek.greaterThan=ek.gt=function(e){return this.cmp(e)>0},ek.greaterThanOrEqualTo=ek.gte=function(e){var t=this.cmp(e);return 1==t||0===t},ek.hyperbolicCosine=ek.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/e4(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=e3(o,1,a.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=a.times(a),a=s.minus(u.times(l.minus(u.times(l))));return eH(a,o.precision=r,o.rounding=n,!0)},ek.hyperbolicSine=ek.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(n=i.d.length)<3)i=e3(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=e3(a,2,i=i.times(1/e4(5,e)),i,!0);for(var o,s=new a(5),u=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(u.times(o).plus(c))))}return a.precision=t,a.rounding=r,eH(i,t,r,!0)},ek.hyperbolicTangent=ek.tanh=function(){var e,t,r=this.constructor;return this.isFinite()?this.isZero()?new r(this):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,eL(this.sinh(),this.cosh(),r.precision=e,r.rounding=t)):new r(this.s)},ek.inverseCosine=ek.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return -1!==n?0===n?t.isNeg()?eV(r,i,a):new r(0):new r(NaN):t.isZero()?eV(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=eV(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))},ek.inverseHyperbolicCosine=ek.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,ew=!1,r=r.times(r).minus(1).sqrt().plus(r),ew=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},ek.inverseHyperbolicSine=ek.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,ew=!1,r=r.times(r).plus(1).sqrt().plus(r),ew=!0,n.precision=e,n.rounding=t,r.ln())},ek.inverseHyperbolicTangent=ek.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,Math.max(n=i.sd(),e)<-(2*i.e)-1)?eH(new a(i),e,t,!0):(a.precision=r=n-i.e,i=eL(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5)):new a(NaN)},ek.inverseSine=ek.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,-1!==t)?0===t?((e=eV(a,r+4,n).times(.5)).s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2))},ek.inverseTangent=ek.atan=function(){var e,t,r,n,i,a,o,s,u,c=this,l=c.constructor,p=l.precision,f=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);else if(c.abs().eq(1)&&p+4<=eI)return(o=eV(l,p+4,f).times(.25)).s=c.s,o}else{if(!c.s)return new l(NaN);if(p+4<=eI)return(o=eV(l,p+4,f).times(.5)).s=c.s,o}for(l.precision=s=p+10,l.rounding=1,e=r=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(ew=!1,t=Math.ceil(s/7),n=1,u=c.times(c),o=new l(c),i=c;-1!==e;)if(i=i.times(u),a=o.minus(i.div(n+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),ew=!0,eH(o,l.precision=p,l.rounding=f,!0)},ek.isFinite=function(){return!!this.d},ek.isInteger=ek.isInt=function(){return!!this.d&&eF(this.e/7)>this.d.length-2},ek.isNaN=function(){return!this.s},ek.isNegative=ek.isNeg=function(){return this.s<0},ek.isPositive=ek.isPos=function(){return this.s>0},ek.isZero=function(){return!!this.d&&0===this.d[0]},ek.lessThan=ek.lt=function(e){return 0>this.cmp(e)},ek.lessThanOrEqualTo=ek.lte=function(e){return 1>this.cmp(e)},ek.logarithm=ek.log=function(e){var t,r,n,i,a,o,s,u=this.constructor,c=u.precision,l=u.rounding;if(null==e)e=new u(10),t=!0;else{if(r=(e=new u(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new u(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(n=r[0];n%10==0;)n/=10;i=1!==n}if(ew=!1,eU((s=eL(a=e0(this,o=c+5),t?eZ(u,o+10):e0(e,o),o,1)).d,n=c,l))do if(o+=10,s=eL(a=e0(this,o),t?eZ(u,o+10):e0(e,o),o,1),!i){+eR(s.d).slice(n+1,n+15)+1==1e14&&(s=eH(s,c+1,0));break}while(eU(s.d,n+=10,l));return ew=!0,eH(s,c,l)},ek.minus=ek.sub=function(e){var t,r,n,i,a,o,s,u,c,l,p,f,d=this.constructor;if(e=new d(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new d(e.d||this.s!==e.s?this:NaN):e=new d(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(c=this.d,f=e.d,s=d.precision,u=d.rounding,!c[0]||!f[0]){if(f[0])e.s=-e.s;else{if(!c[0])return new d(3===u?-0:0);e=new d(this)}return ew?eH(e,s,u):e}if(r=eF(e.e/7),l=eF(this.e/7),c=c.slice(),a=l-r){for((p=a<0)?(t=c,a=-a,o=f.length):(t=f,r=l,o=c.length),a>(n=Math.max(Math.ceil(s/7),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((p=(n=c.length)<(o=f.length))&&(o=n),n=0;n<o;n++)if(c[n]!=f[n]){p=c[n]<f[n];break}a=0}for(p&&(t=c,c=f,f=t,e.s=-e.s),o=c.length,n=f.length-o;n>0;--n)c[o++]=0;for(n=f.length;n>a;){if(c[--n]<f[n]){for(i=n;i&&0===c[--i];)c[i]=1e7-1;--c[i],c[n]+=1e7}c[n]-=f[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=eG(c,r),ew?eH(e,s,u):e):new d(3===u?-0:0)},ek.modulo=ek.mod=function(e){var t,r=this.constructor;return(e=new r(e),this.d&&e.s&&(!e.d||e.d[0]))?e.d&&(!this.d||this.d[0])?(ew=!1,9==r.modulo?(t=eL(this,e.abs(),0,3,1),t.s*=e.s):t=eL(this,e,0,r.modulo,1),t=t.times(e),ew=!0,this.minus(t)):eH(new r(this),r.precision,r.rounding):new r(NaN)},ek.naturalExponential=ek.exp=function(){return eK(this)},ek.naturalLogarithm=ek.ln=function(){return e0(this)},ek.negated=ek.neg=function(){var e=new this.constructor(this);return e.s=-e.s,eH(e)},ek.plus=ek.add=function(e){var t,r,n,i,a,o,s,u,c,l,p=this.constructor;if(e=new p(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new p(e.d||this.s===e.s?this:NaN)):e=new p(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(c=this.d,l=e.d,s=p.precision,u=p.rounding,!c[0]||!l[0])return l[0]||(e=new p(this)),ew?eH(e,s,u):e;if(a=eF(this.e/7),n=eF(e.e/7),c=c.slice(),i=a-n){for(i<0?(r=c,i=-i,o=l.length):(r=l,n=a,o=c.length),i>(o=(a=Math.ceil(s/7))>o?a+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=l.length)<0&&(i=o,r=l,l=c,c=r),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/1e7|0,c[i]%=1e7;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=eG(c,n),ew?eH(e,s,u):e},ek.precision=ek.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(eE+e);return this.d?(t=eW(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},ek.round=function(){var e=this.constructor;return eH(new e(this),this.e+1,e.rounding)},ek.sine=ek.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:e3(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=e3(e,2,t=t.times(1/e4(5,r)),t);for(var i,a=new e(5),o=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(n,e5(n,r)),n.precision=e,n.rounding=t,eH(ev>2?r.neg():r,e,t,!0)):new n(NaN)},ek.squareRoot=ek.sqrt=function(){var e,t,r,n,i,a,o=this.d,s=this.e,u=this.s,c=this.constructor;if(1!==u||!o||!o[0])return new c(!u||u<0&&(!o||o[0])?NaN:o?this:1/0);for(ew=!1,0==(u=Math.sqrt(+this))||u==1/0?(((t=eR(o)).length+s)%2==0&&(t+="0"),u=Math.sqrt(t),s=eF((s+1)/2)-(s<0||s%2),n=new c(t=u==1/0?"5e"+s:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new c(u.toString()),r=(s=c.precision)+3;;)if(n=(a=n).plus(eL(this,a,r+2,1)).times(.5),eR(a.d).slice(0,r)===(t=eR(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(eH(n,s+1,1),e=!n.times(n).eq(this));break}if(!i&&(eH(a,s+1,0),a.times(a).eq(this))){n=a;break}r+=4,i=1}return ew=!0,eH(n,s,c.rounding,e)},ek.tangent=ek.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=eL(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,eH(2==ev||4==ev?r.neg():r,e,t,!0)):new n(NaN)},ek.times=ek.mul=function(e){var t,r,n,i,a,o,s,u,c,l=this.constructor,p=this.d,f=(e=new l(e)).d;if(e.s*=this.s,!p||!p[0]||!f||!f[0])return new l(!e.s||p&&!p[0]&&!f||f&&!f[0]&&!p?NaN:!p||!f?e.s/0:0*e.s);for(r=eF(this.e/7)+eF(e.e/7),(u=p.length)<(c=f.length)&&(a=p,p=f,f=a,o=u,u=c,c=o),a=[],n=o=u+c;n--;)a.push(0);for(n=c;--n>=0;){for(t=0,i=u+n;i>n;)s=a[i]+f[n]*p[i-n-1]+t,a[i--]=s%1e7|0,t=s/1e7|0;a[i]=(a[i]+t)%1e7|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=eG(a,r),ew?eH(e,l.precision,l.rounding):e},ek.toBinary=function(e,t){return e8(this,2,e,t)},ek.toDecimalPlaces=ek.toDP=function(e,t){var r=this,n=r.constructor;return(r=new n(r),void 0===e)?r:(eP(e,0,1e9),void 0===t?t=n.rounding:eP(t,0,8),eH(r,e+r.e+1,t))},ek.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=e$(n,!0):(eP(e,0,1e9),void 0===t?t=i.rounding:eP(t,0,8),r=e$(n=eH(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},ek.toFixed=function(e,t){var r,n,i=this.constructor;return void 0===e?r=e$(this):(eP(e,0,1e9),void 0===t?t=i.rounding:eP(t,0,8),r=e$(n=eH(new i(this),e+this.e+1,t),!1,e+n.e+1)),this.isNeg()&&!this.isZero()?"-"+r:r},ek.toFraction=function(e){var t,r,n,i,a,o,s,u,c,l,p,f,d=this.d,m=this.constructor;if(!d)return new m(this);if(c=r=new m(1),n=u=new m(0),o=(a=(t=new m(n)).e=eW(d)-this.e-1)%7,t.d[0]=eT(10,o<0?7+o:o),null==e)e=a>0?t:c;else{if(!(s=new m(e)).isInt()||s.lt(c))throw Error(eE+s);e=s.gt(t)?a>0?t:c:s}for(ew=!1,s=new m(eR(d)),l=m.precision,m.precision=a=7*d.length*2;p=eL(s,t,0,1,1),1!=(i=r.plus(p.times(n))).cmp(e);)r=n,n=i,i=c,c=u.plus(p.times(i)),u=i,i=t,t=s.minus(p.times(i)),s=i;return i=eL(e.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=this.s,f=1>eL(c,n,a,1).minus(this).abs().cmp(eL(u,r,a,1).minus(this).abs())?[c,n]:[u,r],m.precision=l,ew=!0,f},ek.toHexadecimal=ek.toHex=function(e,t){return e8(this,16,e,t)},ek.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:eP(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(ew=!1,r=eL(r,e,0,t,1).times(e),ew=!0,eH(r)):(e.s=r.s,r=e),r},ek.toNumber=function(){return+this},ek.toOctal=function(e,t){return e8(this,8,e,t)},ek.toPower=ek.pow=function(e){var t,r,n,i,a,o,s=this,u=s.constructor,c=+(e=new u(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new u(eT(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,a=u.rounding,e.eq(1))return eH(s,n,a);if((t=eF(e.e/7))>=e.d.length-1&&(r=c<0?-c:c)<=0x1fffffffffffff)return i=eQ(u,s,r,n),e.s<0?new u(1).div(i):eH(i,n,a);if((o=s.s)<0){if(t<e.d.length-1)return new u(NaN);if((1&e.d[t])==0&&(o=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=o,s}return(t=0!=(r=eT(+s,c))&&isFinite(r)?new u(r+"").e:eF(c*(Math.log("0."+eR(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(ew=!1,u.rounding=s.s=1,r=Math.min(12,(t+"").length),(i=eK(e.times(e0(s,n+r)),n)).d&&eU((i=eH(i,n+5,1)).d,n,a)&&(t=n+10,+eR((i=eH(eK(e.times(e0(s,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=eH(i,n+1,0))),i.s=o,ew=!0,u.rounding=a,eH(i,n,a))},ek.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=e$(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(eP(e,1,1e9),void 0===t?t=i.rounding:eP(t,0,8),r=e$(n=eH(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},ek.toSignificantDigits=ek.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(eP(e,1,1e9),void 0===t?t=r.rounding:eP(t,0,8)),eH(new r(this),e,t)},ek.toString=function(){var e=this.constructor,t=e$(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},ek.truncated=ek.trunc=function(){return eH(new this.constructor(this),this.e+1,1)},ek.valueOf=ek.toJSON=function(){var e=this.constructor,t=e$(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var eL=function(){function e(e,t,r){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+i,e[a]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=+(e[r]<t[r]),e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,a,o,s,u){var c,l,p,f,d,m,h,g,y,v,x,b,D,N,w,A,E,S,C,M,F=n.constructor,T=n.s==i.s?1:-1,B=n.d,O=i.d;if(!B||!B[0]||!O||!O[0])return new F(!n.s||!i.s||(B?O&&B[0]==O[0]:!O)?NaN:B&&0==B[0]||!O?0*T:T/0);for(u?(d=1,l=n.e-i.e):(u=1e7,d=7,l=eF(n.e/d)-eF(i.e/d)),C=O.length,E=B.length,v=(y=new F(T)).d=[],p=0;O[p]==(B[p]||0);p++);if(O[p]>(B[p]||0)&&l--,null==a?(N=a=F.precision,o=F.rounding):N=s?a+(n.e-i.e)+1:a,N<0)v.push(1),m=!0;else{if(N=N/d+2|0,p=0,1==C){for(f=0,O=O[0],N++;(p<E||f)&&N--;p++)w=f*u+(B[p]||0),v[p]=w/O|0,f=w%O|0;m=f||p<E}else{for((f=u/(O[0]+1)|0)>1&&(O=e(O,f,u),B=e(B,f,u),C=O.length,E=B.length),A=C,b=(x=B.slice(0,C)).length;b<C;)x[b++]=0;(M=O.slice()).unshift(0),S=O[0],O[1]>=u/2&&++S;do f=0,(c=t(O,x,C,b))<0?(D=x[0],C!=b&&(D=D*u+(x[1]||0)),(f=D/S|0)>1?(f>=u&&(f=u-1),g=(h=e(O,f,u)).length,b=x.length,1==(c=t(h,x,g,b))&&(f--,r(h,C<g?M:O,g,u))):(0==f&&(c=f=1),h=O.slice()),(g=h.length)<b&&h.unshift(0),r(x,h,b,u),-1==c&&(b=x.length,(c=t(O,x,C,b))<1&&(f++,r(x,C<b?M:O,b,u))),b=x.length):0===c&&(f++,x=[0]),v[p++]=f,c&&x[0]?x[b++]=B[A]||0:(x=[B[A]],b=1);while((A++<E||void 0!==x[0])&&N--);m=void 0!==x[0]}v[0]||v.shift()}if(1==d)y.e=l,ey=m;else{for(p=1,f=v[0];f>=10;f/=10)p++;y.e=p+l*d-1,eH(y,s?a+y.e+1:a,o,m)}return y}}();function eH(e,t,r,n){var i,a,o,s,u,c,l,p,f,d=e.constructor;e:if(null!=t){if(!(p=e.d))return e;for(i=1,s=p[0];s>=10;s/=10)i++;if((a=t-i)<0)a+=7,o=t,u=(l=p[f=0])/eT(10,i-o-1)%10|0;else if((f=Math.ceil((a+1)/7))>=(s=p.length))if(n){for(;s++<=f;)p.push(0);l=u=0,i=1,a%=7,o=a-7+1}else break e;else{for(i=1,l=s=p[f];s>=10;s/=10)i++;a%=7,u=(o=a-7+i)<0?0:l/eT(10,i-o-1)%10|0}if(n=n||t<0||void 0!==p[f+1]||(o<0?l:l%eT(10,i-o-1)),c=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?o>0?l/eT(10,i-o):0:p[f-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,c?(t-=e.e+1,p[0]=eT(10,(7-t%7)%7),e.e=-t||0):p[0]=e.e=0,e;if(0==a?(p.length=f,s=1,f--):(p.length=f+1,s=eT(10,7-a),p[f]=o>0?(l/eT(10,i-o)%eT(10,o)|0)*s:0),c)for(;;)if(0==f){for(a=1,o=p[0];o>=10;o/=10)a++;for(o=p[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,1e7==p[0]&&(p[0]=1));break}else{if(p[f]+=s,1e7!=p[f])break;p[f--]=0,s=1}for(a=p.length;0===p[--a];)p.pop()}return ew&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e<d.minE&&(e.e=0,e.d=[0])),e}function e$(e,t,r){if(!e.isFinite())return e1(e);var n,i=e.e,a=eR(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+eJ(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+eJ(-i-1)+a,r&&(n=r-o)>0&&(a+=eJ(n))):i>=o?(a+=eJ(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+eJ(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=eJ(n))),a}function eG(e,t){var r=e[0];for(t*=7;r>=10;r/=10)t++;return t}function eZ(e,t,r){if(t>eq)throw ew=!0,r&&(e.precision=r),Error(eS);return eH(new e(eb),t,1,!0)}function eV(e,t,r){if(t>eI)throw Error(eS);return eH(new e(eD),t,r,!0)}function eW(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function eJ(e){for(var t="";e--;)t+="0";return t}function eQ(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/7+4);for(ew=!1;;){if(r%2&&e6((a=a.times(t)).d,o)&&(i=!0),0===(r=eF(r/2))){r=a.d.length-1,i&&0===a.d[r]&&++a.d[r];break}e6((t=t.times(t)).d,o)}return ew=!0,a}function eX(e){return 1&e.d[e.d.length-1]}function eY(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;)if((n=new e(t[a])).s)i[r](n)&&(i=n);else{i=n;break}return i}function eK(e,t){var r,n,i,a,o,s,u,c=0,l=0,p=0,f=e.constructor,d=f.rounding,m=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?!e.d[0]?1:e.s<0?0:1/0:e.s?e.s<0?0:e:0/0);for(null==t?(ew=!1,u=m):u=t,s=new f(.03125);e.e>-2;)e=e.times(s),p+=5;for(u+=n=Math.log(eT(2,p))/Math.LN10*2+5|0,r=a=o=new f(1),f.precision=u;;){if(a=eH(a.times(e),u,1),r=r.times(++l),eR((s=o.plus(eL(a,r,u,1))).d).slice(0,u)===eR(o.d).slice(0,u)){for(i=p;i--;)o=eH(o.times(o),u,1);if(null!=t)return f.precision=m,o;if(!(c<3&&eU(o.d,u-n,d,c)))return eH(o,f.precision=m,d,ew=!0);f.precision=u+=10,r=a=s=new f(1),l=0,c++}o=s}}function e0(e,t){var r,n,i,a,o,s,u,c,l,p,f,d=1,m=e,h=m.d,g=m.constructor,y=g.rounding,v=g.precision;if(m.s<0||!h||!h[0]||!m.e&&1==h[0]&&1==h.length)return new g(h&&!h[0]?-1/0:1!=m.s?NaN:h?0:m);if(null==t?(ew=!1,l=v):l=t,g.precision=l+=10,n=(r=eR(h)).charAt(0),!(15e14>Math.abs(a=m.e)))return c=eZ(g,l+2,v).times(a+""),m=e0(new g(n+"."+r.slice(1)),l-10).plus(c),g.precision=v,null==t?eH(m,v,y,ew=!0):m;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=eR((m=m.times(e)).d)).charAt(0),d++;for(a=m.e,n>1?(m=new g("0."+r),a++):m=new g(n+"."+r.slice(1)),p=m,u=o=m=eL(m.minus(1),m.plus(1),l,1),f=eH(m.times(m),l,1),i=3;;){if(o=eH(o.times(f),l,1),eR((c=u.plus(eL(o,new g(i),l,1))).d).slice(0,l)===eR(u.d).slice(0,l)){if(u=u.times(2),0!==a&&(u=u.plus(eZ(g,l+2,v).times(a+""))),u=eL(u,new g(d),l,1),null!=t)return g.precision=v,u;if(!eU(u.d,l-10,y,s))return eH(u,g.precision=v,y,ew=!0);g.precision=l+=10,c=o=m=eL(p.minus(1),p.plus(1),l,1),f=eH(m.times(m),l,1),i=s=1}u=c,i+=2}}function e1(e){return String(e.s*e.s/0)}function e2(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";e.d.push(+t),ew&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function e3(e,t,r,n,i){var a,o,s,u,c=e.precision,l=Math.ceil(c/7);for(ew=!1,u=r.times(r),s=new e(n);;){if(o=eL(s.times(u),new e(t++*t++),c,1),s=i?n.plus(o):n.minus(o),n=eL(o.times(u),new e(t++*t++),c,1),void 0!==(o=s.plus(n)).d[l]){for(a=l;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=n,n=o,o=a}return ew=!0,o.d.length=l+1,o}function e4(e,t){for(var r=e;--t;)r*=e;return r}function e5(e,t){var r,n=t.s<0,i=eV(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return ev=n?4:1,t;if((r=t.divToInt(i)).isZero())ev=n?3:2;else{if((t=t.minus(r.times(i))).lte(a))return ev=eX(r)?n?2:3:n?4:1,t;ev=eX(r)?n?1:4:n?3:2}return t.minus(i).abs()}function e8(e,t,r,n){var i,a,o,s,u,c,l,p,f,d=e.constructor,m=void 0!==r;if(m?(eP(r,1,1e9),void 0===n?n=d.rounding:eP(n,0,8)):(r=d.precision,n=d.rounding),e.isFinite()){for(o=(l=e$(e)).indexOf("."),m?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,o>=0&&(l=l.replace(".",""),(f=new d(1)).e=l.length-o,f.d=ej(e$(f),10,i),f.e=f.d.length),a=u=(p=ej(l,10,i)).length;0==p[--u];)p.pop();if(p[0]){if(o<0?a--:((e=new d(e)).d=p,e.e=a,p=(e=eL(e,f,r,n,0,i)).d,a=e.e,c=ey),o=p[r],s=i/2,c=c||void 0!==p[r+1],c=n<4?(void 0!==o||c)&&(0===n||n===(e.s<0?3:2)):o>s||o===s&&(4===n||c||6===n&&1&p[r-1]||n===(e.s<0?8:7)),p.length=r,c)for(;++p[--r]>i-1;)p[r]=0,r||(++a,p.unshift(1));for(u=p.length;!p[u-1];--u);for(o=0,l="";o<u;o++)l+=ex.charAt(p[o]);if(m){if(u>1)if(16==t||8==t){for(o=16==t?4:3,--u;u%o;u++)l+="0";for(u=(p=ej(l,i,t)).length;!p[u-1];--u);for(o=1,l="1.";o<u;o++)l+=ex.charAt(p[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)l="0"+l;l="0."+l}else if(++a>u)for(a-=u;a--;)l+="0";else a<u&&(l=l.slice(0,a)+"."+l.slice(a))}else l=m?"0p+0":"0";l=(16==t?"0x":2==t?"0b":8==t?"0o":"")+l}else l=e1(e);return e.s<0?"-"+l:l}function e6(e,t){if(e.length>t)return e.length=t,!0}function e7(e){return new this(e).abs()}function e9(e){return new this(e).acos()}function te(e){return new this(e).acosh()}function tt(e,t){return new this(e).plus(t)}function tr(e){return new this(e).asin()}function tn(e){return new this(e).asinh()}function ti(e){return new this(e).atan()}function ta(e){return new this(e).atanh()}function to(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?eV(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=eV(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,r=this.atan(eL(e,t,a,1)),t=eV(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(eL(e,t,a,1)):(r=eV(this,a,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function ts(e){return new this(e).cbrt()}function tu(e){return eH(e=new this(e),e.e+1,2)}function tc(e,t,r){return new this(e).clamp(t,r)}function tl(e){if(!e||"object"!=typeof e)throw Error(eA+"Object expected");var t,r,n,i=!0===e.defaults,a=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=eN[r]),void 0!==(n=e[r]))if(eF(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(eE+r+": "+n);if(r="crypto",i&&(this[r]=eN[r]),void 0!==(n=e[r]))if(!0===n||!1===n||0===n||1===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(eC);else this[r]=!1;else throw Error(eE+r+": "+n);return this}function tp(e){return new this(e).cos()}function tf(e){return new this(e).cosh()}function td(e,t){return new this(e).div(t)}function tm(e){return new this(e).exp()}function th(e){return eH(e=new this(e),e.e+1,3)}function tg(){var e,t,r=new this(0);for(e=0,ew=!1;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return ew=!0,new this(1/0);r=t}return ew=!0,r.sqrt()}function ty(e){return e instanceof tR||e&&e.toStringTag===eM||!1}function tv(e){return new this(e).ln()}function tx(e,t){return new this(e).log(t)}function tb(e){return new this(e).log(2)}function tD(e){return new this(e).log(10)}function tN(){return eY(this,arguments,"lt")}function tw(){return eY(this,arguments,"gt")}function tA(e,t){return new this(e).mod(t)}function tE(e,t){return new this(e).mul(t)}function tS(e,t){return new this(e).pow(t)}function tC(e){var t,r,n,i,a=0,o=new this(1),s=[];if(void 0===e?e=this.precision:eP(e,1,1e9),n=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)(i=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);a<n;)(i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=n/4}else throw Error(eC);else for(;a<n;)s[a++]=1e7*Math.random()|0;for(n=s[--a],e%=7,n&&e&&(i=eT(10,7-e),s[a]=(n/i|0)*i);0===s[a];a--)s.pop();if(a<0)r=0,s=[0];else{for(r=-1;0===s[0];r-=7)s.shift();for(n=1,i=s[0];i>=10;i/=10)n++;n<7&&(r-=7-n)}return o.e=r,o.d=s,o}function tM(e){return eH(e=new this(e),e.e+1,this.rounding)}function tF(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function tT(e){return new this(e).sin()}function tB(e){return new this(e).sinh()}function tO(e){return new this(e).sqrt()}function t_(e,t){return new this(e).sub(t)}function tz(){var e=0,t=arguments,r=new this(t[0]);for(ew=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return ew=!0,eH(r,this.precision,this.rounding)}function tq(e){return new this(e).tan()}function tI(e){return new this(e).tanh()}function tk(e){return eH(e=new this(e),e.e+1,1)}ek[Symbol.for("nodejs.util.inspect.custom")]=ek.toString,ek[Symbol.toStringTag]="Decimal";var tR=ek.constructor=function e(t){var r,n,i;function a(e){var t,r,n;if(!(this instanceof a))return new a(e);if(this.constructor=a,ty(e)){this.s=e.s,ew?!e.d||e.e>a.maxE?(this.e=NaN,this.d=null):e.e<a.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(n=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;ew?t>a.maxE?(this.e=NaN,this.d=null):t<a.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return e2(this,e.toString())}if("string"!==n)throw Error(eE+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===r&&(e=e.slice(1)),this.s=1),ez.test(e)?e2(this,e):function(e,t){var r,n,i,a,o,s,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ez.test(t))return e2(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(eO.test(t))r=16,t=t.toLowerCase();else if(eB.test(t))r=2;else if(e_.test(t))r=8;else throw Error(eE+t);for((a=t.search(/p/i))>0?(u=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),o=(a=t.indexOf("."))>=0,n=e.constructor,o&&(a=(s=(t=t.replace(".","")).length)-a,i=eQ(n,new n(r),a,2*a)),a=l=(c=ej(t,r,1e7)).length-1;0===c[a];--a)c.pop();return a<0?new n(0*e.s):(e.e=eG(c,l),e.d=c,ew=!1,o&&(e=eL(e,i,4*s)),u&&(e=e.times(54>Math.abs(u)?eT(2,u):tR.pow(2,u))),ew=!0,e)}(this,e)}if(a.prototype=ek,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=tl,a.clone=e,a.isDecimal=ty,a.abs=e7,a.acos=e9,a.acosh=te,a.add=tt,a.asin=tr,a.asinh=tn,a.atan=ti,a.atanh=ta,a.atan2=to,a.cbrt=ts,a.ceil=tu,a.clamp=tc,a.cos=tp,a.cosh=tf,a.div=td,a.exp=tm,a.floor=th,a.hypot=tg,a.ln=tv,a.log=tx,a.log10=tD,a.log2=tb,a.max=tN,a.min=tw,a.mod=tA,a.mul=tE,a.pow=tS,a.random=tC,a.round=tM,a.sign=tF,a.sin=tT,a.sinh=tB,a.sqrt=tO,a.sub=t_,a.sum=tz,a.tan=tq,a.tanh=tI,a.trunc=tk,void 0===t&&(t={}),t&&!0!==t.defaults)for(r=0,i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return a.config(t),a}(eN);function tP(e,t,r,n){function i(n){var i=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];void 0!==a&&(r[i]=a)}return r}(n,t.map(tj));return function(e,t,r){if(!t.filter(e=>{var t;return!((t=e)&&"?"===t[0])}).every(e=>void 0!==r[e])){var n=t.filter(e=>void 0===r[e]);throw Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(n.map(e=>'"'.concat(e,'"')).join(", "),"."))}}(e,t,n),r(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function tU(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function tj(e){return e&&"?"===e[0]?e.slice(1):e}eb=new tR(eb),eD=new tR(eD);var tL=tP("BigNumber",["?on","config"],e=>{var{on:t,config:r}=e,n=tR.clone({precision:r.precision,modulo:tR.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})}),n},{isClass:!0});let tH=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},t$=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},tG=function(e,t){return((e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8)?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},tZ=function(){throw SyntaxError("Invalid Param")};function tV(e,t){let r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):.5*Math.log((e*=.5)*e+(t*=.5)*t)+Math.LN2}let tW={re:0,im:0},tJ=function(e,t){if(null==e)tW.re=tW.im=0;else if(void 0!==t)tW.re=e,tW.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)tW.re=e.re,tW.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return tQ.INFINITY;tW.re=e.abs*Math.cos(e.arg),tW.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return tQ.INFINITY;tW.re=e.r*Math.cos(e.phi),tW.im=e.r*Math.sin(e.phi)}else 2===e.length?(tW.re=e[0],tW.im=e[1]):tZ();break;case"string":tW.im=tW.re=0;let r=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),n=1,i=0;null===r&&tZ();for(let e=0;e<r.length;e++){let t=r[e];" "===t||" "===t||"\n"===t||("+"===t?n++:"-"===t?i++:("i"===t||"I"===t?(n+i===0&&tZ()," "===r[e+1]||isNaN(r[e+1])?tW.im+=parseFloat((i%2?"-":"")+"1"):(tW.im+=parseFloat((i%2?"-":"")+r[e+1]),e++)):((n+i===0||isNaN(t))&&tZ(),"i"===r[e+1]||"I"===r[e+1]?(tW.im+=parseFloat((i%2?"-":"")+t),e++):tW.re+=parseFloat((i%2?"-":"")+t)),n=i=0))}n+i>0&&tZ();break;case"number":tW.im=0,tW.re=e;break;default:tZ()}return isNaN(tW.re)||isNaN(tW.im),tW};function tQ(e,t){if(!(this instanceof tQ))return new tQ(e,t);let r=tJ(e,t);this.re=r.re,this.im=r.im}function tX(e){return"boolean"==typeof e||!!Number.isFinite(e)&&e===Math.round(e)}function tY(e,t){if("bigint"===t.number)try{BigInt(e)}catch(e){return t.numberFallback}return t.number}tQ.prototype={re:0,im:0,sign:function(){let e=tG(this.re,this.im);return new tQ(this.re/e,this.im/e)},add:function(e,t){let r=tJ(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im));return n||i?n&&i?tQ.NAN:tQ.INFINITY:new tQ(this.re+r.re,this.im+r.im)},sub:function(e,t){let r=tJ(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im));return n||i?n&&i?tQ.NAN:tQ.INFINITY:new tQ(this.re-r.re,this.im-r.im)},mul:function(e,t){let r=tJ(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im)),a=0===this.re&&0===this.im,o=0===r.re&&0===r.im;return n&&o||i&&a?tQ.NAN:n||i?tQ.INFINITY:0===r.im&&0===this.im?new tQ(this.re*r.re,0):new tQ(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){let r=tJ(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im)),a=0===this.re&&0===this.im,o=0===r.re&&0===r.im;if(a&&o||n&&i)return tQ.NAN;if(o||n)return tQ.INFINITY;if(a||i)return tQ.ZERO;if(0===r.im)return new tQ(this.re/r.re,this.im/r.re);if(Math.abs(r.re)<Math.abs(r.im)){let e=r.re/r.im,t=r.re*e+r.im;return new tQ((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{let e=r.im/r.re,t=r.im*e+r.re;return new tQ((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let r=tJ(e,t),n=0===this.re&&0===this.im;if(0===r.re&&0===r.im)return tQ.ONE;if(0===r.im){if(0===this.im&&this.re>0)return new tQ(Math.pow(this.re,r.re),0);else if(0===this.re)switch((r.re%4+4)%4){case 0:return new tQ(Math.pow(this.im,r.re),0);case 1:return new tQ(0,Math.pow(this.im,r.re));case 2:return new tQ(-Math.pow(this.im,r.re),0);case 3:return new tQ(0,-Math.pow(this.im,r.re))}}if(n&&r.re>0)return tQ.ZERO;let i=Math.atan2(this.im,this.re),a=tV(this.re,this.im),o=Math.exp(r.re*a-r.im*i),s=r.im*a+r.re*i;return new tQ(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(0===t)if(e>=0)return new tQ(Math.sqrt(e),0);else return new tQ(0,Math.sqrt(-e));let r=Math.sqrt(.5*(tG(e,t)+Math.abs(e))),n=Math.abs(t)/(2*r);return e>=0?new tQ(r,t<0?-n:n):new tQ(n,t<0?-r:r)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new tQ(e,0):new tQ(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e,t=this.re,r=this.im;return new tQ(Math.expm1(t)*Math.cos(r)+-2*(e=Math.sin(.5*r))*e,Math.exp(t)*Math.sin(r))},log:function(){let e=this.re,t=this.im;return 0===t&&e>0?new tQ(Math.log(e),0):new tQ(tV(e,t),Math.atan2(t,e))},abs:function(){return tG(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new tQ(Math.sin(e)*tH(t),Math.cos(e)*t$(t))},cos:function(){let e=this.re,t=this.im;return new tQ(Math.cos(e)*tH(t),-Math.sin(e)*t$(t))},tan:function(){let e=2*this.re,t=2*this.im,r=Math.cos(e)+tH(t);return new tQ(Math.sin(e)/r,t$(t)/r)},cot:function(){let e=2*this.re,t=2*this.im,r=Math.cos(e)-tH(t);return new tQ(-Math.sin(e)/r,t$(t)/r)},sec:function(){let e=this.re,t=this.im,r=.5*tH(2*t)+.5*Math.cos(2*e);return new tQ(Math.cos(e)*tH(t)/r,Math.sin(e)*t$(t)/r)},csc:function(){let e=this.re,t=this.im,r=.5*tH(2*t)-.5*Math.cos(2*e);return new tQ(Math.sin(e)*tH(t)/r,-Math.cos(e)*t$(t)/r)},asin:function(){let e=this.re,t=this.im,r=new tQ(t*t-e*e+1,-2*e*t).sqrt(),n=new tQ(r.re-t,r.im+e).log();return new tQ(n.im,-n.re)},acos:function(){let e=this.re,t=this.im,r=new tQ(t*t-e*e+1,-2*e*t).sqrt(),n=new tQ(r.re-t,r.im+e).log();return new tQ(Math.PI/2-n.im,n.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new tQ(0,1/0);if(-1===t)return new tQ(0,-1/0)}let r=e*e+(1-t)*(1-t),n=new tQ((1-t*t-e*e)/r,-2*e/r).log();return new tQ(-.5*n.im,.5*n.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new tQ(Math.atan2(1,e),0);let r=e*e+t*t;return 0!==r?new tQ(e/r,-t/r).atan():new tQ(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new tQ(0,1/0);let r=e*e+t*t;return 0!==r?new tQ(e/r,-t/r).acos():new tQ(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new tQ(Math.PI/2,1/0);let r=e*e+t*t;return 0!==r?new tQ(e/r,-t/r).asin():new tQ(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new tQ(t$(e)*Math.cos(t),tH(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new tQ(tH(e)*Math.cos(t),t$(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,r=tH(e)+Math.cos(t);return new tQ(t$(e)/r,Math.sin(t)/r)},coth:function(){let e=2*this.re,t=2*this.im,r=tH(e)-Math.cos(t);return new tQ(t$(e)/r,-Math.sin(t)/r)},csch:function(){let e=this.re,t=this.im,r=Math.cos(2*t)-tH(2*e);return new tQ(-2*t$(e)*Math.cos(t)/r,2*tH(e)*Math.sin(t)/r)},sech:function(){let e=this.re,t=this.im,r=Math.cos(2*t)+tH(2*e);return new tQ(2*tH(e)*Math.cos(t)/r,-2*t$(e)*Math.sin(t)/r)},asinh:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new tQ(0,0);let t=Math.abs(e),r=Math.log(t+Math.sqrt(t*t+1));return new tQ(e<0?-r:r,0)}let r=new tQ(e*e-t*t+1,2*e*t).sqrt();return new tQ(e+r.re,t+r.im).log()},acosh:function(){let e=this.re,t=this.im;if(0===t){if(e>1)return new tQ(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new tQ(Math.log(-e+t),Math.PI)}return new tQ(0,Math.acos(e))}let r=new tQ(e-1,t).sqrt(),n=new tQ(e+1,t).sqrt();return new tQ(e+r.re*n.re-r.im*n.im,t+r.re*n.im+r.im*n.re).log()},atanh:function(){let e=this.re,t=this.im;if(0===t)return 0===e?new tQ(0,0):1===e?new tQ(1/0,0):-1===e?new tQ(-1/0,0):-1<e&&e<1?new tQ(.5*Math.log((1+e)/(1-e)),0):e>1?new tQ(.5*Math.log((e+1)/(e-1)),-Math.PI/2):new tQ(.5*Math.log(-((1+e)/(1-e))),Math.PI/2);let r=1-e,n=1+e,i=r*r+t*t;if(0===i)return new tQ(-1!==e?e/0:0,0!==t?t/0:0);let a=(n*r-t*t)/i,o=(t*r+n*t)/i;return new tQ(tV(a,o)/2,Math.atan2(o,a)/2)},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new tQ(0,Math.PI/2);let r=e*e+t*t;return 0!==r?new tQ(e/r,-t/r).atanh():new tQ(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new tQ(1/0,0);let t=1/e;return new tQ(Math.log(t+Math.sqrt(t*t+1)),0)}let r=e*e+t*t;return 0!==r?new tQ(e/r,-t/r).asinh():new tQ(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return tQ.INFINITY;let r=e*e+t*t;return 0!==r?new tQ(e/r,-t/r).acosh():new tQ(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return tQ.INFINITY;if(this.isInfinite())return tQ.ZERO;let e=this.re,t=this.im,r=e*e+t*t;return new tQ(e/r,-t/r)},conjugate:function(){return new tQ(this.re,-this.im)},neg:function(){return new tQ(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new tQ(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new tQ(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new tQ(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let r=tJ(e,t);return Math.abs(r.re-this.re)<=tQ.EPSILON&&Math.abs(r.im-this.im)<=tQ.EPSILON},clone:function(){return new tQ(this.re,this.im)},toString:function(){let e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<tQ.EPSILON&&(e=0),Math.abs(t)<tQ.EPSILON&&(t=0),0===t)?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},tQ.ZERO=new tQ(0,0),tQ.ONE=new tQ(1,0),tQ.I=new tQ(0,1),tQ.PI=new tQ(Math.PI,0),tQ.E=new tQ(Math.E,0),tQ.INFINITY=new tQ(1/0,1/0),tQ.NAN=new tQ(NaN,NaN),tQ.EPSILON=1e-15;var tK=Math.sign||function(e){return e>0?1:e<0?-1:0},t0=Math.log2||function(e){return Math.log(e)/Math.LN2},t1=Math.log10||function(e){return Math.log(e)/Math.LN10},t2=Math.log1p||function(e){return Math.log(e+1)},t3=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),Number.isFinite(e)?(t=Math.exp(Math.log(e)/3),t=(e/(t*t)+2*t)/3):t=e,r?-t:t},t4=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function t5(e,t,r){var n="";if(r){if(r<1)throw Error("size must be in greater than 0");if(!tX(r))throw Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!tX(e))throw Error("Value must be an integer");e<0&&(e+=2**r),n="i".concat(r)}var i="";return e<0&&(e=-e,i="-"),"".concat(i).concat({2:"0b",8:"0o",16:"0x"}[t]).concat(e.toString(t)).concat(n)}function t8(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=t6(t);switch(r){case"fixed":return t9(e,n);case"exponential":return re(e,n);case"engineering":return function(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);var r=rt(t7(e),t),n=r.exponent,i=r.coefficients,a=n%3==0?n:n<0?n-3-n%3:n-n%3;if(y(t))for(;t>i.length||n-a+1>i.length;)i.push(0);else for(var o=Math.abs(n-a)-(i.length-1),s=0;s<o;s++)i.push(0);for(var u=Math.abs(n-a),c=1;u>0;)c++,u--;var l=i.slice(c).join(""),p=y(t)&&l.length||l.match(/[1-9]/)?"."+l:"",f=i.slice(0,c).join("")+p+"e"+(n>=0?"+":"")+a.toString();return r.sign+f}(e,n);case"bin":return t5(e,2,i);case"oct":return t5(e,8,i);case"hex":return t5(e,16,i);case"auto":return(function(e,t,r){if(isNaN(e)||!Number.isFinite(e))return String(e);var n=rp(null==r?void 0:r.lowerExp,-3),i=rp(null==r?void 0:r.upperExp,5),a=t7(e),o=t?rt(a,t):a;if(o.exponent<n||o.exponent>=i)return re(e,t);var s=o.coefficients,u=o.exponent;s.length<t&&(s=s.concat(rr(t-s.length))),s=s.concat(rr(u-s.length+1+(s.length<t?t-s.length:0))),s=rr(-u).concat(s);var c=u>0?u:0;return c<s.length-1&&s.splice(c+1,0,"."),o.sign+s.join("")})(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function t6(e){var t,r,n="auto";if(void 0!==e)if(y(e))t=e;else if(v(e))t=e.toNumber();else if(k(e))void 0!==e.precision&&(t=rl(e.precision,()=>{throw Error('Option "precision" must be a number or BigNumber')})),void 0!==e.wordSize&&(r=rl(e.wordSize,()=>{throw Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(n=e.notation);else throw Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:n,precision:t,wordSize:r}}function t7(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=-1!==a?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function t9(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);var r=t7(e),n="number"==typeof t?rt(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(rr(o-i.length))),a<0&&(i=rr(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,0===a?"0.":"."),n.sign+i.join("")}function re(e,t){if(isNaN(e)||!Number.isFinite(Number(e)))return String(e);var r=t7(e),n=t?rt(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(rr(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function rt(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),i--,n[i]++}return r}function rr(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function rn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-8,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r<=0)throw Error("Relative tolerance must be greater than 0");if(n<0)throw Error("Absolute tolerance must be at least 0");return!(isNaN(e)||isNaN(t))&&(Number.isFinite(e)&&Number.isFinite(t)?e===t||Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n):e===t)}var ri=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},ra=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},ro=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},rs=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},ru=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},rc=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function rl(e,t){return y(e)?e:v(e)?e.toNumber():void t()}function rp(e,t){return y(e)?e:v(e)?e.toNumber():t}var rf=tP("Complex",[],()=>(Object.defineProperty(tQ,"name",{value:"Complex"}),tQ.prototype.constructor=tQ,tQ.prototype.type="Complex",tQ.prototype.isComplex=!0,tQ.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tQ.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tQ.prototype.format=function(e){var t=this.im,r=this.re,n=t8(this.re,e),i=t8(this.im,e),a=y(e)?e:e?e.precision:null;if(null!==a){var o=Math.pow(10,-a);Math.abs(r/t)<o&&(r=0),Math.abs(t/r)<o&&(t=0)}return 0===t?n:0===r?1===t?"i":-1===t?"-i":i+"i":t<0?-1===t?n+" - i":n+" - "+i.substring(1)+"i":1===t?n+" + i":n+" + "+i+"i"},tQ.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return tQ(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var r=arguments[0],n=arguments[1];if(y(r)){if(N(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),y(n))return new tQ({r,phi:n});throw TypeError("Phi is not a number nor an angle unit.")}throw TypeError("Radius r is not a number.");default:throw SyntaxError("Wrong number of arguments in function fromPolar")}},tQ.prototype.valueOf=tQ.prototype.toString,tQ.fromJSON=function(e){return new tQ(e)},tQ.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},tQ),{isClass:!0});function rd(e){var{hasher:t,limit:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=null==r?1/0:r,t=null==t?JSON.stringify:t,function n(){"object"!=typeof n.cache&&(n.cache={values:new Map,lru:(i=r||1/0,a=0,o=1,s=Object.create(null),u=Object.create(null),c=0,l=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--a,o===t)){if(!a){c=0,o=1;return}for(;!Object.prototype.hasOwnProperty.call(s,++o););}},i=Math.abs(i),{hit:function(e){var t=u[e],r=++c;if(s[r]=e,u[e]=r,!t){if(++a<=i)return;return l(e=s[o]),e}if(delete s[t],o===t)for(;!Object.prototype.hasOwnProperty.call(s,++o););},delete:l,clear:function(){a=c=0,o=1,s=Object.create(null),u=Object.create(null)}})});for(var i,a,o,s,u,c,l,p=[],f=0;f<arguments.length;f++)p[f]=arguments[f];var d=t(p);if(n.cache.values.has(d))return n.cache.lru.hit(d),n.cache.values.get(d);var m=e.apply(e,p);return n.cache.values.set(d,m),n.cache.values.delete(n.cache.lru.hit(d)),m}}var rm=rd(function(e){return new e(1).exp()},{hasher:rv}),rh=rd(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:rv}),rg=rd(function(e){return e.acos(-1)},{hasher:rv}),ry=rd(function(e){return rg(e).times(2)},{hasher:rv});function rv(e){return e[0].precision}var rx=Math.PI,rb=2*Math.PI,rD=Math.E,rN=tP("true",[],()=>!0),rw=tP("false",[],()=>!1),rA=tP("null",[],()=>null),rE=rj("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1/0):1/0}),rS=rj("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(NaN):NaN}),rC=rj("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?rg(r):rx}),rM=rj("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?ry(r):rb}),rF=rj("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?rm(r):rD}),rT=rj("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?rh(r):1.618033988749895}),rB=rj("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(2).ln():Math.LN2}),rO=rj("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(10).ln():Math.LN10}),r_=rj("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E}),rz=rj("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E}),rq=rj("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2}),rI=rj("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2}),rk=rj("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),rR=tP("PI",["pi"],e=>{var{pi:t}=e;return t}),rP=tP("E",["e"],e=>{var{e:t}=e;return t}),rU=tP("version",[],()=>"15.1.0");function rj(e,t,r){return tP(e,t,r,{recreateOnConfigChange:!0})}var rL=nF("speedOfLight","299792458","m s^-1"),rH=nF("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),r$=nF("planckConstant","6.62607015e-34","J s"),rG=nF("reducedPlanckConstant","1.0545718176461565e-34","J s"),rZ=nF("magneticConstant","1.25663706212e-6","N A^-2"),rV=nF("electricConstant","8.8541878128e-12","F m^-1"),rW=nF("vacuumImpedance","376.730313667","ohm"),rJ=nF("coulomb","8.987551792261171e9","N m^2 C^-2"),rQ=nF("coulombConstant","8.987551792261171e9","N m^2 C^-2"),rX=nF("elementaryCharge","1.602176634e-19","C"),rY=nF("bohrMagneton","9.2740100783e-24","J T^-1"),rK=nF("conductanceQuantum","7.748091729863649e-5","S"),r0=nF("inverseConductanceQuantum","12906.403729652257","ohm"),r1=nF("magneticFluxQuantum","2.0678338484619295e-15","Wb"),r2=nF("nuclearMagneton","5.0507837461e-27","J T^-1"),r3=nF("klitzing","25812.807459304513","ohm"),r4=nF("bohrRadius","5.29177210903e-11","m"),r5=nF("classicalElectronRadius","2.8179403262e-15","m"),r8=nF("electronMass","9.1093837015e-31","kg"),r6=nF("fermiCoupling","1.1663787e-5","GeV^-2"),r7=nT("fineStructure",.0072973525693),r9=nF("hartreeEnergy","4.3597447222071e-18","J"),ne=nF("protonMass","1.67262192369e-27","kg"),nt=nF("deuteronMass","3.3435830926e-27","kg"),nr=nF("neutronMass","1.6749271613e-27","kg"),nn=nF("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),ni=nF("rydberg","10973731.568160","m^-1"),na=nF("thomsonCrossSection","6.6524587321e-29","m^2"),no=nT("weakMixingAngle",.2229),ns=nT("efimovFactor",22.7),nu=nF("atomicMass","1.66053906660e-27","kg"),nc=nF("avogadro","6.02214076e23","mol^-1"),nl=nF("boltzmann","1.380649e-23","J K^-1"),np=nF("faraday","96485.33212331001","C mol^-1"),nf=nF("firstRadiation","3.7417718521927573e-16","W m^2"),nd=nF("loschmidt","2.686780111798444e25","m^-3"),nm=nF("gasConstant","8.31446261815324","J K^-1 mol^-1"),nh=nF("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),ng=nF("molarVolume","0.022413969545014137","m^3 mol^-1"),ny=nT("sackurTetrode",-1.16487052358),nv=nF("secondRadiation","0.014387768775039337","m K"),nx=nF("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),nb=nF("wienDisplacement","2.897771955e-3","m K"),nD=nF("molarMass","0.99999999965e-3","kg mol^-1"),nN=nF("molarMassC12","11.9999999958e-3","kg mol^-1"),nw=nF("gravity","9.80665","m s^-2"),nA=nF("planckLength","1.616255e-35","m"),nE=nF("planckMass","2.176435e-8","kg"),nS=nF("planckTime","5.391245e-44","s"),nC=nF("planckCharge","1.87554603778e-18","C"),nM=nF("planckTemperature","1.416785e+32","K");function nF(e,t,r){return tP(e,["config","Unit","BigNumber"],e=>{var{config:n,Unit:i,BigNumber:a}=e,o=new i("BigNumber"===n.number?new a(t):parseFloat(t),r);return o.fixPrefix=!0,o})}function nT(e,t){return tP(e,["config","BigNumber"],e=>{var{config:r,BigNumber:n}=e;return"BigNumber"===r.number?new n(t):t})}"u"<typeof BigInt&&(BigInt=function(e){if(isNaN(e))throw Error("");return e});let nB=BigInt(0),nO=BigInt(1),n_=BigInt(2),nz=BigInt(3),nq=BigInt(5),nI=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);let nk={s:nO,n:nB,d:nO};function nR(e,t){try{e=BigInt(e)}catch(e){throw nV()}return e*t}function nP(e){return"bigint"==typeof e?e:Math.floor(e)}function nU(e,t){if(t===nB)throw nZ();let r=Object.create(nG.prototype);r.s=e<nB?-nO:nO;let n=n$(e=e<nB?-e:e,t);return r.n=e/n,r.d=t/n,r}let nj=[n_*n_,n_,n_*n_,n_,n_*n_,n_*nz,n_,n_*nz];function nL(e){let t=Object.create(null);if(e<=nO)return t[e]=nO,t;let r=e=>{t[e]=(t[e]||nB)+nO};for(;e%n_===nB;)r(n_),e/=n_;for(;e%nz===nB;)r(nz),e/=nz;for(;e%nq===nB;)r(nq),e/=nq;for(let t=0,n=n_+nq;n*n<=e;){for(;e%n===nB;)r(n),e/=n;n+=nj[t],t=t+1&7}return e>nO&&r(e),t}let nH=function(e,t){let r=nB,n=nO,i=nO;if(null==e);else if(void 0!==t){if("bigint"==typeof e)r=e;else if(isNaN(e))throw nV();else if(e%1!=0)throw nW();else r=BigInt(e);if("bigint"==typeof t)n=t;else if(isNaN(t))throw nV();else if(t%1!=0)throw nW();else n=BigInt(t);i=r*n}else if("object"==typeof e){if("d"in e&&"n"in e)r=BigInt(e.n),n=BigInt(e.d),"s"in e&&(r*=BigInt(e.s));else if(0 in e)r=BigInt(e[0]),1 in e&&(n=BigInt(e[1]));else if("bigint"==typeof e)r=e;else throw nV();i=r*n}else if("number"==typeof e){if(isNaN(e))throw nV();if(e<0&&(i=-nO,e=-e),e%1==0)r=BigInt(e);else{let t=1,i=0,a=1,o=1,s=1;for(e>=1&&(t=10**Math.floor(1+Math.log10(e)),e/=t);a<=1e7&&s<=1e7;){let t=(i+o)/(a+s);if(e===t){a+s<=1e7?(r=i+o,n=a+s):s>a?(r=o,n=s):(r=i,n=a);break}e>t?(i+=o,a+=s):(o+=i,s+=a),a>1e7?(r=o,n=s):(r=i,n=a)}r=BigInt(r)*BigInt(t),n=BigInt(n)}}else if("string"==typeof e){let t=0,a=nB,o=nB,s=nB,u=nO,c=nO,l=e.replace(/_/g,"").match(/\d+|./g);if(null===l)throw nV();if("-"===l[t]?(i=-nO,t++):"+"===l[t]&&t++,l.length===t+1?o=nR(l[t++],i):"."===l[t+1]||"."===l[t]?("."!==l[t]&&(a=nR(l[t++],i)),(++t+1===l.length||"("===l[t+1]&&")"===l[t+3]||"'"===l[t+1]&&"'"===l[t+3])&&(o=nR(l[t],i),u=nI**BigInt(l[t].length),t++),("("===l[t]&&")"===l[t+2]||"'"===l[t]&&"'"===l[t+2])&&(s=nR(l[t+1],i),c=nI**BigInt(l[t+1].length)-nO,t+=3)):"/"===l[t+1]||":"===l[t+1]?(o=nR(l[t],i),u=nR(l[t+2],nO),t+=3):"/"===l[t+3]&&" "===l[t+1]&&(a=nR(l[t],i),o=nR(l[t+2],i),u=nR(l[t+4],nO),t+=5),l.length<=t)i=r=s+(n=u*c)*a+c*o;else throw nV()}else if("bigint"==typeof e)r=e,i=e,n=nO;else throw nV();if(n===nB)throw nZ();nk.s=i<nB?-nO:nO,nk.n=r<nB?-r:r,nk.d=n<nB?-n:n};function n$(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function nG(e,t){if(nH(e,t),!(this instanceof nG))return nU(nk.s*nk.n,nk.d);e=n$(nk.d,nk.n),this.s=nk.s,this.n=nk.n/e,this.d=nk.d/e}let nZ=function(){return Error("Division by Zero")},nV=function(){return Error("Invalid argument")},nW=function(){return Error("Parameters must be integer")};nG.prototype={s:nO,n:nB,d:nO,abs:function(){return nU(this.n,this.d)},neg:function(){return nU(-this.s*this.n,this.d)},add:function(e,t){return nH(e,t),nU(this.s*this.n*nk.d+nk.s*this.d*nk.n,this.d*nk.d)},sub:function(e,t){return nH(e,t),nU(this.s*this.n*nk.d-nk.s*this.d*nk.n,this.d*nk.d)},mul:function(e,t){return nH(e,t),nU(this.s*nk.s*this.n*nk.n,this.d*nk.d)},div:function(e,t){return nH(e,t),nU(this.s*nk.s*this.n*nk.d,this.d*nk.n)},clone:function(){return nU(this.s*this.n,this.d)},mod:function(e,t){if(void 0===e)return nU(this.s*this.n%this.d,nO);if(nH(e,t),nB===nk.n*this.d)throw nZ();return nU(this.s*(nk.d*this.n)%(nk.n*this.d),nk.d*this.d)},gcd:function(e,t){return nH(e,t),nU(n$(nk.n,this.n)*n$(nk.d,this.d),nk.d*this.d)},lcm:function(e,t){return(nH(e,t),nk.n===nB&&this.n===nB)?nU(nB,nO):nU(nk.n*this.n,n$(nk.n,this.n)*n$(nk.d,this.d))},inverse:function(){return nU(this.s*this.d,this.n)},pow:function(e,t){if(nH(e,t),nk.d===nO)if(nk.s<nB)return nU((this.s*this.d)**nk.n,this.n**nk.n);else return nU((this.s*this.n)**nk.n,this.d**nk.n);if(this.s<nB)return null;let r=nL(this.n),n=nL(this.d),i=nO,a=nO;for(let e in r)if("1"!==e){if("0"===e){i=nB;break}if(r[e]*=nk.n,r[e]%nk.d!==nB)return null;r[e]/=nk.d,i*=BigInt(e)**r[e]}for(let e in n)if("1"!==e){if(n[e]*=nk.n,n[e]%nk.d!==nB)return null;n[e]/=nk.d,a*=BigInt(e)**n[e]}return nk.s<nB?nU(a,i):nU(i,a)},log:function(e,t){if(nH(e,t),this.s<=nB||nk.s<=nB)return null;let r=Object.create(null),n=nL(nk.n),i=nL(nk.d),a=nL(this.n),o=nL(this.d);for(let e in i)n[e]=(n[e]||nB)-i[e];for(let e in o)a[e]=(a[e]||nB)-o[e];for(let e in n)"1"!==e&&(r[e]=!0);for(let e in a)"1"!==e&&(r[e]=!0);let s=null,u=null;for(let e in r){let t=n[e]||nB,r=a[e]||nB;if(t===nB){if(r!==nB)return null;continue}let i=r,o=t,c=n$(i,o);if(i/=c,o/=c,null===s&&null===u)s=i,u=o;else if(i*u!=s*o)return null}return null!==s&&null!==u?nU(s,u):null},equals:function(e,t){return nH(e,t),this.s*this.n*nk.d==nk.s*nk.n*this.d},lt:function(e,t){return nH(e,t),this.s*this.n*nk.d<nk.s*nk.n*this.d},lte:function(e,t){return nH(e,t),this.s*this.n*nk.d<=nk.s*nk.n*this.d},gt:function(e,t){return nH(e,t),this.s*this.n*nk.d>nk.s*nk.n*this.d},gte:function(e,t){return nH(e,t),this.s*this.n*nk.d>=nk.s*nk.n*this.d},compare:function(e,t){nH(e,t);let r=this.s*this.n*nk.d-nk.s*nk.n*this.d;return(nB<r)-(r<nB)},ceil:function(e){return e=nI**BigInt(e||0),nU(nP(this.s*e*this.n/this.d)+(e*this.n%this.d>nB&&this.s>=nB?nO:nB),e)},floor:function(e){return e=nI**BigInt(e||0),nU(nP(this.s*e*this.n/this.d)-(e*this.n%this.d>nB&&this.s<nB?nO:nB),e)},round:function(e){return e=nI**BigInt(e||0),nU(nP(this.s*e*this.n/this.d)+this.s*((this.s>=nB?nO:nB)+n_*(e*this.n%this.d)>this.d?nO:nB),e)},roundTo:function(e,t){nH(e,t);let r=this.n*nk.d,n=this.d*nk.n,i=r%n,a=nP(r/n);return i+i>=n&&a++,nU(this.s*a*nk.n,nk.d)},divisible:function(e,t){return nH(e,t),nk.n!==nB&&this.n*nk.d%(nk.n*this.d)===nB},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,r=this.d,n=function(e){for(;e%n_===nB;e/=n_);for(;e%nq===nB;e/=nq);if(e===nO)return nB;let t=nI%e,r=1;for(;t!==nO;r++)if(t=t*nI%e,r>2e3)return nB;return BigInt(r)}(r),i=function(e,t){let r=nO,n=function(e,t,r){let n=nO;for(;t>nB;e=e*e%r,t>>=nO)t&nO&&(n=n*e%r);return n}(nI,t,e);for(let t=0;t<300;t++){if(r===n)return BigInt(t);r=r*nI%e,n=n*nI%e}return 0}(r,n),a=this.s<nB?"-":"";if(a+=nP(t/r),t%=r,(t*=nI)&&(a+="."),n){for(let e=i;e--;)a+=nP(t/r),t%=r,t*=nI;a+="(";for(let e=n;e--;)a+=nP(t/r),t%=r,t*=nI;a+=")"}else for(let n=e;t&&n--;)a+=nP(t/r),t%=r,t*=nI;return a},toFraction:function(e=!1){let t=this.n,r=this.d,n=this.s<nB?"-":"";if(r===nO)n+=t;else{let i=nP(t/r);e&&i>nB&&(n+=i,n+=" ",t%=r),n+=t,n+="/",n+=r}return n},toLatex:function(e=!1){let t=this.n,r=this.d,n=this.s<nB?"-":"";if(r===nO)n+=t;else{let i=nP(t/r);e&&i>nB&&(n+=i,t%=r),n+="\\frac{",n+=t,n+="}{",n+=r,n+="}"}return n},toContinued:function(){let e=this.n,t=this.d,r=[];for(;t;){r.push(nP(e/t));let n=e%t;e=t,t=n}return r},simplify:function(e=.001){let t=BigInt(Math.ceil(1/e)),r=this.abs(),n=r.toContinued();for(let e=1;e<n.length;e++){let i=nU(n[e-1],nO);for(let t=e-2;t>=0;t--)i=i.inverse().add(n[t]);let a=i.sub(r);if(a.n*t<a.d)return i.mul(this.s)}return this}};var nJ=tP("Fraction",[],()=>(Object.defineProperty(nG,"name",{value:"Fraction"}),nG.prototype.constructor=nG,nG.prototype.type="Fraction",nG.prototype.isFraction=!0,nG.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},nG.fromJSON=function(e){return new nG(e)},nG),{isClass:!0}),nQ=tP("Matrix",[],()=>{function e(){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0}),nX=tP("Range",[],()=>{function e(t,r,n){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator");var i=null!=t,a=null!=r,o=null!=n;if(i){if(v(t))t=t.toNumber();else if("number"!=typeof t&&!x(t))throw TypeError("Parameter start must be a number or bigint")}if(a){if(v(r))r=r.toNumber();else if("number"!=typeof r&&!x(r))throw TypeError("Parameter end must be a number or bigint")}if(o){if(v(n))n=n.toNumber();else if("number"!=typeof n&&!x(n))throw TypeError("Parameter step must be a number or bigint")}if(this.start=i?parseFloat(t):0,this.end=a?parseFloat(r):0,this.step=o?parseFloat(n):1,o&&rn(this.step,0))throw Error("Step must not be zero")}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var r=t.split(":").map(function(e){return parseFloat(e)});if(r.some(function(e){return isNaN(e)}))return null;switch(r.length){case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[2],r[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var e=0,t=this.start,r=this.step,n=this.end-t;return tK(r)===tK(n)?e=Math.ceil(n/r):0===n&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var t=this.start,r=this.step,n=this.end,i=0;if(r>0)for(;t<n;)e(t,[i],this),t+=r,i++;else if(r<0)for(;t>n;)e(t,[i],this),t+=r,i++},e.prototype.map=function(e){var t=[];return this.forEach(function(r,n,i){t[n[0]]=e(r,n,i)}),t},e.prototype.toArray=function(){var e=[];return this.forEach(function(t,r){e[r[0]]=t}),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=t8(this.start,e);return 1!==this.step&&(t+=":"+t8(this.step,e)),t+=":"+t8(this.end,e)},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0}),nY=tP("ResultSet",[],()=>{function e(t){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});function nK(e,t,r){var n=new e.constructor(2),i="";if(r){if(r<1)throw Error("size must be in greater than 0");if(!tX(r))throw Error("size must be an integer");if(e.greaterThan(n.pow(r-1).sub(1))||e.lessThan(n.pow(r-1).mul(-1)))throw Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw Error("Value must be an integer");e.lessThan(0)&&(e=e.add(n.pow(r))),i="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw Error("Base ".concat(t," not supported "))}}function n0(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function n1(e,t){return y(e)?e:v(e)?e.toNumber():t}function n2(e,t){var r=function(e,t){var r;if("number"==typeof e)return t8(e,t);if(v(e))return function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var r,n,i,a,o,s,u,{notation:c,precision:l,wordSize:p}=t6(t);switch(c){case"fixed":return r=e,n=l,r.toFixed(n);case"exponential":return n0(e,l);case"engineering":return i=e,a=l,s=(o=i.e)%3==0?o:o<0?o-3-o%3:o-o%3,(u=i.mul(Math.pow(10,-s)).toPrecision(a)).includes("e")&&(u=new i.constructor(u).toFixed()),u+"e"+(o>=0?"+":"")+s.toString();case"bin":return nK(e,2,p);case"oct":return nK(e,8,p);case"hex":return nK(e,16,p);case"auto":var f=n1(null==t?void 0:t.lowerExp,-3),d=n1(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";var m=e.toSignificantDigits(l),h=m.e;return(h>=f&&h<d?m.toFixed():n0(e,l)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+c+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,t);if((r=e)&&"object"==typeof r&&"bigint"==typeof r.s&&"bigint"==typeof r.n&&"bigint"==typeof r.d)if(!t||"decimal"!==t.fraction)return"".concat(e.s*e.n,"/").concat(e.d);else return e.toString();if(Array.isArray(e))return function e(t,r){if(!Array.isArray(t))return n2(t,r);for(var n="[",i=t.length,a=0;a<i;a++)0!==a&&(n+=", "),n+=e(t[a],r);return n+"]"}(e,t);if(w(e))return n3(e);if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e)if("function"==typeof e.format)return e.format(t);else return e&&e.toString(t)!==({}).toString()?e.toString(t):"{"+Object.keys(e).map(r=>n3(r)+": "+n2(e[r],t)).join(", ")+"}";return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function n3(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in n4?n4[i]:i,n++}return'"'+r+'"'}var n4={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function n5(e){var t=String(e);return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function n8(e,t){if(!w(e))throw TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+es(e)+", index: 0)");if(!w(t))throw TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+es(t)+", index: 1)");return e===t?0:e>t?1:-1}function n6(e,t,r){if(!(this instanceof n6))throw SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=Error().stack}function n7(e,t,r){if(!(this instanceof n7))throw SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=Error().stack}function n9(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ie(e,t){if(0===t.length){if(Array.isArray(e))throw new n6(e.length,0)}else!function e(t,r,n){var i,a=t.length;if(a!==r[n])throw new n6(a,r[n]);if(n<r.length-1){var o=n+1;for(i=0;i<a;i++){if(!Array.isArray(t[i]))throw new n6(r.length-1,r.length,"<");e(t[i],r,o)}}else for(i=0;i<a;i++)if(Array.isArray(t[i]))throw new n6(r.length+1,r.length,">")}(e,t,0)}function it(e,t){var r=e.isMatrix?e._size:n9(e);t._sourceSize.forEach((e,t)=>{if(null!==e&&e!==r[t])throw new n6(e,r[t])})}function ir(e,t){if(void 0!==e){if(!y(e)||!tX(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new n7(e,t)}}function ii(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&A(r._data)){if(0===r._size[0])return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(w(r)&&0===r.length)return!0}return!1}function ia(e,t,r){if(!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!y(e)||!tX(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+n2(t)+")")}),(y(e)||v(e))&&(e=[e]),function e(t,r,n,i){var a,o,s=t.length,u=r[n],c=Math.min(s,u);if(t.length=u,n<r.length-1){var l=n+1;for(a=0;a<c;a++)Array.isArray(o=t[a])||(o=[o],t[a]=o),e(o,r,l,i);for(a=c;a<u;a++)o=[],t[a]=o,e(o,r,l,i)}else{for(a=0;a<c;a++)for(;Array.isArray(t[a]);)t[a]=t[a][0];for(a=c;a<u;a++)t[a]=i}}(e,t,0,void 0!==r?r:0),e}function io(e,t){var r=ip(e,!0),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw new n6(0,n,"!=");var i=iu(t=is(t,n));if(n!==i)throw new n6(i,n,"!=");try{return function(e,t){for(var r,n=e,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,s=0;s<o;s++)r.push(n.slice(s*a,(s+1)*a));n=r}return n}(r,t)}catch(e){if(e instanceof n6)throw new n6(i,n,"!=");throw e}}function is(e,t){var r=iu(e),n=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw Error("More than one wildcard in sizes");if(i>=0)if(t%r==0)n[i]=-t/r;else throw Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function iu(e){return e.reduce((e,t)=>e*t,1)}function ic(e,t){for(var r=t||n9(e);Array.isArray(e)&&1===e.length;)e=e[0],r.shift();for(var n=r.length;1===r[n-1];)n--;return n<r.length&&(e=function e(t,r,n){var i,a;if(n<r){var o=n+1;for(i=0,a=t.length;i<a;i++)t[i]=e(t[i],r,o)}else for(;Array.isArray(t);)t=t[0];return t}(e,n,0),r.length=n),e}function il(e,t,r,n){var i=n||n9(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=function e(t,r,n){var i,a;if(Array.isArray(t)){var o=n+1;for(i=0,a=t.length;i<a;i++)t[i]=e(t[i],r,o)}else for(var s=n;s<r;s++)t=[t];return t}(e,t,0);i.length<t;)i.push(1);return e}function ip(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;if("boolean"!=typeof t)throw TypeError("Boolean expected for second argument of flatten");var r=[];return t?function e(t){if(Array.isArray(t[0]))for(var n=0;n<t.length;n++)e(t[n]);else for(var i=0;i<t.length;i++)r.push(t[i])}(e):function e(t){for(var n=0;n<t.length;n++){var i=t[n];Array.isArray(i)?e(i):r.push(i)}}(e),r}function id(e,t){return Array.prototype.map.call(e,t)}function im(e,t){Array.prototype.forEach.call(e,t)}function ih(e,t){if(1!==n9(e).length)throw Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function ig(e,t){if(1!==n9(e).length)throw Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,e=>t.test(e))}function iy(e,t){return Array.prototype.join.call(e,t)}function iv(e){if(!Array.isArray(e))throw TypeError("Array input expected");if(0===e.length)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function ix(e){if(!Array.isArray(e))throw TypeError("Array input expected");if(0===e.length)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function ib(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(0===i&&o&&(n=a.length),o&&a.length!==n)return;var s=o?ib(a,t):t(a);if(void 0===r)r=s;else if(r!==s)return"mixed"}return r}function iD(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(1===e.length)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,r){return function e(t,r,n,i){if(!(i<n))return t.concat(r);if(t.length!==r.length)throw new n6(t.length,r.length);for(var a=[],o=0;o<t.length;o++)a[o]=e(t[o],r[o],n,i+1);return a}(e,r,t,0)},e[0]);throw Error("Wrong number of arguments in function concat")}function iN(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(e=>e.length),i=Math.max(...n),a=Array(i).fill(null),o=0;o<t.length;o++)for(var s=t[o],u=n[o],c=0;c<u;c++){var l=i-u+c;s[c]>a[l]&&(a[l]=s[c])}for(var p=0;p<t.length;p++)iw(t[p],a);return a}function iw(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw Error("shape mismatch: mismatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function iA(e,t){var r,n,a,o=n9(e);if(el(o,t))return e;iw(o,t);var s=iN(o,t),u=s.length,c=[...Array(u-o.length).fill(1),...o],l=i([],e);o.length<u&&(o=n9(l=io(l,c)));for(var p=0;p<u;p++){o[p]<s[p]&&(o=n9((r=l,n=s[p],a=p,l=iD(...Array(n).fill(r),a))))}return l}function iE(e,t){if(!Array.isArray(e))throw Error("Array expected");var r=n9(e);if(t.length!==r.length)throw new n6(t.length,r.length);for(var n=0;n<t.length;n++)ir(t[n],r[n]);return t.reduce((e,t)=>e[t],e)}function iS(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return[];if(r)return function e(r){if(!Array.isArray(r))return t(r);for(var n=r.length,i=Array(n),a=0;a<n;a++)i[a]=e(r[a]);return i}(e);var n=[];return function r(i,a){if(!Array.isArray(i))return t(i,n.slice(0,a),e);for(var o=i.length,s=Array(o),u=0;u<o;u++)n[a]=u,s[u]=r(i[u],a+1);return s}(e,0)}function iC(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0!==e.length){if(r)return void function e(r){if(Array.isArray(r))for(var n=r.length,i=0;i<n;i++)e(r[i]);else t(r)}(e);var n=[];!function r(i,a){if(Array.isArray(i))for(var o=i.length,s=0;s<o;s++)n[a]=s,r(i[s],a+1);else t(i,n.slice(0,a),e)}(e,0)}}n6.prototype=RangeError(),n6.prototype.constructor=RangeError,n6.prototype.name="DimensionError",n6.prototype.isDimensionError=!0,n7.prototype=RangeError(),n7.prototype.constructor=RangeError,n7.prototype.name="IndexError",n7.prototype.isIndexError=!0;var iM=r(62369);function iF(e,t,r,n){if(iM.isTypedFunction(e)){if(n)i=1;else{var i,a,o=t.isMatrix?t.size():n9(t);if(!o.length||0===o[o.length-1])return{isUnary:n,fn:e};var s=o.map(()=>0);i=function(e,t,r,n){for(var i=[t,r,n],a=3;a>0;a--){var o=i.slice(0,a);if(null!==iM.resolve(e,o))return a}}(e,t.isMatrix?t.get(s):iE(t,s),s,t)}if(t.isMatrix&&"mixed"!==t.dataType&&void 0!==t.dataType){var u=function(e,t){var r=[];if(Object.entries(e.signatures).forEach(e=>{var[n,i]=e;n.split(",").length===t&&r.push(i)}),1===r.length)return r[0]}(e,i);a=void 0!==u?u:e}else a=e;return i>=1&&i<=3?{isUnary:1===i,fn:function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return iT(a,n.slice(0,i),r,e.name)}}:{isUnary:!1,fn:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return iT(a,n,r,e.name)}}}return void 0===n?{isUnary:function(e){if(1!==e.length)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var r=t.match(/\(.*?\)/);return!/\.\.\./.test(r)}(e),fn:e}:{isUnary:n,fn:e}}function iT(e,t,r,n){try{return e(...t)}catch(e){var i,a=e,o=t,s=r,u=n;if(a instanceof TypeError&&(null==(i=a.data)?void 0:i.category)==="wrongType"){var c=[];throw c.push("value: ".concat(es(o[0]))),o.length>=2&&c.push("index: ".concat(es(o[1]))),o.length>=3&&c.push("array: ".concat(es(o[2]))),TypeError("Function ".concat(s," cannot apply callback arguments ")+"".concat(u,"(").concat(c.join(", "),") at index ").concat(JSON.stringify(o[1])))}throw TypeError("Function ".concat(s," cannot apply callback arguments ")+"to function ".concat(u,": ").concat(a.message))}}var iB=tP("DenseMatrix",["Matrix","config"],e=>{var{Matrix:t,config:r}=e;function n(e,t){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw Error("Invalid datatype: "+t);if(E(e))"DenseMatrix"===e.type?(this._data=eu(e._data),this._size=eu(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&A(e.data)&&A(e.size))this._data=e.data,this._size=e.size,ie(this._data,this._size),this._datatype=t||e.datatype;else if(A(e))this._data=function e(t){return E(t)?e(t.valueOf()):A(t)?t.map(e):t}(e),this._size=n9(this._data),ie(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+es(e)+")");else this._data=[],this._size=[0],this._datatype=t}function i(e,t,r){if(0===t.length){for(var n=e._data;A(n);)n=n[0];return n}return e._size=t.slice(0),e._data=ia(e._data,e._size,r),e}function a(e,t,r){for(var n=e._size.slice(0),a=!1;n.length<t.length;)n.push(0),a=!0;for(var o=0,s=t.length;o<s;o++)t[o]>n[o]&&(n[o]=t[o],a=!0);a&&i(e,n,r)}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return ib(this._data,es)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,i){switch(arguments.length){case 1:return function(e,t){if(!T(t))throw TypeError("Invalid index");if(r.legacySubset?t.size().every(e=>1===e):t.isScalar())return e.get(t.min());var i,a,o,s,u=t.size();if(u.length!==e._size.length)throw new n6(u.length,e._size.length);for(var c=t.min(),l=t.max(),p=0,f=e._size.length;p<f;p++)ir(c[p],e._size[p]),ir(l[p],e._size[p]);var d=new n,m=(i=e._data,s=Array(o=(a=t).size().length-1),{data:function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=a.dimension(r);function i(e,t){return y(e)?t(e):e.map(t).valueOf()}return(y(n)?s[r]=null:s[r]=n.size()[0],r<o)?i(n,n=>(ir(n,t.length),e(t[n],r+1))):i(n,e=>(ir(e,t.length),t[e]))}(i),size:s.filter(e=>null!==e)});return d._size=m.size,d._datatype=e._datatype,d._data=m.data,r.legacySubset?d.reshape(t.size()):d}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var i,o=t.size(),s=t.isScalar();if(E(r)?(i=r.size(),r=r.valueOf()):i=n9(r),s){if(0!==i.length)throw TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(!el(i,o)){if(0===i.length)r=iA([r],o);else try{r=iA(r,o)}catch(e){}i=n9(r)}if(o.length<e._size.length)throw new n6(o.length,e._size.length,"<");if(i.length<o.length){for(var u,c,l,p,f=0,d=0;1===o[f]&&1===i[f];)f++;for(;1===o[f];)d++,f++;r=il(r,o.length,d,i)}if(!el(o,i))throw new n6(o,i,">");a(e,t.max().map(function(e){return e+1}),n),u=e._data,c=t,l=r,p=c.size().length-1,function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=c.dimension(n),a=(i,a)=>{ir(i,t.length),e(t[i],r[a[0]],n+1)},o=(e,n)=>{ir(e,t.length),t[e]=r[n[0]]};n<p?y(i)?a(i,[0]):i.forEach(a):y(i)?o(i,[0]):i.forEach(o)}(u,l)}return e}(this,e,t,i);default:throw SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){return iE(this._data,e)},n.prototype.set=function(e,t,r){if(!A(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new n6(e.length,this._size.length,"<");a(this,e.map(function(e){return e+1}),r);var n,i,o,s=this._data;for(n=0,i=e.length-1;n<i;n++)ir(o=e[n],s.length),s=s[o];return ir(o=e[e.length-1],s.length),s[o]=t,this},n.prototype.resize=function(e,t,r){if(!S(e))throw TypeError("Array or Matrix expected");var n=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return i(r?this.clone():this,n,t)},n.prototype.reshape=function(e,t){var r=t?this.clone():this;r._data=io(r._data,e);var n=r._size.reduce((e,t)=>e*t);return r._size=is(e,n),r},n.prototype.clone=function(){return new n({data:eu(this._data),size:eu(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this,n=r._size.length-1;if(n<0)return r.clone();var i=iF(e,r,"map",t),a=i.fn,o=r.create(void 0,r._datatype);if(o._size=r._size,t||i.isUnary)return o._data=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Array(t.length);if(r<n)for(var o=0;o<t.length;o++)i[o]=e(t[o],r+1);else for(var s=0;s<t.length;s++)i[s]=a(t[s]);return i}(r._data),o;if(0===n){for(var s=r.valueOf(),u=Array(s.length),c=0;c<s.length;c++)u[c]=a(s[c],[c],r);return o._data=u,o}var l=[];return o._data=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=Array(t.length);if(i<n)for(var s=0;s<t.length;s++)l[i]=s,o[s]=e(t[s],i+1);else for(var u=0;u<t.length;u++)l[i]=u,o[u]=a(t[u],l.slice(),r);return o}(r._data),o},n.prototype.forEach=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this,n=r._size.length-1;if(!(n<0)){var i=iF(e,r,"map",t),a=i.fn;if(t||i.isUnary)return void function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(r<n)for(var i=0;i<t.length;i++)e(t[i],r+1);else for(var o=0;o<t.length;o++)a(t[o])}(r._data);if(0===n){for(var o=0;o<r._data.length;o++)a(r._data[o],[o],r);return}var s=[];!function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(i<n)for(var o=0;o<t.length;o++)s[i]=o,e(t[o],i+1);else for(var u=0;u<t.length;u++)s[i]=u,a(t[u],s.slice(),r)}(r._data)}},n.prototype[Symbol.iterator]=function*(){var e=this._size.length-1;if(!(e<0)){if(0===e){for(var t=0;t<this._data.length;t++)yield{value:this._data[t],index:[t]};return}for(var r=Array(e+1).fill(0),n=this._size.reduce((e,t)=>e*t,1),i=0;i<n;i++){for(var a=this._data,o=0;o<e;o++)a=a[r[o]];yield{value:a[r[e]],index:r.slice()};for(var s=e;s>=0&&(r[s]++,!(r[s]<this._size[s]));s--)r[s]=0}}},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var t of this._data)e.push(new n([t],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],r=this.size();if(2!==r.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,a=function(r){var a=i.map(e=>[e[r]]);t.push(new n(a,e._datatype))},o=0;o<r[1];o++)a(o);return t},n.prototype.toArray=function(){return eu(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return n2(this._data,e)},n.prototype.toString=function(){return n2(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(v(e)&&(e=e.toNumber()),!y(e)||!tX(e))throw TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=Math.min(this._size[0]-r,this._size[1]-t),a=[],o=0;o<i;o++)a[o]=this._data[o+r][o+t];return new n({data:a,size:[i],datatype:this._datatype})},n.diagonal=function(e,t,r,i){if(!A(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(v(e)&&(e=e.toNumber()),!y(e)||!tX(e)||e<1)throw Error("Size values must be positive integers");return e}),r){if(v(r)&&(r=r.toNumber()),!y(r)||!tX(r))throw TypeError("The parameter k must be an integer number")}else r=0;var a,o=r>0?r:0,s=r<0?-r:0,u=e[0],c=e[1],l=Math.min(u-s,c-o);if(A(t)){if(t.length!==l)throw Error("Invalid value array length");a=function(e){return t[e]}}else if(E(t)){var p=t.size();if(1!==p.length||p[0]!==l)throw Error("Invalid matrix length");a=function(e){return t.get([e])}}else a=function(){return t};i||(i=v(a(0))?a(0).mul(0):0);var f=[];if(e.length>0){f=ia(f,e,i);for(var d=0;d<l;d++)f[d+s][d+o]=a(d)}return new n({data:f,size:[u,c]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!y(e)||!tX(e)||!y(t)||!tX(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return ir(e,this._size[0]),ir(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,r){var n=r[e];r[e]=r[t],r[t]=n},n},{isClass:!0}),iO=tP("replacer",[],()=>function(e,t){return"number"==typeof t&&(!Number.isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:"bigint"==typeof t?{mathjs:"bigint",value:String(t)}:t}),i_=function(){return i_=iM.create,iM},iz=tP("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=i_();return a.clear(),a.addTypes([{name:"number",test:y},{name:"Complex",test:b},{name:"BigNumber",test:v},{name:"bigint",test:x},{name:"Fraction",test:D},{name:"Unit",test:N},{name:"identifier",test:e=>w&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)},{name:"string",test:w},{name:"Chain",test:eo},{name:"Array",test:A},{name:"Matrix",test:E},{name:"DenseMatrix",test:C},{name:"SparseMatrix",test:M},{name:"Range",test:F},{name:"Index",test:T},{name:"boolean",test:B},{name:"ResultSet",test:O},{name:"Help",test:_},{name:"function",test:z},{name:"Date",test:q},{name:"RegExp",test:I},{name:"null",test:j},{name:"undefined",test:L},{name:"AccessorNode",test:H},{name:"ArrayNode",test:$},{name:"AssignmentNode",test:G},{name:"BlockNode",test:Z},{name:"ConditionalNode",test:V},{name:"ConstantNode",test:W},{name:"FunctionNode",test:X},{name:"FunctionAssignmentNode",test:Q},{name:"IndexNode",test:Y},{name:"Node",test:K},{name:"ObjectNode",test:ee},{name:"OperatorNode",test:et},{name:"ParenthesisNode",test:er},{name:"RangeNode",test:en},{name:"RelationalNode",test:ei},{name:"SymbolNode",test:ea},{name:"Map",test:R},{name:"Object",test:k}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||iq(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||iI(e),new r(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return r||iI(e),new r(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e+")");return Number(e)}},{from:"bigint",to:"BigNumber",convert:function(e){return t||iq(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return i||ik(e),new i(e)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||iI(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||ik(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||iq(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){i||ik(e);try{return new i(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||iI(e);try{return new r(e)}catch(t){throw Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||iq(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||ik(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&S(t[0])&&r.some(e=>!e.params.includes(","))){var i=TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&S(t[0])&&r.some(e=>!e.params.includes(","))){var i=TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},a});function iq(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function iI(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function ik(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}function iR(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r<i;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);a.push(o)}return a}function iP(e){for(var t=0;t<e.length;t++)if(S(e[t]))return!0;return!1}function iU(e,t){E(e)?e.forEach(e=>t(e),!1,!0):iC(e,t,!0)}function ij(e,t,r){if(!r)if(E(e))return e.map(e=>t(e),!1,!0);else return iS(e,t,!0);var n=e=>0===e?e:t(e);return E(e)?e.map(e=>n(e),!1,!0):iS(e,n,!0)}function iL(e,t,r){var n=Array.isArray(e)?n9(e):e.size();if(t<0||t>=n.length)throw new n7(t,n.length);return E(e)?e.create(iH(e.valueOf(),t,r),e.datatype()):iH(e,t,r)}function iH(e,t,r){var n,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(n=0,o=iR(e),i=[];n<o.length;n++)i[n]=iH(o[n],t-1,r);return i}else{for(n=1,a=e[0];n<e.length;n++)a=r(a,e[n]);return a}for(n=0,i=[];n<e.length;n++)i[n]=iH(e[n],t-1,r);return i}function i$(e,t,r,n,i,a,o,s,u,c,l){var p,f,d,m,h=e._values,g=e._index,y=e._ptr;if(n)for(f=y[t],d=y[t+1],p=f;p<d;p++)r[m=g[p]]!==a?(r[m]=a,o.push(m),c?(n[m]=u?s(h[p],l):s(l,h[p]),i[m]=a):n[m]=h[p]):(n[m]=u?s(h[p],n[m]):s(n[m],h[p]),i[m]=a);else for(f=y[t],d=y[t+1],p=f;p<d;p++)r[m=g[p]]!==a?(r[m]=a,o.push(m)):i[m]=a}var iG="number",iZ="number, number";function iV(e){return Math.abs(e)}function iW(e,t){return e+t}function iJ(e,t){return e-t}function iQ(e,t){return e*t}function iX(e){return-e}function iY(e){return e}function iK(e){return t3(e)}function i0(e){return e*e*e}function i1(e){return Math.exp(e)}function i2(e){return t4(e)}function i3(e,t){if(!tX(e)||!tX(t))throw Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}function i4(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function i5(e){return t1(e)}function i8(e){return t0(e)}function i6(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=t<0;if(r&&(t=-t),0===t)throw Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function i7(e){return tK(e)}function i9(e){return e*e}function ae(e,t){var r,n,i,a=0,o=1,s=1,u=0;if(!tX(e)||!tX(t))throw Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=a,a=o-n*a,o=r,r=s,s=u-n*s,u=r,e=t,t=i;return e<0?[-e,-o,-u]:[e,e?o:0,u]}function at(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function ar(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!tX(t)||t<0||t>15)throw Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(t9(e,t))}iV.signature=iG,iW.signature=iZ,iJ.signature=iZ,iQ.signature=iZ,iX.signature=iG,iY.signature=iG,iK.signature=iG,i0.signature=iG,i1.signature=iG,i2.signature=iG,i3.signature=iZ,i5.signature=iG,i8.signature=iG,i7.signature=iG,i9.signature=iG,ae.signature=iZ,at.signature=iZ;var an=tP("abs",["typed"],e=>{var{typed:t}=e;return t("abs",{number:iV,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0))})}),ai="acos",aa=tP(ai,["typed","config","Complex"],e=>{var{typed:t,config:r,Complex:n}=e;return t(ai,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})}),ao="number";function as(e){return Math.atan(1/e)}function au(e){return Number.isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function ac(e){return Math.asin(1/e)}function al(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function ap(e){return Math.acos(1/e)}function af(e){var t=1/e;return Math.log(Math.sqrt(t*t-1)+t)}function ad(e){return ra(e)}as.signature=ao,au.signature=ao,ac.signature=ao,al.signature=ao,ap.signature=ao,af.signature=ao,ad.signature=ao;function am(e){return 1/Math.tan(e)}function ah(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function ag(e){return 1/Math.sin(e)}function ay(e){return 0===e?1/0:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*tK(e)}function av(e){return 1/Math.cos(e)}function ax(e){return 2/(Math.exp(e)+Math.exp(-e))}function ab(e){return ru(e)}am.signature=ao,ah.signature=ao,ag.signature=ao,ay.signature=ao,av.signature=ao,ax.signature=ao,ab.signature=ao;var aD="acot",aN=tP(aD,["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t(aD,{number:as,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})}),aw="acsc",aA=tP(aw,["typed","config","Complex","BigNumber"],e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(aw,{number:function(e){return e<=-1||e>=1||r.predictable?ac(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})}),aE="addScalar",aS=tP(aE,["typed"],e=>{var{typed:t}=e;return t(aE,{"number, number":iW,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"bigint, bigint":function(e,t){return e+t},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf(e=>(r,n)=>{if(null===r.value||void 0===r.value)throw Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),aC=tP("arg",["typed"],e=>{var{typed:t}=e;return t("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),aM="asech",aF=tP(aM,["typed","config","Complex","BigNumber"],e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(aM,{number:function(e){if(e<=1&&e>=-1||r.predictable){var t=1/e;return t>0||r.predictable?af(e):new n(Math.log(Math.sqrt(t*t-1)-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})}),aT=tP("asinh",["typed"],e=>{var{typed:t}=e;return t("asinh",{number:ad,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})}),aB=tP("atan",["typed"],e=>{var{typed:t}=e;return t("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})}),aO="atanh",a_=tP(aO,["typed","config","Complex"],e=>{var{typed:t,config:r,Complex:n}=e;return t(aO,{number:function(e){return e<=1&&e>=-1||r.predictable?ro(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})}),az=tP("bigint",["typed"],e=>{var{typed:t}=e,r=t("bigint",{"":function(){return 0n},bigint:function(e){return e},number:function(e){return BigInt(e.toFixed())},BigNumber:function(e){return BigInt(e.round().toString())},Fraction:function(e){return BigInt(e.valueOf().toFixed())},"string | boolean":function(e){return BigInt(e)},null:function(e){return 0n},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))});return r.fromJSON=function(e){return BigInt(e.value)},r});function aq(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return aR(e,t,function(e,t){return e&t})}function aI(e){if(e.isFinite()&&!e.isInteger())throw Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function ak(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?aR(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function aR(e,t,r){var n,i,a,o,s,u=e.constructor,c=+(e.s<0),l=+(t.s<0);if(c){n=aP(aI(e));for(var p=0;p<n.length;++p)n[p]^=1}else n=aP(e);if(l){i=aP(aI(t));for(var f=0;f<i.length;++f)i[f]^=1}else i=aP(t);n.length<=i.length?(a=n,o=i,s=c):(a=i,o=n,s=l);var d=a.length,m=o.length,h=1^r(c,l),g=new u(1^h),y=new u(1),v=new u(2),x=u.precision;for(u.config({precision:1e9});d>0;)r(a[--d],o[--m])===h&&(g=g.plus(y)),y=y.times(v);for(;m>0;)r(s,o[--m])===h&&(g=g.plus(y)),y=y.times(v);return u.config({precision:x}),0===h&&(g.s=-g.s),g}function aP(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;"0"===r.charAt(o);)o--;var s=e.e,u=r.slice(0,o+1||1),c=u.length;if(s>0)if(++s>c)for(s-=c;s--;)u+="0";else s<c&&(u=u.slice(0,s)+"."+u.slice(s));for(var l=[0],p=0;p<u.length;){for(var f=l.length;f--;)l[f]*=10;l[0]+=parseInt(u.charAt(p++));for(var d=0;d<l.length;++d)l[d]>1&&((null===l[d+1]||void 0===l[d+1])&&(l[d+1]=0),l[d+1]+=l[d]>>1,l[d]&=1)}return l.reverse()}function aU(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?aI(t):t.eq(n)?aI(e):e.isFinite()&&t.isFinite()?aR(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function aj(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}function aL(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():new r(e.isNegative()?-1:e.isFinite()?0:NaN)}var aH="number, number";function a$(e,t){if(!tX(e)||!tX(t))throw Error("Integers expected in function bitAnd");return e&t}function aG(e){if(!tX(e))throw Error("Integer expected in function bitNot");return~e}function aZ(e,t){if(!tX(e)||!tX(t))throw Error("Integers expected in function bitOr");return e|t}function aV(e,t){if(!tX(e)||!tX(t))throw Error("Integers expected in function bitXor");return e^t}function aW(e,t){if(!tX(e)||!tX(t))throw Error("Integers expected in function leftShift");return e<<t}function aJ(e,t){if(!tX(e)||!tX(t))throw Error("Integers expected in function rightArithShift");return e>>t}function aQ(e,t){if(!tX(e)||!tX(t))throw Error("Integers expected in function rightLogShift");return e>>>t}a$.signature=aH,aG.signature="number",aZ.signature=aH,aV.signature=aH,aW.signature=aH,aJ.signature=aH,aQ.signature=aH;var aX="bitNot",aY=tP(aX,["typed"],e=>{var{typed:t}=e;return t(aX,{number:aG,BigNumber:aI,bigint:e=>~e,"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),aK="boolean",a0=tP(aK,["typed"],e=>{var{typed:t}=e;return t(aK,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;var r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),a1="clone",a2=tP(a1,["typed"],e=>{var{typed:t}=e;return t(a1,{any:eu})});function a3(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return a3(e,r)*a3(r+1,t)}function a4(e,t){if(!tX(e)||e<0||!tX(t)||t<0)throw TypeError("Positive integer value expected in function combinations");if(t>e)throw TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t<r?r+1:t+1,a=2,o=t<r?t:r,s=i;s<=e;++s)for(n*=s;a<=o&&n%a==0;)n/=a,++a;return a<=o&&(n/=a3(a,o)),n}a4.signature="number, number";var a5="combinations",a8=tP(a5,["typed"],e=>{var{typed:t}=e;return t(a5,{"number, number":a4,"BigNumber, BigNumber":function(e,t){var r,n,i=e.constructor,a=e.minus(t),o=new i(1);if(!a6(e)||!a6(t))throw TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw TypeError("k must be less than n in function combinations");if(r=o,t.lt(a))for(n=o;n.lte(a);n=n.plus(o))r=r.times(t.plus(n)).dividedBy(n);else for(n=o;n.lte(t);n=n.plus(o))r=r.times(a.plus(n)).dividedBy(n);return r}})});function a6(e){return e.isInteger()&&e.gte(0)}var a7=tP("complex",["typed","Complex"],e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),a9="conj",oe=tP(a9,["typed"],e=>{var{typed:t}=e;return t(a9,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),Unit:t.referToSelf(e=>t=>new t.constructor(e(t.toNumeric()),t.formatUnits())),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),ot=tP("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(e=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw TypeError("Unit in function cot is no angle");return t.find(e,r.valueType())(r.value)})}}),or=tP("cos",["typed"],e=>{var{typed:t}=e,r=ot({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},r)}),on=tP("cot",["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e,n=ot({typed:t});return t("cot",{number:am,Complex:e=>e.cot(),BigNumber:e=>new r(1).div(e.tan())},n)}),oi=tP("csc",["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e,n=ot({typed:t});return t("csc",{number:ag,Complex:e=>e.csc(),BigNumber:e=>new r(1).div(e.sin())},n)}),oa="cube",oo=tP(oa,["typed"],e=>{var{typed:t}=e;return t(oa,{number:i0,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},bigint:function(e){return e*e*e},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})});function os(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r<=0)throw Error("Relative tolerance must be greater than 0");if(n<0)throw Error("Absolute tolerance must be at least 0");return!(e.isNaN()||t.isNaN())&&(e.isFinite()&&t.isFinite()?!!e.eq(t)||e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n)):e.eq(t))}var ou=tP("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(e=>(r,n)=>{if(!r.equalBase(n))throw Error("Cannot compare units with different base");return t.find(e,[r.valueType(),n.valueType()])(r.value,n.value)})}}),oc="equalScalar",ol=tP(oc,["typed","config"],e=>{var{typed:t,config:r}=e,n=ou({typed:t});return t(oc,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return rn(e,t,r.relTol,r.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||os(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){var n,i;return n=r.relTol,i=r.absTol,rn(e.re,t.re,n,i)&&rn(e.im,t.im,n,i)}},n)});tP(oc,["typed","config"],e=>{var{typed:t,config:r}=e;return t(oc,{"number, number":function(e,t){return rn(e,t,r.relTol,r.absTol)}})});var op=tP("erf",["typed"],e=>{var{typed:t}=e;return t("name",{number:function(e){var t=Math.abs(e);return t>=og?tK(e):t<=of?tK(e)*function(e){var t,r=e*e,n=om[0][4]*r,i=r;for(t=0;t<3;t+=1)n=(n+om[0][t])*r,i=(i+oh[0][t])*r;return e*(n+om[0][3])/(i+oh[0][3])}(t):t<=4?tK(e)*(1-function(e){var t,r=om[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+om[1][t])*e,n=(n+oh[1][t])*e;var i=(r+om[1][7])/(n+oh[1][7]),a=parseInt(16*e)/16;return Math.exp(-a*a)*Math.exp(-((e-a)*(e+a)))*i}(t)):tK(e)*(1-function(e){var t,r=1/(e*e),n=om[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+om[2][t])*r,i=(i+oh[2][t])*r;var a=r*(n+om[2][4])/(i+oh[2][4]);a=(od-a)/e,r=parseInt(16*e)/16;var o=(e-r)*(e+r);return Math.exp(-r*r)*Math.exp(-o)*a}(t))},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),of=.46875,od=.5641895835477563,om=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,6587491615298378e-19,.016315387137302097]],oh=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],og=0x20000000000000,oy=tP("exp",["typed"],e=>{var{typed:t}=e;return t("exp",{number:i1,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})}),ov="expm1",ox=tP(ov,["typed","Complex"],e=>{var{typed:t,Complex:r}=e;return t(ov,{number:i2,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})}),ob=tP("filter",["typed"],e=>{var{typed:t}=e;return t("filter",{"Array, function":oD,"Matrix, function":function(e,t){return e.create(oD(e.valueOf(),t),e.datatype())},"Array, RegExp":ig,"Matrix, RegExp":function(e,t){return e.create(ig(e.valueOf(),t),e.datatype())}})});function oD(e,t){var r=iF(t,e,"filter");return r.isUnary?ih(e,r.fn):ih(e,function(e,t,n){return r.fn(e,[t],n)})}var oN="flatten",ow=tP(oN,["typed"],e=>{var{typed:t}=e;return t(oN,{Array:function(e){return ip(e)},DenseMatrix:function(e){return e.create(ip(e.valueOf(),!0),e.datatype())},SparseMatrix:function(e){throw TypeError("SparseMatrix is not supported by function flatten because it does not support 1D vectors. Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())")}})}),oA="forEach",oE=tP(oA,["typed"],e=>{var{typed:t}=e;return t(oA,{"Array, function":oS,"Matrix, function":function(e,t){e.forEach(t)}})});function oS(e,t){var r=iF(t,e,oA);iC(e,r.fn,r.isUnary)}var oC="format",oM=tP(oC,["typed"],e=>{var{typed:t}=e;return t(oC,{any:n2,"any, Object | function | number | BigNumber":n2})}),oF="getMatrixDataType",oT=tP(oF,["typed"],e=>{var{typed:t}=e;return t(oF,{Array:function(e){return ib(e,es)},Matrix:function(e){return e.getDataType()}})}),oB=tP("hex",["typed","format"],e=>{var{typed:t,format:r}=e;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"hex",wordSize:t})}})}),oO=tP("im",["typed"],e=>{var{typed:t}=e;return t("im",{number:()=>0,"BigNumber | Fraction":e=>e.mul(0),Complex:e=>e.im,"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),o_="isBounded",oz=tP(o_,["typed"],e=>{var{typed:t}=e;return t(o_,{number:e=>Number.isFinite(e),"BigNumber | Complex":e=>e.isFinite(),"bigint | Fraction":()=>!0,"null | undefined":()=>!1,Unit:t.referToSelf(e=>t=>e(t.value)),"Array | Matrix":t.referToSelf(e=>t=>(Array.isArray(t)||(t=t.valueOf()),t.every(t=>e(t))))})}),oq="number";function oI(e){return Number.isNaN(e)}oI.signature=oq;var ok="isNaN",oR=tP(ok,["typed"],e=>{var{typed:t}=e;return t(ok,{number:oI,BigNumber:function(e){return e.isNaN()},bigint:function(e){return!1},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),oP="isNumeric",oU=tP(oP,["typed"],e=>{var{typed:t}=e;return t(oP,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),oj="isPrime",oL=tP(oj,["typed"],e=>{var{typed:t}=e;return t(oj,{number:function(e){if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},bigint:function(e){if(e<=3n)return e>1n;if(e%2n===0n||e%3n===0n)return!1;for(var t=5n;t*t<=e;t+=6n)if(e%t===0n||e%(t+2n)===0n)return!1;return!0},BigNumber:function(e){if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(0x100000000)){for(var t=e.toNumber(),r=5;r*r<=t;r+=6)if(t%r==0||t%(r+2)==0)return!1;return!0}e=new(e.constructor.clone({precision:2*e.toFixed(0).length}))(e);for(var n=0,i=e.sub(1);i.mod(2).eq(0);)i=i.div(2),n+=1;var a=null;if(e.lt("3317044064679887385961981"))a=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(t=>t<e);else{var o=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));a=[];for(var s=2;s<=o;s+=1)a.push(o)}for(var u=0;u<a.length;u+=1){var c=a[u],l=function(e,t,r){for(var n=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}(e.sub(e).add(c),i,e);if(!l.eq(1)){for(var p=0,f=l;!f.eq(e.sub(1));p+=1,f=f.mul(f).mod(e))if(p===n-1)return!1}}return!0},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})});function oH(e){if(tX(e))return e<=0?Number.isFinite(e)?1/0:NaN:e>171?1/0:a3(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*oH(1-e));if(e>=171.35)return 1/0;if(e>85){var t,r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(0xc756000*a)+5246819/(0x11850f0000*a*e))}--e,t=oG[0];for(var o=1;o<oG.length;++o)t+=oG[o]/(e+o);var s=e+o$+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,e+.5)*Math.exp(-s)*t}oH.signature="number";var o$=4.7421875,oG=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,1580887032249125e-19,-21026444172410488e-20,21743961811521265e-20,-1643181065367639e-19,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],oZ=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function oV(e){if(e<0)return NaN;if(0===e)return 1/0;if(!Number.isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-oV(1-e);for(var t=(e-=1)+5+.5,r=oZ[0],n=6;n>=1;n--)r+=oZ[n]/(e+n);return .9189385332046728+(e+.5)*Math.log(t)-t+Math.log(r)}oV.signature="number";var oW="lgamma",oJ=tP(oW,["Complex","typed"],e=>{var{Complex:t,typed:r}=e,n=[-.029550653594771242,.00641025641025641,-.0019175269175269176,8417508417508417e-19,-5952380952380953e-19,7936507936507937e-19,-.002777777777777778,.08333333333333333];return r(oW,{number:oV,Complex:function e(r){if(r.isNaN())return new t(NaN,NaN);if(0===r.im)return new t(oV(r.re),0);if(r.re>=7||Math.abs(r.im)>=7)return i(r);if(r.re<=.1){var n,o=(!0^((n=r.im)>0||!(n<0)&&1/n==1/0)?-6.283185307179586:6.283185307179586)*Math.floor(.5*r.re+.25),s=r.mul(Math.PI).sin().log(),u=e(new t(1-r.re,-r.im));return new t(1.1447298858494002,o).sub(s).sub(u)}if(r.im>=0)return a(r);else return a(r.conjugate()).conjugate()},BigNumber:function(){throw Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(e){for(var r=e.sub(.5).mul(e.log()).sub(e).add(.9189385332046728),i=new t(1,0).div(e),a=i.div(e),o=n[0],s=n[1],u=2*a.re,c=a.re*a.re+a.im*a.im,l=2;l<8;l++){var p=s;s=-c*o+n[l],o=u*o+p}var f=i.mul(a.mul(o).add(s));return r.add(f)}function a(e){var r=0,n=0,a=e;for(e=e.add(1);e.re<=7;){var o=+((a=a.mul(e)).im<0);0!==o&&0===n&&r++,n=o,e=e.add(1)}return i(e).sub(a.log()).sub(new t(0,2*r*Math.PI*1))}});function oQ(e,t,r,n){return function(i){if(i>0||r.predictable){if(i<=0)return NaN;var a=i.toString(16),o=a.substring(0,15);return e*(a.length-o.length)+t(Number("0x"+o))}return n(i.toNumber())}}var oX="log10",oY=i5(16),oK=tP(oX,["typed","config","Complex"],e=>{var{typed:t,config:r,Complex:n}=e;function i(e){return e.log().div(Math.LN10)}function a(e){return i(new n(e,0))}return t(oX,{number:function(e){return e>=0||r.predictable?i5(e):a(e)},bigint:oQ(oY,i5,r,a),Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():a(e.toNumber())},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),o0="log2",o1=tP(o0,["typed","config","Complex"],e=>{var{typed:t,config:r,Complex:n}=e;function i(e){return a(new n(e,0))}return t(o0,{number:function(e){return e>=0||r.predictable?i8(e):i(e)},bigint:oQ(4,i8,r,i),Complex:a,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(e.toNumber())},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))});function a(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}),o2=tP("map",["typed"],e=>{var{typed:t}=e;return t("map",{"Array, function":n,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,i,a)=>(function(e,i){if("function"!=typeof i)throw Error("Last argument must be a callback function");var a,o,s,u,c=e[0].isMatrix,l=e.map(e=>e.isMatrix?e.size():n9(e)),p=iN(...l),f=e.length,d=c?(e,t)=>e.get(t):iE,m=e.map((e,t)=>{var r=l[t].map(()=>0);return e.isMatrix?e.get(r):iE(e,r)}),h=t.isTypedFunction(i)?(a=i,o=m,s=p.map(()=>0),u=e,null!==t.resolve(a,[...o,s,...u])?2:null!==t.resolve(a,[...o,s])?1:(t.resolve(a,o),0)):function(e,t){var r=e.toString();if(/arguments/.test(r))return 2;var n=r.match(/\(.*?\)/);return/\.\.\./.test(n)||e.length>t+1?2:+(e.length===t+1)}(i,f);if(h<2)return function(e,t){var r=e[0],n=e.map(e=>e.isMatrix?e.valueOf():e),i=e.map(e=>e.isMatrix?e.size():n9(e)),a=iN(...i),o=i.map(e=>a.length-e.length),s=a.length-1,u=t.length>1?[]:null,c=function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=a[n],c=Array(i);if(n<s)for(var l=function(t){u&&(u[n]=t),c[t]=e(r.map((e,r)=>o[r]>n?e:1===e.length?e[0]:e[t]),n+1)},p=0;p<i;p++)l(p);else for(var f=function(e){u&&(u[n]=e),c[e]=t(r.map(t=>1===t.length?t[0]:t[e]),u?u.slice():void 0)},d=0;d<i;d++)f(d);return c}(n,0);if(!r.isMatrix)return c;var l=r.create();return l._data=c,l._size=a,l}(e,r(h,i,null));var g=c?e.map(t=>t.isMatrix?t.create(iA(t.toArray(),p),t.datatype()):e[0].create(iA(t.valueOf(),p))):e.map(e=>e.isMatrix?iA(e.toArray(),p):iA(e,p)),y=r(h,i,g),v=(e,t)=>y([e,...g.slice(1).map(e=>d(e,t))],t);return c?g[0].map(v):n(g[0],v)})([e,i,...a.slice(0,a.length-1)],a[a.length-1])});function r(e,t,r){switch(e){case 0:return e=>t(...e);case 1:return(e,r)=>t(...e,r);case 2:return(e,n)=>t(...e,n,...r)}}function n(e,t){var r=iF(t,e,"map");return iS(e,r.fn,r.isUnary)}}),o3="mode",o4=tP(o3,["typed","isNaN","isNumeric"],e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(o3,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=ip(e.valueOf())).length)throw Error("Cannot calculate mode of an empty array");for(var t={},i=[],a=0,o=0;o<e.length;o++){var s=e[o];if(n(s)&&r(s))throw Error("Cannot calculate mode of an array containing NaN values");s in t||(t[s]=0),t[s]++,t[s]===a?i.push(s):t[s]>a&&(a=t[s],i=[s])}return i}}),o5=tP("multiplyScalar",["typed"],e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":iQ,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"bigint, bigint":function(e,t){return e*t},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":(e,t)=>t.multiply(e),"Unit, number | Fraction | BigNumber | Complex | Unit":(e,t)=>e.multiply(t)})}),o8="number, number";function o6(e){return!e}function o7(e,t){return!!(e||t)}function o9(e,t){return!!e!=!!t}function se(e,t){return!!(e&&t)}o6.signature="number",o7.signature=o8,o9.signature=o8,se.signature=o8;var st=tP("not",["typed"],e=>{var{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:o6,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:t.referToSelf(e=>r=>t.find(e,r.valueType())(r.value)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),sr=tP("number",["typed"],e=>{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=function(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(!t)return null;var r={"0b":2,"0o":8,"0x":16}[t[1]];return{input:e,radix:r,integerPart:t[2],fractionalPart:t[3]}}(e);if(t){for(var r=parseInt(t.integerPart,t.radix),n=0,i=0;i<t.fractionalPart.length;i++)n+=parseInt(t.fractionalPart[i],t.radix)/Math.pow(t.radix,i+1);var a=r+n;if(isNaN(a))throw SyntaxError('String "'+t.input+'" is not a valid number');return a}var o=0,s=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);s&&(o=Number(s[2]),e=s[1]);var u=Number(e);if(isNaN(u))throw SyntaxError('String "'+e+'" is not a valid number');if(s){if(u>2**o-1)throw SyntaxError('String "'.concat(e,'" is out of range'));u>=2**(o-1)&&(u-=2**o)}return u},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf(e=>t=>{var r=t.clone();return r.value=e(t.value),r}),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))});return r.fromJSON=function(e){return parseFloat(e.value)},r}),sn=tP("oct",["typed","format"],e=>{var{typed:t,format:r}=e;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"oct",wordSize:t})}})}),si=r(7391),sa=si(Date.now());function so(e){var t;return t=null===e?sa:si(String(e)),function(){return t()}}var ss="pickRandom",su=tP(ss,["typed","config","?on"],e=>{var{typed:t,config:r,on:n}=e,i=so(r.randomSeed);return n&&n("config",function(e,t){e.randomSeed!==t.randomSeed&&(i=so(e.randomSeed))}),t(ss,{"Array | Matrix":function(e){return a(e,{})},"Array | Matrix, Object":function(e,t){return a(e,t)},"Array | Matrix, number":function(e,t){return a(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return a(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return a(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return a(e,{number:t,weights:r})}});function a(e,t){var r,{number:n,weights:a,elementWise:o=!0}=t,s=void 0===n;s&&(n=1);var u=E(e)?e.create:E(a)?a.create:null;e=e.valueOf(),a&&(a=a.valueOf()),!0===o&&(e=ip(e),a=ip(a));var c=0;if(void 0!==a){if(a.length!==e.length)throw Error("Weights must have the same length as possibles");for(var l=0,p=a.length;l<p;l++){if(!y(a[l])||a[l]<0)throw Error("Weights must be an array of positive numbers");c+=a[l]}}for(var f=e.length,d=[];d.length<n;){if(void 0===a)r=e[Math.floor(i()*f)];else for(var m=i()*c,h=0,g=e.length;h<g;h++)if((m-=a[h])<0){r=e[h];break}d.push(r)}return s?d[0]:u?u(d):d}}),sc=/\$([\w.]+)/g,sl="print",sp=tP(sl,["typed"],e=>{var{typed:t}=e;return t(sl,{"string, Object | Array":sf,"string, Object | Array, number | Object":sf})});function sf(e,t,r){return e.replace(sc,function(e,n){var i=n.split("."),a=t[i.shift()];for(void 0!==a&&a.isMatrix&&(a=a.toArray());i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}if(void 0!==a)if(!w(a))return n2(a,r);else return a;return e})}function sd(e,t){var r=[];if((e=e.slice(0)).length>1)for(var n=0,i=e.shift();n<i;n++)r.push(sd(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var sm="random",sh=tP(sm,["typed","config","?on"],e=>{var{typed:t,config:r,on:n}=e,i=so(r.randomSeed);return n&&n("config",function(e,t){e.randomSeed!==t.randomSeed&&(i=so(e.randomSeed))}),t(sm,{"":()=>0+ +i(),number:e=>{var t;return t=e,0+i()*(t-0)},"number, number":(e,t)=>{var r,n;return r=e,n=t,r+i()*(n-r)},"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,r)=>a(e,t,r)});function a(e,t,r){var n=sd(e.valueOf(),()=>{var e,n;return e=t,n=r,e+i()*(n-e)});return E(e)?e.create(n,"number"):n}}),sg=tP("re",["typed"],e=>{var{typed:t}=e;return t("re",{"number | BigNumber | Fraction":e=>e,Complex:e=>e.re,"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),sy=tP("sec",["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e,n=ot({typed:t});return t("sec",{number:av,Complex:e=>e.sec(),BigNumber:e=>new r(1).div(e.cos())},n)}),sv="sign",sx=tP(sv,["typed","BigNumber","Fraction","complex"],e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(sv,{number:i7,Complex:function(e){return 0===e.im?n(i7(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return new i(0n===e.n?0:e.s)},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0)),Unit:t.referToSelf(e=>r=>{if(!r._isDerived()&&0!==r.units[0].unit.offset)throw TypeError("sign is ambiguous for units with offset");return t.find(e,r.valueType())(r.value)})})}),sb=tP("sin",["typed"],e=>{var{typed:t}=e,r=ot({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},r)}),sD="size",sN=tP(sD,["typed"],e=>{var{typed:t}=e;return t(sD,{Matrix:e=>e.size(),Array:n9,string:e=>[e.length],"number | Complex | BigNumber | Unit | boolean | null":e=>[]})}),sw=tP("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(e,t){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw Error("Invalid datatype: "+t);if(E(e)){var r,n,o;r=this,n=e,o=t,"SparseMatrix"===n.type?(r._values=n._values?eu(n._values):void 0,r._index=eu(n._index),r._ptr=eu(n._ptr),r._size=eu(n._size),r._datatype=o||n._datatype):a(r,n.valueOf(),o||n._datatype)}else if(e&&A(e.index)&&A(e.ptr)&&A(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(A(e))a(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+es(e)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function a(e,n,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=n.length,o=0,s=r,u=0;if(w(i)&&(s=t.find(r,[i,i])||r,u=t.convert(0,i)),a>0){var c=0;do{e._ptr.push(e._index.length);for(var l=0;l<a;l++){var p=n[l];if(A(p)){if(0===c&&o<p.length&&(o=p.length),c<p.length){var f=p[c];s(f,u)||(e._values.push(f),e._index.push(l))}}else 0===c&&o<1&&(o=1),s(p,u)||(e._values.push(p),e._index.push(l))}c++}while(c<o)}for(;e._ptr.length<=o;)e._ptr.push(e._index.length);e._size=[a,o]}function o(e,t,r,n){if(r-t==0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function s(e,t,r,n,i,a,o){i.splice(e,0,n),a.splice(e,0,t);for(var s=r+1;s<o.length;s++)o[s]++}function u(e,n,i,a){var o,s,u,c=a||0,l=r,p=0;w(e._datatype)&&(l=t.find(r,[e._datatype,e._datatype])||r,p=t.convert(0,e._datatype),c=t.convert(c,e._datatype));var f=!l(c,p),d=e._size[0],m=e._size[1];if(i>m){for(s=m;s<i;s++)if(e._ptr[s]=e._values.length,f)for(o=0;o<d;o++)e._values.push(c),e._index.push(o);e._ptr[i]=e._values.length}else i<m&&(e._ptr.splice(i+1,m-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(m=i,n>d){if(f){var h=0;for(s=0;s<m;s++){e._ptr[s]=e._ptr[s]+h,u=e._ptr[s+1]+h;var g=0;for(o=d;o<n;o++,g++)e._values.splice(u+g,0,c),e._index.splice(u+g,0,o),h++}e._ptr[m]=e._values.length}}else if(n<d){var y=0;for(s=0;s<m;s++){e._ptr[s]=e._ptr[s]-y;var v=e._ptr[s],x=e._ptr[s+1]-y;for(u=v;u<x;u++)(o=e._index[u])>n-1&&(e._values.splice(u,1),e._index.splice(u,1),y++)}e._ptr[s]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function c(e,t,r,n,i){var a,o,s=n[0],u=n[1],c=[];for(a=0;a<s;a++)for(o=0,c[a]=[];o<u;o++)c[a][o]=0;for(o=0;o<u;o++)for(var l=r[o],p=r[o+1],f=l;f<p;f++)c[a=t[f]][o]=e?i?eu(e[f]):e[f]:1;return c}return i.prototype=new n,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return ib(this._values,es)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},i.prototype.subset=function(e,t,r){if(!this._values)throw Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!T(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,a,o,s=t.size();if(s.length!==e._size.length)throw new n6(s.length,e._size.length);var u=t.min(),c=t.max();for(r=0,n=e._size.length;r<n;r++)ir(u[r],e._size[r]),ir(c[r],e._size[r]);var l=e._values,p=e._index,f=e._ptr,d=t.dimension(0),m=t.dimension(1),h=[],g=[];function y(e,t){g[e]=t[0],h[e]=!0}Number.isInteger(d)?y(d,[0]):d.forEach(y);var v=l?[]:void 0,x=[],b=[];function D(e){for(b.push(x.length),a=f[e],o=f[e+1];a<o;a++)!0===h[r=p[a]]&&(x.push(g[r]),v&&v.push(l[a]))}return Number.isInteger(m)?D(m):m.forEach(D),b.push(x.length),new i({values:v,index:x,ptr:b,size:s,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var i,a=t.size(),o=t.isScalar();if(E(r)?(i=r.size(),r=r.toArray()):i=n9(r),o){if(0!==i.length)throw TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==a.length&&2!==a.length)throw new n6(a.length,e._size.length,"<");if(i.length<a.length){for(var s=0,u=0;1===a[s]&&1===i[s];)s++;for(;1===a[s];)u++,s++;r=il(r,a.length,u,i)}if(!el(a,i))throw new n6(a,i,">");if(1===a.length)p(t.dimension(0),(t,i)=>{ir(t),e.set([t,0],r[i[0]],n)});else{var c=t.dimension(0),l=t.dimension(1);p(c,(t,i)=>{ir(t),p(l,(a,o)=>{ir(a),e.set([t,a],r[i[0]][o[0]],n)})})}}return e;function p(e,t){y(e)?t(e,[0]):e.forEach(t)}}(this,e,t,r);default:throw SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!A(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new n6(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];ir(t,this._size[0]),ir(r,this._size[1]);var n=o(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},i.prototype.set=function(e,n,i){if(!A(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new n6(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke set on a Pattern only matrix");var a=e[0],c=e[1],l=this._size[0],p=this._size[1],f=r,d=0;w(this._datatype)&&(f=t.find(r,[this._datatype,this._datatype])||r,d=t.convert(0,this._datatype)),(a>l-1||c>p-1)&&(u(this,Math.max(a+1,l),Math.max(c+1,p),i),l=this._size[0],p=this._size[1]),ir(a,l),ir(c,p);var m=o(a,this._ptr[c],this._ptr[c+1],this._index);return m<this._ptr[c+1]&&this._index[m]===a?f(n,d)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(var a=t+1;a<i.length;a++)i[a]--}(m,c,this._values,this._index,this._ptr):this._values[m]=n:f(n,d)||s(m,a,c,n,this._values,this._index,this._ptr),this},i.prototype.resize=function(e,t,r){if(!S(e))throw TypeError("Array or Matrix expected");var n=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==n.length)throw Error("Only two dimensions matrix are supported");return n.forEach(function(e){if(!y(e)||!tX(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+n2(n)+")")}),u(r?this.clone():this,n[0],n[1],t)},i.prototype.reshape=function(e,t){if(!A(e))throw TypeError("Array expected");if(2!==e.length)throw Error("Sparse matrices can only be reshaped in two dimensions");e.forEach(function(t){if(!y(t)||!tX(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+n2(e)+")")});var r=this._size[0]*this._size[1],n=(e=is(e,r))[0]*e[1];if(r!==n)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var i=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return i;for(var a=[],u=0;u<i._ptr.length;u++)for(var c=0;c<i._ptr[u+1]-i._ptr[u];c++)a.push(u);for(var l=i._values.slice(),p=i._index.slice(),f=0;f<i._index.length;f++){var d=p[f],m=a[f],h=d*i._size[1]+m;a[f]=h%e[1],p[f]=Math.floor(h/e[1])}i._values.length=0,i._index.length=0,i._ptr.length=e[1]+1,i._size=e.slice();for(var g=0;g<i._ptr.length;g++)i._ptr[g]=0;for(var v=0;v<l.length;v++){var x=p[v],b=a[v],D=l[v];s(o(x,i._ptr[b],i._ptr[b+1],i._index),x,b,D,i._values,i._index,i._ptr)}return i},i.prototype.clone=function(){return new i({values:this._values?eu(this._values):void 0,index:eu(this._index),ptr:eu(this._ptr),size:eu(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,n){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var a=this,o=this._size[0],s=this._size[1],u=iF(e,a,"map");return function(e,n,a,o,s){var u=[],c=[],l=[],p=r,f=0;w(e._datatype)&&(p=t.find(r,[e._datatype,e._datatype])||r,f=t.convert(0,e._datatype));for(var d=function(e,t,r){var n=o(e,t,r);p(n,f)||(u.push(n),c.push(t))},m=0;m<=a;m++){l.push(u.length);var h=e._ptr[m],g=e._ptr[m+1];if(s)for(var y=h;y<g;y++){var v=e._index[y];v>=0&&v<=n&&d(e._values[y],v-0,m-0)}else{for(var x={},b=h;b<g;b++)x[e._index[b]]=e._values[b];for(var D=0;D<=n;D++)d(D in x?x[D]:0,D-0,m-0)}}return l.push(u.length),new i({values:u,index:c,ptr:l,size:[n-0+1,a-0+1]})}(this,o-1,s-1,function(e,t,r){return u.fn(e,[t,r],a)},n)},i.prototype.forEach=function(e,t){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],i=iF(e,this,"forEach"),a=0;a<n;a++){var o=this._ptr[a],s=this._ptr[a+1];if(t)for(var u=o;u<s;u++){var c=this._index[u];i.fn(this._values[u],[c,a],this)}else{for(var l={},p=o;p<s;p++)l[this._index[p]]=this._values[p];for(var f=0;f<r;f++){var d=f in l?l[f]:0;i.fn(d,[f,a],this)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var r=this._ptr[t],n=this._ptr[t+1],i=r;i<n;i++){var a=this._index[i];yield{value:this._values[i],index:[a,t]}}},i.prototype.toArray=function(){return c(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return c(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+n2(t,e)+" x "+n2(r,e)+"] density: "+n2(n,e)+"\n",a=0;a<r;a++)for(var o=this._ptr[a],s=this._ptr[a+1],u=o;u<s;u++)i+="\n ("+n2(this._index[u],e)+", "+n2(a,e)+") ==> "+(this._values?n2(this._values[u],e):"X");return i},i.prototype.toString=function(){return n2(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(v(e)&&(e=e.toNumber()),!y(e)||!tX(e))throw TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,r=e<0?-e:0,n=this._size[0],a=this._size[1],o=Math.min(n-r,a-t),s=[],u=[],c=[];c[0]=0;for(var l=t;l<a&&s.length<o;l++)for(var p=this._ptr[l],f=this._ptr[l+1],d=p;d<f;d++){var m=this._index[d];if(m===l-t+r){s.push(this._values[d]),u[s.length-1]=m-r;break}}return c.push(s.length),new i({values:s,index:u,ptr:c,size:[o,1]})},i.fromJSON=function(e){return new i(e)},i.diagonal=function(e,n,a,o,s){if(!A(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(v(e)&&(e=e.toNumber()),!y(e)||!tX(e)||e<1)throw Error("Size values must be positive integers");return e}),a){if(v(a)&&(a=a.toNumber()),!y(a)||!tX(a))throw TypeError("The parameter k must be an integer number")}else a=0;var u,c=r,l=0;w(s)&&(c=t.find(r,[s,s])||r,l=t.convert(0,s));var p=a>0?a:0,f=a<0?-a:0,d=e[0],m=e[1],h=Math.min(d-f,m-p);if(A(n)){if(n.length!==h)throw Error("Invalid value array length");u=function(e){return n[e]}}else if(E(n)){var g=n.size();if(1!==g.length||g[0]!==h)throw Error("Invalid matrix length");u=function(e){return n.get([e])}}else u=function(){return n};for(var x=[],b=[],D=[],N=0;N<m;N++){D.push(x.length);var S=N-p;if(S>=0&&S<h){var C=u(S);c(C,l)||(b.push(S+f),x.push(C))}}return D.push(x.length),new i({values:x,index:b,ptr:D,size:[d,m]})},i.prototype.swapRows=function(e,t){if(!y(e)||!tX(e)||!y(t)||!tX(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return ir(e,this._size[0]),ir(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,r,n,i){for(var a=n[e],o=n[e+1],s=a;s<o;s++)i(r[s],t[s])},i._swapRows=function(e,t,r,n,i,a){for(var s=0;s<r;s++){var u=a[s],c=a[s+1],l=o(e,u,c,i),p=o(t,u,c,i);if(l<c&&p<c&&i[l]===e&&i[p]===t){if(n){var f=n[l];n[l]=n[p],n[p]=f}continue}if(l<c&&i[l]===e&&(p>=c||i[p]!==t)){var d=n?n[l]:void 0;i.splice(p,0,t),n&&n.splice(p,0,d),i.splice(p<=l?l+1:l,1),n&&n.splice(p<=l?l+1:l,1);continue}if(p<c&&i[p]===t&&(l>=c||i[l]!==e)){var m=n?n[p]:void 0;i.splice(l,0,e),n&&n.splice(l,0,m),i.splice(l<=p?p+1:p,1),n&&n.splice(l<=p?p+1:p,1)}}},i},{isClass:!0}),sA="splitUnit",sE=tP(sA,["typed"],e=>{var{typed:t}=e;return t(sA,{"Unit, Array":function(e,t){return e.splitUnit(t)}})}),sS="square",sC=tP(sS,["typed"],e=>{var{typed:t}=e;return t(sS,{number:i9,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},bigint:function(e){return e*e},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})}),sM="string",sF=tP(sM,["typed"],e=>{var{typed:t}=e;return t(sM,{"":function(){return""},number:t8,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e)),any:function(e){return String(e)}})}),sT="subtractScalar",sB=tP(sT,["typed"],e=>{var{typed:t}=e;return t(sT,{"number, number":iJ,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"bigint, bigint":function(e,t){return e-t},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf(e=>(r,n)=>{if(null===r.value||void 0===r.value)throw Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),sO=tP("tan",["typed"],e=>{var{typed:t}=e,r=ot({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},r)}),s_="toBest",sz=tP(s_,["typed"],e=>{var{typed:t}=e;return t(s_,{Unit:e=>e.toBest(),"Unit, string":(e,t)=>e.toBest(t.split(",")),"Unit, string, Object":(e,t,r)=>e.toBest(t.split(","),r),"Unit, Array":(e,t)=>e.toBest(t),"Unit, Array, Object":(e,t,r)=>e.toBest(t,r)})}),sq="typeOf",sI=tP(sq,["typed"],e=>{var{typed:t}=e;return t(sq,{any:es})}),sk="acosh",sR=tP(sk,["typed","config","Complex"],e=>{var{typed:t,config:r,Complex:n}=e;return t(sk,{number:function(e){return e>=1||r.predictable?ri(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})}),sP="acsch",sU=tP(sP,["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t(sP,{number:al,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})}),sj="asec",sL=tP(sj,["typed","config","Complex","BigNumber"],e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(sj,{number:function(e){return e<=-1||e>=1||r.predictable?ap(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})}),sH=tP("bignumber",["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var n=t[2],i=r(t[1]),a=new r(2).pow(Number(n));if(i.gt(a.sub(1)))throw SyntaxError('String "'.concat(e,'" is out of range'));var o=new r(2).pow(Number(n)-1);return i.gte(o)?i.sub(a):i}return new r(e)},BigNumber:function(e){return e},bigint:function(e){return new r(e.toString())},Unit:t.referToSelf(e=>t=>{var r=t.clone();return r.value=e(t.value),r}),Fraction:function(e){return new r(String(e.n)).div(String(e.d)).times(String(e.s))},null:function(e){return new r(0)},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),s$="combinationsWithRep",sG=tP(s$,["typed"],e=>{var{typed:t}=e;return t(s$,{"number, number":function(e,t){if(!tX(e)||e<0||!tX(t)||t<0)throw TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw TypeError("k must be less than or equal to n + k - 1");return t<e-1?a3(e,e+t-1)/a3(1,t):a3(t+1,e+t-1)/a3(1,e-1)},"BigNumber, BigNumber":function(e,t){var r,n,i=new e.constructor(1),a=e.minus(i);if(!sZ(e)||!sZ(t))throw TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(i))throw TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(r=i,t.lt(a))for(n=i;n.lte(a);n=n.plus(i))r=r.times(t.plus(n)).dividedBy(n);else for(n=i;n.lte(t);n=n.plus(i))r=r.times(a.plus(n)).dividedBy(n);return r}})});function sZ(e){return e.isInteger()&&e.gte(0)}var sV="cosh",sW=tP(sV,["typed"],e=>{var{typed:t}=e;return t(sV,{number:rs,"Complex | BigNumber":e=>e.cosh()})}),sJ="csch",sQ=tP(sJ,["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t(sJ,{number:ay,Complex:e=>e.csch(),BigNumber:e=>new r(1).div(e.sinh())})}),sX=tP("dot",["typed","addScalar","multiplyScalar","conj","size"],e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:a}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,s){var u=o(e,s),c=E(e)?e._data:e,l=E(e)?e._datatype||e.getDataType():void 0,p=E(s)?s._data:s,f=E(s)?s._datatype||s.getDataType():void 0,d=2===a(e).length,m=2===a(s).length,h=r,g=n;if(l&&f&&l===f&&"string"==typeof l&&"mixed"!==l&&(h=t.find(r,[l,l]),g=t.find(n,[l,l])),!d&&!m){for(var y=g(i(c[0]),p[0]),v=1;v<u;v++)y=h(y,g(i(c[v]),p[v]));return y}if(!d&&m){for(var x=g(i(c[0]),p[0][0]),b=1;b<u;b++)x=h(x,g(i(c[b]),p[b][0]));return x}if(d&&!m){for(var D=g(i(c[0][0]),p[0]),N=1;N<u;N++)D=h(D,g(i(c[N][0]),p[N]));return D}if(d&&m){for(var w=g(i(c[0][0]),p[0][0]),A=1;A<u;A++)w=h(w,g(i(c[A][0]),p[A][0]));return w}},"SparseMatrix, SparseMatrix":function(e,t){o(e,t);for(var i=e._index,a=e._values,s=t._index,u=t._values,c=0,l=0,p=0;l<i.length&&p<s.length;){var f=i[l],d=s[p];if(f<d){l++;continue}if(f>d){p++;continue}f===d&&(c=r(c,n(a[l],u[p])),l++,p++)}return c}});function o(e,t){var r,n,i=a(e),o=a(t);if(1===i.length)r=i[0];else if(2===i.length&&1===i[1])r=i[0];else throw RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");if(1===o.length)n=o[0];else if(2===o.length&&1===o[1])n=o[0];else throw RangeError("Expected a column vector, instead got a matrix of size ("+o.join(", ")+")");if(r!==n)throw RangeError("Vectors must have equal length ("+r+" != "+n+")");if(0===r)throw RangeError("Cannot calculate the dot product of empty vectors");return r}}),sY="hasNumericValue",sK=tP(sY,["typed","isNumeric"],e=>{var{typed:t,isNumeric:r}=e;return t(sY,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return r(e)}})}),s0="isFinite",s1=tP(s0,["typed","isBounded","map"],e=>{var{typed:t,isBounded:r,map:n}=e;return t(s0,{"Array | Matrix":e=>n(e,r),any:e=>r(e)})}),s2="isNegative",s3=tP(s2,["typed","config"],e=>{var{typed:t,config:r}=e;return t(s2,{number:e=>!rn(e,0,r.relTol,r.absTol)&&e<0,BigNumber:e=>!os(e,new e.constructor(0),r.relTol,r.absTol)&&e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e<0n,Fraction:e=>e.s<0n,Unit:t.referToSelf(e=>r=>t.find(e,r.valueType())(r.value)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),s4="isZero",s5=tP(s4,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(s4,{"number | BigNumber | Complex | Fraction":e=>r(e,0),bigint:e=>0n===e,Unit:t.referToSelf(e=>r=>t.find(e,r.valueType())(r.value)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),s8="matrix",s6=tP(s8,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(s8,{"":function(){return a([])},string:function(e){return a([],e)},"string, string":function(e,t){return a([],e,t)},Array:function(e){return a(e)},Matrix:function(e){return a(e,e.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(e,t,r){if("dense"===t||"default"===t||void 0===t)return new n(e,r);if("sparse"===t)return new i(e,r);throw TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}),s7="matrixFromFunction",s9=tP(s7,["typed","matrix","isZero"],e=>{var{typed:t,matrix:r,isZero:n}=e;return t(s7,{"Array | Matrix, function, string, string":function(e,t,r,n){return i(e,t,r,n)},"Array | Matrix, function, string":function(e,t,r){return i(e,t,r)},"Matrix, function":function(e,t){return i(e,t,"dense")},"Array, function":function(e,t){return i(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,r){return i(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return i(e,n,t,r)}});function i(e,t,i,a){var o;return(o=void 0!==a?r(i,a):r(i)).resize(e),o.forEach(function(e,r){var i=t(r);n(i)||o.set(r,i)}),o}}),ue=tP("matAlgo11xS0s",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i,a){var o,s=e._values,u=e._index,c=e._ptr,l=e._size,p=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f=l[0],d=l[1],m=r,h=0,g=i;"string"==typeof p&&(o=p,m=t.find(r,[o,o]),h=t.convert(0,o),n=t.convert(n,o),g=t.find(i,[o,o]));for(var y=[],v=[],x=[],b=0;b<d;b++){x[b]=v.length;for(var D=c[b],N=c[b+1],w=D;w<N;w++){var A=u[w],E=a?g(n,s[w]):g(s[w],n);m(E,h)||(v.push(A),y.push(E))}}return x[d]=v.length,e.createSparseMatrix({values:y,index:v,ptr:x,size:[f,d],datatype:o})}}),ut=tP("matAlgo14xDs",["typed"],e=>{var{typed:t}=e;return function(e,r,n,i){var a,o=e._data,s=e._size,u=e._datatype,c=n;"string"==typeof u&&(a=u,r=t.convert(r,a),c=t.find(n,[a,a]));var l=s.length>0?function e(t,r,n,i,a,o,s){var u=[];if(r===n.length-1)for(var c=0;c<i;c++)u[c]=s?t(o,a[c]):t(a[c],o);else for(var l=0;l<i;l++)u[l]=e(t,r+1,n,n[r+1],a[l],o,s);return u}(c,0,s,s[0],o,r,i):[];return e.createDenseMatrix({data:l,size:eu(s),datatype:a})}}),ur="multiply",un=tP(ur,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,s=ue({typed:t,equalScalar:a}),u=ut({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}var l=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._data,l=r._datatype||r.getDataType(),p=s[0],f=s[1],d=n,m=i;u&&l&&u===l&&"string"==typeof u&&"mixed"!==u&&(a=u,d=t.find(n,[a,a]),m=t.find(i,[a,a]));for(var h=[],g=0;g<p;g++){for(var y=o[g],v=m(y[0],c[0]),x=1;x<f;x++)v=d(v,m(y[x],c[x]));h[g]=v}return e.createDenseMatrix({data:h,size:[p],datatype:u===e._datatype&&l===r._datatype?a:void 0})},"SparseMatrix, any":function(e,r){var o,s=e._values,u=e._index,c=e._ptr,l=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!s)throw Error("Cannot multiply Pattern only Matrix times Dense Matrix");var p=r._data,f=r._datatype||r.getDataType(),d=e._size[0],m=r._size[0],h=[],g=[],y=[],v=n,x=i,b=a,D=0;l&&f&&l===f&&"string"==typeof l&&"mixed"!==l&&(o=l,v=t.find(n,[o,o]),x=t.find(i,[o,o]),b=t.find(a,[o,o]),D=t.convert(0,o));var N=[],w=[];y[0]=0;for(var A=0;A<m;A++){var E=p[A];if(!b(E,D))for(var S=c[A],C=c[A+1],M=S;M<C;M++){var F=u[M];w[F]?N[F]=v(N[F],x(E,s[M])):(w[F]=!0,g.push(F),N[F]=x(E,s[M]))}}for(var T=g.length,B=0;B<T;B++){var O=g[B];h[B]=N[O]}return y[1]=g.length,e.createSparseMatrix({values:h,index:g,ptr:y,size:[d,1],datatype:l===e._datatype&&f===r._datatype?o:void 0})}}),p=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,r){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._data,l=r._size,p=r._datatype||r.getDataType(),f=s[0],d=s[1],m=l[1],h=n,g=i;u&&p&&u===p&&"string"==typeof u&&"mixed"!==u&&"mixed"!==u&&(a=u,h=t.find(n,[a,a]),g=t.find(i,[a,a]));for(var y=[],v=0;v<f;v++){var x=o[v];y[v]=[];for(var b=0;b<m;b++){for(var D=g(x[0],c[0][b]),N=1;N<d;N++)D=h(D,g(x[N],c[N][b]));y[v][b]=D}}return e.createDenseMatrix({data:y,size:[f,m],datatype:u===e._datatype&&p===r._datatype?a:void 0})},"DenseMatrix, SparseMatrix":function(e,r){var o,s=e._data,u=e._size,c=e._datatype||e.getDataType(),l=r._values,p=r._index,f=r._ptr,d=r._size,m=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(!l)throw Error("Cannot multiply Dense Matrix times Pattern only Matrix");var h=u[0],g=d[1],y=n,v=i,x=a,b=0;c&&m&&c===m&&"string"==typeof c&&"mixed"!==c&&(o=c,y=t.find(n,[o,o]),v=t.find(i,[o,o]),x=t.find(a,[o,o]),b=t.convert(0,o));for(var D=[],N=[],w=[],A=r.createSparseMatrix({values:D,index:N,ptr:w,size:[h,g],datatype:c===e._datatype&&m===r._datatype?o:void 0}),E=0;E<g;E++){w[E]=N.length;var S=f[E],C=f[E+1];if(C>S)for(var M=0,F=0;F<h;F++){for(var T=F+1,B=void 0,O=S;O<C;O++){var _=p[O];M!==T?(B=v(s[F][_],l[O]),M=T):B=y(B,v(s[F][_],l[O]))}M!==T||x(B,b)||(N.push(F),D.push(B))}}return w[g]=N.length,A},"SparseMatrix, DenseMatrix":function(e,r){var o,s=e._values,u=e._index,c=e._ptr,l=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!s)throw Error("Cannot multiply Pattern only Matrix times Dense Matrix");var p=r._data,f=r._datatype||r.getDataType(),d=e._size[0],m=r._size[0],h=r._size[1],g=n,y=i,v=a,x=0;l&&f&&l===f&&"string"==typeof l&&"mixed"!==l&&(o=l,g=t.find(n,[o,o]),y=t.find(i,[o,o]),v=t.find(a,[o,o]),x=t.convert(0,o));for(var b=[],D=[],N=[],w=e.createSparseMatrix({values:b,index:D,ptr:N,size:[d,h],datatype:l===e._datatype&&f===r._datatype?o:void 0}),A=[],E=[],S=0;S<h;S++){N[S]=D.length;for(var C=S+1,M=0;M<m;M++){var F=p[M][S];if(!v(F,x))for(var T=c[M],B=c[M+1],O=T;O<B;O++){var _=u[O];E[_]!==C?(E[_]=C,D.push(_),A[_]=y(F,s[O])):A[_]=g(A[_],y(F,s[O]))}}for(var z=N[S],q=D.length,I=z;I<q;I++){var k=D[I];b[I]=A[k]}}return N[h]=D.length,w},"SparseMatrix, SparseMatrix":function(e,r){var a,o,s,u,c,l,p,f,d,m=e._values,h=e._index,g=e._ptr,y=e._datatype||void 0===e._data?e._datatype:e.getDataType(),v=r._values,x=r._index,b=r._ptr,D=r._datatype||void 0===r._data?r._datatype:r.getDataType(),N=e._size[0],w=r._size[1],A=m&&v,E=n,S=i;y&&D&&y===D&&"string"==typeof y&&"mixed"!==y&&(a=y,E=t.find(n,[a,a]),S=t.find(i,[a,a]));for(var C=A?[]:void 0,M=[],F=[],T=e.createSparseMatrix({values:C,index:M,ptr:F,size:[N,w],datatype:y===e._datatype&&D===r._datatype?a:void 0}),B=A?[]:void 0,O=[],_=0;_<w;_++){F[_]=M.length;var z=_+1;for(l=b[_],p=b[_+1],c=l;c<p;c++)if(d=x[c],A)for(s=g[d],u=g[d+1],o=s;o<u;o++)O[f=h[o]]!==z?(O[f]=z,M.push(f),B[f]=S(v[c],m[o])):B[f]=E(B[f],S(v[c],m[o]));else for(s=g[d],u=g[d+1],o=s;o<u;o++)O[f=h[o]]!==z&&(O[f]=z,M.push(f));if(A)for(var q=F[_],I=M.length,k=q;k<I;k++){var R=M[k];C[k]=B[R]}}return F[w]=M.length,T}});return t(ur,i,{"Array, Array":t.referTo("Matrix, Matrix",e=>(t,n)=>{c(n9(t),n9(n));var i=e(r(t),r(n));return E(i)?i.valueOf():i}),"Matrix, Matrix":function(e,r){var a=e.size(),s=r.size();if(c(a,s),1===a.length){if(1===s.length){if(0===a[0])throw Error("Cannot multiply two empty vectors");return o(e,r)}if("dense"!==r.storage())throw Error("Support for SparseMatrix not implemented");return function(e,r){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._data,l=r._size,p=r._datatype||r.getDataType(),f=s[0],d=l[1],m=n,h=i;u&&p&&u===p&&"string"==typeof u&&"mixed"!==u&&(a=u,m=t.find(n,[a,a]),h=t.find(i,[a,a]));for(var g=[],y=0;y<d;y++){for(var v=h(o[0],c[0][y]),x=1;x<f;x++)v=m(v,h(o[x],c[x][y]));g[y]=v}return e.createDenseMatrix({data:g,size:[d],datatype:u===e._datatype&&p===r._datatype?a:void 0})}(e,r)}return 1===s.length?l(e,r):p(e,r)},"Matrix, Array":t.referTo("Matrix,Matrix",e=>(t,n)=>e(t,r(n))),"Array, Matrix":t.referToSelf(e=>(t,n)=>e(r(t,n.storage()),n)),"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return u(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return u(t,e,i,!0)},"Array, any":function(e,t){return u(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(e=>(t,r,n)=>{for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i})})}),ui=tP("ones",["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return"Array"===r.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===r.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var r,a=(r=!1,e.forEach(function(e,t,n){v(e)&&(r=!0,n[t]=e.toNumber())}),r)?new i(1):1;if(e.forEach(function(e){if("number"!=typeof e||!tX(e)||e<0)throw Error("Parameters in function ones must be positive integers")}),t){var o=n(t);return e.length>0?o.resize(e,a):o}var s=[];return e.length>0?ia(s,e,a):s}}),ua="randomInt",uo=tP(ua,["typed","config","log2","?on"],e=>{var{typed:t,config:r,log2:n,on:i}=e,a=so(r.randomSeed);return i&&i("config",function(e,t){e.randomSeed!==t.randomSeed&&(a=so(e.randomSeed))}),t(ua,{"":()=>s(0,2),number:e=>s(0,e),"number, number":(e,t)=>s(e,t),bigint:e=>u(0n,e),"bigint, bigint":u,"Array | Matrix":e=>o(e,0,1),"Array | Matrix, number":(e,t)=>o(e,0,t),"Array | Matrix, number, number":(e,t,r)=>o(e,t,r)});function o(e,t,r){var n=sd(e.valueOf(),()=>s(t,r));return E(e)?e.create(n,"number"):n}function s(e,t){return Math.floor(e+a()*(t-e))}function u(e,t){var r=t-e;if(r<=2n**30n)return e+BigInt(s(0,Number(r)));for(var i=n(r),o=r;o>=r;){o=0n;for(var u=0;u<i;++u)o=2n*o+(.5>a()?0n:1n)}return e+o}});function us(e,t,r,n){if(!(this instanceof us))throw SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(null!=n?"-"+n:"")+" expected)",this.stack=Error().stack}us.prototype=Error(),us.prototype.constructor=Error,us.prototype.name="ArgumentsError",us.prototype.isArgumentsError=!0;var uu=tP("resize",["config","matrix"],e=>{var{config:t,matrix:r}=e;return function(e,n,i){if(2!=arguments.length&&3!=arguments.length)throw new us("resize",arguments.length,2,3);if(E(n)&&(n=n.valueOf()),v(n[0])&&(n=n.map(function(e){return v(e)?e.toNumber():e})),E(e))return e.resize(n,i,!0);if("string"==typeof e){var a=e,o=n,s=i;if(void 0!==s){if("string"!=typeof s||1!==s.length)throw TypeError("Single character expected as defaultValue")}else s=" ";if(1!==o.length)throw new n6(o.length,1);var u=o[0];if("number"!=typeof u||!tX(u))throw TypeError("Invalid size, must contain positive integers (size: "+n2(o)+")");if(a.length>u)return a.substring(0,u);if(!(a.length<u))return a;for(var c=a,l=0,p=u-a.length;l<p;l++)c+=s;return c}var f=!Array.isArray(e)&&"Array"!==t.matrix;if(0===n.length){for(;Array.isArray(e);)e=e[0];return eu(e)}Array.isArray(e)||(e=[e]);var d=ia(e=eu(e),n,i);return f?r(d):d}}),uc="sech",ul=tP(uc,["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t(uc,{number:ax,Complex:e=>e.sech(),BigNumber:e=>new r(1).div(e.cosh())})}),up="sinh",uf=tP(up,["typed"],e=>{var{typed:t}=e;return t(up,{number:ab,"Complex | BigNumber":e=>e.sinh()})}),ud="sparse",um=tP(ud,["typed","SparseMatrix"],e=>{var{typed:t,SparseMatrix:r}=e;return t(ud,{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})}),uh=tP("sqrt",["config","typed","Complex"],e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}}),ug="squeeze",uy=tP(ug,["typed"],e=>{var{typed:t}=e;return t(ug,{Array:function(e){return ic(eu(e))},Matrix:function(e){var t=ic(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return eu(e)}})}),uv=tP("tanh",["typed"],e=>{var{typed:t}=e;return t("tanh",{number:rc,"Complex | BigNumber":e=>e.tanh()})}),ux="transpose",ub=tP(ux,["typed","matrix"],e=>{var{typed:t,matrix:r}=e;return t(ux,{Array:e=>n(r(e)).valueOf(),Matrix:n,any:eu});function n(e){var t,r=e.size();switch(r.length){case 1:t=e.clone();break;case 2:var n=r[0],i=r[1];if(0===i)throw RangeError("Cannot transpose a 2D matrix with no columns (size: "+n2(r)+")");switch(e.storage()){case"dense":t=function(e,t,r){for(var n,i=e._data,a=[],o=0;o<r;o++){n=a[o]=[];for(var s=0;s<t;s++)n[s]=eu(i[s][o])}return e.createDenseMatrix({data:a,size:[r,t],datatype:e._datatype})}(e,n,i);break;case"sparse":t=function(e,t,r){for(var n,i,a,o=e._values,s=e._index,u=e._ptr,c=o?[]:void 0,l=[],p=[],f=[],d=0;d<t;d++)f[d]=0;for(n=0,i=s.length;n<i;n++)f[s[n]]++;for(var m=0,h=0;h<t;h++)p.push(m),m+=f[h],f[h]=p[h];for(p.push(m),a=0;a<r;a++)for(var g=u[a],y=u[a+1],v=g;v<y;v++){var x=f[s[v]]++;l[x]=a,o&&(c[x]=eu(o[v]))}return e.createSparseMatrix({values:c,index:l,ptr:p,size:[r,t],datatype:e._datatype})}(e,n,i)}break;default:throw RangeError("Matrix must be a vector or two dimensional (size: "+n2(r)+")")}return t}}),uD="xgcd",uN=tP(uD,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(uD,{"number, number":function(e,t){var i=ae(e,t);return"Array"===r.matrix?i:n(i)},"BigNumber, BigNumber":function(e,t){var a,o,s,u,c=new i(0),l=new i(1),p=c,f=l,d=l,m=c;if(!e.isInt()||!t.isInt())throw Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=e.div(t).floor(),s=e.mod(t),a=p,p=f.minus(o.times(p)),f=a,a=d,d=m.minus(o.times(d)),m=a,e=t,t=s;return u=e.lt(c)?[e.neg(),f.neg(),m.neg()]:[e,e.isZero()?0:f,m],"Array"===r.matrix?u:n(u)}})}),uw="zeros",uA=tP(uw,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(uw,{"":function(){return"Array"===r.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===r.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var r,a=(r=!1,e.forEach(function(e,t,n){v(e)&&(r=!0,n[t]=e.toNumber())}),r)?new i(0):0;if(e.forEach(function(e){if("number"!=typeof e||!tX(e)||e<0)throw Error("Parameters in function zeros must be positive integers")}),t){var o=n(t);return e.length>0?o.resize(e,a):o}var s=[];return e.length>0?ia(s,e,a):s}}),uE="acoth",uS=tP(uE,["typed","config","Complex","BigNumber"],e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(uE,{number:function(e){return e>=1||e<=-1||r.predictable?au(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})}),uC="asin",uM=tP(uC,["typed","config","Complex"],e=>{var{typed:t,config:r,Complex:n}=e;return t(uC,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})}),uF=tP("bin",["typed","format"],e=>{var{typed:t,format:r}=e;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"bin",wordSize:t})}})}),uT="coth",uB=tP(uT,["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t(uT,{number:ah,Complex:e=>e.coth(),BigNumber:e=>new r(1).div(e.tanh())})}),uO="ctranspose",u_=tP(uO,["typed","transpose","conj"],e=>{var{typed:t,transpose:r,conj:n}=e;return t(uO,{any:function(e){return n(r(e))}})}),uz="diag",uq=tP(uz,["typed","matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(uz,{Array:function(e){return a(e,0,n9(e),null)},"Array, number":function(e,t){return a(e,t,n9(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),n9(e),null)},"Array, string":function(e,t){return a(e,0,n9(e),t)},"Array, number, string":function(e,t,r){return a(e,t,n9(e),r)},"Array, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),n9(e),r)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return a(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return a(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return a(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return a(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),e.size(),r)}});function a(e,t,a,o){if(!tX(t))throw TypeError("Second parameter in function diag must be an integer");var s=t>0?t:0,u=t<0?-t:0;switch(a.length){case 1:var c=e,l=t,p=o,f=a[0],d=u,m=s,h=[f+d,f+m];if(p&&"sparse"!==p&&"dense"!==p)throw TypeError("Unknown matrix type ".concat(p,'"'));var g="sparse"===p?i.diagonal(h,c,l):n.diagonal(h,c,l);return null!==p?g:g.valueOf();case 2:var y=e,v=t,x=o,b=a,D=u,N=s;if(E(y)){var w=y.diagonal(v);return null!==x?x!==w.storage()?r(w,x):w:w.valueOf()}for(var A=Math.min(b[0]-D,b[1]-N),S=[],C=0;C<A;C++)S[C]=y[C+D][C+N];return null!==x?r(S):S}throw RangeError("Matrix for function diag must be 2 dimensional")}}),uI=tP("matAlgo03xDSf",["typed"],e=>{var{typed:t}=e;return function(e,r,n,i){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._values,l=r._index,p=r._ptr,f=r._size,d=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new n6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");if(!c)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=s[0],h=s[1],g=0,y=n;"string"==typeof u&&u===d&&"mixed"!==u&&(a=u,g=t.convert(0,a),y=t.find(n,[a,a]));for(var v=[],x=0;x<m;x++)v[x]=[];for(var b=[],D=[],N=0;N<h;N++){for(var w=N+1,A=p[N],E=p[N+1],S=A;S<E;S++){var C=l[S];b[C]=i?y(c[S],o[C][N]):y(o[C][N],c[S]),D[C]=w}for(var M=0;M<m;M++)D[M]===w?v[M][N]=b[M]:v[M][N]=i?y(g,o[M][N]):y(o[M][N],g)}return e.createDenseMatrix({data:v,size:[m,h],datatype:u===e._datatype&&d===r._datatype?a:void 0})}}),uk=tP("matAlgo07xSSf",["typed","SparseMatrix"],e=>{var{typed:t,SparseMatrix:r}=e;return function(e,i,a){var o,s=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),c=i._size,l=i._datatype||void 0===i._data?i._datatype:i.getDataType();if(s.length!==c.length)throw new n6(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");var p=s[0],f=s[1],d=0,m=a;"string"==typeof u&&u===l&&"mixed"!==u&&(o=u,d=t.convert(0,o),m=t.find(a,[o,o]));for(var h=[],g=[],y=Array(f+1).fill(0),v=[],x=[],b=[],D=[],N=0;N<f;N++){var w=N+1,A=0;n(e,N,b,v,w),n(i,N,D,x,w);for(var E=0;E<p;E++){var S=m(b[E]===w?v[E]:d,D[E]===w?x[E]:d);0!==S&&!1!==S&&(g.push(E),h.push(S),A++)}y[N+1]=y[N]+A}return new r({values:h,index:g,ptr:y,size:[p,f],datatype:u===e._datatype&&l===i._datatype?o:void 0})};function n(e,t,r,n,i){for(var a=e._values,o=e._index,s=e._ptr,u=s[t],c=s[t+1];u<c;u++){var l=o[u];r[l]=i,n[l]=a[u]}}}),uR=tP("matAlgo12xSfs",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:r}=e;return function(e,n,i,a){var o,s=e._values,u=e._index,c=e._ptr,l=e._size,p=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f=l[0],d=l[1],m=i;"string"==typeof p&&(o=p,n=t.convert(n,o),m=t.find(i,[o,o]));for(var h=[],g=[],y=[],v=0;v<d;v++){for(var x=v+1,b=c[v],D=c[v+1],N=b;N<D;N++){var w=u[N];g[w]=s[N],y[w]=x}for(var A=0;A<f;A++)0===v&&(h[A]=[]),y[A]===x?h[A][v]=a?m(n,g[A]):m(g[A],n):h[A][v]=a?m(n,0):m(0,n)}return new r({data:h,size:[f,d],datatype:o})}}),uP=tP("matAlgo13xDD",["typed"],e=>{var{typed:t}=e;return function(e,r,n){var i,a=e._data,o=e._size,s=e._datatype,u=r._data,c=r._size,l=r._datatype,p=[];if(o.length!==c.length)throw new n6(o.length,c.length);for(var f=0;f<o.length;f++){if(o[f]!==c[f])throw RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+c+")");p[f]=o[f]}var d=n;"string"==typeof s&&s===l&&(i=s,d=t.find(n,[i,i]));var m=p.length>0?function e(t,r,n,i,a,o){var s=[];if(r===n.length-1)for(var u=0;u<i;u++)s[u]=t(a[u],o[u]);else for(var c=0;c<i;c++)s[c]=e(t,r+1,n,n[r+1],a[c],o[c]);return s}(d,0,p,p[0],a,u):[];return e.createDenseMatrix({data:m,size:p,datatype:i})}});function uU(e,t){if(el(e.size(),t.size()))return[e,t];var r=iN(e.size(),t.size());return[e,t].map(e=>{var t,n;return t=e,n=r,el(t.size(),n)?t:t.create(iA(t.valueOf(),n),t.datatype())})}var uj=tP("matrixAlgorithmSuite",["typed","matrix"],e=>{var{typed:t,matrix:r}=e,n=uP({typed:t}),i=ut({typed:t});return function(e){var a,o=e.elop,s=e.SD||e.DS;o?(a={"DenseMatrix, DenseMatrix":(e,t)=>n(...uU(e,t),o),"Array, Array":(e,t)=>n(...uU(r(e),r(t)),o).valueOf(),"Array, DenseMatrix":(e,t)=>n(...uU(r(e),t),o),"DenseMatrix, Array":(e,t)=>n(...uU(e,r(t)),o)},e.SS&&(a["SparseMatrix, SparseMatrix"]=(t,r)=>e.SS(...uU(t,r),o,!1)),e.DS&&(a["DenseMatrix, SparseMatrix"]=(t,r)=>e.DS(...uU(t,r),o,!1),a["Array, SparseMatrix"]=(t,n)=>e.DS(...uU(r(t),n),o,!1)),s&&(a["SparseMatrix, DenseMatrix"]=(e,t)=>s(...uU(t,e),o,!0),a["SparseMatrix, Array"]=(e,t)=>s(...uU(r(t),e),o,!0))):(a={"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,r)=>n(...uU(t,r),e)),"Array, Array":t.referToSelf(e=>(t,i)=>n(...uU(r(t),r(i)),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,i)=>n(...uU(r(t),i),e)),"DenseMatrix, Array":t.referToSelf(e=>(t,i)=>n(...uU(t,r(i)),e))},e.SS&&(a["SparseMatrix, SparseMatrix"]=t.referToSelf(t=>(r,n)=>e.SS(...uU(r,n),t,!1))),e.DS&&(a["DenseMatrix, SparseMatrix"]=t.referToSelf(t=>(r,n)=>e.DS(...uU(r,n),t,!1)),a["Array, SparseMatrix"]=t.referToSelf(t=>(n,i)=>e.DS(...uU(r(n),i),t,!1))),s&&(a["SparseMatrix, DenseMatrix"]=t.referToSelf(e=>(t,r)=>s(...uU(r,t),e,!0)),a["SparseMatrix, Array"]=t.referToSelf(e=>(t,n)=>s(...uU(r(n),t),e,!0))));var u=e.scalar||"any";(e.Ds||e.Ss)&&(o?(a["DenseMatrix,"+u]=(e,t)=>i(e,t,o,!1),a[u+", DenseMatrix"]=(e,t)=>i(t,e,o,!0),a["Array,"+u]=(e,t)=>i(r(e),t,o,!1).valueOf(),a[u+", Array"]=(e,t)=>i(r(t),e,o,!0).valueOf()):(a["DenseMatrix,"+u]=t.referToSelf(e=>(t,r)=>i(t,r,e,!1)),a[u+", DenseMatrix"]=t.referToSelf(e=>(t,r)=>i(r,t,e,!0)),a["Array,"+u]=t.referToSelf(e=>(t,n)=>i(r(t),n,e,!1).valueOf()),a[u+", Array"]=t.referToSelf(e=>(t,n)=>i(r(n),t,e,!0).valueOf())));var c=void 0!==e.sS?e.sS:e.Ss;return o?(e.Ss&&(a["SparseMatrix,"+u]=(t,r)=>e.Ss(t,r,o,!1)),c&&(a[u+", SparseMatrix"]=(e,t)=>c(t,e,o,!0))):(e.Ss&&(a["SparseMatrix,"+u]=t.referToSelf(t=>(r,n)=>e.Ss(r,n,t,!1))),c&&(a[u+", SparseMatrix"]=t.referToSelf(e=>(t,r)=>c(r,t,e,!0)))),o&&o.signatures&&ec(a,o.signatures),a}}),uL="equal",uH=tP(uL,["typed","matrix","equalScalar","DenseMatrix","SparseMatrix"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=uI({typed:t}),u=uk({typed:t,SparseMatrix:o}),c=uR({typed:t,DenseMatrix:i}),l=uj({typed:t,matrix:r});return t(uL,u$({typed:t,equalScalar:n}),l({elop:n,SS:u,DS:s,Ss:c}))}),u$=tP(uL,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(uL,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})}),uG=tP("fraction",["typed","Fraction"],e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(e){if(!Number.isFinite(e)||isNaN(e))throw Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},"bigint, bigint":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},bigint:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf(e=>t=>{var r=t.clone();return r.value=e(t.value),r}),Object:function(e){return new r(e)},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),uZ="identity",uV=tP(uZ,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(uZ,{"":function(){return"Matrix"===r.matrix?n([]):[]},string:function(e){return n(e)},"number | BigNumber":function(e){return u(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return u(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return u(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return u(e,t,r)},Array:function(e){return s(e)},"Array, string":function(e,t){return s(e,t)},Matrix:function(e){return s(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return s(e.valueOf(),t)}});function s(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return u(e[0],e[0],t);case 2:return u(e[0],e[1],t);default:throw Error("Vector containing two values expected")}}function u(e,t,r){var n=v(e)||v(t)?i:null;if(v(e)&&(e=e.toNumber()),v(t)&&(t=t.toNumber()),!tX(e)||e<1||!tX(t)||t<1)throw Error("Parameters in function identity must be positive integers");var s=n?new i(1):1,u=n?new n(0):0,c=[e,t];if(r){if("sparse"===r)return o.diagonal(c,s,0,u);if("dense"===r)return a.diagonal(c,s,0,u);throw TypeError('Unknown matrix type "'.concat(r,'"'))}for(var l=ia([],c,u),p=e<t?e:t,f=0;f<p;f++)l[f][f]=s;return l}}),uW="isInteger",uJ=tP(uW,["typed","equal"],e=>{var{typed:t,equal:r}=e;return t(uW,{number:e=>!!Number.isFinite(e)&&r(e,Math.round(e)),BigNumber:e=>!!e.isFinite()&&r(e.round(),e),bigint:e=>!0,Fraction:e=>1n===e.d,"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),uQ="kron",uX=tP(uQ,["typed","matrix","multiplyScalar"],e=>{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(uQ,{"Matrix, Matrix":function(e,t){return r(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(i(e.toArray(),t))},"Array, Matrix":function(e,t){return r(i(e,t.toArray()))},"Array, Array":i});function i(e,t){var r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(o<0){var s=n9(e).length,u=n9(t).length;for(o=Math.max(s,u);s++<o;)e=[e];for(;u++<o;)t=[t]}return 1===o?(r=e,a=t,r.flatMap(e=>a.map(t=>n(e,t)))):e.flatMap(e=>t.map(t=>i(e,t,o-1)))}}),uY="mapSlices",uK=tP(uY,["typed","isInteger"],e=>{var{typed:t,isInteger:r}=e;return t(uY,{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw TypeError("Integer number expected for dimension");var i=Array.isArray(e)?n9(e):e.size();if(t<0||t>=i.length)throw new n7(t,i.length);return E(e)?e.create(u0(e.valueOf(),t,n),e.datatype()):u0(e,t,n)}})},{formerly:"apply"});function u0(e,t,r){var n,i,a;if(t<=0)if(!Array.isArray(e[0]))return r(e);else{for(n=0,a=function(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r<i;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);a.push(o)}return a}(e),i=[];n<a.length;n++)i[n]=u0(a[n],t-1,r);return i}for(n=0,i=[];n<e.length;n++)i[n]=u0(e[n],t-1,r);return i}var u1="matrixFromColumns",u2=tP(u1,["typed","matrix","flatten","size"],e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(u1,{"...Array":function(e){return a(e)},"...Matrix":function(e){return r(a(e.map(e=>e.toArray())))}});function a(e){if(0===e.length)throw TypeError("At least one column is needed to construct a matrix.");for(var t=o(e[0]),r=[],i=0;i<t;i++)r[i]=[];for(var a of e){var s=o(a);if(s!==t)throw TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|s));for(var u=n(a),c=0;c<t;c++)r[c].push(u[c])}return r}function o(e){var t=i(e);if(1===t.length)return t[0];if(2===t.length)if(1===t[0])return t[1];else if(1===t[1])return t[0];else throw TypeError("At least one of the arguments is not a vector.");throw TypeError("Only one- or two-dimensional vectors are supported.")}});function u3(){throw Error('No "bignumber" implementation available')}function u4(){throw Error('No "fraction" implementation available')}var u5=tP("numeric",["number","?bignumber","?fraction"],e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:r?e=>r(e):u3,bigint:e=>BigInt(e),Fraction:n?e=>n(e):u4};return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number",r=arguments.length>2?arguments[2]:void 0;if(void 0!==r)throw SyntaxError("numeric() takes one or two arguments");var n=es(e);if(!(n in i))throw TypeError("Cannot convert "+e+' of type "'+n+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in a))throw TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===n?e:a[t](e)}});function u8(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+es(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+es(r)+", value: "+JSON.stringify(r)+")":"",TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var u6="prod",u7=tP(u6,["typed","config","multiplyScalar","numeric"],e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(u6,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var t;if(iU(e,function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw u8(t,"prod",e)}}),"string"==typeof t&&(t=i(t,tY(t,r))),void 0===t)throw Error("Cannot calculate prod of an empty array");return t}}),u9="reshape",ce=tP(u9,["typed","isInteger","matrix"],e=>{var{typed:t,isInteger:r}=e;return t(u9,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach(function(e){if(!r(e))throw TypeError("Invalid size for dimension: "+e)}),io(e,t)}})}),ct="Number of decimals in function round must be an integer",cr="round",cn=tP(cr,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:s}=e,u=ue({typed:t,equalScalar:i}),c=uR({typed:t,DenseMatrix:s}),l=ut({typed:t});function p(e){return Math.abs(t7(e).exponent)}return t(cr,{number:function(e){var t=ar(e,p(r.relTol));return ar(rn(e,t,r.relTol,r.absTol)?t:e)},"number, number":function(e,t){var n=p(r.relTol);if(t>=n)return ar(e,t);var i=ar(e,n);return ar(rn(e,i,r.relTol,r.absTol)?i:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(ct);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(ct);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(ct);var r=t.toNumber();return e.round(r)},BigNumber:function(e){var t=new o(e).toDecimalPlaces(p(r.relTol));return(os(e,t,r.relTol,r.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(ct);var n=p(r.relTol);if(t>=n)return e.toDecimalPlaces(t.toNumber());var i=e.toDecimalPlaces(n);return(os(e,i,r.relTol,r.absTol)?i:e).toDecimalPlaces(t.toNumber())},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(ct);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(ct);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>ij(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>u(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>l(t,r,e,!1)),"Array, number | BigNumber":t.referToSelf(e=>(t,r)=>l(n(t),r,e,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(e=>(t,r)=>i(t,0)?a(r.size(),r.storage()):c(r,t,e,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(e=>(t,r)=>i(t,0)?a(r.size(),r.storage()):l(r,t,e,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(e=>(t,r)=>l(n(r),t,e,!0).valueOf())})}),ci="unaryMinus",ca=tP(ci,["typed"],e=>{var{typed:t}=e;return t(ci,{number:iX,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf(e=>r=>{var n=r.clone();return n.value=t.find(e,n.valueType())(r.value),n}),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0))})}),co="bernoulli",cs=tP(co,["typed","config","isInteger","number","?BigNumber","?Fraction"],e=>{var{typed:t,config:r,number:n,BigNumber:i,Fraction:a}=e,o=[void 0],s=[void 0],u=[void 0],c=50;return t(co,{number:e=>cu(e,e=>e,o,(e,t)=>e+t,(e,t)=>e*t,(e,t)=>e/t),"bigint | Fraction":e=>cu(n(e),e=>new a(e),s,(e,t)=>e.add(t),(e,t)=>e.mul(t),(e,t)=>e.div(t)),BigNumber:e=>(r.precision!==c&&(u=[void 0],c=r.precision),cu(n(e),e=>new i(e),u,(e,t)=>e.add(t),(e,t)=>e.mul(t),(e,t)=>e.div(t)))})});function cu(e,t,r,n,i,a){if(e<0||!tX(e))throw RangeError("Bernoulli index must be nonnegative integer");if(0===e)return t(1);if(1===e)return a(t(-1),t(2));if(e%2==1)return t(0);var o=t(1);1===r.length&&r.push([a(o,t(-3)),a(o,t(-2)),a(o,t(6))]);for(var s=e/2,u=t(0),c=t(2);r.length<=s;){for(var l=r.length,p=Math.floor((l+1)/2),f=u,d=1;d<p;++d)f=n(f,i(r[d][0],r[l-d][0]));f=i(f,c),l%2==0&&(f=n(f,i(r[p][0],r[p][0]))),f=a(f,t(-(2*l+1)));var m=a(i(r[l-1][1],t(-l*(2*l-1))),c);r.push([f,m,i(m,f)])}return r[s][2]}var cc="cbrt",cl=tP(cc,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:o,BigNumber:s,Fraction:u}=e;return r(cc,{number:iK,Complex:c,"Complex, boolean":c,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&b(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=c(e.value),t}var r,a=n(e.value);a&&(e.value=i(e.value)),r=v(e.value)?new s(1).div(3):D(e.value)?new u(1,3):1/3;var o=e.pow(r);return a&&(o.value=i(o.value)),o}});function c(e,r){var n=e.arg()/3,i=e.abs(),s=new o(iK(i),0).mul(new o(0,n).exp());if(!r)return s;var u=[s,new o(iK(i),0).mul(new o(0,n+2*Math.PI/3).exp()),new o(iK(i),0).mul(new o(0,n-2*Math.PI/3).exp())];return"Array"===t.matrix?u:a(u)}}),cp="concat",cf=tP(cp,["typed","matrix","isInteger"],e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(cp,{"...Array | Matrix | number | BigNumber":function(e){var t,i,a=e.length,o=-1,s=!1,u=[];for(t=0;t<a;t++){var c=e[t];if(E(c)&&(s=!0),y(c)||v(c)){if(t!==a-1)throw Error("Dimension must be specified as last argument");if(i=o,!n(o=c.valueOf()))throw TypeError("Integer number expected for dimension");if(o<0||t>0&&o>i)throw new n7(o,i+1)}else{var l=eu(c).valueOf(),p=n9(l);if(u[t]=l,i=o,o=p.length-1,t>0&&o!==i)throw new n6(i+1,o+1)}}if(0===u.length)throw SyntaxError("At least one matrix expected");for(var f=u.shift();u.length;)f=iD(f,u.shift(),o);return s?r(f):f},"...string":function(e){return e.join("")}})}),cd="count",cm=tP(cd,["typed","size","prod"],e=>{var{typed:t,size:r,prod:n}=e;return t(cd,{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})}),ch="deepEqual",cg=tP(ch,["typed","equal"],e=>{var{typed:t,equal:r}=e;return t(ch,{"any, any":function(e,t){return function e(t,n){if(Array.isArray(t))if(!Array.isArray(n))return!1;else{var i=t.length;if(i!==n.length)return!1;for(var a=0;a<i;a++)if(!e(t[a],n[a]))return!1;return!0}return!Array.isArray(n)&&r(t,n)}(e.valueOf(),t.valueOf())}})}),cy="divideScalar",cv=tP(cy,["typed","numeric"],e=>{var{typed:t,numeric:r}=e;return t(cy,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"bigint, bigint":function(e,t){return e/t},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e,t)=>e.divide(t),"number | Fraction | Complex | BigNumber, Unit":(e,t)=>t.divideInto(e)})}),cx=tP("matAlgo02xDS0",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i,a){var o,s=e._data,u=e._size,c=e._datatype||e.getDataType(),l=n._values,p=n._index,f=n._ptr,d=n._size,m=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==d.length)throw new n6(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");if(!l)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=u[0],g=u[1],y=r,v=0,x=i;"string"==typeof c&&c===m&&"mixed"!==c&&(o=c,y=t.find(r,[o,o]),v=t.convert(0,o),x=t.find(i,[o,o]));for(var b=[],D=[],N=[],w=0;w<g;w++){N[w]=D.length;for(var A=f[w],E=f[w+1],S=A;S<E;S++){var C=p[S],M=a?x(l[S],s[C][w]):x(s[C][w],l[S]);y(M,v)||(D.push(C),b.push(M))}}return N[g]=D.length,n.createSparseMatrix({values:b,index:D,ptr:N,size:[h,g],datatype:c===e._datatype&&m===n._datatype?o:void 0})}}),cb=tP("matAlgo09xS0Sf",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a,o,s,u,c,l,p=e._values,f=e._index,d=e._ptr,m=e._size,h=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=n._values,y=n._index,v=n._ptr,x=n._size,b=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(m.length!==x.length)throw new n6(m.length,x.length);if(m[0]!==x[0]||m[1]!==x[1])throw RangeError("Dimension mismatch. Matrix A ("+m+") must match Matrix B ("+x+")");var D=m[0],N=m[1],w=r,A=0,E=i;"string"==typeof h&&h===b&&"mixed"!==h&&(a=h,w=t.find(r,[a,a]),A=t.convert(0,a),E=t.find(i,[a,a]));var S=p&&g?[]:void 0,C=[],M=[],F=S?[]:void 0,T=[];for(s=0;s<N;s++){M[s]=C.length;var B=s+1;if(F)for(c=v[s],l=v[s+1],u=c;u<l;u++)T[o=y[u]]=B,F[o]=g[u];for(c=d[s],l=d[s+1],u=c;u<l;u++)if(o=f[u],F){var O=T[o]===B?F[o]:A,_=E(p[u],O);w(_,A)||(C.push(o),S.push(_))}else C.push(o)}return M[N]=C.length,e.createSparseMatrix({values:S,index:C,ptr:M,size:[D,N],datatype:h===e._datatype&&b===n._datatype?a:void 0})}}),cD="dotMultiply",cN=tP(cD,["typed","matrix","equalScalar","multiplyScalar","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e,o=cx({typed:t,equalScalar:n}),s=cb({typed:t,equalScalar:n}),u=ue({typed:t,equalScalar:n}),c=uj({typed:t,matrix:r,concat:a});return t(cD,c({elop:i,SS:s,DS:o,Ss:u}))}),cw="floor",cA=new tR(10),cE=tP(cw,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;function i(e){var t=Math.floor(e),i=n(e);return t===i?t:rn(e,i,r.relTol,r.absTol)&&!rn(e,t,r.relTol,r.absTol)?i:t}return t(cw,{number:i,"number, number":function(e,t){if(!tX(t))throw RangeError("number of decimals in function floor must be an integer");if(t<0||t>15)throw RangeError("number of decimals in floor number must be in range 0 - 15");var r=10**t;return i(e*r)/r}})}),cS=tP(cw,["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,u=ue({typed:t,equalScalar:a}),c=uR({typed:t,DenseMatrix:s}),l=ut({typed:t}),p=cE({typed:t,config:r,round:n});function f(e){var t=(e,t)=>os(e,t,r.relTol,r.absTol),i=e.floor(),a=n(e);return i.eq(a)?i:t(e,a)&&!t(e,i)?a:i}return t("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:f,"BigNumber, BigNumber":function(e,t){var r=cA.pow(t);return f(e.mul(r)).div(r)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>ij(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,r)=>ij(t,t=>e(t,r),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>u(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>l(t,r,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,r)=>l(i(r),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,r)=>a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?l(r,t,e,!0):c(r,t,e,!0))})}),cC=tP("matAlgo05xSfSf",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a,o,s,u,c,l=e._values,p=e._index,f=e._ptr,d=e._size,m=e._datatype||void 0===e._data?e._datatype:e.getDataType(),h=n._values,g=n._index,y=n._ptr,v=n._size,x=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(d.length!==v.length)throw new n6(d.length,v.length);if(d[0]!==v[0]||d[1]!==v[1])throw RangeError("Dimension mismatch. Matrix A ("+d+") must match Matrix B ("+v+")");var b=d[0],D=d[1],N=r,w=0,A=i;"string"==typeof m&&m===x&&"mixed"!==m&&(a=m,N=t.find(r,[a,a]),w=t.convert(0,a),A=t.find(i,[a,a]));var E=l&&h?[]:void 0,S=[],C=[],M=E?[]:void 0,F=E?[]:void 0,T=[],B=[];for(s=0;s<D;s++){C[s]=S.length;var O=s+1;for(u=f[s],c=f[s+1];u<c;u++)o=p[u],S.push(o),T[o]=O,M&&(M[o]=l[u]);for(u=y[s],c=y[s+1];u<c;u++)T[o=g[u]]!==O&&S.push(o),B[o]=O,F&&(F[o]=h[u]);if(E)for(u=C[s];u<S.length;){var _=T[o=S[u]],z=B[o];if(_===O||z===O){var q=A(_===O?M[o]:w,z===O?F[o]:w);N(q,w)?S.splice(u,1):(E.push(q),u++)}}}return C[D]=S.length,e.createSparseMatrix({values:E,index:S,ptr:C,size:[b,D],datatype:m===e._datatype&&x===n._datatype?a:void 0})}}),cM=tP("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s,concat:u}=e,c=cS({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}),l=cx({typed:t,equalScalar:a}),p=uI({typed:t}),f=cC({typed:t,equalScalar:a}),d=ue({typed:t,equalScalar:a}),m=uR({typed:t,DenseMatrix:s}),h=uj({typed:t,matrix:i,concat:u});return t("mod",{"number, number":function(e,t){return 0===t?e:e-t*c(e/t)},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(c(e.div(t))))},"bigint, bigint":function(e,t){if(0n===t)return e;if(e<0){var r=e%t;return 0n===r?r:r+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},h({SS:f,DS:p,SD:l,Ss:d,sS:m}))}),cF=tP("matAlgo01xDSid",["typed"],e=>{var{typed:t}=e;return function(e,r,n,i){var a,o,s=e._data,u=e._size,c=e._datatype||e.getDataType(),l=r._values,p=r._index,f=r._ptr,d=r._size,m=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==d.length)throw new n6(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");if(!l)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=u[0],g=u[1],y="string"==typeof c&&"mixed"!==c&&c===m?c:void 0,v=y?t.find(n,[y,y]):n,x=[];for(a=0;a<h;a++)x[a]=[];var b=[],D=[];for(o=0;o<g;o++){for(var N=o+1,w=f[o],A=f[o+1],E=w;E<A;E++)b[a=p[E]]=i?v(l[E],s[a][o]):v(s[a][o],l[E]),D[a]=N;for(a=0;a<h;a++)D[a]===N?x[a][o]=b[a]:x[a][o]=s[a][o]}return e.createDenseMatrix({data:x,size:[h,g],datatype:c===e._datatype&&m===r._datatype?y:void 0})}}),cT=tP("matAlgo04xSidSid",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a,o,s,u,c,l,p=e._values,f=e._index,d=e._ptr,m=e._size,h=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=n._values,y=n._index,v=n._ptr,x=n._size,b=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(m.length!==x.length)throw new n6(m.length,x.length);if(m[0]!==x[0]||m[1]!==x[1])throw RangeError("Dimension mismatch. Matrix A ("+m+") must match Matrix B ("+x+")");var D=m[0],N=m[1],w=r,A=0,E=i;"string"==typeof h&&h===b&&"mixed"!==h&&(a=h,w=t.find(r,[a,a]),A=t.convert(0,a),E=t.find(i,[a,a]));var S=p&&g?[]:void 0,C=[],M=[],F=p&&g?[]:void 0,T=p&&g?[]:void 0,B=[],O=[];for(s=0;s<N;s++){M[s]=C.length;var _=s+1;for(c=d[s],l=d[s+1],u=c;u<l;u++)o=f[u],C.push(o),B[o]=_,F&&(F[o]=p[u]);for(c=v[s],l=v[s+1],u=c;u<l;u++)if(B[o=y[u]]===_){if(F){var z=E(F[o],g[u]);w(z,A)?B[o]=null:F[o]=z}}else C.push(o),O[o]=_,T&&(T[o]=g[u]);if(F&&T)for(u=M[s];u<C.length;)B[o=C[u]]===_?(S[u]=F[o],u++):O[o]===_?(S[u]=T[o],u++):C.splice(u,1)}return M[N]=C.length,e.createSparseMatrix({values:S,index:C,ptr:M,size:[D,N],datatype:h===e._datatype&&b===n._datatype?a:void 0})}}),cB=tP("matAlgo10xSids",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:r}=e;return function(e,n,i,a){var o,s=e._values,u=e._index,c=e._ptr,l=e._size,p=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f=l[0],d=l[1],m=i;"string"==typeof p&&(o=p,n=t.convert(n,o),m=t.find(i,[o,o]));for(var h=[],g=[],y=[],v=0;v<d;v++){for(var x=v+1,b=c[v],D=c[v+1],N=b;N<D;N++){var w=u[N];g[w]=s[N],y[w]=x}for(var A=0;A<f;A++)0===v&&(h[A]=[]),y[A]===x?h[A][v]=a?m(n,g[A]):m(g[A],n):h[A][v]=n}return new r({data:h,size:[f,d],datatype:o})}}),cO="number | BigNumber | Fraction | Matrix | Array",c_="".concat(cO,", ").concat(cO,", ...").concat(cO);function cz(e){return!e.some(e=>Array.isArray(e))}var cq=tP("gcd",["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:s,DenseMatrix:u,concat:c}=e,l=cM({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:u,concat:c}),p=cF({typed:t}),f=cT({typed:t,equalScalar:a}),d=cB({typed:t,DenseMatrix:u}),m=uj({typed:t,matrix:r,concat:c});return t("gcd",{"number, number":function(e,t){var r;if(!tX(e)||!tX(t))throw Error("Parameters in function gcd must be integer numbers");for(;0!==t;)r=l(e,t),e=t,t=r;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var r=new s(0);!t.isZero();){var n=l(e,t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},m({SS:f,DS:p,Ss:d}),{[c_]:t.referToSelf(e=>(t,r,n)=>{for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}),Array:t.referToSelf(e=>t=>{if(1===t.length&&Array.isArray(t[0])&&cz(t[0]))return e(...t[0]);if(cz(t))return e(...t);throw new us("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(e=>t=>e(t.toArray()))})}),cI="isPositive",ck=tP(cI,["typed","config"],e=>{var{typed:t,config:r}=e;return t(cI,{number:e=>!rn(e,0,r.relTol,r.absTol)&&e>0,BigNumber:e=>!os(e,new e.constructor(0),r.relTol,r.absTol)&&!e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e>0n,Fraction:e=>e.s>0n&&e.n>0n,Unit:t.referToSelf(e=>r=>t.find(e,r.valueType())(r.value)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),cR="larger",cP=tP(cR,["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,config:r,bignumber:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,u=uI({typed:t}),c=uk({typed:t,SparseMatrix:s}),l=uR({typed:t,DenseMatrix:a}),p=uj({typed:t,matrix:i,concat:o}),f=ou({typed:t});function d(e,t){return e.gt(t)&&!os(e,t,r.relTol,r.absTol)}return t(cR,cU({typed:t,config:r}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":d,"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>1===e.compare(t),"Fraction, BigNumber":function(e,t){return d(n(e),t)},"BigNumber, Fraction":function(e,t){return d(e,n(t))},"Complex, Complex":function(){throw TypeError("No ordering relation is defined for complex numbers")}},f,p({SS:c,DS:u,Ss:l}))}),cU=tP(cR,["typed","config"],e=>{var{typed:t,config:r}=e;return t(cR,{"number, number":function(e,t){return e>t&&!rn(e,t,r.relTol,r.absTol)}})}),cj=tP("matAlgo06xS0S0",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a,o=e._values,s=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),c=n._values,l=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==l.length)throw new n6(s.length,l.length);if(s[0]!==l[0]||s[1]!==l[1])throw RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+l+")");var f=s[0],d=s[1],m=r,h=0,g=i;"string"==typeof u&&u===p&&"mixed"!==u&&(a=u,m=t.find(r,[a,a]),h=t.convert(0,a),g=t.find(i,[a,a]));for(var y=o&&c?[]:void 0,v=[],x=[],b=y?[]:void 0,D=[],N=[],w=0;w<d;w++){x[w]=v.length;var A=w+1;if(i$(e,w,D,b,N,A,v,g),i$(n,w,D,b,N,A,v,g),b)for(var E=x[w];E<v.length;){var S=v[E];if(N[S]===A){var C=b[S];m(C,h)?v.splice(E,1):(y.push(C),E++)}else v.splice(E,1)}else for(var M=x[w];M<v.length;)N[v[M]]!==A?v.splice(M,1):M++}return x[d]=v.length,e.createSparseMatrix({values:y,index:v,ptr:x,size:[f,d],datatype:u===e._datatype&&p===n._datatype?a:void 0})}}),cL=tP("lcm",["typed","matrix","equalScalar","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=cx({typed:t,equalScalar:n}),o=cj({typed:t,equalScalar:n}),s=ue({typed:t,equalScalar:n}),u=uj({typed:t,matrix:r,concat:i}),c="number | BigNumber | Fraction | Matrix | Array",l={};return l["".concat(c,", ").concat(c,", ...").concat(c)]=t.referToSelf(e=>(t,r,n)=>{for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}),t("lcm",{"number, number":i3,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;for(var r=e.times(t);!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":(e,t)=>e.lcm(t)},u({SS:o,DS:a,Ss:s}),l)}),cH=tP("matAlgo08xS0Sid",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a,o,s,u,c,l=e._values,p=e._index,f=e._ptr,d=e._size,m=e._datatype||void 0===e._data?e._datatype:e.getDataType(),h=n._values,g=n._index,y=n._ptr,v=n._size,x=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(d.length!==v.length)throw new n6(d.length,v.length);if(d[0]!==v[0]||d[1]!==v[1])throw RangeError("Dimension mismatch. Matrix A ("+d+") must match Matrix B ("+v+")");if(!l||!h)throw Error("Cannot perform operation on Pattern Sparse Matrices");var b=d[0],D=d[1],N=r,w=0,A=i;"string"==typeof m&&m===x&&"mixed"!==m&&(a=m,N=t.find(r,[a,a]),w=t.convert(0,a),A=t.find(i,[a,a]));for(var E=[],S=[],C=[],M=[],F=[],T=0;T<D;T++){C[T]=S.length;var B=T+1;for(s=f[T],u=f[T+1],o=s;o<u;o++)F[c=p[o]]=B,M[c]=l[o],S.push(c);for(s=y[T],u=y[T+1],o=s;o<u;o++)F[c=g[o]]===B&&(M[c]=A(M[c],h[o]));for(o=C[T];o<S.length;){var O=M[c=S[o]];N(O,w)?S.splice(o,1):(E.push(O),o++)}}return C[D]=S.length,e.createSparseMatrix({values:E,index:S,ptr:C,size:[b,D],datatype:m===e._datatype&&x===n._datatype?a:void 0})}}),c$=tP("useMatrixForArrayScalar",["typed","matrix"],e=>{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",e=>(t,n)=>e(r(t),n).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",e=>(t,n)=>e(r(t),n).valueOf()),"number, Array":t.referTo("number, DenseMatrix",e=>(t,n)=>e(t,r(n)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",e=>(t,n)=>e(t,r(n)).valueOf())}}),cG="leftShift",cZ=tP(cG,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,s=cF({typed:t}),u=cx({typed:t,equalScalar:n}),c=cH({typed:t,equalScalar:n}),l=cB({typed:t,DenseMatrix:a}),p=ue({typed:t,equalScalar:n}),f=ut({typed:t}),d=uj({typed:t,matrix:r,concat:o}),m=c$({typed:t,matrix:r});return t(cG,{"number, number":aW,"BigNumber, BigNumber":aj,"bigint, bigint":(e,t)=>e<<t,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>n(r,0)?t.clone():p(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>n(r,0)?t.clone():f(t,r,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):l(r,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0))},m,d({SS:c,DS:s,SD:u}))});function cV(e){var{DenseMatrix:t}=e;return function(e,r,n){var i=e.size();if(2!==i.length)throw RangeError("Matrix must be two dimensional (size: "+n2(i)+")");var a=i[0];if(a!==i[1])throw RangeError("Matrix must be square (size: "+n2(i)+")");var o=[];if(E(r)){var s=r.size(),u=r._data;if(1===s.length){if(s[0]!==a)throw RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c<a;c++)o[c]=[u[c]];return new t({data:o,size:[a,1],datatype:r._datatype})}if(2===s.length){if(s[0]!==a||1!==s[1])throw RangeError("Dimension mismatch. Matrix columns must match vector length.");if(C(r)){if(n){o=[];for(var l=0;l<a;l++)o[l]=[u[l][0]];return new t({data:o,size:[a,1],datatype:r._datatype})}return r}if(M(r)){for(var p=0;p<a;p++)o[p]=[0];for(var f=r._values,d=r._index,m=r._ptr,h=m[1],g=m[0];g<h;g++)o[d[g]][0]=f[g];return new t({data:o,size:[a,1],datatype:r._datatype})}}throw RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(A(r)){var y=n9(r);if(1===y.length){if(y[0]!==a)throw RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var v=0;v<a;v++)o[v]=[r[v]];return new t({data:o,size:[a,1]})}if(2===y.length){if(y[0]!==a||1!==y[1])throw RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var x=0;x<a;x++)o[x]=[r[x][0]];return new t({data:o,size:[a,1]})}throw RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var cW="lsolve",cJ=tP(cW,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,u=cV({DenseMatrix:s});return t(cW,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=[],h=0;h<l;h++){var g=r[h][0]||0;if(o(g,0))m[h]=[0];else{for(var y=0,v=[],x=[],b=d[h],D=d[h+1],N=b;N<D;N++){var w=f[N];w===h?y=p[N]:w>h&&(v.push(p[N]),x.push(w))}if(o(y,0))throw Error("Linear system cannot be solved since matrix is singular");for(var A=n(g,y),E=0,S=x.length;E<S;E++){var C=x[E];r[C]=[a(r[C][0]||0,i(A,v[E]))]}m[h]=[A]}}return new s({data:m,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).valueOf()}});function c(e,t){for(var r=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],p=[],f=e._data,d=0;d<l;d++){var m=r[d][0]||0,h=void 0;if(o(m,0))h=0;else{var g=f[d][d];if(o(g,0))throw Error("Linear system cannot be solved since matrix is singular");h=n(m,g);for(var y=d+1;y<c;y++)r[y]=[a(r[y][0]||0,i(h,f[y][d]))]}p[d]=[h]}return new s({data:p,size:[c,1]})}}),cQ=tP("max",["typed","config","numeric","larger","isNaN"],e=>{var{typed:t,config:r,numeric:n,larger:i,isNaN:a}=e;return t("max",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){return iL(e,t.valueOf(),o)},"...":function(e){if(iP(e))throw TypeError("Scalar values expected in function max");return s(e)}});function o(e,t){try{return i(e,t)?e:t}catch(e){throw u8(e,"max",t)}}function s(e){var t;if(iU(e,function(e){try{a(e)?t=e:(void 0===t||i(e,t))&&(t=e)}catch(t){throw u8(t,"max",e)}}),void 0===t)throw Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=n(t,tY(t,r))),t}}),cX="nthRoot",cY=tP(cX,["typed","matrix","equalScalar","BigNumber","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:a}=e,o=cF({typed:t}),s=cx({typed:t,equalScalar:n}),u=cj({typed:t,equalScalar:n}),c=ue({typed:t,equalScalar:n}),l=uj({typed:t,matrix:r,concat:a});function p(){throw Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(cX,{number:i6,"number, number":i6,BigNumber:e=>f(e,new i(2)),"BigNumber, BigNumber":f,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",e=>t=>e(r(t),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",e=>t=>e(t,2)),SparseMatrix:t.referTo("SparseMatrix,number",e=>t=>e(t,2)),"SparseMatrix, SparseMatrix":t.referToSelf(e=>(t,r)=>{if(1===r.density())return u(t,r,e);throw Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(e=>(t,r)=>{if(1===r.density())return o(t,r,e,!1);throw Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",e=>(t,n)=>e(r(t),n)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,r)=>{if(1===r.density())return c(r,t,e,!0);throw Error("Root must be non-zero")})},l({scalar:"number | BigNumber",SD:s,Ss:c,sS:!1}));function f(e,t){var r=i.precision,n=i.clone({precision:r+2}),a=new i(0),o=new n(1),s=t.isNegative();if(s&&(t=t.neg()),t.isZero())throw Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw Error("Root must be odd when a is negative.");if(e.isZero())return s?new n(1/0):0;if(!e.isFinite())return s?a:e;var u=e.abs().pow(o.div(t));return u=e.isNeg()?u.neg():u,new i((s?o.div(u):u).toPrecision(r))}}),cK="nullish",c0=tP(cK,["typed","matrix","size","flatten","deepEqual"],e=>{var{typed:t,matrix:r,size:n,flatten:i,deepEqual:a}=e,o=uI({typed:t}),s=ut({typed:t}),u=uP({typed:t});return t(cK,{"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any":(e,t)=>e,"null, any":(e,t)=>t,"undefined, any":(e,t)=>t,"SparseMatrix, Array | Matrix":(e,t)=>{var r=n(e),i=n(t);if(a(r,i))return e;throw new n6(r,i)},"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,r)=>u(t,r,e)),"DenseMatrix, SparseMatrix":t.referToSelf(e=>(t,r)=>o(t,r,e,!1)),"DenseMatrix, Array":t.referToSelf(e=>(t,n)=>u(t,r(n),e)),"DenseMatrix, any":t.referToSelf(e=>(t,r)=>s(t,r,e,!1)),"Array, Array":t.referToSelf(e=>(t,n)=>u(r(t),r(n),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,n)=>u(r(t),n,e)),"Array, SparseMatrix":t.referToSelf(e=>(t,n)=>o(r(t),n,e,!1)),"Array, any":t.referToSelf(e=>(t,n)=>s(r(t),n,e,!1).valueOf())})}),c1=tP("or",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=uI({typed:t}),s=cC({typed:t,equalScalar:n}),u=uR({typed:t,DenseMatrix:i}),c=uj({typed:t,matrix:r,concat:a});return t("or",{"number, number":o7,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"bigint, bigint":o7,"Unit, Unit":t.referToSelf(e=>(t,r)=>e(t.value||0,r.value||0))},c({SS:s,DS:o,Ss:u}))}),c2=tP("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],e=>{var{typed:t,matrix:r,zeros:n,identity:a,isZero:o,equal:s,sign:u,sqrt:c,conj:l,unaryMinus:p,addScalar:f,divideScalar:d,multiplyScalar:m,subtractScalar:h,complex:g}=e;return i(t("qr",{DenseMatrix:function(e){return v(e)},SparseMatrix:function(e){throw Error("qr not implemented for sparse matrices yet")},Array:function(e){var t=v(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:y});function y(e){var t,r,i,g=e._size[0],y=e._size[1],v=a([g],"dense"),x=v._data,b=e.clone(),D=b._data,N=n([g],"");for(i=0;i<Math.min(y,g);++i){var w=D[i][i],A=p(s(w,0)?1:u(w)),E=l(A),S=0;for(t=i;t<g;t++)S=f(S,m(D[t][i],l(D[t][i])));var C=m(A,c(S));if(!o(C)){var M=h(w,C);for(N[i]=1,t=i+1;t<g;t++)N[t]=d(D[t][i],M);var F=p(l(d(M,C))),T=void 0;for(r=i;r<y;r++){for(T=0,t=i;t<g;t++)T=f(T,m(l(N[t]),D[t][r]));for(T=m(T,F),t=i;t<g;t++)D[t][r]=m(h(D[t][r],m(N[t],T)),E)}for(t=0;t<g;t++){for(T=0,r=i;r<g;r++)T=f(T,m(x[t][r],N[r]));for(T=m(T,F),r=i;r<g;++r)x[t][r]=d(h(x[t][r],m(T,l(N[r]))),E)}}}return{Q:v,R:b,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function v(e){var t=y(e),r=t.R._data;if(e._data.length>0)for(var n="Complex"===r[0][0].type?g(0):0,i=0;i<r.length;++i)for(var a=0;a<i&&a<(r[0]||[]).length;++a)r[i][a]=n;return t}}),c3="rightArithShift",c4=tP(c3,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,s=cF({typed:t}),u=cx({typed:t,equalScalar:n}),c=cH({typed:t,equalScalar:n}),l=cB({typed:t,DenseMatrix:a}),p=ue({typed:t,equalScalar:n}),f=ut({typed:t}),d=uj({typed:t,matrix:r,concat:o}),m=c$({typed:t,matrix:r});return t(c3,{"number, number":aJ,"BigNumber, BigNumber":aL,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>n(r,0)?t.clone():p(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>n(r,0)?t.clone():f(t,r,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):l(r,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0))},m,d({SS:c,DS:s,SD:u}))}),c5="smaller",c8=tP(c5,["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,config:r,bignumber:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,u=uI({typed:t}),c=uk({typed:t,SparseMatrix:s}),l=uR({typed:t,DenseMatrix:a}),p=uj({typed:t,matrix:i,concat:o}),f=ou({typed:t});function d(e,t){return e.lt(t)&&!os(e,t,r.relTol,r.absTol)}return t(c5,c6({typed:t,config:r}),{"boolean, boolean":(e,t)=>e<t,"BigNumber, BigNumber":d,"bigint, bigint":(e,t)=>e<t,"Fraction, Fraction":(e,t)=>-1===e.compare(t),"Fraction, BigNumber":function(e,t){return d(n(e),t)},"BigNumber, Fraction":function(e,t){return d(e,n(t))},"Complex, Complex":function(e,t){throw TypeError("No ordering relation is defined for complex numbers")}},f,p({SS:c,DS:u,Ss:l}))}),c6=tP(c5,["typed","config"],e=>{var{typed:t,config:r}=e;return t(c5,{"number, number":function(e,t){return e<t&&!rn(e,t,r.relTol,r.absTol)}})}),c7="subtract",c9=tP(c7,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:s}=e,u=cF({typed:t}),c=uI({typed:t}),l=cC({typed:t,equalScalar:n}),p=cB({typed:t,DenseMatrix:o}),f=uR({typed:t,DenseMatrix:o}),d=uj({typed:t,matrix:r,concat:s});return t(c7,{"any, any":i},d({elop:i,SS:l,DS:u,SD:c,Ss:f,sS:p}))}),le=tP("to",["typed","matrix","concat"],e=>{var{typed:t,matrix:r,concat:n}=e,i=uj({typed:t,matrix:r,concat:n});return t("to",{"Unit, Unit | string":(e,t)=>e.to(t)},i({Ds:!0}))}),lt="unaryPlus",lr=tP(lt,["typed","config","numeric"],e=>{var{typed:t,config:r,numeric:n}=e;return t(lt,{number:iY,Complex:function(e){return e},BigNumber:function(e){return e},bigint:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0)),boolean:function(e){return n(+!!e,r.number)},string:function(e){return n(e,tY(e,r))}})}),ln="usolve",li=tP(ln,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,u=cV({DenseMatrix:s});return t(ln,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=[],h=l-1;h>=0;h--){var g=r[h][0]||0;if(o(g,0))m[h]=[0];else{for(var y=0,v=[],x=[],b=d[h],D=d[h+1],N=D-1;N>=b;N--){var w=f[N];w===h?y=p[N]:w<h&&(v.push(p[N]),x.push(w))}if(o(y,0))throw Error("Linear system cannot be solved since matrix is singular");for(var A=n(g,y),E=0,S=x.length;E<S;E++){var C=x[E];r[C]=[a(r[C][0],i(A,v[E]))]}m[h]=[A]}}return new s({data:m,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).valueOf()}});function c(e,t){for(var r=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],p=[],f=e._data,d=l-1;d>=0;d--){var m=r[d][0]||0,h=void 0;if(o(m,0))h=0;else{var g=f[d][d];if(o(g,0))throw Error("Linear system cannot be solved since matrix is singular");h=n(m,g);for(var y=d-1;y>=0;y--)r[y]=[a(r[y][0]||0,i(h,f[y][d]))]}p[d]=[h]}return new s({data:p,size:[c,1]})}}),la=tP("xor",["typed","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i,SparseMatrix:a}=e,o=uI({typed:t}),s=uk({typed:t,SparseMatrix:a}),u=uR({typed:t,DenseMatrix:n}),c=uj({typed:t,matrix:r,concat:i});return t("xor",{"number, number":o9,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"bigint, bigint":o9,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf(e=>(t,r)=>e(t.value||0,r.value||0))},c({SS:s,DS:o,Ss:u}))}),lo=tP("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:s}=e,u=cF({typed:t}),c=cT({typed:t,equalScalar:i}),l=cB({typed:t,DenseMatrix:a}),p=uj({typed:t,matrix:r,concat:s});return t("add",{"any, any":n,"any, any, ...any":t.referToSelf(e=>(t,r,n)=>{for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i})},p({elop:n,DS:u,SS:c,Ss:l}))}),ls="atan2",lu=tP(ls,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,s=cx({typed:t,equalScalar:n}),u=uI({typed:t}),c=cb({typed:t,equalScalar:n}),l=ue({typed:t,equalScalar:n}),p=uR({typed:t,DenseMatrix:a}),f=uj({typed:t,matrix:r,concat:o});return t(ls,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,t)=>i.atan2(e,t)},f({scalar:"number | BigNumber",SS:c,DS:u,SD:s,Ss:l,sS:p}))}),lc="bitAnd",ll=tP(lc,["typed","matrix","equalScalar","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=cx({typed:t,equalScalar:n}),o=cj({typed:t,equalScalar:n}),s=ue({typed:t,equalScalar:n}),u=uj({typed:t,matrix:r,concat:i});return t(lc,{"number, number":a$,"BigNumber, BigNumber":aq,"bigint, bigint":(e,t)=>e&t},u({SS:o,DS:a,Ss:s}))}),lp="bitOr",lf=tP(lp,["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cF({typed:t}),s=cT({typed:t,equalScalar:n}),u=cB({typed:t,DenseMatrix:i}),c=uj({typed:t,matrix:r,concat:a});return t(lp,{"number, number":aZ,"BigNumber, BigNumber":ak,"bigint, bigint":(e,t)=>e|t},c({SS:s,DS:o,Ss:u}))}),ld="bitXor",lm=tP(ld,["typed","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i,SparseMatrix:a}=e,o=uI({typed:t}),s=uk({typed:t,SparseMatrix:a}),u=uR({typed:t,DenseMatrix:n}),c=uj({typed:t,matrix:r,concat:i});return t(ld,{"number, number":aV,"BigNumber, BigNumber":aU,"bigint, bigint":(e,t)=>e^t},c({SS:s,DS:o,Ss:u}))}),lh="catalan",lg=tP(lh,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:s}=e;return t(lh,{"number | BigNumber":function(e){if(!s(e)||o(e))throw TypeError("Non-negative integer value expected in function catalan");return n(a(i(e,2),e),r(e,1))}})}),ly="compare",lv=tP(ly,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:s,concat:u}=e,c=uI({typed:t}),l=cC({typed:t,equalScalar:n}),p=uR({typed:t,DenseMatrix:s}),f=uj({typed:t,matrix:i,concat:u}),d=ou({typed:t});return t(ly,lx({typed:t,config:r}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return new a(os(e,t,r.relTol,r.absTol)?0:e.cmp(t))},"bigint, bigint":function(e,t){return e===t?0n:e>t?1n:-1n},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:l,DS:c,Ss:p}))}),lx=tP(ly,["typed","config"],e=>{var{typed:t,config:r}=e;return t(ly,{"number, number":function(e,t){return rn(e,t,r.relTol,r.absTol)?0:e>t?1:-1}})}),lb="compareText";n8.signature="any, any";var lD=tP(lb,["typed","matrix","concat"],e=>{var{typed:t,matrix:r,concat:n}=e,i=uj({typed:t,matrix:r,concat:n});return t(lb,n8,i({elop:n8,Ds:!0}))}),lN="composition",lw=tP(lN,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:o,larger:s}=e;return t(lN,{"number | BigNumber, number | BigNumber":function(e,t){if(o(e)&&i(e)&&o(t)&&i(t)){if(s(t,e))throw TypeError("k must be less than or equal to n in function composition")}else throw TypeError("Positive integer value expected in function composition");return n(r(e,-1),r(t,-1))}})}),lA="cross",lE=tP(lA,["typed","matrix","subtract","multiply"],e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(lA,{"Matrix, Matrix":function(e,t){return r(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(a(e.toArray(),t))},"Array, Matrix":function(e,t){return r(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var r=Math.max(n9(e).length,n9(t).length);e=ic(e),t=ic(t);var a=n9(e),o=n9(t);if(1!==a.length||1!==o.length||3!==a[0]||3!==o[0])throw RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+o.join(", ")+"])");var s=[n(i(e[1],t[2]),i(e[2],t[1])),n(i(e[2],t[0]),i(e[0],t[2])),n(i(e[0],t[1]),i(e[1],t[0]))];return r>1?[s]:s}}),lS=tP("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:s}=e;return t("det",{any:function(e){return eu(e)},"Array | Matrix":function(e){var t;switch((t=E(e)?e.size():Array.isArray(e)?(e=r(e)).size():[]).length){case 0:return eu(e);case 1:if(1===t[0])return eu(e.valueOf()[0]);if(0===t[0])return 1;throw RangeError("Matrix must be square (size: "+n2(t)+")");case 2:var u=t[0],c=t[1];if(u===c)return function(e,t){if(1===t)return eu(e[0][0]);if(2===t)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var r=!1,u=Array(t).fill(0).map((e,t)=>t),c=0;c<t;c++){var l=u[c];if(o(e[l][c])){var p=void 0;for(p=c+1;p<t;p++)if(!o(e[u[p]][c])){l=u[p],u[p]=u[c],u[c]=l,r=!r;break}if(p===t)return e[l][c]}for(var f=e[l][c],d=0===c?1:e[u[c-1]][c-1],m=c+1;m<t;m++)for(var h=u[m],g=c+1;g<t;g++)e[h][g]=a(n(i(e[h][g],f),i(e[h][c],e[l][g])),d)}var y=e[u[t-1]][t-1];return r?s(y):y}(e.clone().valueOf(),u);if(0===c)return 1;throw RangeError("Matrix must be square (size: "+n2(t)+")");default:throw RangeError("Matrix must be two dimensional (size: "+n2(t)+")")}}})}),lC="diff",lM=tP(lC,["typed","matrix","subtract","number"],e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(lC,{"Array | Matrix":function(e){return E(e)?r(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(!tX(t))throw RangeError("Dimension must be a whole number");return E(e)?r(a(e.toArray(),t)):a(e,t)},"Array, BigNumber":t.referTo("Array,number",e=>(t,r)=>e(t,i(r))),"Matrix, BigNumber":t.referTo("Matrix,number",e=>(t,r)=>e(t,i(r)))});function a(e,t){if(E(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var r=[];return e.forEach(e=>{r.push(a(e,t-1))}),r}if(0===t)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){for(var t=[],r=e.length,i=1;i<r;i++)t.push(function e(t,r){E(t)&&(t=t.toArray()),E(r)&&(r=r.toArray());var i=Array.isArray(t),a=Array.isArray(r);if(i&&a){var o=t,s=r;if(o.length!==s.length)throw RangeError("Not all sub-arrays have the same length");for(var u=[],c=o.length,l=0;l<c;l++)u.push(e(o[l],s[l]));return u}if(!i&&!a)return n(r,t);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}(e[i-1],e[i]));return t}}),lF="distance",lT=tP(lF,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:s,abs:u}=e;return t(lF,{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!l(e))throw TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(t))throw TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(r))throw TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(t,r))throw TypeError("LinePoint1 should not be same with LinePoint2");var a=n(r[1],t[1]),s=n(t[0],r[0]),u=n(i(r[0],t[1]),i(t[0],r[1]));return h(e[0],e[1],a,s,u)}throw TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!l(e))throw TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(t))throw TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(r))throw TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(m(t),m(r)))throw TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){var a=n(r.lineTwoPtY,t.lineOnePtY),s=n(t.lineOnePtX,r.lineTwoPtX),u=n(i(r.lineTwoPtX,t.lineOnePtY),i(t.lineOnePtX,r.lineTwoPtY));return h(e.pointX,e.pointY,a,s,u)}throw TypeError("Key names do not match")}throw TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!l(e))throw TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw TypeError("Array with 3 numbers or BigNumbers expected for second argument");return h(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!p(e))throw TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!d(t))throw TypeError("Array with 6 numbers or BigNumbers expected for second argument");return g(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!f(e)||!f(t))throw TypeError("All values of an array should be numbers or BigNumbers");return y(e,t)}throw TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!l(e))throw TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(t))throw TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return h(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!p(e))throw TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!d(t))throw TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return g(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!l(e))throw TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(t))throw TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return y([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!p(e))throw TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(t))throw TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return y([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw TypeError("Key names do not match")}throw TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&c(e[0][0])&&c(e[0][1])){if(e.some(e=>2!==e.length||!c(e[0])||!c(e[1])))return!1}else if(!(3===e[0].length&&c(e[0][0])&&c(e[0][1])&&c(e[0][2])))return!1;else if(e.some(e=>3!==e.length||!c(e[0])||!c(e[1])||!c(e[2])))return!1;return!0}(e))throw TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=[],n=[],i=0;i<e.length-1;i++)for(var a=i+1;a<e.length;a++)2===e[0].length?(r=[e[i][0],e[i][1]],n=[e[a][0],e[a][1]]):3===e[0].length&&(r=[e[i][0],e[i][1],e[i][2]],n=[e[a][0],e[a][1],e[a][2]]),t.push(y(r,n));return t}(e)}});function c(e){return"number"==typeof e||v(e)}function l(e){return e.constructor!==Array&&(e=m(e)),c(e[0])&&c(e[1])}function p(e){return e.constructor!==Array&&(e=m(e)),c(e[0])&&c(e[1])&&c(e[2])}function f(e){return Array.isArray(e)||(e=m(e)),e.every(c)}function d(e){return e.constructor!==Array&&(e=m(e)),c(e[0])&&c(e[1])&&c(e[2])&&c(e[3])&&c(e[4])&&c(e[5])}function m(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function h(e,t,n,o,c){return a(u(r(r(i(n,e),i(o,t)),c)),s(r(i(n,n),i(o,o))))}function g(e,t,o,u,c,l,p,f,d){var m=[n(i(n(c,t),d),i(n(l,o),f)),n(i(n(l,o),p),i(n(u,e),d)),n(i(n(u,e),f),i(n(c,t),p))];return a(m=s(r(r(i(m[0],m[0]),i(m[1],m[1])),i(m[2],m[2]))),s(r(r(i(p,p),i(f,f)),i(d,d))))}function y(e,t){for(var a=e.length,o=0,u=0,c=0;c<a;c++)o=r(i(u=n(e[c],t[c]),u),o);return s(o)}}),lB="dotDivide",lO=tP(lB,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,u=cx({typed:t,equalScalar:n}),c=uI({typed:t}),l=uk({typed:t,SparseMatrix:s}),p=ue({typed:t,equalScalar:n}),f=uR({typed:t,DenseMatrix:a}),d=uj({typed:t,matrix:r,concat:o});return t(lB,d({elop:i,SS:l,DS:c,SD:u,Ss:p,sS:f}))}),l_="equalText",lz=tP(l_,["typed","compareText","isZero"],e=>{var{typed:t,compareText:r,isZero:n}=e;return t(l_,{"any, any":function(e,t){return n(r(e,t))}})}),lq=tP("FibonacciHeap",["smaller","larger"],e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,r){var n={key:e,value:r,degree:0};if(this._minimum){var i=this._minimum;n.left=i,n.right=i.right,i.right=n,n.right.left=n,t(e,i.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var i=this._minimum,a=e.degree,s=e.child;a>0;){var u=s.right;s.left.right=s.right,s.right.left=s.left,s.left=i,s.right=i.right,i.right=s,s.right.left=s,s.parent=null,s=u,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,s=Math.floor(Math.log(i)*n)+1,u=Array(s),c=0,l=e;if(l)for(c++,l=l.right;l!==e;)c++,l=l.right;for(;c>0;){for(var p=l.degree,f=l.right;a=u[p];){if(r(l.key,a.key)){var d=a;a=l,l=d}o(a,l),u[p]=null,p++}u[p]=l,l=f,c--}e=null;for(var m=0;m<s;m++)(a=u[m])&&(e?(a.left.right=a.right,a.right.left=a.left,a.left=e,a.right=e.right,e.right=a,a.right.left=a,t(a.key,e.key)&&(e=a)):e=a);return e}(i=e.right,this._size),this._size--,this._minimum=i,e},i.prototype.remove=function(e){var r,n,i;this._minimum=(r=this._minimum,(n=e).key=-1,(i=n.parent)&&t(n.key,i.key)&&(a(r,n,i),function e(t,r){var n=r.parent;n&&(r.mark?(a(t,r,n),e(n)):r.mark=!0)}(r,i)),t(n.key,r.key)&&(r=n),r),this.extractMinimum()};var o=function(e,t){e.left.right=e.right,e.right.left=e.left,e.parent=t,t.child?(e.left=t.child,e.right=t.child.right,t.child.right=e,e.right.left=e):(t.child=e,e.right=e,e.left=e),t.degree++,e.mark=!1};return i},{isClass:!0}),lI="hypot",lk=tP(lI,["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],e=>{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:s,isPositive:u}=e;return t(lI,{"... number | BigNumber":c,Array:c,Matrix:e=>c(ip(e.toArray(),!0))});function c(e){for(var t=0,c=0,l=0;l<e.length;l++){if(b(e[l]))throw TypeError("Unexpected type of argument to hypot");var p=r(e[l]);s(c,p)?(t=n(t=a(t,a(i(c,p),i(c,p))),1),c=p):t=n(t,u(p)?a(i(p,c),i(p,c)):p)}return a(c,o(t))}}),lR=tP("ImmutableDenseMatrix",["smaller","DenseMatrix"],e=>{var{smaller:t,DenseMatrix:r}=e;function n(e,t){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw Error("Invalid datatype: "+t);if(E(e)||A(e)){var i=new r(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&A(e.data)&&A(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else if(e)throw TypeError("Unsupported type of data ("+es(e)+")");else this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(e){switch(arguments.length){case 1:var t=r.prototype.subset.call(this,e);if(E(t))return new n({data:t._data,size:t._size,datatype:t._datatype});return t;case 2:case 3:throw Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:eu(this._data),size:eu(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(){throw Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(null===this._min){var e=null;this.forEach(function(r){(null===e||t(r,e))&&(e=r)}),this._min=null!==e?e:void 0}return this._min},n.prototype.max=function(){if(null===this._max){var e=null;this.forEach(function(r){(null===e||t(e,r))&&(e=r)}),this._max=null!==e?e:void 0}return this._max},n},{isClass:!0}),lP=tP("Index",["ImmutableDenseMatrix","getMatrixDataType"],e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var e=0,t=arguments.length;e<t;e++){var a=e<0||arguments.length<=e?void 0:arguments[e],o=A(a),s=E(a),u=typeof a,c=null;if(F(a))this._dimensions.push(a),this._isScalar=!1;else if(o||s){var l=void 0;this._isScalar=!1,"boolean"===r(a)?(o&&(l=i(lU(a).valueOf())),s&&(l=i(lU(a._data).valueOf())),c=a.valueOf().length):l=i(a.valueOf()),this._dimensions.push(l)}else if("number"===u)this._dimensions.push(a);else if("bigint"===u)this._dimensions.push(Number(a));else if("string"===u)this._dimensions.push(a);else throw TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(c)}}function i(e){for(var r=0,n=e.length;r<n;r++)if(!y(e[r])||!tX(e[r]))throw TypeError("Index parameters must be positive integer numbers");var i=new t;return i._data=e,i._size=[e.length],i}return n.prototype.type="Index",n.prototype.isIndex=!0,n.prototype.clone=function(){var e=new n;return e._dimensions=eu(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},n.create=function(e){var t=new n;return n.apply(t,e),t},n.prototype.size=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]=w(n)||y(n)?1:n.size()[0]}return e},n.prototype.max=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]=w(n)||y(n)?n:n.max()}return e},n.prototype.min=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]=w(n)||y(n)?n:n.min()}return e},n.prototype.forEach=function(e){for(var t=0,r=this._dimensions.length;t<r;t++)e(this._dimensions[t],t,this)},n.prototype.dimension=function(e){var t;return y(e)&&null!=(t=this._dimensions[e])?t:null},n.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&w(this._dimensions[0])},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e.push(w(n)||y(n)?n:n.toArray())}return e},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];w(n)?e.push(JSON.stringify(n)):e.push(n.toString())}return"["+e.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(e){return n.create(e.dimensions)},n},{isClass:!0});function lU(e){var t=[];return e.forEach((e,r)=>{e&&t.push(r)}),t}var lj=tP("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],e=>{var{typed:t,config:r,abs:n,add:i,addScalar:a,matrix:o,multiply:s,multiplyScalar:u,divideScalar:c,subtract:l,smaller:p,equalScalar:f,flatten:d,isZero:m,isNumeric:h}=e;return t("intersect",{"Array, Array, Array":g,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(e,t,r){var n=g(e.valueOf(),t.valueOf(),r.valueOf());return null===n?null:o(n)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){var i=y(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===i?null:o(i)}});function g(e,t,r){var n,i,o,s,p,f,d,m,g,y,x,D,N,w,A,E,S,C;if(e=v(e),t=v(t),r=v(r),!b(e))throw TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(t))throw TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!(4===(n=r).length&&h(n[0])&&h(n[1])&&h(n[2])&&h(n[3])))throw TypeError("Array with 4 numbers expected as third argument");return i=e[0],o=e[1],s=e[2],p=t[0],f=t[1],d=t[2],m=r[0],g=r[1],y=r[2],x=r[3],D=u(i,m),N=u(p,m),w=u(o,g),A=u(f,g),E=u(s,y),S=u(d,y),C=c(l(l(l(x,D),w),E),l(l(l(a(a(N,A),S),D),w),E)),[a(i,u(C,l(p,i))),a(o,u(C,l(f,o))),a(s,u(C,l(d,s)))]}function y(e,t,o,d){if(e=v(e),t=v(t),o=v(o),d=v(d),2===e.length){if(!x(e))throw TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!x(t))throw TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!x(o))throw TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!x(d))throw TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,o,f){var d=l(e,t),h=l(o,f),g=l(u(d[0],h[1]),u(h[0],d[1]));if(m(g)||p(n(g),r.relTol))return null;var y=u(h[0],e[1]),v=u(h[1],e[0]),x=u(h[0],o[1]),b=u(h[1],o[0]);return i(s(d,c(a(l(l(y,v),x),b),g)),e)}(e,t,o,d)}if(3===e.length){if(!b(e))throw TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(t))throw TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(o))throw TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!b(d))throw TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,o,s,p,d,h,g,y){var v=D(e,s,h,s,t,p,g,p,r,d,y,d),x=D(h,s,n,e,g,p,i,t,y,d,o,r),b=D(e,s,n,e,t,p,i,t,r,d,o,r),N=D(h,s,h,s,g,p,g,p,y,d,y,d),w=D(n,e,n,e,i,t,i,t,o,r,o,r),A=l(u(v,x),u(b,N)),E=l(u(w,N),u(x,x));if(m(E))return null;var S=c(A,E),C=c(a(v,u(S,x)),N),M=a(e,u(S,l(n,e))),F=a(t,u(S,l(i,t))),T=a(r,u(S,l(o,r))),B=a(s,u(C,l(h,s))),O=a(p,u(C,l(g,p))),_=a(d,u(C,l(y,d)));return f(M,B)&&f(F,O)&&f(T,_)?[M,F,T]:null}(e[0],e[1],e[2],t[0],t[1],t[2],o[0],o[1],o[2],d[0],d[1],d[2])}throw TypeError("Arrays with two or thee dimensional points expected")}function v(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every(e=>Array.isArray(e)&&1===e.length)?d(e):e}function x(e){return 2===e.length&&h(e[0])&&h(e[1])}function b(e){return 3===e.length&&h(e[0])&&h(e[1])&&h(e[2])}function D(e,t,r,n,i,o,s,c,p,f,d,m){var h=u(l(e,t),l(r,n)),g=u(l(i,o),l(s,c)),y=u(l(p,f),l(d,m));return a(a(h,g),y)}}),lL="invmod",lH=tP(lL,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:a,smaller:o,mod:s,add:u,isInteger:c}=e;return t(lL,{"number, number":l,"BigNumber, BigNumber":l});function l(e,t){if(!c(e)||!c(t))throw Error("Parameters in function invmod must be integer numbers");if(e=s(e,t),a(t,0))throw Error("Divisor must be non zero");var r=i(e,t),[l,p]=r=r.valueOf();return a(l,n(1))?(o(p=s(p,t),n(0))&&(p=u(p,t)),p):NaN}}),l$="largerEq",lG=tP(l$,["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=uI({typed:t}),u=uk({typed:t,SparseMatrix:o}),c=uR({typed:t,DenseMatrix:i}),l=uj({typed:t,matrix:n,concat:a}),p=ou({typed:t});return t(l$,lZ({typed:t,config:r}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||os(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e>=t},"Fraction, Fraction":(e,t)=>-1!==e.compare(t),"Complex, Complex":function(){throw TypeError("No ordering relation is defined for complex numbers")}},p,l({SS:u,DS:s,Ss:c}))}),lZ=tP(l$,["typed","config"],e=>{var{typed:t,config:r}=e;return t(l$,{"number, number":function(e,t){return e>=t||rn(e,t,r.relTol,r.absTol)}})}),lV=Math.log(16),lW=tP("log",["config","typed","typeOf","divideScalar","Complex"],e=>{var{typed:t,typeOf:r,config:n,divideScalar:i,Complex:a}=e;function o(e){return e.log()}function s(e){return o(new a(e,0))}return t("log",{number:function(e){return e>=0||n.predictable?i4(e):s(e)},bigint:oQ(lV,i4,n,s),Complex:o,BigNumber:function(e){return!e.isNegative()||n.predictable?e.ln():s(e.toNumber())},"any, any":t.referToSelf(e=>(t,n)=>{if("Fraction"===r(t)&&"Fraction"===r(n)){var a=t.log(n);if(null!==a)return a}return i(e(t),e(n))})})}),lJ="lsolveAll",lQ=tP(lJ,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,u=cV({DenseMatrix:s});return t(lJ,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[u(e,t,!0)._data.map(e=>e[0])],c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=0;m<l;m++)for(var h=r.length,g=0;g<h;g++){for(var y=r[g],v=[],x=[],b=d[m],D=d[m+1],N=0,w=b;w<D;w++){var A=f[w];A===m?N=p[w]:A>m&&(v.push(p[w]),x.push(A))}if(o(N,0))if(o(y[m],0)){if(0===g){var E=[...y];E[m]=1;for(var S=0,C=x.length;S<C;S++){var M=x[S];E[M]=a(E[M],v[S])}r.push(E)}}else{if(0===g)return[];r.splice(g,1),g-=1,h-=1}else{y[m]=n(y[m],N);for(var F=0,T=x.length;F<T;F++){var B=x[F];y[B]=a(y[B],i(y[m],v[F]))}}}return r.map(e=>new s({data:e.map(e=>[e]),size:[c,1]}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map(e=>e.valueOf())}});function c(e,t){for(var r=[u(e,t,!0)._data.map(e=>e[0])],c=e._data,l=e._size[0],p=e._size[1],f=0;f<p;f++)for(var d=r.length,m=0;m<d;m++){var h=r[m];if(o(c[f][f],0))if(o(h[f],0)){if(0===m){var g=[...h];g[f]=1;for(var y=f+1;y<p;y++)g[y]=a(g[y],c[y][f]);r.push(g)}}else{if(0===m)return[];r.splice(m,1),m-=1,d-=1}else{h[f]=n(h[f],c[f][f]);for(var v=f+1;v<p;v++)h[v]=a(h[v],i(h[f],c[v][f]))}}return r.map(e=>new s({data:e.map(e=>[e]),size:[l,1]}))}}),lX="matrixFromRows",lY=tP(lX,["typed","matrix","flatten","size"],e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(lX,{"...Array":function(e){return a(e)},"...Matrix":function(e){return r(a(e.map(e=>e.toArray())))}});function a(e){if(0===e.length)throw TypeError("At least one row is needed to construct a matrix.");var t=o(e[0]),r=[];for(var i of e){var a=o(i);if(a!==t)throw TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|a));r.push(n(i))}return r}function o(e){var t=i(e);if(1===t.length)return t[0];if(2===t.length)if(1===t[0])return t[1];else if(1===t[1])return t[0];else throw TypeError("At least one of the arguments is not a vector.");throw TypeError("Only one- or two-dimensional vectors are supported.")}}),lK=tP("min",["typed","config","numeric","smaller","isNaN"],e=>{var{typed:t,config:r,numeric:n,smaller:i,isNaN:a}=e;return t("min",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){return iL(e,t.valueOf(),o)},"...":function(e){if(iP(e))throw TypeError("Scalar values expected in function min");return s(e)}});function o(e,t){try{return i(e,t)?e:t}catch(e){throw u8(e,"min",t)}}function s(e){var t;if(iU(e,function(e){try{a(e)?t=e:(void 0===t||i(e,t))&&(t=e)}catch(t){throw u8(t,"min",e)}}),void 0===t)throw Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=n(t,tY(t,r))),t}}),l0="nthRoots",l1=tP(l0,["config","typed","divideScalar","Complex"],e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,a=[function(e){return new i(e,0)},function(e){return new i(0,e)},function(e){return new i(-e,0)},function(e){return new i(0,-e)}];function o(e,t){if(t<0)throw Error("Root must be greater than zero");if(0===t)throw Error("Root must be non-zero");if(t%1!=0)throw Error("Root must be an integer");if(0===e||0===e.abs())return[new i(0,0)];var r,n="number"==typeof e;(n||0===e.re||0===e.im)&&(r=n?2*(e<0):0===e.im?2*(e.re<0):2*(e.im<0)+1);for(var o=e.arg(),s=e.abs(),u=[],c=Math.pow(s,1/t),l=0;l<t;l++){var p=(r+4*l)/t;if(p===Math.round(p)){u.push(a[p%4](c));continue}u.push(new i({r:c,phi:(o+2*Math.PI*l)/t}))}return u}return t(l0,{Complex:function(e){return o(e,2)},"Complex, number":o})}),l2="partitionSelect",l3=tP(l2,["typed","isNumeric","isNaN","compare"],e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,a=(e,t)=>-i(e,t);return t(l2,{"Array | Matrix, number":function(e,t){return o(e,t,i)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return o(e,t,i);if("desc"===r)return o(e,t,a);throw Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":o});function o(e,t,r){if(!tX(t)||t<0)throw Error("k must be a non-negative integer");if(E(e)){if(e.size().length>1)throw Error("Only one dimensional matrices supported");return s(e.valueOf(),t,r)}if(Array.isArray(e))return s(e,t,r)}function s(e,t,i){if(t>=e.length)throw Error("k out of bounds");for(var a=0;a<e.length;a++)if(r(e[a])&&n(e[a]))return e[a];for(var o=0,s=e.length-1;o<s;){for(var u=o,c=s,l=e[Math.floor(Math.random()*(s-o+1))+o];u<c;)if(i(e[u],l)>=0){var p=e[c];e[c]=e[u],e[u]=p,--c}else++u;i(e[u],l)>0&&--u,t<=u?s=u:o=u+1}return e[t]}}),l4="rightLogShift",l5=tP(l4,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,s=cF({typed:t}),u=cx({typed:t,equalScalar:n}),c=cH({typed:t,equalScalar:n}),l=cB({typed:t,DenseMatrix:a}),p=ue({typed:t,equalScalar:n}),f=ut({typed:t}),d=uj({typed:t,matrix:r,concat:o}),m=c$({typed:t,matrix:r});return t(l4,{"number, number":aQ,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>n(r,0)?t.clone():p(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>n(r,0)?t.clone():f(t,r,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):l(r,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0))},m,d({SS:c,DS:s,SD:u}))});function l8(e,t,r,n,i,a,o){var s=0;for(r[o]=e;s>=0;){var u=r[o+s],c=r[n+u];-1===c?(s--,a[t++]=u):(r[n+u]=r[i+c],r[o+ ++s]=c)}return t}var l6=tP("csAmd",["add","multiply","transpose"],e=>{var{add:t,multiply:r,transpose:n}=e;return function(e,o){if(!o||e<=0||e>3)return null;var s,u,c,l,p,f,d,m,h,g,y,v,x,b,D,N,w=o._size,A=w[0],E=w[1],S=0,C=Math.max(16,10*Math.sqrt(E));C=Math.min(E-2,C);var M=function(e,i,a,o,s){var u=n(i);if(1===e&&o===a)return t(i,u);if(2===e){for(var c=u._index,l=u._ptr,p=0,f=0;f<a;f++){var d=l[f];if(l[f]=p,!(l[f+1]-d>s))for(var m=l[f+1];d<m;d++)c[p++]=c[d]}l[a]=p,i=n(u)}return r(u,i)}(e,o,A,E,C);!function(e,t){for(var r=e._values,n=e._index,i=e._ptr,a=e._size[1],o=0,s=0;s<a;s++){var u=i[s];for(i[s]=o;u<i[s+1];u++)t(n[u],s,r?r[u]:1,null)&&(n[o]=n[u],r&&(r[o]=r[u]),o++)}i[a]=o,n.splice(o,n.length-o),r&&r.splice(o,r.length-o)}(M,a);for(var F=M._index,T=M._ptr,B=T[E],O=[],_=[],z=E+1,q=2*(E+1),I=3*(E+1),k=4*(E+1),R=5*(E+1),P=6*(E+1),U=7*(E+1),j=function(e,t,r,n,a,o,s,u,c,l,p){for(var f=0;f<e;f++)r[0+f]=t[f+1]-t[f];r[0+e]=0;for(var d=0;d<=e;d++)r[n+d]=-1,a[d]=-1,r[o+d]=-1,r[s+d]=-1,r[u+d]=1,r[c+d]=1,r[l+d]=0,r[p+d]=r[0+d];var m=i(0,0,r,c,e);return r[l+e]=-2,t[e]=-1,r[c+e]=0,m}(E,T,_,I,O,q,U,z,P,k,R),L=function(e,t,r,n,i,a,o,s,u,c,l){for(var p=0,f=0;f<e;f++){var d=r[n+f];if(0===d)r[i+f]=-2,p++,t[f]=-1,r[a+f]=0;else if(d>o)r[s+f]=0,r[i+f]=-1,p++,t[f]=-e-2,r[s+e]++;else{var m=r[u+d];-1!==m&&(c[m]=f),r[l+f]=r[u+d],r[u+d]=f}}return p}(E,T,_,R,k,P,C,z,I,O,q),H=0;L<E;){for(c=-1;H<E&&-1===(c=_[I+H]);H++);-1!==_[q+c]&&(O[_[q+c]]=-1),_[I+H]=_[q+c];var $=_[k+c],G=_[z+c];L+=G;var Z=0;_[z+c]=-G;var V=T[c],W=0===$?V:B,J=W;for(l=1;l<=$+1;l++){for(l>$?(f=c,d=V,m=_[0+c]-$):(d=T[f=F[V++]],m=_[0+f]),p=1;p<=m;p++)(h=_[z+(s=F[d++])])<=0||(Z+=h,_[z+s]=-h,F[J++]=s,-1!==_[q+s]&&(O[_[q+s]]=O[s]),-1!==O[s]?_[q+O[s]]=_[q+s]:_[I+_[R+s]]=_[q+s]);f!==c&&(T[f]=-c-2,_[P+f]=0)}for(0!==$&&(B=J),_[R+c]=Z,T[c]=W,_[0+c]=J-W,_[k+c]=-2,j=i(j,S,_,P,E),g=W;g<J;g++)if(!((y=_[k+(s=F[g])])<=0)){var Q=j-(h=-_[z+s]);for(V=T[s],v=T[s]+y-1;V<=v;V++)_[P+(f=F[V])]>=j?_[P+f]-=h:0!==_[P+f]&&(_[P+f]=_[R+f]+Q)}for(g=W;g<J;g++){for(D=0,x=(v=T[s=F[g]])+_[k+s]-1,b=v,N=0,V=v;V<=x;V++)if(0!==_[P+(f=F[V])]){var X=_[P+f]-j;X>0?(N+=X,F[b++]=f,D+=f):(T[f]=-c-2,_[P+f]=0)}_[k+s]=b-v+1;var Y=b,K=v+_[0+s];for(V=x+1;V<K;V++){var ee=_[z+(u=F[V])];ee<=0||(N+=ee,F[b++]=u,D+=u)}0===N?(T[s]=-c-2,Z-=h=-_[z+s],G+=h,L+=h,_[z+s]=0,_[k+s]=-1):(_[R+s]=Math.min(_[R+s],N),F[b]=F[Y],F[Y]=F[v],F[v]=c,_[0+s]=b-v+1,D=(D<0?-D:D)%E,_[q+s]=_[U+D],_[U+D]=s,O[s]=D)}for(_[R+c]=Z,j=i(j+(S=Math.max(S,Z)),S,_,P,E),g=W;g<J;g++)if(!(_[z+(s=F[g])]>=0))for(s=_[U+(D=O[s])],_[U+D]=-1;-1!==s&&-1!==_[q+s];s=_[q+s],j++){for(m=_[0+s],y=_[k+s],V=T[s]+1;V<=T[s]+m-1;V++)_[P+F[V]]=j;var et=s;for(u=_[q+s];-1!==u;){var er=_[0+u]===m&&_[k+u]===y;for(V=T[u]+1;er&&V<=T[u]+m-1;V++)_[P+F[V]]!==j&&(er=0);er?(T[u]=-s-2,_[z+s]+=_[z+u],_[z+u]=0,_[k+u]=-1,u=_[q+u],_[q+et]=u):(et=u,u=_[q+u])}}for(V=W,g=W;g<J;g++)(h=-_[z+(s=F[g])])<=0||(_[z+s]=h,N=Math.min(N=_[R+s]+Z-h,E-L-h),-1!==_[I+N]&&(O[_[I+N]]=s),_[q+s]=_[I+N],O[s]=-1,_[I+N]=s,H=Math.min(H,N),_[R+s]=N,F[V++]=s);_[z+c]=G,0==(_[0+c]=V-W)&&(T[c]=-1,_[P+c]=0),0!==$&&(B=V)}for(s=0;s<E;s++)T[s]=-T[s]-2;for(u=0;u<=E;u++)_[I+u]=-1;for(u=E;u>=0;u--)_[z+u]>0||(_[q+u]=_[I+T[u]],_[I+T[u]]=u);for(f=E;f>=0;f--)_[z+f]<=0||-1!==T[f]&&(_[q+f]=_[I+T[f]],_[I+T[f]]=f);for(c=0,s=0;s<=E;s++)-1===T[s]&&(c=l8(s,c,_,I,q,O,P));return O.splice(O.length-1,1),O};function i(e,t,r,n,i){if(e<2||e+t<0){for(var a=0;a<i;a++)0!==r[n+a]&&(r[n+a]=1);e=2}return e}function a(e,t){return e!==t}}),l7=tP("csCounts",["transpose"],e=>{var{transpose:t}=e;return function(e,r,n,i){if(!e||!r||!n)return null;var a,o,s,u,c,l,p,f=e._size,d=f[0],m=f[1],h=4*m+(i?m+d+1:0),g=[],y=2*m,v=3*m,x=4*m,b=5*m+1;for(s=0;s<h;s++)g[s]=-1;var D=[],N=t(e),w=N._index,A=N._ptr;for(s=0;s<m;s++)for(D[o=n[s]]=+(-1===g[v+o]);-1!==o&&-1===g[v+o];o=r[o])g[v+o]=s;if(i){for(s=0;s<m;s++)g[n[s]]=s;for(a=0;a<d;a++){for(s=m,l=A[a],p=A[a+1],c=l;c<p;c++)s=Math.min(s,g[w[c]]);g[b+a]=g[x+s],g[x+s]=a}}for(a=0;a<m;a++)g[0+a]=a;for(s=0;s<m;s++){for(-1!==r[o=n[s]]&&D[r[o]]--,u=i?g[x+s]:o;-1!==u;u=i?g[b+u]:-1)for(c=A[u];c<A[u+1];c++){var E=function(e,t,r,n,i,a){var o,s,u,c=0;if(e<=t||r[n+t]<=r[i+e])return -1;r[i+e]=r[n+t];var l=r[a+e];if(r[a+e]=t,-1===l)c=1,u=e;else{for(c=2,u=l;u!==r[0+u];u=r[0+u]);for(o=l;o!==u;o=s)s=r[0+o],r[0+o]=u}return{jleaf:c,q:u}}(a=w[c],o,g,v,m,y);E.jleaf>=1&&D[o]++,2===E.jleaf&&D[E.q]--}-1!==r[o]&&(g[0+o]=r[o])}for(o=0;o<m;o++)-1!==r[o]&&(D[r[o]]+=D[o]);return D}}),l9=tP("csSqr",["add","multiply","transpose"],e=>{var{add:t,multiply:r,transpose:n}=e,i=l6({add:t,multiply:r,transpose:n}),a=l7({transpose:n});return function(e,t,r){var n,o=t._ptr,s=t._size[1],u={};if(u.q=i(e,t),e&&!u.q)return null;if(r){var c=e?function(e,t){for(var r=e._values,n=e._index,i=e._ptr,a=e._size,o=e._datatype,s=a[0],u=a[1],c=[],l=[],p=0,f=0;f<u;f++){l[f]=p;for(var d=t?t[f]:f,m=i[d],h=i[d+1],g=m;g<h;g++){var y=n[g];c[p]=y,p++}}return l[u]=p,e.createSparseMatrix({values:null,index:c,ptr:l,size:[s,u],datatype:o})}(t,u.q):t;u.parent=function(e){if(!e)return null;var t,r,n=e._index,i=e._ptr,a=e._size,o=a[0],s=a[1],u=[],c=[];for(t=0;t<o;t++)c[s+t]=-1;for(var l=0;l<s;l++){u[l]=-1,c[0+l]=-1;for(var p=i[l],f=i[l+1],d=p;d<f;d++){var m=n[d];for(t=c[s+m];-1!==t&&t<l;t=r)r=c[0+t],c[0+t]=l,-1===r&&(u[t]=l);c[s+m]=l}}return u}(c);var l=function(e,t){if(!e)return null;var r,n=0,i=[],a=[],o=2*t;for(r=0;r<t;r++)a[0+r]=-1;for(r=t-1;r>=0;r--)-1!==e[r]&&(a[t+r]=a[0+e[r]],a[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(n=l8(r,n,a,0,t,i,o));return i}(u.parent,s);if(u.cp=a(c,u.parent,l,1),c&&u.parent&&u.cp&&function(e,t){var r,n,i,a,o,s=e._ptr,u=e._index,c=e._size,l=c[0],p=c[1];t.pinv=[],t.leftmost=[];var f=t.parent,d=t.pinv,m=t.leftmost,h=[],g=l+p,y=l+2*p;for(n=0;n<p;n++)h[l+n]=-1,h[g+n]=-1,h[y+n]=0;for(r=0;r<l;r++)m[r]=-1;for(n=p-1;n>=0;n--)for(a=s[n],o=s[n+1],i=a;i<o;i++)m[u[i]]=n;for(r=l-1;r>=0;r--)d[r]=-1,-1!==(n=m[r])&&(0==h[y+n]++&&(h[g+n]=r),h[0+r]=h[l+n],h[l+n]=r);for(n=0,t.lnz=0,t.m2=l;n<p;n++)if(r=h[l+n],t.lnz++,r<0&&(r=t.m2++),d[r]=n,!(--y[n]<=0)){t.lnz+=h[y+n];var v=f[n];-1!==v&&(0===h[y+v]&&(h[g+v]=h[g+n]),h[0+h[g+n]]=h[l+v],h[l+v]=h[0+r],h[y+v]+=h[y+n])}for(r=0;r<l;r++)d[r]<0&&(d[r]=n++);return!0}(c,u))for(u.unz=0,n=0;n<s;n++)u.unz+=u.cp[n]}else u.unz=4*o[s]+s,u.lnz=u.unz;return u}});function pe(e,t){e[t]=-e[t]-2}var pt=tP("csSpsolve",["divideScalar","multiply","subtract"],e=>{var{divideScalar:t,multiply:r,subtract:n}=e;return function(e,i,a,o,s,u,c){var l,p,f,d,m=e._values,h=e._index,g=e._ptr,y=e._size[1],v=i._values,x=i._index,b=i._ptr,D=function(e,t,r,n,i){var a,o,s,u=e._ptr,c=e._size,l=t._index,p=t._ptr,f=c[1],d=f;for(o=p[r],s=p[r+1],a=o;a<s;a++){var m=l[a];u[m]<0||(d=function(e,t,r,n,i){var a,o,s,u=t._index,c=t._ptr,l=t._size[1],p=0;for(n[0]=e;p>=0;){e=n[p];var f,d,m=i?i[e]:e;c[e]<0||(pe(c,e),n[l+p]=m<0?0:(f=c[m])<0?-f-2:f);var h=1;for(o=n[l+p],s=m<0?0:(d=c[m+1])<0?-d-2:d;o<s;o++)if(!(c[a=u[o]]<0)){n[l+p]=o,n[++p]=a,h=0;break}h&&(p--,n[--r]=e)}return r}(m,e,d,n,i))}for(a=d;a<f;a++)pe(u,n[a]);return d}(e,i,a,o,u);for(l=D;l<y;l++)s[o[l]]=0;for(p=b[a],f=b[a+1],l=p;l<f;l++)s[x[l]]=v[l];for(var N=D;N<y;N++){var w=o[N],A=u?u[w]:w;if(!(A<0))for(p=g[A],f=g[A+1],s[w]=t(s[w],m[c?p:f-1]),l=c?p+1:p,d=c?f:f-1;l<d;l++){var E=h[l];s[E]=n(s[E],r(m[l],s[w]))}}return D}}),pr=tP("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],e=>{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:a,largerEq:o,SparseMatrix:s}=e,u=pt({divideScalar:r,multiply:n,subtract:i});return function(e,i,c){if(!e)return null;var l,p,f,d=e._size[1],m=100,h=100;i&&(l=i.q,m=i.lnz||m,h=i.unz||h);var g=[],y=[],v=[],x=new s({values:g,index:y,ptr:v,size:[d,d]}),b=[],D=[],N=[],w=new s({values:b,index:D,ptr:N,size:[d,d]}),A=[],E=[],S=[];for(p=0;p<d;p++)E[p]=0,A[p]=-1,v[p+1]=0;m=0,h=0;for(var C=0;C<d;C++){v[C]=m,N[C]=h;var M=l?l[C]:C,F=u(x,e,M,S,E,A,1),T=-1,B=-1;for(f=F;f<d;f++)if(A[p=S[f]]<0){var O=t(E[p]);a(O,B)&&(B=O,T=p)}else D[h]=A[p],b[h++]=E[p];if(-1===T||B<=0)return null;A[M]<0&&o(t(E[M]),n(B,c))&&(T=M);var _=E[T];for(D[h]=C,b[h++]=_,A[T]=C,y[m]=T,g[m++]=1,f=F;f<d;f++)A[p=S[f]]<0&&(y[m]=p,g[m++]=r(E[p],_)),E[p]=0}for(f=0,v[d]=m,N[d]=h;f<m;f++)y[f]=A[y[f]];return g.splice(m,g.length-m),y.splice(m,y.length-m),b.splice(h,b.length-h),D.splice(h,D.length-h),{L:x,U:w,pinv:A}}}),pn=tP("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],e=>{var{typed:t,abs:r,add:n,multiply:i,transpose:a,divideScalar:o,subtract:s,larger:u,largerEq:c,SparseMatrix:l}=e,p=l9({add:n,multiply:i,transpose:a}),f=pr({abs:r,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:c,SparseMatrix:l});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!tX(t)||t<0||t>3)throw Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw Error("Partial pivoting threshold must be a number from 0 to 1");var n=p(t,e,!1),i=f(e,n,r);return{L:i.L,U:i.U,p:i.pinv,q:n.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}),pi=tP("Spa",["addScalar","equalScalar","FibonacciHeap"],e=>{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var r=this._heap.insert(e,t);this._values[e]=r}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,r){var n=this._values[e];n?n.value=t(n.value,r):(n=this._heap.insert(e,r),this._values[e]=n)},i.prototype.forEach=function(e,t,n){var i=this._heap,a=this._values,o=[],s=i.extractMinimum();for(s&&o.push(s);s&&s.key<=t;)s.key>=e&&!r(s.value,0)&&n(s.key,s.value,this),(s=i.extractMinimum())&&o.push(s);for(var u=0;u<o.length;u++){var c=o[u];a[(s=i.insert(c.key,c.value)).key]=s}},i.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){var i=r.value;r.value=n.value,n.value=i}},i},{isClass:!0}),pa="subset",po=tP(pa,["typed","matrix","zeros","add"],e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(pa,{"Matrix, Index":function(e,t){return ii(t)?r():(it(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",function(e){return function(t,n){var i=e(r(t),n);return n.isScalar()?i:i.valueOf()}}),"Object, Index":pc,"string, Index":ps,"Matrix, Index, any, any":function(e,t,r,a){return ii(t)?e:(it(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw Error("can't boradcast a string");if(t.isScalar())return e;var r=t.size();if(!r.every(e=>e>0))return e;try{return i(e,n(r))}catch(t){return e}}(r,t),a))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,n,i,a){var o=e(r(t),n,i,a);return o.isMatrix?o.valueOf():o}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,n,i){return e(r(t),n,i,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,r,n){return e(t,r,n,void 0)}}),"string, Index, string":pu,"string, Index, string, string":pu,"Object, Index, any":pl})});function ps(e,t){if(!T(t))throw TypeError("Index expected");if(ii(t))return"";if(it(Array.from(e),t),1!==t.size().length)throw new n6(t.size().length,1);var r=e.length;ir(t.min()[0],r),ir(t.max()[0],r);var n=t.dimension(0),i="";function a(t){i+=e.charAt(t)}return Number.isInteger(n)?a(n):n.forEach(a),i}function pu(e,t,r,n){if(!t||!0!==t.isIndex)throw TypeError("Index expected");if(ii(t))return e;if(it(Array.from(e),t),1!==t.size().length)throw new n6(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0);if((Number.isInteger(i)?1:i.size()[0])!==r.length)throw new n6(i.size()[0],r.length);var a=e.length;ir(t.min()[0]),ir(t.max()[0]);for(var o=[],s=0;s<a;s++)o[s]=e.charAt(s);function u(e,t){o[e]=r.charAt(t[0])}if(Number.isInteger(i)?u(i,[0]):i.forEach(u),o.length>a)for(var c=a-1,l=o.length;c<l;c++)o[c]||(o[c]=n);return o.join("")}function pc(e,t){if(!ii(t)){if(1!==t.size().length)throw new n6(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw TypeError("String expected as index to retrieve an object property");return o(e,r)}}function pl(e,t,r){if(ii(t))return e;if(1!==t.size().length)throw new n6(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw TypeError("String expected as index to retrieve an object property");var i=eu(e);return s(i,n,r),i}var pp=tP("sum",["typed","config","add","numeric"],e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return iL(e,t,n)}catch(e){throw u8(e,"sum")}},"...":function(e){if(iP(e))throw TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return iU(e,function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw u8(t,"sum",e)}}),void 0===t&&(t=i(0,r.number)),"string"==typeof t&&(t=i(t,tY(t,r))),t}}),pf=tP("trace",["typed","matrix","add"],e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(e){return i(r(e))},SparseMatrix:function(e){var t=e._values,r=e._index,i=e._ptr,a=e._size,o=a[0],s=a[1];if(o===s){var u=0;if(t.length>0)for(var c=0;c<s;c++)for(var l=i[c],p=i[c+1],f=l;f<p;f++){var d=r[f];if(d===c){u=n(u,t[f]);break}if(d>c)break}return u}throw RangeError("Matrix must be square (size: "+n2(a)+")")},DenseMatrix:i,any:eu});function i(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return eu(r[0]);throw RangeError("Matrix must be square (size: "+n2(t)+")");case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o<i;o++)a=n(a,r[o][o]);return a}throw RangeError("Matrix must be square (size: "+n2(t)+")");default:throw RangeError("Matrix must be two dimensional (size: "+n2(t)+")")}}}),pd="usolveAll",pm=tP(pd,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,u=cV({DenseMatrix:s});return t(pd,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[u(e,t,!0)._data.map(e=>e[0])],c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=l-1;m>=0;m--)for(var h=r.length,g=0;g<h;g++){for(var y=r[g],v=[],x=[],b=d[m],D=d[m+1],N=0,w=D-1;w>=b;w--){var A=f[w];A===m?N=p[w]:A<m&&(v.push(p[w]),x.push(A))}if(o(N,0))if(o(y[m],0)){if(0===g){var E=[...y];E[m]=1;for(var S=0,C=x.length;S<C;S++){var M=x[S];E[M]=a(E[M],v[S])}r.push(E)}}else{if(0===g)return[];r.splice(g,1),g-=1,h-=1}else{y[m]=n(y[m],N);for(var F=0,T=x.length;F<T;F++){var B=x[F];y[B]=a(y[B],i(y[m],v[F]))}}}return r.map(e=>new s({data:e.map(e=>[e]),size:[c,1]}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map(e=>e.valueOf())}});function c(e,t){for(var r=[u(e,t,!0)._data.map(e=>e[0])],c=e._data,l=e._size[0],p=e._size[1],f=p-1;f>=0;f--)for(var d=r.length,m=0;m<d;m++){var h=r[m];if(o(c[f][f],0))if(o(h[f],0)){if(0===m){var g=[...h];g[f]=1;for(var y=f-1;y>=0;y--)g[y]=a(g[y],c[y][f]);r.push(g)}}else{if(0===m)return[];r.splice(m,1),m-=1,d-=1}else{h[f]=n(h[f],c[f][f]);for(var v=f-1;v>=0;v--)h[v]=a(h[v],i(h[f],c[v][f]))}}return r.map(e=>new s({data:e.map(e=>[e]),size:[l,1]}))}}),ph="zpk2tf",pg=tP(ph,["typed","add","multiply","Complex","number"],e=>{var{typed:t,add:r,multiply:n,Complex:i,number:a}=e;return t(ph,{"Array,Array,number":function(e,t,r){return o(e,t,r)},"Array,Array":function(e,t){return o(e,t,1)},"Matrix,Matrix,number":function(e,t,r){return o(e.valueOf(),t.valueOf(),r)},"Matrix,Matrix":function(e,t){return o(e.valueOf(),t.valueOf(),1)}});function o(e,t,r){e.some(e=>"BigNumber"===e.type)&&(e=e.map(e=>a(e))),t.some(e=>"BigNumber"===e.type)&&(t=t.map(e=>a(e)));for(var o=[i(1,0)],u=[i(1,0)],c=0;c<e.length;c++){var l=e[c];"number"==typeof l&&(l=i(l,0)),o=s(o,[i(1,0),i(-l.re,-l.im)])}for(var p=0;p<t.length;p++){var f=t[p];"number"==typeof f&&(f=i(f,0)),u=s(u,[i(1,0),i(-f.re,-f.im)])}for(var d=0;d<o.length;d++)o[d]=n(o[d],r);return[o,u]}function s(e,t){for(var a=[],o=0;o<e.length+t.length-1;o++){a[o]=i(0,0);for(var s=0;s<e.length;s++)o-s>=0&&o-s<t.length&&(a[o]=r(a[o],n(e[s],t[o-s])))}return a}}),py="ceil",pv=new tR(10),px=tP(py,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;function i(e){var t=Math.ceil(e),i=n(e);return t===i?t:rn(e,i,r.relTol,r.absTol)&&!rn(e,t,r.relTol,r.absTol)?i:t}return t(py,{number:i,"number, number":function(e,t){if(!tX(t))throw RangeError("number of decimals in function ceil must be an integer");if(t<0||t>15)throw RangeError("number of decimals in ceil number must be in range 0-15");var r=10**t;return i(e*r)/r}})}),pb=tP(py,["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,u=ue({typed:t,equalScalar:a}),c=uR({typed:t,DenseMatrix:s}),l=ut({typed:t}),p=px({typed:t,config:r,round:n});function f(e){var t=(e,t)=>os(e,t,r.relTol,r.absTol),i=e.ceil(),a=n(e);return i.eq(a)?i:t(e,a)&&!t(e,i)?a:i}return t("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:f,"BigNumber, BigNumber":function(e,t){var r=pv.pow(t);return f(e.mul(r)).div(r)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>ij(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,r)=>ij(t,t=>e(t,r),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>u(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>l(t,r,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,r)=>l(i(r),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,r)=>a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?l(r,t,e,!0):c(r,t,e,!0))})}),pD=r(31880),pN="compareNatural",pw=tP(pN,["typed","compare"],e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(pN,{"any, any":function e(t,a){var o,s,u,c=es(t),l=es(a);if(("number"===c||"BigNumber"===c||"Fraction"===c)&&("number"===l||"BigNumber"===l||"Fraction"===l))return"0"!==(u=r(t,a)).toString()?u>0?1:-1:pD(c,l);var p=["Array","DenseMatrix","SparseMatrix"];if(p.includes(c)||p.includes(l))return 0!==(u=function e(t,r,n){return M(r)&&M(n)?i(t,r.toJSON().values,n.toJSON().values):M(r)?e(t,r.toArray(),n):M(n)?e(t,r,n.toArray()):C(r)?e(t,r.toJSON().data,n):C(n)?e(t,r,n.toJSON().data):Array.isArray(r)?Array.isArray(n)?i(t,r,n):e(t,r,[n]):e(t,[r],n)}(e,t,a))?u:pD(c,l);if(c!==l)return pD(c,l);if("Complex"===c){return o=t,s=a,o.re>s.re?1:o.re<s.re?-1:o.im>s.im?1:o.im<s.im?-1:0}if("Unit"===c)return t.equalBase(a)?e(t.value,a.value):i(e,t.formatUnits(),a.formatUnits());if("boolean"===c)return n(t,a);if("string"===c)return pD(t,a);if("Object"===c)return function(e,t,r){var n=Object.keys(t),a=Object.keys(r);n.sort(pD),a.sort(pD);var o=i(e,n,a);if(0!==o)return o;for(var s=0;s<n.length;s++){var u=e(t[n[s]],r[a[s]]);if(0!==u)return u}return 0}(e,t,a);if("null"===c||"undefined"===c)return 0;throw TypeError('Unsupported type of value "'+c+'"')}});function i(e,t,r){for(var n=0,i=Math.min(t.length,r.length);n<i;n++){var a=e(t[n],r[n]);if(0!==a)return a}return t.length>r.length?1:t.length<r.length?-1:0}}),pA="cumsum",pE=tP(pA,["typed","add","unaryPlus"],e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(pA,{Array:i,Matrix:function(e){return e.create(i(e.valueOf(),e.datatype()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(e,t){return e.create(o(e.valueOf(),t),e.datatype())},"...":function(e){if(iP(e))throw TypeError("All values expected to be scalar in function cumsum");return i(e)}});function i(e){try{return a(e)}catch(e){throw u8(e,pA)}}function a(e){if(0===e.length)return[];for(var t=[n(e[0])],i=1;i<e.length;++i)t.push(r(t[i-1],e[i]));return t}function o(e,t){var r=n9(e);if(t<0||t>=r.length)throw new n7(t,r.length);try{return function e(t,r){var n,i,o;if(r<=0){if(!Array.isArray(t[0][0]))return a(t);for(n=0,o=iR(t),i=[];n<o.length;n++)i[n]=e(o[n],r-1);return i}for(n=0,i=[];n<t.length;n++)i[n]=e(t[n],r-1);return i}(e,t)}catch(e){throw u8(e,pA)}}}),pS=tP("fix",["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t("fix",{number:function(e){return e>0?n(e):r(e)},"number, number":function(e,t){return e>0?n(e,t):r(e,t)}})}),pC=tP("fix",["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:s,DenseMatrix:u}=e,c=uR({typed:t,DenseMatrix:u}),l=ut({typed:t}),p=pS({typed:t,ceil:i,floor:a});return t("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new r(e.re>0?a(e.re,t):i(e.re,t),e.im>0?a(e.im,t):i(e.im,t))},"Complex, BigNumber":function(e,t){var n=t.toNumber();return new r(e.re>0?a(e.re,n):i(e.re,n),e.im>0?a(e.im,n):i(e.im,n))},BigNumber:function(e){return e.isNegative()?i(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):a(e,t)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.s<0n?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0n?i(e,t):a(e,t)},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>ij(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>ij(t,e,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(e=>(t,r)=>ij(t,t=>e(t,r),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,r)=>l(n(r),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,r)=>o(t,0)?s(r.size(),r.storage()):"dense"===r.storage()?l(r,t,e,!0):c(r,t,e,!0))})}),pM="index",pF=tP(pM,["typed","Index"],e=>{var{typed:t,Index:r}=e;return t(pM,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map(function(e){return v(e)?e.toNumber():A(e)||E(e)?e.map(function(e){return v(e)?e.toNumber():e}):e}),n=new r;return r.apply(n,t),n}})}),pT=tP("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:s,identity:u,abs:c}=e;return t("inv",{"Array | Matrix":function(e){var t=E(e)?e.size():n9(e);switch(t.length){case 1:if(1===t[0])if(E(e))return r([n(1,e.valueOf()[0])]);else return[n(1,e[0])];throw RangeError("Matrix must be square (size: "+n2(t)+")");case 2:var i=t[0],a=t[1];if(i===a)if(E(e))return r(l(e.valueOf(),i,a),e.storage());else return l(e,i,a);throw RangeError("Matrix must be square (size: "+n2(t)+")");default:throw RangeError("Matrix must be two dimensional (size: "+n2(t)+")")}},any:function(e){return n(1,e)}});function l(e,t,r){if(1===t){if(0===(d=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,d)]]}if(2===t){var l,p,f,d,m,h=s(e);if(0===h)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],h),n(o(e[0][1]),h)],[n(o(e[1][0]),h),n(e[0][0],h)]]}var g=e.concat();for(l=0;l<t;l++)g[l]=g[l].concat();for(var y=u(t).valueOf(),v=0;v<r;v++){var x=c(g[v][v]),b=v;for(l=v+1;l<t;)c(g[l][v])>x&&(x=c(g[l][v]),b=l),l++;if(0===x)throw Error("Cannot calculate inverse, determinant is zero");(l=b)!==v&&(m=g[v],g[v]=g[l],g[l]=m,m=y[v],y[v]=y[l],y[l]=m);var D=g[v],N=y[v];for(l=0;l<t;l++){var w=g[l],A=y[l];if(l!==v){if(0!==w[v]){for(f=n(o(w[v]),D[v]),p=v;p<r;p++)w[p]=i(w[p],a(f,D[p]));for(p=0;p<r;p++)A[p]=i(A[p],a(f,N[p]))}}else{for(f=D[v],p=v;p<r;p++)w[p]=n(w[p],f);for(p=0;p<r;p++)A[p]=n(A[p],f)}}}return y}}),pB="log1p",pO=tP(pB,["typed","config","divideScalar","log","Complex"],e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(pB,{number:function(e){return e>=-1||r.predictable?t2(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e)),"any, any":t.referToSelf(e=>(t,r)=>n(e(t),i(r)))});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}),p_=tP("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:o,subtractScalar:s,larger:u,equalScalar:c,unaryMinus:l,DenseMatrix:p,SparseMatrix:f,Spa:d}=e;return t("lup",{DenseMatrix:function(e){return m(e)},SparseMatrix:function(e){return function(e){var t,r,i,s=e._size[0],p=e._size[1],m=Math.min(s,p),h=e._values,g=e._index,y=e._ptr,v=[],x=[],b=[],D=[s,m],N=[],w=[],A=[],E=[m,p],S=[],C=[];for(t=0;t<s;t++)S[t]=t,C[t]=t;var M=function(e,t){var r=C[e],n=C[t];S[r]=t,S[n]=e,C[e]=n,C[t]=r};for(r=0;r<p;r++)!function(){var e=new d;r<s&&(b.push(v.length),v.push(1),x.push(r)),A.push(N.length);var p=y[r],m=y[r+1];for(i=p;i<m;i++)t=g[i],e.set(S[t],h[i]);r>0&&e.forEach(0,r-1,function(t,r){f._forEachRow(t,v,x,b,function(n,i){n>t&&e.accumulate(n,l(o(i,r)))})});var C=r,F=e.get(r),T=n(F);e.forEach(r+1,s-1,function(e,t){var r=n(t);u(r,T)&&(C=e,T=r,F=t)}),r!==C&&(f._swapRows(r,C,D[1],v,x,b),f._swapRows(r,C,E[1],N,w,A),e.swap(r,C),M(r,C)),e.forEach(0,s-1,function(e,t){e<=r?(N.push(t),w.push(e)):c(t=a(t,F),0)||(v.push(t),x.push(e))})}();return A.push(N.length),b.push(v.length),{L:new f({values:v,index:x,ptr:b,size:D}),U:new f({values:N,index:w,ptr:A,size:E}),p:S,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){var t=m(r(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function m(e){var t,r,l,f=e._size[0],d=e._size[1],m=Math.min(f,d),h=eu(e._data),g=[],y=[f,m],v=[],x=[m,d],b=[];for(t=0;t<f;t++)b[t]=t;for(r=0;r<d;r++){if(r>0)for(t=0;t<f;t++){var D=Math.min(t,r),N=0;for(l=0;l<D;l++)N=i(N,o(h[t][l],h[l][r]));h[t][r]=s(h[t][r],N)}var w=r,A=0,E=0;for(t=r;t<f;t++){var S=h[t][r],C=n(S);u(C,A)&&(w=t,A=C,E=S)}if(r!==w&&(b[r]=[b[w],b[w]=b[r]][0],p._swapRows(r,w,h)),r<f)for(t=r+1;t<f;t++)c(h[t][r],0)||(h[t][r]=a(h[t][r],E))}for(r=0;r<d;r++)for(t=0;t<f;t++){if(0===r&&(t<d&&(v[t]=[]),g[t]=[]),t<r){t<d&&(v[t][r]=h[t][r]),r<f&&(g[t][r]=0);continue}if(t===r){t<d&&(v[t][r]=h[t][r]),r<f&&(g[t][r]=1);continue}t<d&&(v[t][r]=0),r<f&&(g[t][r]=h[t][r])}var M=new p({data:g,size:y}),F=new p({data:v,size:x}),T=[];for(t=0,m=b.length;t<m;t++)T[b[t]]=t;return{L:M,U:F,p:T,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}}),pz="pinv",pq=tP(pz,["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],e=>{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:o,dot:s,ctranspose:u,divideScalar:c,multiply:l,add:p,Complex:f}=e;return t(pz,{"Array | Matrix":function(e){var t=E(e)?e.size():n9(e);switch(t.length){case 1:if(h(e))return u(e);if(1===t[0])return n(e);return o(u(e),s(e,e));case 2:if(h(e))return u(e);var i=t[0],a=t[1];if(i===a)try{return n(e)}catch(e){if(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/));else throw e}if(E(e))return r(d(e.valueOf(),i,a),e.storage());return d(e,i,a);default:throw RangeError("Matrix must be two dimensional (size: "+n2(t)+")")}},any:function(e){return a(e,0)?eu(e):c(1,e)}});function d(e,t,r){var i,a,c,{C:f,F:d}=(c=function(e,t,r){for(var n=eu(e),i=0,a=0;a<t&&!(r<=i);a++){for(var s=a;m(n[s][i]);)if(t===++s&&(s=a,r===++i))return n;[n[s],n[a]]=[n[a],n[s]];for(var u=n[a][i],c=0;c<r;c++)n[a][c]=o(n[a][c],u);for(var f=0;f<t;f++)if(f!==a){u=n[f][i];for(var d=0;d<r;d++)n[f][d]=p(n[f][d],l(-1,l(u,n[a][d])))}i++}return n}(i=e,a=t,r),{C:i.map((e,t)=>e.filter((e,t)=>t<a&&!m(s(c[t],c[t])))),F:c.filter((e,t)=>!m(s(c[t],c[t])))}),h=l(n(l(u(f),f)),u(f)),g=l(u(d),n(l(d,u(d))));return l(g,h)}function m(e){return a(p(e,f(1,1)),p(0,f(1,1)))}function h(e){return i(p(e,f(1,1)),p(l(e,0),f(1,1)))}}),pI=tP("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:a,inv:o,number:s,fraction:u,Complex:c}=e;return t("pow",{"number, number":l,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new c(e.toNumber(),0).pow(t.toNumber(),0)},"bigint, bigint":(e,t)=>e**t,"Fraction, Fraction":function(e,t){var n=e.pow(t);if(null!=n)return n;if(!r.predictable)return l(e.valueOf(),t.valueOf());throw Error("Result of pow is non-rational and cannot be expressed as a fraction")},"Array, number":p,"Array, BigNumber":function(e,t){return p(e,t.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(e,t){return f(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function l(e,t){if(r.predictable&&!tX(t)&&e<0)try{var n=u(t),i=s(n);if((t===i||1e-14>Math.abs((t-i)/t))&&n.d%2n===1n)return(n.n%2n===0n?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:tX(t)||e>=0||r.predictable?at(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new c(e,0).pow(t,0)}function p(e,t){if(!tX(t))throw TypeError("For A^b, b must be an integer (value is "+t+")");var r=n9(e);if(2!==r.length)throw Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return p(o(e),-t)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw e}for(var a=n(r[0]).valueOf(),s=e;t>=1;)(1&t)==1&&(a=i(s,a)),t>>=1,s=i(s,s);return a}function f(e,t){return a(p(e.valueOf(),t))}}),pk="setCartesian",pR=tP(pk,["typed","size","subset","compareNatural","Index","DenseMatrix"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(pk,{"Array | Matrix, Array | Matrix":function(e,t){var s=[];if(0!==n(r(e),new a(0))&&0!==n(r(t),new a(0))){var u=ip(Array.isArray(e)?e:e.toArray()).sort(i),c=ip(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(var l=0;l<u.length;l++)for(var p=0;p<c.length;p++)s.push([u[l],c[p]])}return Array.isArray(e)&&Array.isArray(t)?s:new o(s)}})}),pP="setDistinct",pU=tP(pP,["typed","size","subset","compareNatural","Index","DenseMatrix"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(pP,{"Array | Matrix":function(e){var t;if(0===n(r(e),new a(0)))t=[];else{var s=ip(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(s[0]);for(var u=1;u<s.length;u++)0!==i(s[u],s[u-1])&&t.push(s[u])}return Array.isArray(e)?t:new o(t)}})}),pj="setIsSubset",pL=tP(pj,["typed","size","subset","compareNatural","Index"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(pj,{"Array | Matrix, Array | Matrix":function(e,t){if(0===n(r(e),new a(0)))return!0;if(0===n(r(t),new a(0)))return!1;for(var o,s=iv(ip(Array.isArray(e)?e:e.toArray()).sort(i)),u=iv(ip(Array.isArray(t)?t:t.toArray()).sort(i)),c=0;c<s.length;c++){o=!1;for(var l=0;l<u.length;l++)if(0===i(s[c].value,u[l].value)&&s[c].identifier===u[l].identifier){o=!0;break}if(!1===o)return!1}return!0}})}),pH="setPowerset",p$=tP(pH,["typed","size","subset","compareNatural","Index"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(pH,{"Array | Matrix":function(e){if(0===n(r(e),new a(0)))return[];for(var t=ip(Array.isArray(e)?e:e.toArray()).sort(i),o=[],s=0;s.toString(2).length<=t.length;)o.push(function(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}(t,s.toString(2).split("").reverse())),s++;for(var u=o,c=[],l=u.length-1;l>0;l--)for(var p=0;p<l;p++)u[p].length>u[p+1].length&&(c=u[p],u[p]=u[p+1],u[p+1]=c);return u}})}),pG="smallerEq",pZ=tP(pG,["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=uI({typed:t}),u=uk({typed:t,SparseMatrix:o}),c=uR({typed:t,DenseMatrix:i}),l=uj({typed:t,matrix:n,concat:a}),p=ou({typed:t});return t(pG,pV({typed:t,config:r}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||os(e,t,r.relTol,r.absTol)},"bigint, bigint":(e,t)=>e<=t,"Fraction, Fraction":(e,t)=>1!==e.compare(t),"Complex, Complex":function(){throw TypeError("No ordering relation is defined for complex numbers")}},p,l({SS:u,DS:s,Ss:c}))}),pV=tP(pG,["typed","config"],e=>{var{typed:t,config:r}=e;return t(pG,{"number, number":function(e,t){return e<=t||rn(e,t,r.relTol,r.absTol)}})}),pW="sort",pJ=tP(pW,["typed","matrix","compare","compareNatural"],e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,a=(e,t)=>-n(e,t);return t(pW,{Array:function(e){return s(e),e.sort(n)},Matrix:function(e){return u(e),r(e.toArray().sort(n),e.storage())},"Array, function":function(e,t){return s(e),e.sort(t)},"Matrix, function":function(e,t){return u(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return s(e),e.sort(o(t))},"Matrix, string":function(e,t){return u(e),r(e.toArray().sort(o(t)),e.storage())}});function o(e){if("asc"===e)return n;if("desc"===e)return a;if("natural"===e)return i;throw Error('String "asc", "desc", or "natural" expected')}function s(e){if(1!==n9(e).length)throw Error("One dimensional array expected")}function u(e){if(1!==e.size().length)throw Error("One dimensional matrix expected")}}),pQ="sqrtm",pX=tP(pQ,["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],e=>{var{typed:t,abs:r,add:n,multiply:i,map:a,sqrt:o,subtract:s,inv:u,size:c,max:l,identity:p}=e;return t(pQ,{"Array | Matrix":function(e){var t=E(e)?e.size():n9(e);switch(t.length){case 1:if(1===t[0])return a(e,o);throw RangeError("Matrix must be square (size: "+n2(t)+")");case 2:if(t[0]===t[1])return function(e){var t,a=0,o=e,f=p(c(e));do{var d=o;if(o=i(.5,n(d,u(f))),f=i(.5,n(f,u(d))),(t=l(r(s(o,d))))>1e-6&&++a>1e3)throw Error("computing square root of matrix: iterative method could not converge")}while(t>1e-6);return o}(e);throw RangeError("Matrix must be square (size: "+n2(t)+")");default:throw RangeError("Matrix must be at most two dimensional (size: "+n2(t)+")")}}})}),pY="unequal",pK=tP(pY,["typed","config","equalScalar","matrix","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,u=uI({typed:t}),c=uk({typed:t,SparseMatrix:s}),l=uR({typed:t,DenseMatrix:a}),p=uj({typed:t,matrix:i,concat:o});return t(pY,p0({typed:t,equalScalar:n}),p({elop:function(e,t){return!n(e,t)},SS:c,DS:u,Ss:l}))}),p0=tP(pY,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(pY,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})}),p1=tP("and",["typed","matrix","equalScalar","zeros","not","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,s=cx({typed:t,equalScalar:n}),u=cj({typed:t,equalScalar:n}),c=ue({typed:t,equalScalar:n}),l=ut({typed:t}),p=uj({typed:t,matrix:r,concat:o});return t("and",{"number, number":se,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)&&(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!t.isZero()&&!e.isNaN()&&!t.isNaN()},"bigint, bigint":se,"Unit, Unit":t.referToSelf(e=>(t,r)=>e(t.value||0,r.value||0)),"SparseMatrix, any":t.referToSelf(e=>(t,r)=>a(r)?i(t.size(),t.storage()):c(t,r,e,!1)),"DenseMatrix, any":t.referToSelf(e=>(t,r)=>a(r)?i(t.size(),t.storage()):l(t,r,e,!1)),"any, SparseMatrix":t.referToSelf(e=>(t,r)=>a(t)?i(t.size(),t.storage()):c(r,t,e,!0)),"any, DenseMatrix":t.referToSelf(e=>(t,r)=>a(t)?i(t.size(),t.storage()):l(r,t,e,!0)),"Array, any":t.referToSelf(e=>(t,n)=>e(r(t),n).valueOf()),"any, Array":t.referToSelf(e=>(t,n)=>e(t,r(n)).valueOf())},p({SS:u,DS:s}))}),p2=tP("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e,s=ue({typed:t,equalScalar:i}),u=ut({typed:t});return t("divide",ec({"Array | Matrix, Array | Matrix":function(e,t){return n(e,o(t))},"DenseMatrix, any":function(e,t){return u(e,t,a,!1)},"SparseMatrix, any":function(e,t){return s(e,t,a,!1)},"Array, any":function(e,t){return u(r(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,o(t))}},a.signatures))}),p3="expm",p4=tP(p3,["typed","abs","add","identity","inv","multiply"],e=>{var{typed:t,abs:r,add:n,identity:i,inv:a,multiply:o}=e;return t(p3,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw RangeError("Matrix must be square (size: "+n2(t)+")");for(var s=t[0],u=function(e){for(var t=0;t<30;t++)for(var r=0;r<=t;r++){var n=t-r;if(1e-15>function(e,t,r){for(var n=1,i=2;i<=t;i++)n*=i;for(var a=n,o=t+1;o<=2*t;o++)a*=o;var s=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(a*s)}(e,r,n))return{q:r,j:n}}throw Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(function(e){for(var t=e.size()[0],n=0,i=0;i<t;i++){for(var a=0,o=0;o<t;o++)a+=r(e.get([i,o]));n=Math.max(a,n)}return n}(e)),c=u.q,l=u.j,p=o(e,Math.pow(2,-l)),f=i(s),d=i(s),m=1,h=p,g=-1,y=1;y<=c;y++)y>1&&(h=o(h,p),g=-g),f=n(f,o(m=m*(c-y+1)/((2*c-y+1)*y),h)),d=n(d,o(m*g,h));for(var v=o(a(d),f),x=0;x<l;x++)v=o(v,v);return M(e)?e.createSparseMatrix(v):v}})}),p5=tP("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:o,tau:s,i:u,dotDivide:c,conj:l,pow:p,ceil:f,log2:d}=e;return t("fft",{Array:m,Matrix:function(e){return e.create(m(e.valueOf()),e.datatype())}});function m(e){var t=n9(e);return 1===t.length?h(e,t[0]):function e(t,r){var n=n9(t);if(0!==r)return Array(n[0]).fill(0).map((n,i)=>e(t[i],r-1));if(1===n.length)return h(t);function i(e){var t=n9(e);return Array(t[1]).fill(0).map((r,n)=>Array(t[0]).fill(0).map((t,r)=>e[r][n]))}return i(e(i(t),1))}(e.map(e=>m(e,t.slice(1))),0)}function h(e){var t=e.length;if(1===t)return[e[0]];if(t%2!=0)return function(e){for(var t=e.length,r=o(a(i(-1,i(u,s)),t)),n=[],g=1-t;g<t;g++)n.push(p(r,a(p(g,2),2)));for(var y=p(2,f(d(t+t-1))),v=[...Array(t).fill(0).map((r,a)=>i(e[a],n[t-1+a])),...Array(y-t).fill(0)],x=[...Array(t+t-1).fill(0).map((e,t)=>a(1,n[t])),...Array(y-(t+t-1)).fill(0)],b=h(v),D=h(x),N=c(l(m(l(Array(y).fill(0).map((e,t)=>i(b[t],D[t]))))),y),w=[],A=t-1;A<t+t-1;A++)w.push(i(N[A],n[A]));return w}(e);for(var r=[...h(e.filter((e,t)=>t%2==0),t/2),...h(e.filter((e,t)=>t%2==1),t/2)],g=0;g<t/2;g++){var y=r[g],v=i(r[g+t/2],o(i(i(s,u),a(-g,t))));r[g]=n(y,v),r[g+t/2]=n(y,i(-1,v))}return r}}),p8="freqz",p6=tP(p8,["typed","add","multiply","Complex","divide","matrix"],e=>{var{typed:t,add:r,multiply:n,Complex:i,divide:a,matrix:o}=e;return t(p8,{"Array, Array":function(e,t){return s(e,t,u(512))},"Array, Array, Array":function(e,t,r){return s(e,t,r)},"Array, Array, number":function(e,t,r){if(r<0)throw Error("w must be a positive number");return s(e,t,u(r))},"Matrix, Matrix":function(e,t){var r=u(512),{w:n,h:i}=s(e.valueOf(),t.valueOf(),r);return{w:o(n),h:o(i)}},"Matrix, Matrix, Matrix":function(e,t,r){var{h:n}=s(e.valueOf(),t.valueOf(),r.valueOf());return{h:o(n),w:o(r)}},"Matrix, Matrix, number":function(e,t,r){if(r<0)throw Error("w must be a positive number");var n=u(r),{h:i}=s(e.valueOf(),t.valueOf(),n);return{h:o(i),w:o(n)}}});function s(e,t,o){for(var s=[],u=[],c=0;c<o.length;c++){for(var l=i(0,0),p=i(0,0),f=0;f<e.length;f++)l=r(l,n(e[f],i(Math.cos(-f*o[c]),Math.sin(-f*o[c]))));for(var d=0;d<t.length;d++)p=r(p,n(t[d],i(Math.cos(-d*o[c]),Math.sin(-d*o[c]))));s.push(l),u.push(p)}for(var m=[],h=0;h<s.length;h++)m.push(a(s[h],u[h]));return{h:m,w:o}}function u(e){for(var t=[],r=0;r<e;r++)t.push(r/e*Math.PI);return t}}),p7="gamma",p9=tP(p7,["typed","config","multiplyScalar","pow","BigNumber","Complex"],e=>{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:o}=e;return t(p7,{number:oH,Complex:function e(t){if(0===t.im)return oH(t.re);if(t.re<.5){var r=new o(1-t.re,-t.im),n=new o(Math.PI*t.re,Math.PI*t.im);return new o(Math.PI).div(n.sin()).div(e(r))}t=new o(t.re-1,t.im);for(var i=new o(oG["0"],0),a=1;a<oG.length;++a){var s=new o(oG[a],0);i=i.add(s.div(t.add(a)))}var u=new o(t.re+o$+.5,t.im),c=Math.sqrt(2*Math.PI),l=u.pow(t.add(.5)),p=u.neg().exp();return i.mul(c).mul(l).mul(p)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new a(1/0):function e(t){if(t<8)return new a([1,1,2,6,24,120,720,5040][t]);var n=r.precision+(0|Math.log(t.toNumber())),i=a.clone({precision:n});if(t%2==1)return t.times(e(new a(t-1)));for(var o=t,s=new i(t),u=t.toNumber();o>2;)o-=2,u+=o,s=s.times(u);return new a(s.toPrecision(a.precision))}(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw Error("Integer BigNumber expected")}})}),fe="ifft",ft=tP(fe,["typed","fft","dotDivide","conj"],e=>{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(fe,{"Array | Matrix":function(e){var t=E(e)?e.size():n9(e);return n(i(r(i(e))),t.reduce((e,t)=>e*t,1))}})}),fr="kldivergence",fn=tP(fr,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:a,map:o,dotDivide:s,log:u,isNumeric:c}=e;return t(fr,{"Array, Array":function(e,t){return l(r(e),r(t))},"Matrix, Array":function(e,t){return l(e,r(t))},"Array, Matrix":function(e,t){return l(r(e),t)},"Matrix, Matrix":function(e,t){return l(e,t)}});function l(e,t){var r=t.size().length,l=e.size().length;if(r>1)throw Error("first object must be one dimensional");if(l>1)throw Error("second object must be one dimensional");if(r!==l)throw Error("Length of two vectors must be equal");if(0===i(e))throw Error("Sum of elements in first object must be non zero");if(0===i(t))throw Error("Sum of elements in second object must be non zero");var p=n(e,i(e)),f=n(t,i(t)),d=i(a(p,o(s(p,f),e=>u(e))));return c(d)?d:NaN}});function fi(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}var fa="lusolve",fo=tP(fa,["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],e=>{var{typed:t,matrix:r,lup:n,slu:i,usolve:a,lsolve:o,DenseMatrix:s}=e,u=cV({DenseMatrix:s});return t(fa,{"Array, Array | Matrix":function(e,t){var i=n(e=r(e));return l(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var r=n(e);return l(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var r=n(e);return l(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){var a=i(e,r,n);return l(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return l(e.L,e.U,e.p,e.q,t)}});function c(e){if(E(e))return e;if(A(e))return r(e);throw TypeError("Invalid Matrix LU decomposition")}function l(e,t,r,n,i){e=c(e),t=c(t),r&&((i=u(e,i,!0))._data=fi(r,i._data));var s=a(t,o(e,i));return n&&(s._data=fi(n,s._data)),s}}),fs="mean",fu=tP(fs,["typed","add","divide"],e=>{var{typed:t,add:r,divide:n}=e;return t(fs,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{var i=iL(e,t,r),a=Array.isArray(e)?n9(e):e.size();return n(i,a[t])}catch(e){throw u8(e,"mean")}},"...":function(e){if(iP(e))throw TypeError("Scalar values expected in function mean");return i(e)}});function i(e){var t,i=0;if(iU(e,function(e){try{t=void 0===t?e:r(t,e),i++}catch(t){throw u8(t,"mean",e)}}),0===i)throw Error("Cannot calculate the mean of an empty array");return n(t,i)}}),fc="median",fl=tP(fc,["typed","add","divide","compare","partitionSelect"],e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:a}=e;function o(e){try{var t=(e=ip(e.valueOf())).length;if(0===t)throw Error("Cannot calculate median of an empty array");if(t%2==0){for(var r=t/2-1,n=a(e,r+1),o=e[r],c=0;c<r;++c)i(e[c],o)>0&&(o=e[c]);return u(o,n)}var l=a(e,(t-1)/2);return s(l)}catch(e){throw u8(e,"median")}}var s=t({"number | BigNumber | Complex | Unit":function(e){return e}}),u=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return n(r(e,t),2)}});return t(fc,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw Error("median(A, dim) is not yet supported")},"...":function(e){if(iP(e))throw TypeError("Scalar values expected in function median");return o(e)}})}),fp="polynomialRoot",ff=tP(fp,["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:a,multiply:o,divide:s,sqrt:u,unaryMinus:c,cbrt:l,typeOf:p,im:f,re:d}=e;return t(fp,{"number|Complex, ...number|Complex":(e,t)=>{for(var m=[e,...t];m.length>0&&r(m[m.length-1]);)m.pop();if(m.length<2)throw RangeError("Polynomial [".concat(e,", ").concat(t,"] must have a non-zero non-constant coefficient"));switch(m.length){case 2:return[c(s(m[0],m[1]))];case 3:var[h,g,y]=m,v=o(2,y),x=o(g,g),b=o(4,y,h);if(n(x,b))return[s(c(g),v)];var D=u(a(x,b));return[s(a(D,g),v),s(a(c(D),g),v)];case 4:var[N,w,A,E]=m,S=c(o(3,E)),C=o(A,A),M=o(3,E,w),F=i(o(2,A,A,A),o(27,E,E,N)),T=o(9,E,A,w);if(n(C,M)&&n(F,T))return[s(A,S)];var B=a(C,M),O=a(F,T);if(n(i(o(18,E,A,w,N),o(A,A,w,w)),i(o(4,A,A,A,N),o(4,E,w,w,w),o(27,E,E,N,N))))return[s(a(o(4,E,A,w),i(o(9,E,E,N),o(A,A,A))),o(E,B)),s(a(o(9,E,N),o(A,w)),o(2,B))];return l(n(C,M)?O:s(i(O,u(a(o(O,O),o(4,B,B,B)))),2),!0).toArray().map(e=>s(i(A,e,s(B,e)),S)).map(e=>"Complex"===p(e)&&n(d(e),d(e)+f(e))?d(e):e);default:throw RangeError("only implemented for cubic or lower-order polynomials, not ".concat(m))}}})}),fd="quantileSeq",fm=tP(fd,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:p,larger:f,mapSlices:d}=e;return t(fd,{"Array | Matrix, number | BigNumber":(e,t)=>h(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,r)=>m(e,t,!1,r,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(e,t,r,n)=>m(e,t,r,n,h),"Array | Matrix, Array | Matrix":(e,t)=>g(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,r)=>m(e,t,!1,r,g),"Array | Matrix, Array | Matrix, boolean":g,"Array | Matrix, Array | Matrix, boolean, number":(e,t,r,n)=>m(e,t,r,n,g)});function m(e,t,r,n,i){return d(e,n,e=>i(e,t,r))}function h(e,t,i){var o,s=e.valueOf();if(l(t,0))throw Error("N/prob must be non-negative");if(p(t,1))return y(t)?v(s,t,i):r(v(s,t,i));if(f(t,1)){if(!c(t))throw Error("N must be a positive integer");if(f(t,0xffffffff))throw Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var u=n(t,1);o=[];for(var d=0;l(d,t);d++){var m=a(d+1,u);o.push(v(s,m,i))}return y(t)?o:r(o)}}function g(e,t,r){for(var n=e.valueOf(),i=t.valueOf(),a=[],o=0;o<i.length;++o)a.push(v(n,i[o],r));return a}function v(e,t,r){var a,l,p=ip(e),f=p.length;if(0===f)throw Error("Cannot calculate quantile of an empty sequence");var d=y(t)?t*(f-1):t.times(f-1),m=y(t)?Math.floor(d):d.floor().toNumber(),h=y(t)?d%1:d.minus(m);if(c(d))return r?p[d]:s(p,y(t)?d:d.valueOf());if(r)a=p[m],l=p[m+1];else{l=s(p,m+1),a=p[m];for(var g=0;g<m;++g)u(p[g],a)>0&&(a=p[g])}return n(o(a,i(1,h)),o(l,h))}}),fh="range",fg=tP(fh,["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:c,isZero:l,isPositive:p}=e;return t(fh,{string:d,"string, boolean":d,number:function(e){throw TypeError("Too few arguments to function range(): ".concat(e))},boolean:function(e){throw TypeError("Unexpected type of argument 1 to function range(): ".concat(e,", number|bigint|BigNumber|Fraction"))},"number, number":function(e,t){return f(m(e,t,1,!1))},"number, number, number":function(e,t,r){return f(m(e,t,r,!1))},"number, number, boolean":function(e,t,r){return f(m(e,t,1,r))},"number, number, number, boolean":function(e,t,r,n){return f(m(e,t,r,n))},"bigint, bigint|number":function(e,t){return f(m(e,t,1n,!1))},"number, bigint":function(e,t){return f(m(BigInt(e),t,1n,!1))},"bigint, bigint|number, bigint|number":function(e,t,r){return f(m(e,t,BigInt(r),!1))},"number, bigint, bigint|number":function(e,t,r){return f(m(BigInt(e),t,BigInt(r),!1))},"bigint, bigint|number, boolean":function(e,t,r){return f(m(e,t,1n,r))},"number, bigint, boolean":function(e,t,r){return f(m(BigInt(e),t,1n,r))},"bigint, bigint|number, bigint|number, boolean":function(e,t,r,n){return f(m(e,t,BigInt(r),n))},"number, bigint, bigint|number, boolean":function(e,t,r,n){return f(m(BigInt(e),t,BigInt(r),n))},"BigNumber, BigNumber":function(e,t){var r=e.constructor;return f(m(e,t,new r(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return f(m(e,t,r,!1))},"BigNumber, BigNumber, boolean":function(e,t,r){var n=e.constructor;return f(m(e,t,new n(1),r))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return f(m(e,t,r,n))},"Fraction, Fraction":function(e,t){return f(m(e,t,1,!1))},"Fraction, Fraction, Fraction":function(e,t,r){return f(m(e,t,r,!1))},"Fraction, Fraction, boolean":function(e,t,r){return f(m(e,t,1,r))},"Fraction, Fraction, Fraction, boolean":function(e,t,r,n){return f(m(e,t,r,n))},"Unit, Unit, Unit":function(e,t,r){return f(m(e,t,r,!1))},"Unit, Unit, Unit, boolean":function(e,t,r,n){return f(m(e,t,r,n))}});function f(e){return"Matrix"===r.matrix?n?n(e):function(){throw Error('No "matrix" implementation available')}():e}function d(e,t){var n=function(e){var t=e.split(":").map(function(e){return Number(e)});if(t.some(function(e){return isNaN(e)}))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(e);if(!n)throw SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===i&&u3(),f(m(i(n.start),i(n.end),i(n.step)),t)):f(m(n.start,n.end,n.step,t))}function m(e,t,r,n){var i=[];if(l(r))throw Error("Step must be non-zero");for(var f=p(r)?n?o:a:n?u:s,d=e;f(d,t);)i.push(d),d=c(d,r);return i}}),fy=tP("row",["typed","Index","matrix","range"],e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(n(eu(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw Error("Only two dimensional matrix is supported");ir(t,e.size()[0]);var a=new r([t],i(0,e.size()[1])),o=e.subset(a);return E(o)?o:n([[o]])}}),fv="setDifference",fx=tP(fv,["typed","size","subset","compareNatural","Index","DenseMatrix"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(fv,{"Array | Matrix, Array | Matrix":function(e,t){var s;if(0===n(r(e),new a(0)))s=[];else{if(0===n(r(t),new a(0)))return ip(e.toArray());var u,c=iv(ip(Array.isArray(e)?e:e.toArray()).sort(i)),l=iv(ip(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var p=0;p<c.length;p++){u=!1;for(var f=0;f<l.length;f++)if(0===i(c[p].value,l[f].value)&&c[p].identifier===l[f].identifier){u=!0;break}u||s.push(c[p])}}return Array.isArray(e)&&Array.isArray(t)?ix(s):new o(ix(s))}})}),fb="setMultiplicity",fD=tP(fb,["typed","size","subset","compareNatural","Index"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(fb,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===n(r(t),new a(0)))return 0;for(var o=ip(Array.isArray(t)?t:t.toArray()),s=0,u=0;u<o.length;u++)0===i(o[u],e)&&s++;return s}})}),fN="setSymDifference",fw=tP(fN,["typed","size","concat","subset","setDifference","Index"],e=>{var{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(fN,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new o(0)))return ip(t);if(0===i(r(t),new o(0)))return ip(e);var s=ip(e),u=ip(t);return n(a(s,u),a(u,s))}})});function fA(e){return(fA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fE(e,t,r){var n;return(n=function(e,t){if("object"!=fA(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=fA(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==fA(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var fC=tP("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,max:o,map:s,abs:u,isPositive:c,isNegative:l,larger:p,smaller:f,matrix:d,bignumber:m,unaryMinus:h}=e;function g(e){return function(t,d,g,y){if(!(2===d.length&&(d.every(w)||d.every(N))))throw Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var x,b=d[0],D=d[1],A=p(D,b),E=y.firstStep;if(void 0!==E&&!c(E))throw Error('"firstStep" must be positive');var S=y.maxStep;if(void 0!==S&&!c(S))throw Error('"maxStep" must be positive');var C=y.minStep;if(C&&l(C))throw Error('"minStep" must be positive or zero');var M=[b,D,E,C,S].filter(e=>void 0!==e);if(!(M.every(w)||M.every(N)))throw Error('Inconsistent type of "t" dependant variables');for(var F=y.tol?y.tol:1e-4,T=y.minDelta?y.minDelta:.2,B=y.maxDelta?y.maxDelta:5,O=y.maxIter?y.maxIter:1e4,_=[b,D,...g,S,C].some(v),[z,q,I,k]=_?[m(e.a),m(e.c),m(e.b),m(e.bp)]:[e.a,e.c,e.b,e.bp],R=E?A?E:h(E):a(n(D,b),1),P=[b],U=[g],j=n(I,k),L=0,H=0,$=A?f:p,G=(x=A?p:f,function(e,t,i){return x(r(e,i),t)?n(t,e):i});$(P[L],D);){var Z=[];R=G(P[L],D,R),Z.push(t(P[L],U[L]));for(var V=1;V<q.length;++V)Z.push(t(r(P[L],i(q[V],R)),r(U[L],i(R,z[V],Z))));var W=o(u(s(i(j,Z),e=>N(e)?e.value:e)));W<F&&F/W>1/4&&(P.push(r(P[L],R)),U.push(r(U[L],i(R,I,Z))),L++);var J=.84*(F/W)**.2;if(f(J,T)?J=T:p(J,B)&&(J=B),R=i(R,J=_?m(J):J),S&&p(u(R),S)?R=A?S:h(S):C&&f(u(R),C)&&(R=A?C:h(C)),++H>O)throw Error("Maximum number of iterations reached, try changing options")}return{t:P,y:U}}}function x(e,t,r,n){return g({a:[[],[.5],[0,3/4],[2/9,1/3,4/9]],c:[null,.5,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,t,r,n)}function b(e,t,r,n){return g({a:[[],[.2],[3/40,9/40],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40]})(e,t,r,n)}function D(e,t,r,n){var i=n.method?n.method:"RK45",a={RK23:x,RK45:b};if(i.toUpperCase()in a){var o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fS(Object(r),!0).forEach(function(t){fE(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fS(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},n);return delete o.method,a[i.toUpperCase()](e,t,r,o)}var s=Object.keys(a).map(e=>'"'.concat(e,'"')),u="".concat(s.slice(0,-1).join(", ")," and ").concat(s.slice(-1));throw Error('Unavailable method "'.concat(i,'". Available methods are ').concat(u))}function w(e){return v(e)||y(e)}function A(e,t,r,n){var i=D(e,t.toArray(),r.toArray(),n);return{t:d(i.t),y:d(i.y)}}return t("solveODE",{"function, Array, Array, Object":D,"function, Matrix, Matrix, Object":A,"function, Array, Array":(e,t,r)=>D(e,t,r,{}),"function, Matrix, Matrix":(e,t,r)=>A(e,t,r,{}),"function, Array, number | BigNumber | Unit":(e,t,r)=>{var n=D(e,t,[r],{});return{t:n.t,y:n.y.map(e=>e[0])}},"function, Matrix, number | BigNumber | Unit":(e,t,r)=>{var n=D(e,t.toArray(),[r],{});return{t:d(n.t),y:d(n.y.map(e=>e[0]))}},"function, Array, number | BigNumber | Unit, Object":(e,t,r,n)=>{var i=D(e,t,[r],n);return{t:i.t,y:i.y.map(e=>e[0])}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,r,n)=>{var i=D(e,t.toArray(),[r],n);return{t:d(i.t),y:d(i.y.map(e=>e[0]))}}})});function fM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fM(Object(r),!0).forEach(function(t){fE(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fM(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var fT=tP("Unit",["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],e=>{var t,r,n,{on:a,config:o,addScalar:s,subtractScalar:u,multiplyScalar:c,divideScalar:l,pow:p,abs:f,fix:d,round:m,equal:h,isNumeric:g,format:y,number:v,Complex:x,BigNumber:D,Fraction:w}=e;function A(e,t){if(!(this instanceof A))throw Error("Constructor must be called with the new operator");if(!(null==e||g(e)||b(e)))throw TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=I.map(e=>0);else if("string"==typeof t){var r=A.parse(t);this.units=r.units,this.dimensions=r.dimensions}else if(N(t)&&null===t.value)this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map(e=>i({},e));else throw TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(e)}function E(){for(;" "===n||" "===n;)C()}function S(e){return e>="0"&&e<="9"}function C(){r++,n=t.charAt(r)}function M(e){r=e,n=t.charAt(r)}function F(){var e,t="",i=r;if("+"===n?C():"-"===n&&(t+=n,C()),!((e=n)>="0"&&e<="9"||"."===e))return M(i),null;if("."===n){if(t+=n,C(),!S(n))return M(i),null}else{for(;S(n);)t+=n,C();"."===n&&(t+=n,C())}for(;S(n);)t+=n,C();if("E"===n||"e"===n){var a="",o=r;if(a+=n,C(),("+"===n||"-"===n)&&(a+=n,C()),!S(n))return M(o),t;for(t+=a;S(n);)t+=n,C()}return t}function T(e){return n===e?(C(),e):null}Object.defineProperty(A,"name",{value:"Unit"}),A.prototype.constructor=A,A.prototype.type="Unit",A.prototype.isUnit=!0,A.parse=function(e,i){if(i=i||{},r=-1,n="","string"!=typeof(t=e))throw TypeError("Invalid argument in Unit.parse, string expected");var a=new A;a.units=[];var s=1,u=!1;C(),E();var c=F(),l=null;if(c){if("BigNumber"===o.number)l=new D(c);else if("Fraction"===o.number)try{l=new w(c)}catch(e){l=parseFloat(c)}else l=parseFloat(c);E(),T("*")?(s=1,u=!0):T("/")&&(s=-1,u=!0)}for(var p=[],f=1;;){for(E();"("===n;)p.push(s),f*=s,s=1,C(),E();var d=void 0;if(n){var m=n;if(null===(d=function(){for(var e="";S(n)||A.isValidAlpha(n);)e+=n,C();var t=e.charAt(0);return A.isValidAlpha(t)?e:null}()))throw SyntaxError('Unexpected "'+m+'" in "'+t+'" at index '+r.toString())}else break;var h=B(d);if(null===h)throw SyntaxError('Unit "'+d+'" not found.');var g=s*f;if(E(),T("^")){E();var y=F();if(null===y)throw SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');g*=y}a.units.push({unit:h.unit,prefix:h.prefix,power:g});for(var v=0;v<I.length;v++)a.dimensions[v]+=(h.unit.dimensions[v]||0)*g;for(E();")"===n;){if(0===p.length)throw SyntaxError('Unmatched ")" in "'+t+'" at index '+r.toString());f/=p.pop(),C(),E()}if(u=!1,T("*")?(s=1,u=!0):T("/")?(s=-1,u=!0):s=1,h.unit.base){var x=h.unit.base.key;H.auto[x]={unit:h.unit,prefix:h.prefix}}}if(E(),n)throw SyntaxError('Could not parse: "'+e+'"');if(u)throw SyntaxError('Trailing characters: "'+e+'"');if(0!==p.length)throw SyntaxError('Unmatched "(" in "'+t+'"');if(0===a.units.length&&!i.allowNoUnits)throw SyntaxError('"'+e+'" contains no units');return a.value=void 0!==l?a._normalize(l):null,a},A.prototype.clone=function(){var e=new A;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=eu(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])ef(this.units[t],r)&&(e.units[t][r]=this.units[t][r]);return e},A.prototype.valueType=function(){return es(this.value)},A.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},A.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,r=A._getNumberConverter(es(e)),n=0;n<this.units.length;n++){var i=r(this.units[n].unit.value),a=r(this.units[n].prefix.value),o=r(this.units[n].power);t=c(t,p(c(i,a),o))}return t},A.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var r=e,n=A._getNumberConverter(es(e)),i=0;i<this.units.length;i++){var a=n(this.units[i].unit.value),o=n(this.units[i].prefix.value),s=n(this.units[i].power);r=l(r,p(c(a,o),s))}return r};var B=rd(e=>{if(ef(U,e)){var t=U[e],r=t.prefixes[""];return{unit:t,prefix:r}}for(var n in U)if(ef(U,n)&&function(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}(e,n)){var i=U[n],a=e.length-n.length,o=e.substring(0,a),s=ef(i.prefixes,o)?i.prefixes[o]:void 0;if(void 0!==s)return{unit:i,prefix:s}}return null},{hasher:e=>e[0],limit:100});function O(e){return e.equalBase(k.NONE)&&null!==e.value&&!o.predictable?e.value:e}function _(e){return A._getNumberConverter(es(e))(1)}function z(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.skipAutomaticSimplification||null===e.value?e.clone():e.simplify();(function(e){var t=!1;for(var r in void 0!==e.value&&null!==e.value&&b(e.value)&&(t=1e-14>Math.abs(e.value.re)),e.units)ef(e.units,r)&&e.units[r].unit&&("VA"===e.units[r].unit.name&&t?e.units[r].unit=U.VAR:"VAR"!==e.units[r].unit.name||t||(e.units[r].unit=U.VA))})(i),t=i,r=n.offset,1===t.units.length&&!t.fixPrefix&&1e-14>Math.abs(t.units[0].power-Math.round(t.units[0].power))&&(t.units[0].prefix=t._bestPrefix(r));var a=i._denormalize(i.value),o=null!==i.value?y(a,n||{}):"",s=i.formatUnits();return{simp:i,valueStr:o,unitStr:s}}A.isValuelessUnit=function(e){return null!==B(e)},A.prototype.hasBase=function(e){if("string"==typeof e&&(e=k[e]),!e)return!1;for(var t=0;t<I.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},A.prototype.equalBase=function(e){for(var t=0;t<I.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},A.prototype.equals=function(e){return this.equalBase(e)&&h(this.value,e.value)},A.prototype.multiply=function(e){for(var t=this.clone(),r=N(e)?e:new A(e),n=0;n<I.length;n++)t.dimensions[n]=(this.dimensions[n]||0)+(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=fF({},r.units[i]);t.units.push(a)}return null!==this.value||null!==r.value?t.value=c(null===this.value?this._normalize(_(r.value)):this.value,null===r.value?r._normalize(_(this.value)):r.value):t.value=null,N(e)&&(t.skipAutomaticSimplification=!1),O(t)},A.prototype.divideInto=function(e){return new A(e).divide(this)},A.prototype.divide=function(e){for(var t=this.clone(),r=N(e)?e:new A(e),n=0;n<I.length;n++)t.dimensions[n]=(this.dimensions[n]||0)-(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=fF(fF({},r.units[i]),{},{power:-r.units[i].power});t.units.push(a)}return null!==this.value||null!==r.value?t.value=l(null===this.value?this._normalize(_(r.value)):this.value,null===r.value?r._normalize(_(this.value)):r.value):t.value=null,N(e)&&(t.skipAutomaticSimplification=!1),O(t)},A.prototype.pow=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=p(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,O(t)},A.prototype.abs=function(){var e=this.clone();if(null!==e.value)if(e._isDerived()||0===e.units.length||0===e.units[0].unit.offset)e.value=f(e.value);else{var t=e._numberConverter(),r=c(t(e.units[0].unit.value),t(e.units[0].unit.offset));e.value=u(f(s(e.value,r)),r)}for(var n in e.units)("VA"===e.units[n].unit.name||"VAR"===e.units[n].unit.name)&&(e.units[n].unit=U.W);return e},A.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=A.parse(e);else if(N(e))t=e.clone();else throw Error("String or Unit expected as parameter");if(!this.equalBase(t))throw Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw Error("Cannot convert to a unit with a value");if(null===this.value||this._isDerived()||0===this.units.length||0===t.units.length||this.units[0].unit.offset===t.units[0].unit.offset)t.value=eu(r);else{var n=A._getNumberConverter(es(r)),i=c(this.units[0].unit.value,this.units[0].unit.offset),a=c(t.units[0].unit.value,t.units[0].unit.offset);t.value=s(r,n(u(i,a)))}return t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},A.prototype.toNumber=function(e){return v(this.toNumeric(e))},A.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()||0===t.units.length?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},A.prototype.toString=function(){return this.format()},A.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix,skipSimp:this.skipAutomaticSimplification}},A.fromJSON=function(e){var t,r,n,i=new A(e.value,null!=(t=e.unit)?t:void 0);return i.fixPrefix=null!=(r=e.fixPrefix)&&r,i.skipAutomaticSimplification=null==(n=e.skipSimp)||n,i},A.prototype.valueOf=A.prototype.toString,A.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var i in $)if(ef($,i)&&r.hasBase(k[i])){e=i;break}if("NONE"===e)r.units=[];else if(e&&ef($,e)&&(t=$[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,o=0;o<I.length;o++){var s=I[o];Math.abs(r.dimensions[o]||0)>1e-12&&(ef($,s)?n.push({unit:$[s].unit,prefix:$[s].prefix,power:r.dimensions[o]||0}):a=!0)}n.length<r.units.length&&!a&&(r.units=n)}return r},A.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<I.length;r++){var n=I[r];if(Math.abs(e.dimensions[r]||0)>1e-12)if(ef(H.si,n))t.push({unit:H.si[n].unit,prefix:H.si[n].prefix,power:e.dimensions[r]||0});else throw Error("Cannot express custom unit "+n+" in SI units")}return(e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value)?(e.value=null,this.to(e)):e},A.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)this.units[i].power>0?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(n>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(r>0?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+="^"+-this.units[a].power)):(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,t+="^"+this.units[a].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");var o=e;return r>0&&n>0&&(o+=" / "),o+=t},A.prototype.toBest=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&!Array.isArray(e))throw Error("Invalid unit type. Expected string or Unit.");var r=this.units[0].unit.prefixes;if(e&&e.length>0){var n=e.map(e=>{var t=null;if("string"==typeof e){if(!(t=A.parse(e)))throw Error("Invalid unit type. Expected compatible string or Unit.")}else if(!N(e))throw Error("Invalid unit type. Expected compatible string or Unit.");null===t&&(t=e.clone());try{return this.to(t.formatUnits()),t}catch(e){throw Error("Invalid unit type. Expected compatible string or Unit.")}}).map(e=>e.units[0].prefix);this.units[0].unit.prefixes=n.reduce((e,t)=>(e[t.name]=t,e),{}),this.units[0].prefix=n[0]}var i=z(this,t).simp;return this.units[0].unit.prefixes=r,i.fixPrefix=!0,i},A.prototype.format=function(e){var{simp:t,valueStr:r,unitStr:n}=z(this,e),i=r;return t.value&&b(t.value)&&(i="("+i+")"),n.length>0&&i.length>0&&(i+=" "),i+=n},A.prototype._bestPrefix=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.2;if(1!==this.units.length||Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var t=null!==this.value?f(this.value):0,r=f(this.units[0].unit.value),n=this.units[0].prefix;if(0===t)return n;var i=this.units[0].power,a=Math.log(t/Math.pow(n.value*r,i))/Math.LN10-e;if(a>-2.200001&&a<1.800001)return n;a=Math.abs(a);var o=this.units[0].unit.prefixes;for(var s in o)if(ef(o,s)){var u=o[s];if(u.scientific){var c=Math.abs(Math.log(t/Math.pow(u.value*r,i))/Math.LN10-e);(c<a||c===a&&u.name.length<n.name.length)&&(n=u,a=c)}}return n},A.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),a=m(i),o=new A(h(a,i)?a:d(t.toNumeric()),e[n].toString());r.push(o),t=u(t,o)}for(var c=0,l=0;l<r.length;l++)c=s(c,r[l].value);return h(c,this.value)&&(t.value=0),r.push(t),r};var q={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:1048576,scientific:!0},Gi:{name:"Gi",value:0x40000000,scientific:!0},Ti:{name:"Ti",value:0x10000000000,scientific:!0},Pi:{name:"Pi",value:0x4000000000000,scientific:!0},Ei:{name:"Ei",value:0x1000000000000000,scientific:!0},Zi:{name:"Zi",value:11805916207174113e5,scientific:!0},Yi:{name:"Yi",value:12089258196146292e8,scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:1048576,scientific:!0},gibi:{name:"gibi",value:0x40000000,scientific:!0},tebi:{name:"tebi",value:0x10000000000,scientific:!0},pebi:{name:"pebi",value:0x4000000000000,scientific:!0},exi:{name:"exi",value:0x1000000000000000,scientific:!0},zebi:{name:"zebi",value:11805916207174113e5,scientific:!0},yobi:{name:"yobi",value:12089258196146292e8,scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};q.SHORTLONG=i({},q.SHORT,q.LONG),q.BINARY_SHORT=i({},q.BINARY_SHORT_SI,q.BINARY_SHORT_IEC),q.BINARY_LONG=i({},q.BINARY_LONG_SI,q.BINARY_LONG_IEC);var I=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var R in k)ef(k,R)&&(k[R].key=R);var P={name:"",base:{},value:1,offset:0,dimensions:I.map(e=>0)},U={meter:{name:"meter",base:k.LENGTH,prefixes:q.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:q.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:q.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:q.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:q.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:q.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:q.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:q.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:q.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:q.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:q.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:q.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:q.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:q.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:q.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:q.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:q.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:q.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:q.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:q.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:q.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:q.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:q.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:q.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:q.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:q.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:q.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:q.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:q.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:q.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:q.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:q.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:q.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:q.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:q.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:q.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:q.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:q.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:q.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:q.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:q.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:q.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:q.NONE,value:11829411825e-14,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:q.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:q.NONE,value:2365882365e-13,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:q.NONE,value:473176473e-12,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:q.NONE,value:946352946e-12,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:q.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:q.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:q.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:q.NONE,value:.238480942392,offset:0},g:{name:"g",base:k.MASS,prefixes:q.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:q.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:q.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:q.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:q.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:q.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:q.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:q.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:q.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:q.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:q.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:q.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:q.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:q.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:q.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:q.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:q.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:q.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:q.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:q.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:q.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:q.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:q.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:q.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:q.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:q.NONE,value:604800,offset:0},month:{name:"month",base:k.TIME,prefixes:q.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:q.NONE,value:0x1e187e0,offset:0},decade:{name:"decade",base:k.TIME,prefixes:q.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:q.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:q.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:q.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:q.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:q.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:q.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:q.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:q.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:q.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:q.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:q.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:q.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:q.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:q.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:q.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:q.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:q.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:q.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:q.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:q.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:q.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:q.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:q.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:q.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:q.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:q.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:q.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:q.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:q.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:q.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:q.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:q.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:q.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:q.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:q.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:q.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:q.LONG,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:q.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:q.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:q.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:q.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:q.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:q.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:q.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:q.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:q.SHORT,value:x.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:q.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:q.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:q.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:q.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:q.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:q.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:q.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:q.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:q.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:q.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:q.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:q.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:q.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:q.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:q.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:q.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:q.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:q.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:q.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:q.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:q.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:q.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:q.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:q.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:q.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:q.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:q.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:q.BINARY_LONG,value:8,offset:0}},j={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function L(e){if("BigNumber"===e.number){var t=rg(D);U.rad.value=new D(1),U.deg.value=t.div(180),U.grad.value=t.div(200),U.cycle.value=t.times(2),U.arcsec.value=t.div(648e3),U.arcmin.value=t.div(10800)}else U.rad.value=1,U.deg.value=Math.PI/180,U.grad.value=Math.PI/200,U.cycle.value=2*Math.PI,U.arcsec.value=Math.PI/648e3,U.arcmin.value=Math.PI/10800;U.radian.value=U.rad.value,U.degree.value=U.deg.value,U.gradian.value=U.grad.value}L(o),a&&a("config",function(e,t){e.number!==t.number&&L(e)});var H={si:{NONE:{unit:P,prefix:q.NONE[""]},LENGTH:{unit:U.m,prefix:q.SHORT[""]},MASS:{unit:U.g,prefix:q.SHORT.k},TIME:{unit:U.s,prefix:q.SHORT[""]},CURRENT:{unit:U.A,prefix:q.SHORT[""]},TEMPERATURE:{unit:U.K,prefix:q.SHORT[""]},LUMINOUS_INTENSITY:{unit:U.cd,prefix:q.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:U.mol,prefix:q.SHORT[""]},ANGLE:{unit:U.rad,prefix:q.SHORT[""]},BIT:{unit:U.bits,prefix:q.SHORT[""]},FORCE:{unit:U.N,prefix:q.SHORT[""]},ENERGY:{unit:U.J,prefix:q.SHORT[""]},POWER:{unit:U.W,prefix:q.SHORT[""]},PRESSURE:{unit:U.Pa,prefix:q.SHORT[""]},ELECTRIC_CHARGE:{unit:U.C,prefix:q.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:U.F,prefix:q.SHORT[""]},ELECTRIC_POTENTIAL:{unit:U.V,prefix:q.SHORT[""]},ELECTRIC_RESISTANCE:{unit:U.ohm,prefix:q.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:U.H,prefix:q.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:U.S,prefix:q.SHORT[""]},MAGNETIC_FLUX:{unit:U.Wb,prefix:q.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:U.T,prefix:q.SHORT[""]},FREQUENCY:{unit:U.Hz,prefix:q.SHORT[""]}}};H.cgs=JSON.parse(JSON.stringify(H.si)),H.cgs.LENGTH={unit:U.m,prefix:q.SHORT.c},H.cgs.MASS={unit:U.g,prefix:q.SHORT[""]},H.cgs.FORCE={unit:U.dyn,prefix:q.SHORT[""]},H.cgs.ENERGY={unit:U.erg,prefix:q.NONE[""]},H.us=JSON.parse(JSON.stringify(H.si)),H.us.LENGTH={unit:U.ft,prefix:q.NONE[""]},H.us.MASS={unit:U.lbm,prefix:q.NONE[""]},H.us.TEMPERATURE={unit:U.degF,prefix:q.NONE[""]},H.us.FORCE={unit:U.lbf,prefix:q.NONE[""]},H.us.ENERGY={unit:U.BTU,prefix:q.BTU[""]},H.us.POWER={unit:U.hp,prefix:q.NONE[""]},H.us.PRESSURE={unit:U.psi,prefix:q.NONE[""]},H.auto=JSON.parse(JSON.stringify(H.si));var $=H.auto;for(var G in A.setUnitSystem=function(e){if(ef(H,e))$=H[e];else throw Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(H).join(", "))},A.getUnitSystem=function(){for(var e in H)if(ef(H,e)&&H[e]===$)return e},A.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new D(String(e.n)).div(String(e.d)).times(String(e.s)):new D(e+"")},Fraction:function(e){return new w(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?v(e):e}},A.prototype._numberConverter=function(){var e=A.typeConverters[this.valueType()];if(e)return e;throw TypeError('Unsupported Unit value type "'+this.valueType()+'"')},A._getNumberConverter=function(e){if(!A.typeConverters[e])throw TypeError('Unsupported type "'+e+'"');return A.typeConverters[e]},U)if(ef(U,G)){var Z=U[G];Z.dimensions=Z.base.dimensions}for(var V in j)if(ef(j,V)){var W=U[j[V]],J={};for(var Q in W)ef(W,Q)&&(J[Q]=W[Q]);J.name=V,U[V]=J}return A.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},A.createUnit=function(e,t){if("object"!=typeof e)throw TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override){for(var r in e)if(ef(e,r)&&A.deleteUnit(r),e[r].aliases)for(var n,i=0;i<e[r].aliases.length;i++)A.deleteUnit(e[r].aliases[i])}for(var a in e)ef(e,a)&&(n=A.createUnitSingle(a,e[a]));return n},A.createUnitSingle=function(e,t){if(null==t&&(t={}),"string"!=typeof e)throw TypeError("createUnitSingle expects first parameter to be of type 'string'");if(ef(U,e))throw Error('Cannot create unit "'+e+'": a unit with that name already exists');for(var r=0;r<e.length;r++){if(n=e.charAt(r),0===r&&!A.isValidAlpha(n))throw Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(r>0&&!(A.isValidAlpha(n)||S(n)))throw Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}var i,a,o,s=null,u=[],c=0;if(t&&"Unit"===t.type)s=t.clone();else if("string"==typeof t)""!==t&&(i=t);else if("object"==typeof t)i=t.definition,a=t.prefixes,c=t.offset,o=t.baseName,t.aliases&&(u=t.aliases.valueOf());else throw TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');if(u){for(var l=0;l<u.length;l++)if(ef(U,u[l]))throw Error('Cannot create alias "'+u[l]+'": a unit with that name already exists')}if(i&&"string"==typeof i&&!s)try{s=A.parse(i,{allowNoUnits:!0})}catch(t){throw t.message='Could not create unit "'+e+'" from "'+i+'": '+t.message,t}else i&&"Unit"===i.type&&(s=i.clone());u=u||[],c=c||0,a=a&&a.toUpperCase&&q[a.toUpperCase()]||q.NONE;var p={};if(s){p={name:e,value:s.value,dimensions:s.dimensions.slice(0),prefixes:a,offset:c};var f=!1;for(var d in k)if(ef(k,d)){for(var m=!0,h=0;h<I.length;h++)if(Math.abs((p.dimensions[h]||0)-(k[d].dimensions[h]||0))>1e-12){m=!1;break}if(m){f=!0,p.base=k[d];break}}if(!f){o=o||e+"_STUFF";var g={dimensions:s.dimensions.slice(0)};g.key=o,k[o]=g,$[o]={unit:p,prefix:q.NONE[""]},p.base=k[o]}}else{if(o=o||e+"_STUFF",I.indexOf(o)>=0)throw Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var y in I.push(o),k)ef(k,y)&&(k[y].dimensions[I.length-1]=0);for(var v={dimensions:[]},x=0;x<I.length;x++)v.dimensions[x]=0;v.dimensions[I.length-1]=1,v.key=o,k[o]=v,p={name:e,value:1,dimensions:k[o].dimensions.slice(0),prefixes:a,offset:c,base:k[o]},$[o]={unit:p,prefix:q.NONE[""]}}A.UNITS[e]=p;for(var b=0;b<u.length;b++){var D=u[b],N={};for(var w in p)ef(p,w)&&(N[w]=p[w]);N.name=D,A.UNITS[D]=N}return delete B.cache,new A(null,e)},A.deleteUnit=function(e){delete A.UNITS[e],delete B.cache},A.PREFIXES=q,A.BASE_DIMENSIONS=I,A.BASE_UNITS=k,A.UNIT_SYSTEMS=H,A.UNITS=U,A},{isClass:!0}),fB="column",fO=tP(fB,["typed","Index","matrix","range"],e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(fB,{"Matrix, number":a,"Array, number":function(e,t){return a(n(eu(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw Error("Only two dimensional matrix is supported");ir(t,e.size()[1]);var a=new r(i(0,e.size()[0]),[t]),o=e.subset(a);return E(o)?o:n([[o]])}}),f_="createUnit",fz=tP(f_,["typed","Unit"],e=>{var{typed:t,Unit:r}=e;return t(f_,{"Object, Object":function(e,t){return r.createUnit(e,t)},Object:function(e){return r.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,n){var i={};return i[e]=t,r.createUnit(i,n)},"string, Unit | string | Object":function(e,t){var n={};return n[e]=t,r.createUnit(n,{})},string:function(e){var t={};return t[e]={},r.createUnit(t,{})}})}),fq=tP("eigs",["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],e=>{var{config:t,typed:r,matrix:n,addScalar:a,subtract:o,equal:s,abs:u,atan:c,cos:l,sin:p,multiplyScalar:f,divideScalar:d,inv:m,bignumber:h,multiply:g,add:x,larger:N,column:w,flatten:A,number:E,complex:S,sqrt:C,diag:M,size:F,reshape:T,qr:B,usolve:O,usolveAll:_,im:z,re:q,smaller:I,matrixFromColumns:k,dot:R}=e,P=function(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:a,cos:o,sin:s,multiplyScalar:u,inv:c,bignumber:l,multiply:p,add:f}=e;function d(e){for(var t=e.length,r=0,n=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)Math.abs(r)<Math.abs(e[i][a])&&(r=Math.abs(e[i][a]),n=[i,a]);return[n,r]}function m(e){for(var t=e.length,r=0,n=[0,1],a=0;a<t;a++)for(var o=a+1;o<t;o++)i(r)<i(e[a][o])&&(r=i(e[a][o]),n=[a,o]);return[n,r]}function h(e,t,r){var n,a=e.length,o=Array(a);if(r){n=Array(a);for(var s=0;s<a;s++)n[s]=Array(a)}for(var u=0;u<a;u++){for(var c=0,l=e[0],p=0;p<e.length;p++)i(e[p])<i(l)&&(l=e[c=p]);if(o[u]=e.splice(c,1)[0],r)for(var f=0;f<a;f++)n[u][f]=t[f][c],t[f].splice(c,1)}if(!r)return{values:o};var d=n.map((e,t)=>({value:o[t],vector:e}));return{values:o,eigenvectors:d}}return function(e,g){var y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.relTol,v=arguments.length>3?arguments[3]:void 0,x=arguments.length>4?arguments[4]:void 0;if("number"===v)return function(e,r,n){var i,a,o=e.length,s=Math.abs(r/o);if(n){a=Array(o);for(var u=0;u<o;u++)a[u]=Array(o).fill(0),a[u][u]=1}for(var c=d(e);Math.abs(c[1])>=Math.abs(s);){var l,p,f,m=c[0][0],g=c[0][1];l=e[m][m],p=e[g][g],f=e[m][g],e=function(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=a*a,u=o*o,c=Array(i).fill(0),l=Array(i).fill(0),p=s*e[r][r]-2*a*o*e[r][n]+u*e[n][n],f=u*e[r][r]+2*a*o*e[r][n]+s*e[n][n],d=0;d<i;d++)c[d]=a*e[r][d]-o*e[n][d],l[d]=o*e[r][d]+a*e[n][d];e[r][r]=p,e[n][n]=f,e[r][n]=0,e[n][r]=0;for(var m=0;m<i;m++)m!==r&&m!==n&&(e[r][m]=c[m],e[m][r]=c[m],e[n][m]=l[m],e[m][n]=l[m]);return e}(e,i=Math.abs(p-l)<=t.relTol?Math.PI/4:.5*Math.atan(2*f/(p-l)),m,g),n&&(a=function(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=Array(i).fill(0),u=Array(i).fill(0),c=0;c<i;c++)s[c]=a*e[c][r]-o*e[c][n],u[c]=o*e[c][r]+a*e[c][n];for(var l=0;l<i;l++)e[l][r]=s[l],e[l][n]=u[l];return e}(a,i,m,g)),c=d(e)}for(var y=Array(o).fill(0),v=0;v<o;v++)y[v]=e[v][v];return h(eu(y),a,n)}(e,y,x);if("BigNumber"===v)return function(e,d,g){var y,v,x=e.length,b=i(d/x);if(g){v=Array(x);for(var D=0;D<x;D++)v[D]=Array(x).fill(0),v[D][D]=1}for(var N=m(e);i(N[1])>=i(b);){var w=N[0][0],A=N[0][1];y=function(e,r,o){var s=n(r,e);return i(s)<=t.relTol?l(-1).acos().div(4):u(.5,a(p(2,o,c(s))))}(e[w][w],e[A][A],e[w][A]),e=function(e,t,i,a){for(var c=e.length,d=l(o(t)),m=l(s(t)),h=u(d,d),g=u(m,m),y=Array(c).fill(l(0)),v=Array(c).fill(l(0)),x=p(l(2),d,m,e[i][a]),b=r(n(u(h,e[i][i]),x),u(g,e[a][a])),D=f(u(g,e[i][i]),x,u(h,e[a][a])),N=0;N<c;N++)y[N]=n(u(d,e[i][N]),u(m,e[a][N])),v[N]=r(u(m,e[i][N]),u(d,e[a][N]));e[i][i]=b,e[a][a]=D,e[i][a]=l(0),e[a][i]=l(0);for(var w=0;w<c;w++)w!==i&&w!==a&&(e[i][w]=y[w],e[w][i]=y[w],e[a][w]=v[w],e[w][a]=v[w]);return e}(e,y,w,A),g&&(v=function(e,t,i,a){for(var c=e.length,p=o(t),f=s(t),d=Array(c).fill(l(0)),m=Array(c).fill(l(0)),h=0;h<c;h++)d[h]=n(u(p,e[h][i]),u(f,e[h][a])),m[h]=r(u(f,e[h][i]),u(p,e[h][a]));for(var g=0;g<c;g++)e[g][i]=d[g],e[g][a]=m[g];return e}(v,y,w,A)),N=m(e)}for(var E=Array(x).fill(0),S=0;S<x;S++)E[S]=e[S][S];return h(eu(E),v,g)}(e,y,x);throw TypeError("Unsupported data type: "+v)}}({config:t,addScalar:a,subtract:o,column:w,flatten:A,equal:s,abs:u,atan:c,cos:l,sin:p,multiplyScalar:f,inv:m,bignumber:h,complex:S,multiply:g,add:x}),U=function(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:s,abs:u,bignumber:c,diag:l,size:p,reshape:f,inv:d,qr:m,usolve:h,usolveAll:g,equal:y,complex:v,larger:x,smaller:b,matrixFromColumns:D,dot:N}=e;function w(e,t){for(var r=0;r<e.length;r++)e[r].push(...Array(t-e[r].length).fill(0));for(var n=e.length;n<t;n++)e.push(Array(t).fill(0)),e[n][n]=1;return e}function A(e,t){var n=p(e);for(var a of t)e=r(e,i(o(N(a=f(a,n),e),N(a,a)),a));return e}function E(e){return u(s(N(e,e)))}function S(e,t){return i(o("BigNumber"===t?c(1):"Complex"===t?v(1):1,E(e)),e)}return function(e,p,f,D){var N=!(arguments.length>4)||void 0===arguments[4]||arguments[4],C=function(e,r,n,i){var s,p="BigNumber"===n,f=p?c(0):0,d=p?c(1):"Complex"===n?v(1):1,m=p?c(1):1,h=p?c(10):2,g=a(h,h);i&&(s=Array(r).fill(d));for(var D=!1;!D;){D=!0;for(var N=0;N<r;N++){for(var w=f,A=f,E=0;E<r;E++)N!==E&&(w=t(w,u(e[E][N])),A=t(A,u(e[N][E])));if(!y(w,0)&&!y(A,0)){for(var S=m,C=w,M=o(A,h),F=a(A,h);b(C,M);)C=a(C,g),S=a(S,h);for(;x(C,F);)C=o(C,g),S=o(S,h);if(b(o(t(C,A),S),a(t(w,A),.95))){D=!1;for(var T=o(1,S),B=0;B<r;B++)N!==B&&(e[N][B]=a(e[N][B],T),e[B][N]=a(e[B][N],S));i&&(s[N]=a(s[N],T))}}}}return i?l(s):null}(e,p,D,N);!function(e,n,i,s,l,p){var f="BigNumber"===s,d=f?c(0):"Complex"===s?v(0):0;f&&(i=c(i));for(var m=0;m<n-2;m++){for(var h=0,g=d,y=m+1;y<n;y++){var x=e[y][m];b(u(g),u(x))&&(g=x,h=y)}if(!b(u(g),i)){if(h!==m+1){var D=e[h];e[h]=e[m+1],e[m+1]=D;for(var N=0;N<n;N++){var w=e[N][h];e[N][h]=e[N][m+1],e[N][m+1]=w}if(l){var A=p[h];p[h]=p[m+1],p[m+1]=A}}for(var E=m+2;E<n;E++){var S=o(e[E][m],g);if(0!==S){for(var C=0;C<n;C++)e[E][C]=r(e[E][C],a(S,e[m+1][C]));for(var M=0;M<n;M++)e[M][m+1]=t(e[M][m+1],a(S,e[M][E]));if(l)for(var F=0;F<n;F++)p[E][F]=r(p[E][F],a(S,p[m+1][F]))}}}}}(e,p,f,D,N,C);var{values:M,C:F}=function(e,n,o,p,f){var d="BigNumber"===p,h="Complex"===p,g=d?c(1):h?v(1):1;d&&(o=c(o));for(var y=eu(e),D=[],N=n,A=[],E=f?l(Array(n).fill(g)):void 0,S=f?l(Array(N).fill(g)):void 0,C=0;C<=100;){C+=1;for(var M=y[N-1][N-1],F=0;F<N;F++)y[F][F]=r(y[F][F],M);var{Q:T,R:B}=m(y);y=i(B,T);for(var O=0;O<N;O++)y[O][O]=t(y[O][O],M);if(f&&(S=i(S,T)),1===N||b(u(y[N-1][N-2]),o)){C=0,D.push(y[N-1][N-1]),f&&(A.unshift([[1]]),w(S,n),E=i(E,S),N>1&&(S=l(Array(N-1).fill(g)))),N-=1,y.pop();for(var _=0;_<N;_++)y[_].pop()}else if(2===N||b(u(y[N-2][N-3]),o)){C=0;var z=function(e,n,i,o){var u=t(e,o),c=r(a(e,o),a(n,i)),l=a(u,.5),p=a(s(r(a(u,u),a(4,c))),.5);return[t(l,p),r(l,p)]}(y[N-2][N-2],y[N-2][N-1],y[N-1][N-2],y[N-1][N-1]);D.push(...z),f&&(A.unshift(function(e,t,n,i,a,o,s,l){var p="BigNumber"===l,f="Complex"===l,d=p?c(0):f?v(0):0,m=p?c(1):f?v(1):1;if(b(u(n),s))return[[m,d],[d,m]];if(x(u(r(a,o)),s))return[[r(a,i),r(o,i)],[n,n]];var h=r(e,a),g=r(i,a);return b(u(t),s)&&b(u(g),s)?[[h,m],[n,d]]:[[t,d],[g,m]]}(y[N-2][N-2],y[N-2][N-1],y[N-1][N-2],y[N-1][N-1],z[0],z[1],o,p)),w(S,n),E=i(E,S),N>2&&(S=l(Array(N-2).fill(g)))),N-=2,y.pop(),y.pop();for(var q=0;q<N;q++)y[q].pop(),y[q].pop()}if(0===N)break}if(D.sort((e,t)=>+r(u(e),u(t))),C>100){var I=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+D.join(", "));throw I.values=D,I.vectors=[],I}return{values:D,C:f?i(E,function(e,t){for(var r=[],n=0;n<t;n++)r[n]=Array(t).fill(0);var i=0;for(var a of e){for(var o=a.length,s=0;s<o;s++)for(var u=0;u<o;u++)r[i+s][i+u]=a[s][u];i+=o}return r}(A,n)):void 0}}(e,p,f,D,N);if(N){var T=function(e,t,a,o,s,u,p){var f=i(d(a),e,a),m="BigNumber"===p,D="Complex"===p,N=m?c(0):D?v(0):0,w=m?c(1):D?v(1):1,C=[],M=[];for(var F of s){var T=function(e,t,r){for(var n=0;n<e.length;n++)if(r(e[n],t))return n;return -1}(C,F,y);-1===T?(C.push(F),M.push(1)):M[T]+=1}for(var B=[],O=C.length,_=Array(t).fill(N),z=l(Array(t).fill(w)),q=0;q<O;q++)!function(){var e=C[q],s=r(f,i(e,z)),l=g(s,_);for(l.shift();l.length<M[q];){var m=function(e,t,r,n,i){for(var a,o="BigNumber"===i?c(1e3):1e3,s=0;s<5;++s){a=function(e,t,r){var n="BigNumber"===r,i="Complex"===r,a=Array(e).fill(0).map(e=>2*Math.random()-1);return n&&(a=a.map(e=>c(e))),i&&(a=a.map(e=>v(e))),S(a=A(a,t),r)}(t,r,i);try{a=h(e,a)}catch(e){continue}if(x(E(a),o))break}if(s>=5)return null;for(s=0;;){var u=h(e,a);if(b(E(A(a,[u])),n))break;if(++s>=10)return null;a=S(u)}return a}(s,t,l,u,p);if(null===m)break;l.push(m)}var y=i(d(o),a);l=l.map(e=>i(y,e)),B.push(...l.map(t=>({value:e,vector:n(t)})))}();return B}(e,p,F,C,M,f,D);return{values:M,eigenvectors:T}}return{values:M}}}({config:t,addScalar:a,subtract:o,multiply:g,multiplyScalar:f,flatten:A,divideScalar:d,sqrt:C,abs:u,bignumber:h,diag:M,size:F,reshape:T,qr:B,inv:m,usolve:O,usolveAll:_,equal:s,complex:S,larger:N,smaller:I,matrixFromColumns:k,dot:R});return r("eigs",{Array:function(e){return j(n(e))},"Array, number|BigNumber":function(e,t){return j(n(e),{precision:t})},"Array, Object":(e,t)=>j(n(e),t),Matrix:function(e){return j(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return j(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){var r={matricize:!0};return i(r,t),j(e,r)}});function j(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=!("eigenvectors"in i)||i.eigenvectors,s=function(e,t,r){var n=e.toArray(),i=e.size();if(2!==i.length||i[0]!==i[1])throw RangeError("Matrix must be square (size: ".concat(n2(i),")"));var a=i[0];if(function(e,t,r){for(var n=0;n<t;n++)for(var i=0;i<t;i++)if(N(h(u(z(e[n][i]))),r))return!1;return!0}(n,a,t)&&(function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)e[r][n]=q(e[r][n])}(n,a),function(e,t,r){for(var n=0;n<t;n++)for(var i=n;i<t;i++)if(N(h(u(o(e[n][i],e[i][n]))),r))return!1;return!0}(n,a,t))){var s=L(e,n,a);return P(n,a,t,s,r)}var c=L(e,n,a);return U(n,a,t,c,r)}(e,null!=(r=i.precision)?r:t.relTol,a);return i.matricize&&(s.values=n(s.values),a&&(s.eigenvectors=s.eigenvectors.map(e=>{var{value:t,vector:r}=e;return{value:t,vector:n(r)}}))),a&&Object.defineProperty(s,"vectors",{enumerable:!1,get:()=>{throw Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),s}function L(e,t,r){var n=e.datatype();if("number"===n||"BigNumber"===n||"Complex"===n)return n;for(var i=!1,a=!1,o=!1,s=0;s<r;s++)for(var u=0;u<r;u++){var c=t[s][u];if(y(c)||D(c))i=!0;else if(v(c))a=!0;else if(b(c))o=!0;else throw TypeError("Unsupported type in Matrix: "+es(c))}if(a&&o&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),o){for(var l=0;l<r;l++)for(var p=0;p<r;p++)t[l][p]=S(t[l][p]);return"Complex"}if(a){for(var f=0;f<r;f++)for(var d=0;d<r;d++)t[f][d]=h(t[f][d]);return"BigNumber"}if(i){for(var m=0;m<r;m++)for(var g=0;g<r;g++)t[m][g]=E(t[m][g]);return"number"}throw TypeError("Matrix contains unsupported types only.")}}),fI="factorial",fk=tP(fI,["typed","gamma"],e=>{var{typed:t,gamma:r}=e;return t(fI,{number:function(e){if(e<0)throw Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),fR=tP("mad",["typed","abs","map","median","subtract"],e=>{var{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t("mad",{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=ip(e.valueOf())).length)throw Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(n(e,function(e){return r(a(e,t))}))}catch(e){if(e instanceof TypeError&&e.message.includes("median"))throw TypeError(e.message.replace("median","mad"));throw u8(e,"mad")}}}),fP="multinomial",fU=tP(fP,["typed","add","divide","multiply","factorial","isInteger","isPositive"],e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:a,isInteger:o,isPositive:s}=e;return t(fP,{"Array | Matrix":function(e){var t=0,u=1;return iU(e,function(e){if(!o(e)||!s(e))throw TypeError("Positive integer value expected in function multinomial");t=r(t,e),u=i(u,a(e))}),n(a(t),u)}})}),fj="norm",fL=tP(fj,["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],e=>{var{typed:t,abs:r,add:n,pow:i,conj:a,sqrt:o,multiply:s,equalScalar:u,larger:c,smaller:l,matrix:p,ctranspose:f,eigs:d}=e;return t(fj,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return m(p(e),2)},Matrix:function(e){return m(e,2)},"Array, number | BigNumber | string":function(e,t){return m(p(e),t)},"Matrix, number | BigNumber | string":function(e,t){return m(e,t)}});function m(e,t){var p,h,g=e.size();if(1===g.length){if(t===1/0||"inf"===t)return p=0,e.forEach(function(e){var t=r(e);c(t,p)&&(p=t)},!0),p;if(t===-1/0||"-inf"===t)return e.forEach(function(e){var t=r(e);(!h||l(t,h))&&(h=t)},!0),h||0;if("fro"===t)return m(e,2);if("number"==typeof t&&!isNaN(t)){if(!u(t,0)){var y=0;return e.forEach(function(e){y=n(i(r(e),t),y)},!0),i(y,1/t)}return 1/0}throw Error("Unsupported parameter value")}if(2===g.length)if(g[0]&&g[1])return function(e,t){if(1===t)return i=[],u=0,e.forEach(function(e,t){var a=t[1],o=n(i[a]||0,r(e));c(o,u)&&(u=o),i[a]=o},!0),u;if(t===1/0||"inf"===t)return l=[],p=0,e.forEach(function(e,t){var i=t[0],a=n(l[i]||0,r(e));c(a,p)&&(p=a),l[i]=a},!0),p;if("fro"===t)return m=0,e.forEach(function(e,t){m=n(m,s(e,a(e)))}),r(o(m));if(2===t){var i,u,l,p,m,h=e.size();if(h[0]!==h[1])throw RangeError("Invalid matrix dimensions");var g=d(s(f(e),e)).values.toArray();return r(o(g[g.length-1]))}throw Error("Unsupported parameter value "+t)}(e,t);else throw RangeError("Invalid matrix dimensions")}}),fH="permutations",f$=tP(fH,["typed","factorial"],e=>{var{typed:t,factorial:r}=e;return t(fH,{"number | BigNumber":r,"number, number":function(e,t){if(!tX(e)||e<0||!tX(t)||t<0)throw TypeError("Positive integer value expected in function permutations");if(t>e)throw TypeError("second argument k must be less than or equal to first argument n");return a3(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!fG(e)||!fG(t))throw TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})});function fG(e){return e.isInteger()&&e.gte(0)}var fZ="rotationMatrix",fV=tP(fZ,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:o,BigNumber:s,matrix:u,DenseMatrix:c,SparseMatrix:l,cos:p,sin:f}=e;return t(fZ,{"":function(){return"Matrix"===r.matrix?u([]):[]},string:function(e){return u(e)},"number | BigNumber | Complex | Unit":function(e){return d(e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return d(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var r=u(t);return m(r),y(e,r,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){m(t);var n=t.storage()||("Matrix"===r.matrix?"dense":void 0);return y(e,t,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){var n=u(t);return m(n),y(e,n,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return m(t),y(e,t,r)}});function d(e,t){var r=v(e)?new s(-1):-1,i=p(e),a=f(e);return g([[i,n(r,a)],[a,i]],t)}function m(e){var t=e.size();if(t.length<1||3!==t[0])throw RangeError("Vector must be of dimensions 1x3")}function h(e){return e.reduce((e,t)=>n(e,t))}function g(e,t){if(t){if("sparse"===t)return new l(e);if("dense"===t)return new c(e);throw TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function y(e,t,r){var n=o(t);if(0===n)throw RangeError("Rotation around zero vector");var u=v(e)?s:null,c=u?new u(1):1,l=u?new u(-1):-1,d=u?new u(t.get([0])/n):t.get([0])/n,m=u?new u(t.get([1])/n):t.get([1])/n,y=u?new u(t.get([2])/n):t.get([2])/n,x=p(e),b=i(c,a(x)),D=f(e);return g([[i(x,h([d,d,b])),i(h([d,m,b]),h([l,y,D])),i(h([d,y,b]),h([m,D]))],[i(h([d,m,b]),h([y,D])),i(x,h([m,m,b])),i(h([m,y,b]),h([l,d,D]))],[i(h([d,y,b]),h([l,m,D])),i(h([m,y,b]),h([d,D])),i(x,h([y,y,b]))]],r)}}),fW="setSize",fJ=tP(fW,["typed","compareNatural"],e=>{var{typed:t,compareNatural:r}=e;return t(fW,{"Array | Matrix":function(e){return Array.isArray(e)?ip(e).length:ip(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?ip(e).length:ip(e.toArray()).length;for(var n=ip(Array.isArray(e)?e:e.toArray()).sort(r),i=1,a=1;a<n.length;a++)0!==r(n[a],n[a-1])&&i++;return i}})}),fQ="unbiased",fX="variance",fY=tP(fX,["typed","add","subtract","multiply","divide","mapSlices","isNaN"],e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s}=e;return t(fX,{"Array | Matrix":function(e){return u(e,fQ)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,fQ)},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return u(e,fQ)}});function u(e,t){var o,u=0;if(0===e.length)throw SyntaxError("Function variance requires one or more parameters (0 provided)");if(iU(e,function(e){try{o=void 0===o?e:r(o,e),u++}catch(t){throw u8(t,"variance",e)}}),0===u)throw Error("Cannot calculate variance of an empty array");var c=a(o,u);if(o=void 0,iU(e,function(e){var t=n(e,c);o=void 0===o?i(t,t):r(o,i(t,t))}),s(o))return o;switch(t){case"uncorrected":return a(o,u);case"biased":return a(o,u+1);case"unbiased":var l=v(o)?o.mul(0):0;return 1===u?l:a(o,u-1);default:throw Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,r){try{if(0===e.length)throw SyntaxError("Function variance requires one or more parameters (0 provided)");return o(e,t,e=>u(e,r))}catch(e){throw u8(e,"variance")}}}),fK="zeta",f0=tP(fK,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isBounded","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],e=>{var{typed:t,config:r,multiply:n,pow:i,divide:a,factorial:o,equal:s,smallerEq:u,isBounded:c,isNegative:l,gamma:p,sin:f,subtract:d,add:m,Complex:h,BigNumber:g,pi:y}=e;return t(fK,{number:e=>v(e,e=>e,()=>20),BigNumber:e=>v(e,e=>new g(e),()=>Math.abs(Math.log10(r.relTol))),Complex:function(e){return 0===e.re&&0===e.im?new h(-.5):1===e.re?new h(NaN,NaN):e.re===1/0&&0===e.im?new h(1):e.im===1/0||e.re===-1/0?new h(NaN,NaN):x(e,e=>e,e=>Math.round(19.5+.9*Math.abs(e.im)),e=>e.re)}});function v(e,t,r){return s(e,0)?t(-.5):s(e,1)?t(NaN):c(e)?x(e,t,r,e=>e):t(l(e)?NaN:1)}function x(e,t,r,o){var s=r(e);if(o(e)>-(s-1)/2)return function(e,t,r){for(var o=a(1,n(b(r(0),t),d(1,i(2,d(1,e))))),s=r(0),c=r(1);u(c,t);c=m(c,1))s=m(s,a(n((-1)**(c-1),b(c,t)),i(c,e)));return n(o,s)}(e,t(s),t);var c=n(i(2,e),i(t(y),d(e,1)));return c=n(c,f(n(a(t(y),2),e))),c=n(c,p(d(1,e))),n(c,x(d(1,e),t,r,o))}function b(e,t){for(var r=e,s=e;u(s,t);s=m(s,1)){var c=a(n(o(m(t,d(s,1))),i(4,s)),n(o(d(t,s)),o(n(2,s))));r=m(r,c)}return n(t,r)}}),f1="corr",f2=tP(f1,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:a,subtract:o,multiply:s,pow:u,divide:c}=e;return t(f1,{"Array, Array":function(e,t){return l(e,t)},"Matrix, Matrix":function(e,t){var n=l(e.toArray(),t.toArray());return Array.isArray(n)?r(n):n}});function l(e,t){var r=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var n=0;n<e.length;n++){if(e[n].length!==t[n].length)throw SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");r.push(p(e[n],t[n]))}return r}if(e.length!==t.length)throw SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return p(e,t)}function p(e,t){var r=e.length,l=i(e),p=i(t),f=e.reduce((e,r,n)=>a(e,s(r,t[n])),0),d=i(e.map(e=>u(e,2))),m=i(t.map(e=>u(e,2)));return c(o(s(r,f),s(l,p)),n(s(o(s(r,d),u(l,2)),o(s(r,m),u(p,2)))))}}),f3="dotPow",f4=tP(f3,["typed","equalScalar","matrix","pow","DenseMatrix","concat","SparseMatrix"],e=>{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,u=uI({typed:t}),c=uk({typed:t,SparseMatrix:s}),l=ue({typed:t,equalScalar:r}),p=uR({typed:t,DenseMatrix:a}),f=uj({typed:t,matrix:n,concat:o}),d={};for(var m in i.signatures)!Object.prototype.hasOwnProperty.call(i.signatures,m)||m.includes("Matrix")||m.includes("Array")||(d[m]=i.signatures[m]);var h=t(d);return t(f3,f({elop:h,SS:c,DS:u,Ss:l,sS:p}))}),f5="setIntersect",f8=tP(f5,["typed","size","subset","compareNatural","Index","DenseMatrix"],e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(f5,{"Array | Matrix, Array | Matrix":function(e,t){var s;if(0===n(r(e),new a(0))||0===n(r(t),new a(0)))s=[];else{var u=iv(ip(Array.isArray(e)?e:e.toArray()).sort(i)),c=iv(ip(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var l=0;l<u.length;l++)for(var p=0;p<c.length;p++)if(0===i(u[l].value,c[p].value)&&u[l].identifier===c[p].identifier){s.push(u[l]);break}}return Array.isArray(e)&&Array.isArray(t)?ix(s):new o(ix(s))}})}),f6=tP("std",["typed","map","sqrt","variance"],e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t("std",{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(e){return a(e)}});function a(e,t){if(0===e.length)throw SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);if(S(a))return r(a,n);return n(a)}catch(e){if(e instanceof TypeError&&e.message.includes(" variance"))throw TypeError(e.message.replace(" variance"," std"));throw e}}}),f7="stirlingS2",f9=tP(f7,["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:o,factorial:s,combinations:u,isNegative:c,isInteger:l,number:p,bignumber:f,larger:d}=e,m=[],h=[];return t(f7,{"number | BigNumber, number | BigNumber":function(e,t){if(!l(e)||c(e)||!l(t)||c(t))throw TypeError("Non-negative integer value expected in function stirlingS2");if(d(t,e))throw TypeError("k must be less than or equal to n in function stirlingS2");var n=!(y(e)&&y(t)),a=n?h:m,o=n?f:p,s=p(e),u=p(t);if(a[s]&&a[s].length>u)return a[s][u];for(var g=0;g<=s;++g)if(a[g]||(a[g]=[o(+(0===g))]),0!==g)for(var v=a[g],x=a[g-1],b=v.length;b<=g&&b<=u;++b)b===g?v[b]=1:v[b]=r(i(o(b),x[b]),x[b-1]);return a[s][u]}})}),de="unit",dt=tP(de,["typed","Unit"],e=>{var{typed:t,Unit:r}=e;return t(de,{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new r(e,t)},"number | BigNumber | Fraction":function(e){return new r(e)},"Array | Matrix":t.referToSelf(e=>t=>ij(t,e))})}),dr="bellNumbers",dn=tP(dr,["typed","addScalar","isNegative","isInteger","stirlingS2"],e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=e;return t(dr,{"number | BigNumber":function(e){if(!i(e)||n(e))throw TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,o=0;o<=e;o++)t=r(t,a(e,o));return t}})}),di="rotate",da=tP(di,["typed","multiply","rotationMatrix"],e=>{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(di,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),r(n(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),r(n(t,a),e)}});function i(e,t){var r=Array.isArray(e)?n9(e):e.size();if(r.length>2||2===r.length&&1!==r[1]||r[0]!==t)throw RangeError("Vector must be of dimensions 1x".concat(t))}}),ds="setUnion",du=tP(ds,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:s}=e;return t(ds,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new s(0)))return ip(t);if(0===i(r(t),new s(0)))return ip(e);var u=ip(e),c=ip(t);return n(o(u,c),a(u,c))}})}),dc="schur",dl=tP(dc,["typed","matrix","identity","multiply","qr","norm","subtract"],e=>{var{typed:t,matrix:r,identity:n,multiply:i,qr:a,norm:o,subtract:s}=e;return t(dc,{Array:function(e){var t=u(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return u(e)}});function u(e){var t,r=e.size()[0],u=e,c=n(r),l=0;do{t=u;var p=a(u),f=p.Q;if(u=i(p.R,f),c=i(c,f),l++>100)break}while(o(s(u,t))>1e-4);return{U:c,T:u}}}),dp="sylvester",df=tP(dp,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:o,concat:s,transpose:u,index:c,subset:l,add:p,subtract:f,identity:d,lusolve:m,abs:h,config:g}=e;return t(dp,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(e,t,r){return y(i(e),t,r)},"Array, Array, Matrix":function(e,t,r){return y(i(e),i(t),r)},"Array, Matrix, Array":function(e,t,r){return y(i(e),t,i(r))},"Matrix, Array, Matrix":function(e,t,r){return y(e,i(t),r)},"Matrix, Array, Array":function(e,t,r){return y(e,i(t),i(r))},"Matrix, Matrix, Array":function(e,t,r){return y(e,t,i(r))},"Array, Array, Array":function(e,t,r){return y(i(e),i(t),i(r)).toArray()}});function y(e,t,g){for(var y=t.size()[0],v=e.size()[0],x=r(e),b=x.T,D=x.U,N=r(a(-1,t)),w=N.T,A=N.U,E=a(a(u(D),g),A),S=o(0,v),C=[],M=(e,t)=>s(e,t,1),F=(e,t)=>s(e,t,0),T=0;T<y;T++)if(T<y-1&&h(l(w,c(T+1,T)))>1e-5){for(var B=F(l(E,c(S,[T])),l(E,c(S,[T+1]))),O=0;O<T;O++)B=p(B,F(a(C[O],l(w,c(O,T))),a(C[O],l(w,c(O,T+1)))));var _=a(d(v),a(-1,l(w,c(T,T)))),z=a(d(v),a(-1,l(w,c(T+1,T)))),q=a(d(v),a(-1,l(w,c(T,T+1)))),I=a(d(v),a(-1,l(w,c(T+1,T+1)))),k=m(F(M(p(b,_),z),M(q,p(b,I))),B);C[T]=k.subset(c(o(0,v),[0])),C[T+1]=k.subset(c(o(v,2*v),[0])),T++}else{for(var R=l(E,c(S,[T])),P=0;P<T;P++)R=p(R,a(C[P],l(w,c(P,T))));var U=f(b,a(l(w,c(T,T)),d(v)));C[T]=m(U,R)}return a(D,a(i(n(...C)),u(A)))}}),dd="lyap",dm=tP(dd,["typed","matrix","sylvester","multiply","transpose"],e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(dd,{"Matrix, Matrix":function(e,t){return n(e,a(e),i(-1,t))},"Array, Matrix":function(e,t){return n(r(e),a(r(e)),i(-1,t))},"Matrix, Array":function(e,t){return n(e,a(r(e)),r(i(-1,t)))},"Array, Array":function(e,t){return n(r(e),a(r(e)),r(i(-1,t))).toArray()}})}),dh=tL({config:eg}),dg=rf({}),dy=rF({BigNumber:dh,config:eg}),dv=rw({}),dx=r7({BigNumber:dh,config:eg}),db=nJ({}),dD=rk({Complex:dg}),dN=rE({BigNumber:dh,config:eg}),dw=rO({BigNumber:dh,config:eg}),dA=rz({BigNumber:dh,config:eg}),dE=nQ({}),dS=rS({BigNumber:dh,config:eg}),dC=rA({}),dM=rT({BigNumber:dh,config:eg}),dF=nX({}),dT=nY({}),dB=rq({BigNumber:dh,config:eg}),dO=ny({BigNumber:dh,config:eg}),d_=rM({BigNumber:dh,config:eg}),dz=rN({}),dq=rU({}),dI=iB({Matrix:dE,config:eg}),dk=ns({BigNumber:dh,config:eg}),dR=rB({BigNumber:dh,config:eg}),dP=rC({BigNumber:dh,config:eg}),dU=iO({}),dj=rI({BigNumber:dh,config:eg}),dL=iz({BigNumber:dh,Complex:dg,DenseMatrix:dI,Fraction:db}),dH=no({BigNumber:dh,config:eg}),d$=an({typed:dL}),dG=aa({Complex:dg,config:eg,typed:dL}),dZ=aN({BigNumber:dh,typed:dL}),dV=aA({BigNumber:dh,Complex:dg,config:eg,typed:dL}),dW=aS({typed:dL}),dJ=aC({typed:dL}),dQ=aF({BigNumber:dh,Complex:dg,config:eg,typed:dL}),dX=aT({typed:dL}),dY=aB({typed:dL}),dK=a_({Complex:dg,config:eg,typed:dL}),d0=az({typed:dL}),d1=aY({typed:dL}),d2=a0({typed:dL}),d3=a2({typed:dL}),d4=a8({typed:dL}),d5=a7({Complex:dg,typed:dL}),d8=oe({typed:dL}),d6=or({typed:dL}),d7=on({BigNumber:dh,typed:dL}),d9=oi({BigNumber:dh,typed:dL}),me=oo({typed:dL}),mt=ol({config:eg,typed:dL}),mr=op({typed:dL}),mn=oy({typed:dL}),mi=ox({Complex:dg,typed:dL}),ma=ob({typed:dL}),mo=ow({typed:dL}),ms=oE({typed:dL}),mu=oM({typed:dL}),mc=oT({typed:dL}),ml=oB({format:mu,typed:dL}),mp=oO({typed:dL}),mf=oz({typed:dL}),md=oR({typed:dL}),mm=oU({typed:dL}),mh=oL({typed:dL}),mg=r_({BigNumber:dh,config:eg}),my=oJ({Complex:dg,typed:dL}),mv=oK({Complex:dg,config:eg,typed:dL}),mx=o1({Complex:dg,config:eg,typed:dL}),mb=o2({typed:dL}),mD=o4({isNaN:md,isNumeric:mm,typed:dL}),mN=o5({typed:dL}),mw=st({typed:dL}),mA=sr({typed:dL}),mE=sn({format:mu,typed:dL}),mS=su({config:eg,typed:dL}),mC=sp({typed:dL}),mM=sh({config:eg,typed:dL}),mF=sg({typed:dL}),mT=sy({BigNumber:dh,typed:dL}),mB=sx({BigNumber:dh,Fraction:db,complex:d5,typed:dL}),mO=sb({typed:dL}),m_=sN({typed:dL}),mz=sw({Matrix:dE,equalScalar:mt,typed:dL}),mq=sE({typed:dL}),mI=sC({typed:dL}),mk=sF({typed:dL}),mR=sB({typed:dL}),mP=sO({typed:dL}),mU=sz({typed:dL}),mj=sI({typed:dL}),mL=sR({Complex:dg,config:eg,typed:dL}),mH=sU({BigNumber:dh,typed:dL}),m$=sL({BigNumber:dh,Complex:dg,config:eg,typed:dL}),mG=sH({BigNumber:dh,typed:dL}),mZ=sG({typed:dL}),mV=sW({typed:dL}),mW=sQ({BigNumber:dh,typed:dL}),mJ=sX({addScalar:dW,conj:d8,multiplyScalar:mN,size:m_,typed:dL}),mQ=sK({isNumeric:mm,typed:dL}),mX=s1({isBounded:mf,map:mb,typed:dL}),mY=s3({config:eg,typed:dL}),mK=s5({equalScalar:mt,typed:dL}),m0=s6({DenseMatrix:dI,Matrix:dE,SparseMatrix:mz,typed:dL}),m1=s9({isZero:mK,matrix:m0,typed:dL}),m2=un({addScalar:dW,dot:mJ,equalScalar:mt,matrix:m0,multiplyScalar:mN,typed:dL}),m3=ui({BigNumber:dh,config:eg,matrix:m0,typed:dL}),m4=uo({config:eg,log2:mx,typed:dL}),m5=uu({config:eg,matrix:m0}),m8=ul({BigNumber:dh,typed:dL}),m6=uf({typed:dL}),m7=um({SparseMatrix:mz,typed:dL}),m9=uh({Complex:dg,config:eg,typed:dL}),he=uy({typed:dL}),ht=uv({typed:dL}),hr=ub({matrix:m0,typed:dL}),hn=uN({BigNumber:dh,config:eg,matrix:m0,typed:dL}),hi=uA({BigNumber:dh,config:eg,matrix:m0,typed:dL}),ha=uS({BigNumber:dh,Complex:dg,config:eg,typed:dL}),ho=uM({Complex:dg,config:eg,typed:dL}),hs=uF({format:mu,typed:dL}),hu=uB({BigNumber:dh,typed:dL}),hc=u_({conj:d8,transpose:hr,typed:dL}),hl=uq({DenseMatrix:dI,SparseMatrix:mz,matrix:m0,typed:dL}),hp=uH({DenseMatrix:dI,SparseMatrix:mz,equalScalar:mt,matrix:m0,typed:dL}),hf=uG({Fraction:db,typed:dL}),hd=uV({BigNumber:dh,DenseMatrix:dI,SparseMatrix:mz,config:eg,matrix:m0,typed:dL}),hm=uJ({equal:hp,typed:dL}),hh=uX({matrix:m0,multiplyScalar:mN,typed:dL}),hg=uK({isInteger:hm,typed:dL}),hy=hg,hv=u2({flatten:mo,matrix:m0,size:m_,typed:dL}),hx=u5({bignumber:mG,fraction:hf,number:mA}),hb=u7({config:eg,multiplyScalar:mN,numeric:hx,typed:dL}),hD=ce({isInteger:hm,matrix:m0,typed:dL}),hN=cn({BigNumber:dh,DenseMatrix:dI,config:eg,equalScalar:mt,matrix:m0,typed:dL,zeros:hi}),hw=ca({typed:dL}),hA=cs({BigNumber:dh,Fraction:db,config:eg,isInteger:hm,number:mA,typed:dL}),hE=cl({BigNumber:dh,Complex:dg,Fraction:db,config:eg,isNegative:mY,matrix:m0,typed:dL,unaryMinus:hw}),hS=cf({isInteger:hm,matrix:m0,typed:dL}),hC=cm({prod:hb,size:m_,typed:dL}),hM=cg({equal:hp,typed:dL}),hF=cv({numeric:hx,typed:dL}),hT=cN({concat:hS,equalScalar:mt,matrix:m0,multiplyScalar:mN,typed:dL}),hB=cS({DenseMatrix:dI,config:eg,equalScalar:mt,matrix:m0,round:hN,typed:dL,zeros:hi}),hO=cq({BigNumber:dh,DenseMatrix:dI,concat:hS,config:eg,equalScalar:mt,matrix:m0,round:hN,typed:dL,zeros:hi}),h_=ck({config:eg,typed:dL}),hz=cP({DenseMatrix:dI,SparseMatrix:mz,bignumber:mG,concat:hS,config:eg,matrix:m0,typed:dL}),hq=cL({concat:hS,equalScalar:mt,matrix:m0,typed:dL}),hI=cZ({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL,zeros:hi}),hk=cJ({DenseMatrix:dI,divideScalar:hF,equalScalar:mt,matrix:m0,multiplyScalar:mN,subtractScalar:mR,typed:dL}),hR=cQ({config:eg,isNaN:md,larger:hz,numeric:hx,typed:dL}),hP=cM({DenseMatrix:dI,concat:hS,config:eg,equalScalar:mt,matrix:m0,round:hN,typed:dL,zeros:hi}),hU=cY({BigNumber:dh,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),hj=c0({deepEqual:hM,flatten:mo,matrix:m0,size:m_,typed:dL}),hL=c1({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),hH=c2({addScalar:dW,complex:d5,conj:d8,divideScalar:hF,equal:hp,identity:hd,isZero:mK,matrix:m0,multiplyScalar:mN,sign:mB,sqrt:m9,subtractScalar:mR,typed:dL,unaryMinus:hw,zeros:hi}),h$=c4({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL,zeros:hi}),hG=c8({DenseMatrix:dI,SparseMatrix:mz,bignumber:mG,concat:hS,config:eg,matrix:m0,typed:dL}),hZ=c9({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,subtractScalar:mR,typed:dL,unaryMinus:hw}),hV=le({concat:hS,matrix:m0,typed:dL}),hW=lr({config:eg,numeric:hx,typed:dL}),hJ=li({DenseMatrix:dI,divideScalar:hF,equalScalar:mt,matrix:m0,multiplyScalar:mN,subtractScalar:mR,typed:dL}),hQ=la({DenseMatrix:dI,SparseMatrix:mz,concat:hS,matrix:m0,typed:dL}),hX=lo({DenseMatrix:dI,SparseMatrix:mz,addScalar:dW,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),hY=lu({BigNumber:dh,DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),hK=ll({concat:hS,equalScalar:mt,matrix:m0,typed:dL}),h0=lf({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),h1=lm({DenseMatrix:dI,SparseMatrix:mz,concat:hS,matrix:m0,typed:dL}),h2=lg({addScalar:dW,combinations:d4,divideScalar:hF,isInteger:hm,isNegative:mY,multiplyScalar:mN,typed:dL}),h3=lv({BigNumber:dh,DenseMatrix:dI,Fraction:db,concat:hS,config:eg,equalScalar:mt,matrix:m0,typed:dL}),h4=lD({concat:hS,matrix:m0,typed:dL}),h5=lw({addScalar:dW,combinations:d4,isInteger:hm,isNegative:mY,isPositive:h_,larger:hz,typed:dL}),h8=lE({matrix:m0,multiply:m2,subtract:hZ,typed:dL}),h6=lS({divideScalar:hF,isZero:mK,matrix:m0,multiply:m2,subtractScalar:mR,typed:dL,unaryMinus:hw}),h7=lM({matrix:m0,number:mA,subtract:hZ,typed:dL}),h9=lT({abs:d$,addScalar:dW,deepEqual:hM,divideScalar:hF,multiplyScalar:mN,sqrt:m9,subtractScalar:mR,typed:dL}),ge=lO({DenseMatrix:dI,SparseMatrix:mz,concat:hS,divideScalar:hF,equalScalar:mt,matrix:m0,typed:dL}),gt=lz({compareText:h4,isZero:mK,typed:dL}),gr=lq({larger:hz,smaller:hG}),gn=lk({abs:d$,addScalar:dW,divideScalar:hF,isPositive:h_,multiplyScalar:mN,smaller:hG,sqrt:m9,typed:dL}),gi=lR({DenseMatrix:dI,smaller:hG}),ga=lP({ImmutableDenseMatrix:gi,getMatrixDataType:mc}),go=lj({abs:d$,add:hX,addScalar:dW,config:eg,divideScalar:hF,equalScalar:mt,flatten:mo,isNumeric:mm,isZero:mK,matrix:m0,multiply:m2,multiplyScalar:mN,smaller:hG,subtract:hZ,typed:dL}),gs=lH({BigNumber:dh,add:hX,config:eg,equal:hp,isInteger:hm,mod:hP,smaller:hG,typed:dL,xgcd:hn}),gu=lG({DenseMatrix:dI,SparseMatrix:mz,concat:hS,config:eg,matrix:m0,typed:dL}),gc=lW({Complex:dg,config:eg,divideScalar:hF,typeOf:mj,typed:dL}),gl=lQ({DenseMatrix:dI,divideScalar:hF,equalScalar:mt,matrix:m0,multiplyScalar:mN,subtractScalar:mR,typed:dL}),gp=lY({flatten:mo,matrix:m0,size:m_,typed:dL}),gf=lK({config:eg,isNaN:md,numeric:hx,smaller:hG,typed:dL}),gd=l1({Complex:dg,config:eg,divideScalar:hF,typed:dL}),gm=l3({compare:h3,isNaN:md,isNumeric:mm,typed:dL}),gh=l5({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL,zeros:hi}),gg=pn({SparseMatrix:mz,abs:d$,add:hX,divideScalar:hF,larger:hz,largerEq:gu,multiply:m2,subtract:hZ,transpose:hr,typed:dL}),gy=pi({FibonacciHeap:gr,addScalar:dW,equalScalar:mt}),gv=po({add:hX,matrix:m0,typed:dL,zeros:hi}),gx=pp({add:hX,config:eg,numeric:hx,typed:dL}),gb=pf({add:hX,matrix:m0,typed:dL}),gD=pm({DenseMatrix:dI,divideScalar:hF,equalScalar:mt,matrix:m0,multiplyScalar:mN,subtractScalar:mR,typed:dL}),gN=pg({Complex:dg,add:hX,multiply:m2,number:mA,typed:dL}),gw=pb({DenseMatrix:dI,config:eg,equalScalar:mt,matrix:m0,round:hN,typed:dL,zeros:hi}),gA=pw({compare:h3,typed:dL}),gE=pE({add:hX,typed:dL,unaryPlus:hW}),gS=pC({Complex:dg,DenseMatrix:dI,ceil:gw,equalScalar:mt,floor:hB,matrix:m0,typed:dL,zeros:hi}),gC=pF({Index:ga,typed:dL}),gM=pT({abs:d$,addScalar:dW,det:h6,divideScalar:hF,identity:hd,matrix:m0,multiply:m2,typed:dL,unaryMinus:hw}),gF=pO({Complex:dg,config:eg,divideScalar:hF,log:gc,typed:dL}),gT=p_({DenseMatrix:dI,Spa:gy,SparseMatrix:mz,abs:d$,addScalar:dW,divideScalar:hF,equalScalar:mt,larger:hz,matrix:m0,multiplyScalar:mN,subtractScalar:mR,typed:dL,unaryMinus:hw}),gB=pq({Complex:dg,add:hX,ctranspose:hc,deepEqual:hM,divideScalar:hF,dot:mJ,dotDivide:ge,equal:hp,inv:gM,matrix:m0,multiply:m2,typed:dL}),gO=pI({Complex:dg,config:eg,fraction:hf,identity:hd,inv:gM,matrix:m0,multiply:m2,number:mA,typed:dL}),g_=pR({DenseMatrix:dI,Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),gz=pU({DenseMatrix:dI,Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),gq=pL({Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),gI=p$({Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),gk=pZ({DenseMatrix:dI,SparseMatrix:mz,concat:hS,config:eg,matrix:m0,typed:dL}),gR=pJ({compare:h3,compareNatural:gA,matrix:m0,typed:dL}),gP=pX({abs:d$,add:hX,identity:hd,inv:gM,map:mb,max:hR,multiply:m2,size:m_,sqrt:m9,subtract:hZ,typed:dL}),gU=pK({DenseMatrix:dI,SparseMatrix:mz,concat:hS,config:eg,equalScalar:mt,matrix:m0,typed:dL}),gj=p1({concat:hS,equalScalar:mt,matrix:m0,not:mw,typed:dL,zeros:hi}),gL=p2({divideScalar:hF,equalScalar:mt,inv:gM,matrix:m0,multiply:m2,typed:dL}),gH=p4({abs:d$,add:hX,identity:hd,inv:gM,multiply:m2,typed:dL}),g$=p5({addScalar:dW,ceil:gw,conj:d8,divideScalar:hF,dotDivide:ge,exp:mn,i:dD,log2:mx,matrix:m0,multiplyScalar:mN,pow:gO,tau:d_,typed:dL}),gG=p6({Complex:dg,add:hX,divide:gL,matrix:m0,multiply:m2,typed:dL}),gZ=p9({BigNumber:dh,Complex:dg,config:eg,multiplyScalar:mN,pow:gO,typed:dL}),gV=ft({conj:d8,dotDivide:ge,fft:g$,typed:dL}),gW=fn({divide:gL,dotDivide:ge,isNumeric:mm,log:gc,map:mb,matrix:m0,multiply:m2,sum:gx,typed:dL}),gJ=fo({DenseMatrix:dI,lsolve:hk,lup:gT,matrix:m0,slu:gg,typed:dL,usolve:hJ}),gQ=fu({add:hX,divide:gL,typed:dL}),gX=fl({add:hX,compare:h3,divide:gL,partitionSelect:gm,typed:dL}),gY=ff({add:hX,cbrt:hE,divide:gL,equalScalar:mt,im:mp,isZero:mK,multiply:m2,re:mF,sqrt:m9,subtract:hZ,typeOf:mj,typed:dL,unaryMinus:hw}),gK=fm({bignumber:mG,add:hX,compare:h3,divide:gL,isInteger:hm,larger:hz,mapSlices:hg,multiply:m2,partitionSelect:gm,smaller:hG,smallerEq:gk,subtract:hZ,typed:dL}),g0=fg({bignumber:mG,matrix:m0,add:hX,config:eg,equal:hp,isPositive:h_,isZero:mK,larger:hz,largerEq:gu,smaller:hG,smallerEq:gk,typed:dL}),g1=fy({Index:ga,matrix:m0,range:g0,typed:dL}),g2=fx({DenseMatrix:dI,Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),g3=fD({Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),g4=fw({Index:ga,concat:hS,setDifference:g2,size:m_,subset:gv,typed:dL}),g5=fC({abs:d$,add:hX,bignumber:mG,divide:gL,isNegative:mY,isPositive:h_,larger:hz,map:mb,matrix:m0,max:hR,multiply:m2,smaller:hG,subtract:hZ,typed:dL,unaryMinus:hw}),g8=fT({BigNumber:dh,Complex:dg,Fraction:db,abs:d$,addScalar:dW,config:eg,divideScalar:hF,equal:hp,fix:gS,format:mu,isNumeric:mm,multiplyScalar:mN,number:mA,pow:gO,round:hN,subtractScalar:mR}),g6=rW({BigNumber:dh,Unit:g8,config:eg}),g7=nu({BigNumber:dh,Unit:g8,config:eg}),g9=rY({BigNumber:dh,Unit:g8,config:eg}),ye=nl({BigNumber:dh,Unit:g8,config:eg}),yt=fO({Index:ga,matrix:m0,range:g0,typed:dL}),yr=rK({BigNumber:dh,Unit:g8,config:eg}),yn=rJ({BigNumber:dh,Unit:g8,config:eg}),yi=fz({Unit:g8,typed:dL}),ya=nt({BigNumber:dh,Unit:g8,config:eg}),yo=fq({abs:d$,add:hX,addScalar:dW,atan:dY,bignumber:mG,column:yt,complex:d5,config:eg,cos:d6,diag:hl,divideScalar:hF,dot:mJ,equal:hp,flatten:mo,im:mp,inv:gM,larger:hz,matrix:m0,matrixFromColumns:hv,multiply:m2,multiplyScalar:mN,number:mA,qr:hH,re:mF,reshape:hD,sin:mO,size:m_,smaller:hG,sqrt:m9,subtract:hZ,typed:dL,usolve:hJ,usolveAll:gD}),ys=r8({BigNumber:dh,Unit:g8,config:eg}),yu=fk({gamma:gZ,typed:dL}),yc=r6({BigNumber:dh,Unit:g8,config:eg}),yl=nm({BigNumber:dh,Unit:g8,config:eg}),yp=nw({BigNumber:dh,Unit:g8,config:eg}),yf=r3({BigNumber:dh,Unit:g8,config:eg}),yd=nd({BigNumber:dh,Unit:g8,config:eg}),ym=fR({abs:d$,map:mb,median:gX,subtract:hZ,typed:dL}),yh=r1({BigNumber:dh,Unit:g8,config:eg}),yg=nD({BigNumber:dh,Unit:g8,config:eg}),yy=nh({BigNumber:dh,Unit:g8,config:eg}),yv=fU({add:hX,divide:gL,factorial:yu,isInteger:hm,isPositive:h_,multiply:m2,typed:dL}),yx=fL({abs:d$,add:hX,conj:d8,ctranspose:hc,eigs:yo,equalScalar:mt,larger:hz,matrix:m0,multiply:m2,pow:gO,smaller:hG,sqrt:m9,typed:dL}),yb=f$({factorial:yu,typed:dL}),yD=r$({BigNumber:dh,Unit:g8,config:eg}),yN=nE({BigNumber:dh,Unit:g8,config:eg}),yw=nS({BigNumber:dh,Unit:g8,config:eg}),yA=rG({BigNumber:dh,Unit:g8,config:eg}),yE=fV({BigNumber:dh,DenseMatrix:dI,SparseMatrix:mz,addScalar:dW,config:eg,cos:d6,matrix:m0,multiplyScalar:mN,norm:yx,sin:mO,typed:dL,unaryMinus:hw}),yS=ni({BigNumber:dh,Unit:g8,config:eg}),yC=nv({BigNumber:dh,Unit:g8,config:eg}),yM=fJ({compareNatural:gA,typed:dL}),yF=rL({BigNumber:dh,Unit:g8,config:eg}),yT=nx({BigNumber:dh,Unit:g8,config:eg}),yB=na({BigNumber:dh,Unit:g8,config:eg}),yO=fY({add:hX,divide:gL,isNaN:md,mapSlices:hg,multiply:m2,subtract:hZ,typed:dL}),y_=f0({BigNumber:dh,Complex:dg,add:hX,config:eg,divide:gL,equal:hp,factorial:yu,gamma:gZ,isBounded:mf,isNegative:mY,multiply:m2,pi:dP,pow:gO,sin:mO,smallerEq:gk,subtract:hZ,typed:dL}),yz=nc({BigNumber:dh,Unit:g8,config:eg}),yq=r4({BigNumber:dh,Unit:g8,config:eg}),yI=f2({add:hX,divide:gL,matrix:m0,mean:gQ,multiply:m2,pow:gO,sqrt:m9,subtract:hZ,sum:gx,typed:dL}),yk=f4({DenseMatrix:dI,SparseMatrix:mz,concat:hS,equalScalar:mt,matrix:m0,pow:gO,typed:dL}),yR=rX({BigNumber:dh,Unit:g8,config:eg}),yP=np({BigNumber:dh,Unit:g8,config:eg}),yU=r9({BigNumber:dh,Unit:g8,config:eg}),yj=r0({BigNumber:dh,Unit:g8,config:eg}),yL=rZ({BigNumber:dh,Unit:g8,config:eg}),yH=nN({BigNumber:dh,Unit:g8,config:eg}),y$=nr({BigNumber:dh,Unit:g8,config:eg}),yG=nC({BigNumber:dh,Unit:g8,config:eg}),yZ=nM({BigNumber:dh,Unit:g8,config:eg}),yV=nn({BigNumber:dh,Unit:g8,config:eg}),yW=f8({DenseMatrix:dI,Index:ga,compareNatural:gA,size:m_,subset:gv,typed:dL}),yJ=f6({map:mb,sqrt:m9,typed:dL,variance:yO}),yQ=f9({bignumber:mG,addScalar:dW,combinations:d4,divideScalar:hF,factorial:yu,isInteger:hm,isNegative:mY,larger:hz,multiplyScalar:mN,number:mA,pow:gO,subtractScalar:mR,typed:dL}),yX=dt({Unit:g8,typed:dL}),yY=dn({addScalar:dW,isInteger:hm,isNegative:mY,stirlingS2:yQ,typed:dL}),yK=rV({BigNumber:dh,Unit:g8,config:eg}),y0=nf({BigNumber:dh,Unit:g8,config:eg}),y1=r2({BigNumber:dh,Unit:g8,config:eg}),y2=nA({BigNumber:dh,Unit:g8,config:eg}),y3=da({multiply:m2,rotationMatrix:yE,typed:dL}),y4=du({Index:ga,concat:hS,setIntersect:yW,setSymDifference:g4,size:m_,subset:gv,typed:dL}),y5=nb({BigNumber:dh,Unit:g8,config:eg}),y8=r5({BigNumber:dh,Unit:g8,config:eg}),y6=ng({BigNumber:dh,Unit:g8,config:eg}),y7=dl({identity:hd,matrix:m0,multiply:m2,norm:yx,qr:hH,subtract:hZ,typed:dL}),y9=rQ({BigNumber:dh,Unit:g8,config:eg}),ve=rH({BigNumber:dh,Unit:g8,config:eg}),vt=ne({BigNumber:dh,Unit:g8,config:eg}),vr=df({abs:d$,add:hX,concat:hS,identity:hd,index:gC,lusolve:gJ,matrix:m0,matrixFromColumns:hv,multiply:m2,range:g0,schur:y7,subset:gv,subtract:hZ,transpose:hr,typed:dL}),vn=dm({matrix:m0,multiply:m2,sylvester:vr,transpose:hr,typed:dL}),vi=new Set(["end"]),va=tP("Node",["mathWithTransform"],e=>{var{mathWithTransform:t}=e;return class{get type(){return"Node"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){var e=this._compile(t,{}),r={};return{evaluate:function(t){var n=g(t);for(var i of[...vi])if(n.has(i))throw Error('Scope contains an illegal symbol, "'+i+'" is a reserved keyword');return e(n,r,null)}}}_compile(e,t){throw Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw Error("Cannot run forEach on a Node interface")}map(e){throw Error("Cannot run map on a Node interface")}_ifNode(e){if(!K(e))throw TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),!function e(t,r){t.forEach(function(t,n,i){r(t,n,i),e(t,r)})}(this,e)}transform(e){return function t(r,n,i){var a=e(r,n,i);return a!==r?a:r.map(t)}(this,null,null)}filter(e){var t=[];return this.traverse(function(r,n,i){e(r,n,i)&&t.push(r)}),t}clone(){throw Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(e){return e.cloneDeep()})}equals(e){return!!e&&this.type===e.type&&el(this,e)}toString(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw Error("_toString not implemented for "+this.type)}toJSON(){throw Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(e){var t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}_toHTML(){throw Error("_toHTML not implemented for "+this.type)}toTex(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}_toTex(e){throw Error("_toTex not implemented for "+this.type)}_getCustomString(e){if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}},{isClass:!0,isNode:!0}),vo="ObjectNode",vs=tP(vo,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every(function(t){return K(e[t])})))throw TypeError("Object containing Nodes expected")}get type(){return vo}get isObjectNode(){return!0}_compile(e,t){var r={};for(var n in this.properties)if(ef(this.properties,n)){var i=JSON.parse(n3(n)),a=o(this.properties,n);r[i]=a._compile(e,t)}return function(e,t,n){var i={};for(var a in r)ef(r,a)&&(i[a]=r[a](e,t,n));return i}}forEach(e){for(var t in this.properties)ef(this.properties,t)&&e(this.properties[t],"properties["+n3(t)+"]",this)}map(e){var t={};for(var n in this.properties)ef(this.properties,n)&&(t[n]=this._ifNode(e(this.properties[n],"properties["+n3(n)+"]",this)));return new r(t)}clone(){var e={};for(var t in this.properties)ef(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)}_toString(e){var t=[];for(var r in this.properties)ef(this.properties,r)&&t.push(n3(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:vo,properties:this.properties}}static fromJSON(e){return new r(e.properties)}_toHTML(e){var t=[];for(var r in this.properties)ef(this.properties,r)&&t.push('<span class="math-symbol math-property">'+n5(r)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[r].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(e){var t=[];for(var r in this.properties)ef(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return fE(r,"name",vo),r},{isClass:!0,isNode:!0});function vu(e,t){return new d(e,new f(t),new Set(Object.keys(t)))}var vc=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:nullish":{op:"??",associativity:"left",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function vl(e,t){if(!t||"auto"!==t)return e;for(var r=e;er(r);)r=r.content;return r}function vp(e,t,r,n){var i=e;"keep"!==t&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,s=0;s<vc.length;s++)if(a in vc[s]){o=s;break}if("OperatorNode:multiply"===a&&i.implicit&&"show"!==r){var u=vl(i.args[0],t);W(u)&&n&&"OperatorNode:divide"===n.getIdentifier()&&J(vl(n.args[0],t))||"OperatorNode:divide"===u.getIdentifier()&&J(vl(u.args[0],t))&&W(vl(u.args[1]))||(o+=1)}return o}function vf(e,t){var r=e;"keep"!==t&&(r=e.getContent());var n=r.getIdentifier(),i=vp(r,t);if(null===i)return null;var a=vc[i][n];if(ef(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function vd(e,t,r){var n="keep"!==r?e.getContent():e,i="keep"!==r?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),s=vp(n,r);if(null===s)return null;var u=vc[s][a];if(ef(u,"associativeWith")&&u.associativeWith instanceof Array){for(var c=0;c<u.associativeWith.length;c++)if(u.associativeWith[c]===o)return!0;return!1}return null}var vm=r(43144),vh={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},vg={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},vy={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(vg.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(vg.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(vg.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(vg.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(vg.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},fraction:{2:"\\frac{${args[0]}}{${args[1]}}"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(vg.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(vg.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : y^${args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(vg.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(vg.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(vg.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(vg.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(vg.bitAnd,"${args[1]}\\right)")},bitNot:{1:vg.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(vg.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(vg.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(vg.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(vg.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(vg.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(vg.and,"${args[1]}\\right)")},not:{1:vg.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(vg.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(vg.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(vg.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(vg.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(vg.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(vg.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(vg.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(vg.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(vg.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(vg.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(vg.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(vg.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(vg.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(vh.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},vv={deg:"^\\circ"};function vx(e){return vm(e,{preserveFormatting:!0})}function vb(e,t){return(t=void 0!==t&&t)?ef(vv,e)?vv[e]:"\\mathrm{"+vx(e)+"}":ef(vh,e)?vh[e]:vx(e)}var vD="OperatorNode",vN=tP(vD,["Node"],e=>{var{Node:t}=e;function r(e,t,r,n,i){var a=vp(e,t,r),o=vf(e,t);if("all"===t||n.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return n.map(function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});switch(n.length){case 0:s=[];break;case 1:var s,u,c,l=vp(n[0],t,r,e);if(i&&null!==l&&("keep"===t?(u=n[0].getIdentifier(),c=e.getIdentifier()):(u=n[0].getContent().getIdentifier(),c=e.getContent().getIdentifier()),!1===vc[a][c].latexLeftParens||!1===vc[l][u].latexParens)||null===l){s=[!1];break}if(l<=a){s=[!0];break}s=[!1];break;case 2:var p,f,d,m,h,g=vp(n[0],t,r,e),y=vd(e,n[0],t);p=null!==g&&(g===a&&"right"===o&&!y||g<a);var v=vp(n[1],t,r,e),x=vd(e,n[1],t);f=null!==v&&(v===a&&"left"===o&&!x||v<a),i&&("keep"===t?(d=e.getIdentifier(),m=e.args[0].getIdentifier(),h=e.args[1].getIdentifier()):(d=e.getContent().getIdentifier(),m=e.args[0].getContent().getIdentifier(),h=e.args[1].getContent().getIdentifier()),null!==g&&(!1===vc[a][d].latexLeftParens&&(p=!1),!1===vc[g][m].latexParens&&(p=!1)),null!==v&&(!1===vc[a][d].latexRightParens&&(f=!1),!1===vc[v][h].latexParens&&(f=!1))),s=[p,f];break;default:("OperatorNode:add"===e.getIdentifier()||"OperatorNode:multiply"===e.getIdentifier())&&(s=n.map(function(n){var i=vp(n,t,r,e),s=vd(e,n,t),u=vf(n,t);if(null===i);else if(a===i&&o===u&&!s)return!0;else if(i<a)return!0;return!1}))}if(n.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===r)for(var b=1;b<s.length;++b)!function e(t,r){var n=t;if("auto"===r)for(;er(n);)n=n.content;return!!W(n)||!!et(n)&&e(n.args[0],r)}(n[b],t)||s[b-1]||"keep"===t&&er(n[b-1])||(s[b]=!0);return s}class n extends t{constructor(e,t,r,n,i){if(super(),"string"!=typeof e)throw TypeError('string expected for parameter "op"');if("string"!=typeof t)throw TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(K))throw TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===n,this.isPercentage=!0===i,this.op=e,this.fn=t,this.args=r||[]}get type(){return vD}get isOperatorNode(){return!0}_compile(e,t){if("string"!=typeof this.fn||!c(e,this.fn))if(e[this.fn])throw Error('No access to function "'+this.fn+'"');else throw Error("Function "+this.fn+' missing in provided namespace "math"');var r=o(e,this.fn),n=id(this.args,function(r){return r._compile(e,t)});if("function"==typeof r&&!0===r.rawArgs){var i=this.args;return function(t,n,a){return r(i,e,vu(t,n))}}if(1===n.length){var a=n[0];return function(e,t,n){return r(a(e,t,n))}}if(2!==n.length)return function(e,t,i){return r.apply(null,id(n,function(r){return r(e,t,i)}))};var s=n[0],u=n[1];return function(e,t,n){return r(s(e,t,n),u(e,t,n))}}forEach(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){for(var t=[],r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new n(this.op,this.fn,t,this.implicit,this.isPercentage)}clone(){return new n(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return 1===this.args.length}isBinary(){return 2===this.args.length}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!1);if(1===i.length){var o=vf(this,t),s=i[0].toString(e);a[0]&&(s="("+s+")");var u=/[a-zA-Z]+/.test(this.op);return"right"===o?this.op+(u?" ":"")+s:"left"===o?s+(u?" ":"")+this.op:s+this.op}if(2===i.length){var c=i[0].toString(e),l=i[1].toString(e);return(a[0]&&(c="("+c+")"),a[1]&&(l="("+l+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n)?c+" "+l:c+" "+this.op+" "+l}if(!(i.length>2)||"OperatorNode:add"!==this.getIdentifier()&&"OperatorNode:multiply"!==this.getIdentifier())return this.fn+"("+this.args.join(", ")+")";var p=i.map(function(t,r){return t=t.toString(e),a[r]&&(t="("+t+")"),t});return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?p.join(" "):p.join(" "+this.op+" ")}toJSON(){return{mathjs:vD,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new n(e.op,e.fn,e.args,e.implicit,e.isPercentage)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!1);if(1===i.length){var o=vf(this,t),s=i[0].toHTML(e);return(a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===o)?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+n5(this.op)+"</span>"+s:s+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+n5(this.op)+"</span>"}if(2===i.length){var u=i[0].toHTML(e),c=i[1].toHTML(e);return(a[0]&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n)?u+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:u+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+n5(this.op)+"</span>"+c}var l=i.map(function(t,r){return t=t.toHTML(e),a[r]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t});return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):l.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+n5(this.op)+"</span>"):'<span class="math-function">'+n5(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+l.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!0),o=vg[this.fn];if(o=void 0===o?this.op:o,1===i.length){var s=vf(this,t),u=i[0].toTex(e);return(a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===s)?o+u:u+o}if(2===i.length){var c,l=i[0],p=l.toTex(e);a[0]&&(p="\\left(".concat(p,"\\right)"));var f=i[1].toTex(e);switch(a[1]&&(f="\\left(".concat(f,"\\right)")),c="keep"===t?l.getIdentifier():l.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+p+"}{"+f+"}";case"OperatorNode:pow":switch(p="{"+p+"}",f="{"+f+"}",c){case"ConditionalNode":case"OperatorNode:divide":p="\\left(".concat(p,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return p+"~"+f}return p+o+f}if(!(i.length>2)||"OperatorNode:add"!==this.getIdentifier()&&"OperatorNode:multiply"!==this.getIdentifier())return"\\mathrm{"+this.fn+"}\\left("+i.map(function(t){return t.toTex(e)}).join(",")+"\\right)";var d=i.map(function(t,r){return t=t.toTex(e),a[r]&&(t="\\left(".concat(t,"\\right)")),t});return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===n?d.join("~"):d.join(o)}getIdentifier(){return this.type+":"+this.fn}}return fE(n,"name",vD),n},{isClass:!0,isNode:!0}),vw="ParenthesisNode",vA=tP(vw,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e){if(super(),!K(e))throw TypeError('Node expected for parameter "content"');this.content=e}get type(){return vw}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,"content",this)}map(e){return new r(e(this.content,"content",this))}clone(){return new r(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:vw,content:this.content}}static fromJSON(e){return new r(e.content)}_toHTML(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)}_toTex(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)}}return fE(r,"name",vw),r},{isClass:!0,isNode:!0}),vE="RelationalNode",vS=tP(vE,["Node"],e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(e,t){if(super(),!Array.isArray(e))throw TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}get type(){return vE}get isRelationalNode(){return!0}_compile(e,t){var r=this,n=this.params.map(r=>r._compile(e,t));return function(t,i,a){for(var s,u=n[0](t,i,a),c=0;c<r.conditionals.length;c++)if(s=u,u=n[c+1](t,i,a),!o(e,r.conditionals[c])(s,u))return!1;return!0}}forEach(e){this.params.forEach((t,r)=>e(t,"params["+r+"]",this),this)}map(e){return new n(this.conditionals.slice(),this.params.map((t,r)=>this._ifNode(e(t,"params["+r+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=vp(this,t,e&&e.implicit),i=this.params.map(function(r,i){var a=vp(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?"("+r.toString(e)+")":r.toString(e)}),a=i[0],o=0;o<this.conditionals.length;o++)a+=" "+r[this.conditionals[o]],a+=" "+i[o+1];return a}toJSON(){return{mathjs:vE,conditionals:this.conditionals,params:this.params}}static fromJSON(e){return new n(e.conditionals,e.params)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=vp(this,t,e&&e.implicit),i=this.params.map(function(r,i){var a=vp(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)}),a=i[0],o=0;o<this.conditionals.length;o++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+n5(r[this.conditionals[o]])+"</span>"+i[o+1];return a}_toTex(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=vp(this,t,e&&e.implicit),n=this.params.map(function(n,i){var a=vp(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)}),i=n[0],a=0;a<this.conditionals.length;a++)i+=vg[this.conditionals[a]]+n[a+1];return i}}return fE(n,"name",vE),n},{isClass:!0,isNode:!0}),vC="ArrayNode",vM=tP(vC,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(K))throw TypeError("Array containing Nodes expected")}get type(){return vC}get isArrayNode(){return!0}_compile(e,t){var r=id(this.items,function(r){return r._compile(e,t)});if("Array"===e.config.matrix)return function(e,t,n){return id(r,function(r){return r(e,t,n)})};var n=e.matrix;return function(e,t,i){return n(id(r,function(r){return r(e,t,i)}))}}forEach(e){for(var t=0;t<this.items.length;t++)e(this.items[t],"items["+t+"]",this)}map(e){for(var t=[],n=0;n<this.items.length;n++)t[n]=this._ifNode(e(this.items[n],"items["+n+"]",this));return new r(t)}clone(){return new r(this.items.slice(0))}_toString(e){return"["+this.items.map(function(t){return t.toString(e)}).join(", ")+"]"}toJSON(){return{mathjs:vC,items:this.items}}static fromJSON(e){return new r(e.items)}_toHTML(e){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map(function(t){return t.toHTML(e)}).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(e){return function t(r,n){var i=r.some($)&&!r.every($),a=n||i,o=r.map(function(r){return r.items?t(r.items,!n):r.toTex(e)}).join(a?"&":"\\\\");return i||!a||a&&!n?"\\begin{bmatrix}"+o+"\\end{bmatrix}":o}(this.items,!1)}}return fE(r,"name",vC),r},{isClass:!0,isNode:!0}),vF="BlockNode",vT=tP(vF,["ResultSet","Node"],e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(e){if(super(),!Array.isArray(e))throw Error("Array expected");this.blocks=e.map(function(e){var t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!K(t))throw TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw TypeError('Property "visible" must be a boolean');return{node:t,visible:r}})}get type(){return vF}get isBlockNode(){return!0}_compile(e,r){var n=id(this.blocks,function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}});return function(e,r,i){var a=[];return im(n,function(t){var n=t.evaluate(e,r,i);t.visible&&a.push(n)}),new t(a)}}forEach(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)}map(e){for(var t=[],r=0;r<this.blocks.length;r++){var i=this.blocks[r],a=this._ifNode(e(i.node,"blocks["+r+"].node",this));t[r]={node:a,visible:i.visible}}return new n(t)}clone(){return new n(this.blocks.map(function(e){return{node:e.node,visible:e.visible}}))}_toString(e){return this.blocks.map(function(t){return t.node.toString(e)+(t.visible?"":";")}).join("\n")}toJSON(){return{mathjs:vF,blocks:this.blocks}}static fromJSON(e){return new n(e.blocks)}_toHTML(e){return this.blocks.map(function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(e){return this.blocks.map(function(t){return t.node.toTex(e)+(t.visible?"":";")}).join("\\;\\;\n")}}return fE(n,"name",vF),n},{isClass:!0,isNode:!0}),vB="ConditionalNode",vO=tP(vB,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e,t,r){if(super(),!K(e))throw TypeError("Parameter condition must be a Node");if(!K(t))throw TypeError("Parameter trueExpr must be a Node");if(!K(r))throw TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}get type(){return vB}get isConditionalNode(){return!0}_compile(e,t){var r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return!function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(v(e))return!e.isZero();if(b(e))return!!(e.re||e.im);if(N(e))return!!e.value}if(null==e)return!1;throw TypeError('Unsupported type of condition "'+es(e)+'"')}(r(e,t,a))?i(e,t,a):n(e,t,a)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new r(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new r(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=vp(this,t,e&&e.implicit),n=this.condition.toString(e),i=vp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");var a=this.trueExpr.toString(e),o=vp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a="("+a+")");var s=this.falseExpr.toString(e),u=vp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s="("+s+")"),n+" ? "+a+" : "+s}toJSON(){return{mathjs:vB,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new r(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=vp(this,t,e&&e.implicit),n=this.condition.toHTML(e),i=vp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),o=vp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.falseExpr.toHTML(e),u=vp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+s}_toTex(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return fE(r,"name",vB),r},{isClass:!0,isNode:!0}),v_="RangeNode",vz=tP(v_,["Node"],e=>{var{Node:t}=e;function r(e,t,r){var n=vp(e,t,r),i={},a=vp(e.start,t,r);if(i.start=null!==a&&a<=n||"all"===t,e.step){var o=vp(e.step,t,r);i.step=null!==o&&o<=n||"all"===t}var s=vp(e.end,t,r);return i.end=null!==s&&s<=n||"all"===t,i}class n extends t{constructor(e,t,r){if(super(),!K(e)||!K(t)||r&&!K(r))throw TypeError("Node expected");if(arguments.length>3)throw Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}get type(){return v_}get isRangeNode(){return!0}needsEnd(){return this.filter(function(e){return ea(e)&&"end"===e.name}).length>0}_compile(e,t){var r=e.range,n=this.start._compile(e,t),i=this.end._compile(e,t);if(!this.step)return function(e,t,a){return r(n(e,t,a),i(e,t,a))};var a=this.step._compile(e,t);return function(e,t,o){return r(n(e,t,o),i(e,t,o),a(e,t,o))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toString(e);if(n.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),t+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),t+=":"+o}toJSON(){return{mathjs:v_,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new n(e.start,e.end,e.step)}_toHTML(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toHTML(e);if(n.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=i,this.step){var a=this.step.toHTML(e);n.step&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+a}var o=this.end.toHTML(e);return n.end&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+o}_toTex(e){var t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),n=this.start.toTex(e);if(t.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);t.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),n+=":"+a}}return fE(n,"name",v_),n},{isClass:!0,isNode:!0}),vq=tP("reviver",["classes"],e=>{var{classes:t}=e;return function(e,r){var n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}}),vI=tP("Chain",["?on","math","typed"],e=>{var{on:t,math:r,typed:n}=e;function i(e){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");eo(e)?this.value=e.value:this.value=e}function a(e,t){ep(i.prototype,e,function(){var e=t();if("function"==typeof e)return o(e)})}function o(e){return function(){if(0==arguments.length)return new i(e(this.value));for(var t=[this.value],r=0;r<arguments.length;r++)t[r+1]=arguments[r];if(n.isTypedFunction(e)){var a=n.resolve(e,t);if(1===a.params.length)throw Error("chain function "+e.name+" cannot match rest parameter between chain value and additional arguments.");return new i(a.implementation.apply(e,t))}return new i(e.apply(e,t))}}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return n2(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(e){return new i(e.value)},i.createProxy=function(e,t){if("string"==typeof e)"function"==typeof t&&(i.prototype[e]=o(t));else{var r=function(t){ef(e,t)&&void 0===s[t]&&a(t,()=>e[t])};for(var n in e)r(n)}};var s={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(e,t,r){r||a(e,t)}),i},{isClass:!0}),vk="FunctionAssignmentNode",vR=tP(vk,["typed","Node"],e=>{var{typed:t,Node:r}=e;function n(e,t,r){var n=vp(e,t,r),i=vp(e.expr,t,r);return"all"===t||null!==i&&i<=n}class i extends r{constructor(e,t,r){if(super(),"string"!=typeof e)throw TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw TypeError('Array containing strings or objects expected for parameter "params"');if(!K(r))throw TypeError('Node expected for parameter "expr"');if(vi.has(e))throw Error('Illegal function name, "'+e+'" is a reserved keyword');var n=new Set;for(var i of t){var a="string"==typeof i?i:i.name;if(n.has(a))throw Error('Duplicate parameter name "'.concat(a,'"'));n.add(a)}this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||"any"}),this.expr=r}get type(){return vk}get isFunctionAssignmentNode(){return!0}_compile(e,r){var n=Object.create(r);im(this.params,function(e){n[e]=!0});var i=this.expr,a=i._compile(e,n),o=this.name,s=this.params,u=iy(this.types,","),c=o+"("+iy(this.params,", ")+")";return function(e,r,n){var l={};l[u]=function(){for(var t=Object.create(r),i=0;i<s.length;i++)t[s[i]]=arguments[i];return a(e,t,n)};var p=t(o,l);return p.syntax=c,p.expr=i.toString(),e.set(o,p),p}}forEach(e){e(this.expr,"expr",this)}map(e){var t=this._ifNode(e(this.expr,"expr",this));return new i(this.name,this.params.slice(0),t)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toString(e);return n(this,t,e&&e.implicit)&&(r="("+r+")"),this.name+"("+this.params.join(", ")+") = "+r}toJSON(){var e=this.types;return{mathjs:vk,name:this.name,params:this.params.map(function(t,r){return{name:t,type:e[r]}}),expr:this.expr}}static fromJSON(e){return new i(e.name,e.params,e.expr)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=[],i=0;i<this.params.length;i++)r.push('<span class="math-symbol math-parameter">'+n5(this.params[i])+"</span>");var a=this.expr.toHTML(e);return n(this,t,e&&e.implicit)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+n5(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+r.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+a}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toTex(e);return n(this,t,e&&e.implicit)&&(r="\\left(".concat(r,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(vb).join(",")+"\\right)="+r}}return fE(i,"name",vk),i},{isClass:!0,isNode:!0}),vP="chain",vU=tP(vP,["typed","Chain"],e=>{var{typed:t,Chain:r}=e;return t(vP,{"":function(){return new r},any:function(e){return new r(e)}})}),vj="ConstantNode",vL=tP(vj,["Node","isBounded"],e=>{var{Node:t,isBounded:r}=e;class n extends t{constructor(e){super(),this.value=e}get type(){return vj}get isConstantNode(){return!0}_compile(e,t){var r=this.value;return function(){return r}}forEach(e){}map(e){return this.clone()}clone(){return new n(this.value)}_toString(e){return n2(this.value,e)}_toHTML(e){var t=this._toString(e);switch(es(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}}toJSON(){return{mathjs:vj,value:this.value}}static fromJSON(e){return new n(e.value)}_toTex(e){var t=this._toString(e);switch(es(this.value)){case"string":return"\\mathtt{"+vx(t)+"}";case"number":case"BigNumber":if(!r(this.value))return 0>this.value.valueOf()?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");if(-1!==n)return t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}";return t;case"bigint":return t.toString();case"Fraction":return this.value.toLatex();default:return t}}}return fE(n,"name",vj),n},{isClass:!0,isNode:!0}),vH="IndexNode",v$=tP(vH,["Node","size"],e=>{var{Node:t,size:r}=e;class n extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(K))throw TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw Error("dotNotation only applicable for object properties")}get type(){return vH}get isIndexNode(){return!0}_compile(e,t){var n=id(this.dimensions,function(n,i){if(!(n.filter(e=>e.isSymbolNode&&"end"===e.name).length>0))return n._compile(e,t);var a=Object.create(t);a.end=!0;var o=n._compile(e,a);return function(e,t,n){if(!E(n)&&!A(n)&&!w(n))throw TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+es(n));var a=r(n),s=Object.create(t);return s.end=a[i],o(e,s,n)}}),i=o(e,"index");return function(e,t,r){return i(...id(n,function(n){return n(e,t,r)}))}}forEach(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}map(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this._ifNode(e(this.dimensions[r],"dimensions["+r+"]",this));return new n(t,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return 1===this.dimensions.length&&W(this.dimensions[0])&&"string"==typeof this.dimensions[0].value}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:vH,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(e){return new n(e.dimensions,e.dotNotation)}_toHTML(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this.dimensions[r].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+n5(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(e){var t=this.dimensions.map(function(t){return t.toTex(e)});return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"}}return fE(n,"name",vH),n},{isClass:!0,isNode:!0});function vG(e){return e&&e.isIndexError?new n7(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function vZ(e){var{subset:t}=e;return function(e,r){try{if(Array.isArray(e))return t(e,r);if(e&&"function"==typeof e.subset)return e.subset(r);if("string"==typeof e)return t(e,r);else if("object"==typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return o(e,r.getObjectProperty())}else throw TypeError("Cannot apply index: unsupported type of object")}catch(e){throw vG(e)}}}var vV="AccessorNode",vW=tP(vV,["subset","Node"],e=>{var{subset:t,Node:r}=e,n=vZ({subset:t});function i(e){return!(H(e)||$(e)||W(e)||X(e)||ee(e)||er(e)||ea(e))}class a extends r{constructor(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(super(),!K(e))throw TypeError('Node expected for parameter "object"');if(!Y(t))throw TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=t,this.optionalChaining=r}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return vV}get isAccessorNode(){return!0}_compile(e,t){var r=this.object._compile(e,t),i=this.index._compile(e,t),a=this.optionalChaining,s=H(this.object)&&this.object.optionalChaining;if(!this.index.isObjectProperty())return function(e,t,o){var u=o||{},c=r(e,t,u);if(a&&null==c){u.optionalShortCircuit=!0;return}if(!s||null==u||!u.optionalShortCircuit){var l=i(e,t,c);return n(c,l)}};var u=this.index.getObjectProperty();return function(e,t,n){var i=n||{},c=r(e,t,i);if(a&&null==c){i.optionalShortCircuit=!0;return}if(!s||null==i||!i.optionalShortCircuit)return o(c,u)}}forEach(e){e(this.object,"object",this),e(this.index,"index",this)}map(e){return new a(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)),this.optionalChaining)}clone(){return new a(this.object,this.index,this.optionalChaining)}_toString(e){var t=this.object.toString(e);return i(this.object)&&(t="("+t+")"),t+(this.optionalChaining?this.index.dotNotation?"?":"?.":"")+this.index.toString(e)}_toHTML(e){var t=this.object.toHTML(e);return i(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)}_toTex(e){var t=this.object.toTex(e);return i(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}toJSON(){return{mathjs:vV,object:this.object,index:this.index,optionalChaining:this.optionalChaining}}static fromJSON(e){return new a(e.object,e.index,e.optionalChaining)}}return fE(a,"name",vV),a},{isClass:!0,isNode:!0}),vJ="AssignmentNode",vQ=tP(vJ,["subset","?matrix","Node"],e=>{var{subset:t,matrix:r,Node:n}=e,i=vZ({subset:t}),a=function(e){var{subset:t,matrix:r}=e;return function(e,n,i){try{if(Array.isArray(e))return r(e).subset(n,i).valueOf().forEach((t,r)=>{e[r]=t}),e;if(e&&"function"==typeof e.subset)return e.subset(n,i);if("string"==typeof e)return t(e,n,i);else if("object"==typeof e){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return s(e,n.getObjectProperty(),i),e}else throw TypeError("Cannot apply index: unsupported type of object")}catch(e){throw vG(e)}}}({subset:t,matrix:r});function u(e,t,r){t||(t="keep");var n=vp(e,t,r),i=vp(e.value,t,r);return"all"===t||null!==i&&i<=n}class c extends n{constructor(e,t,r){if(super(),this.object=e,this.index=r?t:null,this.value=r||t,!ea(e)&&!H(e))throw TypeError('SymbolNode or AccessorNode expected as "object"');if(ea(e)&&"end"===e.name)throw Error('Cannot assign to symbol "end"');if(this.index&&!Y(this.index))throw TypeError('IndexNode expected as "index"');if(!K(this.value))throw TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return vJ}get isAssignmentNode(){return!0}_compile(e,t){var r=this.object._compile(e,t),n=this.index?this.index._compile(e,t):null,u=this.value._compile(e,t),c=this.object.name;if(this.index)if(this.index.isObjectProperty()){var l=this.index.getObjectProperty();return function(e,t,n){var i=r(e,t,n),a=u(e,t,n);return s(i,l,a),a}}else{if(ea(this.object))return function(e,t,i){var o=r(e,t,i),s=u(e,t,i),l=n(e,t,o);return e.set(c,a(o,l,s)),s};var p=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var f=this.object.index.getObjectProperty();return function(e,t,r){var i=p(e,t,r),c=o(i,f),l=n(e,t,c),d=u(e,t,r);return s(i,f,a(c,l,d)),d}}var d=this.object.index._compile(e,t);return function(e,t,r){var o=p(e,t,r),s=d(e,t,o),c=i(o,s),l=n(e,t,c),f=u(e,t,r);return a(o,s,a(c,l,f)),f}}if(!ea(this.object))throw TypeError("SymbolNode expected as object");return function(e,t,r){var n=u(e,t,r);return e.set(c,n),n}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){return new c(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))}clone(){return new c(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):"",n=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),t+r+" = "+n}toJSON(){return{mathjs:vJ,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new c(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n='<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n}_toTex(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),t+r+"="+n}}return fE(c,"name",vJ),c},{isClass:!0,isNode:!0}),vX=tP("SymbolNode",["math","?Unit","Node"],e=>{var{math:t,Unit:r,Node:n}=e;function i(e){return!!r&&r.isValuelessUnit(e)}class a extends n{constructor(e){if(super(),"string"!=typeof e)throw TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,t){var n=this.name;if(!0===t[n])return function(e,t,r){return o(t,n)};if(n in e)return function(t,r,i){return t.has(n)?t.get(n):o(e,n)};var s=i(n);return function(e,t,i){return e.has(n)?e.get(n):s?new r(null,n):a.onUndefinedSymbol(n)}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw Error("Undefined symbol "+e)}clone(){return new a(this.name)}_toString(e){return this.name}_toHTML(e){var t=n5(this.name);if("true"===t||"false"===t)return'<span class="math-symbol math-boolean">'+t+"</span>";if("i"===t)return'<span class="math-symbol math-imaginary-symbol">'+t+"</span>";if("Infinity"===t)return'<span class="math-symbol math-infinity-symbol">'+t+"</span>";if("NaN"===t)return'<span class="math-symbol math-nan-symbol">'+t+"</span>";if("null"===t)return'<span class="math-symbol math-null-symbol">'+t+"</span>";else if("undefined"===t)return'<span class="math-symbol math-undefined-symbol">'+t+"</span>";return'<span class="math-symbol">'+t+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new a(e.name)}_toTex(e){var r=!1;void 0===t[this.name]&&i(this.name)&&(r=!0);var n=vb(this.name,r);return"\\"===n[0]?n:" "+n}}return a},{isClass:!0,isNode:!0}),vY="FunctionNode",vK=tP(vY,["math","Node","SymbolNode"],e=>{var{math:t,Node:r,SymbolNode:n}=e,i=e=>n2(e,{truncate:78});function a(e,t,r){for(var n,i="",a=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,o=0;null!==(n=a.exec(e));)if(i+=e.substring(o,n.index),o=n.index,"$$"===n[0])i+="$",o++;else{o+=n[0].length;var s=t[n[1]];if(!s)throw ReferenceError("Template: Property "+n[1]+" does not exist.");if(void 0===n[2])switch(typeof s){case"string":i+=s;break;case"object":if(K(s))i+=s.toTex(r);else if(Array.isArray(s))i+=s.map(function(e,t){if(K(e))return e.toTex(r);throw TypeError("Template: "+n[1]+"["+t+"] is not a Node.")}).join(",");else throw TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes");break;default:throw TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes")}else if(K(s[n[2]]&&s[n[2]]))i+=s[n[2]].toTex(r);else throw TypeError("Template: "+n[1]+"["+n[2]+"] is not a Node.")}return i+e.slice(o)}class s extends r{constructor(e,t,r){if(super(),"string"==typeof e&&(e=new n(e)),!K(e))throw TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(K))throw TypeError('Array containing Nodes expected for parameter "args"');var i=typeof r;if("undefined"!==i&&"boolean"!==i)throw TypeError("optional flag, if specified, must be boolean");this.fn=e,this.args=t||[],this.optional=!!r}get name(){return this.fn.name||""}get type(){return vY}get isFunctionNode(){return!0}_compile(e,t){var r=this.args.map(r=>r._compile(e,t)),n=this.optional||H(this.fn)&&this.fn.optionalChaining;if(ea(this.fn)){var a=this.fn.name;if(t[a]){var u=this.args;return function(t,s,c){var l=o(s,a);if(!n||void 0!==l){if("function"!=typeof l)throw TypeError("Argument '".concat(a,"' was not a function; received: ").concat(i(l)));if(l.rawArgs)return l(u,e,vu(t,s));var p=r.map(e=>e(t,s,c));return l.apply(l,p)}}}var l=a in e?o(e,a):void 0,p="function"==typeof l&&!0===l.rawArgs,f=t=>{var r;if(t.has(a))r=t.get(a);else if(a in e)r=o(e,a);else{if(!n)return s.onUndefinedFunction(a);r=void 0}if("function"==typeof r||n&&void 0===r)return r;throw TypeError("'".concat(a,"' is not a function; its value is:\n ").concat(i(r)))};if(p){var d=this.args;return function(t,n,i){var a=f(t);return!0===a.rawArgs?a(d,e,vu(t,n)):a(...r.map(e=>e(t,n,i)))}}switch(r.length){case 0:return function(e,t,r){var i=f(e);if(!n||void 0!==i)return i()};case 1:return function(e,t,i){var a=f(e);if(!n||void 0!==a)return a((0,r[0])(e,t,i))};case 2:return function(e,t,i){var a=f(e);if(!n||void 0!==a){var o=r[0],s=r[1];return a(o(e,t,i),s(e,t,i))}};default:return function(e,t,i){var a=f(e);if(!n||void 0!==a)return a(...r.map(r=>r(e,t,i)))}}}if(H(this.fn)&&Y(this.fn.index)&&this.fn.index.isObjectProperty()){var m=this.fn.object._compile(e,t),h=this.fn.index.getObjectProperty(),g=this.args;return function(t,i,a){var o=m(t,i,a);if(!n||null!=o&&void 0!==o[h]){var s=function(e,t){if(!c(e,t))throw Error('No access to method "'+t+'"');return e[t]}(o,h);if(null!=s&&s.rawArgs)return s(g,e,vu(t,i));var u=r.map(e=>e(t,i,a));return s.apply(o,u)}}}var y=this.fn.toString(),v=this.fn._compile(e,t),x=this.args;return function(t,a,o){var s=v(t,a,o);if(!n||void 0!==s){if("function"!=typeof s)throw TypeError("Expression '".concat(y,"' did not evaluate to a function; value is:")+"\n ".concat(i(s)));if(s.rawArgs)return s(x,e,vu(t,a));var u=r.map(e=>e(t,a,o));return s.apply(s,u)}}}forEach(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){for(var t=this._ifNode(e(this.fn,"fn",this)),r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new s(t,r)}clone(){return new s(this.fn,this.args.slice(0))}toString(e){var t,r=this.fn.toString(e);return(e&&"object"==typeof e.handler&&ef(e.handler,r)&&(t=e.handler[r](this,e)),void 0!==t)?t:super.toString(e)}_toString(e){var t=this.args.map(function(t){return t.toString(e)});return(Q(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}toJSON(){return{mathjs:vY,fn:this.fn,args:this.args}}_toHTML(e){var t=this.args.map(function(t){return t.toHTML(e)});return'<span class="math-function">'+n5(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(e){var t;return(e&&"object"==typeof e.handler&&ef(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t)?t:super.toTex(e)}_toTex(e){var r,n,i=this.args.map(function(t){return t.toTex(e)});switch(vy[this.name]&&(r=vy[this.name]),t[this.name]&&("function"==typeof t[this.name].toTex||"object"==typeof t[this.name].toTex||"string"==typeof t[this.name].toTex)&&(r=t[this.name].toTex),typeof r){case"function":n=r(this,e);break;case"string":n=a(r,this,e);break;case"object":switch(typeof r[i.length]){case"function":n=r[i.length](this,e);break;case"string":n=a(r[i.length],this,e)}}return void 0!==n?n:a("\\mathrm{${name}}\\left(${args}\\right)",this,e)}getIdentifier(){return this.type+":"+this.name}}return fE(s,"name",vY),fE(s,"onUndefinedFunction",function(e){throw Error("Undefined function "+e)}),fE(s,"fromJSON",function(e){return new s(e.fn,e.args)}),s},{isClass:!0,isNode:!0}),v0="parse",v1=tP(v0,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],e=>{var{typed:t,numeric:r,config:n,AccessorNode:a,ArrayNode:o,AssignmentNode:s,BlockNode:u,ConditionalNode:c,ConstantNode:l,FunctionAssignmentNode:p,FunctionNode:f,IndexNode:d,ObjectNode:m,OperatorNode:h,ParenthesisNode:g,RangeNode:y,RelationalNode:v,SymbolNode:x}=e,b=t(v0,{string:function(e){return I(e,{})},"Array | Matrix":function(e){return D(e,{})},"string, Object":function(e,t){return I(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":D});function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return ij(e,function(e){if("string"!=typeof e)throw TypeError("String expected");return I(e,r)})}var N={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"?.":!0,"??":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},w={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined},E=["NaN","Infinity"],S={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "};function C(e,t){return e.expression.substr(e.index,t)}function M(e){return C(e,1)}function F(e){e.index++}function T(e){return e.expression.charAt(e.index-1)}function B(e){return e.expression.charAt(e.index+1)}function O(e){for(e.tokenType=0,e.token="",e.comment="";;){if("#"===M(e))for(;"\n"!==M(e)&&""!==M(e);)e.comment+=M(e),F(e);if(b.isWhitespace(M(e),e.nestingLevel))F(e);else break}if(""===M(e)){e.tokenType=1;return}if("\n"===M(e)&&!e.nestingLevel){e.tokenType=1,e.token=M(e),F(e);return}var t=M(e),r=C(e,2),n=C(e,3);if(3===n.length&&N[n]){e.tokenType=1,e.token=n,F(e),F(e),F(e);return}if(2===r.length&&N[r]&&("?."!==r||!b.isDigit(e.expression.charAt(e.index+2)))){e.tokenType=1,e.token=r,F(e),F(e);return}if(N[t]){e.tokenType=1,e.token=t,F(e);return}if(b.isDigitDot(t)){e.tokenType=2;var i=C(e,2);if("0b"===i||"0o"===i||"0x"===i){for(e.token+=M(e),F(e),e.token+=M(e),F(e);b.isAlpha(M(e),T(e),B(e))||b.isDigit(M(e));)e.token+=M(e),F(e);if("."===M(e))for(e.token+=".",F(e);b.isAlpha(M(e),T(e),B(e))||b.isDigit(M(e));)e.token+=M(e),F(e);else if("i"===M(e))for(e.token+="i",F(e);b.isDigit(M(e));)e.token+=M(e),F(e);return}if("."===M(e)){if(e.token+=M(e),F(e),!b.isDigit(M(e))){e.tokenType=1;return}}else{for(;b.isDigit(M(e));)e.token+=M(e),F(e);b.isDecimalMark(M(e),B(e))&&(e.token+=M(e),F(e))}for(;b.isDigit(M(e));)e.token+=M(e),F(e);if("E"===M(e)||"e"===M(e)){if(b.isDigit(B(e))||"-"===B(e)||"+"===B(e)){if(e.token+=M(e),F(e),("+"===M(e)||"-"===M(e))&&(e.token+=M(e),F(e)),!b.isDigit(M(e)))throw el(e,'Digit expected, got "'+M(e)+'"');for(;b.isDigit(M(e));)e.token+=M(e),F(e);if(b.isDecimalMark(M(e),B(e)))throw el(e,'Digit expected, got "'+M(e)+'"')}else if(b.isDecimalMark(B(e),e.expression.charAt(e.index+2)))throw F(e),el(e,'Digit expected, got "'+M(e)+'"')}return}if(b.isAlpha(M(e),T(e),B(e))){for(;b.isAlpha(M(e),T(e),B(e))||b.isDigit(M(e));)e.token+=M(e),F(e);ef(w,e.token)?e.tokenType=1:e.tokenType=3;return}for(e.tokenType=4;""!==M(e);)e.token+=M(e),F(e);throw el(e,'Syntax error in part "'+e.token+'"')}function _(e){do O(e);while("\n"===e.token)}function z(e){e.nestingLevel++}function q(e){e.nestingLevel--}function I(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:0,nestingLevel:0,conditionalLevel:null};i(r,{expression:e,extraNodes:t}),O(r);var n=function(e){var t,r,n=[];for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=k(e),e.comment&&(t.comment=e.comment));"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),O(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=k(e),e.comment&&(t.comment=e.comment),r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new u(n):(!t&&(t=new l(void 0),e.comment&&(t.comment=e.comment)),t)}(r);if(""!==r.token)if(1===r.tokenType)throw ep(r,"Unexpected operator "+r.token);else throw el(r,'Unexpected part "'+r.token+'"');return n}function k(e){var t,r,n,i,a=function(e){for(var t=function(e){for(var t=R(e);"or"===e.token;)_(e),t=new h("or","or",[t,R(e)]);return t}(e);"?"===e.token;){var r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,_(e);var n=t,i=k(e);if(":"!==e.token)throw el(e,"False part of conditional expression expected");e.conditionalLevel=null,_(e),t=new c(n,i,k(e)),e.conditionalLevel=r}return t}(e);if("="===e.token){if(ea(a))return t=a.name,_(e),n=k(e),new s(new x(t),n);if(H(a)){if(a.optionalChaining)throw el(e,"Cannot assign to optional chain");return _(e),n=k(e),new s(a.object,a.index,n)}if(X(a)&&ea(a.fn)&&(i=!0,r=[],t=a.name,a.args.forEach(function(e,t){ea(e)?r[t]=e.name:i=!1}),i))return _(e),new p(t,r,n=k(e));throw el(e,"Invalid left hand side of assignment operator =")}return a}function R(e){for(var t=P(e);"xor"===e.token;)_(e),t=new h("xor","xor",[t,P(e)]);return t}function P(e){for(var t=U(e);"and"===e.token;)_(e),t=new h("and","and",[t,U(e)]);return t}function U(e){for(var t=j(e);"|"===e.token;)_(e),t=new h("|","bitOr",[t,j(e)]);return t}function j(e){for(var t=L(e);"^|"===e.token;)_(e),t=new h("^|","bitXor",[t,L(e)]);return t}function L(e){for(var t=$(e);"&"===e.token;)_(e),t=new h("&","bitAnd",[t,$(e)]);return t}function $(e){for(var t=[G(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};ef(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),_(e),t.push(G(e))}return 1===t.length?t[0]:2===t.length?new h(r[0].name,r[0].fn,t):new v(r.map(e=>e.fn),t)}function G(e){for(var t,r,n=Z(e),i={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};ef(i,e.token);)r=i[t=e.token],_(e),n=new h(t,r,[n,Z(e)]);return n}function Z(e){for(var t,r,n=V(e),i={to:"to",in:"to"};ef(i,e.token);)r=i[t=e.token],_(e),n="in"===t&&"])},;".includes(e.token)?new h("*","multiply",[n,new x("in")],!0):new h(t,r,[n,V(e)]);return n}function V(e){var t,r=[];if(t=":"===e.token?new l(1):Q(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)_(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new x("end")):r.push(Q(e));t=3===r.length?new y(r[0],r[2],r[1]):new y(r[0],r[1])}return t}function Q(e){for(var t,r,n,i=Y(e),a={"+":"add","-":"subtract"};ef(a,e.token);){r=a[t=e.token],_(e);var o=Y(e);n=o.isPercentage?[i,new h("*","multiply",[i,o])]:[i,o],i=new h(t,r,n)}return i}function Y(e){for(var t,r,n,i=t=K(e),a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};;)if(ef(a,e.token))n=a[r=e.token],_(e),t=new h(r,n,[t,K(e)]);else break;return t}function K(e){var t,r;for(r=t=ee(e);;)if(3===e.tokenType||"in"===e.token&&W(t)||"in"===e.token&&et(t)&&"unaryMinus"===t.fn&&W(t.args[0])||2===e.tokenType&&!W(r)&&(!et(r)||"!"===r.op)||"("===e.token)t=new h("*","multiply",[t,r=ee(e)],!0);else break;return t}function ee(e){for(var t=er(e),r=t,n=[];;)if("/"===e.token&&J(r))if(n.push(i({},e)),_(e),2===e.tokenType)if(n.push(i({},e)),_(e),3===e.tokenType||"("===e.token||"in"===e.token)i(e,n.pop()),n.pop(),t=new h("/","divide",[t,r=er(e)]);else{n.pop(),i(e,n.pop());break}else{i(e,n.pop());break}else break;return t}function er(e){var t=en(e);if("%"===e.token){var r=i({},e);_(e);try{en(e),i(e,r)}catch(e){t=new h("/","divide",[t,new l(100)],!1,!0)}}return t}function en(e){var t,r,n,i,a,o={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return ef(o,e.token)?(a=o[e.token],i=e.token,_(e),new h(i,a,[en(e)])):(r=function(e){for(var t=ei(e);"??"===e.token;)_(e),t=new h("??","nullish",[t,ei(e)]);return t}(t=e),("^"===t.token||".^"===t.token)&&(n=t.token,_(t),r=new h(n,"^"===n?"pow":"dotPow",[r,en(t)])),r)}function ei(e){for(var t,i,a=function(e){var t,i,a,s,u,c=[];if(3===e.tokenType&&ef(e.extraNodes,e.token)){var p=e.extraNodes[e.token];if(O(e),"("===e.token){if(c=[],z(e),O(e),")"!==e.token)for(c.push(k(e));","===e.token;)O(e),c.push(k(e));if(")"!==e.token)throw el(e,"Parenthesis ) expected");q(e),O(e)}return new p(c)}return 3===(t=e).tokenType||1===t.tokenType&&t.token in w?(a=t.token,O(t),eo(t,ef(A,a)?new l(A[a]):E.includes(a)?new l(r(a,"number")):new x(a))):'"'===(s=t).token||"'"===s.token?(u=new l(es(s,s.token)),u=eo(s,u)):function(e){if("["===e.token){if(z(e),O(e),"]"!==e.token){var t=eu(e);if(";"===e.token){for(c=1,u=[t];";"===e.token;)O(e),"]"!==e.token&&(u[c]=eu(e),c++);if("]"!==e.token)throw el(e,"End of matrix ] expected");q(e),O(e),p=u[0].items.length;for(var i=1;i<c;i++)if(u[i].items.length!==p)throw ep(e,"Column dimensions mismatch ("+u[i].items.length+" !== "+p+")");s=new o(u)}else{if("]"!==e.token)throw el(e,"End of matrix ] expected");q(e),O(e),s=t}}else q(e),O(e),s=new o([]);return eo(e,s)}var a=e;if("{"===a.token){z(a);var s,u,c,p,f,d={};do if(O(a),"}"!==a.token){if('"'===a.token||"'"===a.token)f=es(a,a.token);else if(3===a.tokenType||1===a.tokenType&&a.token in w)f=a.token,O(a);else throw el(a,"Symbol or string expected as object key");if(":"!==a.token)throw el(a,"Colon : expected after object key");O(a),d[f]=k(a)}while(","===a.token);if("}"!==a.token)throw el(a,"Comma , or bracket } expected after object value");q(a),O(a);var h=new m(d);return eo(a,h)}return function(e){if(2===e.tokenType){t=e.token,O(e);var t,i,a=tY(t,n);return new l(r(t,a))}var o=e;if("("===o.token){if(z(o),O(o),i=k(o),")"!==o.token)throw el(o,"Parenthesis ) expected");return q(o),O(o),i=eo(o,i=new g(i))}var s=o;if(""===s.token)throw el(s,"Unexpected end of expression");throw el(s,"Value expected")}(a)}(s)}(e),s={"!":"factorial","'":"ctranspose"};ef(s,e.token);)i=s[t=e.token],O(e),a=eo(e,a=new h(t,i,[a]));return a}function eo(e,t,r){for(var n;;){var i=!1;"?."===e.token&&(i=!0,O(e));var o=("("===e.token||"["===e.token||"."===e.token)&&(!r||r.includes(e.token));if(!(i||o))break;if(n=[],"("===e.token)if(i||ea(t)||H(t)){if(z(e),O(e),")"!==e.token)for(n.push(k(e));","===e.token;)O(e),n.push(k(e));if(")"!==e.token)throw el(e,"Parenthesis ) expected");q(e),O(e),t=new f(t,n,i)}else break;else if("["===e.token){if(z(e),O(e),"]"!==e.token)for(n.push(k(e));","===e.token;)O(e),n.push(k(e));if("]"!==e.token)throw el(e,"Parenthesis ] expected");q(e),O(e),t=new a(t,new d(n),i)}else{if(i||O(e),!(3===e.tokenType||1===e.tokenType&&e.token in w)){var s="Property name expected after ";throw el(e,s+=i?"optional chain":"dot")}n.push(new l(e.token)),O(e),t=new a(t,new d(n,!0),i)}}return t}function es(e,t){for(var r="";""!==M(e)&&M(e)!==t;)if("\\"===M(e)){F(e);var n=M(e),i=S[n];if(void 0!==i)r+=i,e.index+=1;else if("u"===n){var a=e.expression.slice(e.index+1,e.index+5);if(/^[0-9A-Fa-f]{4}$/.test(a))r+=String.fromCharCode(parseInt(a,16)),e.index+=5;else throw el(e,"Invalid unicode character \\u".concat(a))}else throw el(e,"Bad escape character \\".concat(n))}else r+=M(e),F(e);if(O(e),e.token!==t)throw el(e,"End of string ".concat(t," expected"));return O(e),r}function eu(e){for(var t=[k(e)],r=1;","===e.token;)O(e),"]"!==e.token&&";"!==e.token&&(t[r]=k(e),r++);return new o(t)}function ec(e){return e.index-e.token.length+1}function el(e,t){var r=ec(e),n=SyntaxError(t+" (char "+r+")");return n.char=r,n}function ep(e,t){var r=ec(e),n=SyntaxError(t+" (char "+r+")");return n.char=r,n}return b.isAlpha=function(e,t,r){return b.isValidLatinOrGreek(e)||b.isValidMathSymbol(e,r)||b.isValidMathSymbol(t,e)},b.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},b.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},b.isWhitespace=function(e,t){return" "===e||" "===e||"\xa0"===e||"\n"===e&&t>0},b.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},b.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},b.isDigit=function(e){return e>="0"&&e<="9"},t.addConversion({from:"string",to:"Node",convert:b}),b}),v2=tP("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function s(e,t){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if(ea(e)){if(u.has(e.name)){var c=Array.from(u).join(", ");throw ReferenceError("recursive loop of variable definitions among {".concat(c,"}"))}var l=t.get(e.name);if(K(l)){var p=new Set(u);return p.add(e.name),s(l,t,p)}return"number"==typeof l?r(String(l)):void 0!==l?new n(l):e}if(et(e)){var f=e.args.map(function(e){return s(e,t,u)});return new a(e.op,e.fn,f,e.implicit)}if(er(e))return new o(s(e.content,t,u));if(X(e)){var d=e.args.map(function(e){return s(e,t,u)});return new i(e.name,d)}return e.map(e=>s(e,t,u))}return t("resolve",{Node:s,"Node, Map | null | undefined":s,"Node, Object":(e,t)=>s(e,g(t)),"Array | Matrix":t.referToSelf(e=>t=>t.map(t=>e(t))),"Array | Matrix, null | undefined":t.referToSelf(e=>t=>t.map(t=>e(t))),"Array, Object":t.referTo("Array,Map",e=>(t,r)=>e(t,g(r))),"Matrix, Object":t.referTo("Matrix,Map",e=>(t,r)=>e(t,g(r))),"Array | Matrix, Map":t.referToSelf(e=>(t,r)=>t.map(t=>e(t,r)))})});function v3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v4(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v3(Object(r),!0).forEach(function(t){fE(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v3(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var v5=tP("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],e=>{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i="defaultF",a={add:{trivial:!0,total:!0,commutative:!0,associative:!0},unaryPlus:{trivial:!0,total:!0,commutative:!0,associative:!0},subtract:{trivial:!1,total:!0,commutative:!1,associative:!1},multiply:{trivial:!0,total:!0,commutative:!0,associative:!0},divide:{trivial:!1,total:!0,commutative:!1,associative:!1},paren:{trivial:!0,total:!0,commutative:!0,associative:!1},defaultF:{trivial:!1,total:!0,commutative:!1,associative:!1}};function o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,n=i;if("string"==typeof e?n=e:et(e)?n=e.fn.toString():X(e)?n=e.name:er(e)&&(n="paren"),ef(r,n)){var o=r[n];if(ef(o,t))return o[t];if(ef(a,n))return a[n][t]}if(ef(r,i)){var s=r[i];return ef(s,t)?s[t]:a[i][t]}if(ef(a,n)){var u=a[n];if(ef(u,t))return u[t]}return a[i][t]}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return o(e,"associative",t)}function u(e,t){var r,n=[],i=function(e){for(var t=0;t<e.args.length;t++){var a=e.args[t];et(a)&&r===a.op?i(a):n.push(a)}};return s(e,t)?(r=e.op,i(e),n):e.args}function c(e){return et(e)?function(t){try{return new r(e.op,e.fn,t,e.implicit)}catch(e){return console.error(e),[]}}:function(r){return new t(new n(e.name),r)}}return{createMakeNodeFunction:c,hasProperty:o,isCommutative:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return o(e,"commutative",t)},isAssociative:s,mergeContext:function(e,t){var r=v4({},e);for(var n in t)ef(e,n)?r[n]=v4(v4({},t[n]),e[n]):r[n]=t[n];return r},flatten:function e(t,r){if(!t.args||0===t.args.length)return t;t.args=u(t,r);for(var n=0;n<t.args.length;n++)e(t.args[n],r)},allChildren:u,unflattenr:function e(t,r){if(t.args&&0!==t.args.length){for(var n=c(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(i>2&&s(t,r)){for(var o=t.args.pop();t.args.length>0;)o=n([t.args.pop(),o]);t.args=o.args}}},unflattenl:function e(t,r){if(t.args&&0!==t.args.length){for(var n=c(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(i>2&&s(t,r)){for(var o=t.args.shift();t.args.length>0;)o=n([o,t.args.shift()]);t.args=o.args}}},defaultContext:a,realContext:{divide:{total:!1},log:{total:!1}},positiveContext:{subtract:{total:!1},abs:{trivial:!0},log:{total:!0}}}}),v8=tP("simplifyConstant",["typed","config","mathWithTransform","matrix","isBounded","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],e=>{var{typed:t,config:r,mathWithTransform:n,matrix:i,isBounded:a,fraction:o,bignumber:s,AccessorNode:u,ArrayNode:c,ConstantNode:l,FunctionNode:p,IndexNode:f,ObjectNode:d,OperatorNode:m,SymbolNode:h}=e,{isCommutative:g,isAssociative:y,allChildren:v,createMakeNodeFunction:x}=v5({FunctionNode:p,OperatorNode:m,SymbolNode:h}),b=t("simplifyConstant",{Node:e=>A(T(e,{})),"Node, Object":function(e,t){return A(T(e,t))}});function N(e,t,r){try{return n[e].apply(null,t)}catch(a){return t=t.map(function e(t){return D(t)?t.valueOf():t instanceof Array?t.map(e):E(t)?i(e(t.valueOf())):t}),C(n[e].apply(null,t),r)}}var w=t({Fraction:function(e){var t=e=>"BigNumber"===r.number&&s?s(e):Number(e),n=e.s*e.n,i=n<0n?new m("-","unaryMinus",[new l(-t(n))]):new l(t(n));return 1n===e.d?i:new m("/","divide",[i,new l(t(e.d))])},number:function(e){return e<0?M(new l(-e)):new l(e)},BigNumber:function(e){return e<0?M(new l(-e)):new l(e)},bigint:function(e){return e<0n?M(new l(-e)):new l(e)},Complex:function(e){throw Error("Cannot convert Complex number to Node")},string:function(e){return new l(e)},Matrix:function(e){return new c(e.valueOf().map(e=>w(e)))}});function A(e){return K(e)?e:w(e)}function S(e,t){if(t&&!1!==t.exactFractions&&a(e)&&o){var r=o(e),n=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n<n&&r.d<n)return r}return e}var C=t({"string, Object":function(e,t){var n=tY(e,r);return"BigNumber"===n?(void 0===s&&u3(),s(e)):"bigint"===n?BigInt(e):"Fraction"===n?(void 0===o&&u4(),o(e)):S(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return S(e,t)},"bigint, Object":function(e,t){return e},"Complex, Object":function(e,t){return 0!==e.im?e:S(e.re,t)},"Matrix, Object":function(e,t){return i(S(e.valueOf()))},"Array, Object":function(e,t){return e.map(S)}});function M(e){return new m("-","unaryMinus",[e])}function F(e,t,r,n){var i=t.shift(),a=t.reduce((t,i)=>{if(!K(i)){var a=t.pop();if(K(a))return[a,i];try{return t.push(N(e,[a,i],n)),t}catch(e){t.push(a)}}t.push(A(t.pop()));var o=1===t.length?t[0]:r(t);return[r([o,A(i)])]},[i]);return 1===a.length?a[0]:r([a[0],w(a[1])])}function T(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":case"bigint":return C(e.value,t);case"string":return e.value;default:if(!isNaN(e.value))return C(e.value,t)}return e;case"FunctionNode":if(n[e.name]&&n[e.name].rawArgs)return e;if(!["add","multiply"].includes(e.name)){var r=e.args.map(e=>T(e,t));if(!r.some(K))try{return N(e.name,r,t)}catch(e){}if("size"===e.name&&1===r.length&&$(r[0])){for(var a=[],o=r[0];$(o);)a.push(o.items.length),o=o.items[0];return i(a)}return new p(e.name,r.map(A))}case"OperatorNode":var s,m,h=e.fn.toString(),D=x(e);if(et(e)&&e.isUnary())m=K((s=[T(e.args[0],t)])[0])?D(s):N(h,s,t);else if(y(e,t.context))if(s=(s=v(e,t.context)).map(e=>T(e,t)),g(h,t.context)){for(var w=[],S=[],M=0;M<s.length;M++)K(s[M])?S.push(s[M]):w.push(s[M]);w.length>1?(m=F(h,w,D,t),S.unshift(m),m=F(h,S,D,t)):m=F(h,s,D,t)}else m=F(h,s,D,t);else m=F(h,s=e.args.map(e=>T(e,t)),D,t);return m;case"ParenthesisNode":return T(e.content,t);case"AccessorNode":return function(e,t,r){if(!Y(t))return new u(A(e),A(t));if($(e)||E(e)){for(var n=Array.from(t.dimensions);n.length>0;)if(W(n[0])&&"string"!=typeof n[0].value){var a=C(n.shift().value,r);$(e)?e=e.items[a-1]:(e=e.valueOf()[a-1])instanceof Array&&(e=i(e))}else if(n.length>1&&W(n[1])&&"string"!=typeof n[1].value){var o=C(n[1].value,r),s=[],p=$(e)?e.items:e.valueOf();for(var d of p)if($(d))s.push(d.items[o-1]);else if(E(e))s.push(d[o-1]);else break;if(s.length===p.length)e=$(e)?new c(s):i(s),n.splice(1,1);else break}else break;return n.length===t.dimensions.length?new u(A(e),t):n.length>0?(t=new f(n),new u(A(e),t)):e}if(ee(e)&&1===t.dimensions.length&&W(t.dimensions[0])){var m=t.dimensions[0].value;return m in e.properties?e.properties[m]:new l}return new u(A(e),t)}(T(e.object,t),T(e.index,t),t);case"ArrayNode":var B=e.items.map(e=>T(e,t));if(B.some(K))return new c(B.map(A));return i(B);case"IndexNode":return new f(e.dimensions.map(e=>b(e,t)));case"ObjectNode":var O={};for(var _ in e.properties)O[_]=b(e.properties[_],t);return new d(O);default:throw Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return b}),v6="compile",v7=tP(v6,["typed","parse"],e=>{var{typed:t,parse:r}=e;return t(v6,{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return ij(e,function(e){return r(e).compile()})}})}),v9="leafCount",xe=tP(v9,["parse","typed"],e=>{var{parse:t,typed:r}=e;return r(v9,{Node:function(e){return function e(t){var r=0;return t.forEach(t=>{r+=e(t)}),r||1}(e)}})}),xt="simplifyCore",xr=tP(xt,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],e=>{var{typed:t,parse:r,equal:n,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,AccessorNode:l,ArrayNode:p,ConstantNode:f,FunctionNode:d,IndexNode:m,ObjectNode:h,OperatorNode:g,ParenthesisNode:y,SymbolNode:v}=e,x=new f(0),b=new f(1),D=new f(!0),N=new f(!1);function w(e){return et(e)&&["and","not","or"].includes(e.op)}var{hasProperty:A,isCommutative:E}=v5({FunctionNode:d,OperatorNode:g,SymbolNode:v});function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t?t.context:void 0;if(A(e,"trivial",r)){if(X(e)&&1===e.args.length)return S(e.args[0],t);var a=!1,o=0;if(e.forEach(e=>{1==++o&&(a=S(e,t))}),1===o)return a}var s=e;if(X(s)){var u=function(e){var t="OperatorNode:"+e;for(var r of vc)if(t in r)return r[t].op;return null}(s.name);if(!u)return new d(S(s.fn),s.args.map(e=>S(e,t)));if(s.args.length>2&&A(s,"associative",r))for(;s.args.length>2;){var c=s.args.pop(),f=s.args.pop();s.args.push(new g(u,s.name,[c,f]))}s=new g(u,s.name,s.args)}if(et(s)&&s.isUnary()){var y=S(s.args[0],t);if("~"===s.op&&et(y)&&y.isUnary()&&"~"===y.op||"not"===s.op&&et(y)&&y.isUnary()&&"not"===y.op&&w(y.args[0]))return y.args[0];var v=!0;if("-"===s.op&&et(y)&&(y.isBinary()&&"subtract"===y.fn&&(s=new g("-","subtract",[y.args[1],y.args[0]]),v=!1),y.isUnary()&&"-"===y.op))return y.args[0];if(v)return new g(s.op,s.fn,[y])}if(et(s)&&s.isBinary()){var C=S(s.args[0],t),M=S(s.args[1],t);if("+"===s.op){if(W(C)&&i(C.value))return M;if(W(M)&&i(M.value))return C;et(M)&&M.isUnary()&&"-"===M.op&&(s=new g("-","subtract",[C,M=M.args[0]]))}if("-"===s.op)return et(M)&&M.isUnary()&&"-"===M.op?S(new g("+","add",[C,M.args[0]]),t):W(C)&&i(C.value)?S(new g("-","unaryMinus",[M])):W(M)&&i(M.value)?C:new g(s.op,s.fn,[C,M]);if("*"===s.op){if(W(C)){if(i(C.value))return x;else if(n(C.value,1))return M}if(W(M)){if(i(M.value))return x;if(n(M.value,1))return C;if(E(s,r))return new g(s.op,s.fn,[M,C],s.implicit)}return new g(s.op,s.fn,[C,M],s.implicit)}if("/"===s.op)return W(C)&&i(C.value)?x:W(M)&&n(M.value,1)?C:new g(s.op,s.fn,[C,M]);if("^"===s.op&&W(M)){if(i(M.value))return b;else if(n(M.value,1))return C}if("and"===s.op){if(W(C))if(!C.value)return N;else{if(w(M))return M;if(W(M))return M.value?D:N}if(W(M)){if(!M.value)return N;else if(w(C))return C}}if("or"===s.op){if(W(C)){if(C.value)return D;else if(w(M))return M}if(W(M)){if(M.value)return D;else if(w(C))return C}}return new g(s.op,s.fn,[C,M])}if(et(s))return new g(s.op,s.fn,s.args.map(e=>S(e,t)));if($(s))return new p(s.items.map(e=>S(e,t)));if(H(s))return new l(S(s.object,t),S(s.index,t));if(Y(s))return new m(s.dimensions.map(e=>S(e,t)));if(ee(s)){var F={};for(var T in s.properties)F[T]=S(s.properties[T],t);return new h(F)}return s}return t(xt,{Node:S,"Node,Object":S})}),xn="evaluate",xi=tP(xn,["typed","parse"],e=>{var{typed:t,parse:r}=e;return t(xn,{string:function(e){var t=h();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=h();return ij(e,function(e){return r(e).compile().evaluate(t)})},"Array | Matrix, Map | Object":function(e,t){return ij(e,function(e){return r(e).compile().evaluate(t)})}})}),xa=tP("Help",["evaluate"],e=>{var{evaluate:t}=e;function r(e){if(!(this instanceof r))throw SyntaxError("Constructor must be called with the new operator");if(!e)throw Error('Argument "doc" missing');this.doc=e}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var e=this.doc||{},r="\n";if(e.name&&(r+="Name: "+e.name+"\n\n"),e.category&&(r+="Category: "+e.category+"\n\n"),e.description&&(r+="Description:\n "+e.description+"\n\n"),e.syntax&&(r+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){r+="Examples:\n";for(var n=!1,i=t("config()"),a={config:e=>(n=!0,t("config(newConfig)",{newConfig:e}))},o=0;o<e.examples.length;o++){var s=e.examples[o];r+=" "+s+"\n";var u=void 0;try{u=t(s,a)}catch(e){u=e}void 0===u||_(u)||(r+=" "+n2(u,{precision:14})+"\n")}r+="\n",n&&t("config(originalConfig)",{originalConfig:i})}return e.mayThrow&&e.mayThrow.length&&(r+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(r+="See also: "+e.seealso.join(", ")+"\n"),r},r.prototype.toJSON=function(){var e=eu(this.doc);return e.mathjs="Help",e},r.fromJSON=function(e){var t={};return Object.keys(e).filter(e=>"mathjs"!==e).forEach(r=>{t[r]=e[r]}),new r(t)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),xo=tP("Parser",["evaluate","parse"],e=>{var{evaluate:t,parse:r}=e;function n(){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:h(),writable:!1})}return n.prototype.type="Parser",n.prototype.isParser=!0,n.prototype.evaluate=function(e){return t(e,this.scope)},n.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},n.prototype.getAll=function(){var e=this.scope;if(e instanceof f)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);s(t,r,n)}return t},n.prototype.getAllAsMap=function(){return this.scope},n.prototype.set=function(e,t){if(!function(e){if(0===e.length)return!1;for(var t=0;t<e.length;t++){var n=e.charAt(t-1),i=e.charAt(t),a=e.charAt(t+1);if(!(r.isAlpha(i,n,a)||t>0&&r.isDigit(i)))return!1}return!0}(e))throw Error("Invalid variable name: '".concat(e,"'. Variable names must follow the specified rules."));return this.scope.set(e,t),t},n.prototype.remove=function(e){this.scope.delete(e)},n.prototype.clear=function(){this.scope.clear()},n.prototype.toJSON=function(){var e,t={mathjs:"Parser",variables:{},functions:{}};for(var[r,n]of this.scope)if(z(n)){if("function"!=typeof(e=n)||"string"!=typeof e.syntax||"string"!=typeof e.expr)throw Error("Cannot serialize external function ".concat(r));t.functions[r]="".concat(n.syntax," = ").concat(n.expr)}else t.variables[r]=n;return t},n.fromJSON=function(e){var t=new n;return Object.entries(e.variables).forEach(e=>{var[r,n]=e;return t.set(r,n)}),Object.entries(e.functions).forEach(e=>{var[r,n]=e;return t.evaluate(n)}),t},n},{isClass:!0}),xs="parser",xu=tP(xs,["typed","Parser"],e=>{var{typed:t,Parser:r}=e;return t(xs,{"":function(){return new r}})});function xc(e){return W(e)||et(e)&&e.isUnary()&&W(e.args[0])}function xl(e){return!!(W(e)||(X(e)||et(e))&&e.args.every(xl)||er(e)&&xl(e.content))}var xp=tP("simplify",["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],e=>{var{typed:t,parse:r,equal:n,resolve:i,simplifyConstant:a,simplifyCore:o,AccessorNode:s,ArrayNode:u,ConstantNode:c,FunctionNode:l,IndexNode:p,ObjectNode:f,OperatorNode:d,ParenthesisNode:m,SymbolNode:y,replacer:v}=e,{hasProperty:x,isCommutative:b,isAssociative:D,mergeContext:N,flatten:w,unflattenr:A,unflattenl:E,createMakeNodeFunction:S,defaultContext:C,realContext:M,positiveContext:F}=v5({FunctionNode:l,OperatorNode:d,SymbolNode:y});t.addConversion({from:"Object",to:"Map",convert:g});var T=t("simplify",{Node:q,"Node, Map":(e,t)=>q(e,!1,t),"Node, Map, Object":(e,t,r)=>q(e,!1,t,r),"Node, Array":q,"Node, Array, Map":q,"Node, Array, Map, Object":q});function B(e){return e.transform(function(e){return er(e)?B(e.content):e})}t.removeConversion({from:"Object",to:"Map",convert:g}),T.defaultContext=C,T.realContext=M,T.positiveContext=F;var O={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};T.rules=[o,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},a,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},a,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];var _=0;function z(){return new y("_p"+_++)}function q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h(),a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=a.consoleDebug;t=function(e,t){for(var n=[],i=0;i<e.length;i++){var a=e[i],o=void 0,s=typeof a;switch(s){case"string":a={s:a};case"object":o=function(e,t){var n={};if(e.s){var i=e.s.split("->");if(2===i.length)n.l=i[0],n.r=i[1];else throw SyntaxError("Could not parse rule: "+e.s)}else n.l=e.l,n.r=e.r;for(var a of(n.l=B(r(n.l)),n.r=B(r(n.r)),["imposeContext","repeat","assuming"]))a in e&&(n[a]=e[a]);if(e.evaluate&&(n.evaluate=r(e.evaluate)),D(n.l,t)){var o,s=!b(n.l,t);s&&(o=z());var u=S(n.l),c=z();n.expanded={},n.expanded.l=u([n.l,c]),w(n.expanded.l,t),A(n.expanded.l,t),n.expanded.r=u([n.r,c]),s&&(n.expandedNC1={},n.expandedNC1.l=u([o,n.l]),n.expandedNC1.r=u([o,n.r]),n.expandedNC2={},n.expandedNC2.l=u([o,n.expanded.l]),n.expandedNC2.r=u([o,n.expanded.r]))}return n}(a,t);break;case"function":o=a;break;default:throw TypeError("Unsupported type of rule: "+s)}n.push(o)}return n}(t||T.rules,a.context);var s=i(e,n);s=B(s);for(var u={},c=s.toString({parenthesis:"all"});!u[c];){u[c]=!0,_=0;var l=c;o&&console.log("Working on: ",c);for(var p=0;p<t.length;p++){var f="";if("function"==typeof t[p]?(s=t[p](s,a),o&&(f=t[p].name)):(w(s,a.context),s=k(s,t[p],a.context),o&&(f="".concat(t[p].l.toString()," -> ").concat(t[p].r.toString()))),o){var d=s.toString({parenthesis:"all"});d!==l&&(console.log("Applying",f,"produced",d),l=d)}E(s,a.context)}c=s.toString({parenthesis:"all"})}return s}function I(e,t,r){var n=e;if(e)for(var i=0;i<e.length;++i){var a=k(e[i],t,r);a!==e[i]&&(n===e&&(n=e.slice()),n[i]=a)}return n}function k(e,t,r){if(t.assuming){for(var n in t.assuming)for(var i in t.assuming[n])if(x(n,i,r)!==t.assuming[n][i])return e}var a=N(t.imposeContext,r),o=e;if(o instanceof d||o instanceof l){var c=I(o.args,t,r);c!==o.args&&((o=o.clone()).args=c)}else if(o instanceof m){if(o.content){var h=k(o.content,t,r);h!==o.content&&(o=new m(h))}}else if(o instanceof u){var g=I(o.items,t,r);g!==o.items&&(o=new u(g))}else if(o instanceof s){var y=o.object;o.object&&(y=k(o.object,t,r));var v=o.index;o.index&&(v=k(o.index,t,r)),(y!==o.object||v!==o.index)&&(o=new s(y,v))}else if(o instanceof p){var b=I(o.dimensions,t,r);b!==o.dimensions&&(o=new p(b))}else if(o instanceof f){var D=!1,w={};for(var A in o.properties)w[A]=k(o.properties[A],t,r),w[A]!==o.properties[A]&&(D=!0);D&&(o=new f(w))}var E=t.r,S=P(t.l,o,a)[0];if(!S&&t.expanded&&(E=t.expanded.r,S=P(t.expanded.l,o,a)[0]),!S&&t.expandedNC1&&(E=t.expandedNC1.r,(S=P(t.expandedNC1.l,o,a)[0])||(E=t.expandedNC2.r,S=P(t.expandedNC2.l,o,a)[0])),S){var C=o.implicit;o=E.clone(),C&&"implicit"in E&&(o.implicit=!0),o=o.transform(function(e){return e.isSymbolNode&&ef(S.placeholders,e.name)?S.placeholders[e.name].clone():e})}return t.repeat&&o!==e&&(o=k(o,t,r)),o}function R(e,t){var r,i=[];if(0===e.length||0===t.length)return i;for(var a=0;a<e.length;a++)for(var o=0;o<t.length;o++)(r=function(e,t){var r={placeholders:{}};if(!e.placeholders&&!t.placeholders)return r;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var i in e.placeholders)if(ef(e.placeholders,i)&&(r.placeholders[i]=e.placeholders[i],ef(t.placeholders,i)&&!function e(t,r){if(t instanceof c&&r instanceof c){if(!n(t.value,r.value))return!1}else if(t instanceof y&&r instanceof y){if(t.name!==r.name)return!1}else{if((!(t instanceof d)||!(r instanceof d))&&(!(t instanceof l)||!(r instanceof l)))return!1;if(t instanceof d){if(t.op!==r.op||t.fn!==r.fn)return!1}else if(t instanceof l&&t.name!==r.name)return!1;if(t.args.length!==r.args.length)return!1;for(var i=0;i<t.args.length;i++)if(!e(t.args[i],r.args[i]))return!1}return!0}(e.placeholders[i],t.placeholders[i])))return null;for(var a in t.placeholders)ef(t.placeholders,a)&&(r.placeholders[a]=t.placeholders[a]);return r}(e[a],t[o]))&&i.push(r);return i}function P(e,t,r,i){var a=[{placeholders:{}}];if(e instanceof d&&t instanceof d||e instanceof l&&t instanceof l){if(e instanceof d){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof l&&e.name!==t.name)return[];if(1===t.args.length&&1===e.args.length||!D(t,r)&&t.args.length===e.args.length||i){for(var o=[],s=0;s<e.args.length;s++){var u=P(e.args[s],t.args[s],r);if(0===u.length)break;o.push(u)}if(o.length!==e.args.length){if(!b(t,r)||1===e.args.length)return[];if(e.args.length>2)throw Error("permuting >2 commutative non-associative rule arguments not yet implemented");var p=P(e.args[0],t.args[1],r);if(0===p.length)return[];var f=P(e.args[1],t.args[0],r);if(0===f.length)return[];o=[p,f]}a=function(e){if(0===e.length)return e;for(var t=e.reduce(R),r=[],n={},i=0;i<t.length;i++){var a=JSON.stringify(t[i],v);n[a]||(n[a]=!0,r.push(t[i]))}return r}(o)}else if(t.args.length>=2&&2===e.args.length){for(var m=function(e,t){var r,n,i=[],a=S(e);if(b(e,t))for(var o=0;o<e.args.length;o++)(n=e.args.slice(0)).splice(o,1),r=1===n.length?n[0]:a(n),i.push(a([e.args[o],r]));else for(var s=1;s<e.args.length;s++){var u=e.args[0];s>1&&(u=a(e.args.slice(0,s))),r=1===(n=e.args.slice(s)).length?n[0]:a(n),i.push(a([u,r]))}return i}(t,r),h=[],g=0;g<m.length;g++){var x=P(e,m[g],r,!0);h=h.concat(x)}return h}else if(!(e.args.length>2))return[];else throw Error("Unexpected non-binary associative function: "+e.toString())}else if(e instanceof y){if(0===e.name.length)throw Error("Symbol in rule has 0 length...!?");if(O[e.name]){if(e.name!==t.name)return[]}else switch(e.name[1]>="a"&&e.name[1]<="z"?e.name.substring(0,2):e.name[0]){case"n":case"_p":a[0].placeholders[e.name]=t;break;case"c":case"cl":if(!W(t))return[];a[0].placeholders[e.name]=t;break;case"v":if(W(t))return[];a[0].placeholders[e.name]=t;break;case"vl":if(!ea(t))return[];a[0].placeholders[e.name]=t;break;case"cd":if(!xc(t))return[];a[0].placeholders[e.name]=t;break;case"vd":if(xc(t))return[];a[0].placeholders[e.name]=t;break;case"ce":if(!xl(t))return[];a[0].placeholders[e.name]=t;break;case"ve":if(xl(t))return[];a[0].placeholders[e.name]=t;break;default:throw Error("Invalid symbol in rule: "+e.name)}}else if(!(e instanceof c))return[];else if(!n(e.value,t.value))return[];return a}return T}),xf="symbolicEqual",xd=tP(xf,["parse","simplify","typed","OperatorNode"],e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r(new i("-","subtract",[e,t]),{},n);return W(a)&&!a.value}return n(xf,{"Node, Node":a,"Node, Node, Object":a})}),xm="derivative",xh=tP(xm,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],e=>{var{typed:t,config:r,parse:n,simplify:i,equal:a,isZero:o,numeric:s,ConstantNode:u,FunctionNode:c,OperatorNode:l,ParenthesisNode:p,SymbolNode:f}=e;function d(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0},n=new Map,a=t.name,o=v(e,function e(t){var r=n.get(t);if(void 0!==r)return r;var i=y(e,t,a);return n.set(t,i),i});return r.simplify?i(o):o}function m(e){var t=n(e);if(!t.isSymbolNode)throw TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(e)," into a variable in function derivative"));return t}var h=t(xm,{"Node, SymbolNode":d,"Node, SymbolNode, Object":d,"Node, string":(e,t)=>d(e,m(t)),"Node, string, Object":(e,t,r)=>d(e,m(t),r)});h._simplify=!0,h.toTex=function(e){return g.apply(null,e.args)};var g=t("_derivTex",{"Node, SymbolNode":function(e,t){return W(e)&&"string"===es(e.value)?g(n(e.value).toString(),t.toString(),1):g(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===es(t.value))return g(e,n(t.value));throw Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return g(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),y=t("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(e,t,r){return t.name!==r},"function, ParenthesisNode, string":function(e,t,r){return e(t.content,r)},"function, FunctionAssignmentNode, string":function(e,t,r){return!t.params.includes(r)||e(t.expr,r)},"function, FunctionNode | OperatorNode, string":function(e,t,r){return t.args.every(t=>e(t,r))}}),v=t("_derivative",{"ConstantNode, function":function(){return x(0)},"SymbolNode, function":function(e,t){return t(e)?x(0):x(1)},"ParenthesisNode, function":function(e,t){return new p(v(e.content,t))},"FunctionAssignmentNode, function":function(e,t){return t(e)?x(0):v(e.expr,t)},"FunctionNode, function":function(e,t){if(t(e))return x(0);var r,n,i,a,o=e.args[0],s=!1,u=!1;switch(e.name){case"cbrt":s=!0,n=new l("*","multiply",[x(3),new l("^","pow",[o,new l("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,n=new l("*","multiply",[x(2),new c("sqrt",[o])]);else if(2===e.args.length)return r=new l("/","divide",[x(1),e.args[1]]),v(new l("^","pow",[o,r]),t);break;case"log10":r=x(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&t(e.args[1]))n=new l("*","multiply",[o.clone(),new c("log",[r||e.args[1]])]),s=!0;else if(2===e.args.length)return v(new l("/","divide",[new c("log",[o]),new c("log",[e.args[1]])]),t)}else n=o.clone(),s=!0;break;case"pow":if(2===e.args.length)return v(new l("^","pow",[o,e.args[1]]),t);break;case"exp":n=new c("exp",[o.clone()]);break;case"sin":n=new c("cos",[o.clone()]);break;case"cos":n=new l("-","unaryMinus",[new c("sin",[o.clone()])]);break;case"tan":n=new l("^","pow",[new c("sec",[o.clone()]),x(2)]);break;case"sec":n=new l("*","multiply",[e,new c("tan",[o.clone()])]);break;case"csc":u=!0,n=new l("*","multiply",[e,new c("cot",[o.clone()])]);break;case"cot":u=!0,n=new l("^","pow",[new c("csc",[o.clone()]),x(2)]);break;case"asin":s=!0,n=new c("sqrt",[new l("-","subtract",[x(1),new l("^","pow",[o.clone(),x(2)])])]);break;case"acos":s=!0,u=!0,n=new c("sqrt",[new l("-","subtract",[x(1),new l("^","pow",[o.clone(),x(2)])])]);break;case"atan":s=!0,n=new l("+","add",[new l("^","pow",[o.clone(),x(2)]),x(1)]);break;case"asec":s=!0,n=new l("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new l("-","subtract",[new l("^","pow",[o.clone(),x(2)]),x(1)])])]);break;case"acsc":s=!0,u=!0,n=new l("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new l("-","subtract",[new l("^","pow",[o.clone(),x(2)]),x(1)])])]);break;case"acot":s=!0,u=!0,n=new l("+","add",[new l("^","pow",[o.clone(),x(2)]),x(1)]);break;case"sinh":n=new c("cosh",[o.clone()]);break;case"cosh":n=new c("sinh",[o.clone()]);break;case"tanh":n=new l("^","pow",[new c("sech",[o.clone()]),x(2)]);break;case"sech":u=!0,n=new l("*","multiply",[e,new c("tanh",[o.clone()])]);break;case"csch":u=!0,n=new l("*","multiply",[e,new c("coth",[o.clone()])]);break;case"coth":u=!0,n=new l("^","pow",[new c("csch",[o.clone()]),x(2)]);break;case"asinh":s=!0,n=new c("sqrt",[new l("+","add",[new l("^","pow",[o.clone(),x(2)]),x(1)])]);break;case"acosh":s=!0,n=new c("sqrt",[new l("-","subtract",[new l("^","pow",[o.clone(),x(2)]),x(1)])]);break;case"atanh":s=!0,n=new l("-","subtract",[x(1),new l("^","pow",[o.clone(),x(2)])]);break;case"asech":s=!0,u=!0,n=new l("*","multiply",[o.clone(),new c("sqrt",[new l("-","subtract",[x(1),new l("^","pow",[o.clone(),x(2)])])])]);break;case"acsch":s=!0,u=!0,n=new l("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new l("+","add",[new l("^","pow",[o.clone(),x(2)]),x(1)])])]);break;case"acoth":s=!0,u=!0,n=new l("-","subtract",[x(1),new l("^","pow",[o.clone(),x(2)])]);break;case"abs":n=new l("/","divide",[new c(new f("abs"),[o.clone()]),o.clone()]);break;default:throw Error('Cannot process function "'+e.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}s?(i="/",a="divide"):(i="*",a="multiply");var p=v(o,t);return u&&(p=new l("-","unaryMinus",[p])),new l(i,a,[p,n])},"OperatorNode, function":function(e,t){if(t(e))return x(0);if("+"===e.op)return new l(e.op,e.fn,e.args.map(function(e){return v(e,t)}));if("-"===e.op){if(e.isUnary())return new l(e.op,e.fn,[v(e.args[0],t)]);if(e.isBinary())return new l(e.op,e.fn,[v(e.args[0],t),v(e.args[1],t)])}if("*"===e.op){var r=e.args.filter(function(e){return t(e)});if(r.length>0){var n=e.args.filter(function(e){return!t(e)}),i=1===n.length?n[0]:new l("*","multiply",n);return new l("*","multiply",r.concat(v(i,t)))}return new l("+","add",e.args.map(function(r){return new l("*","multiply",e.args.map(function(e){return e===r?v(e,t):e.clone()}))}))}if("/"===e.op&&e.isBinary()){var s=e.args[0],u=e.args[1];return t(u)?new l("/","divide",[v(s,t),u]):t(s)?new l("*","multiply",[new l("-","unaryMinus",[s]),new l("/","divide",[v(u,t),new l("^","pow",[u.clone(),x(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[v(s,t),u.clone()]),new l("*","multiply",[s.clone(),v(u,t)])]),new l("^","pow",[u.clone(),x(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],f=e.args[1];if(t(p))return W(p)&&(o(p.value)||a(p.value,1))?x(0):new l("*","multiply",[e,new l("*","multiply",[new c("log",[p.clone()]),v(f.clone(),t)])]);if(t(f)){if(W(f)){if(o(f.value))return x(0);if(a(f.value,1))return v(p,t)}var d=new l("^","pow",[p.clone(),new l("-","subtract",[f,x(1)])]);return new l("*","multiply",[f.clone(),new l("*","multiply",[v(p,t),d])])}return new l("*","multiply",[new l("^","pow",[p.clone(),f.clone()]),new l("+","add",[new l("*","multiply",[v(p,t),new l("/","divide",[f.clone(),p.clone()])]),new l("*","multiply",[v(f,t),new c("log",[p.clone()])])])])}throw Error('Cannot process operator "'+e.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function x(e,t){return new u(s(e,t||tY(String(e),r)))}return h}),xg={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},xy={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},xv={bignumber:{name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]},bigint:{name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]},boolean:{name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},complex:{name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},createUnit:{name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},fraction:{name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},index:{name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix","number","range","string","unit"]},matrix:{name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},number:{name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]},sparse:{name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},splitUnit:{name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},string:{name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},unit:{name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},e:xg,E:xg,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Infinity:{name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},LOG10E:{name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:xy,PI:xy,phi:{name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},SQRT1_2:{name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},SQRT2:{name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tau:{name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},true:{name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},version:{name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant. Deprecated in favor of coulombConstant",examples:["coulombConstant"]},coulombConstant:{description:"Coulomb's constant",examples:["coulombConstant"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:{name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},lsolve:{name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},lsolveAll:{name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},lup:{name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},lusolve:{name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},leafCount:{name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},polynomialRoot:{name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},resolve:{name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},simplify:{name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},simplifyConstant:{name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},simplifyCore:{name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},symbolicEqual:{name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},rationalize:{name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},slu:{name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},usolve:{name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},usolveAll:{name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},qr:{name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},abs:{name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},add:{name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},cbrt:{name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},ceil:{name:"ceil",category:"Arithmetic",syntax:["ceil(x)","ceil(x, n)","ceil(unit, valuelessUnit)","ceil(unit, n, valuelessUnit)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)","ceil(3.241cm, cm)","ceil(3.241cm, 2, cm)"],seealso:["floor","fix","round"]},cube:{name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},divide:{name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},dotDivide:{name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},dotMultiply:{name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},dotPow:{name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},exp:{name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},expm:{name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},expm1:{name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},fix:{name:"fix",category:"Arithmetic",syntax:["fix(x)","fix(x, n)","fix(unit, valuelessUnit)","fix(unit, n, valuelessUnit)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)","fix(3.241cm, cm)","fix(3.241cm, 2, cm)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)","floor(x, n)","floor(unit, valuelessUnit)","floor(unit, n, valuelessUnit)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)","floor(3.241cm, cm)","floor(3.241cm, 2, cm)"],seealso:["ceil","fix","round"]},gcd:{name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},hypot:{name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},lcm:{name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},log:{name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},log2:{name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},log1p:{name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},log10:{name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},mod:{name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},multiply:{name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},norm:{name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},nthRoot:{name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},nthRoots:{name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},pow:{name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},sign:{name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},sqrt:{name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},sqrtm:{name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},square:{name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},subtract:{name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},unaryMinus:{name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},invmod:{name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},bitAnd:{name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitNot:{name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitOr:{name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},bitXor:{name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},leftShift:{name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},rightArithShift:{name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},rightLogShift:{name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},bellNumbers:{name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},catalan:{name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},composition:{name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},stirlingS2:{name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers","bernoulli"]},config:{name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},import:{name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},typed:{name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},arg:{name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},conj:{name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},re:{name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},im:{name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},evaluate:{name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:["parser","parse","compile"]},help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},parse:{name:"parse",category:"Expression",syntax:["parse(expr)","parse(expr, options)","parse([expr1, expr2, expr3, ...])","parse([expr1, expr2, expr3, ...], options)"],description:"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().",examples:['node1 = parse("sqrt(3^2 + 4^2)")',"node1.evaluate()","code1 = node1.compile()","code1.evaluate()","scope = {a: 3, b: 4}",'node2 = parse("a * b")',"node2.evaluate(scope)","code2 = node2.compile()","code2.evaluate(scope)"],seealso:["parser","evaluate","compile"]},parser:{name:"parser",category:"Expression",syntax:["parser()"],description:"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.",examples:["myParser = parser()",'myParser.evaluate("sqrt(3^2 + 4^2)")','myParser.set("x", 3)','myParser.evaluate("y = x + 3")','myParser.evaluate(["y = x + 3", "y = y + 1"])','myParser.get("y")'],seealso:["evaluate","parse","compile"]},compile:{name:"compile",category:"Expression",syntax:["compile(expr) ","compile([expr1, expr2, expr3, ...])"],description:"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.",examples:['code1 = compile("sqrt(3^2 + 4^2)")',"code1.evaluate() ",'code2 = compile("a * b")',"code2.evaluate({a: 3, b: 4})"],seealso:["parser","parse","evaluate"]},distance:{name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},intersect:{name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},and:{name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},not:{name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},nullish:{name:"nullish",category:"Logical",syntax:["x ?? y","nullish(x, y)"],description:"Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.",examples:["null ?? 42","undefined ?? 42","0 ?? 42","false ?? 42","null ?? undefined ?? 42"],seealso:["and","or","not"]},or:{name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},xor:{name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},mapSlices:{name:"mapSlices",category:"Matrix",syntax:["mapSlices(A, dim, callback)"],description:"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.",examples:["A = [[1, 2], [3, 4]]","mapSlices(A, 1, sum)","mapSlices(A, 2, prod)"],seealso:["map","forEach"]},concat:{name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},count:{name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},cross:{name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},column:{name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},ctranspose:{name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},det:{name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diag:{name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diff:{name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},dot:{name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},getMatrixDataType:{name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},identity:{name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},filter:{name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},flatten:{name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},forEach:{name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},inv:{name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},pinv:{name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},kron:{name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},matrixFromFunction:{name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},matrixFromRows:{name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},matrixFromColumns:{name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},map:{name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]},ones:{name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},partitionSelect:{name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},range:{name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},resize:{name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},reshape:{name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},rotate:{name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},rotationMatrix:{name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},row:{name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},size:{name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},sort:{name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},squeeze:{name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},subset:{name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},trace:{name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},transpose:{name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},zeros:{name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},fft:{name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ifft:{name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},sylvester:{name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},schur:{name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},lyap:{name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},solveODE:{name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},bernoulli:{name:"bernoulli",category:"Probability",syntax:["bernoulli(n)"],description:"The nth Bernoulli number",examples:["bernoulli(4)","bernoulli(fraction(12))"],seealso:["combinations","gamma","stirlingS2"]},combinations:{name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},combinationsWithRep:{name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},factorial:{name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},gamma:{name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},kldivergence:{name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},lgamma:{name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},multinomial:{name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},permutations:{name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},pickRandom:{name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},random:{name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},randomInt:{name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},compare:{name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},compareNatural:{name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},compareText:{name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},deepEqual:{name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},equal:{name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},equalText:{name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},larger:{name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},largerEq:{name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},smaller:{name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},smallerEq:{name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},unequal:{name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},setCartesian:{name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},setDifference:{name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},setDistinct:{name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},setIntersect:{name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},setIsSubset:{name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},setMultiplicity:{name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},setPowerset:{name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},setSize:{name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},setSymDifference:{name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},setUnion:{name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},zpk2tf:{name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},freqz:{name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},erf:{name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},zeta:{name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},cumsum:{name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},mad:{name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},max:{name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},mean:{name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},median:{name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},min:{name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},mode:{name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},prod:{name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},quantileSeq:{name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},std:{name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},sum:{name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","variance"]},variance:{name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},corr:{name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},acos:{name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},acosh:{name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},acot:{name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},acoth:{name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},acsc:{name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},acsch:{name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},asec:{name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},asinh:{name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},atan:{name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},atanh:{name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},atan2:{name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},cos:{name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},coth:{name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},csc:{name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},csch:{name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},sec:{name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},sech:{name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},sin:{name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},tanh:{name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},to:{name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},toBest:{name:"toBest",category:"Units",syntax:["toBest(x)","toBest(x, unitList)","toBest(x, unitList, options)"],description:"Converts to the most appropriate display unit.",examples:['toBest(unit(5000, "m"))','toBest(unit(3500000, "W"))','toBest(unit(0.000000123, "A"))','toBest(unit(10, "m"), "cm")','toBest(unit(10, "m"), "mm,km", {offset: 1.5})'],seealso:[]},clone:{name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},format:{name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},bin:{name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},oct:{name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},hex:{name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},isNaN:{name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero","isFinite","isBounded"]},isBounded:{name:"isBounded",category:"Utils",syntax:["isBounded(x)"],description:"Test whether a value or its entries are bounded.",examples:["isBounded(Infinity)","isBounded(bigint(3))","isBounded([3, -Infinity, -3])"],seealso:["isFinite","isNumeric","isNaN","isNegative","isPositive"]},isFinite:{name:"isFinite",category:"Utils",syntax:["isFinite(x)"],description:"Test whether a value is finite, elementwise on collections.",examples:["isFinite(Infinity)","isFinite(bigint(3))","isFinite([3, -Infinity, -3])"],seealso:["isBounded","isNumeric","isNaN","isNegative","isPositive"]},isInteger:{name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isNegative:{name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},isNumeric:{name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue","isFinite","isBounded"]},hasNumericValue:{name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},isPositive:{name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isPrime:{name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isZero:{name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},print:{name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},typeOf:{name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},numeric:{name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]}},xx="help",xb=tP(xx,["typed","mathWithTransform","Help"],e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(xx,{any:function(e){var t,i=e;if("string"!=typeof e){for(t in r)if(ef(r,t)&&e===r[t]){i=t;break}}var a=o(xv,i);if(!a)throw Error('No documentation found on "'+("function"==typeof i?i.name:i)+'"');return new n(a)}})}),xD="rationalize",xN=tP(xD,["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],e=>{var{config:t,typed:r,equal:n,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,parse:l,simplifyConstant:p,simplifyCore:f,simplify:d,fraction:m,bignumber:h,mathWithTransform:g,matrix:y,AccessorNode:v,ArrayNode:x,ConstantNode:b,FunctionNode:D,IndexNode:N,ObjectNode:w,OperatorNode:A,SymbolNode:E,ParenthesisNode:S}=e;function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=(c=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],l=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],(m={}).firstRules=(u=[f,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},p,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}]).concat(c,l),m.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],m.sucDivRules=l,m.firstRulesAgain=u.concat(c),m.finalRules=[f,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},p,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],m),i=(h=e,g=t,y=!0,v=n.firstRules,x=[],D=d(h,v,g,{exactFractions:!1}),N="+-*"+((y=!!y)?"/":""),!function e(t){var r=t.type;if("FunctionNode"===r)throw Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op)if("ConstantNode"===t.args[1].type&&tX(parseFloat(t.args[1].value)))e(t.args[0]);else throw Error("There is a non-integer exponent");else{if(!N.includes(t.op))throw Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n<t.args.length;n++)e(t.args[n])}else if("SymbolNode"===r){var i=t.name;-1===x.indexOf(i)&&x.push(i)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw Error("type "+r+" is not allowed in polynomial expression")}(D),(w={}).expression=D,w.variables=x,w),a=i.variables.length,o={exactFractions:!1},s={exactFractions:!0};if(e=i.expression,a>=1){e=function e(t,r,n){var i=t.type,a=arguments.length>1;if("OperatorNode"===i&&t.isBinary()){var o,s=!1;if("^"===t.op&&("ParenthesisNode"===t.args[0].type||"OperatorNode"===t.args[0].type)&&"ConstantNode"===t.args[1].type&&(s=(o=parseFloat(t.args[1].value))>=2&&tX(o)),s){if(o>2){var u=t.args[0],c=new A("^","pow",[t.args[0].cloneDeep(),new b(o-1)]);t=new A("*","multiply",[u,c])}else t=new A("*","multiply",[t.args[0],t.args[0].cloneDeep()]);a&&("content"===n?r.content=t:r.args[n]=t)}}if("ParenthesisNode"===i)e(t.content,t,"content");else if("ConstantNode"!==i&&"SymbolNode"!==i)for(var l=0;l<t.args.length;l++)e(t.args[l],t,l);if(!a)return t}(e);var u,c,l,m,h,g,y,v,x,D,N,w,E,S,C=!0,F=!1;for(e=d(e,n.firstRules,{},o);e=d(e,C?n.distrDivRules:n.sucDivRules,{},s),C=!C,(S=e.toString())!==E;)F=!0,E=S;F&&(e=d(e,n.firstRulesAgain,{},o)),e=d(e,n.finalRules,{},o)}var T=[],B={};return("OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===a&&(e.args[0]=M(e.args[0],T),e.args[1]=M(e.args[1])),r&&(B.numerator=e.args[0],B.denominator=e.args[1])):(1===a&&(e=M(e,T)),r&&(B.numerator=e,B.denominator=null)),r)?(B.coefficients=T,B.variables=i.variables,B.expression=e,B):e}return r(xD,{Node:C,"Node, boolean":(e,t)=>C(e,{},t),"Node, Object":C,"Node, Object, boolean":C});function M(e,t){void 0===t&&(t=[]),t[0]=0;var r,n={};n.cte=1,n.oper="+",n.fire="";var i=0,a="";(function e(r,n,o){var s=r.type;if("FunctionNode"===s)throw Error("There is an unsolved function call");if("OperatorNode"===s){if(!"+-*^".includes(r.op))throw Error("Operator "+r.op+" invalid");if(null!==n&&(("unaryMinus"===r.fn||"pow"===r.fn)&&"add"!==n.fn&&"subtract"!==n.fn&&"multiply"!==n.fn||("subtract"===r.fn||"add"===r.fn||"multiply"===r.fn)&&"add"!==n.fn&&"subtract"!==n.fn||("subtract"===r.fn||"add"===r.fn||"unaryMinus"===r.fn)&&0!==o.noFil))throw Error("Invalid "+r.op+" placing");("^"===r.op||"*"===r.op)&&(o.fire=r.op);for(var u=0;u<r.args.length;u++)"unaryMinus"===r.fn&&(o.oper="-"),("+"===r.op||"subtract"===r.fn)&&(o.fire="",o.cte=1,o.oper=0===u?"+":r.op),o.noFil=u,e(r.args[u],r,o)}else if("SymbolNode"===s){if(r.name!==a&&""!==a)throw Error("There is more than one variable");if(a=r.name,null===n){t[1]=1;return}if("^"===n.op&&0!==o.noFil)throw Error("In power the variable should be the first parameter");if("*"===n.op&&1!==o.noFil)throw Error("In multiply the variable should be the second parameter");(""===o.fire||"*"===o.fire)&&(i<1&&(t[1]=0),t[1]+=o.cte*("+"===o.oper?1:-1),i=Math.max(1,i))}else if("ConstantNode"===s){var c=parseFloat(r.value);if(null===n){t[0]=c;return}if("^"===n.op){if(1!==o.noFil)throw Error("Constant cannot be powered");if(!tX(c)||c<=0)throw Error("Non-integer exponent is not allowed");for(var l=i+1;l<c;l++)t[l]=0;c>i&&(t[c]=0),t[c]+=o.cte*("+"===o.oper?1:-1),i=Math.max(c,i);return}o.cte=c,""===o.fire&&(t[0]+=o.cte*("+"===o.oper?1:-1))}else throw Error("Type "+s+" is not allowed")})(e,null,n),i=t.length-1;for(var o=!0,s=i;s>=0;s--)if(0!==t[s]){var u=new b(o?t[s]:Math.abs(t[s])),c=t[s]<0?"-":"+";if(s>0){var l=new E(a);s>1&&(l=new A("^","pow",[l,new b(s)])),u=-1===t[s]&&o?new A("-","unaryMinus",[l]):1===Math.abs(t[s])?l:new A("*","multiply",[u,l])}r=o?u:"+"===c?new A("+","add",[r,u]):new A("-","subtract",[r,u]),o=!1}return o?new b(0):r}});function xw(e,t,r){var n=e.filter(function(e){return ea(e)&&!(e.name in t)&&!r.has(e.name)})[0];if(!n)throw Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,o=new d(r,a,new Set([i])),s=e.compile();return function(e){return a.set(i,e),s.evaluate(o)}}var xA=tP("transformCallback",["typed"],e=>{var{typed:t}=e;return function(e,r){return t.isTypedFunction(e)?function e(r,n){var i=Object.fromEntries(Object.entries(r.signatures).map(r=>{var[i,a]=r,o=i.split(",").length;return t.isTypedFunction(a)?[i,e(a,n)]:[i,xE(a,o,n)]}));return"string"==typeof r.name?t(r.name,i):t(i)}(e,r):xE(e,e.length,r)}});function xE(e,t,r){return t===r?e:t===r+1?function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return e(...n.slice(0,r),xS(n[r]))}:t>r+1?function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return e(...n.slice(0,r),xS(n[r]),...n.slice(r+1))}:e}function xS(e){return e.map(e=>e+1)}var xC=tP("map",["typed"],e=>{var{typed:t}=e,r=o2({typed:t}),n=xA({typed:t});function i(e,t,i){if(0===e.length)return r();if(1===e.length)return r(e[0]);var a=e.length-1,o=e.slice(0,a),s=e[a];return o=o.map(e=>u(e,i)),s&&(s=ea(s)||Q(s)?u(s,i):xw(s,t,i)),r(...o,n(s,a));function u(e,t){return e.compile().evaluate(t)}}return i.rawArgs=!0,i},{isTransformFunction:!0}),xM=tP("filter",["typed"],e=>{var{typed:t}=e;function r(e,r,i){var a=ob({typed:t}),o=xA({typed:t});if(0===e.length)return a();var s=e[0];if(1===e.length)return a(s);var u=e.length-1,c=e[u];return s&&(s=n(s,i)),c&&(c=ea(c)||Q(c)?n(c,i):xw(c,r,i)),a(s,o(c,u))}function n(e,t){return e.compile().evaluate(t)}return r.rawArgs=!0,r},{isTransformFunction:!0}),xF=tP("forEach",["typed"],e=>{var{typed:t}=e,r=oE({typed:t}),n=xA({typed:t});function i(e,t,i){if(0===e.length)return r();var o=e[0];if(1===e.length)return r(o);var s=e.length-1,u=e[s];return o&&(o=a(o,i)),u&&(u=ea(u)||Q(u)?a(u,i):xw(u,t,i)),r(o,n(u,s))}function a(e,t){return e.compile().evaluate(t)}return i.rawArgs=!0,i},{isTransformFunction:!0});function xT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var xB=tP("mapSlices",["typed","isInteger"],e=>{var{typed:t,isInteger:r}=e,n=uK({typed:t,isInteger:r});return t("mapSlices",{"...any":function(e){var t=e[1];y(t)?e[1]=t-1:v(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw vG(e)}}})},function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xT(Object(r),!0).forEach(function(t){fE(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xT(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({isTransformFunction:!0},uK.meta)),xO=tP("and",["typed","matrix","zeros","add","equalScalar","not","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,s=p1({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function u(e,t,r){var n=e[0].compile().evaluate(r);return(!!S(n)||!!s(n,!0))&&s(n,e[1].compile().evaluate(r))}return u.rawArgs=!0,u},{isTransformFunction:!0}),x_="cumsum",xz=tP(x_,["typed","add","unaryPlus"],e=>{var{typed:t,add:r,unaryPlus:n}=e,i=pE({typed:t,add:r,unaryPlus:n});return t(x_,{"...any":function(e){if(2===e.length&&S(e[0])){var t=e[1];y(t)?e[1]=t-1:v(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),xq=tP("nullish",["typed","matrix","size","flatten","deepEqual"],e=>{var{typed:t,matrix:r,size:n,flatten:i,deepEqual:a}=e,o=c0({typed:t,matrix:r,size:n,flatten:i,deepEqual:a});function s(e,t,r){var n=e[0].compile().evaluate(r);return S(n)||null==n||void 0===n?o(n,e[1].compile().evaluate(r)):n}return s.rawArgs=!0,s},{isTransformFunction:!0}),xI="print",xk=tP(xI,["typed","matrix","zeros","add"],e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=sp({typed:t,matrix:r,zeros:n,add:i});return t(xI,{"string, Object | Array":function(e,t){return a(o(e),t)},"string, Object | Array, number | Object":function(e,t,r){return a(o(e),t,r)}});function o(e){return e.replace(sc,e=>"$"+e.slice(1).split(".").map(function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e}).join("."))}},{isTransformFunction:!0}),xR=tP("bitAnd",["typed","matrix","zeros","add","equalScalar","not","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,s=ll({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function u(e,t,r){var n=e[0].compile().evaluate(r);if(!S(n)){if(isNaN(n))return NaN;if(0===n||!1===n)return 0}return s(n,e[1].compile().evaluate(r))}return u.rawArgs=!0,u},{isTransformFunction:!0}),xP=tP("concat",["typed","matrix","isInteger"],e=>{var{typed:t,matrix:r,isInteger:n}=e,i=cf({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(e){var t=e.length-1,r=e[t];y(r)?e[t]=r-1:v(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0});function xU(e){if(2===e.length&&S(e[0])){var t=(e=e.slice())[1];(y(t)||v(t))&&(e[1]=y(t)?t-1:v(t)?t.minus(1):t)}return e}var xj="diff",xL=tP(xj,["typed","matrix","subtract","number","bignumber"],e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e,o=lM({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(xj,{"...any":function(e){e=xU(e);try{return o.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),xH=tP("max",["typed","config","numeric","larger","isNaN"],e=>{var{typed:t,config:r,numeric:n,larger:i,isNaN:a}=e,o=cQ({typed:t,config:r,numeric:n,larger:i,isNaN:a});return t("max",{"...any":function(e){e=xU(e);try{return o.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),x$=tP("min",["typed","config","numeric","smaller","isNaN"],e=>{var{typed:t,config:r,numeric:n,smaller:i,isNaN:a}=e,o=lK({typed:t,config:r,numeric:n,smaller:i,isNaN:a});return t("min",{"...any":function(e){e=xU(e);try{return o.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),xG=tP("or",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=c1({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function s(e,t,r){var n=e[0].compile().evaluate(r);return!!(!S(n)&&o(n,!1))||o(n,e[1].compile().evaluate(r))}return s.rawArgs=!0,s},{isTransformFunction:!0}),xZ=tP("subset",["typed","matrix","zeros","add"],e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=po({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(e){try{return a.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),xV=tP("bitOr",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=lf({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!S(n)){if(isNaN(n))return NaN;if(-1===n)return -1;if(!0===n)return 1}return o(n,e[1].compile().evaluate(r))}return s.rawArgs=!0,s},{isTransformFunction:!0}),xW=tP("sum",["typed","config","add","numeric"],e=>{var{typed:t,config:r,add:n,numeric:i}=e,a=pp({typed:t,config:r,add:n,numeric:i});return t("sum",{"...any":function(e){e=xU(e);try{return a.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),xJ="variance",xQ=tP(xJ,["typed","add","subtract","multiply","divide","mapSlices","isNaN"],e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s}=e,u=fY({typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s});return t(xJ,{"...any":function(e){e=xU(e);try{return u.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),xX=tP("index",["Index","getMatrixDataType"],e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var e=[],n=0,i=arguments.length;n<i;n++){var a=arguments[n];if(F(a))a.start--,a.end-=a.step>0?0:2;else if(a&&!0===a.isSet)a=a.map(function(e){return e-1});else if(A(a)||E(a))"boolean"!==r(a)&&(a=a.map(function(e){return e-1}));else if(y(a)||x(a))a--;else if(v(a))a=a.toNumber()-1;else if("string"==typeof a);else throw TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");e[n]=a}var o=new t;return t.apply(o,e),o}},{isTransformFunction:!0}),xY=tP("quantileSeq",["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:p,larger:f,mapSlices:d}=e,m=fm({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:p,larger:f,mapSlices:d});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(e,t,r)=>m(e,t,h(r)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(e,t,r,n)=>m(e,t,r,h(n)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(e,t,r)=>m(e,t,h(r)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(e,t,r,n)=>m(e,t,r,h(n))});function h(e){return xU([[],e])[1]}},{isTransformFunction:!0}),xK=tP("range",["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],e=>{var{typed:t,config:r,matrix:n,bignumber:i,equal:a,smaller:o,smallerEq:s,larger:u,largerEq:c,add:l,isZero:p,isPositive:f}=e,d=fg({typed:t,config:r,matrix:n,bignumber:i,equal:a,smaller:o,smallerEq:s,larger:u,largerEq:c,add:l,isZero:p,isPositive:f});return t("range",{"...any":function(e){var t=e.length-1;return"boolean"!=typeof e[t]&&e.push(!0),d.apply(null,e)}})},{isTransformFunction:!0}),x0=tP("column",["typed","Index","matrix","range"],e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=fO({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(e){var t=e.length-1,r=e[t];y(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),x1=tP("row",["typed","Index","matrix","range"],e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=fy({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(e){var t=e.length-1,r=e[t];y(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),x2=tP("mean",["typed","add","divide"],e=>{var{typed:t,add:r,divide:n}=e,i=fu({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){e=xU(e);try{return i.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),x3=tP("std",["typed","map","sqrt","variance"],e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,a=f6({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(e){e=xU(e);try{return a.apply(null,e)}catch(e){throw vG(e)}}})},{isTransformFunction:!0}),x4={},x5={},x8={},x6=va({mathWithTransform:x5}),x7=vs({Node:x6}),x9=vN({Node:x6}),be=vA({Node:x6}),bt=vS({Node:x6}),br=vM({Node:x6}),bn=vT({Node:x6,ResultSet:dT}),bi=vO({Node:x6}),ba=vz({Node:x6}),bo=vq({classes:x8}),bs=vI({math:x4,typed:dL}),bu=vR({Node:x6,typed:dL}),bc=vU({Chain:bs,typed:dL}),bl=vL({Node:x6,isBounded:mf}),bp=v$({Node:x6,size:m_}),bf=vW({Node:x6,subset:gv}),bd=vQ({matrix:m0,Node:x6,subset:gv}),bm=vX({Unit:g8,Node:x6,math:x4}),bh=vK({Node:x6,SymbolNode:bm,math:x4}),bg=v1({AccessorNode:bf,ArrayNode:br,AssignmentNode:bd,BlockNode:bn,ConditionalNode:bi,ConstantNode:bl,FunctionAssignmentNode:bu,FunctionNode:bh,IndexNode:bp,ObjectNode:x7,OperatorNode:x9,ParenthesisNode:be,RangeNode:ba,RelationalNode:bt,SymbolNode:bm,config:eg,numeric:hx,typed:dL}),by=v2({ConstantNode:bl,FunctionNode:bh,OperatorNode:x9,ParenthesisNode:be,parse:bg,typed:dL}),bv=v8({bignumber:mG,fraction:hf,AccessorNode:bf,ArrayNode:br,ConstantNode:bl,FunctionNode:bh,IndexNode:bp,ObjectNode:x7,OperatorNode:x9,SymbolNode:bm,config:eg,isBounded:mf,mathWithTransform:x5,matrix:m0,typed:dL}),bx=v7({parse:bg,typed:dL}),bb=xe({parse:bg,typed:dL}),bD=xr({AccessorNode:bf,ArrayNode:br,ConstantNode:bl,FunctionNode:bh,IndexNode:bp,ObjectNode:x7,OperatorNode:x9,ParenthesisNode:be,SymbolNode:bm,add:hX,divide:gL,equal:hp,isZero:mK,multiply:m2,parse:bg,pow:gO,subtract:hZ,typed:dL}),bN=xi({parse:bg,typed:dL}),bw=xa({evaluate:bN}),bA=xo({evaluate:bN,parse:bg}),bE=xu({Parser:bA,typed:dL}),bS=xp({AccessorNode:bf,ArrayNode:br,ConstantNode:bl,FunctionNode:bh,IndexNode:bp,ObjectNode:x7,OperatorNode:x9,ParenthesisNode:be,SymbolNode:bm,equal:hp,parse:bg,replacer:dU,resolve:by,simplifyConstant:bv,simplifyCore:bD,typed:dL}),bC=xd({OperatorNode:x9,parse:bg,simplify:bS,typed:dL}),bM=xh({ConstantNode:bl,FunctionNode:bh,OperatorNode:x9,ParenthesisNode:be,SymbolNode:bm,config:eg,equal:hp,isZero:mK,numeric:hx,parse:bg,simplify:bS,typed:dL}),bF=xb({Help:bw,mathWithTransform:x5,typed:dL}),bT=xN({bignumber:mG,fraction:hf,AccessorNode:bf,ArrayNode:br,ConstantNode:bl,FunctionNode:bh,IndexNode:bp,ObjectNode:x7,OperatorNode:x9,ParenthesisNode:be,SymbolNode:bm,add:hX,config:eg,divide:gL,equal:hp,isZero:mK,mathWithTransform:x5,matrix:m0,multiply:m2,parse:bg,pow:gO,simplify:bS,simplifyConstant:bv,simplifyCore:bD,subtract:hZ,typed:dL});i(x4,{e:dy,false:dv,fineStructure:dx,i:dD,Infinity:dN,LN10:dw,LOG10E:dA,NaN:dS,null:dC,phi:dM,SQRT1_2:dB,sackurTetrode:dO,tau:d_,true:dz,E:dy,version:dq,efimovFactor:dk,LN2:dR,pi:dP,replacer:dU,reviver:bo,SQRT2:dj,typed:dL,PI:dP,weakMixingAngle:dH,abs:d$,acos:dG,acot:dZ,acsc:dV,addScalar:dW,arg:dJ,asech:dQ,asinh:dX,atan:dY,atanh:dK,bigint:d0,bitNot:d1,boolean:d2,clone:d3,combinations:d4,complex:d5,conj:d8,cos:d6,cot:d7,csc:d9,cube:me,equalScalar:mt,erf:mr,exp:mn,expm1:mi,filter:ma,flatten:mo,forEach:ms,format:mu,getMatrixDataType:mc,hex:ml,im:mp,isBounded:mf,isNaN:md,isNumeric:mm,isPrime:mh,LOG2E:mg,lgamma:my,log10:mv,log2:mx,map:mb,mode:mD,multiplyScalar:mN,not:mw,number:mA,oct:mE,pickRandom:mS,print:mC,random:mM,re:mF,sec:mT,sign:mB,sin:mO,size:m_,splitUnit:mq,square:mI,string:mk,subtractScalar:mR,tan:mP,toBest:mU,typeOf:mj,acosh:mL,acsch:mH,asec:m$,bignumber:mG,chain:bc,combinationsWithRep:mZ,cosh:mV,csch:mW,dot:mJ,hasNumericValue:mQ,isFinite:mX,isNegative:mY,isZero:mK,matrix:m0,matrixFromFunction:m1,multiply:m2,ones:m3,randomInt:m4,resize:m5,sech:m8,sinh:m6,sparse:m7,sqrt:m9,squeeze:he,tanh:ht,transpose:hr,xgcd:hn,zeros:hi,acoth:ha,asin:ho,bin:hs,coth:hu,ctranspose:hc,diag:hl,equal:hp,fraction:hf,identity:hd,isInteger:hm,kron:hh,mapSlices:hg,matrixFromColumns:hv,numeric:hx,prod:hb,reshape:hD,round:hN,unaryMinus:hw,bernoulli:hA,cbrt:hE,concat:hS,count:hC,deepEqual:hM,divideScalar:hF,dotMultiply:hT,floor:hB,gcd:hO,isPositive:h_,larger:hz,lcm:hq,leftShift:hI,lsolve:hk,max:hR,mod:hP,nthRoot:hU,nullish:hj,or:hL,qr:hH,rightArithShift:h$,smaller:hG,subtract:hZ,to:hV,unaryPlus:hW,usolve:hJ,xor:hQ,add:hX,atan2:hY,bitAnd:hK,bitOr:h0,bitXor:h1,catalan:h2,compare:h3,compareText:h4,composition:h5,cross:h8,det:h6,diff:h7,distance:h9,dotDivide:ge,equalText:gt,hypot:gn,intersect:go,invmod:gs,largerEq:gu,log:gc,lsolveAll:gl,matrixFromRows:gp,min:gf,nthRoots:gd,partitionSelect:gm,rightLogShift:gh,slu:gg,subset:gv,sum:gx,trace:gb,usolveAll:gD,zpk2tf:gN,ceil:gw,compareNatural:gA,cumsum:gE,fix:gS,index:gC,inv:gM,log1p:gF,lup:gT,pinv:gB,pow:gO,setCartesian:g_,setDistinct:gz,setIsSubset:gq,setPowerset:gI,smallerEq:gk,sort:gR,sqrtm:gP,unequal:gU,and:gj,divide:gL,expm:gH,fft:g$,freqz:gG,gamma:gZ,ifft:gV,kldivergence:gW,lusolve:gJ,mean:gQ,median:gX,polynomialRoot:gY,quantileSeq:gK,range:g0,row:g1,setDifference:g2,setMultiplicity:g3,setSymDifference:g4,solveODE:g5,vacuumImpedance:g6,atomicMass:g7,bohrMagneton:g9,boltzmann:ye,column:yt,conductanceQuantum:yr,coulomb:yn,createUnit:yi,deuteronMass:ya,eigs:yo,electronMass:ys,factorial:yu,fermiCoupling:yc,gasConstant:yl,gravity:yp,klitzing:yf,loschmidt:yd,mad:ym,magneticFluxQuantum:yh,molarMass:yg,molarPlanckConstant:yy,multinomial:yv,norm:yx,permutations:yb,planckConstant:yD,planckMass:yN,planckTime:yw,reducedPlanckConstant:yA,rotationMatrix:yE,rydberg:yS,secondRadiation:yC,setSize:yM,speedOfLight:yF,stefanBoltzmann:yT,thomsonCrossSection:yB,variance:yO,zeta:y_,avogadro:yz,bohrRadius:yq,corr:yI,dotPow:yk,elementaryCharge:yR,faraday:yP,hartreeEnergy:yU,inverseConductanceQuantum:yj,magneticConstant:yL,molarMassC12:yH,neutronMass:y$,parse:bg,planckCharge:yG,planckTemperature:yZ,quantumOfCirculation:yV,resolve:by,setIntersect:yW,simplifyConstant:bv,std:yJ,stirlingS2:yQ,unit:yX,bellNumbers:yY,compile:bx,electricConstant:yK,firstRadiation:y0,leafCount:bb,nuclearMagneton:y1,planckLength:y2,rotate:y3,setUnion:y4,simplifyCore:bD,wienDisplacement:y5,classicalElectronRadius:y8,evaluate:bN,molarVolume:y6,schur:y7,coulombConstant:y9,gravitationConstant:ve,parser:bE,simplify:bS,symbolicEqual:bC,derivative:bM,protonMass:vt,sylvester:vr,help:bF,rationalize:bT,lyap:vn,config:eg}),i(x5,x4,{map:xC({typed:dL}),filter:xM({typed:dL}),forEach:xF({typed:dL}),mapSlices:xB({isInteger:hm,typed:dL}),and:xO({add:hX,concat:hS,equalScalar:mt,matrix:m0,not:mw,typed:dL,zeros:hi}),cumsum:xz({add:hX,typed:dL,unaryPlus:hW}),nullish:xq({deepEqual:hM,flatten:mo,matrix:m0,size:m_,typed:dL}),print:xk({add:hX,matrix:m0,typed:dL,zeros:hi}),bitAnd:xR({add:hX,concat:hS,equalScalar:mt,matrix:m0,not:mw,typed:dL,zeros:hi}),concat:xP({isInteger:hm,matrix:m0,typed:dL}),diff:xL({bignumber:mG,matrix:m0,number:mA,subtract:hZ,typed:dL}),max:xH({config:eg,isNaN:md,larger:hz,numeric:hx,typed:dL}),min:x$({config:eg,isNaN:md,numeric:hx,smaller:hG,typed:dL}),or:xG({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),subset:xZ({add:hX,matrix:m0,typed:dL,zeros:hi}),bitOr:xV({DenseMatrix:dI,concat:hS,equalScalar:mt,matrix:m0,typed:dL}),sum:xW({add:hX,config:eg,numeric:hx,typed:dL}),variance:xQ({add:hX,divide:gL,isNaN:md,mapSlices:hg,multiply:m2,subtract:hZ,typed:dL}),index:xX({Index:ga,getMatrixDataType:mc}),quantileSeq:xY({add:hX,bignumber:mG,compare:h3,divide:gL,isInteger:hm,larger:hz,mapSlices:hg,multiply:m2,partitionSelect:gm,smaller:hG,smallerEq:gk,subtract:hZ,typed:dL}),range:xK({bignumber:mG,matrix:m0,add:hX,config:eg,equal:hp,isPositive:h_,isZero:mK,larger:hz,largerEq:gu,smaller:hG,smallerEq:gk,typed:dL}),column:x0({Index:ga,matrix:m0,range:g0,typed:dL}),row:x1({Index:ga,matrix:m0,range:g0,typed:dL}),mean:x2({add:hX,divide:gL,typed:dL}),std:x3({map:mb,sqrt:m9,typed:dL,variance:yO})}),i(x8,{BigNumber:dh,Complex:dg,Fraction:db,Matrix:dE,Node:x6,ObjectNode:x7,OperatorNode:x9,ParenthesisNode:be,Range:dF,RelationalNode:bt,ResultSet:dT,ArrayNode:br,BlockNode:bn,ConditionalNode:bi,DenseMatrix:dI,RangeNode:ba,Chain:bs,FunctionAssignmentNode:bu,SparseMatrix:mz,ConstantNode:bl,IndexNode:bp,FibonacciHeap:gr,ImmutableDenseMatrix:gi,Index:ga,Spa:gy,AccessorNode:bf,AssignmentNode:bd,Unit:g8,SymbolNode:bm,FunctionNode:bh,Help:bw,Parser:bA}),bs.createProxy(x4);var bB={createBigNumberClass:tL},bO={createComplexClass:rf},b_={createMatrixClass:nQ},bz={MatrixDependencies:b_,createDenseMatrixClass:iB},bq={createFractionClass:nJ},bI={BigNumberDependencies:bB,ComplexDependencies:bO,DenseMatrixDependencies:bz,FractionDependencies:bq,createTyped:iz},bk={typedDependencies:bI,createAbs:an},bR={createNode:va},bP={typedDependencies:bI,createEqualScalar:ol},bU={MatrixDependencies:b_,equalScalarDependencies:bP,typedDependencies:bI,createSparseMatrixClass:sw},bj={typedDependencies:bI,createAddScalar:aS},bL={DenseMatrixDependencies:bz,MatrixDependencies:b_,SparseMatrixDependencies:bU,typedDependencies:bI,createMatrix:s6},bH={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createEqual:uH},b$={equalDependencies:bH,typedDependencies:bI,createIsInteger:uJ},bG={isIntegerDependencies:b$,matrixDependencies:bL,typedDependencies:bI,createConcat:cf},bZ={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,addScalarDependencies:bj,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createAdd:lo},bV={BigNumberDependencies:bB,matrixDependencies:bL,typedDependencies:bI,createZeros:uA},bW={addDependencies:bZ,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createSubset:po},bJ={NodeDependencies:bR,subsetDependencies:bW,createAccessorNode:vW},bQ={ComplexDependencies:bO,typedDependencies:bI,createAcos:aa},bX={ComplexDependencies:bO,typedDependencies:bI,createAcosh:sR},bY={BigNumberDependencies:bB,typedDependencies:bI,createAcot:aN},bK={BigNumberDependencies:bB,ComplexDependencies:bO,typedDependencies:bI,createAcoth:uS},b0={BigNumberDependencies:bB,ComplexDependencies:bO,typedDependencies:bI,createAcsc:aA},b1={BigNumberDependencies:bB,typedDependencies:bI,createAcsch:sU},b2={typedDependencies:bI,createNot:st},b3={concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,notDependencies:b2,typedDependencies:bI,zerosDependencies:bV,createAnd:p1},b4={addDependencies:bZ,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,notDependencies:b2,typedDependencies:bI,zerosDependencies:bV,createAndTransform:xO},b5={typedDependencies:bI,createArg:aC},b8={NodeDependencies:bR,createArrayNode:vM},b6={BigNumberDependencies:bB,ComplexDependencies:bO,typedDependencies:bI,createAsec:sL},b7={BigNumberDependencies:bB,ComplexDependencies:bO,typedDependencies:bI,createAsech:aF},b9={ComplexDependencies:bO,typedDependencies:bI,createAsin:uM},De={typedDependencies:bI,createAsinh:aT},Dt={matrixDependencies:bL,NodeDependencies:bR,subsetDependencies:bW,createAssignmentNode:vQ},Dr={typedDependencies:bI,createAtan:aB},Dn={BigNumberDependencies:bB,DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createAtan2:lu},Di={ComplexDependencies:bO,typedDependencies:bI,createAtanh:a_},Da={BigNumberDependencies:bB,typedDependencies:bI,createBignumber:sH},Do={FractionDependencies:bq,typedDependencies:bI,createFraction:uG},Ds={typedDependencies:bI,createNumber:sr},Du={bignumberDependencies:Da,fractionDependencies:Do,numberDependencies:Ds,createNumeric:u5},Dc={numericDependencies:Du,typedDependencies:bI,createDivideScalar:cv},Dl={BigNumberDependencies:bB,DenseMatrixDependencies:bz,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createRound:cn},Dp={DenseMatrixDependencies:bz,equalScalarDependencies:bP,matrixDependencies:bL,roundDependencies:Dl,typedDependencies:bI,zerosDependencies:bV,createCeil:pb},Df={DenseMatrixDependencies:bz,equalScalarDependencies:bP,matrixDependencies:bL,roundDependencies:Dl,typedDependencies:bI,zerosDependencies:bV,createFloor:cS},Dd={ComplexDependencies:bO,DenseMatrixDependencies:bz,ceilDependencies:Dp,equalScalarDependencies:bP,floorDependencies:Df,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createFix:pC},Dm={typedDependencies:bI,createFormat:oM},Dh={typedDependencies:bI,createIsNumeric:oU},Dg={typedDependencies:bI,createMultiplyScalar:o5},Dy={BigNumberDependencies:bB,DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,matrixDependencies:bL,typedDependencies:bI,createIdentity:uV},Dv={equalScalarDependencies:bP,typedDependencies:bI,createIsZero:s5},Dx={typedDependencies:bI,createConj:oe},Db={typedDependencies:bI,createSize:sN},DD={addScalarDependencies:bj,conjDependencies:Dx,multiplyScalarDependencies:Dg,sizeDependencies:Db,typedDependencies:bI,createDot:sX},DN={addScalarDependencies:bj,dotDependencies:DD,equalScalarDependencies:bP,matrixDependencies:bL,multiplyScalarDependencies:Dg,typedDependencies:bI,createMultiply:un},Dw={typedDependencies:bI,createSubtractScalar:sB},DA={typedDependencies:bI,createUnaryMinus:ca},DE={divideScalarDependencies:Dc,isZeroDependencies:Dv,matrixDependencies:bL,multiplyDependencies:DN,subtractScalarDependencies:Dw,typedDependencies:bI,unaryMinusDependencies:DA,createDet:lS},DS={absDependencies:bk,addScalarDependencies:bj,detDependencies:DE,divideScalarDependencies:Dc,identityDependencies:Dy,matrixDependencies:bL,multiplyDependencies:DN,typedDependencies:bI,unaryMinusDependencies:DA,createInv:pT},DC={ComplexDependencies:bO,fractionDependencies:Do,identityDependencies:Dy,invDependencies:DS,matrixDependencies:bL,multiplyDependencies:DN,numberDependencies:Ds,typedDependencies:bI,createPow:pI},DM={BigNumberDependencies:bB,ComplexDependencies:bO,FractionDependencies:bq,absDependencies:bk,addScalarDependencies:bj,divideScalarDependencies:Dc,equalDependencies:bH,fixDependencies:Dd,formatDependencies:Dm,isNumericDependencies:Dh,multiplyScalarDependencies:Dg,numberDependencies:Ds,powDependencies:DC,roundDependencies:Dl,subtractScalarDependencies:Dw,createUnitClass:fT},DF={BigNumberDependencies:bB,UnitDependencies:DM,createAtomicMass:nu},DT={BigNumberDependencies:bB,UnitDependencies:DM,createAvogadro:nc},DB={typedDependencies:bI,createIsNegative:s3},DO={typedDependencies:bI,createCombinations:a8},D_={BigNumberDependencies:bB,ComplexDependencies:bO,multiplyScalarDependencies:Dg,powDependencies:DC,typedDependencies:bI,createGamma:p9},Dz={gammaDependencies:D_,typedDependencies:bI,createFactorial:fk},Dq={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,bignumberDependencies:Da,concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createLarger:cP},DI={bignumberDependencies:Da,addScalarDependencies:bj,combinationsDependencies:DO,divideScalarDependencies:Dc,factorialDependencies:Dz,isIntegerDependencies:b$,isNegativeDependencies:DB,largerDependencies:Dq,multiplyScalarDependencies:Dg,numberDependencies:Ds,powDependencies:DC,subtractScalarDependencies:Dw,typedDependencies:bI,createStirlingS2:f9},Dk={addScalarDependencies:bj,isIntegerDependencies:b$,isNegativeDependencies:DB,stirlingS2Dependencies:DI,typedDependencies:bI,createBellNumbers:dn},DR={BigNumberDependencies:bB,FractionDependencies:bq,isIntegerDependencies:b$,numberDependencies:Ds,typedDependencies:bI,createBernoulli:cs},DP={typedDependencies:bI,createBigint:az},DU={formatDependencies:Dm,typedDependencies:bI,createBin:uF},Dj={concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createBitAnd:ll},DL={addDependencies:bZ,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,notDependencies:b2,typedDependencies:bI,zerosDependencies:bV,createBitAndTransform:xR},DH={typedDependencies:bI,createBitNot:aY},D$={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createBitOr:lf},DG={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createBitOrTransform:xV},DZ={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createBitXor:lm},DV={createResultSet:nY},DW={NodeDependencies:bR,ResultSetDependencies:DV,createBlockNode:vT},DJ={BigNumberDependencies:bB,UnitDependencies:DM,createBohrMagneton:rY},DQ={BigNumberDependencies:bB,UnitDependencies:DM,createBohrRadius:r4},DX={BigNumberDependencies:bB,UnitDependencies:DM,createBoltzmann:nl},DY={typedDependencies:bI,createBoolean:a0},DK={addScalarDependencies:bj,combinationsDependencies:DO,divideScalarDependencies:Dc,isIntegerDependencies:b$,isNegativeDependencies:DB,multiplyScalarDependencies:Dg,typedDependencies:bI,createCatalan:lg},D0={BigNumberDependencies:bB,ComplexDependencies:bO,FractionDependencies:bq,isNegativeDependencies:DB,matrixDependencies:bL,typedDependencies:bI,unaryMinusDependencies:DA,createCbrt:cl},D1={typedDependencies:bI,createChainClass:vI},D2={ChainDependencies:D1,typedDependencies:bI,createChain:vU},D3={BigNumberDependencies:bB,UnitDependencies:DM,createClassicalElectronRadius:r5},D4={typedDependencies:bI,createClone:a2},D5={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,bignumberDependencies:Da,concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createSmaller:c8},D8={DenseMatrixDependencies:bz,smallerDependencies:D5,createImmutableDenseMatrixClass:lR},D6={typedDependencies:bI,createGetMatrixDataType:oT},D7={ImmutableDenseMatrixDependencies:D8,getMatrixDataTypeDependencies:D6,createIndexClass:lP},D9={typedDependencies:bI,createIsPositive:ck},Ne={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createLargerEq:lG},Nt={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createSmallerEq:pZ},Nr={bignumberDependencies:Da,matrixDependencies:bL,addDependencies:bZ,equalDependencies:bH,isPositiveDependencies:D9,isZeroDependencies:Dv,largerDependencies:Dq,largerEqDependencies:Ne,smallerDependencies:D5,smallerEqDependencies:Nt,typedDependencies:bI,createRange:fg},Nn={IndexDependencies:D7,matrixDependencies:bL,rangeDependencies:Nr,typedDependencies:bI,createColumn:fO},Ni={IndexDependencies:D7,matrixDependencies:bL,rangeDependencies:Nr,typedDependencies:bI,createColumnTransform:x0},Na={typedDependencies:bI,createCombinationsWithRep:sG},No={BigNumberDependencies:bB,DenseMatrixDependencies:bz,FractionDependencies:bq,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createCompare:lv},Ns={compareDependencies:No,typedDependencies:bI,createCompareNatural:pw},Nu={concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createCompareText:lD},Nc={NodeDependencies:bR,createConditionalNode:vO},Nl={typedDependencies:bI,createIsBounded:oz},Np={NodeDependencies:bR,isBoundedDependencies:Nl,createConstantNode:vL},Nf={NodeDependencies:bR,typedDependencies:bI,createFunctionAssignmentNode:vR},Nd={UnitDependencies:DM,NodeDependencies:bR,createSymbolNode:vX},Nm={NodeDependencies:bR,SymbolNodeDependencies:Nd,createFunctionNode:vK},Nh={NodeDependencies:bR,sizeDependencies:Db,createIndexNode:v$},Ng={NodeDependencies:bR,createObjectNode:vs},Ny={NodeDependencies:bR,createOperatorNode:vN},Nv={NodeDependencies:bR,createParenthesisNode:vA},Nx={NodeDependencies:bR,createRangeNode:vz},Nb={NodeDependencies:bR,createRelationalNode:vS},ND={AccessorNodeDependencies:bJ,ArrayNodeDependencies:b8,AssignmentNodeDependencies:Dt,BlockNodeDependencies:DW,ConditionalNodeDependencies:Nc,ConstantNodeDependencies:Np,FunctionAssignmentNodeDependencies:Nf,FunctionNodeDependencies:Nm,IndexNodeDependencies:Nh,ObjectNodeDependencies:Ng,OperatorNodeDependencies:Ny,ParenthesisNodeDependencies:Nv,RangeNodeDependencies:Nx,RelationalNodeDependencies:Nb,SymbolNodeDependencies:Nd,numericDependencies:Du,typedDependencies:bI,createParse:v1},NN={parseDependencies:ND,typedDependencies:bI,createCompile:v7},Nw={ComplexDependencies:bO,typedDependencies:bI,createComplex:a7},NA={addScalarDependencies:bj,combinationsDependencies:DO,isIntegerDependencies:b$,isNegativeDependencies:DB,isPositiveDependencies:D9,largerDependencies:Dq,typedDependencies:bI,createComposition:lw},NE={isIntegerDependencies:b$,matrixDependencies:bL,typedDependencies:bI,createConcatTransform:xP},NS={BigNumberDependencies:bB,UnitDependencies:DM,createConductanceQuantum:rK},NC={divideScalarDependencies:Dc,equalScalarDependencies:bP,invDependencies:DS,matrixDependencies:bL,multiplyDependencies:DN,typedDependencies:bI,createDivide:p2},NM={addDependencies:bZ,divideDependencies:NC,typedDependencies:bI,createMean:fu},NF={ComplexDependencies:bO,typedDependencies:bI,createSqrt:uh},NT={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,subtractScalarDependencies:Dw,typedDependencies:bI,unaryMinusDependencies:DA,createSubtract:c9},NB={addDependencies:bZ,numericDependencies:Du,typedDependencies:bI,createSum:pp},NO={addDependencies:bZ,divideDependencies:NC,matrixDependencies:bL,meanDependencies:NM,multiplyDependencies:DN,powDependencies:DC,sqrtDependencies:NF,subtractDependencies:NT,sumDependencies:NB,typedDependencies:bI,createCorr:f2},N_={typedDependencies:bI,createCos:or},Nz={typedDependencies:bI,createCosh:sW},Nq={BigNumberDependencies:bB,typedDependencies:bI,createCot:on},NI={BigNumberDependencies:bB,typedDependencies:bI,createCoth:uB},Nk={BigNumberDependencies:bB,UnitDependencies:DM,createCoulomb:rJ},NR={BigNumberDependencies:bB,UnitDependencies:DM,createCoulombConstant:rQ},NP={multiplyScalarDependencies:Dg,numericDependencies:Du,typedDependencies:bI,createProd:u7},NU={prodDependencies:NP,sizeDependencies:Db,typedDependencies:bI,createCount:cm},Nj={UnitDependencies:DM,typedDependencies:bI,createCreateUnit:fz},NL={matrixDependencies:bL,multiplyDependencies:DN,subtractDependencies:NT,typedDependencies:bI,createCross:lE},NH={BigNumberDependencies:bB,typedDependencies:bI,createCsc:oi},N$={BigNumberDependencies:bB,typedDependencies:bI,createCsch:sQ},NG={matrixDependencies:bL,typedDependencies:bI,createTranspose:ub},NZ={conjDependencies:Dx,transposeDependencies:NG,typedDependencies:bI,createCtranspose:u_},NV={typedDependencies:bI,createCube:oo},NW={numericDependencies:Du,typedDependencies:bI,createUnaryPlus:lr},NJ={addDependencies:bZ,typedDependencies:bI,unaryPlusDependencies:NW,createCumSum:pE},NQ={addDependencies:bZ,typedDependencies:bI,unaryPlusDependencies:NW,createCumSumTransform:xz},NX={equalDependencies:bH,typedDependencies:bI,createDeepEqual:cg},NY={createReplacer:iO},NK={ConstantNodeDependencies:Np,FunctionNodeDependencies:Nm,OperatorNodeDependencies:Ny,ParenthesisNodeDependencies:Nv,parseDependencies:ND,typedDependencies:bI,createResolve:v2},N0={bignumberDependencies:Da,fractionDependencies:Do,AccessorNodeDependencies:bJ,ArrayNodeDependencies:b8,ConstantNodeDependencies:Np,FunctionNodeDependencies:Nm,IndexNodeDependencies:Nh,ObjectNodeDependencies:Ng,OperatorNodeDependencies:Ny,SymbolNodeDependencies:Nd,isBoundedDependencies:Nl,matrixDependencies:bL,typedDependencies:bI,createSimplifyConstant:v8},N1={AccessorNodeDependencies:bJ,ArrayNodeDependencies:b8,ConstantNodeDependencies:Np,FunctionNodeDependencies:Nm,IndexNodeDependencies:Nh,ObjectNodeDependencies:Ng,OperatorNodeDependencies:Ny,ParenthesisNodeDependencies:Nv,SymbolNodeDependencies:Nd,addDependencies:bZ,divideDependencies:NC,equalDependencies:bH,isZeroDependencies:Dv,multiplyDependencies:DN,parseDependencies:ND,powDependencies:DC,subtractDependencies:NT,typedDependencies:bI,createSimplifyCore:xr},N2={AccessorNodeDependencies:bJ,ArrayNodeDependencies:b8,ConstantNodeDependencies:Np,FunctionNodeDependencies:Nm,IndexNodeDependencies:Nh,ObjectNodeDependencies:Ng,OperatorNodeDependencies:Ny,ParenthesisNodeDependencies:Nv,SymbolNodeDependencies:Nd,equalDependencies:bH,parseDependencies:ND,replacerDependencies:NY,resolveDependencies:NK,simplifyConstantDependencies:N0,simplifyCoreDependencies:N1,typedDependencies:bI,createSimplify:xp},N3={ConstantNodeDependencies:Np,FunctionNodeDependencies:Nm,OperatorNodeDependencies:Ny,ParenthesisNodeDependencies:Nv,SymbolNodeDependencies:Nd,equalDependencies:bH,isZeroDependencies:Dv,numericDependencies:Du,parseDependencies:ND,simplifyDependencies:N2,typedDependencies:bI,createDerivative:xh},N4={BigNumberDependencies:bB,UnitDependencies:DM,createDeuteronMass:nt},N5={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,matrixDependencies:bL,typedDependencies:bI,createDiag:uq},N8={matrixDependencies:bL,numberDependencies:Ds,subtractDependencies:NT,typedDependencies:bI,createDiff:lM},N6={bignumberDependencies:Da,matrixDependencies:bL,numberDependencies:Ds,subtractDependencies:NT,typedDependencies:bI,createDiffTransform:xL},N7={absDependencies:bk,addScalarDependencies:bj,deepEqualDependencies:NX,divideScalarDependencies:Dc,multiplyScalarDependencies:Dg,sqrtDependencies:NF,subtractScalarDependencies:Dw,typedDependencies:bI,createDistance:lT},N9={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,divideScalarDependencies:Dc,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createDotDivide:lO},we={concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,multiplyScalarDependencies:Dg,typedDependencies:bI,createDotMultiply:cN},wt={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,powDependencies:DC,typedDependencies:bI,createDotPow:f4},wr={BigNumberDependencies:bB,createE:rF},wn={BigNumberDependencies:bB,createEfimovFactor:ns},wi={typedDependencies:bI,createFlatten:ow},wa={typedDependencies:bI,createIm:oO},wo={flattenDependencies:wi,matrixDependencies:bL,sizeDependencies:Db,typedDependencies:bI,createMatrixFromColumns:u2},ws={BigNumberDependencies:bB,FractionDependencies:bq,complexDependencies:Nw,typedDependencies:bI,createSign:sx},wu={addScalarDependencies:bj,complexDependencies:Nw,conjDependencies:Dx,divideScalarDependencies:Dc,equalDependencies:bH,identityDependencies:Dy,isZeroDependencies:Dv,matrixDependencies:bL,multiplyScalarDependencies:Dg,signDependencies:ws,sqrtDependencies:NF,subtractScalarDependencies:Dw,typedDependencies:bI,unaryMinusDependencies:DA,zerosDependencies:bV,createQr:c2},wc={typedDependencies:bI,createRe:sg},wl={isIntegerDependencies:b$,matrixDependencies:bL,typedDependencies:bI,createReshape:ce},wp={typedDependencies:bI,createSin:sb},wf={DenseMatrixDependencies:bz,divideScalarDependencies:Dc,equalScalarDependencies:bP,matrixDependencies:bL,multiplyScalarDependencies:Dg,subtractScalarDependencies:Dw,typedDependencies:bI,createUsolve:li},wd={DenseMatrixDependencies:bz,divideScalarDependencies:Dc,equalScalarDependencies:bP,matrixDependencies:bL,multiplyScalarDependencies:Dg,subtractScalarDependencies:Dw,typedDependencies:bI,createUsolveAll:pm},wm={absDependencies:bk,addDependencies:bZ,addScalarDependencies:bj,atanDependencies:Dr,bignumberDependencies:Da,columnDependencies:Nn,complexDependencies:Nw,cosDependencies:N_,diagDependencies:N5,divideScalarDependencies:Dc,dotDependencies:DD,equalDependencies:bH,flattenDependencies:wi,imDependencies:wa,invDependencies:DS,largerDependencies:Dq,matrixDependencies:bL,matrixFromColumnsDependencies:wo,multiplyDependencies:DN,multiplyScalarDependencies:Dg,numberDependencies:Ds,qrDependencies:wu,reDependencies:wc,reshapeDependencies:wl,sinDependencies:wp,sizeDependencies:Db,smallerDependencies:D5,sqrtDependencies:NF,subtractDependencies:NT,typedDependencies:bI,usolveDependencies:wf,usolveAllDependencies:wd,createEigs:fq},wh={BigNumberDependencies:bB,UnitDependencies:DM,createElectricConstant:rV},wg={BigNumberDependencies:bB,UnitDependencies:DM,createElectronMass:r8},wy={BigNumberDependencies:bB,UnitDependencies:DM,createElementaryCharge:rX},wv={compareTextDependencies:Nu,isZeroDependencies:Dv,typedDependencies:bI,createEqualText:lz},wx={typedDependencies:bI,createErf:op},wb={parseDependencies:ND,typedDependencies:bI,createEvaluate:xi},wD={typedDependencies:bI,createExp:oy},wN={absDependencies:bk,addDependencies:bZ,identityDependencies:Dy,invDependencies:DS,multiplyDependencies:DN,typedDependencies:bI,createExpm:p4},ww={ComplexDependencies:bO,typedDependencies:bI,createExpm1:ox},wA={createFalse:rw},wE={BigNumberDependencies:bB,UnitDependencies:DM,createFaraday:np},wS={BigNumberDependencies:bB,UnitDependencies:DM,createFermiCoupling:r6},wC={ComplexDependencies:bO,createI:rk},wM={ComplexDependencies:bO,typedDependencies:bI,createLog2:o1},wF={BigNumberDependencies:bB,createTau:rM},wT={addScalarDependencies:bj,ceilDependencies:Dp,conjDependencies:Dx,divideScalarDependencies:Dc,dotDivideDependencies:N9,expDependencies:wD,iDependencies:wC,log2Dependencies:wM,matrixDependencies:bL,multiplyScalarDependencies:Dg,powDependencies:DC,tauDependencies:wF,typedDependencies:bI,createFft:p5},wB={largerDependencies:Dq,smallerDependencies:D5,createFibonacciHeapClass:lq},wO={typedDependencies:bI,createFilter:ob},w_={typedDependencies:bI,createFilterTransform:xM},wz={BigNumberDependencies:bB,createFineStructure:r7},wq={BigNumberDependencies:bB,UnitDependencies:DM,createFirstRadiation:nf},wI={typedDependencies:bI,createForEach:oE},wk={typedDependencies:bI,createForEachTransform:xF},wR={ComplexDependencies:bO,addDependencies:bZ,divideDependencies:NC,matrixDependencies:bL,multiplyDependencies:DN,typedDependencies:bI,createFreqz:p6},wP={BigNumberDependencies:bB,UnitDependencies:DM,createGasConstant:nm},wU={BigNumberDependencies:bB,DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,roundDependencies:Dl,typedDependencies:bI,zerosDependencies:bV,createGcd:cq},wj={BigNumberDependencies:bB,UnitDependencies:DM,createGravitationConstant:rH},wL={BigNumberDependencies:bB,UnitDependencies:DM,createGravity:nw},wH={BigNumberDependencies:bB,UnitDependencies:DM,createHartreeEnergy:r9},w$={isNumericDependencies:Dh,typedDependencies:bI,createHasNumericValue:sK},wG={evaluateDependencies:wb,createHelpClass:xa},wZ={HelpDependencies:wG,typedDependencies:bI,createHelp:xb},wV={formatDependencies:Dm,typedDependencies:bI,createHex:oB},wW={absDependencies:bk,addScalarDependencies:bj,divideScalarDependencies:Dc,isPositiveDependencies:D9,multiplyScalarDependencies:Dg,smallerDependencies:D5,sqrtDependencies:NF,typedDependencies:bI,createHypot:lk},wJ={conjDependencies:Dx,dotDivideDependencies:N9,fftDependencies:wT,typedDependencies:bI,createIfft:ft},wQ={IndexDependencies:D7,typedDependencies:bI,createIndex:pF},wX={IndexDependencies:D7,getMatrixDataTypeDependencies:D6,createIndexTransform:xX},wY={BigNumberDependencies:bB,createInfinity:rE},wK={absDependencies:bk,addDependencies:bZ,addScalarDependencies:bj,divideScalarDependencies:Dc,equalScalarDependencies:bP,flattenDependencies:wi,isNumericDependencies:Dh,isZeroDependencies:Dv,matrixDependencies:bL,multiplyDependencies:DN,multiplyScalarDependencies:Dg,smallerDependencies:D5,subtractDependencies:NT,typedDependencies:bI,createIntersect:lj},w0={BigNumberDependencies:bB,UnitDependencies:DM,createInverseConductanceQuantum:r0},w1={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,roundDependencies:Dl,typedDependencies:bI,zerosDependencies:bV,createMod:cM},w2={BigNumberDependencies:bB,matrixDependencies:bL,typedDependencies:bI,createXgcd:uN},w3={BigNumberDependencies:bB,addDependencies:bZ,equalDependencies:bH,isIntegerDependencies:b$,modDependencies:w1,smallerDependencies:D5,typedDependencies:bI,xgcdDependencies:w2,createInvmod:lH},w4={typedDependencies:bI,createMap:o2},w5={isBoundedDependencies:Nl,mapDependencies:w4,typedDependencies:bI,createIsFinite:s1},w8={typedDependencies:bI,createIsNaN:oR},w6={typedDependencies:bI,createIsPrime:oL},w7={typedDependencies:bI,createTypeOf:sI},w9={ComplexDependencies:bO,divideScalarDependencies:Dc,typeOfDependencies:w7,typedDependencies:bI,createLog:lW},Ae={divideDependencies:NC,dotDivideDependencies:N9,isNumericDependencies:Dh,logDependencies:w9,mapDependencies:w4,matrixDependencies:bL,multiplyDependencies:DN,sumDependencies:NB,typedDependencies:bI,createKldivergence:fn},At={BigNumberDependencies:bB,UnitDependencies:DM,createKlitzing:r3},Ar={matrixDependencies:bL,multiplyScalarDependencies:Dg,typedDependencies:bI,createKron:uX},An={BigNumberDependencies:bB,createLN10:rO},Ai={BigNumberDependencies:bB,createLN2:rB},Aa={BigNumberDependencies:bB,createLOG10E:rz},Ao={BigNumberDependencies:bB,createLOG2E:r_},As={concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createLcm:cL},Au={parseDependencies:ND,typedDependencies:bI,createLeafCount:xe},Ac={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createLeftShift:cZ},Al={ComplexDependencies:bO,typedDependencies:bI,createLgamma:oJ},Ap={ComplexDependencies:bO,typedDependencies:bI,createLog10:oK},Af={ComplexDependencies:bO,divideScalarDependencies:Dc,logDependencies:w9,typedDependencies:bI,createLog1p:pO},Ad={BigNumberDependencies:bB,UnitDependencies:DM,createLoschmidt:nd},Am={DenseMatrixDependencies:bz,divideScalarDependencies:Dc,equalScalarDependencies:bP,matrixDependencies:bL,multiplyScalarDependencies:Dg,subtractScalarDependencies:Dw,typedDependencies:bI,createLsolve:cJ},Ah={DenseMatrixDependencies:bz,divideScalarDependencies:Dc,equalScalarDependencies:bP,matrixDependencies:bL,multiplyScalarDependencies:Dg,subtractScalarDependencies:Dw,typedDependencies:bI,createLsolveAll:lQ},Ag={FibonacciHeapDependencies:wB,addScalarDependencies:bj,equalScalarDependencies:bP,createSpaClass:pi},Ay={DenseMatrixDependencies:bz,SpaDependencies:Ag,SparseMatrixDependencies:bU,absDependencies:bk,addScalarDependencies:bj,divideScalarDependencies:Dc,equalScalarDependencies:bP,largerDependencies:Dq,matrixDependencies:bL,multiplyScalarDependencies:Dg,subtractScalarDependencies:Dw,typedDependencies:bI,unaryMinusDependencies:DA,createLup:p_},Av={SparseMatrixDependencies:bU,absDependencies:bk,addDependencies:bZ,divideScalarDependencies:Dc,largerDependencies:Dq,largerEqDependencies:Ne,multiplyDependencies:DN,subtractDependencies:NT,transposeDependencies:NG,typedDependencies:bI,createSlu:pn},Ax={DenseMatrixDependencies:bz,lsolveDependencies:Am,lupDependencies:Ay,matrixDependencies:bL,sluDependencies:Av,typedDependencies:bI,usolveDependencies:wf,createLusolve:fo},Ab={absDependencies:bk,addDependencies:bZ,conjDependencies:Dx,ctransposeDependencies:NZ,eigsDependencies:wm,equalScalarDependencies:bP,largerDependencies:Dq,matrixDependencies:bL,multiplyDependencies:DN,powDependencies:DC,smallerDependencies:D5,sqrtDependencies:NF,typedDependencies:bI,createNorm:fL},AD={identityDependencies:Dy,matrixDependencies:bL,multiplyDependencies:DN,normDependencies:Ab,qrDependencies:wu,subtractDependencies:NT,typedDependencies:bI,createSchur:dl},AN={absDependencies:bk,addDependencies:bZ,concatDependencies:bG,identityDependencies:Dy,indexDependencies:wQ,lusolveDependencies:Ax,matrixDependencies:bL,matrixFromColumnsDependencies:wo,multiplyDependencies:DN,rangeDependencies:Nr,schurDependencies:AD,subsetDependencies:bW,subtractDependencies:NT,transposeDependencies:NG,typedDependencies:bI,createSylvester:df},Aw={matrixDependencies:bL,multiplyDependencies:DN,sylvesterDependencies:AN,transposeDependencies:NG,typedDependencies:bI,createLyap:dm},AA={compareDependencies:No,isNaNDependencies:w8,isNumericDependencies:Dh,typedDependencies:bI,createPartitionSelect:l3},AE={addDependencies:bZ,compareDependencies:No,divideDependencies:NC,partitionSelectDependencies:AA,typedDependencies:bI,createMedian:fl},AS={absDependencies:bk,mapDependencies:w4,medianDependencies:AE,subtractDependencies:NT,typedDependencies:bI,createMad:fR},AC={BigNumberDependencies:bB,UnitDependencies:DM,createMagneticConstant:rZ},AM={BigNumberDependencies:bB,UnitDependencies:DM,createMagneticFluxQuantum:r1},AF={isIntegerDependencies:b$,typedDependencies:bI,createMapSlices:uK},AT={isIntegerDependencies:b$,typedDependencies:bI,createMapSlicesTransform:xB},AB={typedDependencies:bI,createMapTransform:xC},AO={isZeroDependencies:Dv,matrixDependencies:bL,typedDependencies:bI,createMatrixFromFunction:s9},A_={flattenDependencies:wi,matrixDependencies:bL,sizeDependencies:Db,typedDependencies:bI,createMatrixFromRows:lY},Az={isNaNDependencies:w8,largerDependencies:Dq,numericDependencies:Du,typedDependencies:bI,createMax:cQ},Aq={isNaNDependencies:w8,largerDependencies:Dq,numericDependencies:Du,typedDependencies:bI,createMaxTransform:xH},AI={addDependencies:bZ,divideDependencies:NC,typedDependencies:bI,createMeanTransform:x2},Ak={isNaNDependencies:w8,numericDependencies:Du,smallerDependencies:D5,typedDependencies:bI,createMin:lK},AR={isNaNDependencies:w8,numericDependencies:Du,smallerDependencies:D5,typedDependencies:bI,createMinTransform:x$},AP={isNaNDependencies:w8,isNumericDependencies:Dh,typedDependencies:bI,createMode:o4},AU={BigNumberDependencies:bB,UnitDependencies:DM,createMolarMass:nD},Aj={BigNumberDependencies:bB,UnitDependencies:DM,createMolarMassC12:nN},AL={BigNumberDependencies:bB,UnitDependencies:DM,createMolarPlanckConstant:nh},AH={BigNumberDependencies:bB,UnitDependencies:DM,createMolarVolume:ng},A$={addDependencies:bZ,divideDependencies:NC,factorialDependencies:Dz,isIntegerDependencies:b$,isPositiveDependencies:D9,multiplyDependencies:DN,typedDependencies:bI,createMultinomial:fU},AG={BigNumberDependencies:bB,createNaN:rS},AZ={BigNumberDependencies:bB,UnitDependencies:DM,createNeutronMass:nr},AV={BigNumberDependencies:bB,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createNthRoot:cY},AW={ComplexDependencies:bO,divideScalarDependencies:Dc,typedDependencies:bI,createNthRoots:l1},AJ={BigNumberDependencies:bB,UnitDependencies:DM,createNuclearMagneton:r2},AQ={createNull:rA},AX={deepEqualDependencies:NX,flattenDependencies:wi,matrixDependencies:bL,sizeDependencies:Db,typedDependencies:bI,createNullish:c0},AY={deepEqualDependencies:NX,flattenDependencies:wi,matrixDependencies:bL,sizeDependencies:Db,typedDependencies:bI,createNullishTransform:xq},AK={formatDependencies:Dm,typedDependencies:bI,createOct:sn},A0={BigNumberDependencies:bB,matrixDependencies:bL,typedDependencies:bI,createOnes:ui},A1={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createOr:c1},A2={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createOrTransform:xG},A3={evaluateDependencies:wb,parseDependencies:ND,createParserClass:xo},A4={ParserDependencies:A3,typedDependencies:bI,createParser:xu},A5={factorialDependencies:Dz,typedDependencies:bI,createPermutations:f$},A8={BigNumberDependencies:bB,createPhi:rT},A6={BigNumberDependencies:bB,createPi:rC},A7={typedDependencies:bI,createPickRandom:su},A9={ComplexDependencies:bO,addDependencies:bZ,ctransposeDependencies:NZ,deepEqualDependencies:NX,divideScalarDependencies:Dc,dotDependencies:DD,dotDivideDependencies:N9,equalDependencies:bH,invDependencies:DS,matrixDependencies:bL,multiplyDependencies:DN,typedDependencies:bI,createPinv:pq},Ee={BigNumberDependencies:bB,UnitDependencies:DM,createPlanckCharge:nC},Et={BigNumberDependencies:bB,UnitDependencies:DM,createPlanckConstant:r$},Er={BigNumberDependencies:bB,UnitDependencies:DM,createPlanckLength:nA},En={BigNumberDependencies:bB,UnitDependencies:DM,createPlanckMass:nE},Ei={BigNumberDependencies:bB,UnitDependencies:DM,createPlanckTemperature:nM},Ea={BigNumberDependencies:bB,UnitDependencies:DM,createPlanckTime:nS},Eo={addDependencies:bZ,cbrtDependencies:D0,divideDependencies:NC,equalScalarDependencies:bP,imDependencies:wa,isZeroDependencies:Dv,multiplyDependencies:DN,reDependencies:wc,sqrtDependencies:NF,subtractDependencies:NT,typeOfDependencies:w7,typedDependencies:bI,unaryMinusDependencies:DA,createPolynomialRoot:ff},Es={typedDependencies:bI,createPrint:sp},Eu={addDependencies:bZ,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createPrintTransform:xk},Ec={BigNumberDependencies:bB,UnitDependencies:DM,createProtonMass:ne},El={bignumberDependencies:Da,addDependencies:bZ,compareDependencies:No,divideDependencies:NC,isIntegerDependencies:b$,largerDependencies:Dq,mapSlicesDependencies:AF,multiplyDependencies:DN,partitionSelectDependencies:AA,smallerDependencies:D5,smallerEqDependencies:Nt,subtractDependencies:NT,typedDependencies:bI,createQuantileSeq:fm},Ep={addDependencies:bZ,bignumberDependencies:Da,compareDependencies:No,divideDependencies:NC,isIntegerDependencies:b$,largerDependencies:Dq,mapSlicesDependencies:AF,multiplyDependencies:DN,partitionSelectDependencies:AA,smallerDependencies:D5,smallerEqDependencies:Nt,subtractDependencies:NT,typedDependencies:bI,createQuantileSeqTransform:xY},Ef={BigNumberDependencies:bB,UnitDependencies:DM,createQuantumOfCirculation:nn},Ed={typedDependencies:bI,createRandom:sh},Em={log2Dependencies:wM,typedDependencies:bI,createRandomInt:uo},Eh={createRangeClass:nX},Eg={bignumberDependencies:Da,matrixDependencies:bL,addDependencies:bZ,equalDependencies:bH,isPositiveDependencies:D9,isZeroDependencies:Dv,largerDependencies:Dq,largerEqDependencies:Ne,smallerDependencies:D5,smallerEqDependencies:Nt,typedDependencies:bI,createRangeTransform:xK},Ey={bignumberDependencies:Da,fractionDependencies:Do,AccessorNodeDependencies:bJ,ArrayNodeDependencies:b8,ConstantNodeDependencies:Np,FunctionNodeDependencies:Nm,IndexNodeDependencies:Nh,ObjectNodeDependencies:Ng,OperatorNodeDependencies:Ny,ParenthesisNodeDependencies:Nv,SymbolNodeDependencies:Nd,addDependencies:bZ,divideDependencies:NC,equalDependencies:bH,isZeroDependencies:Dv,matrixDependencies:bL,multiplyDependencies:DN,parseDependencies:ND,powDependencies:DC,simplifyDependencies:N2,simplifyConstantDependencies:N0,simplifyCoreDependencies:N1,subtractDependencies:NT,typedDependencies:bI,createRationalize:xN},Ev={BigNumberDependencies:bB,UnitDependencies:DM,createReducedPlanckConstant:rG},Ex={matrixDependencies:bL,createResize:uu},Eb={createReviver:vq},ED={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createRightArithShift:c4},EN={DenseMatrixDependencies:bz,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createRightLogShift:l5},Ew={BigNumberDependencies:bB,DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,addScalarDependencies:bj,cosDependencies:N_,matrixDependencies:bL,multiplyScalarDependencies:Dg,normDependencies:Ab,sinDependencies:wp,typedDependencies:bI,unaryMinusDependencies:DA,createRotationMatrix:fV},EA={multiplyDependencies:DN,rotationMatrixDependencies:Ew,typedDependencies:bI,createRotate:da},EE={IndexDependencies:D7,matrixDependencies:bL,rangeDependencies:Nr,typedDependencies:bI,createRow:fy},ES={IndexDependencies:D7,matrixDependencies:bL,rangeDependencies:Nr,typedDependencies:bI,createRowTransform:x1},EC={BigNumberDependencies:bB,UnitDependencies:DM,createRydberg:ni},EM={BigNumberDependencies:bB,createSQRT1_2:rq},EF={BigNumberDependencies:bB,createSQRT2:rI},ET={BigNumberDependencies:bB,createSackurTetrode:ny},EB={BigNumberDependencies:bB,typedDependencies:bI,createSec:sy},EO={BigNumberDependencies:bB,typedDependencies:bI,createSech:ul},E_={BigNumberDependencies:bB,UnitDependencies:DM,createSecondRadiation:nv},Ez={DenseMatrixDependencies:bz,IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetCartesian:pR},Eq={DenseMatrixDependencies:bz,IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetDifference:fx},EI={DenseMatrixDependencies:bz,IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetDistinct:pU},Ek={DenseMatrixDependencies:bz,IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetIntersect:f8},ER={IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetIsSubset:pL},EP={IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetMultiplicity:fD},EU={IndexDependencies:D7,compareNaturalDependencies:Ns,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetPowerset:p$},Ej={compareNaturalDependencies:Ns,typedDependencies:bI,createSetSize:fJ},EL={IndexDependencies:D7,concatDependencies:bG,setDifferenceDependencies:Eq,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetSymDifference:fw},EH={IndexDependencies:D7,concatDependencies:bG,setIntersectDependencies:Ek,setSymDifferenceDependencies:EL,sizeDependencies:Db,subsetDependencies:bW,typedDependencies:bI,createSetUnion:du},E$={typedDependencies:bI,createSinh:uf},EG={absDependencies:bk,addDependencies:bZ,bignumberDependencies:Da,divideDependencies:NC,isNegativeDependencies:DB,isPositiveDependencies:D9,largerDependencies:Dq,mapDependencies:w4,matrixDependencies:bL,maxDependencies:Az,multiplyDependencies:DN,smallerDependencies:D5,subtractDependencies:NT,typedDependencies:bI,unaryMinusDependencies:DA,createSolveODE:fC},EZ={compareDependencies:No,compareNaturalDependencies:Ns,matrixDependencies:bL,typedDependencies:bI,createSort:pJ},EV={SparseMatrixDependencies:bU,typedDependencies:bI,createSparse:um},EW={BigNumberDependencies:bB,UnitDependencies:DM,createSpeedOfLight:rL},EJ={typedDependencies:bI,createSplitUnit:sE},EQ={absDependencies:bk,addDependencies:bZ,identityDependencies:Dy,invDependencies:DS,mapDependencies:w4,maxDependencies:Az,multiplyDependencies:DN,sizeDependencies:Db,sqrtDependencies:NF,subtractDependencies:NT,typedDependencies:bI,createSqrtm:pX},EX={typedDependencies:bI,createSquare:sC},EY={typedDependencies:bI,createSqueeze:uy},EK={addDependencies:bZ,divideDependencies:NC,isNaNDependencies:w8,mapSlicesDependencies:AF,multiplyDependencies:DN,subtractDependencies:NT,typedDependencies:bI,createVariance:fY},E0={mapDependencies:w4,sqrtDependencies:NF,typedDependencies:bI,varianceDependencies:EK,createStd:f6},E1={mapDependencies:w4,sqrtDependencies:NF,typedDependencies:bI,varianceDependencies:EK,createStdTransform:x3},E2={BigNumberDependencies:bB,UnitDependencies:DM,createStefanBoltzmann:nx},E3={typedDependencies:bI,createString:sF},E4={addDependencies:bZ,matrixDependencies:bL,typedDependencies:bI,zerosDependencies:bV,createSubsetTransform:xZ},E5={addDependencies:bZ,numericDependencies:Du,typedDependencies:bI,createSumTransform:xW},E8={OperatorNodeDependencies:Ny,parseDependencies:ND,simplifyDependencies:N2,typedDependencies:bI,createSymbolicEqual:xd},E6={typedDependencies:bI,createTan:sO},E7={typedDependencies:bI,createTanh:uv},E9={BigNumberDependencies:bB,UnitDependencies:DM,createThomsonCrossSection:na},Se={concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createTo:le},St={typedDependencies:bI,createToBest:sz},Sr={addDependencies:bZ,matrixDependencies:bL,typedDependencies:bI,createTrace:pf},Sn={createTrue:rN},Si={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,equalScalarDependencies:bP,matrixDependencies:bL,typedDependencies:bI,createUnequal:pK},Sa={UnitDependencies:DM,typedDependencies:bI,createUnitFunction:dt},So={eDependencies:wr,createUppercaseE:rP},Ss={piDependencies:A6,createUppercasePi:rR},Su={BigNumberDependencies:bB,UnitDependencies:DM,createVacuumImpedance:rW},Sc={addDependencies:bZ,divideDependencies:NC,isNaNDependencies:w8,mapSlicesDependencies:AF,multiplyDependencies:DN,subtractDependencies:NT,typedDependencies:bI,createVarianceTransform:xQ},Sl={createVersion:rU},Sp={BigNumberDependencies:bB,createWeakMixingAngle:no},Sf={BigNumberDependencies:bB,UnitDependencies:DM,createWienDisplacement:nb},Sd={DenseMatrixDependencies:bz,SparseMatrixDependencies:bU,concatDependencies:bG,matrixDependencies:bL,typedDependencies:bI,createXor:la},Sm={BigNumberDependencies:bB,ComplexDependencies:bO,addDependencies:bZ,divideDependencies:NC,equalDependencies:bH,factorialDependencies:Dz,gammaDependencies:D_,isBoundedDependencies:Nl,isNegativeDependencies:DB,multiplyDependencies:DN,piDependencies:A6,powDependencies:DC,sinDependencies:wp,smallerEqDependencies:Nt,subtractDependencies:NT,typedDependencies:bI,createZeta:f0},Sh={ComplexDependencies:bO,addDependencies:bZ,multiplyDependencies:DN,numberDependencies:Ds,typedDependencies:bI,createZpk2tf:pg},Sg=n,Sy=r(51504);function Sv(e,t){var r,n,o,s=i({},a,t);if("function"!=typeof Object.create)throw Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var u=((r={isNumber:y,isComplex:b,isBigNumber:v,isBigInt:x,isFraction:D,isUnit:N,isString:w,isArray:A,isMatrix:E,isCollection:S,isDenseMatrix:C,isSparseMatrix:M,isRange:F,isIndex:T,isBoolean:B,isResultSet:O,isHelp:_,isFunction:z,isDate:q,isRegExp:I,isObject:k,isMap:R,isPartitionedMap:P,isObjectWrappingMap:U,isNull:j,isUndefined:L,isAccessorNode:H,isArrayNode:$,isAssignmentNode:G,isBlockNode:Z,isConditionalNode:V,isConstantNode:W,isFunctionAssignmentNode:Q,isFunctionNode:X,isIndexNode:Y,isNode:K,isObjectNode:ee,isOperatorNode:et,isParenthesisNode:er,isRangeNode:en,isRelationalNode:ei,isSymbolNode:ea,isChain:eo}).on=(n=new Sy).on.bind(n),r.off=n.off.bind(n),r.once=n.once.bind(n),r.emit=n.emit.bind(n),r);u.config=function(e,t){function r(n){if(!n)return eu(e);if(void 0!==n.epsilon){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');var i=eu(n);return i.relTol=n.epsilon,i.absTol=.001*n.epsilon,delete i.epsilon,r(i)}!0===n.legacySubset&&console.warn('Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated in the future.');var a=eu(e);eh(n,"matrix",ed),eh(n,"number",em),function e(t,r){if(Array.isArray(r))throw TypeError("Arrays are not supported by deepExtend");for(var n in r)if(ef(r,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else if(Array.isArray(r[n]))throw TypeError("Arrays are not supported by deepExtend");else t[n]=r[n];return t}(e,n);var o=eu(e);return t("config",o,a,eu(n)),o}return r.MATRIX_OPTIONS=ed,r.NUMBER_OPTIONS=em,Object.keys(a).forEach(t=>{Object.defineProperty(r,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),r}(s,u.emit),u.expression={transform:{},mathWithTransform:{config:u.config}};var c={};function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return u.typed.apply(u.typed,t)}l.isTypedFunction=iM.isTypedFunction;var p=function(e,t,r,n){function i(e,t){t&&"function"==typeof t.transform?(r.expression.transform[e]=t.transform,ef(s,e)||(r.expression.mathWithTransform[e]=t.transform)):(delete r.expression.transform[e],ef(s,e)||(r.expression.mathWithTransform[e]=t))}function a(e){delete r.expression.transform[e],ef(s,e)?delete r.expression.mathWithTransform[e]:r.expression.mathWithTransform[e]=r[e]}function o(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction}var s={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(t,u){var c=arguments.length;if(1!==c&&2!==c)throw new us("import",c,1,2);u||(u={});var l={};for(var p in!function e(t,r,n){if(Array.isArray(r))r.forEach(r=>e(t,r));else{var i;if(k(r)||"object"==typeof(i=r)&&"Module"===i[Symbol.toStringTag])for(var a in r)ef(r,a)&&e(t,r[a],a);else if(tU(r)||void 0!==n){var s=tU(r)?o(r)?r.fn+".transform":r.fn:n;if(ef(t,s)&&t[s]!==r&&!u.silent)throw Error('Cannot import "'+s+'" twice');t[s]=r}else if(!u.silent)throw TypeError("Factory, Object, or Array expected")}}(l,t),l)if(ef(l,p)){var f,d=l[p];if(tU(d))!function(t,i){var u,c,l,p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(p.includes("."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(p));var f=o(t)?r.expression.transform:r,d=p in r.expression.transform,m=ef(f,p)?f[p]:void 0,h=function(){var n={};t.dependencies.map(tj).forEach(e=>{if(e.includes("."))throw Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=r:"mathWithTransform"===e?n.mathWithTransform=r.expression.mathWithTransform:"classes"===e?n.classes=r:n[e]=r[e]});var a=t(n);if(a&&"function"==typeof a.transform)throw Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(void 0===m||i.override)return a;if(e.isTypedFunction(m)&&e.isTypedFunction(a))return e(m,a);if(i.silent)return m;throw Error('Cannot import "'+p+'": already exists')},g=null!=(c=null==(l=t.meta)?void 0:l.formerly)?c:"",y=o(t)||!(u=t).fn.includes(".")&&!ef(s,u.fn)&&(!u.meta||!u.meta.isClass),v=r.expression.mathWithTransform;t.meta&&!1===t.meta.lazy?(f[p]=h(),g&&(f[g]=f[p])):(ep(f,p,h),g&&ep(f,g,h)),m&&d?(a(p),g&&a(g)):y&&(ep(v,p,()=>f[p]),g&&ep(v,g,()=>f[p])),n[p]=t,r.emit("import",p,h)}(d,u);else{if("function"==typeof(f=d)||"number"==typeof f||"string"==typeof f||"boolean"==typeof f||null===f||N(f)||b(f)||v(f)||D(f)||E(f)||Array.isArray(f))!function(t,a,o){if(o.wrap&&"function"==typeof a&&(a=function(e){var t=function(){for(var t=[],n=0,i=arguments.length;n<i;n++){var a=arguments[n];t[n]=a&&a.valueOf()}return e.apply(r,t)};return e.transform&&(t.transform=e.transform),t}(a)),"function"==typeof(s=a)&&"string"==typeof s.signature&&(a=e(t,{[a.signature]:a})),e.isTypedFunction(r[t])&&e.isTypedFunction(a)){a=o.override?e(t,a.signatures):e(r[t],a),r[t]=a,delete n[t],i(t,a),r.emit("import",t,function(){return a});return}var s,u,c=void 0!==r[t],l=null==(u=r.Unit)?void 0:u.isValuelessUnit(t);if(!c&&!l||o.override){r[t]=a,delete n[t],i(t,a),r.emit("import",t,function(){return a});return}if(!o.silent)throw Error('Cannot import "'+t+'": already exists')}(p,d,u);else if(!u.silent)throw TypeError("Factory, Object, or Array expected")}}}}(l,0,u,c);return u.import=p,u.on("config",()=>{Object.values(c).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&p(e,{override:!0})})}),u.create=Sv.bind(null,e),u.factory=tP,u.import(Object.values((function e(t,r){for(var n in t)if(ef(t,n)){var i=t[n];"object"==typeof i&&null!==i?e(i,r):r[n]=i}}(e,o={}),o))),u.ArgumentsError=us,u.DimensionError=n6,u.IndexError=n7,u}}};