hs-admin-ui 14.3.5 → 14.3.6

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 (306) hide show
  1. package/dist/{401-BJUEr3zO.js → 401--ngJ_50u.js} +1 -1
  2. package/dist/{401-DyZSrD8U.mjs → 401-CGOUTcLL.mjs} +1 -1
  3. package/dist/{404-BcDKlaGx.js → 404-BktDbggf.js} +1 -1
  4. package/dist/404-BktDbggf.js.gz +0 -0
  5. package/dist/{404-ClZOl-js.mjs → 404-BlncZvYz.mjs} +1 -1
  6. package/dist/404-BlncZvYz.mjs.gz +0 -0
  7. package/dist/{account-B2-uWJeI.js → account-R0I5gVjg.js} +1 -1
  8. package/dist/{account-CxbVNBQp.mjs → account-ufR9s3SN.mjs} +1 -1
  9. package/dist/{aside-CTvKXsHj.mjs → aside-BOEBZGDG.mjs} +3 -3
  10. package/dist/{aside-DeyW4MuG.js → aside-DFEw9i90.js} +1 -1
  11. package/dist/{auth_test-DvRVg1gn.mjs → auth_test-B3bj8AYu.mjs} +1 -1
  12. package/dist/{auth_test-CmiMmny2.js → auth_test-C8YufYV9.js} +1 -1
  13. package/dist/{baseFormConfig-BoY7hYVi.mjs → baseFormConfig-4T2ox4Tl.mjs} +1 -1
  14. package/dist/baseFormConfig-4T2ox4Tl.mjs.gz +0 -0
  15. package/dist/{baseFormConfig-BqLcOsrp.js → baseFormConfig-XuA8Nq7M.js} +1 -1
  16. package/dist/{baseTableConfig-__g4cUyA.js → baseTableConfig-Bx14m1cu.js} +1 -1
  17. package/dist/baseTableConfig-Bx14m1cu.js.gz +0 -0
  18. package/dist/{baseTableConfig-C-36fjTX.mjs → baseTableConfig-D0FN0Bed.mjs} +1 -1
  19. package/dist/baseTableConfig-D0FN0Bed.mjs.gz +0 -0
  20. package/dist/{bcFormConfig-DU3QWdyO.js → bcFormConfig-DCFf5e_l.js} +1 -1
  21. package/dist/{bcFormConfig-BtzlYW1K.mjs → bcFormConfig-Dd0P2LIv.mjs} +1 -1
  22. package/dist/{bcPageTreeBySystem.vue_vue_type_script_setup_true_lang-BhwoWzew.mjs → bcPageTreeBySystem.vue_vue_type_script_setup_true_lang-BTh_qc2h.mjs} +2 -2
  23. package/dist/{bcPageTreeBySystem.vue_vue_type_script_setup_true_lang-DuYbZhwl.js → bcPageTreeBySystem.vue_vue_type_script_setup_true_lang-BZ42SlZS.js} +1 -1
  24. package/dist/{bcSwitchSystems.vue_vue_type_script_setup_true_lang-CpFftdvp.mjs → bcSwitchSystems.vue_vue_type_script_setup_true_lang-BHb9Qu73.mjs} +2 -2
  25. package/dist/{bcSwitchSystems.vue_vue_type_script_setup_true_lang-R9Oi7LF-.js → bcSwitchSystems.vue_vue_type_script_setup_true_lang-bWBtgF6v.js} +1 -1
  26. package/dist/{btnIndex-gHoEFTpO.js → btnIndex--H75NnPc.js} +1 -1
  27. package/dist/{btnIndex-PrpEhj29.mjs → btnIndex-Cg8sFJ_2.mjs} +3 -3
  28. package/dist/btnIndex-Cg8sFJ_2.mjs.gz +0 -0
  29. package/dist/{classic-BYfdAB_8.mjs → classic-5wiIzqFD.mjs} +5 -5
  30. package/dist/{classic-DNmufrvZ.js → classic-BCMq22Ul.js} +1 -1
  31. package/dist/{cloneConfigDialog-D6so2lng.mjs → cloneConfigDialog-CArBGtHG.mjs} +3 -3
  32. package/dist/cloneConfigDialog-CArBGtHG.mjs.gz +0 -0
  33. package/dist/{cloneConfigDialog-BdXVqg1W.js → cloneConfigDialog-CqIkrY-S.js} +1 -1
  34. package/dist/cloneConfigDialog-CqIkrY-S.js.gz +0 -0
  35. package/dist/{columns-DCFlK4P-.mjs → columns-DaD_JmCP.mjs} +5 -5
  36. package/dist/{columns-BC0xHmZp.js → columns-lTHumBOK.js} +1 -1
  37. package/dist/{columnsAside-O2gA-HuW.mjs → columnsAside-BQ-Fj4rF.mjs} +1 -1
  38. package/dist/{columnsAside-BWvqySQt.js → columnsAside-ONjE9tqg.js} +1 -1
  39. package/dist/{contextmenu-CT9cUskm.mjs → contextmenu-CRWiw-6B.mjs} +1 -1
  40. package/dist/{contextmenu-CKs3a92_.js → contextmenu-DrES7YhT.js} +1 -1
  41. package/dist/{contextmenu-IHw5xEmo.js → contextmenu-DwEvTut2.js} +1 -1
  42. package/dist/{contextmenu-BWDufxZx.mjs → contextmenu-RnDwE8sD.mjs} +1 -1
  43. package/dist/{copyMenuConfig-BlG88Qnw.mjs → copyMenuConfig-2cg9ssJd.mjs} +1 -1
  44. package/dist/{copyMenuConfig-DKzRhCbi.js → copyMenuConfig-BxrIFgyr.js} +1 -1
  45. package/dist/{copyMenuConfig.vue_vue_type_script_setup_true_lang-D8XHvcqc.mjs → copyMenuConfig.vue_vue_type_script_setup_true_lang-BX4AL3IU.mjs} +2 -2
  46. package/dist/{copyMenuConfig.vue_vue_type_script_setup_true_lang-CgDZzoH-.js → copyMenuConfig.vue_vue_type_script_setup_true_lang-CXAwYRMy.js} +1 -1
  47. package/dist/{copySystem-uu32iiUK.js → copySystem-CMrSR8-J.js} +1 -1
  48. package/dist/{copySystem-B_QAuOq9.mjs → copySystem-Cd_Kj_ub.mjs} +1 -1
  49. package/dist/{copySystem.vue_vue_type_script_setup_true_lang-Ckac6qvO.mjs → copySystem.vue_vue_type_script_setup_true_lang-MLxkNb1K.mjs} +2 -2
  50. package/dist/{copySystem.vue_vue_type_script_setup_true_lang-Cy8VRAwd.js → copySystem.vue_vue_type_script_setup_true_lang-c5DD6kLt.js} +1 -1
  51. package/dist/{defaults--pHZUp5W.js → defaults-B5UsIFbm.js} +1 -1
  52. package/dist/{defaults-CJaCmyLm.mjs → defaults-CNoT-uye.mjs} +4 -4
  53. package/dist/{dialog-CrLdTw0o.mjs → dialog-B4pR3NJ3.mjs} +1 -1
  54. package/dist/{dialog-Bj1j3bsR.mjs → dialog-CdNh1SYF.mjs} +1 -1
  55. package/dist/{dialog-BTgJq6e7.js → dialog-DMCoapek.js} +1 -1
  56. package/dist/{dialog-BTlXhs91.js → dialog-MpsgSlrh.js} +1 -1
  57. package/dist/{dialog-ijftGbX9.mjs → dialog-cST6tsX1.mjs} +1 -1
  58. package/dist/{dialog-Co56VSQ0.js → dialog-oR4R2bkJ.js} +1 -1
  59. package/dist/{dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-DUFUKrPR.mjs → dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-BR84_5ZH.mjs} +3 -3
  60. package/dist/{dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-Wfk1HEoh.js → dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-C_Ftu6fe.js} +1 -1
  61. package/dist/{dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-CUy3zGzb.js → dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-Di5Hb7mX.js} +1 -1
  62. package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-Di5Hb7mX.js.gz +0 -0
  63. package/dist/{dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-ySB3VYsq.mjs → dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-rDb5ZVOh.mjs} +2 -2
  64. package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-rDb5ZVOh.mjs.gz +0 -0
  65. package/dist/{dictDialog-CiN_ca7Q.js → dictDialog-BW0mFcH5.js} +1 -1
  66. package/dist/{dictDialog-C6a8v_ir.mjs → dictDialog-C4vkcTbW.mjs} +1 -1
  67. package/dist/{dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-BVkmyrrf.js → dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-KofbnwFW.js} +1 -1
  68. package/dist/{dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-Ca4fDjQ7.mjs → dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-wDJ1eRxw.mjs} +2 -2
  69. package/dist/{dictItemDialog-Bq2TLnMf.mjs → dictItemDialog-CMlxJGmJ.mjs} +1 -1
  70. package/dist/{dictItemDialog-CJ-ILs97.js → dictItemDialog-F2yvuOWh.js} +1 -1
  71. package/dist/{dictItemDialog.vue_vue_type_script_setup_true_lang-C89aRRF2.mjs → dictItemDialog.vue_vue_type_script_setup_true_lang-BZIJ_pVI.mjs} +2 -2
  72. package/dist/{dictItemDialog.vue_vue_type_script_setup_true_lang-BCglhGsL.js → dictItemDialog.vue_vue_type_script_setup_true_lang-BpLJ7WLD.js} +1 -1
  73. package/dist/{formConfig-BYAbq4At.mjs → formConfig-Cexj2vB3.mjs} +6 -6
  74. package/dist/formConfig-Cexj2vB3.mjs.gz +0 -0
  75. package/dist/{formConfig-CKr3xMFQ.js → formConfig-DaXuMFFU.js} +1 -1
  76. package/dist/formConfig-DaXuMFFU.js.gz +0 -0
  77. package/dist/{header-B4ZiE_bp.js → header-BXnpnVlR.js} +1 -1
  78. package/dist/{header-CXurt7Q9.mjs → header-Bwbr1uva.mjs} +2 -2
  79. package/dist/{horizontal-CUkgD5d9.js → horizontal-BNPOllP-.js} +1 -1
  80. package/dist/{horizontal-CVXrDwSU.mjs → horizontal-DBHqvwVp.mjs} +2 -2
  81. package/dist/{hsAttrBtn-KoIYVYnh.mjs → hsAttrBtn-BGmpcdnY.mjs} +1 -1
  82. package/dist/{hsAttrBtn-CMaSrkZ0.js → hsAttrBtn-BzvIUFxK.js} +1 -1
  83. package/dist/{hsAttrBtn.vue_vue_type_script_setup_true_lang-DipXiAzi.mjs → hsAttrBtn.vue_vue_type_script_setup_true_lang-VRxRfrl_.mjs} +4 -4
  84. package/dist/{hsAttrBtn.vue_vue_type_script_setup_true_lang-Cr0SrGIH.js → hsAttrBtn.vue_vue_type_script_setup_true_lang-y4vu8UvW.js} +1 -1
  85. package/dist/{hsAttrForm-DM38Da51.js → hsAttrForm-B7yESywK.js} +1 -1
  86. package/dist/{hsAttrForm-DokzviMQ.mjs → hsAttrForm-D6UkJ-Kj.mjs} +1 -1
  87. package/dist/{hsAttrForm.vue_vue_type_script_setup_true_lang-C7ilfnzl.js → hsAttrForm.vue_vue_type_script_setup_true_lang-BIk2ARNn.js} +1 -1
  88. package/dist/{hsAttrForm.vue_vue_type_script_setup_true_lang-DBdnIjyR.mjs → hsAttrForm.vue_vue_type_script_setup_true_lang-B_wTaIce.mjs} +4 -4
  89. package/dist/hsAttrForm.vue_vue_type_script_setup_true_lang-B_wTaIce.mjs.gz +0 -0
  90. package/dist/{hsBtnConfigList-CIT00il7.js → hsBtnConfigList-CuXQzFre.js} +1 -1
  91. package/dist/{hsBtnConfigList-B-AkTj0g.mjs → hsBtnConfigList-DcRF5BRd.mjs} +1 -1
  92. package/dist/{hsBtnItemConfig-B5G3jYsU.js → hsBtnItemConfig-B_SAnsco.js} +1 -1
  93. package/dist/{hsBtnItemConfig-BMt9ptEF.mjs → hsBtnItemConfig-C1cUsLih.mjs} +1 -1
  94. package/dist/{hsBtnItemConfig.vue_vue_type_script_setup_true_lang-avhu_9Jn.mjs → hsBtnItemConfig.vue_vue_type_script_setup_true_lang-BsbIbcYA.mjs} +3 -3
  95. package/dist/{hsBtnItemConfig.vue_vue_type_script_setup_true_lang-DdwHag1m.js → hsBtnItemConfig.vue_vue_type_script_setup_true_lang-D-SZ6H9p.js} +1 -1
  96. package/dist/{hsBtnPanel-BrXPGYFF.js → hsBtnPanel-B3HreNs8.js} +1 -1
  97. package/dist/{hsBtnPanel-X1IW-LoR.mjs → hsBtnPanel-CY7EUbLP.mjs} +1 -1
  98. package/dist/{hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-BCMW5jp0.mjs → hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CouYgjV6.mjs} +4 -4
  99. package/dist/{hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-k5quE0gT.js → hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-Cq5e-k-E.js} +1 -1
  100. package/dist/{hsExpand-4spGm1vU.mjs → hsExpand-Bt_oTuLP.mjs} +1 -1
  101. package/dist/{hsExpand-DYCVn1VX.js → hsExpand-Caz700ii.js} +1 -1
  102. package/dist/{hsExpand.vue_vue_type_script_setup_true_lang-Cup6IkEq.js → hsExpand.vue_vue_type_script_setup_true_lang-DDhDDEL1.js} +1 -1
  103. package/dist/{hsExpand.vue_vue_type_script_setup_true_lang-Bd5J9vu6.mjs → hsExpand.vue_vue_type_script_setup_true_lang-DMWD4qNN.mjs} +1 -1
  104. package/dist/{hsFormConfig-Pv78QMfT.js → hsFormConfig-ByeJg2Qr.js} +1 -1
  105. package/dist/{hsFormConfig-Bv6H8FLR.mjs → hsFormConfig-DoJ8yr03.mjs} +1 -1
  106. package/dist/{hsFormConfigList-D9tcRHNw.js → hsFormConfigList-BPkuJfAB.js} +1 -1
  107. package/dist/{hsFormConfigList-B8i5Mbv1.mjs → hsFormConfigList-Dtr3cEpk.mjs} +2 -2
  108. package/dist/hsFormConfigList-Dtr3cEpk.mjs.gz +0 -0
  109. package/dist/{hsFormPanel-Cfa3pP0-.js → hsFormPanel-7KRX-JNw.js} +1 -1
  110. package/dist/{hsFormPanel-CU8Oy_Qj.mjs → hsFormPanel-DVRJz_oT.mjs} +6 -6
  111. package/dist/hsFormPanel-DVRJz_oT.mjs.gz +0 -0
  112. package/dist/{hsFormParse-BMmCiNCz.mjs → hsFormParse-C_5YPCm5.mjs} +1 -1
  113. package/dist/{hsFormParse-D-Q3l3fm.js → hsFormParse-OyV8UrGS.js} +1 -1
  114. package/dist/{hsFormParse.vue_vue_type_script_setup_true_lang-B4WWVeQa.mjs → hsFormParse.vue_vue_type_script_setup_true_lang-BODh05dh.mjs} +3 -3
  115. package/dist/{hsFormParse.vue_vue_type_script_setup_true_lang-ByuZOc9E.js → hsFormParse.vue_vue_type_script_setup_true_lang-u1JxyCro.js} +1 -1
  116. package/dist/{hsPanelItem-C7NVUG18.mjs → hsPanelItem-BMjHgrHF.mjs} +1 -1
  117. package/dist/{hsPanelItem-VHlIkruS.js → hsPanelItem-BgLUf7Iz.js} +1 -1
  118. package/dist/{hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-Bz6BR-F1.mjs → hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-D_OcYz90.mjs} +1 -1
  119. package/dist/{hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-CRqXqQbX.js → hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-IpNSWCDb.js} +1 -1
  120. package/dist/{index copy-CpCrOoBA.js → index copy-C-0fZXYu.js } +1 -1
  121. package/dist/{index copy-CTVbzQdm.js → index copy-C_bPft-R.js } +1 -1
  122. package/dist/index copy-C_bPft-R.js.gz +0 -0
  123. package/dist/{index copy-BhY2wW0m.mjs → index copy-CymLhoDM.mjs } +1 -1
  124. package/dist/{index copy-mrzLswh9.mjs → index copy-DEA4upSu.mjs } +1 -1
  125. package/dist/index copy-DEA4upSu.mjs.gz +0 -0
  126. package/dist/{index-DVjawejP.js → index-2LCHSvt_.js} +1 -1
  127. package/dist/{index-B31o9vyr.mjs → index-2RSw_vEf.mjs} +5 -5
  128. package/dist/{index-CQJfysj5.js → index-4zddx3cP.js} +1 -1
  129. package/dist/{index-CvzlF3PD.mjs → index-5vKXtyoV.mjs} +1 -1
  130. package/dist/{index-C_Osh4YS.js → index-B2jnERDZ.js} +1 -1
  131. package/dist/{index-DeheFDPn.mjs → index-B3CGFEBm.mjs} +3 -3
  132. package/dist/{index-BUXy_JFx.js → index-B67cdsc8.js} +1 -1
  133. package/dist/{index-Bq6HBnVN.mjs → index-B89ZVnAY.mjs} +4 -4
  134. package/dist/{index-BViQn-K7.mjs → index-BA9LDJLu.mjs} +1 -1
  135. package/dist/{index-CGTOLXFq.mjs → index-BKbAJdkf.mjs} +1 -1
  136. package/dist/{index-B0F8IKcg.js → index-BM7au2Mx.js} +1 -1
  137. package/dist/{index-DRQqujwQ.js → index-BRl3XF5Q.js} +1 -1
  138. package/dist/{index-CNQjdHS-.mjs → index-BYzabQCT.mjs} +10 -10
  139. package/dist/index-BYzabQCT.mjs.gz +0 -0
  140. package/dist/{index-Bg__Ky_C.mjs → index-BamW9tgP.mjs} +3 -3
  141. package/dist/{index-DNvwLdv3.mjs → index-Bb105wrG.mjs} +1 -1
  142. package/dist/{index-DS1t4Gm4.js → index-BgOvNdpd.js} +1 -1
  143. package/dist/{index-D04GsTN9.mjs → index-Bi5xr8hu.mjs} +3 -3
  144. package/dist/{index-BQPWwjz6.js → index-Bm-3Vmp7.js} +3 -3
  145. package/dist/index-Bm-3Vmp7.js.gz +0 -0
  146. package/dist/{index-3cL7Moei.mjs → index-BoZ4zUaz.mjs} +1 -1
  147. package/dist/{index-BzKxtQGz.js → index-BozmXv9E.js} +1 -1
  148. package/dist/{index-BrN0X5kT.js → index-Bptg7lEL.js} +1 -1
  149. package/dist/{index-DePOsWG_.mjs → index-BsLxKxrN.mjs} +1 -1
  150. package/dist/{index-Cb-Fe_1h.js → index-C0EviSXr.js} +1 -1
  151. package/dist/{index-CPNym4PK.js → index-C1cQDv9A.js} +1 -1
  152. package/dist/{index-RZqiMcIl.mjs → index-C1oDAubU.mjs} +1 -1
  153. package/dist/{index-Cwf_EX9w.js → index-C2yXed4j.js} +1 -1
  154. package/dist/{index-Dh3VrrPy.mjs → index-C78oJudy.mjs} +1 -1
  155. package/dist/{index-fApPz_RR.mjs → index-CAQHzRS_.mjs} +1 -1
  156. package/dist/{index-CULuhMm4.mjs → index-CDtPl2Dp.mjs} +1 -1
  157. package/dist/{index-DgY6992I.js → index-CGLfN47i.js} +1 -1
  158. package/dist/{index-2tILke6U.js → index-CVEyV3oH.js} +1 -1
  159. package/dist/{index-DfuIkb3b.mjs → index-CZvQK9um.mjs} +1 -1
  160. package/dist/{index-XyeM8FMs.js → index-Ca0KFCUy.js} +1 -1
  161. package/dist/{index-Bb8qLImc.js → index-CaLz_yWZ.js} +1 -1
  162. package/dist/{index-50WDZwY6.mjs → index-CfkA1HUF.mjs} +1 -1
  163. package/dist/{index-BaW128lR.mjs → index-CgVuCs-9.mjs} +1 -1
  164. package/dist/{index-BTHLvnDM.js → index-Ch9mzlaS.js} +1 -1
  165. package/dist/{index-DWp__yVp.js → index-CiH4S124.js} +1 -1
  166. package/dist/{index-CBMEGdtF.mjs → index-CkC7e6UC.mjs} +4 -4
  167. package/dist/index-CkC7e6UC.mjs.gz +0 -0
  168. package/dist/{index-6O_WmJiR.js → index-CkStkbTm.js} +1 -1
  169. package/dist/{index-CdVU6GTd.js → index-CnpHnzdh.js} +1 -1
  170. package/dist/{index-CBpCTPIe.js → index-D3y4nc65.js} +1 -1
  171. package/dist/{index-5lMsyCt-.mjs → index-D98ndODz.mjs} +116 -128
  172. package/dist/index-D98ndODz.mjs.gz +0 -0
  173. package/dist/{index-CVwY37Ap.mjs → index-D9NRql2_.mjs} +4 -4
  174. package/dist/{index-BMJH-pKx.mjs → index-DDiA6Hbk.mjs} +1 -1
  175. package/dist/{index-B1OyiNKv.js → index-DE6ps8-P.js} +1 -1
  176. package/dist/{index-Dmq67sYK.mjs → index-DOoi0m0O.mjs} +1 -1
  177. package/dist/{index-CXMGJckG.mjs → index-DS8W1tKu.mjs} +1 -1
  178. package/dist/{index-J4NxGzFM.mjs → index-DWnpoAcE.mjs} +4 -4
  179. package/dist/{index-CfbuW5QS.js → index-DXaT7Bpw.js} +1 -1
  180. package/dist/{index-XnjtFEnD.js → index-Da19FKfM.js} +1 -1
  181. package/dist/index-Da19FKfM.js.gz +0 -0
  182. package/dist/{index-CtcPgv48.mjs → index-DbZczM8A.mjs} +1 -1
  183. package/dist/{index-GscAHVlz.js → index-DePKCEIy.js} +1 -1
  184. package/dist/{index-rLuVoqX7.js → index-Dkc23mFY.js} +1 -1
  185. package/dist/{index-DJIIwHfH.mjs → index-DlHkOibD.mjs} +5 -5
  186. package/dist/{index-BjqcY5WP.mjs → index-DpyLYH0u.mjs} +1 -1
  187. package/dist/{index-Da-EibnS.mjs → index-DtA-rDg6.mjs} +1 -1
  188. package/dist/{index-D8ri1xcm.js → index-Dzp_gx2r.js} +1 -1
  189. package/dist/{index-DvF2RH6S.js → index-EbByaRmt.js} +1 -1
  190. package/dist/{index-A5ktR9cH.mjs → index-HnaDezaq.mjs} +1 -1
  191. package/dist/{index-hcAYrsAq.mjs → index-IyjpYm-g.mjs} +1 -1
  192. package/dist/{index-boVE6Ad1.js → index-K8q_W8GL.js} +1 -1
  193. package/dist/index-K8q_W8GL.js.gz +0 -0
  194. package/dist/{index-xJTcoFM6.mjs → index-L_oZT5nD.mjs} +3 -3
  195. package/dist/{index-D-4YQghO.mjs → index-NLIQlZON.mjs} +2 -2
  196. package/dist/index-NLIQlZON.mjs.gz +0 -0
  197. package/dist/{index-Dbatv4cZ.js → index-VtXQ2397.js} +1 -1
  198. package/dist/{index-neNMVAnO.mjs → index-WoY1GUIa.mjs} +2 -2
  199. package/dist/{index-He0mGZyR.mjs → index-ZPusH2gB.mjs} +4 -4
  200. package/dist/{index-Dw-o7dOL.mjs → index-Zs7USusy.mjs} +4 -4
  201. package/dist/index-Zs7USusy.mjs.gz +0 -0
  202. package/dist/{index-D7zDx1Ap.js → index-aFbLPlHA.js} +1 -1
  203. package/dist/{index-By636CoZ.js → index-cjrMHYB1.js} +1 -1
  204. package/dist/{index-CSeVpPfN.js → index-f-3maudb.js} +1 -1
  205. package/dist/{index-poDxeics.js → index-jdn4e0oK.js} +1 -1
  206. package/dist/{index-bEmT2tdh.js → index-lewbbs_X.js} +1 -1
  207. package/dist/{index-ZN1lfv8J.js → index-mJFY2tIL.js} +1 -1
  208. package/dist/{index-DahfL4JO.js → index-tRuuFe1Y.js} +1 -1
  209. package/dist/{index-CKLoKoxI.mjs → index-zYzwENmR.mjs} +1 -1
  210. package/dist/index.js +1 -1
  211. package/dist/index.mjs +1 -1
  212. package/dist/{index.vue_vue_type_script_setup_true_lang-DOISnIti.js → index.vue_vue_type_script_setup_true_lang-B6m5KDQa.js} +1 -1
  213. package/dist/{index.vue_vue_type_script_setup_true_lang-BZdfiBAy.mjs → index.vue_vue_type_script_setup_true_lang-BPUqRaQN.mjs} +2 -2
  214. package/dist/{index.vue_vue_type_script_setup_true_lang-eHo2CSr2.mjs → index.vue_vue_type_script_setup_true_lang-C1PYjFMH.mjs} +3 -3
  215. package/dist/index.vue_vue_type_script_setup_true_lang-C1PYjFMH.mjs.gz +0 -0
  216. package/dist/{index.vue_vue_type_script_setup_true_lang-i3cr6Fud.mjs → index.vue_vue_type_script_setup_true_lang-DslCmKCp.mjs} +6 -6
  217. package/dist/{index.vue_vue_type_script_setup_true_lang-BcsjzugF.js → index.vue_vue_type_script_setup_true_lang-Dzpex0aC.js} +1 -1
  218. package/dist/{index.vue_vue_type_script_setup_true_lang-VoJ022sb.mjs → index.vue_vue_type_script_setup_true_lang-fx3NKA-S.mjs} +1 -1
  219. package/dist/{index.vue_vue_type_script_setup_true_lang-D0a77Piz.js → index.vue_vue_type_script_setup_true_lang-q07uaQKj.js} +1 -1
  220. package/dist/{index.vue_vue_type_script_setup_true_lang-utlzLJEa.js → index.vue_vue_type_script_setup_true_lang-xiikUE4V.js} +1 -1
  221. package/dist/{index.vue_vue_type_script_setup_true_name_iconSelector_lang-BU-u_TBp.js → index.vue_vue_type_script_setup_true_name_iconSelector_lang-BYHkfIpy.js} +1 -1
  222. package/dist/{index.vue_vue_type_script_setup_true_name_iconSelector_lang-Q1w9bC44.mjs → index.vue_vue_type_script_setup_true_name_iconSelector_lang-DVwfhQ_n.mjs} +2 -2
  223. package/dist/index.vue_vue_type_script_setup_true_name_iconSelector_lang-DVwfhQ_n.mjs.gz +0 -0
  224. package/dist/{link-DRSQkB95.js → link-BrFzFsZF.js} +1 -1
  225. package/dist/{link-BZGaCtCz.mjs → link-eO-bynjJ.mjs} +1 -1
  226. package/dist/{list-C2btJYZH.js → list-BfaBN6j2.js} +1 -1
  227. package/dist/{list-0Nq0Auyi.mjs → list-U-qVf3cy.mjs} +1 -1
  228. package/dist/{main-BJ4O5MUB.mjs → main-D-tcRxsx.mjs} +3 -3
  229. package/dist/{main-DbT_-hLa.js → main-V6sNKA4d.js} +1 -1
  230. package/dist/{mobile-NssmNsTv.js → mobile-4IvgFmHN.js} +1 -1
  231. package/dist/{mobile-UZzyoPD0.mjs → mobile-BlskgHaB.mjs} +1 -1
  232. package/dist/{parent-D9OF0cw6.js → parent-CPbhWpmo.js} +1 -1
  233. package/dist/{parent-quzw9epH.mjs → parent-DwLqox1X.mjs} +1 -1
  234. package/dist/{popup-BGGgNpP2.js → popup-BrUrrwGO.js} +1 -1
  235. package/dist/{popup-BZ9oxKSJ.mjs → popup-CwqBBm0Q.mjs} +1 -1
  236. package/dist/{popup.vue_vue_type_script_setup_true_name_replaceRules_lang-Dg6e8awx.js → popup.vue_vue_type_script_setup_true_name_replaceRules_lang-BI3Cw8_l.js} +1 -1
  237. package/dist/{popup.vue_vue_type_script_setup_true_name_replaceRules_lang-DjsA4npa.mjs → popup.vue_vue_type_script_setup_true_name_replaceRules_lang-DNwAz5ey.mjs} +1 -1
  238. package/dist/{roleItem-DUoLQGDE.mjs → roleItem-B2Vtlegj.mjs} +1 -1
  239. package/dist/{roleItem-1_ZEkknn.js → roleItem-Coyp2NC2.js} +1 -1
  240. package/dist/{saveForm-CrSwxY-W.mjs → saveForm--ZKP-z8H.mjs} +3 -3
  241. package/dist/{saveForm-u1F0yEE2.js → saveForm-C4fcV3By.js} +1 -1
  242. package/dist/{scan-rRbFV2K9.mjs → scan-ACPfTpqs.mjs} +1 -1
  243. package/dist/{scan-rRbFV2K9.mjs.gz → scan-ACPfTpqs.mjs.gz} +0 -0
  244. package/dist/{scan-BrB6Irjb.js → scan-Cd_herHl.js} +1 -1
  245. package/dist/scan-Cd_herHl.js.gz +0 -0
  246. package/dist/{search-BJRJxHKA.mjs → search-BjnU4-yQ.mjs} +1 -1
  247. package/dist/{search-BlDK4BJ-.js → search-CbHZg3cF.js} +1 -1
  248. package/dist/{selectConfig-CTPij-JN.mjs → selectConfig-0kH5CM38.mjs} +1 -1
  249. package/dist/selectConfig-0kH5CM38.mjs.gz +0 -0
  250. package/dist/{selectConfig-DqS0Xegt.js → selectConfig-B9UbTiiU.js} +1 -1
  251. package/dist/{subItem-jHaNwA6U.mjs → subItem-B2UGhn8b.mjs} +1 -1
  252. package/dist/{subItem-Cp3JbvhY.js → subItem-DgH3PANG.js} +1 -1
  253. package/dist/{tagsView-BZCUtvu8.mjs → tagsView-BECHlio8.mjs} +2 -2
  254. package/dist/tagsView-BECHlio8.mjs.gz +0 -0
  255. package/dist/{tagsView-Y977b_5V.js → tagsView-DF2XAadv.js} +2 -2
  256. package/dist/tagsView-DF2XAadv.js.gz +0 -0
  257. package/dist/{transverse-CRWwf_GJ.js → transverse-C0XckDfz.js} +1 -1
  258. package/dist/{transverse-C0cLZwfn.mjs → transverse-njT0027P.mjs} +3 -3
  259. package/dist/{uploadAvatar-B-DU9q7s.mjs → uploadAvatar-BEuio2Sd.mjs} +1 -1
  260. package/dist/uploadAvatar-BEuio2Sd.mjs.gz +0 -0
  261. package/dist/{uploadAvatar-T3d2Ra0Y.js → uploadAvatar-D710MQXR.js} +1 -1
  262. package/dist/uploadAvatar-D710MQXR.js.gz +0 -0
  263. package/dist/{user-CW5hip8b.js → user-DrsLYkgK.js} +1 -1
  264. package/dist/{user-Y-iO-Jyi.mjs → user-gSWVD5H7.mjs} +3 -3
  265. package/dist/{userNews-BlmPzVlh.js → userNews-D6paNEWn.js} +1 -1
  266. package/dist/{userNews-DJPFdwVY.mjs → userNews-DVEfgi1V.mjs} +1 -1
  267. package/dist/{userSelect-DU5Ntks6.js → userSelect-Be6H4OMY.js} +1 -1
  268. package/dist/{userSelect-BsJ1_36P.mjs → userSelect-CKaaf--Y.mjs} +1 -1
  269. package/dist/{userSelect.vue_vue_type_script_setup_true_lang-Db6lV-dr.mjs → userSelect.vue_vue_type_script_setup_true_lang-BsHQ02j-.mjs} +1 -1
  270. package/dist/{userSelect.vue_vue_type_script_setup_true_lang-D4VUA3Gn.js → userSelect.vue_vue_type_script_setup_true_lang-Dj4SSeW5.js} +1 -1
  271. package/dist/{vertical-BC0mqYKq.mjs → vertical-DN-OeWiV.mjs} +2 -2
  272. package/dist/{vertical-D5YCb7Ah.js → vertical-Y1FHUeYu.js} +1 -1
  273. package/package.json +1 -1
  274. package/dist/404-BcDKlaGx.js.gz +0 -0
  275. package/dist/404-ClZOl-js.mjs.gz +0 -0
  276. package/dist/baseFormConfig-BoY7hYVi.mjs.gz +0 -0
  277. package/dist/baseTableConfig-C-36fjTX.mjs.gz +0 -0
  278. package/dist/baseTableConfig-__g4cUyA.js.gz +0 -0
  279. package/dist/btnIndex-PrpEhj29.mjs.gz +0 -0
  280. package/dist/cloneConfigDialog-BdXVqg1W.js.gz +0 -0
  281. package/dist/cloneConfigDialog-D6so2lng.mjs.gz +0 -0
  282. package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-CUy3zGzb.js.gz +0 -0
  283. package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-ySB3VYsq.mjs.gz +0 -0
  284. package/dist/formConfig-BYAbq4At.mjs.gz +0 -0
  285. package/dist/formConfig-CKr3xMFQ.js.gz +0 -0
  286. package/dist/hsAttrForm.vue_vue_type_script_setup_true_lang-DBdnIjyR.mjs.gz +0 -0
  287. package/dist/hsFormConfigList-B8i5Mbv1.mjs.gz +0 -0
  288. package/dist/hsFormPanel-CU8Oy_Qj.mjs.gz +0 -0
  289. package/dist/index copy-CTVbzQdm.js.gz +0 -0
  290. package/dist/index copy-mrzLswh9.mjs.gz +0 -0
  291. package/dist/index-5lMsyCt-.mjs.gz +0 -0
  292. package/dist/index-BQPWwjz6.js.gz +0 -0
  293. package/dist/index-CBMEGdtF.mjs.gz +0 -0
  294. package/dist/index-CNQjdHS-.mjs.gz +0 -0
  295. package/dist/index-D-4YQghO.mjs.gz +0 -0
  296. package/dist/index-Dw-o7dOL.mjs.gz +0 -0
  297. package/dist/index-XnjtFEnD.js.gz +0 -0
  298. package/dist/index-boVE6Ad1.js.gz +0 -0
  299. package/dist/index.vue_vue_type_script_setup_true_lang-eHo2CSr2.mjs.gz +0 -0
  300. package/dist/index.vue_vue_type_script_setup_true_name_iconSelector_lang-Q1w9bC44.mjs.gz +0 -0
  301. package/dist/scan-BrB6Irjb.js.gz +0 -0
  302. package/dist/selectConfig-CTPij-JN.mjs.gz +0 -0
  303. package/dist/tagsView-BZCUtvu8.mjs.gz +0 -0
  304. package/dist/tagsView-Y977b_5V.js.gz +0 -0
  305. package/dist/uploadAvatar-B-DU9q7s.mjs.gz +0 -0
  306. package/dist/uploadAvatar-T3d2Ra0Y.js.gz +0 -0
@@ -52,7 +52,7 @@ e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function n(e){
52
52
 
53
53
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54
54
  */
55
- function(){var t=e,n=t.lib,r=n.WordArray,o=n.Hasher,a=t.algo,i=r.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=r.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=r.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=r.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=r.create([0,1518500249,1859775393,2400959708,2840853838]),d=r.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=o.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var a,p,b,w,x,C,_,E,S,k,T,N=this._hash.words,D=u.words,A=d.words,I=i.words,R=l.words,M=s.words,O=c.words;for(C=a=N[0],_=p=N[1],E=b=N[2],S=w=N[3],k=x=N[4],n=0;n<80;n+=1)T=a+e[t+I[n]]|0,T+=n<16?f(p,b,w)+D[0]:n<32?h(p,b,w)+D[1]:n<48?m(p,b,w)+D[2]:n<64?v(p,b,w)+D[3]:g(p,b,w)+D[4],T=(T=y(T|=0,M[n]))+x|0,a=x,x=w,w=y(b,10),b=p,p=T,T=C+e[t+R[n]]|0,T+=n<16?g(_,E,S)+A[0]:n<32?v(_,E,S)+A[1]:n<48?m(_,E,S)+A[2]:n<64?h(_,E,S)+A[3]:f(_,E,S)+A[4],T=(T=y(T|=0,O[n]))+k|0,C=k,k=S,S=y(E,10),E=_,_=T;T=N[1]+b+S|0,N[1]=N[2]+w+k|0,N[2]=N[3]+x+C|0,N[3]=N[4]+a+_|0,N[4]=N[0]+p+E|0,N[0]=T},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,a=o.words,i=0;i<5;i++){var l=a[i];a[i]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return o},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function v(e,t,n){return e&n|t&~n}function g(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(p),t.HmacRIPEMD160=o._createHmacHelper(p)}(),e.RIPEMD160)),dW.exports;var e}(),hW(),function(){return mW?vW.exports:(mW=1,vW.exports=(s=Dq(),Qq(),hW(),t=(e=s).lib,n=t.Base,r=t.WordArray,o=e.algo,a=o.SHA256,i=o.HMAC,l=o.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,o=i.create(n.hasher,e),a=r.create(),l=r.create([1]),s=a.words,c=l.words,u=n.keySize,d=n.iterations;s.length<u;){var p=o.update(t).finalize(l);o.reset();for(var f=p.words,h=f.length,m=p,v=1;v<d;v++){m=o.finalize(m),o.reset();for(var g=m.words,y=0;y<h;y++)f[y]^=g[y]}a.concat(p),c[0]++}return a.sigBytes=4*u,a}}),e.PBKDF2=function(e,t,n){return l.create(n).compute(e,t)},s.PBKDF2));var e,t,n,r,o,a,i,l,s}(),bW(),CW(),function(){return _W?EW.exports:(_W=1,EW.exports=(e=Dq(),CW(),e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var o,a=this._iv;a?(o=a.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var i=0;i<n;i++)e[t+i]^=o[i]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize;n.call(this,e,t,o,r),this._prevBlock=e.slice(t,t+o)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,a=e.slice(t,t+o);n.call(this,e,t,o,r),this._prevBlock=a}}),t}(),e.mode.CFB));var e}(),function(){return SW?kW.exports:(SW=1,kW.exports=(n=Dq(),CW(),n.mode.CTR=(e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0);var i=a.slice(0);n.encryptBlock(i,0),a[r-1]=a[r-1]+1|0;for(var l=0;l<r;l++)e[t+l]^=i[l]}}),e.Decryptor=t,e),n.mode.CTR));var e,t,n}(),DW(),function(){return AW?IW.exports:(AW=1,IW.exports=(n=Dq(),CW(),n.mode.OFB=(e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,a=this._keystream;o&&(a=this._keystream=o.slice(0),this._iv=void 0),n.encryptBlock(a,0);for(var i=0;i<r;i++)e[t+i]^=a[i]}}),e.Decryptor=t,e),n.mode.OFB));var e,t,n}(),function(){return RW?MW.exports:(RW=1,MW.exports=(t=Dq(),CW(),t.mode.ECB=((e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),e),t.mode.ECB));var e,t}(),function(){return OW?BW.exports:(OW=1,BW.exports=(e=Dq(),CW(),e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,o=r-n%r,a=n+o-1;e.clamp(),e.words[a>>>2]|=o<<24-a%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923));var e}(),function(){return VW?PW.exports:(VW=1,PW.exports=(e=Dq(),CW(),e.pad.Iso10126={pad:function(t,n){var r=4*n,o=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(o-1)).concat(e.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126));var e}(),function(){return LW?FW.exports:(LW=1,FW.exports=(e=Dq(),CW(),e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971));var e}(),function(){return zW?jW.exports:(zW=1,jW.exports=(e=Dq(),CW(),e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding));var e}(),function(){return $W?UW.exports:($W=1,UW.exports=(e=Dq(),CW(),e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding));var e}(),function(){return HW?qW.exports:(HW=1,qW.exports=(r=Dq(),CW(),t=(e=r).lib.CipherParams,n=e.enc.Hex,e.format.Hex={stringify:function(e){return e.ciphertext.toString(n)},parse:function(e){var r=n.parse(e);return t.create({ciphertext:r})}},r.format.Hex));var e,t,n,r}(),function(){return WW||(WW=1,GW.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.BlockCipher,r=t.algo,o=[],a=[],i=[],l=[],s=[],c=[],u=[],d=[],p=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var h=r^r<<1^r<<2^r<<3^r<<4;h=h>>>8^255&h^99,o[n]=h,a[h]=n;var m=e[n],v=e[m],g=e[v],y=257*e[h]^16843008*h;i[n]=y<<24|y>>>8,l[n]=y<<16|y>>>16,s[n]=y<<8|y>>>24,c[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[h]=y<<24|y>>>8,d[h]=y<<16|y>>>16,p[h]=y<<8|y>>>24,f[h]=y,n?(n=m^e[e[e[g^m]]],r^=e[e[r]]):n=r=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),a=this._keySchedule=[],i=0;i<r;i++)i<n?a[i]=t[i]:(c=a[i-1],i%n?n>6&&i%n==4&&(c=o[c>>>24]<<24|o[c>>>16&255]<<16|o[c>>>8&255]<<8|o[255&c]):(c=o[(c=c<<8|c>>>24)>>>24]<<24|o[c>>>16&255]<<16|o[c>>>8&255]<<8|o[255&c],c^=h[i/n|0]<<24),a[i]=a[i-n]^c);for(var l=this._invKeySchedule=[],s=0;s<r;s++){if(i=r-s,s%4)var c=a[i];else c=a[i-4];l[s]=s<4||i<=4?c:u[o[c>>>24]]^d[o[c>>>16&255]]^p[o[c>>>8&255]]^f[o[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,l,s,c,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,f,a),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,a,i,l){for(var s=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],f=4,h=1;h<s;h++){var m=r[c>>>24]^o[u>>>16&255]^a[d>>>8&255]^i[255&p]^n[f++],v=r[u>>>24]^o[d>>>16&255]^a[p>>>8&255]^i[255&c]^n[f++],g=r[d>>>24]^o[p>>>16&255]^a[c>>>8&255]^i[255&u]^n[f++],y=r[p>>>24]^o[c>>>16&255]^a[u>>>8&255]^i[255&d]^n[f++];c=m,u=v,d=g,p=y}m=(l[c>>>24]<<24|l[u>>>16&255]<<16|l[d>>>8&255]<<8|l[255&p])^n[f++],v=(l[u>>>24]<<24|l[d>>>16&255]<<16|l[p>>>8&255]<<8|l[255&c])^n[f++],g=(l[d>>>24]<<24|l[p>>>16&255]<<16|l[c>>>8&255]<<8|l[255&u])^n[f++],y=(l[p>>>24]<<24|l[c>>>16&255]<<16|l[u>>>8&255]<<8|l[255&d])^n[f++],e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y},keySize:8});t.AES=n._createHelper(m)}(),e.AES)),GW.exports;var e}(),XW(),function(){return JW||(JW=1,ZW.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.StreamCipher,r=t.algo,o=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var a=0;o<256;o++){var i=o%n,l=t[i>>>2]>>>24-i%4*8&255;a=(a+r[o]+l)%256;var s=r[o];r[o]=r[a],r[a]=s}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[n],e[n]=a,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}t.RC4=n._createHelper(o);var i=r.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});t.RC4Drop=n._createHelper(i)}(),e.RC4)),ZW.exports;var e}(),function(){return QW?eG.exports:(QW=1,eG.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.StreamCipher,r=t.algo,o=[],a=[],i=[],l=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)s.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var a=t.words,i=a[0],l=a[1],c=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),u=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(o[0]^=c,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=c,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)s.call(this)}},_doProcessBlock:function(e,t){var n=this._X;s.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function s(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,l=r>>>16,s=((o*o>>>17)+o*l>>>15)+l*l,c=((4294901760&r)*r|0)+((65535&r)*r|0);i[n]=s^c}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}t.Rabbit=n._createHelper(l)}(),e.Rabbit));var e}(),function(){return tG?nG.exports:(tG=1,nG.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.StreamCipher,r=t.algo,o=[],a=[],i=[],l=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)s.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var a=t.words,i=a[0],l=a[1],c=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),u=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(r[0]^=c,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=c,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)s.call(this)}},_doProcessBlock:function(e,t){var n=this._X;s.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function s(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,l=r>>>16,s=((o*o>>>17)+o*l>>>15)+l*l,c=((4294901760&r)*r|0)+((65535&r)*r|0);i[n]=s^c}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}t.RabbitLegacy=n._createHelper(l)}(),e.RabbitLegacy));var e}(),dG());var pG=Sq.exports;const fG=P(pG);function hG(e,t){return function(){return e.apply(t,arguments)}}const{toString:mG}=Object.prototype,{getPrototypeOf:vG}=Object,gG=(e=>t=>{const n=mG.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),yG=e=>(e=e.toLowerCase(),t=>gG(t)===e),bG=e=>t=>typeof t===e,{isArray:wG}=Array,xG=bG("undefined");const CG=yG("ArrayBuffer");const _G=bG("string"),EG=bG("function"),SG=bG("number"),kG=e=>null!==e&&"object"==typeof e,TG=e=>{if("object"!==gG(e))return!1;const t=vG(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},NG=yG("Date"),DG=yG("File"),AG=yG("Blob"),IG=yG("FileList"),RG=yG("URLSearchParams");function MG(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),wG(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(r=0;r<a;r++)i=o[r],t.call(null,e[i],i,e)}}function OG(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const BG="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,VG=e=>!xG(e)&&e!==BG;const PG=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&vG(Uint8Array)),LG=yG("HTMLFormElement"),FG=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zG=yG("RegExp"),jG=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};MG(n,((n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)})),Object.defineProperties(e,r)},$G="abcdefghijklmnopqrstuvwxyz",UG="0123456789",HG={DIGIT:UG,ALPHA:$G,ALPHA_DIGIT:$G+$G.toUpperCase()+UG};const qG=yG("AsyncFunction"),WG={isArray:wG,isArrayBuffer:CG,isBuffer:function(e){return null!==e&&!xG(e)&&null!==e.constructor&&!xG(e.constructor)&&EG(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||EG(e.append)&&("formdata"===(t=gG(e))||"object"===t&&EG(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&CG(e.buffer),t},isString:_G,isNumber:SG,isBoolean:e=>!0===e||!1===e,isObject:kG,isPlainObject:TG,isUndefined:xG,isDate:NG,isFile:DG,isBlob:AG,isRegExp:zG,isFunction:EG,isStream:e=>kG(e)&&EG(e.pipe),isURLSearchParams:RG,isTypedArray:PG,isFileList:IG,forEach:MG,merge:function e(){const{caseless:t}=VG(this)&&this||{},n={},r=(r,o)=>{const a=t&&OG(n,o)||o;TG(n[a])&&TG(r)?n[a]=e(n[a],r):TG(r)?n[a]=e({},r):wG(r)?n[a]=r.slice():n[a]=r};for(let o=0,a=arguments.length;o<a;o++)arguments[o]&&MG(arguments[o],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(MG(t,((t,r)=>{n&&EG(t)?e[r]=hG(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const l={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||l[i]||(t[i]=e[i],l[i]=!0);e=!1!==n&&vG(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:gG,kindOfTest:yG,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(wG(e))return e;let t=e.length;if(!SG(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:LG,hasOwnProperty:FG,hasOwnProp:FG,reduceDescriptors:jG,freezeMethods:e=>{jG(e,((t,n)=>{if(EG(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];EG(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return wG(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:OG,global:BG,isContextDefined:VG,ALPHABET:HG,generateString:(e=16,t=HG.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&EG(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(kG(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=wG(e)?[]:{};return MG(e,((e,t)=>{const a=n(e,r+1);!xG(a)&&(o[t]=a)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:qG,isThenable:e=>e&&(kG(e)||EG(e))&&EG(e.then)&&EG(e.catch)};function GG(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}WG.inherits(GG,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:WG.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const YG=GG.prototype,KG={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{KG[e]={value:e}})),Object.defineProperties(GG,KG),Object.defineProperty(YG,"isAxiosError",{value:!0}),GG.from=(e,t,n,r,o,a)=>{const i=Object.create(YG);return WG.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),GG.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};function XG(e){return WG.isPlainObject(e)||WG.isArray(e)}function JG(e){return WG.endsWith(e,"[]")?e.slice(0,-2):e}function ZG(e,t,n){return e?e.concat(t).map((function(e,t){return e=JG(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const QG=WG.toFlatObject(WG,{},null,(function(e){return/^is[A-Z]/.test(e)}));function eY(e,t,n){if(!WG.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=WG.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!WG.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,a=n.dots,i=n.indexes,l=(n.Blob||"undefined"!=typeof Blob&&Blob)&&WG.isSpecCompliantForm(t);if(!WG.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(WG.isDate(e))return e.toISOString();if(!l&&WG.isBlob(e))throw new GG("Blob is not supported. Use a Buffer instead.");return WG.isArrayBuffer(e)||WG.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let l=e;if(e&&!o&&"object"==typeof e)if(WG.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(WG.isArray(e)&&function(e){return WG.isArray(e)&&!e.some(XG)}(e)||(WG.isFileList(e)||WG.endsWith(n,"[]"))&&(l=WG.toArray(e)))return n=JG(n),l.forEach((function(e,r){!WG.isUndefined(e)&&null!==e&&t.append(!0===i?ZG([n],r,a):null===i?n:n+"[]",s(e))})),!1;return!!XG(e)||(t.append(ZG(o,n,a),s(e)),!1)}const u=[],d=Object.assign(QG,{defaultVisitor:c,convertValue:s,isVisitable:XG});if(!WG.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!WG.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),WG.forEach(n,(function(n,a){!0===(!(WG.isUndefined(n)||null===n)&&o.call(t,n,WG.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t}function tY(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function nY(e,t){this._pairs=[],e&&eY(e,this,t)}const rY=nY.prototype;function oY(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function aY(e,t,n){if(!t)return e;const r=n&&n.encode||oY,o=n&&n.serialize;let a;if(a=o?o(t,n):WG.isURLSearchParams(t)?t.toString():new nY(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}rY.append=function(e,t){this._pairs.push([e,t])},rY.toString=function(e){const t=e?function(t){return e.call(this,t,tY)}:tY;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class iY{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){WG.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}const lY={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},sY={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:nY,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},cY="undefined"!=typeof window&&"undefined"!=typeof document,uY=(dY="undefined"!=typeof navigator&&navigator.product,cY&&["ReactNative","NativeScript","NS"].indexOf(dY)<0);var dY;const pY="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fY={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cY,hasStandardBrowserEnv:uY,hasStandardBrowserWebWorkerEnv:pY},Symbol.toStringTag,{value:"Module"})),...sY};function hY(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),l=o>=e.length;if(a=!a&&WG.isArray(r)?r.length:a,l)return WG.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i;r[a]&&WG.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],o)&&WG.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i}if(WG.isFormData(e)&&WG.isFunction(e.entries)){const n={};return WG.forEachEntry(e,((e,r)=>{t(function(e){return WG.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const mY={transitional:lY,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=WG.isObject(e);o&&WG.isHTMLForm(e)&&(e=new FormData(e));if(WG.isFormData(e))return r?JSON.stringify(hY(e)):e;if(WG.isArrayBuffer(e)||WG.isBuffer(e)||WG.isStream(e)||WG.isFile(e)||WG.isBlob(e))return e;if(WG.isArrayBufferView(e))return e.buffer;if(WG.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return eY(e,new fY.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return fY.isNode&&WG.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=WG.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return eY(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(WG.isString(e))try{return(t||JSON.parse)(e),WG.trim(e)}catch(HT){if("SyntaxError"!==HT.name)throw HT}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||mY.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&WG.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(HT){if(n){if("SyntaxError"===HT.name)throw GG.from(HT,GG.ERR_BAD_RESPONSE,this,null,this.response);throw HT}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fY.classes.FormData,Blob:fY.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};WG.forEach(["delete","get","head","post","put","patch"],(e=>{mY.headers[e]={}}));const vY=WG.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),gY=Symbol("internals");function yY(e){return e&&String(e).trim().toLowerCase()}function bY(e){return!1===e||null==e?e:WG.isArray(e)?e.map(bY):String(e)}function wY(e,t,n,r,o){return WG.isFunction(r)?r.call(this,t,n):(o&&(t=n),WG.isString(t)?WG.isString(r)?-1!==t.indexOf(r):WG.isRegExp(r)?r.test(t):void 0:void 0)}let xY=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=yY(t);if(!o)throw new Error("header name must be a non-empty string");const a=WG.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=bY(e))}const a=(e,t)=>WG.forEach(e,((e,n)=>o(e,n,t)));return WG.isPlainObject(e)||e instanceof this.constructor?a(e,t):WG.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&vY[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=yY(e)){const n=WG.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(WG.isFunction(t))return t.call(this,e,n);if(WG.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=yY(e)){const n=WG.findKey(this,e);return!(!n||void 0===this[n]||t&&!wY(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=yY(e)){const o=WG.findKey(n,e);!o||t&&!wY(0,n[o],o,t)||(delete n[o],r=!0)}}return WG.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!wY(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return WG.forEach(this,((r,o)=>{const a=WG.findKey(n,o);if(a)return t[a]=bY(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=bY(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return WG.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&WG.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[gY]=this[gY]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=yY(e);t[r]||(!function(e,t){const n=WG.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return WG.isArray(e)?e.forEach(r):r(e),this}};function CY(e,t){const n=this||mY,r=t||n,o=xY.from(r.headers);let a=r.data;return WG.forEach(e,(function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)})),o.normalize(),a}function _Y(e){return!(!e||!e.__CANCEL__)}function EY(e,t,n){GG.call(this,null==e?"canceled":e,GG.ERR_CANCELED,t,n),this.name="CanceledError"}xY.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),WG.reduceDescriptors(xY.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),WG.freezeMethods(xY),WG.inherits(EY,GG,{__CANCEL__:!0});const SY=fY.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];WG.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),WG.isString(r)&&i.push("path="+r),WG.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function kY(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const TY=fY.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=WG.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return function(){return!0}}();function NY(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(l){const s=Date.now(),c=r[i];o||(o=s),n[a]=l,r[a]=s;let u=i,d=0;for(;u!==a;)d+=n[u++],u%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),s-o<t)return;const p=c&&s-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return o=>{const a=o.loaded,i=o.lengthComputable?o.total:void 0,l=a-n,s=r(l);n=a;const c={loaded:a,total:i,progress:i?a/i:void 0,bytes:l,rate:s||void 0,estimated:s&&i&&a<=i?(i-a)/s:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const DY="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=xY.from(e.headers).normalize();let a,i,{responseType:l,withXSRFToken:s}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(WG.isFormData(r))if(fY.hasStandardBrowserEnv||fY.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=kY(e.baseURL,e.url);function p(){if(!u)return;const r=xY.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new GG("Request failed with status code "+n.status,[GG.ERR_BAD_REQUEST,GG.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:l&&"text"!==l&&"json"!==l?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),aY(d,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(n(new GG("Request aborted",GG.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new GG("Network Error",GG.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||lY;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new GG(t,r.clarifyTimeoutError?GG.ETIMEDOUT:GG.ECONNABORTED,e,u)),u=null},fY.hasStandardBrowserEnv&&(s&&WG.isFunction(s)&&(s=s(e)),s||!1!==s&&TY(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&SY.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in u&&WG.forEach(o.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),WG.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),l&&"json"!==l&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",NY(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",NY(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{u&&(n(!t||t.type?new EY(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);f&&-1===fY.protocols.indexOf(f)?n(new GG("Unsupported protocol "+f+":",GG.ERR_BAD_REQUEST,e)):u.send(r||null)}))},AY={http:null,xhr:DY};WG.forEach(AY,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(HT){}Object.defineProperty(e,"adapterName",{value:t})}}));const IY=e=>`- ${e}`,RY=e=>WG.isFunction(e)||null===e||!1===e,MY=e=>{e=WG.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!RY(n)&&(r=AY[(t=String(n)).toLowerCase()],void 0===r))throw new GG(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+a]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new GG("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(IY).join("\n"):" "+IY(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function OY(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new EY(null,e)}function BY(e){OY(e),e.headers=xY.from(e.headers),e.data=CY.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return MY(e.adapter||mY.adapter)(e).then((function(t){return OY(e),t.data=CY.call(e,e.transformResponse,t),t.headers=xY.from(t.headers),t}),(function(t){return _Y(t)||(OY(e),t&&t.response&&(t.response.data=CY.call(e,e.transformResponse,t.response),t.response.headers=xY.from(t.response.headers))),Promise.reject(t)}))}const VY=e=>e instanceof xY?{...e}:e;function PY(e,t){t=t||{};const n={};function r(e,t,n){return WG.isPlainObject(e)&&WG.isPlainObject(t)?WG.merge.call({caseless:n},e,t):WG.isPlainObject(t)?WG.merge({},t):WG.isArray(t)?t.slice():t}function o(e,t,n){return WG.isUndefined(t)?WG.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!WG.isUndefined(t))return r(void 0,t)}function i(e,t){return WG.isUndefined(t)?WG.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const s={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(e,t)=>o(VY(e),VY(t),!0)};return WG.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=s[r]||o,i=a(e[r],t[r],r);WG.isUndefined(i)&&a!==l||(n[r]=i)})),n}const LY="1.6.8",FY={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{FY[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const zY={};FY.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,a)=>{if(!1===e)throw new GG(r(o," has been removed"+(t?" in "+t:"")),GG.ERR_DEPRECATED);return t&&!zY[o]&&(zY[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,a)}};const jY={assertOptions:function(e,t,n){if("object"!=typeof e)throw new GG("options must be an object",GG.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new GG("option "+a+" must be "+n,GG.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new GG("Unknown option "+a,GG.ERR_BAD_OPTION)}},validators:FY},$Y=jY.validators;let UY=class{constructor(e){this.defaults=e,this.interceptors={request:new iY,response:new iY}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=PY(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&jY.assertOptions(n,{silentJSONParsing:$Y.transitional($Y.boolean),forcedJSONParsing:$Y.transitional($Y.boolean),clarifyTimeoutError:$Y.transitional($Y.boolean)},!1),null!=r&&(WG.isFunction(r)?t.paramsSerializer={serialize:r}:jY.assertOptions(r,{encode:$Y.function,serialize:$Y.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&WG.merge(o.common,o[t.method]);o&&WG.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=xY.concat(a,o);const i=[];let l=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const s=[];let c;this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)}));let u,d=0;if(!l){const e=[BY.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,s),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(f){t.call(this,f);break}}try{c=BY.call(this,p)}catch(f){return Promise.reject(f)}for(d=0,u=s.length;d<u;)c=c.then(s[d++],s[d++]);return c}getUri(e){return aY(kY((e=PY(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};WG.forEach(["delete","get","head","options"],(function(e){UY.prototype[e]=function(t,n){return this.request(PY(n||{},{method:e,url:t,data:(n||{}).data}))}})),WG.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(PY(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}UY.prototype[e]=t(),UY.prototype[e+"Form"]=t(!0)}));const HY={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HY).forEach((([e,t])=>{HY[t]=e}));const qY=function e(t){const n=new UY(t),r=hG(UY.prototype.request,n);return WG.extend(r,UY.prototype,n,{allOwnKeys:!0}),WG.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(PY(t,n))},r}(mY);qY.Axios=UY,qY.CanceledError=EY,qY.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new EY(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},qY.isCancel=_Y,qY.VERSION=LY,qY.toFormData=eY,qY.AxiosError=GG,qY.Cancel=qY.CanceledError,qY.all=function(e){return Promise.all(e)},qY.spread=function(e){return function(t){return e.apply(null,t)}},qY.isAxiosError=function(e){return WG.isObject(e)&&!0===e.isAxiosError},qY.mergeConfig=PY,qY.AxiosHeaders=xY,qY.formToJSON=e=>hY(WG.isHTMLForm(e)?new FormData(e):e),qY.getAdapter=MY,qY.HttpStatusCode=HY,qY.default=qY;const{Axios:WY,AxiosError:GY,CanceledError:YY,isCancel:KY,CancelToken:XY,VERSION:JY,all:ZY,Cancel:QY,isAxiosError:eK,spread:tK,toFormData:nK,AxiosHeaders:rK,HttpStatusCode:oK,formToJSON:aK,getAdapter:iK,mergeConfig:lK}=qY;var sK=TypeError,cK="function"==typeof Map&&Map.prototype,uK=Object.getOwnPropertyDescriptor&&cK?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,dK=cK&&uK&&"function"==typeof uK.get?uK.get:null,pK=cK&&Map.prototype.forEach,fK="function"==typeof Set&&Set.prototype,hK=Object.getOwnPropertyDescriptor&&fK?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,mK=fK&&hK&&"function"==typeof hK.get?hK.get:null,vK=fK&&Set.prototype.forEach,gK="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,yK="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,bK="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,wK=Boolean.prototype.valueOf,xK=Object.prototype.toString,CK=Function.prototype.toString,_K=String.prototype.match,EK=String.prototype.slice,SK=String.prototype.replace,kK=String.prototype.toUpperCase,TK=String.prototype.toLowerCase,NK=RegExp.prototype.test,DK=Array.prototype.concat,AK=Array.prototype.join,IK=Array.prototype.slice,RK=Math.floor,MK="function"==typeof BigInt?BigInt.prototype.valueOf:null,OK=Object.getOwnPropertySymbols,BK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,VK="function"==typeof Symbol&&"object"==typeof Symbol.iterator,PK="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===VK||"symbol")?Symbol.toStringTag:null,LK=Object.prototype.propertyIsEnumerable,FK=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function zK(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||NK.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-RK(-e):RK(e);if(r!==e){var o=String(r),a=EK.call(t,o.length+1);return SK.call(o,n,"$&_")+"."+SK.call(SK.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return SK.call(t,n,"$&_")}var jK=Tq,$K=jK.custom,UK=ZK($K)?$K:null,HK={__proto__:null,double:'"',single:"'"},qK={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},WK=function e(t,n,r,o){var a=n||{};if(eX(a,"quoteStyle")&&!eX(HK,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(eX(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!eX(a,"customInspect")||a.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(eX(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(eX(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return rX(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var s=String(t);return l?zK(t,s):s}if("bigint"==typeof t){var c=String(t)+"n";return l?zK(t,c):c}var u=void 0===a.depth?5:a.depth;if(void 0===r&&(r=0),r>=u&&u>0&&"object"==typeof t)return XK(t)?"[Array]":"[Object]";var d=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=AK.call(Array(e.indent+1)," ")}return{base:n,prev:AK.call(Array(t+1),n)}}(a,r);if(void 0===o)o=[];else if(nX(o,t)>=0)return"[Circular]";function p(t,n,i){if(n&&(o=IK.call(o)).push(n),i){var l={depth:a.depth};return eX(a,"quoteStyle")&&(l.quoteStyle=a.quoteStyle),e(t,l,r+1,o)}return e(t,a,r+1,o)}if("function"==typeof t&&!JK(t)){var f=function(e){if(e.name)return e.name;var t=_K.call(CK.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),h=cX(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(h.length>0?" { "+AK.call(h,", ")+" }":"")}if(ZK(t)){var m=VK?SK.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):BK.call(t);return"object"!=typeof t||VK?m:aX(m)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var v="<"+TK.call(String(t.nodeName)),g=t.attributes||[],y=0;y<g.length;y++)v+=" "+g[y].name+"="+GK(YK(g[y].value),"double",a);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+TK.call(String(t.nodeName))+">"}if(XK(t)){if(0===t.length)return"[]";var b=cX(t,p);return d&&!function(e){for(var t=0;t<e.length;t++)if(nX(e[t],"\n")>=0)return!1;return!0}(b)?"["+sX(b,d)+"]":"[ "+AK.call(b,", ")+" ]"}if(function(e){return"[object Error]"===tX(e)&&KK(e)}(t)){var w=cX(t,p);return"cause"in Error.prototype||!("cause"in t)||LK.call(t,"cause")?0===w.length?"["+String(t)+"]":"{ ["+String(t)+"] "+AK.call(w,", ")+" }":"{ ["+String(t)+"] "+AK.call(DK.call("[cause]: "+p(t.cause),w),", ")+" }"}if("object"==typeof t&&i){if(UK&&"function"==typeof t[UK]&&jK)return jK(t,{depth:u-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!dK||!e||"object"!=typeof e)return!1;try{dK.call(e);try{mK.call(e)}catch(v){return!0}return e instanceof Map}catch(HT){}return!1}(t)){var x=[];return pK&&pK.call(t,(function(e,n){x.push(p(n,t,!0)+" => "+p(e,t))})),lX("Map",dK.call(t),x,d)}if(function(e){if(!mK||!e||"object"!=typeof e)return!1;try{mK.call(e);try{dK.call(e)}catch(t){return!0}return e instanceof Set}catch(HT){}return!1}(t)){var C=[];return vK&&vK.call(t,(function(e){C.push(p(e,t))})),lX("Set",mK.call(t),C,d)}if(function(e){if(!gK||!e||"object"!=typeof e)return!1;try{gK.call(e,gK);try{yK.call(e,yK)}catch(v){return!0}return e instanceof WeakMap}catch(HT){}return!1}(t))return iX("WeakMap");if(function(e){if(!yK||!e||"object"!=typeof e)return!1;try{yK.call(e,yK);try{gK.call(e,gK)}catch(v){return!0}return e instanceof WeakSet}catch(HT){}return!1}(t))return iX("WeakSet");if(function(e){if(!bK||!e||"object"!=typeof e)return!1;try{return bK.call(e),!0}catch(HT){}return!1}(t))return iX("WeakRef");if(function(e){return"[object Number]"===tX(e)&&KK(e)}(t))return aX(p(Number(t)));if(function(e){if(!e||"object"!=typeof e||!MK)return!1;try{return MK.call(e),!0}catch(HT){}return!1}(t))return aX(p(MK.call(t)));if(function(e){return"[object Boolean]"===tX(e)&&KK(e)}(t))return aX(wK.call(t));if(function(e){return"[object String]"===tX(e)&&KK(e)}(t))return aX(p(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==V&&t===V)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===tX(e)&&KK(e)}(t)&&!JK(t)){var _=cX(t,p),E=FK?FK(t)===Object.prototype:t instanceof Object||t.constructor===Object,S=t instanceof Object?"":"null prototype",k=!E&&PK&&Object(t)===t&&PK in t?EK.call(tX(t),8,-1):S?"Object":"",T=(E||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||S?"["+AK.call(DK.call([],k||[],S||[]),": ")+"] ":"");return 0===_.length?T+"{}":d?T+"{"+sX(_,d)+"}":T+"{ "+AK.call(_,", ")+" }"}return String(t)};function GK(e,t,n){var r=n.quoteStyle||t,o=HK[r];return o+e+o}function YK(e){return SK.call(String(e),/"/g,"&quot;")}function KK(e){return!PK||!("object"==typeof e&&(PK in e||void 0!==e[PK]))}function XK(e){return"[object Array]"===tX(e)&&KK(e)}function JK(e){return"[object RegExp]"===tX(e)&&KK(e)}function ZK(e){if(VK)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!BK)return!1;try{return BK.call(e),!0}catch(HT){}return!1}var QK=Object.prototype.hasOwnProperty||function(e){return e in this};function eX(e,t){return QK.call(e,t)}function tX(e){return xK.call(e)}function nX(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function rX(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return rX(EK.call(e,0,t.maxStringLength),t)+r}var o=qK[t.quoteStyle||"single"];return o.lastIndex=0,GK(SK.call(SK.call(e,o,"\\$1"),/[\x00-\x1f]/g,oX),"single",t)}function oX(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+kK.call(t.toString(16))}function aX(e){return"Object("+e+")"}function iX(e){return e+" { ? }"}function lX(e,t,n,r){return e+" ("+t+") {"+(r?sX(n,r):AK.call(n,", "))+"}"}function sX(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+AK.call(e,","+n)+"\n"+t.prev}function cX(e,t){var n=XK(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=eX(e,o)?t(e[o],e):""}var a,i="function"==typeof OK?OK(e):[];if(VK){a={};for(var l=0;l<i.length;l++)a["$"+i[l]]=i[l]}for(var s in e)eX(e,s)&&(n&&String(Number(s))===s&&s<e.length||VK&&a["$"+s]instanceof Symbol||(NK.call(/[^\w$]/,s)?r.push(t(s,e)+": "+t(e[s],e)):r.push(s+": "+t(e[s],e))));if("function"==typeof OK)for(var c=0;c<i.length;c++)LK.call(e,i[c])&&r.push("["+t(i[c])+"]: "+t(e[i[c]],e));return r}var uX=WK,dX=sK,pX=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r},fX=Object,hX=Error,mX=EvalError,vX=RangeError,gX=ReferenceError,yX=SyntaxError,bX=URIError,wX=Math.abs,xX=Math.floor,CX=Math.max,_X=Math.min,EX=Math.pow,SX=Math.round,kX=Number.isNaN||function(e){return e!=e},TX=kX,NX=Object.getOwnPropertyDescriptor;if(NX)try{NX([],"length")}catch(HT){NX=null}var DX=NX,AX=Object.defineProperty||!1;if(AX)try{AX({},"a",{value:1})}catch(HT){AX=!1}var IX,RX,MX,OX,BX,VX,PX,LX,FX,zX,jX,$X,UX,HX,qX,WX,GX=AX;function YX(){return VX?BX:(VX=1,BX="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function KX(){return LX?PX:(LX=1,PX=fX.getPrototypeOf||null)}function XX(){if($X)return jX;$X=1;var e=function(){if(zX)return FX;zX=1;var e=Object.prototype.toString,t=Math.max,n=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};return FX=function(r){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var a,i=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),l=t(0,o.length-i.length),s=[],c=0;c<l;c++)s[c]="$"+c;if(a=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(s,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var e=o.apply(this,n(i,arguments));return Object(e)===e?e:this}return o.apply(r,n(i,arguments))})),o.prototype){var u=function(){};u.prototype=o.prototype,a.prototype=new u,u.prototype=null}return a},FX}();return jX=Function.prototype.bind||e}function JX(){return HX?UX:(HX=1,UX=Function.prototype.call)}function ZX(){return WX?qX:(WX=1,qX=Function.prototype.apply)}var QX,eJ,tJ,nJ,rJ,oJ,aJ,iJ="undefined"!=typeof Reflect&&Reflect&&Reflect.apply,lJ=XX(),sJ=ZX(),cJ=JX(),uJ=iJ||lJ.call(cJ,sJ),dJ=XX(),pJ=sK,fJ=JX(),hJ=uJ,mJ=function(e){if(e.length<1||"function"!=typeof e[0])throw new pJ("a function is required");return hJ(dJ,fJ,e)};var vJ=fX,gJ=hX,yJ=mX,bJ=vX,wJ=gX,xJ=yX,CJ=sK,_J=bX,EJ=wX,SJ=xX,kJ=CX,TJ=_X,NJ=EX,DJ=SX,AJ=function(e){return TX(e)||0===e?e:e<0?-1:1},IJ=Function,RJ=function(e){try{return IJ('"use strict"; return ('+e+").constructor;")()}catch(HT){}},MJ=DX,OJ=GX,BJ=function(){throw new CJ},VJ=MJ?function(){try{return BJ}catch(e){try{return MJ(arguments,"callee").get}catch(t){return BJ}}}():BJ,PJ=function(){if(OX)return MX;OX=1;var e="undefined"!=typeof Symbol&&Symbol,t=RX?IX:(RX=1,IX=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0});return MX=function(){return"function"==typeof e&&("function"==typeof Symbol&&("symbol"==typeof e("foo")&&("symbol"==typeof Symbol("bar")&&t())))}}()(),LJ=function(){if(nJ)return tJ;nJ=1;var e=YX(),t=KX(),n=function(){if(eJ)return QX;eJ=1;var e,t=mJ,n=DX;try{e=[].__proto__===Array.prototype}catch(HT){if(!HT||"object"!=typeof HT||!("code"in HT)||"ERR_PROTO_ACCESS"!==HT.code)throw HT}var r=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,a=o.getPrototypeOf;return QX=r&&"function"==typeof r.get?t([r.get]):"function"==typeof a&&function(e){return a(null==e?e:o(e))}}();return tJ=e?function(t){return e(t)}:t?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return t(e)}:n?function(e){return n(e)}:null}(),FJ=KX(),zJ=YX(),jJ=ZX(),$J=JX(),UJ={},HJ="undefined"!=typeof Uint8Array&&LJ?LJ(Uint8Array):aJ,qJ={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?aJ:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?aJ:ArrayBuffer,"%ArrayIteratorPrototype%":PJ&&LJ?LJ([][Symbol.iterator]()):aJ,"%AsyncFromSyncIteratorPrototype%":aJ,"%AsyncFunction%":UJ,"%AsyncGenerator%":UJ,"%AsyncGeneratorFunction%":UJ,"%AsyncIteratorPrototype%":UJ,"%Atomics%":"undefined"==typeof Atomics?aJ:Atomics,"%BigInt%":"undefined"==typeof BigInt?aJ:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?aJ:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?aJ:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?aJ:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gJ,"%eval%":eval,"%EvalError%":yJ,"%Float16Array%":"undefined"==typeof Float16Array?aJ:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?aJ:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?aJ:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?aJ:FinalizationRegistry,"%Function%":IJ,"%GeneratorFunction%":UJ,"%Int8Array%":"undefined"==typeof Int8Array?aJ:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?aJ:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?aJ:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":PJ&&LJ?LJ(LJ([][Symbol.iterator]())):aJ,"%JSON%":"object"==typeof JSON?JSON:aJ,"%Map%":"undefined"==typeof Map?aJ:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&PJ&&LJ?LJ((new Map)[Symbol.iterator]()):aJ,"%Math%":Math,"%Number%":Number,"%Object%":vJ,"%Object.getOwnPropertyDescriptor%":MJ,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?aJ:Promise,"%Proxy%":"undefined"==typeof Proxy?aJ:Proxy,"%RangeError%":bJ,"%ReferenceError%":wJ,"%Reflect%":"undefined"==typeof Reflect?aJ:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?aJ:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&PJ&&LJ?LJ((new Set)[Symbol.iterator]()):aJ,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?aJ:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":PJ&&LJ?LJ(""[Symbol.iterator]()):aJ,"%Symbol%":PJ?Symbol:aJ,"%SyntaxError%":xJ,"%ThrowTypeError%":VJ,"%TypedArray%":HJ,"%TypeError%":CJ,"%Uint8Array%":"undefined"==typeof Uint8Array?aJ:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?aJ:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?aJ:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?aJ:Uint32Array,"%URIError%":_J,"%WeakMap%":"undefined"==typeof WeakMap?aJ:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?aJ:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?aJ:WeakSet,"%Function.prototype.call%":$J,"%Function.prototype.apply%":jJ,"%Object.defineProperty%":OJ,"%Object.getPrototypeOf%":FJ,"%Math.abs%":EJ,"%Math.floor%":SJ,"%Math.max%":kJ,"%Math.min%":TJ,"%Math.pow%":NJ,"%Math.round%":DJ,"%Math.sign%":AJ,"%Reflect.getPrototypeOf%":zJ};if(LJ)try{null.error}catch(HT){var WJ=LJ(LJ(HT));qJ["%Error.prototype%"]=WJ}var GJ=function e(t){var n;if("%AsyncFunction%"===t)n=RJ("async function () {}");else if("%GeneratorFunction%"===t)n=RJ("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=RJ("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&LJ&&(n=LJ(o.prototype))}return qJ[t]=n,n},YJ={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},KJ=XX(),XJ=function(){if(oJ)return rJ;oJ=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=XX();return rJ=n.call(e,t)}(),JJ=KJ.call($J,Array.prototype.concat),ZJ=KJ.call(jJ,Array.prototype.splice),QJ=KJ.call($J,String.prototype.replace),eZ=KJ.call($J,String.prototype.slice),tZ=KJ.call($J,RegExp.prototype.exec),nZ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rZ=/\\(\\)?/g,oZ=function(e,t){var n,r=e;if(XJ(YJ,r)&&(r="%"+(n=YJ[r])[0]+"%"),XJ(qJ,r)){var o=qJ[r];if(o===UJ&&(o=GJ(r)),void 0===o&&!t)throw new CJ("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new xJ("intrinsic "+e+" does not exist!")},aZ=function(e,t){if("string"!=typeof e||0===e.length)throw new CJ("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new CJ('"allowMissing" argument must be a boolean');if(null===tZ(/^%?[^%]*%?$/,e))throw new xJ("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=eZ(e,0,1),n=eZ(e,-1);if("%"===t&&"%"!==n)throw new xJ("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new xJ("invalid intrinsic syntax, expected opening `%`");var r=[];return QJ(e,nZ,(function(e,t,n,o){r[r.length]=n?QJ(o,rZ,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=oZ("%"+r+"%",t),a=o.name,i=o.value,l=!1,s=o.alias;s&&(r=s[0],ZJ(n,JJ([0,1],s)));for(var c=1,u=!0;c<n.length;c+=1){var d=n[c],p=eZ(d,0,1),f=eZ(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===f||"'"===f||"`"===f)&&p!==f)throw new xJ("property names with quotes must have matching quotes");if("constructor"!==d&&u||(l=!0),XJ(qJ,a="%"+(r+="."+d)+"%"))i=qJ[a];else if(null!=i){if(!(d in i)){if(!t)throw new CJ("base intrinsic for "+e+" exists, but the property is not available.");return}if(MJ&&c+1>=n.length){var h=MJ(i,d);i=(u=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:i[d]}else u=XJ(i,d),i=i[d];u&&!l&&(qJ[a]=i)}}return i},iZ=aZ,lZ=mJ,sZ=lZ([iZ("%String.prototype.indexOf%")]),cZ=function(e,t){var n=iZ(e,!!t);return"function"==typeof n&&sZ(e,".prototype.")>-1?lZ([n]):n},uZ=cZ,dZ=WK,pZ=sK,fZ=aZ("%Map%",!0),hZ=uZ("Map.prototype.get",!0),mZ=uZ("Map.prototype.set",!0),vZ=uZ("Map.prototype.has",!0),gZ=uZ("Map.prototype.delete",!0),yZ=uZ("Map.prototype.size",!0),bZ=!!fZ&&function(){var e,t={assert:function(e){if(!t.has(e))throw new pZ("Side channel does not contain "+dZ(e))},delete:function(t){if(e){var n=gZ(e,t);return 0===yZ(e)&&(e=void 0),n}return!1},get:function(t){if(e)return hZ(e,t)},has:function(t){return!!e&&vZ(e,t)},set:function(t,n){e||(e=new fZ),mZ(e,t,n)}};return t},wZ=cZ,xZ=WK,CZ=bZ,_Z=sK,EZ=aZ("%WeakMap%",!0),SZ=wZ("WeakMap.prototype.get",!0),kZ=wZ("WeakMap.prototype.set",!0),TZ=wZ("WeakMap.prototype.has",!0),NZ=wZ("WeakMap.prototype.delete",!0),DZ=sK,AZ=WK,IZ=(EZ?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new _Z("Side channel does not contain "+xZ(e))},delete:function(n){if(EZ&&n&&("object"==typeof n||"function"==typeof n)){if(e)return NZ(e,n)}else if(CZ&&t)return t.delete(n);return!1},get:function(n){return EZ&&n&&("object"==typeof n||"function"==typeof n)&&e?SZ(e,n):t&&t.get(n)},has:function(n){return EZ&&n&&("object"==typeof n||"function"==typeof n)&&e?TZ(e,n):!!t&&t.has(n)},set:function(n,r){EZ&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new EZ),kZ(e,n,r)):CZ&&(t||(t=CZ()),t.set(n,r))}};return n}:CZ)||bZ||function(){var e,t={assert:function(e){if(!t.has(e))throw new dX("Side channel does not contain "+uX(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return pX(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=pX(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!pX(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=pX(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t},RZ=String.prototype.replace,MZ=/%20/g,OZ="RFC3986",BZ={default:OZ,formatters:{RFC1738:function(e){return RZ.call(e,MZ,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:OZ},VZ=BZ,PZ=Object.prototype.hasOwnProperty,LZ=Array.isArray,FZ=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),zZ=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},jZ={arrayToObject:zZ,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],i=Object.keys(a),l=0;l<i.length;++l){var s=i[l],c=a[s];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:a,prop:s}),n.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(LZ(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(HT){return r}},encode:function(e,t,n,r,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var i="",l=0;l<a.length;++l){var s=a.charCodeAt(l);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||o===VZ.RFC1738&&(40===s||41===s)?i+=a.charAt(l):s<128?i+=FZ[s]:s<2048?i+=FZ[192|s>>6]+FZ[128|63&s]:s<55296||s>=57344?i+=FZ[224|s>>12]+FZ[128|s>>6&63]+FZ[128|63&s]:(l+=1,s=65536+((1023&s)<<10|1023&a.charCodeAt(l)),i+=FZ[240|s>>18]+FZ[128|s>>12&63]+FZ[128|s>>6&63]+FZ[128|63&s])}return i},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(LZ(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(LZ(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!PZ.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var o=t;return LZ(t)&&!LZ(n)&&(o=zZ(t,r)),LZ(t)&&LZ(n)?(n.forEach((function(n,o){if(PZ.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,r):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var a=n[o];return PZ.call(t,o)?t[o]=e(t[o],a,r):t[o]=a,t}),o)}},$Z=function(){var e,t={assert:function(e){if(!t.has(e))throw new DZ("Side channel does not contain "+AZ(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=IZ()),e.set(t,n)}};return t},UZ=jZ,HZ=BZ,qZ=Object.prototype.hasOwnProperty,WZ={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},GZ=Array.isArray,YZ=Array.prototype.push,KZ=function(e,t){YZ.apply(e,GZ(t)?t:[t])},XZ=Date.prototype.toISOString,JZ=HZ.default,ZZ={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:UZ.encode,encodeValuesOnly:!1,format:JZ,formatter:HZ.formatters[JZ],indices:!1,serializeDate:function(e){return XZ.call(e)},skipNulls:!1,strictNullHandling:!1},QZ={},eQ=function e(t,n,r,o,a,i,l,s,c,u,d,p,f,h,m,v,g,y){for(var b,w=t,x=y,C=0,_=!1;void 0!==(x=x.get(QZ))&&!_;){var E=x.get(t);if(C+=1,void 0!==E){if(E===C)throw new RangeError("Cyclic object value");_=!0}void 0===x.get(QZ)&&(C=0)}if("function"==typeof u?w=u(n,w):w instanceof Date?w=f(w):"comma"===r&&GZ(w)&&(w=UZ.maybeMap(w,(function(e){return e instanceof Date?f(e):e}))),null===w){if(i)return c&&!v?c(n,ZZ.encoder,g,"key",h):n;w=""}if("string"==typeof(b=w)||"number"==typeof b||"boolean"==typeof b||"symbol"==typeof b||"bigint"==typeof b||UZ.isBuffer(w))return c?[m(v?n:c(n,ZZ.encoder,g,"key",h))+"="+m(c(w,ZZ.encoder,g,"value",h))]:[m(n)+"="+m(String(w))];var S,k=[];if(void 0===w)return k;if("comma"===r&&GZ(w))v&&c&&(w=UZ.maybeMap(w,c)),S=[{value:w.length>0?w.join(",")||null:void 0}];else if(GZ(u))S=u;else{var T=Object.keys(w);S=d?T.sort(d):T}var N=s?n.replace(/\./g,"%2E"):n,D=o&&GZ(w)&&1===w.length?N+"[]":N;if(a&&GZ(w)&&0===w.length)return D+"[]";for(var A=0;A<S.length;++A){var I=S[A],R="object"==typeof I&&void 0!==I.value?I.value:w[I];if(!l||null!==R){var M=p&&s?I.replace(/\./g,"%2E"):I,O=GZ(w)?"function"==typeof r?r(D,M):D:D+(p?"."+M:"["+M+"]");y.set(t,C);var B=$Z();B.set(QZ,y),KZ(k,e(R,O,r,o,a,i,l,s,"comma"===r&&v&&GZ(w)?null:c,u,d,p,f,h,m,v,g,B))}}return k},tQ=jZ,nQ=Object.prototype.hasOwnProperty,rQ=Array.isArray,oQ={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!0,decoder:tQ.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},aQ=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},iQ=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},lQ=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,i=n.depth>0&&/(\[[^[\]]*])/.exec(o),l=i?o.slice(0,i.index):o,s=[];if(l){if(!n.plainObjects&&nQ.call(Object.prototype,l)&&!n.allowPrototypes)return;s.push(l)}for(var c=0;n.depth>0&&null!==(i=a.exec(o))&&c<n.depth;){if(c+=1,!n.plainObjects&&nQ.call(Object.prototype,i[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(i[1])}return i&&s.push("["+o.slice(i.index)+"]"),function(e,t,n,r){for(var o=r?t:iQ(t,n),a=e.length-1;a>=0;--a){var i,l=e[a];if("[]"===l&&n.parseArrays)i=n.allowEmptyArrays&&""===o?[]:[].concat(o);else{i=n.plainObjects?Object.create(null):{};var s="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=n.decodeDotInKeys?s.replace(/%2E/g,"."):s,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&l!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=o:"__proto__"!==c&&(i[c]=o):i={0:o}}o=i}return o}(s,t,n,r)}},sQ=function(e,t){var n,r=e,o=function(e){if(!e)return ZZ;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||ZZ.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=HZ.default;if(void 0!==e.format){if(!qZ.call(HZ.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r,o=HZ.formatters[n],a=ZZ.filter;if(("function"==typeof e.filter||GZ(e.filter))&&(a=e.filter),r=e.arrayFormat in WZ?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":ZZ.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var i=void 0===e.allowDots?!0===e.encodeDotInKeys||ZZ.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:ZZ.addQueryPrefix,allowDots:i,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:ZZ.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:ZZ.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:void 0===e.delimiter?ZZ.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:ZZ.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:ZZ.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:ZZ.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:ZZ.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:ZZ.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:ZZ.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:ZZ.strictNullHandling}}(t);"function"==typeof o.filter?r=(0,o.filter)("",r):GZ(o.filter)&&(n=o.filter);var a=[];if("object"!=typeof r||null===r)return"";var i=WZ[o.arrayFormat],l="comma"===i&&o.commaRoundTrip;n||(n=Object.keys(r)),o.sort&&n.sort(o.sort);for(var s=$Z(),c=0;c<n.length;++c){var u=n[c];o.skipNulls&&null===r[u]||KZ(a,eQ(r[u],u,i,l,o.allowEmptyArrays,o.strictNullHandling,o.skipNulls,o.encodeDotInKeys,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,s))}var d=a.join(o.delimiter),p=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},cQ=function(e,t){var n=function(e){if(!e)return oQ;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?oQ.charset:e.charset,n=void 0===e.duplicates?oQ.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||oQ.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:oQ.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:oQ.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:oQ.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:oQ.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:oQ.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:oQ.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:oQ.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:oQ.decoder,delimiter:"string"==typeof e.delimiter||tQ.isRegExp(e.delimiter)?e.delimiter:oQ.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:oQ.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:oQ.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:oQ.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:oQ.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:oQ.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,i=o.split(t.delimiter,a),l=-1,s=t.charset;if(t.charsetSentinel)for(n=0;n<i.length;++n)0===i[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===i[n]?s="utf-8":"utf8=%26%2310003%3B"===i[n]&&(s="iso-8859-1"),l=n,n=i.length);for(n=0;n<i.length;++n)if(n!==l){var c,u,d=i[n],p=d.indexOf("]="),f=-1===p?d.indexOf("="):p+1;-1===f?(c=t.decoder(d,oQ.decoder,s,"key"),u=t.strictNullHandling?null:""):(c=t.decoder(d.slice(0,f),oQ.decoder,s,"key"),u=tQ.maybeMap(iQ(d.slice(f+1),t),(function(e){return t.decoder(e,oQ.decoder,s,"value")}))),u&&t.interpretNumericEntities&&"iso-8859-1"===s&&(u=aQ(u)),d.indexOf("[]=")>-1&&(u=rQ(u)?[u]:u);var h=nQ.call(r,c);h&&"combine"===t.duplicates?r[c]=tQ.combine(r[c],u):h&&"last"!==t.duplicates||(r[c]=u)}return r}(e,n):e,o=n.plainObjects?Object.create(null):{},a=Object.keys(r),i=0;i<a.length;++i){var l=a[i],s=lQ(l,r[l],n,"string"==typeof e);o=tQ.merge(o,s,n)}return!0===n.allowSparse?o:tQ.compact(o)};const uQ=P({formats:BZ,parse:cQ,stringify:sQ});const dQ=[async function(e){let t={...e};if("application/x-www-form-urlencoded"===e.headers["Content-Type"]&&(t.data=uQ.stringify(t.data)),"multipart/form-data"===e.headers["Content-Type"]){const[e,...n]=Object.keys(t.data),r=t.data[e],o=await async function(e,t){const n=new FormData;return U.isArray(e)?await Promise.all(e.map((e=>(n.append(t,e),!0)))):await n.append(t,e),n}(r,e);null==n||n.forEach((e=>{o.append(e,"object"==typeof t.data[e]?JSON.stringify(t.data[e]):t.data[e])})),t.data=o}return t},function(e){throw e}];
55
+ function(){var t=e,n=t.lib,r=n.WordArray,o=n.Hasher,a=t.algo,i=r.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=r.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=r.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=r.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=r.create([0,1518500249,1859775393,2400959708,2840853838]),d=r.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=o.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var a,p,b,w,x,C,_,E,S,k,T,N=this._hash.words,D=u.words,A=d.words,I=i.words,R=l.words,M=s.words,O=c.words;for(C=a=N[0],_=p=N[1],E=b=N[2],S=w=N[3],k=x=N[4],n=0;n<80;n+=1)T=a+e[t+I[n]]|0,T+=n<16?f(p,b,w)+D[0]:n<32?h(p,b,w)+D[1]:n<48?m(p,b,w)+D[2]:n<64?v(p,b,w)+D[3]:g(p,b,w)+D[4],T=(T=y(T|=0,M[n]))+x|0,a=x,x=w,w=y(b,10),b=p,p=T,T=C+e[t+R[n]]|0,T+=n<16?g(_,E,S)+A[0]:n<32?v(_,E,S)+A[1]:n<48?m(_,E,S)+A[2]:n<64?h(_,E,S)+A[3]:f(_,E,S)+A[4],T=(T=y(T|=0,O[n]))+k|0,C=k,k=S,S=y(E,10),E=_,_=T;T=N[1]+b+S|0,N[1]=N[2]+w+k|0,N[2]=N[3]+x+C|0,N[3]=N[4]+a+_|0,N[4]=N[0]+p+E|0,N[0]=T},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,a=o.words,i=0;i<5;i++){var l=a[i];a[i]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return o},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function v(e,t,n){return e&n|t&~n}function g(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(p),t.HmacRIPEMD160=o._createHmacHelper(p)}(),e.RIPEMD160)),dW.exports;var e}(),hW(),function(){return mW?vW.exports:(mW=1,vW.exports=(s=Dq(),Qq(),hW(),t=(e=s).lib,n=t.Base,r=t.WordArray,o=e.algo,a=o.SHA256,i=o.HMAC,l=o.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,o=i.create(n.hasher,e),a=r.create(),l=r.create([1]),s=a.words,c=l.words,u=n.keySize,d=n.iterations;s.length<u;){var p=o.update(t).finalize(l);o.reset();for(var f=p.words,h=f.length,m=p,v=1;v<d;v++){m=o.finalize(m),o.reset();for(var g=m.words,y=0;y<h;y++)f[y]^=g[y]}a.concat(p),c[0]++}return a.sigBytes=4*u,a}}),e.PBKDF2=function(e,t,n){return l.create(n).compute(e,t)},s.PBKDF2));var e,t,n,r,o,a,i,l,s}(),bW(),CW(),function(){return _W?EW.exports:(_W=1,EW.exports=(e=Dq(),CW(),e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var o,a=this._iv;a?(o=a.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var i=0;i<n;i++)e[t+i]^=o[i]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize;n.call(this,e,t,o,r),this._prevBlock=e.slice(t,t+o)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,a=e.slice(t,t+o);n.call(this,e,t,o,r),this._prevBlock=a}}),t}(),e.mode.CFB));var e}(),function(){return SW?kW.exports:(SW=1,kW.exports=(n=Dq(),CW(),n.mode.CTR=(e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0);var i=a.slice(0);n.encryptBlock(i,0),a[r-1]=a[r-1]+1|0;for(var l=0;l<r;l++)e[t+l]^=i[l]}}),e.Decryptor=t,e),n.mode.CTR));var e,t,n}(),DW(),function(){return AW?IW.exports:(AW=1,IW.exports=(n=Dq(),CW(),n.mode.OFB=(e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,a=this._keystream;o&&(a=this._keystream=o.slice(0),this._iv=void 0),n.encryptBlock(a,0);for(var i=0;i<r;i++)e[t+i]^=a[i]}}),e.Decryptor=t,e),n.mode.OFB));var e,t,n}(),function(){return RW?MW.exports:(RW=1,MW.exports=(t=Dq(),CW(),t.mode.ECB=((e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),e),t.mode.ECB));var e,t}(),function(){return OW?BW.exports:(OW=1,BW.exports=(e=Dq(),CW(),e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,o=r-n%r,a=n+o-1;e.clamp(),e.words[a>>>2]|=o<<24-a%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923));var e}(),function(){return VW?PW.exports:(VW=1,PW.exports=(e=Dq(),CW(),e.pad.Iso10126={pad:function(t,n){var r=4*n,o=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(o-1)).concat(e.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126));var e}(),function(){return LW?FW.exports:(LW=1,FW.exports=(e=Dq(),CW(),e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971));var e}(),function(){return zW?jW.exports:(zW=1,jW.exports=(e=Dq(),CW(),e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding));var e}(),function(){return $W?UW.exports:($W=1,UW.exports=(e=Dq(),CW(),e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding));var e}(),function(){return HW?qW.exports:(HW=1,qW.exports=(r=Dq(),CW(),t=(e=r).lib.CipherParams,n=e.enc.Hex,e.format.Hex={stringify:function(e){return e.ciphertext.toString(n)},parse:function(e){var r=n.parse(e);return t.create({ciphertext:r})}},r.format.Hex));var e,t,n,r}(),function(){return WW||(WW=1,GW.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.BlockCipher,r=t.algo,o=[],a=[],i=[],l=[],s=[],c=[],u=[],d=[],p=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var h=r^r<<1^r<<2^r<<3^r<<4;h=h>>>8^255&h^99,o[n]=h,a[h]=n;var m=e[n],v=e[m],g=e[v],y=257*e[h]^16843008*h;i[n]=y<<24|y>>>8,l[n]=y<<16|y>>>16,s[n]=y<<8|y>>>24,c[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[h]=y<<24|y>>>8,d[h]=y<<16|y>>>16,p[h]=y<<8|y>>>24,f[h]=y,n?(n=m^e[e[e[g^m]]],r^=e[e[r]]):n=r=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),a=this._keySchedule=[],i=0;i<r;i++)i<n?a[i]=t[i]:(c=a[i-1],i%n?n>6&&i%n==4&&(c=o[c>>>24]<<24|o[c>>>16&255]<<16|o[c>>>8&255]<<8|o[255&c]):(c=o[(c=c<<8|c>>>24)>>>24]<<24|o[c>>>16&255]<<16|o[c>>>8&255]<<8|o[255&c],c^=h[i/n|0]<<24),a[i]=a[i-n]^c);for(var l=this._invKeySchedule=[],s=0;s<r;s++){if(i=r-s,s%4)var c=a[i];else c=a[i-4];l[s]=s<4||i<=4?c:u[o[c>>>24]]^d[o[c>>>16&255]]^p[o[c>>>8&255]]^f[o[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,l,s,c,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,f,a),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,a,i,l){for(var s=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],f=4,h=1;h<s;h++){var m=r[c>>>24]^o[u>>>16&255]^a[d>>>8&255]^i[255&p]^n[f++],v=r[u>>>24]^o[d>>>16&255]^a[p>>>8&255]^i[255&c]^n[f++],g=r[d>>>24]^o[p>>>16&255]^a[c>>>8&255]^i[255&u]^n[f++],y=r[p>>>24]^o[c>>>16&255]^a[u>>>8&255]^i[255&d]^n[f++];c=m,u=v,d=g,p=y}m=(l[c>>>24]<<24|l[u>>>16&255]<<16|l[d>>>8&255]<<8|l[255&p])^n[f++],v=(l[u>>>24]<<24|l[d>>>16&255]<<16|l[p>>>8&255]<<8|l[255&c])^n[f++],g=(l[d>>>24]<<24|l[p>>>16&255]<<16|l[c>>>8&255]<<8|l[255&u])^n[f++],y=(l[p>>>24]<<24|l[c>>>16&255]<<16|l[u>>>8&255]<<8|l[255&d])^n[f++],e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y},keySize:8});t.AES=n._createHelper(m)}(),e.AES)),GW.exports;var e}(),XW(),function(){return JW||(JW=1,ZW.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.StreamCipher,r=t.algo,o=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var a=0;o<256;o++){var i=o%n,l=t[i>>>2]>>>24-i%4*8&255;a=(a+r[o]+l)%256;var s=r[o];r[o]=r[a],r[a]=s}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[n],e[n]=a,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}t.RC4=n._createHelper(o);var i=r.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});t.RC4Drop=n._createHelper(i)}(),e.RC4)),ZW.exports;var e}(),function(){return QW?eG.exports:(QW=1,eG.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.StreamCipher,r=t.algo,o=[],a=[],i=[],l=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)s.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var a=t.words,i=a[0],l=a[1],c=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),u=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(o[0]^=c,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=c,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)s.call(this)}},_doProcessBlock:function(e,t){var n=this._X;s.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function s(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,l=r>>>16,s=((o*o>>>17)+o*l>>>15)+l*l,c=((4294901760&r)*r|0)+((65535&r)*r|0);i[n]=s^c}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}t.Rabbit=n._createHelper(l)}(),e.Rabbit));var e}(),function(){return tG?nG.exports:(tG=1,nG.exports=(e=Dq(),jq(),Gq(),bW(),CW(),function(){var t=e,n=t.lib.StreamCipher,r=t.algo,o=[],a=[],i=[],l=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)s.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var a=t.words,i=a[0],l=a[1],c=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),u=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(r[0]^=c,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=c,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)s.call(this)}},_doProcessBlock:function(e,t){var n=this._X;s.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function s(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,l=r>>>16,s=((o*o>>>17)+o*l>>>15)+l*l,c=((4294901760&r)*r|0)+((65535&r)*r|0);i[n]=s^c}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}t.RabbitLegacy=n._createHelper(l)}(),e.RabbitLegacy));var e}(),dG());var pG=Sq.exports;const fG=P(pG);function hG(e,t){return function(){return e.apply(t,arguments)}}const{toString:mG}=Object.prototype,{getPrototypeOf:vG}=Object,gG=(e=>t=>{const n=mG.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),yG=e=>(e=e.toLowerCase(),t=>gG(t)===e),bG=e=>t=>typeof t===e,{isArray:wG}=Array,xG=bG("undefined");const CG=yG("ArrayBuffer");const _G=bG("string"),EG=bG("function"),SG=bG("number"),kG=e=>null!==e&&"object"==typeof e,TG=e=>{if("object"!==gG(e))return!1;const t=vG(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},NG=yG("Date"),DG=yG("File"),AG=yG("Blob"),IG=yG("FileList"),RG=yG("URLSearchParams");function MG(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),wG(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(r=0;r<a;r++)i=o[r],t.call(null,e[i],i,e)}}function OG(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const BG="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,VG=e=>!xG(e)&&e!==BG;const PG=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&vG(Uint8Array)),LG=yG("HTMLFormElement"),FG=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zG=yG("RegExp"),jG=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};MG(n,((n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)})),Object.defineProperties(e,r)},$G="abcdefghijklmnopqrstuvwxyz",UG="0123456789",HG={DIGIT:UG,ALPHA:$G,ALPHA_DIGIT:$G+$G.toUpperCase()+UG};const qG=yG("AsyncFunction"),WG={isArray:wG,isArrayBuffer:CG,isBuffer:function(e){return null!==e&&!xG(e)&&null!==e.constructor&&!xG(e.constructor)&&EG(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||EG(e.append)&&("formdata"===(t=gG(e))||"object"===t&&EG(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&CG(e.buffer),t},isString:_G,isNumber:SG,isBoolean:e=>!0===e||!1===e,isObject:kG,isPlainObject:TG,isUndefined:xG,isDate:NG,isFile:DG,isBlob:AG,isRegExp:zG,isFunction:EG,isStream:e=>kG(e)&&EG(e.pipe),isURLSearchParams:RG,isTypedArray:PG,isFileList:IG,forEach:MG,merge:function e(){const{caseless:t}=VG(this)&&this||{},n={},r=(r,o)=>{const a=t&&OG(n,o)||o;TG(n[a])&&TG(r)?n[a]=e(n[a],r):TG(r)?n[a]=e({},r):wG(r)?n[a]=r.slice():n[a]=r};for(let o=0,a=arguments.length;o<a;o++)arguments[o]&&MG(arguments[o],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(MG(t,((t,r)=>{n&&EG(t)?e[r]=hG(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const l={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||l[i]||(t[i]=e[i],l[i]=!0);e=!1!==n&&vG(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:gG,kindOfTest:yG,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(wG(e))return e;let t=e.length;if(!SG(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:LG,hasOwnProperty:FG,hasOwnProp:FG,reduceDescriptors:jG,freezeMethods:e=>{jG(e,((t,n)=>{if(EG(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];EG(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return wG(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:OG,global:BG,isContextDefined:VG,ALPHABET:HG,generateString:(e=16,t=HG.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&EG(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(kG(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=wG(e)?[]:{};return MG(e,((e,t)=>{const a=n(e,r+1);!xG(a)&&(o[t]=a)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:qG,isThenable:e=>e&&(kG(e)||EG(e))&&EG(e.then)&&EG(e.catch)};function GG(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}WG.inherits(GG,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:WG.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const YG=GG.prototype,KG={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{KG[e]={value:e}})),Object.defineProperties(GG,KG),Object.defineProperty(YG,"isAxiosError",{value:!0}),GG.from=(e,t,n,r,o,a)=>{const i=Object.create(YG);return WG.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),GG.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};function XG(e){return WG.isPlainObject(e)||WG.isArray(e)}function JG(e){return WG.endsWith(e,"[]")?e.slice(0,-2):e}function ZG(e,t,n){return e?e.concat(t).map((function(e,t){return e=JG(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const QG=WG.toFlatObject(WG,{},null,(function(e){return/^is[A-Z]/.test(e)}));function eY(e,t,n){if(!WG.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=WG.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!WG.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,a=n.dots,i=n.indexes,l=(n.Blob||"undefined"!=typeof Blob&&Blob)&&WG.isSpecCompliantForm(t);if(!WG.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(WG.isDate(e))return e.toISOString();if(!l&&WG.isBlob(e))throw new GG("Blob is not supported. Use a Buffer instead.");return WG.isArrayBuffer(e)||WG.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let l=e;if(e&&!o&&"object"==typeof e)if(WG.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(WG.isArray(e)&&function(e){return WG.isArray(e)&&!e.some(XG)}(e)||(WG.isFileList(e)||WG.endsWith(n,"[]"))&&(l=WG.toArray(e)))return n=JG(n),l.forEach((function(e,r){!WG.isUndefined(e)&&null!==e&&t.append(!0===i?ZG([n],r,a):null===i?n:n+"[]",s(e))})),!1;return!!XG(e)||(t.append(ZG(o,n,a),s(e)),!1)}const u=[],d=Object.assign(QG,{defaultVisitor:c,convertValue:s,isVisitable:XG});if(!WG.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!WG.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),WG.forEach(n,(function(n,a){!0===(!(WG.isUndefined(n)||null===n)&&o.call(t,n,WG.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t}function tY(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function nY(e,t){this._pairs=[],e&&eY(e,this,t)}const rY=nY.prototype;function oY(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function aY(e,t,n){if(!t)return e;const r=n&&n.encode||oY,o=n&&n.serialize;let a;if(a=o?o(t,n):WG.isURLSearchParams(t)?t.toString():new nY(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}rY.append=function(e,t){this._pairs.push([e,t])},rY.toString=function(e){const t=e?function(t){return e.call(this,t,tY)}:tY;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class iY{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){WG.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}const lY={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},sY={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:nY,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},cY="undefined"!=typeof window&&"undefined"!=typeof document,uY=(dY="undefined"!=typeof navigator&&navigator.product,cY&&["ReactNative","NativeScript","NS"].indexOf(dY)<0);var dY;const pY="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fY={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cY,hasStandardBrowserEnv:uY,hasStandardBrowserWebWorkerEnv:pY},Symbol.toStringTag,{value:"Module"})),...sY};function hY(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),l=o>=e.length;if(a=!a&&WG.isArray(r)?r.length:a,l)return WG.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i;r[a]&&WG.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],o)&&WG.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i}if(WG.isFormData(e)&&WG.isFunction(e.entries)){const n={};return WG.forEachEntry(e,((e,r)=>{t(function(e){return WG.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const mY={transitional:lY,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=WG.isObject(e);o&&WG.isHTMLForm(e)&&(e=new FormData(e));if(WG.isFormData(e))return r?JSON.stringify(hY(e)):e;if(WG.isArrayBuffer(e)||WG.isBuffer(e)||WG.isStream(e)||WG.isFile(e)||WG.isBlob(e))return e;if(WG.isArrayBufferView(e))return e.buffer;if(WG.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return eY(e,new fY.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return fY.isNode&&WG.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=WG.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return eY(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(WG.isString(e))try{return(t||JSON.parse)(e),WG.trim(e)}catch(HT){if("SyntaxError"!==HT.name)throw HT}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||mY.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&WG.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(HT){if(n){if("SyntaxError"===HT.name)throw GG.from(HT,GG.ERR_BAD_RESPONSE,this,null,this.response);throw HT}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fY.classes.FormData,Blob:fY.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};WG.forEach(["delete","get","head","post","put","patch"],(e=>{mY.headers[e]={}}));const vY=WG.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),gY=Symbol("internals");function yY(e){return e&&String(e).trim().toLowerCase()}function bY(e){return!1===e||null==e?e:WG.isArray(e)?e.map(bY):String(e)}function wY(e,t,n,r,o){return WG.isFunction(r)?r.call(this,t,n):(o&&(t=n),WG.isString(t)?WG.isString(r)?-1!==t.indexOf(r):WG.isRegExp(r)?r.test(t):void 0:void 0)}let xY=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=yY(t);if(!o)throw new Error("header name must be a non-empty string");const a=WG.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=bY(e))}const a=(e,t)=>WG.forEach(e,((e,n)=>o(e,n,t)));return WG.isPlainObject(e)||e instanceof this.constructor?a(e,t):WG.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&vY[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=yY(e)){const n=WG.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(WG.isFunction(t))return t.call(this,e,n);if(WG.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=yY(e)){const n=WG.findKey(this,e);return!(!n||void 0===this[n]||t&&!wY(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=yY(e)){const o=WG.findKey(n,e);!o||t&&!wY(0,n[o],o,t)||(delete n[o],r=!0)}}return WG.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!wY(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return WG.forEach(this,((r,o)=>{const a=WG.findKey(n,o);if(a)return t[a]=bY(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=bY(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return WG.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&WG.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[gY]=this[gY]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=yY(e);t[r]||(!function(e,t){const n=WG.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return WG.isArray(e)?e.forEach(r):r(e),this}};function CY(e,t){const n=this||mY,r=t||n,o=xY.from(r.headers);let a=r.data;return WG.forEach(e,(function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)})),o.normalize(),a}function _Y(e){return!(!e||!e.__CANCEL__)}function EY(e,t,n){GG.call(this,null==e?"canceled":e,GG.ERR_CANCELED,t,n),this.name="CanceledError"}xY.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),WG.reduceDescriptors(xY.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),WG.freezeMethods(xY),WG.inherits(EY,GG,{__CANCEL__:!0});const SY=fY.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];WG.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),WG.isString(r)&&i.push("path="+r),WG.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function kY(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const TY=fY.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=WG.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return function(){return!0}}();function NY(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(l){const s=Date.now(),c=r[i];o||(o=s),n[a]=l,r[a]=s;let u=i,d=0;for(;u!==a;)d+=n[u++],u%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),s-o<t)return;const p=c&&s-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return o=>{const a=o.loaded,i=o.lengthComputable?o.total:void 0,l=a-n,s=r(l);n=a;const c={loaded:a,total:i,progress:i?a/i:void 0,bytes:l,rate:s||void 0,estimated:s&&i&&a<=i?(i-a)/s:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const DY="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=xY.from(e.headers).normalize();let a,i,{responseType:l,withXSRFToken:s}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(WG.isFormData(r))if(fY.hasStandardBrowserEnv||fY.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=kY(e.baseURL,e.url);function p(){if(!u)return;const r=xY.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new GG("Request failed with status code "+n.status,[GG.ERR_BAD_REQUEST,GG.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:l&&"text"!==l&&"json"!==l?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),aY(d,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(n(new GG("Request aborted",GG.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new GG("Network Error",GG.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||lY;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new GG(t,r.clarifyTimeoutError?GG.ETIMEDOUT:GG.ECONNABORTED,e,u)),u=null},fY.hasStandardBrowserEnv&&(s&&WG.isFunction(s)&&(s=s(e)),s||!1!==s&&TY(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&SY.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in u&&WG.forEach(o.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),WG.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),l&&"json"!==l&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",NY(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",NY(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{u&&(n(!t||t.type?new EY(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);f&&-1===fY.protocols.indexOf(f)?n(new GG("Unsupported protocol "+f+":",GG.ERR_BAD_REQUEST,e)):u.send(r||null)}))},AY={http:null,xhr:DY};WG.forEach(AY,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(HT){}Object.defineProperty(e,"adapterName",{value:t})}}));const IY=e=>`- ${e}`,RY=e=>WG.isFunction(e)||null===e||!1===e,MY=e=>{e=WG.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!RY(n)&&(r=AY[(t=String(n)).toLowerCase()],void 0===r))throw new GG(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+a]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new GG("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(IY).join("\n"):" "+IY(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function OY(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new EY(null,e)}function BY(e){OY(e),e.headers=xY.from(e.headers),e.data=CY.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return MY(e.adapter||mY.adapter)(e).then((function(t){return OY(e),t.data=CY.call(e,e.transformResponse,t),t.headers=xY.from(t.headers),t}),(function(t){return _Y(t)||(OY(e),t&&t.response&&(t.response.data=CY.call(e,e.transformResponse,t.response),t.response.headers=xY.from(t.response.headers))),Promise.reject(t)}))}const VY=e=>e instanceof xY?{...e}:e;function PY(e,t){t=t||{};const n={};function r(e,t,n){return WG.isPlainObject(e)&&WG.isPlainObject(t)?WG.merge.call({caseless:n},e,t):WG.isPlainObject(t)?WG.merge({},t):WG.isArray(t)?t.slice():t}function o(e,t,n){return WG.isUndefined(t)?WG.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!WG.isUndefined(t))return r(void 0,t)}function i(e,t){return WG.isUndefined(t)?WG.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const s={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(e,t)=>o(VY(e),VY(t),!0)};return WG.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=s[r]||o,i=a(e[r],t[r],r);WG.isUndefined(i)&&a!==l||(n[r]=i)})),n}const LY="1.6.8",FY={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{FY[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const zY={};FY.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,a)=>{if(!1===e)throw new GG(r(o," has been removed"+(t?" in "+t:"")),GG.ERR_DEPRECATED);return t&&!zY[o]&&(zY[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,a)}};const jY={assertOptions:function(e,t,n){if("object"!=typeof e)throw new GG("options must be an object",GG.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new GG("option "+a+" must be "+n,GG.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new GG("Unknown option "+a,GG.ERR_BAD_OPTION)}},validators:FY},$Y=jY.validators;let UY=class{constructor(e){this.defaults=e,this.interceptors={request:new iY,response:new iY}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=PY(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&jY.assertOptions(n,{silentJSONParsing:$Y.transitional($Y.boolean),forcedJSONParsing:$Y.transitional($Y.boolean),clarifyTimeoutError:$Y.transitional($Y.boolean)},!1),null!=r&&(WG.isFunction(r)?t.paramsSerializer={serialize:r}:jY.assertOptions(r,{encode:$Y.function,serialize:$Y.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&WG.merge(o.common,o[t.method]);o&&WG.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=xY.concat(a,o);const i=[];let l=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const s=[];let c;this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)}));let u,d=0;if(!l){const e=[BY.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,s),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(f){t.call(this,f);break}}try{c=BY.call(this,p)}catch(f){return Promise.reject(f)}for(d=0,u=s.length;d<u;)c=c.then(s[d++],s[d++]);return c}getUri(e){return aY(kY((e=PY(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};WG.forEach(["delete","get","head","options"],(function(e){UY.prototype[e]=function(t,n){return this.request(PY(n||{},{method:e,url:t,data:(n||{}).data}))}})),WG.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(PY(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}UY.prototype[e]=t(),UY.prototype[e+"Form"]=t(!0)}));const HY={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HY).forEach((([e,t])=>{HY[t]=e}));const qY=function e(t){const n=new UY(t),r=hG(UY.prototype.request,n);return WG.extend(r,UY.prototype,n,{allOwnKeys:!0}),WG.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(PY(t,n))},r}(mY);qY.Axios=UY,qY.CanceledError=EY,qY.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new EY(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},qY.isCancel=_Y,qY.VERSION=LY,qY.toFormData=eY,qY.AxiosError=GG,qY.Cancel=qY.CanceledError,qY.all=function(e){return Promise.all(e)},qY.spread=function(e){return function(t){return e.apply(null,t)}},qY.isAxiosError=function(e){return WG.isObject(e)&&!0===e.isAxiosError},qY.mergeConfig=PY,qY.AxiosHeaders=xY,qY.formToJSON=e=>hY(WG.isHTMLForm(e)?new FormData(e):e),qY.getAdapter=MY,qY.HttpStatusCode=HY,qY.default=qY;const{Axios:WY,AxiosError:GY,CanceledError:YY,isCancel:KY,CancelToken:XY,VERSION:JY,all:ZY,Cancel:QY,isAxiosError:eK,spread:tK,toFormData:nK,AxiosHeaders:rK,HttpStatusCode:oK,formToJSON:aK,getAdapter:iK,mergeConfig:lK}=qY;var sK=TypeError,cK="function"==typeof Map&&Map.prototype,uK=Object.getOwnPropertyDescriptor&&cK?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,dK=cK&&uK&&"function"==typeof uK.get?uK.get:null,pK=cK&&Map.prototype.forEach,fK="function"==typeof Set&&Set.prototype,hK=Object.getOwnPropertyDescriptor&&fK?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,mK=fK&&hK&&"function"==typeof hK.get?hK.get:null,vK=fK&&Set.prototype.forEach,gK="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,yK="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,bK="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,wK=Boolean.prototype.valueOf,xK=Object.prototype.toString,CK=Function.prototype.toString,_K=String.prototype.match,EK=String.prototype.slice,SK=String.prototype.replace,kK=String.prototype.toUpperCase,TK=String.prototype.toLowerCase,NK=RegExp.prototype.test,DK=Array.prototype.concat,AK=Array.prototype.join,IK=Array.prototype.slice,RK=Math.floor,MK="function"==typeof BigInt?BigInt.prototype.valueOf:null,OK=Object.getOwnPropertySymbols,BK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,VK="function"==typeof Symbol&&"object"==typeof Symbol.iterator,PK="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===VK||"symbol")?Symbol.toStringTag:null,LK=Object.prototype.propertyIsEnumerable,FK=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function zK(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||NK.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-RK(-e):RK(e);if(r!==e){var o=String(r),a=EK.call(t,o.length+1);return SK.call(o,n,"$&_")+"."+SK.call(SK.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return SK.call(t,n,"$&_")}var jK=Tq,$K=jK.custom,UK=ZK($K)?$K:null,HK={__proto__:null,double:'"',single:"'"},qK={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},WK=function e(t,n,r,o){var a=n||{};if(eX(a,"quoteStyle")&&!eX(HK,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(eX(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!eX(a,"customInspect")||a.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(eX(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(eX(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return rX(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var s=String(t);return l?zK(t,s):s}if("bigint"==typeof t){var c=String(t)+"n";return l?zK(t,c):c}var u=void 0===a.depth?5:a.depth;if(void 0===r&&(r=0),r>=u&&u>0&&"object"==typeof t)return XK(t)?"[Array]":"[Object]";var d=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=AK.call(Array(e.indent+1)," ")}return{base:n,prev:AK.call(Array(t+1),n)}}(a,r);if(void 0===o)o=[];else if(nX(o,t)>=0)return"[Circular]";function p(t,n,i){if(n&&(o=IK.call(o)).push(n),i){var l={depth:a.depth};return eX(a,"quoteStyle")&&(l.quoteStyle=a.quoteStyle),e(t,l,r+1,o)}return e(t,a,r+1,o)}if("function"==typeof t&&!JK(t)){var f=function(e){if(e.name)return e.name;var t=_K.call(CK.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),h=cX(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(h.length>0?" { "+AK.call(h,", ")+" }":"")}if(ZK(t)){var m=VK?SK.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):BK.call(t);return"object"!=typeof t||VK?m:aX(m)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var v="<"+TK.call(String(t.nodeName)),g=t.attributes||[],y=0;y<g.length;y++)v+=" "+g[y].name+"="+GK(YK(g[y].value),"double",a);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+TK.call(String(t.nodeName))+">"}if(XK(t)){if(0===t.length)return"[]";var b=cX(t,p);return d&&!function(e){for(var t=0;t<e.length;t++)if(nX(e[t],"\n")>=0)return!1;return!0}(b)?"["+sX(b,d)+"]":"[ "+AK.call(b,", ")+" ]"}if(function(e){return"[object Error]"===tX(e)&&KK(e)}(t)){var w=cX(t,p);return"cause"in Error.prototype||!("cause"in t)||LK.call(t,"cause")?0===w.length?"["+String(t)+"]":"{ ["+String(t)+"] "+AK.call(w,", ")+" }":"{ ["+String(t)+"] "+AK.call(DK.call("[cause]: "+p(t.cause),w),", ")+" }"}if("object"==typeof t&&i){if(UK&&"function"==typeof t[UK]&&jK)return jK(t,{depth:u-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!dK||!e||"object"!=typeof e)return!1;try{dK.call(e);try{mK.call(e)}catch(v){return!0}return e instanceof Map}catch(HT){}return!1}(t)){var x=[];return pK&&pK.call(t,(function(e,n){x.push(p(n,t,!0)+" => "+p(e,t))})),lX("Map",dK.call(t),x,d)}if(function(e){if(!mK||!e||"object"!=typeof e)return!1;try{mK.call(e);try{dK.call(e)}catch(t){return!0}return e instanceof Set}catch(HT){}return!1}(t)){var C=[];return vK&&vK.call(t,(function(e){C.push(p(e,t))})),lX("Set",mK.call(t),C,d)}if(function(e){if(!gK||!e||"object"!=typeof e)return!1;try{gK.call(e,gK);try{yK.call(e,yK)}catch(v){return!0}return e instanceof WeakMap}catch(HT){}return!1}(t))return iX("WeakMap");if(function(e){if(!yK||!e||"object"!=typeof e)return!1;try{yK.call(e,yK);try{gK.call(e,gK)}catch(v){return!0}return e instanceof WeakSet}catch(HT){}return!1}(t))return iX("WeakSet");if(function(e){if(!bK||!e||"object"!=typeof e)return!1;try{return bK.call(e),!0}catch(HT){}return!1}(t))return iX("WeakRef");if(function(e){return"[object Number]"===tX(e)&&KK(e)}(t))return aX(p(Number(t)));if(function(e){if(!e||"object"!=typeof e||!MK)return!1;try{return MK.call(e),!0}catch(HT){}return!1}(t))return aX(p(MK.call(t)));if(function(e){return"[object Boolean]"===tX(e)&&KK(e)}(t))return aX(wK.call(t));if(function(e){return"[object String]"===tX(e)&&KK(e)}(t))return aX(p(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==V&&t===V)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===tX(e)&&KK(e)}(t)&&!JK(t)){var _=cX(t,p),E=FK?FK(t)===Object.prototype:t instanceof Object||t.constructor===Object,S=t instanceof Object?"":"null prototype",k=!E&&PK&&Object(t)===t&&PK in t?EK.call(tX(t),8,-1):S?"Object":"",T=(E||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||S?"["+AK.call(DK.call([],k||[],S||[]),": ")+"] ":"");return 0===_.length?T+"{}":d?T+"{"+sX(_,d)+"}":T+"{ "+AK.call(_,", ")+" }"}return String(t)};function GK(e,t,n){var r=n.quoteStyle||t,o=HK[r];return o+e+o}function YK(e){return SK.call(String(e),/"/g,"&quot;")}function KK(e){return!PK||!("object"==typeof e&&(PK in e||void 0!==e[PK]))}function XK(e){return"[object Array]"===tX(e)&&KK(e)}function JK(e){return"[object RegExp]"===tX(e)&&KK(e)}function ZK(e){if(VK)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!BK)return!1;try{return BK.call(e),!0}catch(HT){}return!1}var QK=Object.prototype.hasOwnProperty||function(e){return e in this};function eX(e,t){return QK.call(e,t)}function tX(e){return xK.call(e)}function nX(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function rX(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return rX(EK.call(e,0,t.maxStringLength),t)+r}var o=qK[t.quoteStyle||"single"];return o.lastIndex=0,GK(SK.call(SK.call(e,o,"\\$1"),/[\x00-\x1f]/g,oX),"single",t)}function oX(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+kK.call(t.toString(16))}function aX(e){return"Object("+e+")"}function iX(e){return e+" { ? }"}function lX(e,t,n,r){return e+" ("+t+") {"+(r?sX(n,r):AK.call(n,", "))+"}"}function sX(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+AK.call(e,","+n)+"\n"+t.prev}function cX(e,t){var n=XK(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=eX(e,o)?t(e[o],e):""}var a,i="function"==typeof OK?OK(e):[];if(VK){a={};for(var l=0;l<i.length;l++)a["$"+i[l]]=i[l]}for(var s in e)eX(e,s)&&(n&&String(Number(s))===s&&s<e.length||VK&&a["$"+s]instanceof Symbol||(NK.call(/[^\w$]/,s)?r.push(t(s,e)+": "+t(e[s],e)):r.push(s+": "+t(e[s],e))));if("function"==typeof OK)for(var c=0;c<i.length;c++)LK.call(e,i[c])&&r.push("["+t(i[c])+"]: "+t(e[i[c]],e));return r}var uX=WK,dX=sK,pX=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r},fX=Object,hX=Error,mX=EvalError,vX=RangeError,gX=ReferenceError,yX=SyntaxError,bX=URIError,wX=Math.abs,xX=Math.floor,CX=Math.max,_X=Math.min,EX=Math.pow,SX=Math.round,kX=Number.isNaN||function(e){return e!=e},TX=kX,NX=Object.getOwnPropertyDescriptor;if(NX)try{NX([],"length")}catch(HT){NX=null}var DX=NX,AX=Object.defineProperty||!1;if(AX)try{AX({},"a",{value:1})}catch(HT){AX=!1}var IX,RX,MX,OX,BX,VX,PX,LX,FX=AX;function zX(){return VX?BX:(VX=1,BX="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function jX(){return LX?PX:(LX=1,PX=fX.getPrototypeOf||null)}var $X,UX,HX,qX,WX=Object.prototype.toString,GX=Math.max,YX=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n},KX=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==WX.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=function(e,t){for(var n=[],r=t,o=0;r<e.length;r+=1,o+=1)n[o]=e[r];return n}(arguments,1),o=GX(0,t.length-r.length),a=[],i=0;i<o;i++)a[i]="$"+i;if(n=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(a,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var o=t.apply(this,YX(r,arguments));return Object(o)===o?o:this}return t.apply(e,YX(r,arguments))})),t.prototype){var l=function(){};l.prototype=t.prototype,n.prototype=new l,l.prototype=null}return n},XX=Function.prototype.bind||KX;function JX(){return UX?$X:(UX=1,$X=Function.prototype.call)}function ZX(){return qX?HX:(qX=1,HX=Function.prototype.apply)}var QX,eJ,tJ,nJ,rJ,oJ,aJ,iJ="undefined"!=typeof Reflect&&Reflect&&Reflect.apply,lJ=XX,sJ=ZX(),cJ=JX(),uJ=iJ||lJ.call(cJ,sJ),dJ=XX,pJ=sK,fJ=JX(),hJ=uJ,mJ=function(e){if(e.length<1||"function"!=typeof e[0])throw new pJ("a function is required");return hJ(dJ,fJ,e)};var vJ=fX,gJ=hX,yJ=mX,bJ=vX,wJ=gX,xJ=yX,CJ=sK,_J=bX,EJ=wX,SJ=xX,kJ=CX,TJ=_X,NJ=EX,DJ=SX,AJ=function(e){return TX(e)||0===e?e:e<0?-1:1},IJ=Function,RJ=function(e){try{return IJ('"use strict"; return ('+e+").constructor;")()}catch(HT){}},MJ=DX,OJ=FX,BJ=function(){throw new CJ},VJ=MJ?function(){try{return BJ}catch(e){try{return MJ(arguments,"callee").get}catch(t){return BJ}}}():BJ,PJ=function(){if(OX)return MX;OX=1;var e="undefined"!=typeof Symbol&&Symbol,t=RX?IX:(RX=1,IX=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0});return MX=function(){return"function"==typeof e&&("function"==typeof Symbol&&("symbol"==typeof e("foo")&&("symbol"==typeof Symbol("bar")&&t())))}}()(),LJ=function(){if(nJ)return tJ;nJ=1;var e=zX(),t=jX(),n=function(){if(eJ)return QX;eJ=1;var e,t=mJ,n=DX;try{e=[].__proto__===Array.prototype}catch(HT){if(!HT||"object"!=typeof HT||!("code"in HT)||"ERR_PROTO_ACCESS"!==HT.code)throw HT}var r=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,a=o.getPrototypeOf;return QX=r&&"function"==typeof r.get?t([r.get]):"function"==typeof a&&function(e){return a(null==e?e:o(e))}}();return tJ=e?function(t){return e(t)}:t?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return t(e)}:n?function(e){return n(e)}:null}(),FJ=jX(),zJ=zX(),jJ=ZX(),$J=JX(),UJ={},HJ="undefined"!=typeof Uint8Array&&LJ?LJ(Uint8Array):aJ,qJ={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?aJ:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?aJ:ArrayBuffer,"%ArrayIteratorPrototype%":PJ&&LJ?LJ([][Symbol.iterator]()):aJ,"%AsyncFromSyncIteratorPrototype%":aJ,"%AsyncFunction%":UJ,"%AsyncGenerator%":UJ,"%AsyncGeneratorFunction%":UJ,"%AsyncIteratorPrototype%":UJ,"%Atomics%":"undefined"==typeof Atomics?aJ:Atomics,"%BigInt%":"undefined"==typeof BigInt?aJ:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?aJ:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?aJ:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?aJ:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gJ,"%eval%":eval,"%EvalError%":yJ,"%Float16Array%":"undefined"==typeof Float16Array?aJ:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?aJ:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?aJ:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?aJ:FinalizationRegistry,"%Function%":IJ,"%GeneratorFunction%":UJ,"%Int8Array%":"undefined"==typeof Int8Array?aJ:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?aJ:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?aJ:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":PJ&&LJ?LJ(LJ([][Symbol.iterator]())):aJ,"%JSON%":"object"==typeof JSON?JSON:aJ,"%Map%":"undefined"==typeof Map?aJ:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&PJ&&LJ?LJ((new Map)[Symbol.iterator]()):aJ,"%Math%":Math,"%Number%":Number,"%Object%":vJ,"%Object.getOwnPropertyDescriptor%":MJ,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?aJ:Promise,"%Proxy%":"undefined"==typeof Proxy?aJ:Proxy,"%RangeError%":bJ,"%ReferenceError%":wJ,"%Reflect%":"undefined"==typeof Reflect?aJ:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?aJ:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&PJ&&LJ?LJ((new Set)[Symbol.iterator]()):aJ,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?aJ:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":PJ&&LJ?LJ(""[Symbol.iterator]()):aJ,"%Symbol%":PJ?Symbol:aJ,"%SyntaxError%":xJ,"%ThrowTypeError%":VJ,"%TypedArray%":HJ,"%TypeError%":CJ,"%Uint8Array%":"undefined"==typeof Uint8Array?aJ:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?aJ:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?aJ:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?aJ:Uint32Array,"%URIError%":_J,"%WeakMap%":"undefined"==typeof WeakMap?aJ:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?aJ:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?aJ:WeakSet,"%Function.prototype.call%":$J,"%Function.prototype.apply%":jJ,"%Object.defineProperty%":OJ,"%Object.getPrototypeOf%":FJ,"%Math.abs%":EJ,"%Math.floor%":SJ,"%Math.max%":kJ,"%Math.min%":TJ,"%Math.pow%":NJ,"%Math.round%":DJ,"%Math.sign%":AJ,"%Reflect.getPrototypeOf%":zJ};if(LJ)try{null.error}catch(HT){var WJ=LJ(LJ(HT));qJ["%Error.prototype%"]=WJ}var GJ=function e(t){var n;if("%AsyncFunction%"===t)n=RJ("async function () {}");else if("%GeneratorFunction%"===t)n=RJ("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=RJ("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&LJ&&(n=LJ(o.prototype))}return qJ[t]=n,n},YJ={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},KJ=XX,XJ=function(){if(oJ)return rJ;oJ=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty;return rJ=XX.call(e,t)}(),JJ=KJ.call($J,Array.prototype.concat),ZJ=KJ.call(jJ,Array.prototype.splice),QJ=KJ.call($J,String.prototype.replace),eZ=KJ.call($J,String.prototype.slice),tZ=KJ.call($J,RegExp.prototype.exec),nZ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rZ=/\\(\\)?/g,oZ=function(e,t){var n,r=e;if(XJ(YJ,r)&&(r="%"+(n=YJ[r])[0]+"%"),XJ(qJ,r)){var o=qJ[r];if(o===UJ&&(o=GJ(r)),void 0===o&&!t)throw new CJ("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new xJ("intrinsic "+e+" does not exist!")},aZ=function(e,t){if("string"!=typeof e||0===e.length)throw new CJ("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new CJ('"allowMissing" argument must be a boolean');if(null===tZ(/^%?[^%]*%?$/,e))throw new xJ("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=eZ(e,0,1),n=eZ(e,-1);if("%"===t&&"%"!==n)throw new xJ("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new xJ("invalid intrinsic syntax, expected opening `%`");var r=[];return QJ(e,nZ,(function(e,t,n,o){r[r.length]=n?QJ(o,rZ,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=oZ("%"+r+"%",t),a=o.name,i=o.value,l=!1,s=o.alias;s&&(r=s[0],ZJ(n,JJ([0,1],s)));for(var c=1,u=!0;c<n.length;c+=1){var d=n[c],p=eZ(d,0,1),f=eZ(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===f||"'"===f||"`"===f)&&p!==f)throw new xJ("property names with quotes must have matching quotes");if("constructor"!==d&&u||(l=!0),XJ(qJ,a="%"+(r+="."+d)+"%"))i=qJ[a];else if(null!=i){if(!(d in i)){if(!t)throw new CJ("base intrinsic for "+e+" exists, but the property is not available.");return}if(MJ&&c+1>=n.length){var h=MJ(i,d);i=(u=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:i[d]}else u=XJ(i,d),i=i[d];u&&!l&&(qJ[a]=i)}}return i},iZ=aZ,lZ=mJ,sZ=lZ([iZ("%String.prototype.indexOf%")]),cZ=function(e,t){var n=iZ(e,!!t);return"function"==typeof n&&sZ(e,".prototype.")>-1?lZ([n]):n},uZ=cZ,dZ=WK,pZ=sK,fZ=aZ("%Map%",!0),hZ=uZ("Map.prototype.get",!0),mZ=uZ("Map.prototype.set",!0),vZ=uZ("Map.prototype.has",!0),gZ=uZ("Map.prototype.delete",!0),yZ=uZ("Map.prototype.size",!0),bZ=!!fZ&&function(){var e,t={assert:function(e){if(!t.has(e))throw new pZ("Side channel does not contain "+dZ(e))},delete:function(t){if(e){var n=gZ(e,t);return 0===yZ(e)&&(e=void 0),n}return!1},get:function(t){if(e)return hZ(e,t)},has:function(t){return!!e&&vZ(e,t)},set:function(t,n){e||(e=new fZ),mZ(e,t,n)}};return t},wZ=cZ,xZ=WK,CZ=bZ,_Z=sK,EZ=aZ("%WeakMap%",!0),SZ=wZ("WeakMap.prototype.get",!0),kZ=wZ("WeakMap.prototype.set",!0),TZ=wZ("WeakMap.prototype.has",!0),NZ=wZ("WeakMap.prototype.delete",!0),DZ=sK,AZ=WK,IZ=(EZ?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new _Z("Side channel does not contain "+xZ(e))},delete:function(n){if(EZ&&n&&("object"==typeof n||"function"==typeof n)){if(e)return NZ(e,n)}else if(CZ&&t)return t.delete(n);return!1},get:function(n){return EZ&&n&&("object"==typeof n||"function"==typeof n)&&e?SZ(e,n):t&&t.get(n)},has:function(n){return EZ&&n&&("object"==typeof n||"function"==typeof n)&&e?TZ(e,n):!!t&&t.has(n)},set:function(n,r){EZ&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new EZ),kZ(e,n,r)):CZ&&(t||(t=CZ()),t.set(n,r))}};return n}:CZ)||bZ||function(){var e,t={assert:function(e){if(!t.has(e))throw new dX("Side channel does not contain "+uX(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return pX(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=pX(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!pX(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=pX(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t},RZ=String.prototype.replace,MZ=/%20/g,OZ="RFC3986",BZ={default:OZ,formatters:{RFC1738:function(e){return RZ.call(e,MZ,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:OZ},VZ=BZ,PZ=Object.prototype.hasOwnProperty,LZ=Array.isArray,FZ=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),zZ=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},jZ={arrayToObject:zZ,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],i=Object.keys(a),l=0;l<i.length;++l){var s=i[l],c=a[s];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:a,prop:s}),n.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(LZ(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(HT){return r}},encode:function(e,t,n,r,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var i="",l=0;l<a.length;++l){var s=a.charCodeAt(l);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||o===VZ.RFC1738&&(40===s||41===s)?i+=a.charAt(l):s<128?i+=FZ[s]:s<2048?i+=FZ[192|s>>6]+FZ[128|63&s]:s<55296||s>=57344?i+=FZ[224|s>>12]+FZ[128|s>>6&63]+FZ[128|63&s]:(l+=1,s=65536+((1023&s)<<10|1023&a.charCodeAt(l)),i+=FZ[240|s>>18]+FZ[128|s>>12&63]+FZ[128|s>>6&63]+FZ[128|63&s])}return i},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(LZ(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(LZ(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!PZ.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var o=t;return LZ(t)&&!LZ(n)&&(o=zZ(t,r)),LZ(t)&&LZ(n)?(n.forEach((function(n,o){if(PZ.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,r):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var a=n[o];return PZ.call(t,o)?t[o]=e(t[o],a,r):t[o]=a,t}),o)}},$Z=function(){var e,t={assert:function(e){if(!t.has(e))throw new DZ("Side channel does not contain "+AZ(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=IZ()),e.set(t,n)}};return t},UZ=jZ,HZ=BZ,qZ=Object.prototype.hasOwnProperty,WZ={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},GZ=Array.isArray,YZ=Array.prototype.push,KZ=function(e,t){YZ.apply(e,GZ(t)?t:[t])},XZ=Date.prototype.toISOString,JZ=HZ.default,ZZ={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:UZ.encode,encodeValuesOnly:!1,format:JZ,formatter:HZ.formatters[JZ],indices:!1,serializeDate:function(e){return XZ.call(e)},skipNulls:!1,strictNullHandling:!1},QZ={},eQ=function e(t,n,r,o,a,i,l,s,c,u,d,p,f,h,m,v,g,y){for(var b,w=t,x=y,C=0,_=!1;void 0!==(x=x.get(QZ))&&!_;){var E=x.get(t);if(C+=1,void 0!==E){if(E===C)throw new RangeError("Cyclic object value");_=!0}void 0===x.get(QZ)&&(C=0)}if("function"==typeof u?w=u(n,w):w instanceof Date?w=f(w):"comma"===r&&GZ(w)&&(w=UZ.maybeMap(w,(function(e){return e instanceof Date?f(e):e}))),null===w){if(i)return c&&!v?c(n,ZZ.encoder,g,"key",h):n;w=""}if("string"==typeof(b=w)||"number"==typeof b||"boolean"==typeof b||"symbol"==typeof b||"bigint"==typeof b||UZ.isBuffer(w))return c?[m(v?n:c(n,ZZ.encoder,g,"key",h))+"="+m(c(w,ZZ.encoder,g,"value",h))]:[m(n)+"="+m(String(w))];var S,k=[];if(void 0===w)return k;if("comma"===r&&GZ(w))v&&c&&(w=UZ.maybeMap(w,c)),S=[{value:w.length>0?w.join(",")||null:void 0}];else if(GZ(u))S=u;else{var T=Object.keys(w);S=d?T.sort(d):T}var N=s?n.replace(/\./g,"%2E"):n,D=o&&GZ(w)&&1===w.length?N+"[]":N;if(a&&GZ(w)&&0===w.length)return D+"[]";for(var A=0;A<S.length;++A){var I=S[A],R="object"==typeof I&&void 0!==I.value?I.value:w[I];if(!l||null!==R){var M=p&&s?I.replace(/\./g,"%2E"):I,O=GZ(w)?"function"==typeof r?r(D,M):D:D+(p?"."+M:"["+M+"]");y.set(t,C);var B=$Z();B.set(QZ,y),KZ(k,e(R,O,r,o,a,i,l,s,"comma"===r&&v&&GZ(w)?null:c,u,d,p,f,h,m,v,g,B))}}return k},tQ=jZ,nQ=Object.prototype.hasOwnProperty,rQ=Array.isArray,oQ={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!0,decoder:tQ.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},aQ=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},iQ=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},lQ=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,i=n.depth>0&&/(\[[^[\]]*])/.exec(o),l=i?o.slice(0,i.index):o,s=[];if(l){if(!n.plainObjects&&nQ.call(Object.prototype,l)&&!n.allowPrototypes)return;s.push(l)}for(var c=0;n.depth>0&&null!==(i=a.exec(o))&&c<n.depth;){if(c+=1,!n.plainObjects&&nQ.call(Object.prototype,i[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(i[1])}return i&&s.push("["+o.slice(i.index)+"]"),function(e,t,n,r){for(var o=r?t:iQ(t,n),a=e.length-1;a>=0;--a){var i,l=e[a];if("[]"===l&&n.parseArrays)i=n.allowEmptyArrays&&""===o?[]:[].concat(o);else{i=n.plainObjects?Object.create(null):{};var s="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=n.decodeDotInKeys?s.replace(/%2E/g,"."):s,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&l!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=o:"__proto__"!==c&&(i[c]=o):i={0:o}}o=i}return o}(s,t,n,r)}},sQ=function(e,t){var n,r=e,o=function(e){if(!e)return ZZ;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||ZZ.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=HZ.default;if(void 0!==e.format){if(!qZ.call(HZ.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r,o=HZ.formatters[n],a=ZZ.filter;if(("function"==typeof e.filter||GZ(e.filter))&&(a=e.filter),r=e.arrayFormat in WZ?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":ZZ.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var i=void 0===e.allowDots?!0===e.encodeDotInKeys||ZZ.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:ZZ.addQueryPrefix,allowDots:i,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:ZZ.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:ZZ.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:void 0===e.delimiter?ZZ.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:ZZ.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:ZZ.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:ZZ.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:ZZ.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:ZZ.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:ZZ.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:ZZ.strictNullHandling}}(t);"function"==typeof o.filter?r=(0,o.filter)("",r):GZ(o.filter)&&(n=o.filter);var a=[];if("object"!=typeof r||null===r)return"";var i=WZ[o.arrayFormat],l="comma"===i&&o.commaRoundTrip;n||(n=Object.keys(r)),o.sort&&n.sort(o.sort);for(var s=$Z(),c=0;c<n.length;++c){var u=n[c];o.skipNulls&&null===r[u]||KZ(a,eQ(r[u],u,i,l,o.allowEmptyArrays,o.strictNullHandling,o.skipNulls,o.encodeDotInKeys,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,s))}var d=a.join(o.delimiter),p=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},cQ=function(e,t){var n=function(e){if(!e)return oQ;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?oQ.charset:e.charset,n=void 0===e.duplicates?oQ.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||oQ.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:oQ.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:oQ.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:oQ.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:oQ.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:oQ.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:oQ.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:oQ.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:oQ.decoder,delimiter:"string"==typeof e.delimiter||tQ.isRegExp(e.delimiter)?e.delimiter:oQ.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:oQ.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:oQ.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:oQ.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:oQ.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:oQ.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,i=o.split(t.delimiter,a),l=-1,s=t.charset;if(t.charsetSentinel)for(n=0;n<i.length;++n)0===i[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===i[n]?s="utf-8":"utf8=%26%2310003%3B"===i[n]&&(s="iso-8859-1"),l=n,n=i.length);for(n=0;n<i.length;++n)if(n!==l){var c,u,d=i[n],p=d.indexOf("]="),f=-1===p?d.indexOf("="):p+1;-1===f?(c=t.decoder(d,oQ.decoder,s,"key"),u=t.strictNullHandling?null:""):(c=t.decoder(d.slice(0,f),oQ.decoder,s,"key"),u=tQ.maybeMap(iQ(d.slice(f+1),t),(function(e){return t.decoder(e,oQ.decoder,s,"value")}))),u&&t.interpretNumericEntities&&"iso-8859-1"===s&&(u=aQ(u)),d.indexOf("[]=")>-1&&(u=rQ(u)?[u]:u);var h=nQ.call(r,c);h&&"combine"===t.duplicates?r[c]=tQ.combine(r[c],u):h&&"last"!==t.duplicates||(r[c]=u)}return r}(e,n):e,o=n.plainObjects?Object.create(null):{},a=Object.keys(r),i=0;i<a.length;++i){var l=a[i],s=lQ(l,r[l],n,"string"==typeof e);o=tQ.merge(o,s,n)}return!0===n.allowSparse?o:tQ.compact(o)};const uQ=P({formats:BZ,parse:cQ,stringify:sQ});const dQ=[async function(e){let t={...e};if("application/x-www-form-urlencoded"===e.headers["Content-Type"]&&(t.data=uQ.stringify(t.data)),"multipart/form-data"===e.headers["Content-Type"]){const[e,...n]=Object.keys(t.data),r=t.data[e],o=await async function(e,t){const n=new FormData;return U.isArray(e)?await Promise.all(e.map((e=>(n.append(t,e),!0)))):await n.append(t,e),n}(r,e);null==n||n.forEach((e=>{o.append(e,"object"==typeof t.data[e]?JSON.stringify(t.data[e]):t.data[e])})),t.data=o}return t},function(e){throw e}];
56
56
  /*!
57
57
  * browser-tool v1.2.2
58
58
  * Useragent analysis tool.
@@ -64,9 +64,9 @@ function(){var t=e,n=t.lib,r=n.WordArray,o=n.Hasher,a=t.algo,i=r.create([0,1,2,3
64
64
  * https://github.com/mumuy/browser
65
65
  *
66
66
  * Created on: 2024-01-16
67
- */function pQ(e){return(pQ="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)}var fQ={name:"Safari",match:function(e){return e.indexOf("Safari")>-1},version:function(e){var t;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},hQ={name:"Chrome",match:function(e){return e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1},version:function(e){var t,n;return(null===(t=e.match(/Chrome\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/CriOS\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},mQ={name:"Edge",match:function(e){return e.indexOf("Edge")>-1||e.indexOf("Edg/")>-1||e.indexOf("EdgA")>-1||e.indexOf("EdgiOS")>-1},version:function(e){var t,n,r,o;return(null===(t=e.match(/Edge\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/Edg\/([\d.]+)/))||void 0===n?void 0:n[1])||(null===(r=e.match(/EdgA\/([\d.]+)/))||void 0===r?void 0:r[1])||(null===(o=e.match(/EdgiOS\/([\d.]+)/))||void 0===o?void 0:o[1])||""}},vQ={name:"IE",match:function(e){return e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1},version:function(e){var t,n;return(null===(t=e.match(/MSIE ([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/rv:([\d.]+)/))||void 0===n?void 0:n[1])||""}},gQ={name:"Firefox",match:function(e){return e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1},version:function(e){var t,n;return(null===(t=e.match(/Firefox\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/FxiOS\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},yQ={name:"Firefox Focus",match:function(e){return e.indexOf("Focus")>-1},version:function(e){var t;return(null===(t=e.match(/Focus\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},bQ={name:"Chromium",match:function(e){return e.indexOf("Chromium")>-1},version:function(e){var t;return(null===(t=e.match(/Chromium\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},wQ={name:"Opera",match:function(e){return e.indexOf("Opera")>-1||e.indexOf("OPR")>-1},version:function(e){var t,n;return(null===(t=e.match(/Opera\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/OPR\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},xQ={name:"Vivaldi",match:function(e){return e.indexOf("Vivaldi")>-1},version:function(e){var t;return(null===(t=e.match(/Vivaldi\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},CQ={name:"Yandex",match:function(e){return e.indexOf("YaBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/YaBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},_Q={};"undefined"!=typeof globalThis?_Q=globalThis:"undefined"!=typeof self?_Q=self:"undefined"!=typeof window?_Q=window:"undefined"!=typeof global&&(_Q=global);var EQ=_Q,SQ={name:"Brave",match:function(e){var t;return!(null==EQ||null===(t=EQ.navigator)||void 0===t||!t.brave)},version:function(e){var t;return(null===(t=e.match(/Chrome\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},kQ={name:"Arora",match:function(e){return e.indexOf("Arora")>-1},version:function(e){var t;return(null===(t=e.match(/Arora\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},TQ={name:"Lunascape",match:function(e){return e.indexOf("Lunascape")>-1},version:function(e){var t;return(null===(t=e.match(/Lunascape[\/\s]([\d.]+)/))||void 0===t?void 0:t[1])||""}},NQ={name:"QupZilla",match:function(e){return e.indexOf("QupZilla")>-1},version:function(e){var t;return(null===(t=e.match(/QupZilla[\/\s]([\d.]+)/))||void 0===t?void 0:t[1])||""}},DQ={name:"Coc Coc",match:function(e){return e.indexOf("coc_coc_browser")>-1},version:function(e){var t;return(null===(t=e.match(/coc_coc_browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},AQ={name:"Kindle",match:function(e){return e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1},version:function(e){var t;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},IQ={name:"Iceweasel",match:function(e){return e.indexOf("Iceweasel")>-1},version:function(e){var t;return(null===(t=e.match(/Iceweasel\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},RQ={name:"Konqueror",match:function(e){return e.indexOf("Konqueror")>-1},version:function(e){var t;return(null===(t=e.match(/Konqueror\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},MQ={name:"Iceape",match:function(e){return e.indexOf("Iceape")>-1},version:function(e){var t;return(null===(t=e.match(/Iceape\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},OQ={name:"SeaMonkey",match:function(e){return e.indexOf("SeaMonkey")>-1},version:function(e){var t;return(null===(t=e.match(/SeaMonkey\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},BQ={name:"Epiphany",match:function(e){return e.indexOf("Epiphany")>-1},version:function(e){var t;return(null===(t=e.match(/Epiphany\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},VQ={name:"Huawei",match:function(e){return e.indexOf("HuaweiBrowser")>-1||e.indexOf("HUAWEI")>-1||e.indexOf("HONOR")>-1||e.indexOf("HBPC/")>-1},version:function(e){var t,n,r;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/HuaweiBrowser\/([\d.]+)/))||void 0===n?void 0:n[1])||(null===(r=e.match(/HBPC\/([\d.]+)/))||void 0===r?void 0:r[1])||""}},PQ={name:"OPPO",match:function(e){return e.indexOf("HeyTapBrowser")>-1||e.indexOf("OPPO")>-1},version:function(e){var t;return(null===(t=e.match(/HeyTapBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},LQ={name:"Vivo",match:function(e){return e.indexOf("VivoBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/VivoBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},FQ={name:"Xiaomi",match:function(e){return e.indexOf("MiuiBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/MiuiBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},zQ={name:"Meizu",match:function(e){return e.indexOf("MZBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/MZBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},jQ={name:"Samsung",match:function(e){return e.indexOf("SamsungBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/SamsungBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}};function $Q(e,t){var n,r=null==EQ||null===(n=EQ.navigator)||void 0===n?void 0:n.mimeTypes;for(var o in r)if(r[o][e]&&r[o][e]==t)return r[o];return null}var UQ={name:"360",match:function(e){var t=!1;if(null!=EQ&&EQ.chrome){var n=e.replace(/^.*Chrome\/([\d]+).*$/,"$1");$Q("type","application/360softmgrplugin")||$Q("type","application/mozilla-npqihooquicklogin")||n>36&&null!=EQ&&EQ.showModalDialog?t=!0:n>45&&!(t=$Q("type","application/vnd.chromium.remoting-viewer"))&&n>=69&&(t=$Q("type","application/hwepass2001.installepass2001")||$Q("type","application/asx"))}return e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1||t},version:function(e){var t;return(null===(t=e.match(/QihooBrowser(HD)?\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},HQ={name:"360SE",match:function(e){var t,n=!1;return UQ.match(e)&&($Q("type","application/gameplugin")||null!=EQ&&null!==(t=EQ.navigator)&&void 0!==t&&null!==(t=t.userAgentData)&&void 0!==t&&t.brands.filter((function(e){return"Not.A/Brand"==e.brand})).length)&&(n=!0),e.indexOf("360SE")>-1||n},version:function(e){return{114:"15.0",108:"14.0",86:"13.0",78:"12.0",69:"11.0",63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[parseInt(hQ.version(e))]||""}},qQ={name:"360EE",match:function(e){var t=!1;if($Q("type","application/cenroll.cenroll.version.1")||$Q("type","application/hwepass2001.installepass2001"))t=!0;else if(UQ.match(e)){var n;null!=EQ&&null!==(n=EQ.navigator)&&void 0!==n&&null!==(n=n.userAgentData)&&void 0!==n&&n.brands.filter((function(e){return"Not A(Brand"==e.brand})).length&&(t=!0)}return e.indexOf("360EE")>-1||t},version:function(e){return{119:"(X)22.0",108:"14.0",95:"(X)21.0",86:"13.0",78:"12.0",69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[parseInt(hQ.version(e))]||""}},WQ={name:"UC",match:function(e){return e.indexOf("UCBrowser")>-1||e.indexOf(" UBrowser")>-1||e.indexOf("UCWEB")>-1},version:function(e){var t;return(null===(t=e.match(/UC?Browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},GQ={name:"QQBrowser",match:function(e){return e.indexOf("QQBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/QQBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},YQ={name:"QQ",match:function(e){return e.indexOf("QQ/")>-1},version:function(e){var t;return(null===(t=e.match(/QQ\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},KQ={name:"Baidu",match:function(e){return e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1||e.indexOf("baidubrowser")>-1||e.indexOf("baiduboxapp")>-1||e.indexOf("BaiduD")>-1},version:function(e){var t,n;return(null===(t=e.match(/BIDUBrowser[\s\/]([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/baiduboxapp\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},XQ={name:"Maxthon",match:function(e){return e.indexOf("Maxthon")>-1||(null==EQ?void 0:EQ.maxthon)},version:function(e){var t;return{109:"7.0",78:"6.0"}[parseInt(hQ.version(e))]||(null===(t=e.match(/Maxthon\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},JQ={name:"Sogou",match:function(e){return e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1},version:function(e){var t,n;return{94:"12.0",80:"11.0"}[(null===(t=e.match(/Chrome\/([\d]+)/))||void 0===t?void 0:t[1])||""]||(null===(n=e.match(/SogouMobileBrowser\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},ZQ={name:"Liebao",match:function(e){return e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1||(null==EQ?void 0:EQ.liebao)},version:function(e){var t="";e.indexOf("LieBaoFast")>-1&&(t=e.replace(/LieBaoFast\/([\d.]+)/,"$1"));var n=parseInt(hQ.version(e));return t||{79:"8.0",57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""}},QQ={name:"2345Explorer",match:function(e){var t,n,r=(null==EQ?void 0:EQ.chrome)&&((null==EQ||null===(t=EQ.chrome)||void 0===t?void 0:t.adblock2345)||(null==EQ||null===(n=EQ.chrome)||void 0===n?void 0:n.common2345));return e.indexOf("2345Explorer")>-1||e.indexOf("Mb2345Browser")>-1||e.indexOf("2345chrome")>-1||r},version:function(e){var t,n;return{69:"10.0",55:"9.9"}[parseInt(hQ.version(e))]||(null===(t=e.match(/2345Explorer\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/Mb2345Browser\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},e0={name:"115Browser",match:function(e){return e.indexOf("115Browser")>-1},version:function(e){var t;return(null===(t=e.match(/115Browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},t0={name:"TheWorld",match:function(e){return e.indexOf("TheWorld")>-1},version:function(e){var t;return(null===(t=e.match(/TheWorld ([\d.]+)/))||void 0===t?void 0:t[1])||""}},n0={name:"Quark",match:function(e){return e.indexOf("Quark")>-1},version:function(e){var t;return(null===(t=e.match(/Quark\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},r0={name:"Qiyu",match:function(e){return e.indexOf("Qiyu")>-1},version:function(e){var t;return(null===(t=e.match(/Qiyu\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},o0={name:"Wechat",match:function(e){return e.indexOf("MicroMessenger")>-1},version:function(e){var t;return(null===(t=e.match(/MicroMessenger\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},a0={name:"WechatWork",match:function(e){return e.indexOf("wxwork/")>-1},version:function(e){var t;return(null===(t=e.match(/wxwork\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},i0={name:"Taobao",match:function(e){return e.indexOf("AliApp(TB")>-1},version:function(e){var t;return(null===(t=e.match(/AliApp\(TB\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},l0={name:"Alipay",match:function(e){return e.indexOf("AliApp(AP")>-1},version:function(e){var t;return(null===(t=e.match(/AliApp\(AP\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},s0={name:"Weibo",match:function(e){return e.indexOf("Weibo")>-1},version:function(e){var t;return(null===(t=e.match(/weibo__([\d.]+)/))||void 0===t?void 0:t[1])||""}},c0={name:"Douban",match:function(e){return e.indexOf("com.douban.frodo")>-1},version:function(e){var t;return(null===(t=e.match(/com.douban.frodo\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},u0={name:"Suning",match:function(e){return e.indexOf("SNEBUY-APP")>-1},version:function(e){var t;return(null===(t=e.match(/SNEBUY-APP([\d.]+)/))||void 0===t?void 0:t[1])||""}},d0={name:"iQIYI",match:function(e){return e.indexOf("IqiyiApp")>-1},version:function(e){var t;return(null===(t=e.match(/IqiyiVersion\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},p0={name:"DingTalk",match:function(e){return e.indexOf("DingTalk")>-1},version:function(e){var t;return(null===(t=e.match(/DingTalk\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},f0={name:"Douyin",match:function(e){return e.indexOf("aweme")>-1},version:function(e){var t;return(null===(t=e.match(/app_version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},h0={name:"Googlebot",match:function(e){return e.indexOf("Googlebot")>-1},version:function(e){var t;return(null===(t=e.match(/Googlebot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},m0={name:"Baiduspider",match:function(e){return e.indexOf("Baiduspider")>-1},version:function(e){var t;return(null===(t=e.match(/Baiduspider(-render)?\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},v0={name:"Sogouspider",match:function(e){return e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1},version:function(e){var t;return(null===(t=e.match(/Sogou (\S+) Spider\/([\d.]+)/i))||void 0===t?void 0:t[1])||""}},g0={name:"Bingbot",match:function(e){return e.indexOf("bingbot")>-1},version:function(e){var t;return(null===(t=e.match(/bingbot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},y0={name:"360Spider",match:function(e){return e.indexOf("360Spider")>-1||e.indexOf("HaosouSpider")>-1},version:function(e){return""}},b0={name:"Bytespider",match:function(e){return e.indexOf("Bytespider")>-1},version:function(e){return""}},w0={name:"YisouSpider",match:function(e){return e.indexOf("YisouSpider")>-1},version:function(e){var t;return(null===(t=e.match(/YisouSpider\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},x0={name:"YodaoBot",match:function(e){return e.indexOf("YodaoBot")>-1},version:function(e){var t;return(null===(t=e.match(/YodaoBot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},C0={name:"YandexBot",match:function(e){return e.indexOf("YandexBot")>-1},version:function(e){var t;return(null===(t=e.match(/YandexBot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}};function _0(e,t){var n,r=e.userAgent;e.browser="",e.browserVersion="",[fQ,hQ,mQ,vQ,gQ,yQ,bQ,wQ,xQ,CQ,SQ,kQ,TQ,NQ,DQ,AQ,IQ,RQ,MQ,OQ,BQ,VQ,PQ,LQ,FQ,zQ,jQ,UQ,qQ,HQ,WQ,GQ,YQ,KQ,XQ,JQ,ZQ,QQ,e0,t0,n0,r0,o0,a0,i0,l0,s0,c0,u0,d0,p0,f0,h0,m0,v0,g0,y0,b0,w0,x0,C0].forEach((function(n){n.match(r)&&(e.browser=n.name,e.browserVersion=n.version(r,t))})),"Chrome"==e.browser&&r.match(/\S+Browser/)&&(e.browser=r.match(/\S+Browser/)[0],e.browserVersion=(null===(n=r.replace(/^.*Browser\/([\d.]+).*$/))||void 0===n?void 0:n[1])||"")}var E0={name:"Mobile",match:function(e){return e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1}},S0={name:"Tablet",match:function(e){var t=(null==EQ?void 0:EQ.navigator)||{};return e.indexOf("Tablet")>-1||e.indexOf("Pad")>-1||e.indexOf("Nexus 7")>-1||"MacIntel"===t.platform&&t.maxTouchPoints>1}};function k0(e){e.device="Desktop",[E0,S0].forEach((function(t){t.match(e.userAgent)&&(e.device=t.name)}))}var T0={name:"WebKit",match:function(e){return e.indexOf("AppleWebKit")>-1}},N0={name:"Trident",match:function(e){return e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1}},D0={name:"Gecko",match:function(e){return e.indexOf("Gecko/")>-1}},A0={name:"Presto",match:function(e){return e.indexOf("Presto")>-1}},I0={name:"KHTML",match:function(e){return e.indexOf("KHTML/")>-1}};function R0(e){e.engine="",[T0,N0,D0,A0,I0].forEach((function(t){t.match(e.userAgent)&&(e.engine=t.name)})),"Edge"==e.browser?e.engine=parseInt(e.browserVersion)>75?"Blink":"EdgeHTML":(hQ.match(e.userAgent)&&"WebKit"==e.engine&&parseInt(hQ.version(e.userAgent))>27||"Opera"==e.browser&&parseInt(e.browserVersion)>12||"Yandex"==e.browser)&&(e.engine="Blink")}var M0={name:"Windows",match:function(e){return e.indexOf("Windows")>-1},version:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(null===(t=e.match(/^Mozilla\/\d.0 \(Windows NT ([\d.]+)[;)].*$/))||void 0===t?void 0:t[1])||"",o={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return n?new Promise((function(e){var t;null!=EQ&&null!==(t=EQ.navigator)&&void 0!==t&&t.userAgentData?EQ.navigator.userAgentData.getHighEntropyValues(["platformVersion"]).then((function(t){var n="";"Windows"===navigator.userAgentData.platform&&(n=parseInt(t.platformVersion.split(".")[0])>=13?"11":"10"),e(n)})):e(o[r]||r)})):o[r]||r}},O0={name:"Linux",match:function(e){return e.indexOf("Linux")>-1||e.indexOf("X11")>-1},version:function(e){return""}},B0={name:"macOS",match:function(e){return e.indexOf("Macintosh")>-1},version:function(e){var t;return(null===(t=e.match(/Mac OS X -?([\d_]+)/))||void 0===t?void 0:t[1].replace(/_/g,"."))||""}},V0={name:"Android",match:function(e){return e.indexOf("Android")>-1||e.indexOf("Adr")>-1},version:function(e){var t;return(null===(t=e.match(/Android ([\d.]+);/))||void 0===t?void 0:t[1])||""}},P0={name:"HarmonyOS",match:function(e){return e.indexOf("HarmonyOS")>-1},version:function(e){var t,n=+(null===(t=e.match(/HMSCore (\d+.\d+)/))||void 0===t?void 0:t[1])||0;return n>=6.1?"4.0":n>=6?"3.0":n>=5?"2.0":n>=4?"1.0":""}},L0={name:"Ubuntu",match:function(e){return e.indexOf("Ubuntu")>-1},version:function(e){return""}},F0={name:"FreeBSD",match:function(e){return e.indexOf("FreeBSD")>-1},version:function(e){return""}},z0={name:"Debian",match:function(e){return e.indexOf("Debian")>-1},version:function(e){var t;return(null===(t=e.match(/Debian\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},j0={name:"iOS",match:function(e){return e.indexOf("like Mac OS X")>-1},version:function(e){var t;return(null===(t=e.match(/OS ([\d_]+) like/))||void 0===t?void 0:t[1].replace(/_/g,"."))||""}},$0={name:"Windows Phone",match:function(e){return e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1},version:function(e){var t;return(null===(t=e.match(/Windows Phone( OS)? ([\d.]+);/))||void 0===t?void 0:t[2])||""}},U0={name:"BlackBerry",match:function(e){return e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1},version:function(e){return""}},H0={name:"MeeGo",match:function(e){return e.indexOf("MeeGo")>-1},version:function(e){return""}},q0={name:"Symbian",match:function(e){return e.indexOf("Symbian")>-1},version:function(e){return""}},W0={name:"Chrome OS",match:function(e){return e.indexOf("CrOS")>-1},version:function(e){var t,n;return(null===(t=e.match(/MSIE ([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/rv:([\d.]+)/))||void 0===n?void 0:n[1])||""}},G0={name:"WebOS",match:function(e){return e.indexOf("hpwOS")>-1},version:function(e){var t;return(null===(t=e.match(/hpwOS\/([\d.]+);/))||void 0===t?void 0:t[1])||""}};function Y0(e,t){var n,r=e.userAgent;e.system="",e.systemVersion="",[M0,O0,B0,V0,P0,L0,F0,z0,j0,$0,U0,H0,q0,W0,G0].forEach((function(n){n.match(r)&&(e.system=n.name,e.systemVersion=n.version(r,t))})),e.platform="",r.match(/(Win64|x64|WOW64|x86_64)/i)?e.platform="Win64":r.match(/(Win32|x86|WOW32)/i)?e.platform="Win32":r.match(/aarch64|arm64/)?e.platform="ARM64":r.match(/arm32/)?e.platform="ARM32":null!=EQ&&null!==(n=EQ.navigator)&&void 0!==n&&n.platform&&(e.platform=EQ.navigator.platform),e.architecture="";var o,a=r+"|"+e.platform;a.match(/armv\d+/i)||a.match(/aarch64/)?e.architecture="arm":a.match(/loongarch64/)?e.architecture="loongarch":e.architecture="x86",e.bitness=r.match(/Win64|x64|WOW64|x86_64|aarch64|arm64|loongarch64/i)?64:32,t&&null!=EQ&&null!==(o=EQ.navigator)&&void 0!==o&&o.userAgentData&&(e.architecture=navigator.userAgentData.getHighEntropyValues(["architecture"]).then((function(e){return e.architecture})),e.bitness=navigator.userAgentData.getHighEntropyValues(["bitness"]).then((function(e){return+e.bitness})))}function K0(e){if(e.gpu="",e.gpuModel="",null!=EQ&&EQ.document){var t,n,r=EQ.document.createElement("canvas").getContext("experimental-webgl"),o=r.getExtension("WEBGL_debug_renderer_info"),a=r.getParameter(o.UNMASKED_RENDERER_WEBGL);e.gpu=(null===(t=a.match(/ANGLE \((.+?),/))||void 0===t?void 0:t[1])||"",e.gpuModel=(null===(n=a.match(/, (.+?) (\(|vs_)/))||void 0===n?void 0:n[1])||""}}function X0(e){e.language=function(e,t){var n=(null==EQ||null===(e=EQ.navigator)||void 0===e?void 0:e.browserLanguage)||(null==EQ||null===(t=EQ.navigator)||void 0===t?void 0:t.language);if("string"!=typeof n)return"Unknown language";var r=n.split("-");return r[1]&&(r[1]=r[1].toUpperCase()),r.join("_")}()}function J0(e){var t,n,r;e.network=(n="unknown",(r=null==EQ||null===(t=EQ.navigator)||void 0===t?void 0:t.connection)&&("2"!=(n=r.type||r.effectiveType)&&"unknown"!=n||(n="wifi")),n)}function Z0(e){e.isWebview=e.userAgent.indexOf("; wv)")>-1,e.isRobot=["Googlebot","Baiduspider","Sogouspider","Bingbot","360Spider","Bytespider","YandexBot"].includes(e.browser)}var Q0=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={};return r.userAgent=e||(null==EQ||null===(t=EQ.navigator)||void 0===t?void 0:t.userAgent)||"",[_0,k0,R0,Y0,K0,X0,J0,Z0].forEach((function(e){return e(r,n)})),r};function e1(e){var t=Q0(e);for(var n in t)"object"==pQ(t[n])&&(t[n]="");return t}e1.getInfo=function(e){var t=Q0(e,!0),n=Object.keys(t),r=Object.values(t).map((function(e){return"object"==pQ(e)?e:Promise.resolve(e)}));return Promise.all(r).then((function(e){var t={};return e.forEach((function(e,r){t[n[r]]=e})),t}))};const t1=function(){const e=e1();return{ip:"",ipv6:"",loc_ip:"",mac:"",browser:e.browser,device:e.device,os:e.system+" "+e.systemVersion,version:e.browserVersion}}(),n1=e=>{if(e&&"[object Object]"===Object.prototype.toString.call(e)){const t=Object.assign({},e);for(let e in t)"undefined"===t[e]||"null"===t[e]||null===t[e]||void 0===t[e]?delete t[e]:"string"==typeof t[e]&&(t[e]=t[e].trim());return t}return e},r1=[[function(e){var t,n;return e&&e.params&&(e.params=n1(e.params),U.get(e,"params.menu_id")||U.set(e,"params.menu_id",null==(t=hge())?void 0:t.mid)),e&&e.data&&(e.data=n1(e.data),U.get(e,"data.menu_id")||U.set(e,"data.menu_id",null==(n=hge())?void 0:n.mid)),e},function(e){throw e}],dQ,[async e=>{var t,n,r,o;const a=await kge.getToken();return a&&!(null==(t=null==e?void 0:e.headers)?void 0:t.Authorization)&&U.set(e,"headers.Authorization",`Bearer ${a}`),"get"!==e.method&&U.set(e,"data.other_log_info",{page_name:null==(n=yge.value)?void 0:n.value.meta.title,action_name:null==(o=null==(r=null==e?void 0:e.data)?void 0:r.other_log_info)?void 0:o.title,...t1}),e},e=>{throw e}]];let o1=!1;const a1=[[async function(e){const{data:t}=e;if(t instanceof Blob)return t;if("object"==typeof t&&!Reflect.has(t,"code"))return t;switch(t.code){case 1:return t;case 401:case 4001:zj.error("你已被登出,请重新登录"),o1||(o1=!0,await kge.remove("userInfo"),window.location.href="/",setTimeout((()=>{o1=!1}),1e3));break;case 2e3:o1||(o1=!0,gge.value?Kj.alert(t.msg,"提示",{confirmButtonText:"确定",callback:async()=>{o1=!1,await kge.remove("userInfo"),window.location.href="/"}}):(zj.error(t.msg),await kge.remove("userInfo"),window.location.href="/"));break;default:return t.msg&&!o1&&(o1=!0,zj.error(t.msg),setTimeout((()=>{o1=!1}),1e3)),Promise.reject(t)}},function(e){return-1!=e.message.indexOf("timeout")?zj.error("网络超时"):"Network Error"==e.message?zj.error("网络连接错误"):"操作太频繁,请稍后再试"==e.message?zj.warning("操作太频繁,请稍后再试"):e.response.data?zj.error(e.response.statusText):zj.error("接口路径找不到"),Promise.reject(e)}]],i1=qY.CancelToken,l1=[],s1=e=>{for(const t in l1){const n=+t,r=l1[t];r.url===e.url&&r.method===e.method&&JSON.stringify(r.params)===JSON.stringify(e.params)&&JSON.stringify(r.data)===JSON.stringify(e.data)&&(r.cancel("操作太频繁,请稍后再试"),l1.splice(n,1))}};const c1=qY.create({baseURL:void 0,timeout:6e4,paramsSerializer:{serialize:e=>uQ.stringify(e,{allowDots:!0})}});var u1;(u1=c1).interceptors.request.use((e=>(s1(e),e.cancelToken=new i1((t=>{l1.push({url:e.url,method:e.method,params:e.params,data:e.data,cancel:t})})),e)),(e=>Promise.reject(e))),u1.interceptors.response.use((e=>(s1(e.config),Promise.resolve(e))),(e=>Promise.reject(e))),r1.forEach((e=>{c1.interceptors.request.use(...e)})),a1.forEach((e=>{c1.interceptors.response.use(...e)}));const d1=c1.interceptors,p1=c1.request,f1=(e,t={},n="get",r={})=>kge.get("userInfo").then((o=>{const a={url:`/${o.project_code}-web${e}`,method:n,...r},{title:i="",...l}=t;return"get"==n?a.params=Object.assign({other_log_info:{title:i}},l):a.data=Object.assign({other_log_info:{title:i}},l),c1.request(a)}));function h1(){return h1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h1.apply(null,arguments)}var m1={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function v1(e,t){if(y1(e,t))return e[t];if("function"==typeof e[t]&&b1(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function g1(e,t,n){if(y1(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function y1(e,t){return!(!function(e){return"object"==typeof e&&e&&e.constructor===Object}(e)&&!Array.isArray(e))&&(!!b2(w1,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function b1(e,t){return null!=e&&"function"==typeof e[t]&&(!(b2(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!b2(x1,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}var w1={length:!0,name:!0},x1={toString:!0,valueOf:!0,toLocaleString:!0};class C1{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 v1(this.wrappedObject,e)}set(e,t){return g1(this.wrappedObject,e,t),this}has(e){return y1(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return E1(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){y1(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 _1{constructor(e,t,n){this.a=e,this.b=t,this.bKeys=n,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 E1(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 E1(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function S1(){return new Map}function k1(e){if(!e)return S1();if(Y1(e))return e;if(G1(e))return new C1(e);throw new Error("createMap can create maps from objects or Maps")}function T1(e){return"number"==typeof e}function N1(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 D1(e){return"bigint"==typeof e}function A1(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function I1(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function R1(e){return e&&!0===e.constructor.prototype.isUnit||!1}function M1(e){return"string"==typeof e}var O1=Array.isArray;function B1(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function V1(e){return Array.isArray(e)||B1(e)}function P1(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function L1(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function F1(e){return e&&!0===e.constructor.prototype.isRange||!1}function z1(e){return e&&!0===e.constructor.prototype.isIndex||!1}function j1(e){return"boolean"==typeof e}function $1(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function U1(e){return e&&!0===e.constructor.prototype.isHelp||!1}function H1(e){return"function"==typeof e}function q1(e){return e instanceof Date}function W1(e){return e instanceof RegExp}function G1(e){return!(!e||"object"!=typeof e||e.constructor!==Object||A1(e)||I1(e))}function Y1(e){return!!e&&(e instanceof Map||e instanceof C1||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function K1(e){return null===e}function X1(e){return void 0===e}function J1(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function Z1(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function Q1(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function e2(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function t2(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function n2(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function r2(e){return n2(e)||c2(e)&&1===e.args.length&&n2(e.args[0])&&"-+~".includes(e.op)}function o2(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function a2(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function i2(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function l2(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function s2(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function c2(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function u2(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function d2(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function p2(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function f2(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function h2(e){return e&&!0===e.constructor.prototype.isChain||!1}function m2(e){var t=typeof e;return"object"===t?null===e?"null":N1(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function v2(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 v2(e)}));if(e instanceof Date)return new Date(e.valueOf());if(N1(e))return e;if(G1(e))return function(e,t){var n={};for(var r in e)b2(e,r)&&(n[r]=t(e[r]));return n}(e,v2);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function g2(e,t){for(var n in t)b2(t,n)&&(e[n]=t[n]);return e}function y2(e,t){var n,r,o;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,o=e.length;r<o;r++)if(!y2(e[r],t[r]))return!1;return!0}if("function"==typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!y2(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}return e===t}function b2(e,t){return e&&Object.hasOwnProperty.call(e,t)}var w2=function(e){if(e)throw new 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(m1)};function x2(){return!0}function C2(){return!1}function _2(){}h1(w2,m1,{MATRIX_OPTIONS:["Matrix","Array"],NUMBER_OPTIONS:["number","BigNumber","Fraction"]});const E2="Argument is not a typed-function.";const S2=function e(){function t(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const n=[{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:t},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],r={name:"any",test:x2,isAny:!0};let o,a,i=0,l={createCount:0};function s(e){const t=o.get(e);if(t)return t;let n='Unknown type "'+e+'"';const r=e.toLowerCase();let i;for(i of a)if(i.toLowerCase()===r){n+='. Did you mean "'+i+'" ?';break}throw new TypeError(n)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const n=t?s(t).index:a.length,r=[];for(let a=0;a<e.length;++a){if(!e[a]||"string"!=typeof e[a].name||"function"!=typeof e[a].test)throw new TypeError("Object with properties {name: string, test: function} expected");const t=e[a].name;if(o.has(t))throw new TypeError('Duplicate type name "'+t+'"');r.push(t),o.set(t,{name:t,test:e[a].test,isAny:e[a].isAny,index:n+a,conversionsTo:[]})}const i=a.slice(n);a=a.slice(0,n).concat(r).concat(i);for(let l=n+r.length;l<a.length;++l)o.get(a[l]).index=l}function u(){o=new Map,a=[],i=0,c([r],!1)}function d(e){const t=a.filter((t=>{const n=o.get(t);return!n.isAny&&n.test(e)}));return t.length?t:["any"]}function p(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function f(e,t,n){if(!p(e))throw new TypeError(E2);const r=n&&n.exact,o=y(Array.isArray(t)?t.join(","):t),a=h(o);if(!r||a in e.signatures){const t=e._typedFunctionData.signatureMap.get(a);if(t)return t}const i=o.length;let l,s;if(r){let t;for(t in l=[],e.signatures)l.push(e._typedFunctionData.signatureMap.get(t))}else l=e._typedFunctionData.signatures;for(let c=0;c<i;++c){const e=o[c],t=[];let n;for(n of l){const r=C(n.params,c);if(r&&(!e.restParam||r.restParam)){if(!r.hasAny){const t=g(r);if(e.types.some((e=>!t.has(e.name))))continue}t.push(n)}}if(l=t,0===l.length)break}for(s of l)if(s.params.length<=i)return s;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+h(o,", ")+"))")}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function m(e){const t=0===e.indexOf("..."),n=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>s(e.trim())));let r=!1,o=t?"...":"";return{types:n.map((function(e){return r=e.isAny||r,o+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:o.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function v(e){const t=e.types.map((e=>e.name)),n=function(e){if(0===e.length)return[];const t=e.map(s);e.length>1&&t.sort(((e,t)=>e.index-t.index));let n=t[0].conversionsTo;if(1===e.length)return n;n=n.concat([]);const r=new Set(e);for(let o=1;o<t.length;++o){let e;for(e of t[o].conversionsTo)r.has(e.from)||(n.push(e),r.add(e.from))}return n}(t);let r=e.hasAny,o=e.name;const a=n.map((function(e){const t=s(e.from);return r=t.isAny||r,o+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}}));return{types:e.types.concat(a),name:o,hasAny:r,hasConversion:a.length>0,restParam:e.restParam}}function g(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function y(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const n=e.trim();if(""===n)return t;const r=n.split(",");for(let o=0;o<r.length;++o){const e=m(r[o].trim());if(e.restParam&&o!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+r[o]+'": only allowed for the last parameter');if(0===e.types.length)return null;t.push(e)}return t}function b(e){const t=z(e);return!!t&&t.restParam}function w(e){if(e&&0!==e.types.length){if(1===e.types.length)return s(e.types[0].name).test;if(2===e.types.length){const t=s(e.types[0].name).test,n=s(e.types[1].name).test;return function(e){return t(e)||n(e)}}{const t=e.types.map((function(e){return s(e.name).test}));return function(e){for(let n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}}return x2}function x(e){let t,n,r;if(b(e)){t=F(e).map(w);const n=t.length,r=w(z(e)),o=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return o(e)&&e.length>=n+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=w(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=w(e[0]),r=w(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(w),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}function C(e,t){return t<e.length?e[t]:b(e)?z(e):null}function _(e,t){const n=C(e,t);return n?g(n):new Set}function E(e){return null===e.conversion||void 0===e.conversion}function S(e,t){const n=new Set;return e.forEach((e=>{const r=_(e.params,t);let o;for(o of r)n.add(o)})),n.has("any")?["any"]:Array.from(n)}function k(e,t,n){let r,o;const a=e||"unnamed";let i,l=n;for(i=0;i<t.length;i++){const e=[];if(l.forEach((n=>{const r=w(C(n.params,i));(i<n.params.length||b(n.params))&&r(t[i])&&e.push(n)})),0===e.length){if(o=S(l,i),o.length>0){const e=d(t[i]);return r=new TypeError("Unexpected type of argument in function "+a+" (expected: "+o.join(" or ")+", actual: "+e.join(" | ")+", index: "+i+")"),r.data={category:"wrongType",fn:a,index:i,actual:e,expected:o},r}}else l=e}const s=l.map((function(e){return b(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,s))return o=S(l,i),r=new TypeError("Too few arguments in function "+a+" (expected: "+o.join(" or ")+", index: "+t.length+")"),r.data={category:"tooFewArgs",fn:a,index:t.length,expected:o},r;const c=Math.max.apply(null,s);if(t.length>c)return r=new TypeError("Too many arguments in function "+a+" (expected: "+c+", actual: "+t.length+")"),r.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:c},r;const u=[];for(let p=0;p<t.length;++p)u.push(d(t[p]).join("|"));return r=new TypeError('Arguments of type "'+u.join(", ")+'" do not match any of the defined signatures of function '+a+"."),r.data={category:"mismatch",actual:u},r}function T(e){let t=a.length+1;for(let n=0;n<e.types.length;n++)E(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function N(e){let t=i+1;for(let n=0;n<e.types.length;n++)E(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function D(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;const n=T(e)-T(t);if(n<0)return-1;if(n>0)return 1;const r=N(e)-N(t);return r<0?-1:r>0?1:0}function A(e,t){const n=e.params,r=t.params,o=z(n),a=z(r),i=b(n),l=b(r);if(i&&o.hasAny){if(!l||!a.hasAny)return 1}else if(l&&a.hasAny)return-1;let s,c=0,u=0;for(s of n)s.hasAny&&++c,s.hasConversion&&++u;let d=0,p=0;for(s of r)s.hasAny&&++d,s.hasConversion&&++p;if(c!==d)return c-d;if(i&&o.hasConversion){if(!l||!a.hasConversion)return 1}else if(l&&a.hasConversion)return-1;if(u!==p)return u-p;if(i){if(!l)return 1}else if(l)return-1;const f=(n.length-r.length)*(i?-1:1);if(0!==f)return f;const h=[];let m,v=0;for(let g=0;g<n.length;++g){const e=D(n[g],r[g]);h.push(e),v+=e}if(0!==v)return v;for(m of h)if(0!==m)return m;return 0}function I(e,t){let n=t;if(e.some((e=>e.hasConversion))){const r=b(e),o=e.map(R);n=function(){const e=[],n=r?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=o[t](arguments[t]);return r&&(e[n]=arguments[n].map(o[n])),t.apply(this,e)}}let r=n;if(b(e)){const t=e.length-1;r=function(){return n.apply(this,j(arguments,0,t).concat([j(arguments,t)]))}}return r}function R(e){let t,n,r,o;const a=[],i=[];switch(e.types.forEach((function(e){e.conversion&&(a.push(s(e.conversion.from).test),i.push(e.conversion.convert))})),i.length){case 0:return function(e){return e};case 1:return t=a[0],r=i[0],function(e){return t(e)?r(e):e};case 2:return t=a[0],n=a[1],r=i[0],o=i[1],function(e){return t(e)?r(e):n(e)?o(e):e};default:return function(e){for(let t=0;t<i.length;t++)if(a[t](e))return i[t](e);return e}}}function M(e){return function e(t,n,r){if(n<t.length){const i=t[n];let l=[];if(i.restParam){const e=i.types.filter(E);e.length<i.types.length&&l.push({types:e,name:"..."+e.map((e=>e.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),l.push(i)}else l=i.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return o=l,a=function(o){return e(t,n+1,r.concat([o]))},Array.prototype.concat.apply([],o.map(a))}return[r];var o,a}(e,0,[])}function O(e,t){const n=Math.max(e.length,t.length);for(let l=0;l<n;l++){const n=_(e,l),r=_(t,l);let o,a=!1;for(o of r)if(n.has(o)){a=!0;break}if(!a)return!1}const r=e.length,o=t.length,a=b(e),i=b(t);return a?i?r===o:o>=r:i?r>=o:r===o}function B(e,t,n){const r=[];let o;for(o of e){let e=n[o];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+o+'"');if(e=t[e],"function"!=typeof e)return!1;r.push(e)}return r}function V(e,t,n){const r=function(e){return e.map((e=>q(e)?U(e.referToSelf.callback):H(e)?$(e.referTo.references,e.referTo.callback):e))}(e),o=new Array(r.length).fill(!1);let a=!0;for(;a;){a=!1;let e=!0;for(let i=0;i<r.length;++i){if(o[i])continue;const l=r[i];if(q(l))r[i]=l.referToSelf.callback(n),r[i].referToSelf=l.referToSelf,o[i]=!0,e=!1;else if(H(l)){const n=B(l.referTo.references,r,t);n?(r[i]=l.referTo.callback.apply(this,n),r[i].referTo=l.referTo,o[i]=!0,e=!1):a=!0}}if(e&&a)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return r}function P(e,t){if(l.createCount++,0===Object.keys(t).length)throw new SyntaxError("No signatures provided");l.warnAgainstDeprecatedThis&&function(e){const t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach((n=>{const r=e[n];if(t.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}(t);const n=[],r=[],o={},a=[];let i;for(i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const e=y(i);if(!e)continue;n.forEach((function(t){if(O(t,e))throw new TypeError('Conflicting signatures "'+h(t)+'" and "'+h(e)+'".')})),n.push(e);const l=r.length;r.push(t[i]);const s=e.map(v);let c;for(c of M(s)){const e=h(c);a.push({params:c,name:e,fn:l}),c.every((e=>!e.hasConversion))&&(o[e]=l)}}a.sort(A);const s=V(r,o,ae);let c;for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&(o[c]=s[o[c]]);const u=[],d=new Map;for(c of a)d.has(c.name)||(c.fn=s[c.fn],u.push(c),d.set(c.name,c));const p=u[0]&&u[0].params.length<=2&&!b(u[0].params),f=u[1]&&u[1].params.length<=2&&!b(u[1].params),m=u[2]&&u[2].params.length<=2&&!b(u[2].params),g=u[3]&&u[3].params.length<=2&&!b(u[3].params),C=u[4]&&u[4].params.length<=2&&!b(u[4].params),_=u[5]&&u[5].params.length<=2&&!b(u[5].params),E=p&&f&&m&&g&&C&&_;for(let l=0;l<u.length;++l)u[l].test=x(u[l].params);const S=p?w(u[0].params[0]):C2,k=f?w(u[1].params[0]):C2,T=m?w(u[2].params[0]):C2,N=g?w(u[3].params[0]):C2,D=C?w(u[4].params[0]):C2,R=_?w(u[5].params[0]):C2,B=p?w(u[0].params[1]):C2,P=f?w(u[1].params[1]):C2,L=m?w(u[2].params[1]):C2,F=g?w(u[3].params[1]):C2,z=C?w(u[4].params[1]):C2,j=_?w(u[5].params[1]):C2;for(let l=0;l<u.length;++l)u[l].implementation=I(u[l].params,u[l].fn);const $=p?u[0].implementation:_2,U=f?u[1].implementation:_2,H=m?u[2].implementation:_2,q=g?u[3].implementation:_2,W=C?u[4].implementation:_2,G=_?u[5].implementation:_2,Y=p?u[0].params.length:-1,K=f?u[1].params.length:-1,X=m?u[2].params.length:-1,J=g?u[3].params.length:-1,Z=C?u[4].params.length:-1,Q=_?u[5].params.length:-1,ee=E?6:0,te=u.length,ne=u.map((e=>e.test)),re=u.map((e=>e.implementation)),oe=function(){for(let e=ee;e<te;e++)if(ne[e](arguments))return re[e].apply(this,arguments);return l.onMismatch(e,arguments,u)};function ae(e,t){return arguments.length===Y&&S(e)&&B(t)?$.apply(this,arguments):arguments.length===K&&k(e)&&P(t)?U.apply(this,arguments):arguments.length===X&&T(e)&&L(t)?H.apply(this,arguments):arguments.length===J&&N(e)&&F(t)?q.apply(this,arguments):arguments.length===Z&&D(e)&&z(t)?W.apply(this,arguments):arguments.length===Q&&R(e)&&j(t)?G.apply(this,arguments):oe.apply(this,arguments)}try{Object.defineProperty(ae,"name",{value:e})}catch(ie){}return ae.signatures=o,ae._typedFunctionData={signatures:u,signatureMap:d},ae}function L(e,t,n){throw k(e,t,n)}function F(e){return j(e,0,e.length-1)}function z(e){return e[e.length-1]}function j(e,t,n){return Array.prototype.slice.call(e,t,n)}function $(e,t){return{referTo:{references:e,callback:t}}}function U(e){if("function"!=typeof e)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function H(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function q(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function W(e,t){if(!e)return t;if(t&&t!==e){const n=new Error("Function names do not match (expected: "+e+", actual: "+t+")");throw n.data={actual:t,expected:e},n}return e}function G(e){let t;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(p(e[n])||"string"==typeof e[n].signature)&&(t=W(t,e[n].name));return t}function Y(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){const r=new Error('Signature "'+n+'" is defined twice');throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}u(),c(n);const K=l;function X(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw new SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return l=function(e){const n="string"==typeof e;let r=n?e:"";const o={};for(let a=n?1:0;a<arguments.length;++a){const e=arguments[a];let i,l={};if("function"==typeof e?(i=e.name,"string"==typeof e.signature?l[e.signature]=e:p(e)&&(l=e.signatures)):t(e)&&(l=e,n||(i=G(e))),0===Object.keys(l).length){const t=new TypeError("Argument to 'typed' at index "+a+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw t.data={index:a,argument:e},t}n||(r=W(r,i)),Y(o,l)}return P(r||"",o)},l.create=e,l.createCount=K.createCount,l.onMismatch=L,l.throwMismatchError=L,l.createError=k,l.clear=u,l.clearConversions=function(){let e;for(e of a)o.get(e).conversionsTo=[];i=0},l.addTypes=c,l._findType=s,l.referTo=function(){const e=F(arguments).map((e=>h(y(e)))),t=z(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return $(e,t)},l.referToSelf=U,l.convert=function(e,t){const n=s(t);if(n.test(e))return e;const r=n.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+t+" defined.");for(let o=0;o<r.length;o++){if(s(r[o].from).test(e))return r[o].convert(e)}throw new Error("Cannot convert "+e+" to "+t)},l.findSignature=f,l.find=function(e,t,n){return f(e,t,n).implementation},l.isTypedFunction=p,l.warnAgainstDeprecatedThis=!0,l.addType=function(e,t){let n="any";!1!==t&&o.has("Object")&&(n="Object"),l.addTypes([e],n)},l.addConversion=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{override:!1};X(e);const n=s(e.to),r=n.conversionsTo.find((t=>t.from===e.from));if(r){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+n.name+'"');l.removeConversion({from:r.from,to:e.to,convert:r.convert})}n.conversionsTo.push({from:e.from,convert:e.convert,index:i++})},l.addConversions=function(e,t){e.forEach((e=>l.addConversion(e,t)))},l.removeConversion=function(e){X(e);const t=s(e.to),n=function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}(t.conversionsTo,(t=>t.from===e.from));if(!n)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(n.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},l.resolve=function(e,t){if(!p(e))throw new TypeError(E2);const n=e._typedFunctionData.signatures;for(let r=0;r<n.length;++r)if(n[r].test(t))return n[r];return null},l}();function k2(e,t,n,r){function o(r){var o=function(e,t){for(var n={},r=0;r<t.length;r++){var o=t[r],a=e[o];void 0!==a&&(n[o]=a)}return n}(r,t.map(T2));return function(e,t,n){var r=t.filter((e=>!function(e){return e&&"?"===e[0]}(e))).every((e=>void 0!==n[e]));if(!r){var o=t.filter((e=>void 0===n[e]));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(o.map((e=>'"'.concat(e,'"'))).join(", "),"."))}}(e,t,r),n(o)}return o.isFactory=!0,o.fn=e,o.dependencies=t.slice().sort(),r&&(o.meta=r),o}function T2(e){return e&&"?"===e[0]?e.slice(1):e}function N2(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function D2(e,t){return"bigint"!==t.number||/^-?\d+$/.test(e)?t.number:t.numberFallback}var A2=Math.sign||function(e){return e>0?1:e<0?-1:0},I2=Math.log2||function(e){return Math.log(e)/Math.LN2},R2=Math.log10||function(e){return Math.log(e)/Math.LN10},M2=Math.log1p||function(e){return Math.log(e+1)},O2=Math.cbrt||function(e){if(0===e)return e;var t,n=e<0;return n&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,n?-t:t},B2=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function V2(e,t,n){var r={2:"0b",8:"0o",16:"0x"}[t],o="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!N2(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!N2(e))throw new Error("Value must be an integer");e<0&&(e+=2**n),o="i".concat(n)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(r).concat(e.toString(t)).concat(o)}function P2(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:n,precision:r,wordSize:o}=L2(t);switch(n){case"fixed":return z2(e,r);case"exponential":return j2(e,r);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=F2(e),r=$2(n,t),o=r.exponent,a=r.coefficients,i=o%3==0?o:o<0?o-3-o%3:o-o%3;if(T1(t))for(;t>a.length||o-i+1>a.length;)a.push(0);else for(var l=Math.abs(o-i)-(a.length-1),s=0;s<l;s++)a.push(0);var c=Math.abs(o-i),u=1;for(;c>0;)u++,c--;var d=a.slice(u).join(""),p=T1(t)&&d.length||d.match(/[1-9]/)?"."+d:"",f=a.slice(0,u).join("")+p+"e"+(o>=0?"+":"")+i.toString();return r.sign+f}(e,r);case"bin":return V2(e,2,o);case"oct":return V2(e,8,o);case"hex":return V2(e,16,o);case"auto":return function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=Z2(null==n?void 0:n.lowerExp,-3),o=Z2(null==n?void 0:n.upperExp,5),a=F2(e),i=t?$2(a,t):a;if(i.exponent<r||i.exponent>=o)return j2(e,t);var l=i.coefficients,s=i.exponent;l.length<t&&(l=l.concat(U2(t-l.length))),l=l.concat(U2(s-l.length+1+(l.length<t?t-l.length:0)));var c=s>0?s:0;return c<(l=U2(-s).concat(l)).length-1&&l.splice(c+1,0,"."),i.sign+l.join("")}(e,r,t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function L2(e){var t,n,r="auto";if(void 0!==e)if(T1(e))t=e;else if(N1(e))t=e.toNumber();else{if(!G1(e))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==e.precision&&(t=J2(e.precision,(()=>{throw new Error('Option "precision" must be a number or BigNumber')}))),void 0!==e.wordSize&&(n=J2(e.wordSize,(()=>{throw new Error('Option "wordSize" must be a number or BigNumber')}))),e.notation&&(r=e.notation)}return{notation:r,precision:t,wordSize:n}}function F2(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],o=parseFloat(t[4]||"0"),a=r.indexOf(".");o+=-1!==a?a-1:r.length-1;var i=r.replace(".","").replace(/^0*/,(function(e){return o-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===i.length&&(i.push(0),o++),{sign:n,coefficients:i,exponent:o}}function z2(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=F2(e),r="number"==typeof t?$2(n,n.exponent+1+t):n,o=r.coefficients,a=r.exponent+1,i=a+(t||0);return o.length<i&&(o=o.concat(U2(i-o.length))),a<0&&(o=U2(1-a).concat(o),a=1),a<o.length&&o.splice(a,0,0===a?"0.":"."),r.sign+o.join("")}function j2(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=F2(e),r=t?$2(n,t):n,o=r.coefficients,a=r.exponent;o.length<t&&(o=o.concat(U2(t-o.length)));var i=o.shift();return r.sign+i+(o.length>0?"."+o.join(""):"")+"e"+(a>=0?"+":"")+a}function $2(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var o=t-1;for(r[o]++;10===r[o];)r.pop(),0===o&&(r.unshift(0),n.exponent++,o++),r[--o]++}return n}function U2(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function H2(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return!isNaN(e)&&!isNaN(t)&&(isFinite(e)&&isFinite(t)?e===t||Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r):e===t)}var q2=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},W2=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},G2=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Y2=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},K2=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},X2=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function J2(e,t){return T1(e)?e:N1(e)?e.toNumber():void t()}function Z2(e,t){return T1(e)?e:N1(e)?e.toNumber():t}var Q2=function(){return Q2=S2.create,S2},e4=k2("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:o}=e,a=Q2();return a.clear(),a.addTypes([{name:"number",test:T1},{name:"Complex",test:A1},{name:"BigNumber",test:N1},{name:"bigint",test:D1},{name:"Fraction",test:I1},{name:"Unit",test:R1},{name:"identifier",test:e=>M1&&/^(?:[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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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\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\uDE80-\uDEA9\uDEB0\uDEB1\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]|\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]|\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\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\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\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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\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\uDE80-\uDEA9\uDEB0\uDEB1\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]|\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]|\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\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\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\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:M1},{name:"Chain",test:h2},{name:"Array",test:O1},{name:"Matrix",test:B1},{name:"DenseMatrix",test:P1},{name:"SparseMatrix",test:L1},{name:"Range",test:F1},{name:"Index",test:z1},{name:"boolean",test:j1},{name:"ResultSet",test:$1},{name:"Help",test:U1},{name:"function",test:H1},{name:"Date",test:q1},{name:"RegExp",test:W1},{name:"null",test:K1},{name:"undefined",test:X1},{name:"AccessorNode",test:J1},{name:"ArrayNode",test:Z1},{name:"AssignmentNode",test:Q1},{name:"BlockNode",test:e2},{name:"ConditionalNode",test:t2},{name:"ConstantNode",test:n2},{name:"FunctionNode",test:a2},{name:"FunctionAssignmentNode",test:o2},{name:"IndexNode",test:i2},{name:"Node",test:l2},{name:"ObjectNode",test:s2},{name:"OperatorNode",test:c2},{name:"ParenthesisNode",test:u2},{name:"RangeNode",test:d2},{name:"RelationalNode",test:p2},{name:"SymbolNode",test:f2},{name:"Map",test:Y1},{name:"Object",test:G1}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||t4(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new 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 n||n4(e),new n(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return n||n4(e),new n(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new 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||t4(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return o||r4(e),new o(e.toString())}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new 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 n||n4(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){o||r4(e);var t=new o(e);if(t.valueOf()!==e)throw new 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 new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||t4(e);try{return new t(e)}catch(n){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){o||r4(e);try{return new o(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||n4(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||t4(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return o||r4(e),new o(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&V1(t[0])&&n.some((e=>!e.params.includes(",")))){var o=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw o.data=r.data,o}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&V1(t[0])&&n.some((e=>!e.params.includes(",")))){var o=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw o.data=r.data,o}throw r},a}));function t4(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function n4(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function r4(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var o4,a4,i4=k2("ResultSet",[],(()=>{function e(t){if(!(this instanceof e))throw new 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.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0}),l4=9e15,s4=1e9,c4="0123456789abcdef",u4="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",d4="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p4={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:l4,crypto:!1},f4=!0,h4="[DecimalError] ",m4=h4+"Invalid argument: ",v4=h4+"Precision limit exceeded",g4=h4+"crypto unavailable",y4="[object Decimal]",b4=Math.floor,w4=Math.pow,x4=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,C4=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,_4=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,E4=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,S4=1e7,k4=u4.length-1,T4=d4.length-1,N4={toStringTag:y4};function D4(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)(n=7-(r=e[t]+"").length)&&(a+=z4(n)),a+=r;(n=7-(r=(i=e[t])+"").length)&&(a+=z4(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return a+i}function A4(e,t,n){if(e!==~~e||e<t||e>n)throw Error(m4+e)}function I4(e,t,n,r){var o,a,i,l;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,o=0):(o=Math.ceil((t+1)/7),t%=7),a=w4(10,7-t),l=e[o]%a|0,null==r?t<3?(0==t?l=l/100|0:1==t&&(l=l/10|0),i=n<4&&99999==l||n>3&&49999==l||5e4==l||0==l):i=(n<4&&l+1==a||n>3&&l+1==a/2)&&(e[o+1]/a/100|0)==w4(10,t-2)-1||(l==a/2||0==l)&&!(e[o+1]/a/100|0):t<4?(0==t?l=l/1e3|0:1==t?l=l/100|0:2==t&&(l=l/10|0),i=(r||n<4)&&9999==l||!r&&n>3&&4999==l):i=((r||n<4)&&l+1==a||!r&&n>3&&l+1==a/2)&&(e[o+1]/a/1e3|0)==w4(10,t-3)-1,i}function R4(e,t,n){for(var r,o,a=[0],i=0,l=e.length;i<l;){for(o=a.length;o--;)a[o]*=t;for(a[0]+=c4.indexOf(e.charAt(i++)),r=0;r<a.length;r++)a[r]>n-1&&(void 0===a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}N4.absoluteValue=N4.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O4(e)},N4.ceil=function(){return O4(new this.constructor(this),this.e+1,2)},N4.clampedTo=N4.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(m4+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},N4.comparedTo=N4.cmp=function(e){var t,n,r,o,a=this,i=a.d,l=(e=new a.constructor(e)).d,s=a.s,c=e.s;if(!i||!l)return s&&c?s!==c?s:i===l?0:!i^s<0?1:-1:NaN;if(!i[0]||!l[0])return i[0]?s:l[0]?-c:0;if(s!==c)return s;if(a.e!==e.e)return a.e>e.e^s<0?1:-1;for(t=0,n=(r=i.length)<(o=l.length)?r:o;t<n;++t)if(i[t]!==l[t])return i[t]>l[t]^s<0?1:-1;return r===o?0:r>o^s<0?1:-1},N4.cosine=N4.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,o;if(t.isZero())return t;r=t.d.length,r<32?o=(1/K4(4,n=Math.ceil(r/3))).toString():(n=16,o="2.3283064365386962890625e-10");e.precision+=n,t=Y4(e,1,t.times(o),new e(1));for(var a=n;a--;){var i=t.times(t);t=i.times(i).minus(i).times(8).plus(1)}return e.precision-=n,t}(r,X4(r,n)),r.precision=e,r.rounding=t,O4(2==a4||3==a4?n.neg():n,e,t,!0)):new r(1):new r(NaN)},N4.cubeRoot=N4.cbrt=function(){var e,t,n,r,o,a,i,l,s,c,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(f4=!1,(a=u.s*w4(u.s*u,1/3))&&Math.abs(a)!=1/0?r=new d(a.toString()):(n=D4(u.d),(a=((e=u.e)-n.length+1)%3)&&(n+=1==a||-2==a?"0":"00"),a=w4(n,1/3),e=b4((e+1)/3)-(e%3==(e<0?-1:2)),(r=new d(n=a==1/0?"5e"+e:(n=a.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),i=(e=d.precision)+3;;)if(c=(s=(l=r).times(l).times(l)).plus(u),r=M4(c.plus(u).times(l),c.plus(s),i+2,1),D4(l.d).slice(0,i)===(n=D4(r.d)).slice(0,i)){if("9999"!=(n=n.slice(i-3,i+1))&&(o||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(O4(r,e+1,1),t=!r.times(r).times(r).eq(u));break}if(!o&&(O4(l,e+1,0),l.times(l).times(l).eq(u))){r=l;break}i+=4,o=1}return f4=!0,O4(r,e,d.rounding,t)},N4.decimalPlaces=N4.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-b4(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},N4.dividedBy=N4.div=function(e){return M4(this,new this.constructor(e))},N4.dividedToIntegerBy=N4.divToInt=function(e){var t=this.constructor;return O4(M4(this,new t(e),0,1,1),t.precision,t.rounding)},N4.equals=N4.eq=function(e){return 0===this.cmp(e)},N4.floor=function(){return O4(new this.constructor(this),this.e+1,3)},N4.greaterThan=N4.gt=function(e){return this.cmp(e)>0},N4.greaterThanOrEqualTo=N4.gte=function(e){var t=this.cmp(e);return 1==t||0===t},N4.hyperbolicCosine=N4.cosh=function(){var e,t,n,r,o,a=this,i=a.constructor,l=new i(1);if(!a.isFinite())return new i(a.s?1/0:NaN);if(a.isZero())return l;n=i.precision,r=i.rounding,i.precision=n+Math.max(a.e,a.sd())+4,i.rounding=1,(o=a.d.length)<32?t=(1/K4(4,e=Math.ceil(o/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=Y4(i,1,a.times(t),new i(1),!0);for(var s,c=e,u=new i(8);c--;)s=a.times(a),a=l.minus(s.times(u.minus(s.times(u))));return O4(a,i.precision=n,i.rounding=r,!0)},N4.hyperbolicSine=N4.sinh=function(){var e,t,n,r,o=this,a=o.constructor;if(!o.isFinite()||o.isZero())return new a(o);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(o.e,o.sd())+4,a.rounding=1,(r=o.d.length)<3)o=Y4(a,2,o,o,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,o=Y4(a,2,o=o.times(1/K4(5,e)),o,!0);for(var i,l=new a(5),s=new a(16),c=new a(20);e--;)i=o.times(o),o=o.times(l.plus(i.times(s.times(i).plus(c))))}return a.precision=t,a.rounding=n,O4(o,t,n,!0)},N4.hyperbolicTangent=N4.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,M4(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},N4.inverseCosine=N4.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,o=t.rounding;return-1!==n?0===n?e.isNeg()?L4(t,r,o):new t(0):new t(NaN):e.isZero()?L4(t,r+4,o).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=o,e.times(2))},N4.inverseHyperbolicCosine=N4.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,f4=!1,n=n.times(n).minus(1).sqrt().plus(n),f4=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},N4.inverseHyperbolicSine=N4.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,f4=!1,n=n.times(n).plus(1).sqrt().plus(n),f4=!0,r.precision=e,r.rounding=t,n.ln())},N4.inverseHyperbolicTangent=N4.atanh=function(){var e,t,n,r,o=this,a=o.constructor;return o.isFinite()?o.e>=0?new a(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=a.precision,t=a.rounding,r=o.sd(),Math.max(r,e)<2*-o.e-1?O4(new a(o),e,t,!0):(a.precision=n=r-o.e,o=M4(o.plus(1),new a(1).minus(o),n+e,1),a.precision=e+4,a.rounding=1,o=o.ln(),a.precision=e,a.rounding=t,o.times(.5))):new a(NaN)},N4.inverseSine=N4.asin=function(){var e,t,n,r,o=this,a=o.constructor;return o.isZero()?new a(o):(t=o.abs().cmp(1),n=a.precision,r=a.rounding,-1!==t?0===t?((e=L4(a,n+4,r).times(.5)).s=o.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,o=o.div(new a(1).minus(o.times(o)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,o.times(2)))},N4.inverseTangent=N4.atan=function(){var e,t,n,r,o,a,i,l,s,c=this,u=c.constructor,d=u.precision,p=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&d+4<=T4)return(i=L4(u,d+4,p).times(.25)).s=c.s,i}else{if(!c.s)return new u(NaN);if(d+4<=T4)return(i=L4(u,d+4,p).times(.5)).s=c.s,i}for(u.precision=l=d+10,u.rounding=1,e=n=Math.min(28,l/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(f4=!1,t=Math.ceil(l/7),r=1,s=c.times(c),i=new u(c),o=c;-1!==e;)if(o=o.times(s),a=i.minus(o.div(r+=2)),o=o.times(s),void 0!==(i=a.plus(o.div(r+=2))).d[t])for(e=t;i.d[e]===a.d[e]&&e--;);return n&&(i=i.times(2<<n-1)),f4=!0,O4(i,u.precision=d,u.rounding=p,!0)},N4.isFinite=function(){return!!this.d},N4.isInteger=N4.isInt=function(){return!!this.d&&b4(this.e/7)>this.d.length-2},N4.isNaN=function(){return!this.s},N4.isNegative=N4.isNeg=function(){return this.s<0},N4.isPositive=N4.isPos=function(){return this.s>0},N4.isZero=function(){return!!this.d&&0===this.d[0]},N4.lessThan=N4.lt=function(e){return this.cmp(e)<0},N4.lessThanOrEqualTo=N4.lte=function(e){return this.cmp(e)<1},N4.logarithm=N4.log=function(e){var t,n,r,o,a,i,l,s,c=this,u=c.constructor,d=u.precision,p=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(o=n[0];o%10==0;)o/=10;a=1!==o}if(f4=!1,i=q4(c,l=d+5),r=t?P4(u,l+10):q4(e,l),I4((s=M4(i,r,l,1)).d,o=d,p))do{if(i=q4(c,l+=10),r=t?P4(u,l+10):q4(e,l),s=M4(i,r,l,1),!a){+D4(s.d).slice(o+1,o+15)+1==1e14&&(s=O4(s,d+1,0));break}}while(I4(s.d,o+=10,p));return f4=!0,O4(s,d,p)},N4.minus=N4.sub=function(e){var t,n,r,o,a,i,l,s,c,u,d,p,f=this,h=f.constructor;if(e=new h(e),!f.d||!e.d)return f.s&&e.s?f.d?e.s=-e.s:e=new h(e.d||f.s!==e.s?f:NaN):e=new h(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(c=f.d,p=e.d,l=h.precision,s=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===s?-0:0);e=new h(f)}return f4?O4(e,l,s):e}if(n=b4(e.e/7),u=b4(f.e/7),c=c.slice(),a=u-n){for((d=a<0)?(t=c,a=-a,i=p.length):(t=p,n=u,i=c.length),a>(r=Math.max(Math.ceil(l/7),i)+2)&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for((d=(r=c.length)<(i=p.length))&&(i=r),r=0;r<i;r++)if(c[r]!=p[r]){d=c[r]<p[r];break}a=0}for(d&&(t=c,c=p,p=t,e.s=-e.s),i=c.length,r=p.length-i;r>0;--r)c[i++]=0;for(r=p.length;r>a;){if(c[--r]<p[r]){for(o=r;o&&0===c[--o];)c[o]=S4-1;--c[o],c[r]+=S4}c[r]-=p[r]}for(;0===c[--i];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=V4(c,n),f4?O4(e,l,s):e):new h(3===s?-0:0)},N4.modulo=N4.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?O4(new r(n),r.precision,r.rounding):(f4=!1,9==r.modulo?(t=M4(n,e.abs(),0,3,1)).s*=e.s:t=M4(n,e,0,r.modulo,1),t=t.times(e),f4=!0,n.minus(t))},N4.naturalExponential=N4.exp=function(){return H4(this)},N4.naturalLogarithm=N4.ln=function(){return q4(this)},N4.negated=N4.neg=function(){var e=new this.constructor(this);return e.s=-e.s,O4(e)},N4.plus=N4.add=function(e){var t,n,r,o,a,i,l,s,c,u,d=this,p=d.constructor;if(e=new p(e),!d.d||!e.d)return d.s&&e.s?d.d||(e=new p(e.d||d.s===e.s?d:NaN)):e=new p(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(c=d.d,u=e.d,l=p.precision,s=p.rounding,!c[0]||!u[0])return u[0]||(e=new p(d)),f4?O4(e,l,s):e;if(a=b4(d.e/7),r=b4(e.e/7),c=c.slice(),o=a-r){for(o<0?(n=c,o=-o,i=u.length):(n=u,r=a,i=c.length),o>(i=(a=Math.ceil(l/7))>i?a+1:i+1)&&(o=i,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for((i=c.length)-(o=u.length)<0&&(o=i,n=u,u=c,c=n),t=0;o;)t=(c[--o]=c[o]+u[o]+t)/S4|0,c[o]%=S4;for(t&&(c.unshift(t),++r),i=c.length;0==c[--i];)c.pop();return e.d=c,e.e=V4(c,r),f4?O4(e,l,s):e},N4.precision=N4.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(m4+e);return n.d?(t=F4(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},N4.round=function(){var e=this,t=e.constructor;return O4(new t(e),e.e+1,t.rounding)},N4.sine=N4.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Y4(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:0|n,t=t.times(1/K4(5,n)),t=Y4(e,2,t,t);for(var o,a=new e(5),i=new e(16),l=new e(20);n--;)o=t.times(t),t=t.times(a.plus(o.times(i.times(o).minus(l))));return t}(r,X4(r,n)),r.precision=e,r.rounding=t,O4(a4>2?n.neg():n,e,t,!0)):new r(NaN)},N4.squareRoot=N4.sqrt=function(){var e,t,n,r,o,a,i=this,l=i.d,s=i.e,c=i.s,u=i.constructor;if(1!==c||!l||!l[0])return new u(!c||c<0&&(!l||l[0])?NaN:l?i:1/0);for(f4=!1,0==(c=Math.sqrt(+i))||c==1/0?(((t=D4(l)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=b4((s+1)/2)-(s<0||s%2),r=new u(t=c==1/0?"5e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):r=new u(c.toString()),n=(s=u.precision)+3;;)if(r=(a=r).plus(M4(i,a,n+2,1)).times(.5),D4(a.d).slice(0,n)===(t=D4(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(O4(r,s+1,1),e=!r.times(r).eq(i));break}if(!o&&(O4(a,s+1,0),a.times(a).eq(i))){r=a;break}n+=4,o=1}return f4=!0,O4(r,s,u.rounding,e)},N4.tangent=N4.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=M4(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,O4(2==a4||4==a4?n.neg():n,e,t,!0)):new r(NaN)},N4.times=N4.mul=function(e){var t,n,r,o,a,i,l,s,c,u=this,d=u.constructor,p=u.d,f=(e=new d(e)).d;if(e.s*=u.s,!(p&&p[0]&&f&&f[0]))return new d(!e.s||p&&!p[0]&&!f||f&&!f[0]&&!p?NaN:p&&f?0*e.s:e.s/0);for(n=b4(u.e/7)+b4(e.e/7),(s=p.length)<(c=f.length)&&(a=p,p=f,f=a,i=s,s=c,c=i),a=[],r=i=s+c;r--;)a.push(0);for(r=c;--r>=0;){for(t=0,o=s+r;o>r;)l=a[o]+f[r]*p[o-r-1]+t,a[o--]=l%S4|0,t=l/S4|0;a[o]=(a[o]+t)%S4|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=V4(a,n),f4?O4(e,d.precision,d.rounding):e},N4.toBinary=function(e,t){return J4(this,2,e,t)},N4.toDecimalPlaces=N4.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(A4(e,0,s4),void 0===t?t=r.rounding:A4(t,0,8),O4(n,e+n.e+1,t))},N4.toExponential=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=B4(r,!0):(A4(e,0,s4),void 0===t?t=o.rounding:A4(t,0,8),n=B4(r=O4(new o(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},N4.toFixed=function(e,t){var n,r,o=this,a=o.constructor;return void 0===e?n=B4(o):(A4(e,0,s4),void 0===t?t=a.rounding:A4(t,0,8),n=B4(r=O4(new a(o),e+o.e+1,t),!1,e+r.e+1)),o.isNeg()&&!o.isZero()?"-"+n:n},N4.toFraction=function(e){var t,n,r,o,a,i,l,s,c,u,d,p,f=this,h=f.d,m=f.constructor;if(!h)return new m(f);if(c=n=new m(1),r=s=new m(0),i=(a=(t=new m(r)).e=F4(h)-f.e-1)%7,t.d[0]=w4(10,i<0?7+i:i),null==e)e=a>0?t:c;else{if(!(l=new m(e)).isInt()||l.lt(c))throw Error(m4+l);e=l.gt(t)?a>0?t:c:l}for(f4=!1,l=new m(D4(h)),u=m.precision,m.precision=a=7*h.length*2;d=M4(l,t,0,1,1),1!=(o=n.plus(d.times(r))).cmp(e);)n=r,r=o,o=c,c=s.plus(d.times(o)),s=o,o=t,t=l.minus(d.times(o)),l=o;return o=M4(e.minus(n),r,0,1,1),s=s.plus(o.times(c)),n=n.plus(o.times(r)),s.s=c.s=f.s,p=M4(c,r,a,1).minus(f).abs().cmp(M4(s,n,a,1).minus(f).abs())<1?[c,r]:[s,n],m.precision=u,f4=!0,p},N4.toHexadecimal=N4.toHex=function(e,t){return J4(this,16,e,t)},N4.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:A4(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(f4=!1,n=M4(n,e,0,t,1).times(e),f4=!0,O4(n)):(e.s=n.s,n=e),n},N4.toNumber=function(){return+this},N4.toOctal=function(e,t){return J4(this,8,e,t)},N4.toPower=N4.pow=function(e){var t,n,r,o,a,i,l=this,s=l.constructor,c=+(e=new s(e));if(!(l.d&&e.d&&l.d[0]&&e.d[0]))return new s(w4(+l,c));if((l=new s(l)).eq(1))return l;if(r=s.precision,a=s.rounding,e.eq(1))return O4(l,r,a);if((t=b4(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return o=j4(s,l,n,r),e.s<0?new s(1).div(o):O4(o,r,a);if((i=l.s)<0){if(t<e.d.length-1)return new s(NaN);if(1&e.d[t]||(i=1),0==l.e&&1==l.d[0]&&1==l.d.length)return l.s=i,l}return(t=0!=(n=w4(+l,c))&&isFinite(n)?new s(n+"").e:b4(c*(Math.log("0."+D4(l.d))/Math.LN10+l.e+1)))>s.maxE+1||t<s.minE-1?new s(t>0?i/0:0):(f4=!1,s.rounding=l.s=1,n=Math.min(12,(t+"").length),(o=H4(e.times(q4(l,r+n)),r)).d&&I4((o=O4(o,r+5,1)).d,r,a)&&(t=r+10,+D4((o=O4(H4(e.times(q4(l,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(o=O4(o,r+1,0))),o.s=i,f4=!0,s.rounding=a,O4(o,r,a))},N4.toPrecision=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=B4(r,r.e<=o.toExpNeg||r.e>=o.toExpPos):(A4(e,1,s4),void 0===t?t=o.rounding:A4(t,0,8),n=B4(r=O4(new o(r),e,t),e<=r.e||r.e<=o.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},N4.toSignificantDigits=N4.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(A4(e,1,s4),void 0===t?t=n.rounding:A4(t,0,8)),O4(new n(this),e,t)},N4.toString=function(){var e=this,t=e.constructor,n=B4(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},N4.truncated=N4.trunc=function(){return O4(new this.constructor(this),this.e+1,1)},N4.valueOf=N4.toJSON=function(){var e=this,t=e.constructor,n=B4(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var M4=function(){function e(e,t,n){var r,o=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+o,e[a]=r%n|0,o=r/n|0;return o&&e.unshift(o),e}function t(e,t,n,r){var o,a;if(n!=r)a=n>r?1:-1;else for(o=a=0;o<n;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,o,a,i,l,s){var c,u,d,p,f,h,m,v,g,y,b,w,x,C,_,E,S,k,T,N,D=r.constructor,A=r.s==o.s?1:-1,I=r.d,R=o.d;if(!(I&&I[0]&&R&&R[0]))return new D(r.s&&o.s&&(I?!R||I[0]!=R[0]:R)?I&&0==I[0]||!R?0*A:A/0:NaN);for(s?(f=1,u=r.e-o.e):(s=S4,f=7,u=b4(r.e/f)-b4(o.e/f)),T=R.length,S=I.length,y=(g=new D(A)).d=[],d=0;R[d]==(I[d]||0);d++);if(R[d]>(I[d]||0)&&u--,null==a?(C=a=D.precision,i=D.rounding):C=l?a+(r.e-o.e)+1:a,C<0)y.push(1),h=!0;else{if(C=C/f+2|0,d=0,1==T){for(p=0,R=R[0],C++;(d<S||p)&&C--;d++)_=p*s+(I[d]||0),y[d]=_/R|0,p=_%R|0;h=p||d<S}else{for((p=s/(R[0]+1)|0)>1&&(R=e(R,p,s),I=e(I,p,s),T=R.length,S=I.length),E=T,w=(b=I.slice(0,T)).length;w<T;)b[w++]=0;(N=R.slice()).unshift(0),k=R[0],R[1]>=s/2&&++k;do{p=0,(c=t(R,b,T,w))<0?(x=b[0],T!=w&&(x=x*s+(b[1]||0)),(p=x/k|0)>1?(p>=s&&(p=s-1),1==(c=t(m=e(R,p,s),b,v=m.length,w=b.length))&&(p--,n(m,T<v?N:R,v,s))):(0==p&&(c=p=1),m=R.slice()),(v=m.length)<w&&m.unshift(0),n(b,m,w,s),-1==c&&(c=t(R,b,T,w=b.length))<1&&(p++,n(b,T<w?N:R,w,s)),w=b.length):0===c&&(p++,b=[0]),y[d++]=p,c&&b[0]?b[w++]=I[E]||0:(b=[I[E]],w=1)}while((E++<S||void 0!==b[0])&&C--);h=void 0!==b[0]}y[0]||y.shift()}if(1==f)g.e=u,o4=h;else{for(d=1,p=y[0];p>=10;p/=10)d++;g.e=d+u*f-1,O4(g,l?a+g.e+1:a,i,h)}return g}}();function O4(e,t,n,r){var o,a,i,l,s,c,u,d,p,f=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(o=1,l=d[0];l>=10;l/=10)o++;if((a=t-o)<0)a+=7,i=t,s=(u=d[p=0])/w4(10,o-i-1)%10|0;else if((p=Math.ceil((a+1)/7))>=(l=d.length)){if(!r)break e;for(;l++<=p;)d.push(0);u=s=0,o=1,i=(a%=7)-7+1}else{for(u=l=d[p],o=1;l>=10;l/=10)o++;s=(i=(a%=7)-7+o)<0?0:u/w4(10,o-i-1)%10|0}if(r=r||t<0||void 0!==d[p+1]||(i<0?u:u%w4(10,o-i-1)),c=n<4?(s||r)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||r||6==n&&(a>0?i>0?u/w4(10,o-i):0:d[p-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=w4(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==a?(d.length=p,l=1,p--):(d.length=p+1,l=w4(10,7-a),d[p]=i>0?(u/w4(10,o-i)%w4(10,i)|0)*l:0),c)for(;;){if(0==p){for(a=1,i=d[0];i>=10;i/=10)a++;for(i=d[0]+=l,l=1;i>=10;i/=10)l++;a!=l&&(e.e++,d[0]==S4&&(d[0]=1));break}if(d[p]+=l,d[p]!=S4)break;d[p--]=0,l=1}for(a=d.length;0===d[--a];)d.pop()}return f4&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function B4(e,t,n){if(!e.isFinite())return W4(e);var r,o=e.e,a=D4(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+z4(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):o<0?(a="0."+z4(-o-1)+a,n&&(r=n-i)>0&&(a+=z4(r))):o>=i?(a+=z4(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+z4(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=z4(r))),a}function V4(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function P4(e,t,n){if(t>k4)throw f4=!0,n&&(e.precision=n),Error(v4);return O4(new e(u4),t,1,!0)}function L4(e,t,n){if(t>T4)throw Error(v4);return O4(new e(d4),t,n,!0)}function F4(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function z4(e){for(var t="";e--;)t+="0";return t}function j4(e,t,n,r){var o,a=new e(1),i=Math.ceil(r/7+4);for(f4=!1;;){if(n%2&&Z4((a=a.times(t)).d,i)&&(o=!0),0===(n=b4(n/2))){n=a.d.length-1,o&&0===a.d[n]&&++a.d[n];break}Z4((t=t.times(t)).d,i)}return f4=!0,a}function $4(e){return 1&e.d[e.d.length-1]}function U4(e,t,n){for(var r,o,a=new e(t[0]),i=0;++i<t.length;){if(!(o=new e(t[i])).s){a=o;break}((r=a.cmp(o))===n||0===r&&a.s===n)&&(a=o)}return a}function H4(e,t){var n,r,o,a,i,l,s,c=0,u=0,d=0,p=e.constructor,f=p.rounding,h=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(f4=!1,s=h):s=t,l=new p(.03125);e.e>-2;)e=e.times(l),d+=5;for(s+=r=Math.log(w4(2,d))/Math.LN10*2+5|0,n=a=i=new p(1),p.precision=s;;){if(a=O4(a.times(e),s,1),n=n.times(++u),D4((l=i.plus(M4(a,n,s,1))).d).slice(0,s)===D4(i.d).slice(0,s)){for(o=d;o--;)i=O4(i.times(i),s,1);if(null!=t)return p.precision=h,i;if(!(c<3&&I4(i.d,s-r,f,c)))return O4(i,p.precision=h,f,f4=!0);p.precision=s+=10,n=a=l=new p(1),u=0,c++}i=l}}function q4(e,t){var n,r,o,a,i,l,s,c,u,d,p,f=1,h=e,m=h.d,v=h.constructor,g=v.rounding,y=v.precision;if(h.s<0||!m||!m[0]||!h.e&&1==m[0]&&1==m.length)return new v(m&&!m[0]?-1/0:1!=h.s?NaN:m?0:h);if(null==t?(f4=!1,u=y):u=t,v.precision=u+=10,r=(n=D4(m)).charAt(0),!(Math.abs(a=h.e)<15e14))return c=P4(v,u+2,y).times(a+""),h=q4(new v(r+"."+n.slice(1)),u-10).plus(c),v.precision=y,null==t?O4(h,y,g,f4=!0):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=D4((h=h.times(e)).d)).charAt(0),f++;for(a=h.e,r>1?(h=new v("0."+n),a++):h=new v(r+"."+n.slice(1)),d=h,s=i=h=M4(h.minus(1),h.plus(1),u,1),p=O4(h.times(h),u,1),o=3;;){if(i=O4(i.times(p),u,1),D4((c=s.plus(M4(i,new v(o),u,1))).d).slice(0,u)===D4(s.d).slice(0,u)){if(s=s.times(2),0!==a&&(s=s.plus(P4(v,u+2,y).times(a+""))),s=M4(s,new v(f),u,1),null!=t)return v.precision=y,s;if(!I4(s.d,u-10,g,l))return O4(s,v.precision=y,g,f4=!0);v.precision=u+=10,c=i=h=M4(d.minus(1),d.plus(1),u,1),p=O4(h.times(h),u,1),o=l=1}s=c,o+=2}}function W4(e){return String(e.s*e.s/0)}function G4(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(o=t.length;48===t.charCodeAt(o-1);--o);if(t=t.slice(r,o)){if(o-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=7;r<o;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=o;for(;r--;)t+="0";e.d.push(+t),f4&&(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 Y4(e,t,n,r,o){var a,i,l,s,c=e.precision,u=Math.ceil(c/7);for(f4=!1,s=n.times(n),l=new e(r);;){if(i=M4(l.times(s),new e(t++*t++),c,1),l=o?r.plus(i):r.minus(i),r=M4(i.times(s),new e(t++*t++),c,1),void 0!==(i=l.plus(r)).d[u]){for(a=u;i.d[a]===l.d[a]&&a--;);if(-1==a)break}a=l,l=r,r=i,i=a}return f4=!0,i.d.length=u+1,i}function K4(e,t){for(var n=e;--t;)n*=e;return n}function X4(e,t){var n,r=t.s<0,o=L4(e,e.precision,1),a=o.times(.5);if((t=t.abs()).lte(a))return a4=r?4:1,t;if((n=t.divToInt(o)).isZero())a4=r?3:2;else{if((t=t.minus(n.times(o))).lte(a))return a4=$4(n)?r?2:3:r?4:1,t;a4=$4(n)?r?1:4:r?3:2}return t.minus(o).abs()}function J4(e,t,n,r){var o,a,i,l,s,c,u,d,p,f=e.constructor,h=void 0!==n;if(h?(A4(n,1,s4),void 0===r?r=f.rounding:A4(r,0,8)):(n=f.precision,r=f.rounding),e.isFinite()){for(h?(o=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):o=t,(i=(u=B4(e)).indexOf("."))>=0&&(u=u.replace(".",""),(p=new f(1)).e=u.length-i,p.d=R4(B4(p),10,o),p.e=p.d.length),a=s=(d=R4(u,10,o)).length;0==d[--s];)d.pop();if(d[0]){if(i<0?a--:((e=new f(e)).d=d,e.e=a,d=(e=M4(e,p,n,r,0,o)).d,a=e.e,c=o4),i=d[n],l=o/2,c=c||void 0!==d[n+1],c=r<4?(void 0!==i||c)&&(0===r||r===(e.s<0?3:2)):i>l||i===l&&(4===r||c||6===r&&1&d[n-1]||r===(e.s<0?8:7)),d.length=n,c)for(;++d[--n]>o-1;)d[n]=0,n||(++a,d.unshift(1));for(s=d.length;!d[s-1];--s);for(i=0,u="";i<s;i++)u+=c4.charAt(d[i]);if(h){if(s>1)if(16==t||8==t){for(i=16==t?4:3,--s;s%i;s++)u+="0";for(s=(d=R4(u,o,t)).length;!d[s-1];--s);for(i=1,u="1.";i<s;i++)u+=c4.charAt(d[i])}else u=u.charAt(0)+"."+u.slice(1);u=u+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)u="0"+u;u="0."+u}else if(++a>s)for(a-=s;a--;)u+="0";else a<s&&(u=u.slice(0,a)+"."+u.slice(a))}else u=h?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=W4(e);return e.s<0?"-"+u:u}function Z4(e,t){if(e.length>t)return e.length=t,!0}function Q4(e){return new this(e).abs()}function e3(e){return new this(e).acos()}function t3(e){return new this(e).acosh()}function n3(e,t){return new this(e).plus(t)}function r3(e){return new this(e).asin()}function o3(e){return new this(e).asinh()}function a3(e){return new this(e).atan()}function i3(e){return new this(e).atanh()}function l3(e,t){e=new this(e),t=new this(t);var n,r=this.precision,o=this.rounding,a=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?L4(this,r,o):new this(0)).s=e.s:!e.d||t.isZero()?(n=L4(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,n=this.atan(M4(e,t,a,1)),t=L4(this,a,1),this.precision=r,this.rounding=o,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(M4(e,t,a,1)):(n=L4(this,a,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function s3(e){return new this(e).cbrt()}function c3(e){return O4(e=new this(e),e.e+1,2)}function u3(e,t,n){return new this(e).clamp(t,n)}function d3(e){if(!e||"object"!=typeof e)throw Error(h4+"Object expected");var t,n,r,o=!0===e.defaults,a=["precision",1,s4,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,l4,"maxE",0,l4,"minE",-9e15,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],o&&(this[n]=p4[n]),void 0!==(r=e[n])){if(!(b4(r)===r&&r>=a[t+1]&&r<=a[t+2]))throw Error(m4+n+": "+r);this[n]=r}if(n="crypto",o&&(this[n]=p4[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(m4+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(g4);this[n]=!0}else this[n]=!1}return this}function p3(e){return new this(e).cos()}function f3(e){return new this(e).cosh()}function h3(e,t){return new this(e).div(t)}function m3(e){return new this(e).exp()}function v3(e){return O4(e=new this(e),e.e+1,3)}function g3(){var e,t,n=new this(0);for(f4=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return f4=!0,new this(1/0);n=t}return f4=!0,n.sqrt()}function y3(e){return e instanceof F3||e&&e.toStringTag===y4||!1}function b3(e){return new this(e).ln()}function w3(e,t){return new this(e).log(t)}function x3(e){return new this(e).log(2)}function C3(e){return new this(e).log(10)}function _3(){return U4(this,arguments,-1)}function E3(){return U4(this,arguments,1)}function S3(e,t){return new this(e).mod(t)}function k3(e,t){return new this(e).mul(t)}function T3(e,t){return new this(e).pow(t)}function N3(e){var t,n,r,o,a=0,i=new this(1),l=[];if(void 0===e?e=this.precision:A4(e,1,s4),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)(o=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:l[a++]=o%1e7;else{if(!crypto.randomBytes)throw Error(g4);for(t=crypto.randomBytes(r*=4);a<r;)(o=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(l.push(o%1e7),a+=4);a=r/4}else for(;a<r;)l[a++]=1e7*Math.random()|0;for(e%=7,(r=l[--a])&&e&&(o=w4(10,7-e),l[a]=(r/o|0)*o);0===l[a];a--)l.pop();if(a<0)n=0,l=[0];else{for(n=-1;0===l[0];n-=7)l.shift();for(r=1,o=l[0];o>=10;o/=10)r++;r<7&&(n-=7-r)}return i.e=n,i.d=l,i}function D3(e){return O4(e=new this(e),e.e+1,this.rounding)}function A3(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function I3(e){return new this(e).sin()}function R3(e){return new this(e).sinh()}function M3(e){return new this(e).sqrt()}function O3(e,t){return new this(e).sub(t)}function B3(){var e=0,t=arguments,n=new this(t[e]);for(f4=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return f4=!0,O4(n,this.precision,this.rounding)}function V3(e){return new this(e).tan()}function P3(e){return new this(e).tanh()}function L3(e){return O4(e=new this(e),e.e+1,1)}N4[Symbol.for("nodejs.util.inspect.custom")]=N4.toString,N4[Symbol.toStringTag]="Decimal";var F3=N4.constructor=function e(t){var n,r,o;function a(e){var t,n,r,o=this;if(!(o instanceof a))return new a(e);if(o.constructor=a,y3(e))return o.s=e.s,void(f4?!e.d||e.e>a.maxE?(o.e=NaN,o.d=null):e.e<a.minE?(o.e=0,o.d=[0]):(o.e=e.e,o.d=e.d.slice()):(o.e=e.e,o.d=e.d?e.d.slice():e.d));if("number"===(r=typeof e)){if(0===e)return o.s=1/e<0?-1:1,o.e=0,void(o.d=[0]);if(e<0?(e=-e,o.s=-1):o.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(f4?t>a.maxE?(o.e=NaN,o.d=null):t<a.minE?(o.e=0,o.d=[0]):(o.e=t,o.d=[e]):(o.e=t,o.d=[e]))}return 0*e!=0?(e||(o.s=NaN),o.e=NaN,void(o.d=null)):G4(o,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),o.s=-1):(43===n&&(e=e.slice(1)),o.s=1),E4.test(e)?G4(o,e):function(e,t){var n,r,o,a,i,l,s,c,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),E4.test(t))return G4(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(C4.test(t))n=16,t=t.toLowerCase();else if(x4.test(t))n=2;else{if(!_4.test(t))throw Error(m4+t);n=8}for((a=t.search(/p/i))>0?(s=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),i=(a=t.indexOf("."))>=0,r=e.constructor,i&&(a=(l=(t=t.replace(".","")).length)-a,o=j4(r,new r(n),a,2*a)),a=u=(c=R4(t,n,S4)).length-1;0===c[a];--a)c.pop();return a<0?new r(0*e.s):(e.e=V4(c,u),e.d=c,f4=!1,i&&(e=M4(e,o,4*l)),s&&(e=e.times(Math.abs(s)<54?w4(2,s):F3.pow(2,s))),f4=!0,e)}(o,e);if("bigint"===r)return e<0?(e=-e,o.s=-1):o.s=1,G4(o,e.toString());throw Error(m4+e)}if(a.prototype=N4,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=d3,a.clone=e,a.isDecimal=y3,a.abs=Q4,a.acos=e3,a.acosh=t3,a.add=n3,a.asin=r3,a.asinh=o3,a.atan=a3,a.atanh=i3,a.atan2=l3,a.cbrt=s3,a.ceil=c3,a.clamp=u3,a.cos=p3,a.cosh=f3,a.div=h3,a.exp=m3,a.floor=v3,a.hypot=g3,a.ln=b3,a.log=w3,a.log10=C3,a.log2=x3,a.max=_3,a.min=E3,a.mod=S3,a.mul=k3,a.pow=T3,a.random=N3,a.round=D3,a.sign=A3,a.sin=I3,a.sinh=R3,a.sqrt=M3,a.sub=O3,a.sum=B3,a.tan=V3,a.tanh=P3,a.trunc=L3,void 0===t&&(t={}),t&&!0!==t.defaults)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<o.length;)t.hasOwnProperty(r=o[n++])||(t[r]=this[r]);return a.config(t),a}(p4);u4=new F3(u4),d4=new F3(d4);var z3=k2("BigNumber",["?on","config"],(e=>{var{on:t,config:n}=e,r=F3.clone({precision:n.precision,modulo:F3.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})})),r}),{isClass:!0});const j3=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},$3=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},U3=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))},H3=function(){throw SyntaxError("Invalid Param")};function q3(e,t){const n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const W3={re:0,im:0},G3=function(e,t){const n=W3;if(null==e)n.re=n.im=0;else if(void 0!==t)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return Y3.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return Y3.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else 2===e.length?(n.re=e[0],n.im=e[1]):H3();break;case"string":n.im=n.re=0;const t=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let r=1,o=0;null===t&&H3();for(let e=0;e<t.length;e++){const a=t[e];" "===a||"\t"===a||"\n"===a||("+"===a?r++:"-"===a?o++:"i"===a||"I"===a?(r+o===0&&H3()," "===t[e+1]||isNaN(t[e+1])?n.im+=parseFloat((o%2?"-":"")+"1"):(n.im+=parseFloat((o%2?"-":"")+t[e+1]),e++),r=o=0):((r+o===0||isNaN(a))&&H3(),"i"===t[e+1]||"I"===t[e+1]?(n.im+=parseFloat((o%2?"-":"")+a),e++):n.re+=parseFloat((o%2?"-":"")+a),r=o=0))}r+o>0&&H3();break;case"number":n.im=0,n.re=e;break;default:H3()}return isNaN(n.re)||isNaN(n.im),n};function Y3(e,t){if(!(this instanceof Y3))return new Y3(e,t);const n=G3(e,t);this.re=n.re,this.im=n.im}Y3.prototype={re:0,im:0,sign:function(){const e=U3(this.re,this.im);return new Y3(this.re/e,this.im/e)},add:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im));return r||o?r&&o?Y3.NAN:Y3.INFINITY:new Y3(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im));return r||o?r&&o?Y3.NAN:Y3.INFINITY:new Y3(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im)),a=0===this.re&&0===this.im,i=0===n.re&&0===n.im;return r&&i||o&&a?Y3.NAN:r||o?Y3.INFINITY:0===n.im&&0===this.im?new Y3(this.re*n.re,0):new Y3(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im)),a=0===this.re&&0===this.im,i=0===n.re&&0===n.im;if(a&&i||r&&o)return Y3.NAN;if(i||r)return Y3.INFINITY;if(a||o)return Y3.ZERO;if(0===n.im)return new Y3(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){const e=n.re/n.im,t=n.re*e+n.im;return new Y3((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{const e=n.im/n.re,t=n.im*e+n.re;return new Y3((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){const n=G3(e,t),r=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return Y3.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new Y3(Math.pow(this.re,n.re),0);if(0===this.re)switch((n.re%4+4)%4){case 0:return new Y3(Math.pow(this.im,n.re),0);case 1:return new Y3(0,Math.pow(this.im,n.re));case 2:return new Y3(-Math.pow(this.im,n.re),0);case 3:return new Y3(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return Y3.ZERO;const o=Math.atan2(this.im,this.re),a=q3(this.re,this.im);let i=Math.exp(n.re*a-n.im*o),l=n.im*a+n.re*o;return new Y3(i*Math.cos(l),i*Math.sin(l))},sqrt:function(){const e=this.re,t=this.im;if(0===t)return e>=0?new Y3(Math.sqrt(e),0):new Y3(0,Math.sqrt(-e));const n=U3(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),o=Math.abs(t)/(2*r);return e>=0?new Y3(r,t<0?-o:o):new Y3(o,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return 0===this.im?new Y3(e,0):new Y3(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new Y3(Math.expm1(e)*Math.cos(t)+function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return 0===t&&e>0?new Y3(Math.log(e),0):new Y3(q3(e,t),Math.atan2(t,e))},abs:function(){return U3(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new Y3(Math.sin(e)*j3(t),Math.cos(e)*$3(t))},cos:function(){const e=this.re,t=this.im;return new Y3(Math.cos(e)*j3(t),-Math.sin(e)*$3(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+j3(t);return new Y3(Math.sin(e)/n,$3(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-j3(t);return new Y3(-Math.sin(e)/n,$3(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*j3(2*t)+.5*Math.cos(2*e);return new Y3(Math.cos(e)*j3(t)/n,Math.sin(e)*$3(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*j3(2*t)-.5*Math.cos(2*e);return new Y3(Math.sin(e)*j3(t)/n,-Math.cos(e)*$3(t)/n)},asin:function(){const e=this.re,t=this.im,n=new Y3(t*t-e*e+1,-2*e*t).sqrt(),r=new Y3(n.re-t,n.im+e).log();return new Y3(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new Y3(t*t-e*e+1,-2*e*t).sqrt(),r=new Y3(n.re-t,n.im+e).log();return new Y3(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(0===e){if(1===t)return new Y3(0,1/0);if(-1===t)return new Y3(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new Y3((1-t*t-e*e)/n,-2*e/n).log();return new Y3(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(0===t)return new Y3(Math.atan2(1,e),0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).atan():new Y3(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Y3(0,1/0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).acos():new Y3(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Y3(Math.PI/2,1/0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).asin():new Y3(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new Y3($3(e)*Math.cos(t),j3(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new Y3(j3(e)*Math.cos(t),$3(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=j3(e)+Math.cos(t);return new Y3($3(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=j3(e)-Math.cos(t);return new Y3($3(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-j3(2*e);return new Y3(-2*$3(e)*Math.cos(t)/n,2*j3(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+j3(2*e);return new Y3(2*j3(e)*Math.cos(t)/n,-2*$3(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&0===t,r=1-e,o=1+e,a=r*r+t*t,i=0!==a?new Y3((o*r-t*t)/a,(t*r+o*t)/a):new Y3(-1!==e?e/0:0,0!==t?t/0:0),l=i.re;return i.re=q3(i.re,i.im)/2,i.im=Math.atan2(i.im,l)/2,n&&(i.im=-i.im),i},acoth:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Y3(0,Math.PI/2);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).atanh():new Y3(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(0===t)return new Y3(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).asinh():new Y3(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return Y3.INFINITY;const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).acosh():new Y3(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Y3.INFINITY;if(this.isInfinite())return Y3.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new Y3(e/n,-t/n)},conjugate:function(){return new Y3(this.re,-this.im)},neg:function(){return new Y3(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Y3(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Y3(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Y3(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=G3(e,t);return Math.abs(n.re-this.re)<=Y3.EPSILON&&Math.abs(n.im-this.im)<=Y3.EPSILON},clone:function(){return new Y3(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<Y3.EPSILON&&(e=0),Math.abs(t)<Y3.EPSILON&&(t=0),0===t?n+e:(0!==e?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),1!==t&&(n+=t),n+"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()}},Y3.ZERO=new Y3(0,0),Y3.ONE=new Y3(1,0),Y3.I=new Y3(0,1),Y3.PI=new Y3(Math.PI,0),Y3.E=new Y3(Math.E,0),Y3.INFINITY=new Y3(1/0,1/0),Y3.NAN=new Y3(NaN,NaN),Y3.EPSILON=1e-15;var K3=k2("Complex",[],(()=>(Object.defineProperty(Y3,"name",{value:"Complex"}),Y3.prototype.constructor=Y3,Y3.prototype.type="Complex",Y3.prototype.isComplex=!0,Y3.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Y3.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Y3.prototype.format=function(e){var t=this.im,n=this.re,r=P2(this.re,e),o=P2(this.im,e),a=T1(e)?e:e?e.precision:null;if(null!==a){var i=Math.pow(10,-a);Math.abs(n/t)<i&&(n=0),Math.abs(t/n)<i&&(t=0)}return 0===t?r:0===n?1===t?"i":-1===t?"-i":o+"i":t<0?-1===t?r+" - i":r+" - "+o.substring(1)+"i":1===t?r+" + i":r+" + "+o+"i"},Y3.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return Y3(t);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(T1(n)){if(R1(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),T1(r))return new Y3({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Y3.prototype.valueOf=Y3.prototype.toString,Y3.fromJSON=function(e){return new Y3(e)},Y3.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},Y3)),{isClass:!0}),X3={s:1,n:0,d:1};function J3(e,t){if(isNaN(e=parseInt(e,10)))throw o6();return e*t}function Z3(e,t){if(0===t)throw r6();var n=Object.create(n6.prototype);n.s=e<0?-1:1;var r=t6(e=e<0?-e:e,t);return n.n=e/r,n.d=t/r,n}function Q3(e){for(var t={},n=e,r=2,o=4;o<=n;){for(;n%r===0;)n/=r,t[r]=(t[r]||0)+1;o+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var e6=function(e,t){var n,r=0,o=1,a=1,i=0,l=0,s=0,c=1,u=1,d=0,p=1,f=1,h=1,m=1e7;if(null==e);else if(void 0!==t){if(a=(r=e)*(o=t),r%1!=0||o%1!=0)throw a6()}else switch(typeof e){case"object":if("d"in e&&"n"in e)r=e.n,o=e.d,"s"in e&&(r*=e.s);else{if(!(0 in e))throw o6();r=e[0],1 in e&&(o=e[1])}a=r*o;break;case"number":if(e<0&&(a=e,e=-e),e%1==0)r=e;else if(e>0){for(e>=1&&(e/=u=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));p<=m&&h<=m;){if(e===(n=(d+f)/(p+h))){p+h<=m?(r=d+f,o=p+h):h>p?(r=f,o=h):(r=d,o=p);break}e>n?(d+=f,p+=h):(f+=d,h+=p),p>m?(r=f,o=h):(r=d,o=p)}r*=u}else(isNaN(e)||isNaN(t))&&(o=r=NaN);break;case"string":if(null===(p=e.match(/\d+|./g)))throw o6();if("-"===p[d]?(a=-1,d++):"+"===p[d]&&d++,p.length===d+1?l=J3(p[d++],a):"."===p[d+1]||"."===p[d]?("."!==p[d]&&(i=J3(p[d++],a)),(++d+1===p.length||"("===p[d+1]&&")"===p[d+3]||"'"===p[d+1]&&"'"===p[d+3])&&(l=J3(p[d],a),c=Math.pow(10,p[d].length),d++),("("===p[d]&&")"===p[d+2]||"'"===p[d]&&"'"===p[d+2])&&(s=J3(p[d+1],a),u=Math.pow(10,p[d+1].length)-1,d+=3)):"/"===p[d+1]||":"===p[d+1]?(l=J3(p[d],a),c=J3(p[d+2],1),d+=3):"/"===p[d+3]&&" "===p[d+1]&&(i=J3(p[d],a),l=J3(p[d+2],a),c=J3(p[d+4],1),d+=5),p.length<=d){a=r=s+(o=c*u)*i+u*l;break}default:throw o6()}if(0===o)throw r6();X3.s=a<0?-1:1,X3.n=Math.abs(r),X3.d=Math.abs(o)};function t6(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function n6(e,t){if(e6(e,t),!(this instanceof n6))return Z3(X3.s*X3.n,X3.d);e=t6(X3.d,X3.n),this.s=X3.s,this.n=X3.n/e,this.d=X3.d/e}var r6=function(){return new Error("Division by Zero")},o6=function(){return new Error("Invalid argument")},a6=function(){return new Error("Parameters must be integer")};n6.prototype={s:1,n:0,d:1,abs:function(){return Z3(this.n,this.d)},neg:function(){return Z3(-this.s*this.n,this.d)},add:function(e,t){return e6(e,t),Z3(this.s*this.n*X3.d+X3.s*this.d*X3.n,this.d*X3.d)},sub:function(e,t){return e6(e,t),Z3(this.s*this.n*X3.d-X3.s*this.d*X3.n,this.d*X3.d)},mul:function(e,t){return e6(e,t),Z3(this.s*X3.s*this.n*X3.n,this.d*X3.d)},div:function(e,t){return e6(e,t),Z3(this.s*X3.s*this.n*X3.d,this.d*X3.n)},clone:function(){return Z3(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new n6(NaN);if(void 0===e)return Z3(this.s*this.n%this.d,1);if(e6(e,t),0===X3.n&&0===this.d)throw r6();return Z3(this.s*(X3.d*this.n)%(X3.n*this.d),X3.d*this.d)},gcd:function(e,t){return e6(e,t),Z3(t6(X3.n,this.n)*t6(X3.d,this.d),X3.d*this.d)},lcm:function(e,t){return e6(e,t),0===X3.n&&0===this.n?Z3(0,1):Z3(X3.n*this.n,t6(X3.n,this.n)*t6(X3.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new n6(NaN):Z3(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new n6(NaN):Z3(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new n6(NaN):Z3(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return e6(e,t),Z3(this.s*Math.round(this.n*X3.d/(this.d*X3.n))*X3.n,X3.d)},inverse:function(){return Z3(this.s*this.d,this.n)},pow:function(e,t){if(e6(e,t),1===X3.d)return X3.s<0?Z3(Math.pow(this.s*this.d,X3.n),Math.pow(this.n,X3.n)):Z3(Math.pow(this.s*this.n,X3.n),Math.pow(this.d,X3.n));if(this.s<0)return null;var n=Q3(this.n),r=Q3(this.d),o=1,a=1;for(var i in n)if("1"!==i){if("0"===i){o=0;break}if(n[i]*=X3.n,n[i]%X3.d!==0)return null;n[i]/=X3.d,o*=Math.pow(i,n[i])}for(var i in r)if("1"!==i){if(r[i]*=X3.n,r[i]%X3.d!==0)return null;r[i]/=X3.d,a*=Math.pow(i,r[i])}return X3.s<0?Z3(a,o):Z3(o,a)},equals:function(e,t){return e6(e,t),this.s*this.n*X3.d===X3.s*X3.n*this.d},compare:function(e,t){e6(e,t);var n=this.s*this.n*X3.d-X3.s*X3.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),r=1;r<n.length;r++){for(var o=Z3(n[r-1],1),a=r-2;a>=0;a--)o=o.inverse().add(n[a]);if(Math.abs(o.sub(t).valueOf())<e)return o.mul(this.s)}return this},divisible:function(e,t){return e6(e,t),!(!(X3.n*this.d)||this.n*X3.d%(X3.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,o=this.d;return this.s<0&&(n+="-"),1===o?n+=r:(e&&(t=Math.floor(r/o))>0&&(n+=t,n+=" ",r%=o),n+=r,n+="/",n+=o),n},toLatex:function(e){var t,n="",r=this.n,o=this.d;return this.s<0&&(n+="-"),1===o?n+=r:(e&&(t=Math.floor(r/o))>0&&(n+=t,r%=o),n+="\\frac{",n+=r,n+="}{",n+=o,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do{r.push(Math.floor(t/n)),e=t%n,t=n,n=e}while(1!==t);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var n=10%t,r=1;1!==n;r++)if(n=10*n%t,r>2e3)return 0;return r}(0,n),o=function(e,t,n){for(var r=1,o=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,n,t),a=0;a<300;a++){if(r===o)return a;r=10*r%t,o=10*o%t}return 0}(0,n,r),a=this.s<0?"-":"";if(a+=t/n|0,t%=n,(t*=10)&&(a+="."),r){for(var i=o;i--;)a+=t/n|0,t%=n,t*=10;a+="(";for(i=r;i--;)a+=t/n|0,t%=n,t*=10;a+=")"}else for(i=e;t&&i--;)a+=t/n|0,t%=n,t*=10;return a}};var i6=k2("Fraction",[],(()=>(Object.defineProperty(n6,"name",{value:"Fraction"}),n6.prototype.constructor=n6,n6.prototype.type="Fraction",n6.prototype.isFraction=!0,n6.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},n6.fromJSON=function(e){return new n6(e)},n6)),{isClass:!0}),l6=k2("Range",[],(()=>{function e(t,n,r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var o=null!=t,a=null!=n,i=null!=r;if(o)if(N1(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(a)if(N1(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter end must be a number");if(i)if(N1(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter step must be a number");this.start=o?parseFloat(t):0,this.end=a?parseFloat(n):0,this.step=i?parseFloat(r):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var n=t.split(":").map((function(e){return parseFloat(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[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,n=this.step,r=this.end-t;return A2(n)===A2(r)?e=Math.ceil(r/n):0===r&&(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,n=this.step,r=this.end,o=0;if(n>0)for(;t<r;)e(t,[o],this),t+=n,o++;else if(n<0)for(;t>r;)e(t,[o],this),t+=n,o++},e.prototype.map=function(e){var t=[];return this.forEach((function(n,r,o){t[r[0]]=e(n,r,o)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,n){e[n[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=P2(this.start,e);return 1!==this.step&&(t+=":"+P2(this.step,e)),t+=":"+P2(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}),s6=k2("Matrix",[],(()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0});function c6(e,t,n){var r=new(0,e.constructor)(2),o="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!N2(n))throw new Error("size must be an integer");if(e.greaterThan(r.pow(n-1).sub(1))||e.lessThan(r.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(r.pow(n))),o="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function u6(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:r,wordSize:o}=L2(t);switch(n){case"fixed":return function(e,t){return e.toFixed(t)}(e,r);case"exponential":return d6(e,r);case"engineering":return function(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,o=e.mul(Math.pow(10,-r)),a=o.toPrecision(t);if(a.includes("e")){a=new(0,e.constructor)(a).toFixed()}return a+"e"+(n>=0?"+":"")+r.toString()}(e,r);case"bin":return c6(e,2,o);case"oct":return c6(e,8,o);case"hex":return c6(e,16,o);case"auto":var a=p6(null==t?void 0:t.lowerExp,-3),i=p6(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";var l=e.toSignificantDigits(r),s=l.e;return(s>=a&&s<i?l.toFixed():d6(e,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function d6(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function p6(e,t){return T1(e)?e:N1(e)?e.toNumber():t}function f6(e,t){var n=e.length-t.length,r=e.length;return e.substring(n,r)===t}function h6(e,t){var n=function(e,t){if("number"==typeof e)return P2(e,t);if(N1(e))return u6(e,t);if(function(e){return e&&"object"==typeof e&&"number"==typeof e.s&&"number"==typeof e.n&&"number"==typeof e.d||!1}(e))return t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d;if(Array.isArray(e))return y6(e,t);if(M1(e))return m6(e);if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e){return"function"==typeof e.format?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):"{"+Object.keys(e).map((n=>m6(n)+": "+h6(e[n],t))).join(", ")+"}"}return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function m6(e){for(var t=String(e),n="",r=0;r<t.length;){var o=t.charAt(r);n+=o in v6?v6[o]:o,r++}return'"'+n+'"'}var v6={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function g6(e){var t=String(e);return t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function y6(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,o=0;o<r;o++)0!==o&&(n+=", "),n+=y6(e[o],t);return n+="]"}return h6(e,t)}function b6(e,t){if(!M1(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+m2(e)+", index: 0)");if(!M1(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+m2(t)+", index: 1)");return e===t?0:e>t?1:-1}function w6(e,t,n){if(!(this instanceof w6))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function x6(e,t,n){if(!(this instanceof x6))throw new 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=n),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=(new Error).stack}function C6(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function _6(e,t,n){var r,o=e.length;if(o!==t[n])throw new w6(o,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<o;r++){var i=e[r];if(!Array.isArray(i))throw new w6(t.length-1,t.length,"<");_6(e[r],t,a)}}else for(r=0;r<o;r++)if(Array.isArray(e[r]))throw new w6(t.length+1,t.length,">")}function E6(e,t){if(0===t.length){if(Array.isArray(e))throw new w6(e.length,0)}else _6(e,t,0)}function S6(e,t){var n=e.isMatrix?e._size:C6(e);t._sourceSize.forEach(((e,t)=>{if(null!==e&&e!==n[t])throw new w6(e,n[t])}))}function k6(e,t){if(void 0!==e){if(!T1(e)||!N2(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new x6(e,t)}}function T6(e){for(var t=0;t<e._dimensions.length;++t){var n=e._dimensions[t];if(n._data&&O1(n._data)){if(0===n._size[0])return!0}else if(n.isRange){if(n.start===n.end)return!0}else if(M1(n)&&0===n.length)return!0}return!1}function N6(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach((function(e){if(!T1(e)||!N2(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+h6(t)+")")})),(T1(e)||N1(e))&&(e=[e]),D6(e,t,0,void 0!==n?n:0),e}function D6(e,t,n,r){var o,a,i=e.length,l=t[n],s=Math.min(i,l);if(e.length=l,n<t.length-1){var c=n+1;for(o=0;o<s;o++)a=e[o],Array.isArray(a)||(a=[a],e[o]=a),D6(a,t,c,r);for(o=s;o<l;o++)a=[],e[o]=a,D6(a,t,c,r)}else{for(o=0;o<s;o++)for(;Array.isArray(e[o]);)e[o]=e[o][0];for(o=s;o<l;o++)e[o]=r}}function A6(e,t){var n=P6(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new w6(0,r,"!=");var o=R6(t=I6(t,r));if(r!==o)throw new w6(o,r,"!=");try{return function(e,t){for(var n,r=e,o=t.length-1;o>0;o--){var a=t[o];n=[];for(var i=r.length/a,l=0;l<i;l++)n.push(r.slice(l*a,(l+1)*a));r=n}return r}(n,t)}catch(HT){if(HT instanceof w6)throw new w6(o,r,"!=");throw HT}}function I6(e,t){var n=R6(e),r=e.slice(),o=e.indexOf(-1);if(e.indexOf(-1,o+1)>=0)throw new Error("More than one wildcard in sizes");if(o>=0){if(!(t%n===0))throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);r[o]=-t/n}return r}function R6(e){return e.reduce(((e,t)=>e*t),1)}function M6(e,t){for(var n=C6(e);Array.isArray(e)&&1===e.length;)e=e[0],n.shift();for(var r=n.length;1===n[r-1];)r--;return r<n.length&&(e=O6(e,r,0),n.length=r),e}function O6(e,t,n){var r,o;if(n<t){var a=n+1;for(r=0,o=e.length;r<o;r++)e[r]=O6(e[r],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function B6(e,t,n,r){var o=r||C6(e);if(n)for(var a=0;a<n;a++)e=[e],o.unshift(1);for(e=V6(e,t,0);o.length<t;)o.push(1);return e}function V6(e,t,n){var r,o;if(Array.isArray(e)){var a=n+1;for(r=0,o=e.length;r<o;r++)e[r]=V6(e[r],t,a)}else for(var i=n;i<t;i++)e=[e];return e}function P6(e){if(!Array.isArray(e))return e;var t=[];return e.forEach((function e(n){Array.isArray(n)?n.forEach(e):t.push(n)})),t}function L6(e,t){return Array.prototype.map.call(e,t)}function F6(e,t){Array.prototype.forEach.call(e,t)}function z6(e,t){if(1!==C6(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function j6(e,t){if(1!==C6(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(e=>t.test(e)))}function $6(e,t){return Array.prototype.join.call(e,t)}function U6(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],n=0;t[0]={value:e[0],identifier:0};for(var r=1;r<e.length;r++)e[r]===e[r-1]?n++:n=0,t.push({value:e[r],identifier:n});return t}function H6(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],n=0;n<e.length;n++)t.push(e[n].value);return t}function q6(e,t){for(var n,r=0,o=0;o<e.length;o++){var a=e[o],i=Array.isArray(a);if(0===o&&i&&(r=a.length),i&&a.length!==r)return;var l=i?q6(a,t):t(a);if(void 0===n)n=l;else if(n!==l)return"mixed"}return n}function W6(e,t,n,r){if(r<n){if(e.length!==t.length)throw new w6(e.length,t.length);for(var o=[],a=0;a<e.length;a++)o[a]=W6(e[a],t[a],n,r+1);return o}return e.concat(t)}function G6(){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,n){return W6(e,n,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function Y6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map((e=>e.length)),o=Math.max(...r),a=new Array(o).fill(null),i=0;i<t.length;i++)for(var l=t[i],s=r[i],c=0;c<s;c++){var u=o-s+c;l[c]>a[u]&&(a[u]=l[c])}for(var d=0;d<t.length;d++)K6(t[d],a);return a}function K6(e,t){for(var n=t.length,r=e.length,o=0;o<r;o++){var a=n-r+o;if(e[o]<t[a]&&e[o]>1||e[o]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[o]," to size ").concat(t[a]))}}function X6(e,t){var n=C6(e);if(y2(n,t))return e;K6(n,t);var r,o,a,i=Y6(n,t),l=i.length,s=[...Array(l-n.length).fill(1),...n],c=function(e){return h1([],e)}(e);n.length<l&&(n=C6(c=A6(c,s)));for(var u=0;u<l;u++)n[u]<i[u]&&(r=c,o=i[u],a=u,n=C6(c=G6(...Array(o).fill(r),a)));return c}function J6(e,t){if(!Array.isArray(e))throw new Error("Array expected");var n=C6(e);if(t.length!==n.length)throw new w6(t.length,n.length);for(var r=0;r<t.length;r++)k6(t[r],n[r]);return t.reduce(((e,t)=>e[t]),e)}function Z6(e,t,n,r,o){if(S2.isTypedFunction(e)){var a=[t,n,r],i=S2.resolve(e,a);if(i)return d(i.implementation,a);var l=[t,n],s=S2.resolve(e,l);if(s)return d(s.implementation,l);var c=[t],u=S2.resolve(e,c);return u?d(u.implementation,c):d(e,a)}return e(t,n,r);function d(a,i){try{return a.apply(a,i)}catch(c){var l;if(c instanceof TypeError&&"wrongType"===(null===(l=c.data)||void 0===l?void 0:l.category)){var s=[];throw s.push("value: ".concat(m2(t))),i.length>=2&&s.push("index: ".concat(m2(n))),i.length>=3&&s.push("array: ".concat(m2(r))),new TypeError("Function ".concat(o," cannot apply callback arguments ")+"".concat(e.name,"(").concat(s.join(", "),") at index ").concat(JSON.stringify(n)))}throw new TypeError("Function ".concat(o," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(c.message))}}}w6.prototype=new RangeError,w6.prototype.constructor=RangeError,w6.prototype.name="DimensionError",w6.prototype.isDimensionError=!0,x6.prototype=new RangeError,x6.prototype.constructor=RangeError,x6.prototype.name="IndexError",x6.prototype.isIndexError=!0;var Q6=k2("DenseMatrix",["Matrix"],(e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M1(t))throw new Error("Invalid datatype: "+t);if(B1(e))"DenseMatrix"===e.type?(this._data=v2(e._data),this._size=v2(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&O1(e.data)&&O1(e.size))this._data=e.data,this._size=e.size,E6(this._data,this._size),this._datatype=t||e.datatype;else if(O1(e))this._data=l(e),this._size=C6(this._data),E6(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+m2(e)+")");this._data=[],this._size=[0],this._datatype=t}}function r(e,t,n,o){var a=o===n-1,i=t.dimension(o);return a?i.map((function(t){return k6(t,e.length),e[t]})).valueOf():i.map((function(a){return k6(a,e.length),r(e[a],t,n,o+1)})).valueOf()}function o(e,t,n,r,a){var i=a===r-1,l=t.dimension(a);i?l.forEach((function(t,r){k6(t),e[t]=n[r[0]]})):l.forEach((function(i,l){k6(i),o(e[i],t,n[l[0]],r,a+1)}))}function a(e,t,n){if(0===t.length){for(var r=e._data;O1(r);)r=r[0];return r}return e._size=t.slice(0),e._data=N6(e._data,e._size,n),e}function i(e,t,n){for(var r=e._size.slice(0),o=!1;r.length<t.length;)r.push(0),o=!0;for(var i=0,l=t.length;i<l;i++)t[i]>r[i]&&(r[i]=t[i],o=!0);o&&a(e,r,n)}function l(e){return B1(e)?l(e.valueOf()):O1(e)?e.map(l):e}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 q6(this._data,m2)},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,a){switch(arguments.length){case 1:return function(e,t){if(!z1(t))throw new TypeError("Invalid index");var o=t.isScalar();if(o)return e.get(t.min());var a=t.size();if(a.length!==e._size.length)throw new w6(a.length,e._size.length);for(var i=t.min(),l=t.max(),s=0,c=e._size.length;s<c;s++)k6(i[s],e._size[s]),k6(l[s],e._size[s]);return new n(r(e._data,t,a.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var a,l=t.size(),s=t.isScalar();B1(n)?(a=n.size(),n=n.valueOf()):a=C6(n);if(s){if(0!==a.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(!y2(a,l))try{a=C6(n=0===a.length?X6([n],l):X6(n,l))}catch(f){}if(l.length<e._size.length)throw new w6(l.length,e._size.length,"<");if(a.length<l.length){for(var c=0,u=0;1===l[c]&&1===a[c];)c++;for(;1===l[c];)u++,c++;n=B6(n,l.length,u,a)}if(!y2(l,a))throw new w6(l,a,">");i(e,t.max().map((function(e){return e+1})),r);var d=l.length,p=0;o(e._data,t,n,d,p)}return e}(this,e,t,a);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){return J6(this._data,e)},n.prototype.set=function(e,t,n){if(!O1(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new w6(e.length,this._size.length,"<");var r,o,a;i(this,e.map((function(e){return e+1})),n);var l=this._data;for(r=0,o=e.length-1;r<o;r++)k6(a=e[r],l.length),l=l[a];return k6(a=e[e.length-1],l.length),l[a]=t,this},n.prototype.resize=function(e,t,n){if(!V1(e))throw new TypeError("Array or Matrix expected");var r=e.valueOf().map((e=>Array.isArray(e)&&1===e.length?e[0]:e));return a(n?this.clone():this,r,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;n._data=A6(n._data,e);var r=n._size.reduce(((e,t)=>e*t));return n._size=I6(e,r),n},n.prototype.clone=function(){return new n({data:v2(this._data),size:v2(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function(n,o){return O1(n)?n.map((function(e,t){return r(e,o.concat(t))})):Z6(e,n,o,t,"map")},o=r(this._data,[]);return new n(o,void 0!==this._datatype?q6(o,m2):void 0)},n.prototype.forEach=function(e){var t=this,n=function(r,o){O1(r)?r.forEach((function(e,t){n(e,o.concat(t))})):e(r,o,t)};n(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function*(t,n){if(O1(t))for(var r=0;r<t.length;r++)yield*e(t[r],n.concat(r));else yield{value:t,index:n}};yield*e(this._data,[])},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t=this._data;for(var r of t)e.push(new n([r],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var o=this._data,a=function(r){var a=o.map((e=>[e[r]]));t.push(new n(a,e._datatype))},i=0;i<r[1];i++)a(i);return t},n.prototype.toArray=function(){return v2(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return h6(this._data,e)},n.prototype.toString=function(){return h6(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(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-r,a-t),l=[],s=0;s<i;s++)l[s]=this._data[s+r][s+t];return new n({data:l,size:[i],datatype:this._datatype})},n.diagonal=function(e,t,r,o){if(!O1(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e)||e<1)throw new Error("Size values must be positive integers");return e})),r){if(N1(r)&&(r=r.toNumber()),!T1(r)||!N2(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var a,i=r>0?r:0,l=r<0?-r:0,s=e[0],c=e[1],u=Math.min(s-l,c-i);if(O1(t)){if(t.length!==u)throw new Error("Invalid value array length");a=function(e){return t[e]}}else if(B1(t)){var d=t.size();if(1!==d.length||d[0]!==u)throw new Error("Invalid matrix length");a=function(e){return t.get([e])}}else a=function(){return t};o||(o=N1(a(0))?a(0).mul(0):0);var p=[];if(e.length>0){p=N6(p,e,o);for(var f=0;f<u;f++)p[f+l][f+i]=a(f)}return new n({data:p,size:[s,c]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!(T1(e)&&N2(e)&&T1(t)&&N2(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return k6(e,this._size[0]),k6(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r},n}),{isClass:!0}),e8="clone",t8=k2(e8,["typed"],(e=>{var{typed:t}=e;return t(e8,{any:v2})}));function n8(e){var t,n,r=e.length,o=e[0].length,a=[];for(n=0;n<o;n++){var i=[];for(t=0;t<r;t++)i.push(e[t][n]);a.push(i)}return a}function r8(e){for(var t=0;t<e.length;t++)if(V1(e[t]))return!0;return!1}function o8(e,t){B1(e)&&(e=e.valueOf());for(var n=0,r=e.length;n<r;n++){var o=e[n];Array.isArray(o)?o8(o,t):t(o)}}function a8(e,t,n){return e&&"function"==typeof e.map?e.map((function(e){return a8(e,t)})):t(e)}function i8(e,t,n){var r=Array.isArray(e)?C6(e):e.size();if(t<0||t>=r.length)throw new x6(t,r.length);return B1(e)?e.create(l8(e.valueOf(),t,n),e.datatype()):l8(e,t,n)}function l8(e,t,n){var r,o,a,i;if(t<=0){if(Array.isArray(e[0])){for(i=n8(e),o=[],r=0;r<i.length;r++)o[r]=l8(i[r],t-1,n);return o}for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}for(o=[],r=0;r<e.length;r++)o[r]=l8(e[r],t-1,n);return o}function s8(e,t,n,r,o,a,i,l,s,c,u){var d,p,f,h,m=e._values,v=e._index,g=e._ptr;if(r)for(p=g[t],f=g[t+1],d=p;d<f;d++)n[h=v[d]]!==a?(n[h]=a,i.push(h),r[h]=m[d]):(r[h]=l(r[h],m[d]),o[h]=a);else for(p=g[t],f=g[t+1],d=p;d<f;d++)n[h=v[d]]!==a?(n[h]=a,i.push(h)):o[h]=a}var c8="isInteger",u8=k2(c8,["typed"],(e=>{var{typed:t}=e;return t(c8,{number:N2,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),d8="number",p8="number, number";function f8(e){return Math.abs(e)}function h8(e,t){return e+t}function m8(e,t){return e-t}function v8(e,t){return e*t}function g8(e){return-e}function y8(e){return e}function b8(e){return O2(e)}function w8(e){return e*e*e}function x8(e){return Math.exp(e)}function C8(e){return B2(e)}function _8(e,t){if(!N2(e)||!N2(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var n,r=e*t;0!==t;)t=e%(n=t),e=n;return Math.abs(r/e)}function E8(e){return R2(e)}function S8(e){return I2(e)}function k8(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t<0;if(n&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return n?1/0:0;if(!isFinite(e))return n?0:e;var r=Math.pow(Math.abs(e),1/t);return r=e<0?-r:r,n?1/r:r}function T8(e){return A2(e)}function N8(e){return e*e}function D8(e,t){var n,r,o,a=0,i=1,l=1,s=0;if(!N2(e)||!N2(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)o=e-(r=Math.floor(e/t))*t,n=a,a=i-r*a,i=n,n=l,l=s-r*l,s=n,e=t,t=o;return e<0?[-e,-i,-s]:[e,e?i:0,s]}function A8(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function I8(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!N2(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(z2(e,t))}f8.signature=d8,h8.signature=p8,m8.signature=p8,v8.signature=p8,g8.signature=d8,y8.signature=d8,b8.signature=d8,w8.signature=d8,x8.signature=d8,C8.signature=d8,_8.signature=p8,E8.signature=d8,S8.signature=d8,T8.signature=d8,N8.signature=d8,D8.signature=p8,A8.signature=p8;var R8="number, number";function M8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function bitAnd");return e&t}function O8(e){if(!N2(e))throw new Error("Integer expected in function bitNot");return~e}function B8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function bitOr");return e|t}function V8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function bitXor");return e^t}function P8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function leftShift");return e<<t}function L8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function F8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}function z8(e,t){if(t<e)return 1;if(t===e)return t;var n=t+e>>1;return z8(e,n)*z8(n+1,t)}function j8(e,t){if(!N2(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!N2(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var n=e-t,r=1,o=2,a=t<n?t:n,i=t<n?n+1:t+1;i<=e;++i)for(r*=i;o<=a&&r%o===0;)r/=o,++o;return o<=a&&(r/=z8(o,a)),r}M8.signature=R8,O8.signature="number",B8.signature=R8,V8.signature=R8,P8.signature=R8,L8.signature=R8,F8.signature=R8,j8.signature="number, number";var $8=Math.PI,U8=2*Math.PI,H8=Math.E,q8="number, number";function W8(e){return!e}function G8(e,t){return!(!e&&!t)}function Y8(e,t){return!!e!=!!t}function K8(e,t){return!(!e||!t)}function X8(e){var t;if(N2(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:z8(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*X8(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,o=r*e,a=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*o)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=Z8[0];for(var i=1;i<Z8.length;++i)t+=Z8[i]/(e+i);var l=e+J8+.5;return Math.sqrt(2*Math.PI)*Math.pow(l,e+.5)*Math.exp(-l)*t}W8.signature="number",G8.signature=q8,Y8.signature=q8,K8.signature=q8,X8.signature="number";var J8=4.7421875,Z8=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Q8=.9189385332046728,e5=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function t5(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-t5(1-e);for(var t=(e-=1)+5+.5,n=e5[0],r=6;r>=1;r--)n+=e5[r]/(e+r);return Q8+(e+.5)*Math.log(t)-t+Math.log(n)}t5.signature="number";var n5="number";function r5(e){return q2(e)}function o5(e){return Math.atan(1/e)}function a5(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function i5(e){return Math.asin(1/e)}function l5(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function s5(e){return Math.acos(1/e)}function c5(e){var t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}function u5(e){return W2(e)}function d5(e){return G2(e)}function p5(e){return 1/Math.tan(e)}function f5(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function h5(e){return 1/Math.sin(e)}function m5(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*A2(e)}function v5(e){return 1/Math.cos(e)}function g5(e){return 2/(Math.exp(e)+Math.exp(-e))}function y5(e){return K2(e)}r5.signature=n5,o5.signature=n5,a5.signature=n5,i5.signature=n5,l5.signature=n5,s5.signature=n5,c5.signature=n5,u5.signature=n5,d5.signature=n5,p5.signature=n5,f5.signature=n5,h5.signature=n5,m5.signature=n5,v5.signature=n5,g5.signature=n5,y5.signature=n5;var b5="number";function w5(e){return e<0}function x5(e){return e>0}function C5(e){return Number.isNaN(e)}function _5(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new 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(n),r)):e.eq(t))}w5.signature=b5,x5.signature=b5,C5.signature=b5;var E5="isNegative",S5=k2(E5,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(E5,{number:e=>!H2(e,0,n.relTol,n.absTol)&&w5(e),BigNumber:e=>!_5(e,new e.constructor(0),n.relTol,n.absTol)&&(e.isNeg()&&!e.isZero()&&!e.isNaN()),bigint:e=>e<0n,Fraction:e=>e.s<0,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),k5="isNumeric",T5=k2(k5,["typed"],(e=>{var{typed:t}=e;return t(k5,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),N5="hasNumericValue",D5=k2(N5,["typed","isNumeric"],(e=>{var{typed:t,isNumeric:n}=e;return t(N5,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})})),A5="isPositive",I5=k2(A5,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(A5,{number:e=>!H2(e,0,n.relTol,n.absTol)&&x5(e),BigNumber:e=>!_5(e,new e.constructor(0),n.relTol,n.absTol)&&(!e.isNeg()&&!e.isZero()&&!e.isNaN()),bigint:e=>e>0n,Fraction:e=>e.s>0&&e.n>0,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),R5="isZero",M5=k2(R5,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(R5,{"number | BigNumber | Complex | Fraction":e=>n(e,0),bigint:e=>0n===e,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),O5="isNaN",B5=k2(O5,["typed"],(e=>{var{typed:t}=e;return t(O5,{number:C5,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=>a8(t,e)))})})),V5="typeOf",P5=k2(V5,["typed"],(e=>{var{typed:t}=e;return t(V5,{any:m2})}));var L5=k2("compareUnits",["typed"],(e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf((e=>(n,r)=>{if(!n.equalBase(r))throw new Error("Cannot compare units with different base");return t.find(e,[n.valueType(),r.valueType()])(n.value,r.value)}))}})),F5="equalScalar",z5=k2(F5,["typed","config"],(e=>{var{typed:t,config:n}=e,r=L5({typed:t});return t(F5,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return H2(e,t,n.relTol,n.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||_5(e,t,n.relTol,n.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,n,r){return H2(e.re,t.re,n,r)&&H2(e.im,t.im,n,r)}(e,t,n.relTol,n.absTol)}},r)}));k2(F5,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(F5,{"number, number":function(e,t){return H2(e,t,n.relTol,n.absTol)}})}));var j5=k2("SparseMatrix",["typed","equalScalar","Matrix"],(e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M1(t))throw new Error("Invalid datatype: "+t);if(B1(e))!function(e,t,n){"SparseMatrix"===t.type?(e._values=t._values?v2(t._values):void 0,e._index=v2(t._index),e._ptr=v2(t._ptr),e._size=v2(t._size),e._datatype=n||t._datatype):a(e,t.valueOf(),n||t._datatype)}(this,e,t);else if(e&&O1(e.index)&&O1(e.ptr)&&O1(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(O1(e))a(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+m2(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function a(e,r,o){e._values=[],e._index=[],e._ptr=[],e._datatype=o;var a=r.length,i=0,l=n,s=0;if(M1(o)&&(l=t.find(n,[o,o])||n,s=t.convert(0,o)),a>0){var c=0;do{e._ptr.push(e._index.length);for(var u=0;u<a;u++){var d=r[u];if(O1(d)){if(0===c&&i<d.length&&(i=d.length),c<d.length){var p=d[c];l(p,s)||(e._values.push(p),e._index.push(u))}}else 0===c&&i<1&&(i=1),l(d,s)||(e._values.push(d),e._index.push(u))}c++}while(c<i)}e._ptr.push(e._index.length),e._size=[a,i]}function i(e,t,n,r){if(n-t===0)return n;for(var o=t;o<n;o++)if(r[o]===e)return o;return t}function l(e,t,n,r,o,a,i){o.splice(e,0,r),a.splice(e,0,t);for(var l=n+1;l<i.length;l++)i[l]++}function s(e,r,o,a){var i=a||0,l=n,s=0;M1(e._datatype)&&(l=t.find(n,[e._datatype,e._datatype])||n,s=t.convert(0,e._datatype),i=t.convert(i,e._datatype));var c,u,d,p=!l(i,s),f=e._size[0],h=e._size[1];if(o>h){for(u=h;u<o;u++)if(e._ptr[u]=e._values.length,p)for(c=0;c<f;c++)e._values.push(i),e._index.push(c);e._ptr[o]=e._values.length}else o<h&&(e._ptr.splice(o+1,h-o),e._values.splice(e._ptr[o],e._values.length),e._index.splice(e._ptr[o],e._index.length));if(h=o,r>f){if(p){var m=0;for(u=0;u<h;u++){e._ptr[u]=e._ptr[u]+m,d=e._ptr[u+1]+m;var v=0;for(c=f;c<r;c++,v++)e._values.splice(d+v,0,i),e._index.splice(d+v,0,c),m++}e._ptr[h]=e._values.length}}else if(r<f){var g=0;for(u=0;u<h;u++){e._ptr[u]=e._ptr[u]-g;var y=e._ptr[u],b=e._ptr[u+1]-g;for(d=y;d<b;d++)(c=e._index[d])>r-1&&(e._values.splice(d,1),e._index.splice(d,1),g++)}e._ptr[u]=e._values.length}return e._size[0]=r,e._size[1]=o,e}function c(e,t,n,r,o){var a,i,l=r[0],s=r[1],c=[];for(a=0;a<l;a++)for(c[a]=[],i=0;i<s;i++)c[a][i]=0;for(i=0;i<s;i++)for(var u=n[i],d=n[i+1],p=u;p<d;p++)c[a=t[p]][i]=e?o?v2(e[p]):e[p]:1;return c}return o.prototype=new r,o.prototype.createSparseMatrix=function(e,t){return new o(e,t)},Object.defineProperty(o,"name",{value:"SparseMatrix"}),o.prototype.constructor=o,o.prototype.type="SparseMatrix",o.prototype.isSparseMatrix=!0,o.prototype.getDataType=function(){return q6(this._values,m2)},o.prototype.storage=function(){return"sparse"},o.prototype.datatype=function(){return this._datatype},o.prototype.create=function(e,t){return new o(e,t)},o.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},o.prototype.subset=function(e,t,n){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!z1(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,r,a,i,l=t.size();if(l.length!==e._size.length)throw new w6(l.length,e._size.length);var s=t.min(),c=t.max();for(n=0,r=e._size.length;n<r;n++)k6(s[n],e._size[n]),k6(c[n],e._size[n]);var u=e._values,d=e._index,p=e._ptr,f=t.dimension(0),h=t.dimension(1),m=[],v=[];f.forEach((function(e,t){v[e]=t[0],m[e]=!0}));var g=u?[]:void 0,y=[],b=[];return h.forEach((function(e){for(b.push(y.length),a=p[e],i=p[e+1];a<i;a++)n=d[a],!0===m[n]&&(y.push(v[n]),g&&g.push(u[a]))})),b.push(y.length),new o({values:g,index:y,ptr:b,size:l,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var o,a=t.size(),i=t.isScalar();B1(n)?(o=n.size(),n=n.toArray()):o=C6(n);if(i){if(0!==o.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(1!==a.length&&2!==a.length)throw new w6(a.length,e._size.length,"<");if(o.length<a.length){for(var l=0,s=0;1===a[l]&&1===o[l];)l++;for(;1===a[l];)s++,l++;n=B6(n,a.length,s,o)}if(!y2(a,o))throw new w6(a,o,">");if(1===a.length){t.dimension(0).forEach((function(t,o){k6(t),e.set([t,0],n[o[0]],r)}))}else{var c=t.dimension(0),u=t.dimension(1);c.forEach((function(t,o){k6(t),u.forEach((function(a,i){k6(a),e.set([t,a],n[o[0]][i[0]],r)}))}))}}return e}(this,e,t,n);default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.get=function(e){if(!O1(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new w6(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];k6(t,this._size[0]),k6(n,this._size[1]);var r=i(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},o.prototype.set=function(e,r,o){if(!O1(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new w6(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var a=e[0],c=e[1],u=this._size[0],d=this._size[1],p=n,f=0;M1(this._datatype)&&(p=t.find(n,[this._datatype,this._datatype])||n,f=t.convert(0,this._datatype)),(a>u-1||c>d-1)&&(s(this,Math.max(a+1,u),Math.max(c+1,d),o),u=this._size[0],d=this._size[1]),k6(a,u),k6(c,d);var h=i(a,this._ptr[c],this._ptr[c+1],this._index);return h<this._ptr[c+1]&&this._index[h]===a?p(r,f)?function(e,t,n,r,o){n.splice(e,1),r.splice(e,1);for(var a=t+1;a<o.length;a++)o[a]--}(h,c,this._values,this._index,this._ptr):this._values[h]=r:p(r,f)||l(h,a,c,r,this._values,this._index,this._ptr),this},o.prototype.resize=function(e,t,n){if(!V1(e))throw new TypeError("Array or Matrix expected");var r=e.valueOf().map((e=>Array.isArray(e)&&1===e.length?e[0]:e));if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(e){if(!T1(e)||!N2(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+h6(r)+")")})),s(n?this.clone():this,r[0],r[1],t)},o.prototype.reshape=function(e,t){if(!O1(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!T1(t)||!N2(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+h6(e)+")")}));var n=this._size[0]*this._size[1];if(n!==(e=I6(e,n))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;for(var o=[],a=0;a<r._ptr.length;a++)for(var s=0;s<r._ptr[a+1]-r._ptr[a];s++)o.push(a);for(var c=r._values.slice(),u=r._index.slice(),d=0;d<r._index.length;d++){var p=u[d],f=o[d],h=p*r._size[1]+f;o[d]=h%e[1],u[d]=Math.floor(h/e[1])}r._values.length=0,r._index.length=0,r._ptr.length=e[1]+1,r._size=e.slice();for(var m=0;m<r._ptr.length;m++)r._ptr[m]=0;for(var v=0;v<c.length;v++){var g=u[v],y=o[v],b=c[v];l(i(g,r._ptr[y],r._ptr[y+1],r._index),g,y,b,r._values,r._index,r._ptr)}return r},o.prototype.clone=function(){return new o({values:this._values?v2(this._values):void 0,index:v2(this._index),ptr:v2(this._ptr),size:v2(this._size),datatype:this._datatype})},o.prototype.size=function(){return this._size.slice(0)},o.prototype.map=function(e,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var a=this;return function(e,r,a,i,l,s,c){var u=[],d=[],p=[],f=n,h=0;M1(e._datatype)&&(f=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype));for(var m=function(e,t,n){var r=s(e,t,n);f(r,h)||(u.push(r),d.push(t))},v=i;v<=l;v++){p.push(u.length);var g=e._ptr[v],y=e._ptr[v+1];if(c)for(var b=g;b<y;b++){var w=e._index[b];w>=r&&w<=a&&m(e._values[b],w-r,v-i)}else{for(var x={},C=g;C<y;C++){x[e._index[C]]=e._values[C]}for(var _=r;_<=a;_++){m(_ in x?x[_]:0,_-r,v-i)}}}return p.push(u.length),new o({values:u,index:d,ptr:p,size:[a-r+1,l-i+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,(function(t,n,r){return Z6(e,t,[n,r],a,"map")}),r)},o.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],o=0;o<r;o++){var a=this._ptr[o],i=this._ptr[o+1];if(t)for(var l=a;l<i;l++){var s=this._index[l];e(this._values[l],[s,o],this)}else{for(var c={},u=a;u<i;u++){c[this._index[u]]=this._values[u]}for(var d=0;d<n;d++){e(d in c?c[d]:0,[d,o],this)}}}},o.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],r=this._ptr[t+1],o=n;o<r;o++){var a=this._index[o];yield{value:this._values[o],index:[a,t]}}},o.prototype.toArray=function(){return c(this._values,this._index,this._ptr,this._size,!0)},o.prototype.valueOf=function(){return c(this._values,this._index,this._ptr,this._size,!1)},o.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),o="Sparse Matrix ["+h6(t,e)+" x "+h6(n,e)+"] density: "+h6(r,e)+"\n",a=0;a<n;a++)for(var i=this._ptr[a],l=this._ptr[a+1],s=i;s<l;s++){o+="\n ("+h6(this._index[s],e)+", "+h6(a,e)+") ==> "+(this._values?h6(this._values[s],e):"X")}return o},o.prototype.toString=function(){return h6(this.toArray())},o.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},o.prototype.diagonal=function(e){if(e){if(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],a=this._size[1],i=Math.min(r-n,a-t),l=[],s=[],c=[];c[0]=0;for(var u=t;u<a&&l.length<i;u++)for(var d=this._ptr[u],p=this._ptr[u+1],f=d;f<p;f++){var h=this._index[f];if(h===u-t+n){l.push(this._values[f]),s[l.length-1]=h-n;break}}return c.push(l.length),new o({values:l,index:s,ptr:c,size:[i,1]})},o.fromJSON=function(e){return new o(e)},o.diagonal=function(e,r,a,i,l){if(!O1(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e)||e<1)throw new Error("Size values must be positive integers");return e})),a){if(N1(a)&&(a=a.toNumber()),!T1(a)||!N2(a))throw new TypeError("The parameter k must be an integer number")}else a=0;var s=n,c=0;M1(l)&&(s=t.find(n,[l,l])||n,c=t.convert(0,l));var u,d=a>0?a:0,p=a<0?-a:0,f=e[0],h=e[1],m=Math.min(f-p,h-d);if(O1(r)){if(r.length!==m)throw new Error("Invalid value array length");u=function(e){return r[e]}}else if(B1(r)){var v=r.size();if(1!==v.length||v[0]!==m)throw new Error("Invalid matrix length");u=function(e){return r.get([e])}}else u=function(){return r};for(var g=[],y=[],b=[],w=0;w<h;w++){b.push(g.length);var x=w-d;if(x>=0&&x<m){var C=u(x);s(C,c)||(y.push(x+p),g.push(C))}}return b.push(g.length),new o({values:g,index:y,ptr:b,size:[f,h]})},o.prototype.swapRows=function(e,t){if(!(T1(e)&&N2(e)&&T1(t)&&N2(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return k6(e,this._size[0]),k6(t,this._size[0]),o._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},o._forEachRow=function(e,t,n,r,o){for(var a=r[e],i=r[e+1],l=a;l<i;l++)o(n[l],t[l])},o._swapRows=function(e,t,n,r,o,a){for(var l=0;l<n;l++){var s=a[l],c=a[l+1],u=i(e,s,c,o),d=i(t,s,c,o);if(u<c&&d<c&&o[u]===e&&o[d]===t){if(r){var p=r[u];r[u]=r[d],r[d]=p}}else if(u<c&&o[u]===e&&(d>=c||o[d]!==t)){var f=r?r[u]:void 0;o.splice(d,0,t),r&&r.splice(d,0,f),o.splice(d<=u?u+1:u,1),r&&r.splice(d<=u?u+1:u,1)}else if(d<c&&o[d]===t&&(u>=c||o[u]!==e)){var h=r?r[d]:void 0;o.splice(u,0,e),r&&r.splice(u,0,h),o.splice(u<=d?d+1:d,1),r&&r.splice(u<=d?d+1:d,1)}}},o}),{isClass:!0});var $5=k2("number",["typed"],(e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t,n,r=(n=(t=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:t,radix:{"0b":2,"0o":8,"0x":16}[n[1]],integerPart:n[2],fractionalPart:n[3]}:null;if(r)return function(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++)n+=parseInt(e.fractionalPart[r],e.radix)/Math.pow(e.radix,r+1);var o=t+n;if(isNaN(o))throw new SyntaxError('String "'+e.input+'" is not a valid number');return o}(r);var o=0,a=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);a&&(o=Number(a[2]),e=a[1]);var i=Number(e);if(isNaN(i))throw new SyntaxError('String "'+e+'" is not a valid number');if(a){if(i>2**o-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));i>=2**(o-1)&&(i-=2**o)}return i},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((e=>t=>{var n=t.clone();return n.value=e(t.value),n})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))});return n.fromJSON=function(e){return parseFloat(e.value)},n})),U5=k2("bigint",["typed"],(e=>{var{typed:t}=e,n=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=>a8(t,e)))});return n.fromJSON=function(e){return BigInt(e.value)},n})),H5="string",q5=k2(H5,["typed"],(e=>{var{typed:t}=e;return t(H5,{"":function(){return""},number:P2,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),any:function(e){return String(e)}})})),W5="boolean",G5=k2(W5,["typed"],(e=>{var{typed:t}=e;return t(W5,{"":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 n=Number(e);if(""!==e&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),Y5=k2("bignumber",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(e){return new n(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var r=t[2],o=n(t[1]),a=new n(2).pow(Number(r));if(o.gt(a.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var i=new n(2).pow(Number(r)-1);return o.gte(i)?o.sub(a):o}return new n(e)},BigNumber:function(e){return e},bigint:function(e){return new n(e.toString())},Unit:t.referToSelf((e=>t=>{var n=t.clone();return n.value=e(t.value),n})),Fraction:function(e){return new n(e.n).div(e.d).times(e.s)},null:function(e){return new n(0)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),K5=k2("complex",["typed","Complex"],(e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(e){return new n(e,0)},"number, number":function(e,t){return new n(e,t)},"BigNumber, BigNumber":function(e,t){return new n(e.toNumber(),t.toNumber())},Fraction:function(e){return new n(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return n(e)},null:function(e){return n(0)},Object:function(e){if("re"in e&&"im"in e)return new n(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new n(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),X5=k2("fraction",["typed","Fraction"],(e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new n(e)},string:function(e){return new n(e)},"number, number":function(e,t){return new n(e,t)},null:function(e){return new n(0)},BigNumber:function(e){return new n(e.toString())},bigint:function(e){return new n(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((e=>t=>{var n=t.clone();return n.value=e(t.value),n})),Object:function(e){return new n(e)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),J5="matrix",Z5=k2(J5,["typed","Matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:o}=e;return t(J5,{"":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,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new o(e,n);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Q5="matrixFromFunction",e9=k2(Q5,["typed","matrix","isZero"],(e=>{var{typed:t,matrix:n,isZero:r}=e;return t(Q5,{"Array | Matrix, function, string, string":function(e,t,n,r){return o(e,t,n,r)},"Array | Matrix, function, string":function(e,t,n){return o(e,t,n)},"Matrix, function":function(e,t){return o(e,t,"dense")},"Array, function":function(e,t){return o(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,n){return o(e,n,t)},"Array | Matrix, string, string, function":function(e,t,n,r){return o(e,r,t,n)}});function o(e,t,o,a){var i;return(i=void 0!==a?n(o,a):n(o)).resize(e),i.forEach((function(e,n){var o=t(n);r(o)||i.set(n,o)})),i}})),t9="matrixFromRows",n9=k2(t9,["typed","matrix","flatten","size"],(e=>{var{typed:t,matrix:n,flatten:r,size:o}=e;return t(t9,{"...Array":function(e){return a(e)},"...Matrix":function(e){return n(a(e.map((e=>e.toArray()))))}});function a(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var t=i(e[0]),n=[];for(var o of e){var a=i(o);if(a!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|a));n.push(r(o))}return n}function i(e){var t=o(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),r9="matrixFromColumns",o9=k2(r9,["typed","matrix","flatten","size"],(e=>{var{typed:t,matrix:n,flatten:r,size:o}=e;return t(r9,{"...Array":function(e){return a(e)},"...Matrix":function(e){return n(a(e.map((e=>e.toArray()))))}});function a(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var t=i(e[0]),n=[],o=0;o<t;o++)n[o]=[];for(var a of e){var l=i(a);if(l!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|l));for(var s=r(a),c=0;c<t;c++)n[c].push(s[c])}return n}function i(e){var t=o(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),a9="splitUnit",i9=k2(a9,["typed"],(e=>{var{typed:t}=e;return t(a9,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),l9="unaryMinus",s9=k2(l9,["typed"],(e=>{var{typed:t}=e;return t(l9,{number:g8,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf((e=>n=>{var r=n.clone();return r.value=t.find(e,r.valueType())(n.value),r})),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),c9="unaryPlus",u9=k2(c9,["typed","config","numeric"],(e=>{var{typed:t,config:n,numeric:r}=e;return t(c9,{number:y8,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=>a8(t,e))),boolean:function(e){return r(e?1:0,n.number)},string:function(e){return r(e,D2(e,n))}})})),d9=k2("abs",["typed"],(e=>{var{typed:t}=e;return t("abs",{number:f8,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),p9="apply",f9=k2(p9,["typed","isInteger"],(e=>{var{typed:t,isInteger:n}=e;return t(p9,{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(e)?C6(e):e.size();if(t<0||t>=o.length)throw new x6(t,o.length);return B1(e)?e.create(h9(e.valueOf(),t,r),e.datatype()):h9(e,t,r)}})}));function h9(e,t,n){var r,o,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,n,r=e.length,o=e[0].length,a=[];for(n=0;n<o;n++){var i=[];for(t=0;t<r;t++)i.push(e[t][n]);a.push(i)}return a}(e),o=[],r=0;r<a.length;r++)o[r]=h9(a[r],t-1,n);return o}return n(e)}for(o=[],r=0;r<e.length;r++)o[r]=h9(e[r],t-1,n);return o}var m9="addScalar",v9=k2(m9,["typed"],(e=>{var{typed:t}=e;return t(m9,{"number, number":h8,"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=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(e,[o.valueType(),r.valueType()])(o.value,r.value),o.fixPrefix=!1,o}))})})),g9="subtractScalar",y9=k2(g9,["typed"],(e=>{var{typed:t}=e;return t(g9,{"number, number":m8,"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=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(e,[o.valueType(),r.valueType()])(o.value,r.value),o.fixPrefix=!1,o}))})})),b9="cbrt",w9=k2(b9,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(e=>{var{config:t,typed:n,isNegative:r,unaryMinus:o,matrix:a,Complex:i,BigNumber:l,Fraction:s}=e;return n(b9,{number:b8,Complex:c,"Complex, boolean":c,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&A1(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=c(e.value),t}var n,a=r(e.value);a&&(e.value=o(e.value)),n=N1(e.value)?new l(1).div(3):I1(e.value)?new s(1,3):1/3;var i=e.pow(n);return a&&(i.value=o(i.value)),i}});function c(e,n){var r=e.arg()/3,o=e.abs(),l=new i(b8(o),0).mul(new i(0,r).exp());if(n){var s=[l,new i(b8(o),0).mul(new i(0,r+2*Math.PI/3).exp()),new i(b8(o),0).mul(new i(0,r-2*Math.PI/3).exp())];return"Array"===t.matrix?s:a(s)}return l}})),x9=k2("matAlgo11xS0s",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o,a){var i=e._values,l=e._index,s=e._ptr,c=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,p=c[0],f=c[1],h=n,m=0,v=o;"string"==typeof u&&(d=u,h=t.find(n,[d,d]),m=t.convert(0,d),r=t.convert(r,d),v=t.find(o,[d,d]));for(var g=[],y=[],b=[],w=0;w<f;w++){b[w]=y.length;for(var x=s[w],C=s[w+1],_=x;_<C;_++){var E=l[_],S=a?v(r,i[_]):v(i[_],r);h(S,m)||(y.push(E),g.push(S))}}return b[f]=y.length,e.createSparseMatrix({values:g,index:y,ptr:b,size:[p,f],datatype:d})}})),C9=k2("matAlgo12xSfs",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,o,a){var i=e._values,l=e._index,s=e._ptr,c=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,p=c[0],f=c[1],h=o;"string"==typeof u&&(d=u,r=t.convert(r,d),h=t.find(o,[d,d]));for(var m=[],v=[],g=[],y=0;y<f;y++){for(var b=y+1,w=s[y],x=s[y+1],C=w;C<x;C++){var _=l[C];v[_]=i[C],g[_]=b}for(var E=0;E<p;E++)0===y&&(m[E]=[]),g[E]===b?m[E][y]=a?h(r,v[E]):h(v[E],r):m[E][y]=a?h(r,0):h(0,r)}return new n({data:m,size:[p,f],datatype:d})}})),_9=k2("matAlgo14xDs",["typed"],(e=>{var{typed:t}=e;return function(e,r,o,a){var i,l=e._data,s=e._size,c=e._datatype,u=o;"string"==typeof c&&(i=c,r=t.convert(r,i),u=t.find(o,[i,i]));var d=s.length>0?n(u,0,s,s[0],l,r,a):[];return e.createDenseMatrix({data:d,size:v2(s),datatype:i})};function n(e,t,r,o,a,i,l){var s=[];if(t===r.length-1)for(var c=0;c<o;c++)s[c]=l?e(i,a[c]):e(a[c],i);else for(var u=0;u<o;u++)s[u]=n(e,t+1,r,r[t+1],a[u],i,l);return s}})),E9="ceil",S9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],k9=k2(E9,["typed","config","round"],(e=>{var{typed:t,config:n,round:r}=e;return t(E9,{number:function(e){return H2(e,r(e),n.relTol,n.absTol)?r(e):Math.ceil(e)},"number, number":function(e,t){if(H2(e,r(e,t),n.relTol,n.absTol))return r(e,t);var[o,a]="".concat(e,"e").split("e"),i=Math.ceil(Number("".concat(o,"e").concat(Number(a)+t)));return[o,a]="".concat(i,"e").split("e"),Number("".concat(o,"e").concat(Number(a)-t))}})})),T9=k2(E9,S9,(e=>{var{typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l}=e,s=x9({typed:t,equalScalar:a}),c=C9({typed:t,DenseMatrix:l}),u=_9({typed:t}),d=k9({typed:t,config:n,round:r});return t("ceil",{number:d.signatures.number,"number,number":d.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:function(e){return _5(e,r(e),n.relTol,n.absTol)?r(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return _5(e,r(e,t),n.relTol,n.absTol)?r(e,t):e.toDecimalPlaces(t.toNumber(),F3.ROUND_CEIL)},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())},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>a8(t,(t=>e(t,n))))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>s(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>u(o(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>a(t,0)?i(n.size(),n.storage()):"dense"===n.storage()?u(n,t,e,!0):c(n,t,e,!0)))})})),N9="cube",D9=k2(N9,["typed"],(e=>{var{typed:t}=e;return t(N9,{number:w8,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)}})})),A9=k2("exp",["typed"],(e=>{var{typed:t}=e;return t("exp",{number:x8,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),I9="expm1",R9=k2(I9,["typed","Complex"],(e=>{var{typed:t,Complex:n}=e;return t(I9,{number:C8,Complex:function(e){var t=Math.exp(e.re);return new n(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})})),M9="fix",O9=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],B9=k2(M9,["typed","ceil","floor"],(e=>{var{typed:t,ceil:n,floor:r}=e;return t(M9,{number:function(e){return e>0?r(e):n(e)},"number, number":function(e,t){return e>0?r(e,t):n(e,t)}})})),V9=k2(M9,O9,(e=>{var{typed:t,Complex:n,matrix:r,ceil:o,floor:a,equalScalar:i,zeros:l,DenseMatrix:s}=e,c=C9({typed:t,DenseMatrix:s}),u=_9({typed:t}),d=B9({typed:t,ceil:o,floor:a});return t("fix",{number:d.signatures.number,"number, number | BigNumber":d.signatures["number,number"],Complex:function(e){return new n(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 n(e.re>0?a(e.re,t):o(e.re,t),e.im>0?a(e.im,t):o(e.im,t))},"Complex, BigNumber":function(e,t){var r=t.toNumber();return new n(e.re>0?a(e.re,r):o(e.re,r),e.im>0?a(e.im,r):o(e.im,r))},BigNumber:function(e){return e.isNegative()?o(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?o(e,t):a(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?o(e,t):a(e,t)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"Array | Matrix, number | BigNumber":t.referToSelf((e=>(t,n)=>a8(t,(t=>e(t,n))))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>u(r(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>i(t,0)?l(n.size(),n.storage()):"dense"===n.storage()?u(n,t,e,!0):c(n,t,e,!0)))})})),P9="floor",L9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],F9=k2(P9,["typed","config","round"],(e=>{var{typed:t,config:n,round:r}=e;return t(P9,{number:function(e){return H2(e,r(e),n.relTol,n.absTol)?r(e):Math.floor(e)},"number, number":function(e,t){if(H2(e,r(e,t),n.relTol,n.absTol))return r(e,t);var[o,a]="".concat(e,"e").split("e"),i=Math.floor(Number("".concat(o,"e").concat(Number(a)+t)));return[o,a]="".concat(i,"e").split("e"),Number("".concat(o,"e").concat(Number(a)-t))}})})),z9=k2(P9,L9,(e=>{var{typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l}=e,s=x9({typed:t,equalScalar:a}),c=C9({typed:t,DenseMatrix:l}),u=_9({typed:t}),d=F9({typed:t,config:n,round:r});return t("floor",{number:d.signatures.number,"number,number":d.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:function(e){return _5(e,r(e),n.relTol,n.absTol)?r(e):e.floor()},"BigNumber, BigNumber":function(e,t){return _5(e,r(e,t),n.relTol,n.absTol)?r(e,t):e.toDecimalPlaces(t.toNumber(),F3.ROUND_FLOOR)},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())},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>a8(t,(t=>e(t,n))))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>s(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>u(o(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>a(t,0)?i(n.size(),n.storage()):"dense"===n.storage()?u(n,t,e,!0):c(n,t,e,!0)))})})),j9=k2("matAlgo02xDS0",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o,a){var i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=r._values,u=r._index,d=r._ptr,p=r._size,f=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(l.length!==p.length)throw new w6(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,m=l[0],v=l[1],g=n,y=0,b=o;"string"==typeof s&&s===f&&"mixed"!==s&&(h=s,g=t.find(n,[h,h]),y=t.convert(0,h),b=t.find(o,[h,h]));for(var w=[],x=[],C=[],_=0;_<v;_++){C[_]=x.length;for(var E=d[_],S=d[_+1],k=E;k<S;k++){var T=u[k],N=a?b(c[k],i[T][_]):b(i[T][_],c[k]);g(N,y)||(x.push(T),w.push(N))}}return C[v]=x.length,r.createSparseMatrix({values:w,index:x,ptr:C,size:[m,v],datatype:s===e._datatype&&f===r._datatype?h:void 0})}})),$9=k2("matAlgo03xDSf",["typed"],(e=>{var{typed:t}=e;return function(e,n,r,o){var a=e._data,i=e._size,l=e._datatype||e.getDataType(),s=n._values,c=n._index,u=n._ptr,d=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(i.length!==d.length)throw new w6(i.length,d.length);if(i[0]!==d[0]||i[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+d+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var f,h=i[0],m=i[1],v=0,g=r;"string"==typeof l&&l===p&&"mixed"!==l&&(f=l,v=t.convert(0,f),g=t.find(r,[f,f]));for(var y=[],b=0;b<h;b++)y[b]=[];for(var w=[],x=[],C=0;C<m;C++){for(var _=C+1,E=u[C],S=u[C+1],k=E;k<S;k++){var T=c[k];w[T]=o?g(s[k],a[T][C]):g(a[T][C],s[k]),x[T]=_}for(var N=0;N<h;N++)x[N]===_?y[N][C]=w[N]:y[N][C]=o?g(v,a[N][C]):g(a[N][C],v)}return e.createDenseMatrix({data:y,size:[h,m],datatype:l===e._datatype&&p===n._datatype?f:void 0})}})),U9=k2("matAlgo05xSfSf",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));var x,C,_,E,S=a&&u?[]:void 0,k=[],T=[],N=S?[]:void 0,D=S?[]:void 0,A=[],I=[];for(C=0;C<g;C++){T[C]=k.length;var R=C+1;for(_=l[C],E=l[C+1];_<E;_++)x=i[_],k.push(x),A[x]=R,N&&(N[x]=a[_]);for(_=p[C],E=p[C+1];_<E;_++)A[x=d[_]]!==R&&k.push(x),I[x]=R,D&&(D[x]=u[_]);if(S)for(_=T[C];_<k.length;){var M=A[x=k[_]],O=I[x];if(M===R||O===R){var B=w(M===R?N[x]:b,O===R?D[x]:b);y(B,b)?k.splice(_,1):(S.push(B),_++)}}}return T[g]=k.length,e.createSparseMatrix({values:S,index:k,ptr:T,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),H9=k2("matAlgo13xDD",["typed"],(e=>{var{typed:t}=e;return function(e,r,o){var a,i=e._data,l=e._size,s=e._datatype,c=r._data,u=r._size,d=r._datatype,p=[];if(l.length!==u.length)throw new w6(l.length,u.length);for(var f=0;f<l.length;f++){if(l[f]!==u[f])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+u+")");p[f]=l[f]}var h=o;"string"==typeof s&&s===d&&(a=s,h=t.find(o,[a,a]));var m=p.length>0?n(h,0,p,p[0],i,c):[];return e.createDenseMatrix({data:m,size:p,datatype:a})};function n(e,t,r,o,a,i){var l=[];if(t===r.length-1)for(var s=0;s<o;s++)l[s]=e(a[s],i[s]);else for(var c=0;c<o;c++)l[c]=n(e,t+1,r,r[t+1],a[c],i[c]);return l}}));function q9(e,t){if(y2(e.size(),t.size()))return[e,t];var n=Y6(e.size(),t.size());return[e,t].map((e=>function(e,t){if(y2(e.size(),t))return e;return e.create(X6(e.valueOf(),t),e.datatype())}(e,n)))}var W9=k2("matrixAlgorithmSuite",["typed","matrix"],(e=>{var{typed:t,matrix:n}=e,r=H9({typed:t}),o=_9({typed:t});return function(e){var a,i=e.elop,l=e.SD||e.DS;i?(a={"DenseMatrix, DenseMatrix":(e,t)=>r(...q9(e,t),i),"Array, Array":(e,t)=>r(...q9(n(e),n(t)),i).valueOf(),"Array, DenseMatrix":(e,t)=>r(...q9(n(e),t),i),"DenseMatrix, Array":(e,t)=>r(...q9(e,n(t)),i)},e.SS&&(a["SparseMatrix, SparseMatrix"]=(t,n)=>e.SS(...q9(t,n),i,!1)),e.DS&&(a["DenseMatrix, SparseMatrix"]=(t,n)=>e.DS(...q9(t,n),i,!1),a["Array, SparseMatrix"]=(t,r)=>e.DS(...q9(n(t),r),i,!1)),l&&(a["SparseMatrix, DenseMatrix"]=(e,t)=>l(...q9(t,e),i,!0),a["SparseMatrix, Array"]=(e,t)=>l(...q9(n(t),e),i,!0))):(a={"DenseMatrix, DenseMatrix":t.referToSelf((e=>(t,n)=>r(...q9(t,n),e))),"Array, Array":t.referToSelf((e=>(t,o)=>r(...q9(n(t),n(o)),e).valueOf())),"Array, DenseMatrix":t.referToSelf((e=>(t,o)=>r(...q9(n(t),o),e))),"DenseMatrix, Array":t.referToSelf((e=>(t,o)=>r(...q9(t,n(o)),e)))},e.SS&&(a["SparseMatrix, SparseMatrix"]=t.referToSelf((t=>(n,r)=>e.SS(...q9(n,r),t,!1)))),e.DS&&(a["DenseMatrix, SparseMatrix"]=t.referToSelf((t=>(n,r)=>e.DS(...q9(n,r),t,!1))),a["Array, SparseMatrix"]=t.referToSelf((t=>(r,o)=>e.DS(...q9(n(r),o),t,!1)))),l&&(a["SparseMatrix, DenseMatrix"]=t.referToSelf((e=>(t,n)=>l(...q9(n,t),e,!0))),a["SparseMatrix, Array"]=t.referToSelf((e=>(t,r)=>l(...q9(n(r),t),e,!0)))));var s=e.scalar||"any";(e.Ds||e.Ss)&&(i?(a["DenseMatrix,"+s]=(e,t)=>o(e,t,i,!1),a[s+", DenseMatrix"]=(e,t)=>o(t,e,i,!0),a["Array,"+s]=(e,t)=>o(n(e),t,i,!1).valueOf(),a[s+", Array"]=(e,t)=>o(n(t),e,i,!0).valueOf()):(a["DenseMatrix,"+s]=t.referToSelf((e=>(t,n)=>o(t,n,e,!1))),a[s+", DenseMatrix"]=t.referToSelf((e=>(t,n)=>o(n,t,e,!0))),a["Array,"+s]=t.referToSelf((e=>(t,r)=>o(n(t),r,e,!1).valueOf())),a[s+", Array"]=t.referToSelf((e=>(t,r)=>o(n(r),t,e,!0).valueOf()))));var c=void 0!==e.sS?e.sS:e.Ss;return i?(e.Ss&&(a["SparseMatrix,"+s]=(t,n)=>e.Ss(t,n,i,!1)),c&&(a[s+", SparseMatrix"]=(e,t)=>c(t,e,i,!0))):(e.Ss&&(a["SparseMatrix,"+s]=t.referToSelf((t=>(n,r)=>e.Ss(n,r,t,!1)))),c&&(a[s+", SparseMatrix"]=t.referToSelf((e=>(t,n)=>c(n,t,e,!0))))),i&&i.signatures&&g2(a,i.signatures),a}})),G9=k2("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l,concat:s}=e,c=z9({typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l}),u=j9({typed:t,equalScalar:a}),d=$9({typed:t}),p=U9({typed:t,equalScalar:a}),f=x9({typed:t,equalScalar:a}),h=C9({typed:t,DenseMatrix:l});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 n=e%t;return 0n===n?n:n+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},W9({typed:t,matrix:o,concat:s})({SS:p,DS:d,SD:u,Ss:f,sS:h}))})),Y9=k2("matAlgo01xDSid",["typed"],(e=>{var{typed:t}=e;return function(e,n,r,o){var a=e._data,i=e._size,l=e._datatype||e.getDataType(),s=n._values,c=n._index,u=n._ptr,d=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(i.length!==d.length)throw new w6(i.length,d.length);if(i[0]!==d[0]||i[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+d+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var f,h,m=i[0],v=i[1],g="string"==typeof l&&"mixed"!==l&&l===p?l:void 0,y=g?t.find(r,[g,g]):r,b=[];for(f=0;f<m;f++)b[f]=[];var w=[],x=[];for(h=0;h<v;h++){for(var C=h+1,_=u[h],E=u[h+1],S=_;S<E;S++)w[f=c[S]]=o?y(s[S],a[f][h]):y(a[f][h],s[S]),x[f]=C;for(f=0;f<m;f++)x[f]===C?b[f][h]=w[f]:b[f][h]=a[f][h]}return e.createDenseMatrix({data:b,size:[m,v],datatype:l===e._datatype&&p===n._datatype?g:void 0})}})),K9=k2("matAlgo04xSidSid",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));var x,C,_,E,S,k=a&&u?[]:void 0,T=[],N=[],D=a&&u?[]:void 0,A=a&&u?[]:void 0,I=[],R=[];for(C=0;C<g;C++){N[C]=T.length;var M=C+1;for(E=l[C],S=l[C+1],_=E;_<S;_++)x=i[_],T.push(x),I[x]=M,D&&(D[x]=a[_]);for(E=p[C],S=p[C+1],_=E;_<S;_++)if(I[x=d[_]]===M){if(D){var O=w(D[x],u[_]);y(O,b)?I[x]=null:D[x]=O}}else T.push(x),R[x]=M,A&&(A[x]=u[_]);if(D&&A)for(_=N[C];_<T.length;)I[x=T[_]]===M?(k[_]=D[x],_++):R[x]===M?(k[_]=A[x],_++):T.splice(_,1)}return N[g]=T.length,e.createSparseMatrix({values:k,index:T,ptr:N,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),X9=k2("matAlgo10xSids",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,o,a){var i=e._values,l=e._index,s=e._ptr,c=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,p=c[0],f=c[1],h=o;"string"==typeof u&&(d=u,r=t.convert(r,d),h=t.find(o,[d,d]));for(var m=[],v=[],g=[],y=0;y<f;y++){for(var b=y+1,w=s[y],x=s[y+1],C=w;C<x;C++){var _=l[C];v[_]=i[C],g[_]=b}for(var E=0;E<p;E++)0===y&&(m[E]=[]),g[E]===b?m[E][y]=a?h(r,v[E]):h(v[E],r):m[E][y]=r}return new n({data:m,size:[p,f],datatype:d})}}));function J9(e,t,n,r){if(!(this instanceof J9))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}J9.prototype=new Error,J9.prototype.constructor=Error,J9.prototype.name="ArgumentsError",J9.prototype.isArgumentsError=!0;var Z9=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],Q9="number | BigNumber | Fraction | Matrix | Array",e7="".concat(Q9,", ").concat(Q9,", ...").concat(Q9);function t7(e){return!e.some((e=>Array.isArray(e)))}var n7=k2("gcd",Z9,(e=>{var{typed:t,matrix:n,config:r,round:o,equalScalar:a,zeros:i,BigNumber:l,DenseMatrix:s,concat:c}=e,u=G9({typed:t,config:r,round:o,matrix:n,equalScalar:a,zeros:i,DenseMatrix:s,concat:c}),d=Y9({typed:t}),p=K9({typed:t,equalScalar:a}),f=X9({typed:t,DenseMatrix:s});return t("gcd",{"number, number":function(e,t){if(!N2(e)||!N2(t))throw new Error("Parameters in function gcd must be integer numbers");var n;for(;0!==t;)n=u(e,t),e=t,t=n;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var n=new l(0);for(;!t.isZero();){var r=u(e,t);e=t,t=r}return e.lt(n)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},W9({typed:t,matrix:n,concat:c})({SS:p,DS:d,Ss:f}),{[e7]:t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o})),Array:t.referToSelf((e=>t=>{if(1===t.length&&Array.isArray(t[0])&&t7(t[0]))return e(...t[0]);if(t7(t))return e(...t);throw new J9("gcd() supports only 1d matrices!")})),Matrix:t.referToSelf((e=>t=>e(t.toArray())))})})),r7=k2("matAlgo06xS0S0",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._size,l=e._datatype||void 0===e._data?e._datatype:e.getDataType(),s=r._values,c=r._size,u=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(i.length!==c.length)throw new w6(i.length,c.length);if(i[0]!==c[0]||i[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+c+")");var d,p=i[0],f=i[1],h=n,m=0,v=o;"string"==typeof l&&l===u&&"mixed"!==l&&(d=l,h=t.find(n,[d,d]),m=t.convert(0,d),v=t.find(o,[d,d]));for(var g=a&&s?[]:void 0,y=[],b=[],w=g?[]:void 0,x=[],C=[],_=0;_<f;_++){b[_]=y.length;var E=_+1;if(s8(e,_,x,w,C,E,y,v),s8(r,_,x,w,C,E,y,v),w)for(var S=b[_];S<y.length;){var k=y[S];if(C[k]===E){var T=w[k];h(T,m)?y.splice(S,1):(g.push(T),S++)}else y.splice(S,1)}else for(var N=b[_];N<y.length;){C[y[N]]!==E?y.splice(N,1):N++}}return b[f]=y.length,e.createSparseMatrix({values:g,index:y,ptr:b,size:[p,f],datatype:l===e._datatype&&u===r._datatype?d:void 0})}})),o7=k2("lcm",["typed","matrix","equalScalar","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,concat:o}=e,a=j9({typed:t,equalScalar:r}),i=r7({typed:t,equalScalar:r}),l=x9({typed:t,equalScalar:r}),s=W9({typed:t,matrix:n,concat:o}),c="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(c,", ").concat(c,", ...").concat(c)]=t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o})),t("lcm",{"number, number":_8,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;var n=e.times(t);for(;!t.isZero();){var r=t;t=e.mod(r),e=r}return n.div(e).abs()},"Fraction, Fraction":(e,t)=>e.lcm(t)},s({SS:i,DS:a,Ss:l}),u)})),a7="log10",i7=k2(a7,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(a7,{number:function(e){return e>=0||n.predictable?E8(e):new r(e,0).log().div(Math.LN10)},Complex:function(e){return new r(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||n.predictable?e.log():new r(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),l7="log2",s7=k2(l7,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(l7,{number:function(e){return e>=0||n.predictable?S8(e):o(new r(e,0))},Complex:o,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log(2):o(new r(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))});function o(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),c7=k2("multiplyScalar",["typed"],(e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":v8,"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)})})),u7="multiply",d7=k2(u7,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:o,equalScalar:a,dot:i}=e,l=x9({typed:t,equalScalar:a}),s=_9({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new 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 new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}function u(e,n){if("dense"!==n.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,n){var a,i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._data,u=n._size,d=n._datatype||n.getDataType(),p=l[0],f=u[1],h=r,m=o;s&&d&&s===d&&"string"==typeof s&&"mixed"!==s&&(a=s,h=t.find(r,[a,a]),m=t.find(o,[a,a]));for(var v=[],g=0;g<f;g++){for(var y=m(i[0],c[0][g]),b=1;b<p;b++)y=h(y,m(i[b],c[b][g]));v[g]=y}return e.createDenseMatrix({data:v,size:[f],datatype:s===e._datatype&&d===n._datatype?a:void 0})}(e,n)}var d=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,n){var a,i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._data,u=n._datatype||n.getDataType(),d=l[0],p=l[1],f=r,h=o;s&&u&&s===u&&"string"==typeof s&&"mixed"!==s&&(a=s,f=t.find(r,[a,a]),h=t.find(o,[a,a]));for(var m=[],v=0;v<d;v++){for(var g=i[v],y=h(g[0],c[0]),b=1;b<p;b++)y=f(y,h(g[b],c[b]));m[v]=y}return e.createDenseMatrix({data:m,size:[d],datatype:s===e._datatype&&u===n._datatype?a:void 0})},"SparseMatrix, any":function(e,n){var i=e._values,l=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!i)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var u,d=n._data,p=n._datatype||n.getDataType(),f=e._size[0],h=n._size[0],m=[],v=[],g=[],y=r,b=o,w=a,x=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(u=c,y=t.find(r,[u,u]),b=t.find(o,[u,u]),w=t.find(a,[u,u]),x=t.convert(0,u));var C=[],_=[];g[0]=0;for(var E=0;E<h;E++){var S=d[E];if(!w(S,x))for(var k=s[E],T=s[E+1],N=k;N<T;N++){var D=l[N];_[D]?C[D]=y(C[D],b(S,i[N])):(_[D]=!0,v.push(D),C[D]=b(S,i[N]))}}for(var A=v.length,I=0;I<A;I++){var R=v[I];m[I]=C[R]}return g[1]=v.length,e.createSparseMatrix({values:m,index:v,ptr:g,size:[f,1],datatype:c===e._datatype&&p===n._datatype?u:void 0})}}),p=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,n){var a,i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._data,u=n._size,d=n._datatype||n.getDataType(),p=l[0],f=l[1],h=u[1],m=r,v=o;s&&d&&s===d&&"string"==typeof s&&"mixed"!==s&&"mixed"!==s&&(a=s,m=t.find(r,[a,a]),v=t.find(o,[a,a]));for(var g=[],y=0;y<p;y++){var b=i[y];g[y]=[];for(var w=0;w<h;w++){for(var x=v(b[0],c[0][w]),C=1;C<f;C++)x=m(x,v(b[C],c[C][w]));g[y][w]=x}}return e.createDenseMatrix({data:g,size:[p,h],datatype:s===e._datatype&&d===n._datatype?a:void 0})},"DenseMatrix, SparseMatrix":function(e,n){var i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._values,u=n._index,d=n._ptr,p=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(!c)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var h,m=l[0],v=p[1],g=r,y=o,b=a,w=0;s&&f&&s===f&&"string"==typeof s&&"mixed"!==s&&(h=s,g=t.find(r,[h,h]),y=t.find(o,[h,h]),b=t.find(a,[h,h]),w=t.convert(0,h));for(var x=[],C=[],_=[],E=n.createSparseMatrix({values:x,index:C,ptr:_,size:[m,v],datatype:s===e._datatype&&f===n._datatype?h:void 0}),S=0;S<v;S++){_[S]=C.length;var k=d[S],T=d[S+1];if(T>k)for(var N=0,D=0;D<m;D++){for(var A=D+1,I=void 0,R=k;R<T;R++){var M=u[R];N!==A?(I=y(i[D][M],c[R]),N=A):I=g(I,y(i[D][M],c[R]))}N!==A||b(I,w)||(C.push(D),x.push(I))}}return _[v]=C.length,E},"SparseMatrix, DenseMatrix":function(e,n){var i=e._values,l=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!i)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var u,d=n._data,p=n._datatype||n.getDataType(),f=e._size[0],h=n._size[0],m=n._size[1],v=r,g=o,y=a,b=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(u=c,v=t.find(r,[u,u]),g=t.find(o,[u,u]),y=t.find(a,[u,u]),b=t.convert(0,u));for(var w=[],x=[],C=[],_=e.createSparseMatrix({values:w,index:x,ptr:C,size:[f,m],datatype:c===e._datatype&&p===n._datatype?u:void 0}),E=[],S=[],k=0;k<m;k++){C[k]=x.length;for(var T=k+1,N=0;N<h;N++){var D=d[N][k];if(!y(D,b))for(var A=s[N],I=s[N+1],R=A;R<I;R++){var M=l[R];S[M]!==T?(S[M]=T,x.push(M),E[M]=g(D,i[R])):E[M]=v(E[M],g(D,i[R]))}}for(var O=C[k],B=x.length,V=O;V<B;V++){var P=x[V];w[V]=E[P]}}return C[m]=x.length,_},"SparseMatrix, SparseMatrix":function(e,n){var a,i=e._values,l=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=n._values,d=n._index,p=n._ptr,f=n._datatype||void 0===n._data?n._datatype:n.getDataType(),h=e._size[0],m=n._size[1],v=i&&u,g=r,y=o;c&&f&&c===f&&"string"==typeof c&&"mixed"!==c&&(a=c,g=t.find(r,[a,a]),y=t.find(o,[a,a]));for(var b,w,x,C,_,E,S,k,T=v?[]:void 0,N=[],D=[],A=e.createSparseMatrix({values:T,index:N,ptr:D,size:[h,m],datatype:c===e._datatype&&f===n._datatype?a:void 0}),I=v?[]:void 0,R=[],M=0;M<m;M++){D[M]=N.length;var O=M+1;for(_=p[M],E=p[M+1],C=_;C<E;C++)if(k=d[C],v)for(w=s[k],x=s[k+1],b=w;b<x;b++)R[S=l[b]]!==O?(R[S]=O,N.push(S),I[S]=y(u[C],i[b])):I[S]=g(I[S],y(u[C],i[b]));else for(w=s[k],x=s[k+1],b=w;b<x;b++)R[S=l[b]]!==O&&(R[S]=O,N.push(S));if(v)for(var B=D[M],V=N.length,P=B;P<V;P++){var L=N[P];T[P]=I[L]}}return D[m]=N.length,A}});return t(u7,o,{"Array, Array":t.referTo("Matrix, Matrix",(e=>(t,r)=>{c(C6(t),C6(r));var o=e(n(t),n(r));return B1(o)?o.valueOf():o})),"Matrix, Matrix":function(e,t){var n=e.size(),r=t.size();return c(n,r),1===n.length?1===r.length?function(e,t,n){if(0===n)throw new Error("Cannot multiply two empty vectors");return i(e,t)}(e,t,n[0]):u(e,t):1===r.length?d(e,t):p(e,t)},"Matrix, Array":t.referTo("Matrix,Matrix",(e=>(t,r)=>e(t,n(r)))),"Array, Matrix":t.referToSelf((e=>(t,r)=>e(n(t,r.storage()),r))),"SparseMatrix, any":function(e,t){return l(e,t,o,!1)},"DenseMatrix, any":function(e,t){return s(e,t,o,!1)},"any, SparseMatrix":function(e,t){return l(t,e,o,!0)},"any, DenseMatrix":function(e,t){return s(t,e,o,!0)},"Array, any":function(e,t){return s(n(e),t,o,!1).valueOf()},"any, Array":function(e,t){return s(n(t),e,o,!0).valueOf()},"any, any":o,"any, any, ...any":t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o}))})})),p7="nthRoot",f7=k2(p7,["typed","matrix","equalScalar","BigNumber","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:o,concat:a}=e,i=Y9({typed:t}),l=j9({typed:t,equalScalar:r}),s=r7({typed:t,equalScalar:r}),c=x9({typed:t,equalScalar:r}),u=W9({typed:t,matrix:n,concat:a});function d(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(p7,{number:k8,"number, number":k8,BigNumber:e=>p(e,new o(2)),"BigNumber, BigNumber":p,Complex:d,"Complex, number":d,Array:t.referTo("DenseMatrix,number",(e=>t=>e(n(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,n)=>{if(1===n.density())return s(t,n,e);throw new Error("Root must be non-zero")})),"DenseMatrix, SparseMatrix":t.referToSelf((e=>(t,n)=>{if(1===n.density())return i(t,n,e,!1);throw new Error("Root must be non-zero")})),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",(e=>(t,r)=>e(n(t),r))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>{if(1===n.density())return c(n,t,e,!0);throw new Error("Root must be non-zero")}))},u({scalar:"number | BigNumber",SD:l,Ss:c,sS:!1}));function p(e,t){var n=o.precision,r=o.clone({precision:n+2}),a=new o(0),i=new r(1),l=t.isNegative();if(l&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return l?new r(1/0):0;if(!e.isFinite())return l?a:e;var s=e.abs().pow(i.div(t));return s=e.isNeg()?s.neg():s,new o((l?i.div(s):s).toPrecision(n))}})),h7="sign",m7=k2(h7,["typed","BigNumber","Fraction","complex"],(e=>{var{typed:t,BigNumber:n,complex:r,Fraction:o}=e;return t(h7,{number:T8,Complex:function(e){return 0===e.im?r(T8(e.re)):e.sign()},BigNumber:function(e){return new n(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return new o(e.s,1)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),Unit:t.referToSelf((e=>n=>{if(!n._isDerived()&&0!==n.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,n.valueType())(n.value)}))})})),v7=k2("sqrt",["config","typed","Complex"],(e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:o,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():o(e.toNumber())},Unit:function(e){return e.pow(.5)}});function o(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new r(e,0).sqrt()}})),g7="square",y7=k2(g7,["typed"],(e=>{var{typed:t}=e;return t(g7,{number:N8,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)}})})),b7="subtract",w7=k2(b7,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:o,unaryMinus:a,DenseMatrix:i,concat:l}=e,s=Y9({typed:t}),c=$9({typed:t}),u=U9({typed:t,equalScalar:r}),d=X9({typed:t,DenseMatrix:i}),p=C9({typed:t,DenseMatrix:i}),f=W9({typed:t,matrix:n,concat:l});return t(b7,{"any, any":o},f({elop:o,SS:u,DS:s,SD:c,Ss:p,sS:d}))})),x7="xgcd",C7=k2(x7,["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o}=e;return t(x7,{"number, number":function(e,t){var o=D8(e,t);return"Array"===n.matrix?o:r(o)},"BigNumber, BigNumber":function(e,t){var a,i,l,s,c=new o(0),u=new o(1),d=c,p=u,f=u,h=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)i=e.div(t).floor(),l=e.mod(t),a=d,d=p.minus(i.times(d)),p=a,a=f,f=h.minus(i.times(f)),h=a,e=t,t=l;s=e.lt(c)?[e.neg(),p.neg(),h.neg()]:[e,e.isZero()?0:p,h];return"Array"===n.matrix?s:r(s)}})})),_7="invmod",E7=k2(_7,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],(e=>{var{typed:t,config:n,BigNumber:r,xgcd:o,equal:a,smaller:i,mod:l,add:s,isInteger:c}=e;return t(_7,{"number, number":u,"BigNumber, BigNumber":u});function u(e,t){if(!c(e)||!c(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=l(e,t),a(t,0))throw new Error("Divisor must be non zero");var n=o(e,t);n=n.valueOf();var[u,d]=n;return a(u,r(1))?(d=l(d,t),i(d,r(0))&&(d=s(d,t)),d):NaN}})),S7=k2("matAlgo09xS0Sf",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));var x,C,_,E,S,k=a&&u?[]:void 0,T=[],N=[],D=k?[]:void 0,A=[];for(C=0;C<g;C++){N[C]=T.length;var I=C+1;if(D)for(E=p[C],S=p[C+1],_=E;_<S;_++)A[x=d[_]]=I,D[x]=u[_];for(E=l[C],S=l[C+1],_=E;_<S;_++)if(x=i[_],D){var R=A[x]===I?D[x]:b,M=w(a[_],R);y(M,b)||(T.push(x),k.push(M))}else T.push(x)}return N[g]=T.length,e.createSparseMatrix({values:k,index:T,ptr:N,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),k7="dotMultiply",T7=k2(k7,["typed","matrix","equalScalar","multiplyScalar","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,multiplyScalar:o,concat:a}=e,i=j9({typed:t,equalScalar:r}),l=S7({typed:t,equalScalar:r}),s=x9({typed:t,equalScalar:r}),c=W9({typed:t,matrix:n,concat:a});return t(k7,c({elop:o,SS:l,DS:i,Ss:s}))}));function N7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(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 n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return I7(e,t,(function(e,t){return e&t}))}function D7(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,n=t.precision;t.config({precision:1e9});var r=e.plus(new t(1));return r.s=-r.s||null,t.config({precision:n}),r}function A7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);var r=new n(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:e.isFinite()&&t.isFinite()?I7(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function I7(e,t,n){var r,o,a,i,l,s=e.constructor,c=+(e.s<0),u=+(t.s<0);if(c){r=R7(D7(e));for(var d=0;d<r.length;++d)r[d]^=1}else r=R7(e);if(u){o=R7(D7(t));for(var p=0;p<o.length;++p)o[p]^=1}else o=R7(t);r.length<=o.length?(a=r,i=o,l=c):(a=o,i=r,l=u);var f=a.length,h=i.length,m=1^n(c,u),v=new s(1^m),g=new s(1),y=new s(2),b=s.precision;for(s.config({precision:1e9});f>0;)n(a[--f],i[--h])===m&&(v=v.plus(g)),g=g.times(y);for(;h>0;)n(l,i[--h])===m&&(v=v.plus(g)),g=g.times(y);return s.config({precision:b}),0===m&&(v.s=-v.s),v}function R7(e){for(var t=e.d,n=t[0]+"",r=1;r<t.length;++r){for(var o=t[r]+"",a=7-o.length;a--;)o="0"+o;n+=o}for(var i=n.length;"0"===n.charAt(i);)i--;var l=e.e,s=n.slice(0,i+1||1),c=s.length;if(l>0)if(++l>c)for(l-=c;l--;)s+="0";else l<c&&(s=s.slice(0,l)+"."+s.slice(l));for(var u=[0],d=0;d<s.length;){for(var p=u.length;p--;)u[p]*=10;u[0]+=parseInt(s.charAt(d++));for(var f=0;f<u.length;++f)u[f]>1&&(null!==u[f+1]&&void 0!==u[f+1]||(u[f+1]=0),u[f+1]+=u[f]>>1,u[f]&=1)}return u.reverse()}function M7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new n(0);var r=new n(-1);return e.eq(r)?D7(t):t.eq(r)?D7(e):e.isFinite()&&t.isFinite()?I7(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new n(e.isNegative()===t.isNegative()?1/0:-1/0):r}function O7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new n(2).pow(t)):new n(NaN)}function B7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new n(2).pow(t)).floor():e.isNegative()?new n(-1):e.isFinite()?new n(0):new n(NaN)}var V7="bitAnd",P7=k2(V7,["typed","matrix","equalScalar","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,concat:o}=e,a=j9({typed:t,equalScalar:r}),i=r7({typed:t,equalScalar:r}),l=x9({typed:t,equalScalar:r}),s=W9({typed:t,matrix:n,concat:o});return t(V7,{"number, number":M8,"BigNumber, BigNumber":N7,"bigint, bigint":(e,t)=>e&t},s({SS:i,DS:a,Ss:l}))})),L7="bitNot",F7=k2(L7,["typed"],(e=>{var{typed:t}=e;return t(L7,{number:O8,BigNumber:D7,bigint:e=>~e,"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),z7="bitOr",j7=k2(z7,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=Y9({typed:t}),l=K9({typed:t,equalScalar:r}),s=X9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:n,concat:a});return t(z7,{"number, number":B8,"BigNumber, BigNumber":A7,"bigint, bigint":(e,t)=>e|t},c({SS:l,DS:i,Ss:s}))})),$7=k2("matAlgo07xSSf",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,o,a){var i=e._size,l=e._datatype||void 0===e._data?e._datatype:e.getDataType(),s=o._size,c=o._datatype||void 0===o._data?o._datatype:o.getDataType();if(i.length!==s.length)throw new w6(i.length,s.length);if(i[0]!==s[0]||i[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+s+")");var u,d,p,f=i[0],h=i[1],m=0,v=a;"string"==typeof l&&l===c&&"mixed"!==l&&(u=l,m=t.convert(0,u),v=t.find(a,[u,u]));var g=[];for(d=0;d<f;d++)g[d]=[];var y=[],b=[],w=[],x=[];for(p=0;p<h;p++){var C=p+1;for(r(e,p,w,y,C),r(o,p,x,b,C),d=0;d<f;d++){var _=w[d]===C?y[d]:m,E=x[d]===C?b[d]:m;g[d][p]=v(_,E)}}return new n({data:g,size:[f,h],datatype:l===e._datatype&&c===o._datatype?u:void 0})};function r(e,t,n,r,o){for(var a=e._values,i=e._index,l=e._ptr,s=l[t],c=l[t+1];s<c;s++){var u=i[s];n[u]=o,r[u]=a[s]}}})),U7="bitXor",H7=k2(U7,["typed","matrix","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,concat:o}=e,a=$9({typed:t}),i=$7({typed:t,DenseMatrix:r}),l=C9({typed:t,DenseMatrix:r}),s=W9({typed:t,matrix:n,concat:o});return t(U7,{"number, number":V8,"BigNumber, BigNumber":M7,"bigint, bigint":(e,t)=>e^t},s({SS:i,DS:a,Ss:l}))})),q7=k2("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=>a8(t,e)))})})),W7="conj",G7=k2(W7,["typed"],(e=>{var{typed:t}=e;return t(W7,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),Y7=k2("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=>a8(t,e)))})})),K7=k2("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=>a8(t,e)))})})),X7=k2("not",["typed"],(e=>{var{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:W8,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=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),J7=k2("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=U9({typed:t,equalScalar:r}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:n,concat:a});return t("or",{"number, number":G8,"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":G8,"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t.value||0,n.value||0)))},c({SS:l,DS:i,Ss:s}))})),Z7=k2("xor",["typed","matrix","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,concat:o}=e,a=$9({typed:t}),i=$7({typed:t,DenseMatrix:r}),l=C9({typed:t,DenseMatrix:r}),s=W9({typed:t,matrix:n,concat:o});return t("xor",{"number, number":Y8,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"bigint, bigint":Y8,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t.value||0,n.value||0)))},s({SS:i,DS:a,Ss:l}))})),Q7="concat",eee=k2(Q7,["typed","matrix","isInteger"],(e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(Q7,{"...Array | Matrix | number | BigNumber":function(e){var t,o,a=e.length,i=-1,l=!1,s=[];for(t=0;t<a;t++){var c=e[t];if(B1(c)&&(l=!0),T1(c)||N1(c)){if(t!==a-1)throw new Error("Dimension must be specified as last argument");if(o=i,i=c.valueOf(),!r(i))throw new TypeError("Integer number expected for dimension");if(i<0||t>0&&i>o)throw new x6(i,o+1)}else{var u=v2(c).valueOf(),d=C6(u);if(s[t]=u,o=i,i=d.length-1,t>0&&i!==o)throw new w6(o+1,i+1)}}if(0===s.length)throw new SyntaxError("At least one matrix expected");for(var p=s.shift();s.length;)p=G6(p,s.shift(),i);return l?n(p):p},"...string":function(e){return e.join("")}})})),tee="column",nee=k2(tee,["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:o}=e;return t(tee,{"Matrix, number":a,"Array, number":function(e,t){return a(r(v2(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");k6(t,e.size()[1]);var a=o(0,e.size()[0]),i=new n(a,t),l=e.subset(i);return B1(l)?l:r([[l]])}})),ree="count",oee=k2(ree,["typed","size","prod"],(e=>{var{typed:t,size:n,prod:r}=e;return t(ree,{string:function(e){return e.length},"Matrix | Array":function(e){return r(n(e))}})})),aee="cross",iee=k2(aee,["typed","matrix","subtract","multiply"],(e=>{var{typed:t,matrix:n,subtract:r,multiply:o}=e;return t(aee,{"Matrix, Matrix":function(e,t){return n(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(a(e.toArray(),t))},"Array, Matrix":function(e,t){return n(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var n=Math.max(C6(e).length,C6(t).length);e=M6(e),t=M6(t);var a=C6(e),i=C6(t);if(1!==a.length||1!==i.length||3!==a[0]||3!==i[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+i.join(", ")+"])");var l=[r(o(e[1],t[2]),o(e[2],t[1])),r(o(e[2],t[0]),o(e[0],t[2])),r(o(e[0],t[1]),o(e[1],t[0]))];return n>1?[l]:l}})),lee="diag",see=k2(lee,["typed","matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:o}=e;return t(lee,{Array:function(e){return a(e,0,C6(e),null)},"Array, number":function(e,t){return a(e,t,C6(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),C6(e),null)},"Array, string":function(e,t){return a(e,0,C6(e),t)},"Array, number, string":function(e,t,n){return a(e,t,C6(e),n)},"Array, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),C6(e),n)},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,n){return a(e,t,e.size(),n)},"Matrix, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),e.size(),n)}});function a(e,t,a,i){if(!N2(t))throw new TypeError("Second parameter in function diag must be an integer");var l=t>0?t:0,s=t<0?-t:0;switch(a.length){case 1:return function(e,t,n,a,i,l){var s=[a+i,a+l];if(n&&"sparse"!==n&&"dense"!==n)throw new TypeError("Unknown matrix type ".concat(n,'"'));var c="sparse"===n?o.diagonal(s,e,t):r.diagonal(s,e,t);return null!==n?c:c.valueOf()}(e,t,i,a[0],s,l);case 2:return function(e,t,r,o,a,i){if(B1(e)){var l=e.diagonal(t);return null!==r?r!==l.storage()?n(l,r):l:l.valueOf()}for(var s=Math.min(o[0]-a,o[1]-i),c=[],u=0;u<s;u++)c[u]=e[u+a][u+i];return null!==r?n(c):c}(e,t,i,a,s,l)}throw new RangeError("Matrix for function diag must be 2 dimensional")}})),cee=k2("filter",["typed"],(e=>{var{typed:t}=e;return t("filter",{"Array, function":uee,"Matrix, function":function(e,t){return e.create(uee(e.valueOf(),t),e.datatype())},"Array, RegExp":j6,"Matrix, RegExp":function(e,t){return e.create(j6(e.valueOf(),t),e.datatype())}})}));function uee(e,t){return z6(e,(function(e,n,r){return Z6(t,e,[n],r,"filter")}))}var dee="flatten",pee=k2(dee,["typed"],(e=>{var{typed:t}=e;return t(dee,{Array:function(e){return P6(e)},Matrix:function(e){return e.create(P6(e.toArray()),e.datatype())}})})),fee="forEach",hee=k2(fee,["typed"],(e=>{var{typed:t}=e;return t(fee,{"Array, function":mee,"Matrix, function":function(e,t){e.forEach(t)}})}));function mee(e,t){var n=function(r,o){if(!Array.isArray(r))return Z6(t,r,o,e,"forEach");F6(r,(function(e,t){n(e,o.concat(t))}))};n(e,[])}var vee="getMatrixDataType",gee=k2(vee,["typed"],(e=>{var{typed:t}=e;return t(vee,{Array:function(e){return q6(e,m2)},Matrix:function(e){return e.getDataType()}})})),yee="identity",bee=k2(yee,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o,DenseMatrix:a,SparseMatrix:i}=e;return t(yee,{"":function(){return"Matrix"===n.matrix?r([]):[]},string:function(e){return r(e)},"number | BigNumber":function(e){return s(e,e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return s(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return s(e,t,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,n){return s(e,t,n)},Array:function(e){return l(e)},"Array, string":function(e,t){return l(e,t)},Matrix:function(e){return l(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return l(e.valueOf(),t)}});function l(e,t){switch(e.length){case 0:return t?r(t):[];case 1:return s(e[0],e[0],t);case 2:return s(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function s(e,t,n){var r=N1(e)||N1(t)?o:null;if(N1(e)&&(e=e.toNumber()),N1(t)&&(t=t.toNumber()),!N2(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!N2(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var l=r?new o(1):1,s=r?new r(0):0,c=[e,t];if(n){if("sparse"===n)return i.diagonal(c,l,0,s);if("dense"===n)return a.diagonal(c,l,0,s);throw new TypeError('Unknown matrix type "'.concat(n,'"'))}for(var u=N6([],c,s),d=e<t?e:t,p=0;p<d;p++)u[p][p]=l;return u}})),wee="kron",xee=k2(wee,["typed","matrix","multiplyScalar"],(e=>{var{typed:t,matrix:n,multiplyScalar:r}=e;return t(wee,{"Matrix, Matrix":function(e,t){return n(o(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(o(e.toArray(),t))},"Array, Matrix":function(e,t){return n(o(e,t.toArray()))},"Array, Array":o});function o(e,t){if(1===C6(e).length&&(e=[e]),1===C6(t).length&&(t=[t]),C6(e).length>2||C6(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var n=[],o=[];return e.map((function(e){return t.map((function(t){return o=[],n.push(o),e.map((function(e){return t.map((function(t){return o.push(r(e,t))}))}))}))}))&&n}})),Cee=k2("map",["typed"],(e=>{var{typed:t}=e;return t("map",{"Array, function":_ee,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,n,r)=>function(e,n){if("function"!=typeof n)throw new Error("Last argument must be a callback function");var r,o=e[0].isMatrix,a=Y6(...e.map((e=>e.isMatrix?e.size():C6(e)))),i=o?(e,t)=>e.get(t):J6,l=o?e.map((t=>t.isMatrix?t.create(X6(t.toArray(),a),t.datatype()):e[0].create(X6(t.valueOf(),a)))):e.map((e=>e.isMatrix?X6(e.toArray(),a):X6(e,a)));if(t.isTypedFunction(n)){var s=a.map((()=>0)),c=l.map((e=>i(e,s))),u=v(n,c,s,l);r=h(u)}else{var d=e.length,p=m(n,d);r=h(p)}var f=(e,t)=>r([e,...l.slice(1).map((e=>i(e,t)))],t);return o?l[0].map(f):_ee(l[0],f);function h(e){switch(e){case 0:return e=>n(...e);case 1:return(e,t)=>n(...e,t);case 2:return(e,t)=>n(...e,t,...l)}}function m(e,t){return e.length>t+1?2:e.length===t+1?1:0}function v(e,n,r,o){return null!==t.resolve(e,[...n,r,...o])?2:null!==t.resolve(e,[...n,r])?1:(t.resolve(e,n),0)}}([e,n,...r.slice(0,r.length-1)],r[r.length-1])})}));function _ee(e,t){return Eee(e,[],e,t)}function Eee(e,t,n,r){return Array.isArray(e)?e.map((function(e,o){return Eee(e,t.concat(o),n,r)})):Z6(r,e,t,n,"map")}var See="diff",kee=k2(See,["typed","matrix","subtract","number"],(e=>{var{typed:t,matrix:n,subtract:r,number:o}=e;return t(See,{"Array | Matrix":function(e){return B1(e)?n(i(e.toArray())):i(e)},"Array | Matrix, number":function(e,t){if(!N2(t))throw new RangeError("Dimension must be a whole number");return B1(e)?n(a(e.toArray(),t)):a(e,t)},"Array, BigNumber":t.referTo("Array,number",(e=>(t,n)=>e(t,o(n)))),"Matrix, BigNumber":t.referTo("Matrix,number",(e=>(t,n)=>e(t,o(n))))});function a(e,t){if(B1(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var n=[];return e.forEach((e=>{n.push(a(e,t-1))})),n}if(0===t)return i(e);throw RangeError("Cannot have negative dimension")}function i(e){for(var t=[],n=e.length,r=1;r<n;r++)t.push(l(e[r-1],e[r]));return t}function l(e,t){B1(e)&&(e=e.toArray()),B1(t)&&(t=t.toArray());var n=Array.isArray(e),o=Array.isArray(t);if(n&&o)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var n=[],r=e.length,o=0;o<r;o++)n.push(l(e[o],t[o]));return n}(e,t);if(!n&&!o)return r(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}})),Tee=k2("ones",["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o}=e;return t("ones",{"":function(){return"Array"===n.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"===n.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 n=function(e){var t=!1;return e.forEach((function(e,n,r){N1(e)&&(t=!0,r[n]=e.toNumber())})),t}(e),a=n?new o(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!N2(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var i=r(t);return e.length>0?i.resize(e,a):i}var l=[];return e.length>0?N6(l,e,a):l}}));function Nee(){throw new Error('No "bignumber" implementation available')}function Dee(){throw new Error('No "fraction" implementation available')}function Aee(){throw new Error('No "matrix" implementation available')}var Iee="range",Ree=k2(Iee,["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(e=>{var{typed:t,config:n,matrix:r,bignumber:o,smaller:a,smallerEq:i,larger:l,largerEq:s,add:c,isPositive:u}=e;return t(Iee,{string:p,"string, boolean":p,"number, number":function(e,t){return d(f(e,t,1,!1))},"number, number, number":function(e,t,n){return d(f(e,t,n,!1))},"number, number, boolean":function(e,t,n){return d(f(e,t,1,n))},"number, number, number, boolean":function(e,t,n,r){return d(f(e,t,n,r))},"BigNumber, BigNumber":function(e,t){return d(f(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,n){return d(f(e,t,n,!1))},"BigNumber, BigNumber, boolean":function(e,t,n){return d(f(e,t,new(0,e.constructor)(1),n))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,n,r){return d(f(e,t,n,r))},"Unit, Unit, Unit":function(e,t,n){return d(f(e,t,n,!1))},"Unit, Unit, Unit, boolean":function(e,t,n,r){return d(f(e,t,n,r))}});function d(e){return"Matrix"===n.matrix?r?r(e):Aee():e}function p(e,t){var r=function(e){var t=e.split(":"),n=t.map((function(e){return Number(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return{start:n[0],end:n[1],step:1};case 3:return{start:n[0],end:n[2],step:n[1]};default:return null}}(e);if(!r)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===n.number?(void 0===o&&Nee(),d(f(o(r.start),o(r.end),o(r.step)))):d(f(r.start,r.end,r.step,t))}function f(e,t,n,r){for(var o=[],d=u(n)?r?i:a:r?s:l,p=e;d(p,t);)o.push(p),p=c(p,n);return o}})),Mee="reshape",Oee=k2(Mee,["typed","isInteger","matrix"],(e=>{var{typed:t,isInteger:n}=e;return t(Mee,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach((function(e){if(!n(e))throw new TypeError("Invalid size for dimension: "+e)})),A6(e,t)}})})),Bee=k2("resize",["config","matrix"],(e=>{var{config:t,matrix:n}=e;return function(e,r,o){if(2!==arguments.length&&3!==arguments.length)throw new J9("resize",arguments.length,2,3);if(B1(r)&&(r=r.valueOf()),N1(r[0])&&(r=r.map((function(e){return N1(e)?e.toNumber():e}))),B1(e))return e.resize(r,o,!0);if("string"==typeof e)return function(e,t,n){if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";if(1!==t.length)throw new w6(t.length,1);var r=t[0];if("number"!=typeof r||!N2(r))throw new TypeError("Invalid size, must contain positive integers (size: "+h6(t)+")");if(e.length>r)return e.substring(0,r);if(e.length<r){for(var o=e,a=0,i=r-e.length;a<i;a++)o+=n;return o}return e}(e,r,o);var a=!Array.isArray(e)&&"Array"!==t.matrix;if(0===r.length){for(;Array.isArray(e);)e=e[0];return v2(e)}Array.isArray(e)||(e=[e]);var i=N6(e=v2(e),r,o);return a?n(i):i}})),Vee="rotate",Pee=k2(Vee,["typed","multiply","rotationMatrix"],(e=>{var{typed:t,multiply:n,rotationMatrix:r}=e;return t(Vee,{"Array , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),n(r(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),n(r(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return o(e,3),n(r(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return o(e,3),n(r(t,a),e)}});function o(e,t){var n=Array.isArray(e)?C6(e):e.size();if(n.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===n.length&&1!==n[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(n[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}})),Lee="rotationMatrix",Fee=k2(Lee,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],(e=>{var{typed:t,config:n,multiplyScalar:r,addScalar:o,unaryMinus:a,norm:i,BigNumber:l,matrix:s,DenseMatrix:c,SparseMatrix:u,cos:d,sin:p}=e;return t(Lee,{"":function(){return"Matrix"===n.matrix?s([]):[]},string:function(e){return s(e)},"number | BigNumber | Complex | Unit":function(e){return f(e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return f(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var n=s(t);return h(n),g(e,n,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){h(t);var r=t.storage()||("Matrix"===n.matrix?"dense":void 0);return g(e,t,r)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,n){var r=s(t);return h(r),g(e,r,n)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,n){return h(t),g(e,t,n)}});function f(e,t){var n=N1(e)?new l(-1):-1,o=d(e),a=p(e);return v([[o,r(n,a)],[a,o]],t)}function h(e){var t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function m(e){return e.reduce(((e,t)=>r(e,t)))}function v(e,t){if(t){if("sparse"===t)return new u(e);if("dense"===t)return new c(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function g(e,t,n){var r=i(t);if(0===r)throw new RangeError("Rotation around zero vector");var s=N1(e)?l:null,c=s?new s(1):1,u=s?new s(-1):-1,f=s?new s(t.get([0])/r):t.get([0])/r,h=s?new s(t.get([1])/r):t.get([1])/r,g=s?new s(t.get([2])/r):t.get([2])/r,y=d(e),b=o(c,a(y)),w=p(e);return v([[o(y,m([f,f,b])),o(m([f,h,b]),m([u,g,w])),o(m([f,g,b]),m([h,w]))],[o(m([f,h,b]),m([g,w])),o(y,m([h,h,b])),o(m([h,g,b]),m([u,f,w]))],[o(m([f,g,b]),m([u,h,w])),o(m([h,g,b]),m([f,w])),o(y,m([g,g,b]))]],n)}})),zee=k2("row",["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:o}=e;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(r(v2(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");k6(t,e.size()[0]);var a=o(0,e.size()[1]),i=new n(t,a),l=e.subset(i);return B1(l)?l:r([[l]])}})),jee="size",$ee=k2(jee,["typed","config","?matrix"],(e=>{var{typed:t,config:n,matrix:r}=e;return t(jee,{Matrix:function(e){return e.create(e.size(),"number")},Array:C6,string:function(e){return"Array"===n.matrix?[e.length]:r([e.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===n.matrix?[]:r?r([],"dense","number"):Aee()}})})),Uee="squeeze",Hee=k2(Uee,["typed"],(e=>{var{typed:t}=e;return t(Uee,{Array:function(e){return M6(v2(e))},Matrix:function(e){var t=M6(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return v2(e)}})})),qee="subset",Wee=k2(qee,["typed","matrix","zeros","add"],(e=>{var{typed:t,matrix:n,zeros:r,add:o}=e;return t(qee,{"Matrix, Index":function(e,t){return T6(t)?n():(S6(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",(function(e){return function(t,r){var o=e(n(t),r);return r.isScalar()?o:o.valueOf()}})),"Object, Index":Kee,"string, Index":Gee,"Matrix, Index, any, any":function(e,t,n,a){return T6(t)?e:(S6(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t._isScalar)return e;var n=t.size();if(!n.every((e=>e>0)))return e;try{return o(e,r(n))}catch(a){return e}}(n,t),a))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,o,a){var i=e(n(t),r,o,a);return i.isMatrix?i.valueOf():i}})),"Array, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,o){return e(n(t),r,o,void 0).valueOf()}})),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,r){return e(t,n,r,void 0)}})),"string, Index, string":Yee,"string, Index, string, string":Yee,"Object, Index, any":Xee})}));function Gee(e,t){if(!z1(t))throw new TypeError("Index expected");if(T6(t))return"";if(S6(Array.from(e),t),1!==t.size().length)throw new w6(t.size().length,1);var n=e.length;k6(t.min()[0],n),k6(t.max()[0],n);var r=t.dimension(0),o="";return r.forEach((function(t){o+=e.charAt(t)})),o}function Yee(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(T6(t))return e;if(S6(Array.from(e),t),1!==t.size().length)throw new w6(t.size().length,1);if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";var o=t.dimension(0);if(o.size()[0]!==n.length)throw new w6(o.size()[0],n.length);var a=e.length;k6(t.min()[0]),k6(t.max()[0]);for(var i=[],l=0;l<a;l++)i[l]=e.charAt(l);if(o.forEach((function(e,t){i[e]=n.charAt(t[0])})),i.length>a)for(var s=a-1,c=i.length;s<c;s++)i[s]||(i[s]=r);return i.join("")}function Kee(e,t){if(!T6(t)){if(1!==t.size().length)throw new w6(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");return v1(e,n)}}function Xee(e,t,n){if(T6(t))return e;if(1!==t.size().length)throw new w6(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");var o=v2(e);return g1(o,r,n),o}var Jee="transpose",Zee=k2(Jee,["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return t(Jee,{Array:e=>r(n(e)).valueOf(),Matrix:r,any:v2});function r(e){var t,n=e.size();switch(n.length){case 1:t=e.clone();break;case 2:var r=n[0],o=n[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+h6(n)+")");switch(e.storage()){case"dense":t=function(e,t,n){for(var r,o=e._data,a=[],i=0;i<n;i++){r=a[i]=[];for(var l=0;l<t;l++)r[l]=v2(o[l][i])}return e.createDenseMatrix({data:a,size:[n,t],datatype:e._datatype})}(e,r,o);break;case"sparse":t=function(e,t,n){for(var r,o,a,i=e._values,l=e._index,s=e._ptr,c=i?[]:void 0,u=[],d=[],p=[],f=0;f<t;f++)p[f]=0;for(r=0,o=l.length;r<o;r++)p[l[r]]++;for(var h=0,m=0;m<t;m++)d.push(h),h+=p[m],p[m]=d[m];for(d.push(h),a=0;a<n;a++)for(var v=s[a],g=s[a+1],y=v;y<g;y++){var b=p[l[y]]++;u[b]=a,i&&(c[b]=v2(i[y]))}return e.createSparseMatrix({values:c,index:u,ptr:d,size:[n,t],datatype:e._datatype})}(e,r,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+h6(n)+")")}return t}})),Qee="ctranspose",ete=k2(Qee,["typed","transpose","conj"],(e=>{var{typed:t,transpose:n,conj:r}=e;return t(Qee,{any:function(e){return r(n(e))}})})),tte="zeros",nte=k2(tte,["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o}=e;return t(tte,{"":function(){return"Array"===n.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"===n.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 n=function(e){var t=!1;return e.forEach((function(e,n,r){N1(e)&&(t=!0,r[n]=e.toNumber())})),t}(e),a=n?new o(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!N2(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var i=r(t);return e.length>0?i.resize(e,a):i}var l=[];return e.length>0?N6(l,e,a):l}})),rte=k2("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],(e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:o,divideScalar:a,exp:i,tau:l,i:s,dotDivide:c,conj:u,pow:d,ceil:p,log2:f}=e;return t("fft",{Array:h,Matrix:function(e){return e.create(h(e.valueOf()),e.datatype())}});function h(e){var t=C6(e);return 1===t.length?v(e,t[0]):m(e.map((e=>h(e,t.slice(1)))),0)}function m(e,t){var n=C6(e);if(0!==t)return new Array(n[0]).fill(0).map(((n,r)=>m(e[r],t-1)));if(1===n.length)return v(e);function r(e){var t=C6(e);return new Array(t[1]).fill(0).map(((n,r)=>new Array(t[0]).fill(0).map(((t,n)=>e[n][r]))))}return r(m(r(e),1))}function v(e){var t=e.length;if(1===t)return[e[0]];if(t%2==0){for(var n=[...v(e.filter(((e,t)=>t%2==0))),...v(e.filter(((e,t)=>t%2==1)))],m=0;m<t/2;m++){var g=n[m],y=o(n[m+t/2],i(o(o(l,s),a(-m,t))));n[m]=r(g,y),n[m+t/2]=r(g,o(-1,y))}return n}return function(e){for(var t=e.length,n=i(a(o(-1,o(s,l)),t)),r=[],m=1-t;m<t;m++)r.push(d(n,a(d(m,2),2)));for(var g=d(2,p(f(t+t-1))),y=[...new Array(t).fill(0).map(((n,a)=>o(e[a],r[t-1+a]))),...new Array(g-t).fill(0)],b=[...new Array(t+t-1).fill(0).map(((e,t)=>a(1,r[t]))),...new Array(g-(t+t-1)).fill(0)],w=v(y),x=v(b),C=new Array(g).fill(0).map(((e,t)=>o(w[t],x[t]))),_=c(u(h(u(C))),g),E=[],S=t-1;S<t+t-1;S++)E.push(o(_[S],r[S]));return E}(e)}})),ote="ifft",ate=k2(ote,["typed","fft","dotDivide","conj"],(e=>{var{typed:t,fft:n,dotDivide:r,conj:o}=e;return t(ote,{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);return r(o(n(o(e))),t.reduce(((e,t)=>e*t),1))}})}));function ite(e){return(ite="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 lte(e){var t=function(e,t){if("object"!=ite(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ite(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ite(t)?t:t+""}function ste(e,t,n){return(t=lte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cte(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ute=k2("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],(e=>{var{typed:t,add:n,subtract:r,multiply:o,divide:a,max:i,map:l,abs:s,isPositive:c,isNegative:u,larger:d,smaller:p,matrix:f,bignumber:h,unaryMinus:m}=e;function v(e){return function(t,f,v,g){if(!(2===f.length&&(f.every(w)||f.every(R1))))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var y=f[0],b=f[1],x=d(b,y),C=g.firstStep;if(void 0!==C&&!c(C))throw new Error('"firstStep" must be positive');var _=g.maxStep;if(void 0!==_&&!c(_))throw new Error('"maxStep" must be positive');var E=g.minStep;if(E&&u(E))throw new Error('"minStep" must be positive or zero');var S=[y,b,C,E,_].filter((e=>void 0!==e));if(!S.every(w)&&!S.every(R1))throw new Error('Inconsistent type of "t" dependant variables');for(var k=g.tol?g.tol:1e-4,T=g.minDelta?g.minDelta:.2,N=g.maxDelta?g.maxDelta:5,D=g.maxIter?g.maxIter:1e4,A=[y,b,...v,_,E].some(N1),[I,R,M,O]=A?[h(e.a),h(e.c),h(e.b),h(e.bp)]:[e.a,e.c,e.b,e.bp],B=C?x?C:m(C):a(r(b,y),1),V=[y],P=[v],L=r(M,O),F=0,z=0,j=function(e){return e?p:d}(x),$=function(e){var t=e?d:p;return function(e,o,a){var i=n(e,a);return t(i,o)?r(o,e):a}}(x);j(V[F],b);){var U=[];B=$(V[F],b,B),U.push(t(V[F],P[F]));for(var H=1;H<R.length;++H)U.push(t(n(V[F],o(R[H],B)),n(P[F],o(B,I[H],U))));var q=i(s(l(o(L,U),(e=>R1(e)?e.value:e))));q<k&&k/q>1/4&&(V.push(n(V[F],B)),P.push(n(P[F],o(B,M,U))),F++);var W=.84*(k/q)**.2;if(p(W,T)?W=T:d(W,N)&&(W=N),W=A?h(W):W,B=o(B,W),_&&d(s(B),_)?B=x?_:m(_):E&&p(s(B),E)&&(B=x?E:m(E)),++z>D)throw new Error("Maximum number of iterations reached, try changing options")}return{t:V,y:P}}}function g(e,t,n,r){return v({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,n,r)}function y(e,t,n,r){return v({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,n,r)}function b(e,t,n,r){var o=r.method?r.method:"RK45",a={RK23:g,RK45:y};if(o.toUpperCase()in a){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cte(Object(n),!0).forEach((function(t){ste(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cte(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r);return delete i.method,a[o.toUpperCase()](e,t,n,i)}var l=Object.keys(a).map((e=>'"'.concat(e,'"'))),s="".concat(l.slice(0,-1).join(", ")," and ").concat(l.slice(-1));throw new Error('Unavailable method "'.concat(o,'". Available methods are ').concat(s))}function w(e){return N1(e)||T1(e)}function x(e,t,n,r){var o=b(e,t.toArray(),n.toArray(),r);return{t:f(o.t),y:f(o.y)}}return t("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":x,"function, Array, Array":(e,t,n)=>b(e,t,n,{}),"function, Matrix, Matrix":(e,t,n)=>x(e,t,n,{}),"function, Array, number | BigNumber | Unit":(e,t,n)=>{var r=b(e,t,[n],{});return{t:r.t,y:r.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit":(e,t,n)=>{var r=b(e,t.toArray(),[n],{});return{t:f(r.t),y:f(r.y.map((e=>e[0])))}},"function, Array, number | BigNumber | Unit, Object":(e,t,n,r)=>{var o=b(e,t,[n],r);return{t:o.t,y:o.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,n,r)=>{var o=b(e,t.toArray(),[n],r);return{t:f(o.t),y:f(o.y.map((e=>e[0])))}}})})),dte=k2("erf",["typed"],(e=>{var{typed:t}=e;return t("name",{number:function(e){var t=Math.abs(e);return t>=vte?A2(e):t<=pte?A2(e)*function(e){var t,n=e*e,r=hte[0][4]*n,o=n;for(t=0;t<3;t+=1)r=(r+hte[0][t])*n,o=(o+mte[0][t])*n;return e*(r+hte[0][3])/(o+mte[0][3])}(t):t<=4?A2(e)*(1-function(e){var t,n=hte[1][8]*e,r=e;for(t=0;t<7;t+=1)n=(n+hte[1][t])*e,r=(r+mte[1][t])*e;var o=(n+hte[1][7])/(r+mte[1][7]),a=parseInt(16*e)/16,i=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-i)*o}(t)):A2(e)*(1-function(e){var t,n=1/(e*e),r=hte[2][5]*n,o=n;for(t=0;t<4;t+=1)r=(r+hte[2][t])*n,o=(o+mte[2][t])*n;var a=n*(r+hte[2][4])/(o+mte[2][4]);a=(fte-a)/e,n=parseInt(16*e)/16;var i=(e-n)*(e+n);return Math.exp(-n*n)*Math.exp(-i)*a}(t))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),pte=.46875,fte=.5641895835477563,hte=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],mte=[[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]],vte=Math.pow(2,53),gte="zeta",yte=k2(gte,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],(e=>{var{typed:t,config:n,multiply:r,pow:o,divide:a,factorial:i,equal:l,smallerEq:s,isNegative:c,gamma:u,sin:d,subtract:p,add:f,Complex:h,BigNumber:m,pi:v}=e;return t(gte,{number:e=>g(e,(e=>e),(()=>20)),BigNumber:e=>g(e,(e=>new m(e)),(()=>Math.abs(Math.log10(n.relTol)))),Complex:function(e){if(0===e.re&&0===e.im)return new h(-.5);if(1===e.re)return new h(NaN,NaN);if(e.re===1/0&&0===e.im)return new h(1);if(e.im===1/0||e.re===-1/0)return new h(NaN,NaN);return y(e,(e=>e),(e=>Math.round(19.5+.9*Math.abs(e.im))),(e=>e.re))}});function g(e,t,n){return l(e,0)?t(-.5):l(e,1)?t(NaN):isFinite(e)?y(e,t,n,(e=>e)):c(e)?t(NaN):t(1)}function y(e,t,n,i){var l=n(e);if(i(e)>-(l-1)/2)return function(e,t,n){for(var i=a(1,r(b(n(0),t),p(1,o(2,p(1,e))))),l=n(0),c=n(1);s(c,t);c=f(c,1))l=f(l,a(r((-1)**(c-1),b(c,t)),o(c,e)));return r(i,l)}(e,t(l),t);var c=r(o(2,e),o(t(v),p(e,1)));return c=r(c,d(r(a(t(v),2),e))),c=r(c,u(p(1,e))),r(c,y(p(1,e),t,n,i))}function b(e,t){for(var n=e,l=e;s(l,t);l=f(l,1)){var c=a(r(i(f(t,p(l,1))),o(4,l)),r(i(p(t,l)),i(r(2,l))));n=f(n,c)}return r(t,n)}})),bte="mode",wte=k2(bte,["typed","isNaN","isNumeric"],(e=>{var{typed:t,isNaN:n,isNumeric:r}=e;return t(bte,{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=P6(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},o=[],a=0,i=0;i<e.length;i++){var l=e[i];if(r(l)&&n(l))throw new Error("Cannot calculate mode of an array containing NaN values");l in t||(t[l]=0),t[l]++,t[l]===a?o.push(l):t[l]>a&&(a=t[l],o=[l])}return o}}));function xte(e,t,n){var r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+m2(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+m2(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var Cte="prod",_te=k2(Cte,["typed","config","multiplyScalar","numeric"],(e=>{var{typed:t,config:n,multiplyScalar:r,numeric:o}=e;return t(Cte,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var t;if(o8(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(n){throw xte(n,"prod",e)}})),"string"==typeof t&&(t=o(t,D2(t,n))),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),Ete="format",Ste=k2(Ete,["typed"],(e=>{var{typed:t}=e;return t(Ete,{any:h6,"any, Object | function | number | BigNumber":h6})})),kte=k2("bin",["typed","format"],(e=>{var{typed:t,format:n}=e;return t("bin",{"number | BigNumber":function(e){return n(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"bin",wordSize:t})}})})),Tte=k2("oct",["typed","format"],(e=>{var{typed:t,format:n}=e;return t("oct",{"number | BigNumber":function(e){return n(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"oct",wordSize:t})}})})),Nte=k2("hex",["typed","format"],(e=>{var{typed:t,format:n}=e;return t("hex",{"number | BigNumber":function(e){return n(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"hex",wordSize:t})}})})),Dte=/\$([\w.]+)/g,Ate="print",Ite=k2(Ate,["typed"],(e=>{var{typed:t}=e;return t(Ate,{"string, Object | Array":Rte,"string, Object | Array, number | Object":Rte})}));function Rte(e,t,n){return e.replace(Dte,(function(e,r){var o=r.split("."),a=t[o.shift()];for(void 0!==a&&a.isMatrix&&(a=a.toArray());o.length&&void 0!==a;){var i=o.shift();a=i?a[i]:a+"."}return void 0!==a?M1(a)?a:h6(a,n):e}))}var Mte=k2("to",["typed","matrix","concat"],(e=>{var{typed:t,matrix:n,concat:r}=e;return t("to",{"Unit, Unit | string":(e,t)=>e.to(t)},W9({typed:t,matrix:n,concat:r})({Ds:!0}))})),Ote="isPrime",Bte=k2(Ote,["typed"],(e=>{var{typed:t}=e;return t(Ote,{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(Math.pow(2,32))){for(var t=e.toNumber(),n=5;n*n<=t;n+=6)if(t%n===0||t%(n+2)===0)return!1;return!0}function r(e,t,n){for(var r=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(n)):(t=t.sub(1),r=e.mul(r).mod(n));return r}for(var o=e.constructor.clone({precision:2*e.toFixed(0).length}),a=0,i=(e=new o(e)).sub(1);i.mod(2).eq(0);)i=i.div(2),a+=1;var l=null;if(e.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((t=>t<e));else{var s=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));l=[];for(var c=2;c<=s;c+=1)l.push(s)}for(var u=0;u<l.length;u+=1){var d=l[u],p=r(e.sub(e).add(d),i,e);if(!p.eq(1))for(var f=0,h=p;!h.eq(e.sub(1));f+=1,h=h.mul(h).mod(e))if(f===a-1)return!1}return!0},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),Vte=k2("numeric",["number","?bignumber","?fraction"],(e=>{var{number:t,bignumber:n,fraction:r}=e,o={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:n?e=>n(e):Nee,bigint:e=>BigInt(e),Fraction:r?e=>r(e):Dee};return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");var n=m2(e);if(!(n in o))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; valid input types are '+Object.keys(o).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===n?e:a[t](e)}})),Pte="divideScalar",Lte=k2(Pte,["typed","numeric"],(e=>{var{typed:t,numeric:n}=e;return t(Pte,{"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)})})),Fte=k2("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],(e=>{var{typed:t,config:n,identity:r,multiply:o,matrix:a,inv:i,number:l,fraction:s,Complex:c}=e;return t("pow",{"number, number":u,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||n.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 r=e.pow(t);if(null!=r)return r;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(e.valueOf(),t.valueOf())},"Array, number":d,"Array, BigNumber":function(e,t){return d(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function u(e,t){if(n.predictable&&!N2(t)&&e<0)try{var r=s(t),o=l(r);if((t===o||Math.abs((t-o)/t)<1e-14)&&r.d%2==1)return(r.n%2==0?1:-1)*Math.pow(-e,t)}catch(a){}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:N2(t)||e>=0||n.predictable?A8(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new c(e,0).pow(t,0)}function d(e,t){if(!N2(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");var n=C6(e);if(2!==n.length)throw new Error("For A^b, A must be 2 dimensional (A has "+n.length+" dimensions)");if(n[0]!==n[1])throw new Error("For A^b, A must be square (size is "+n[0]+"x"+n[1]+")");if(t<0)try{return d(i(e),-t)}catch(s){if("Cannot calculate inverse, determinant is zero"===s.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw s}for(var a=r(n[0]).valueOf(),l=e;t>=1;)1&~t||(a=o(l,a)),t>>=1,l=o(l,l);return a}function p(e,t){return a(d(e.valueOf(),t))}})),zte="Number of decimals in function round must be an integer",jte="round",$te=k2(jte,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(e=>{var{typed:t,config:n,matrix:r,equalScalar:o,zeros:a,BigNumber:i,DenseMatrix:l}=e,s=x9({typed:t,equalScalar:o}),c=C9({typed:t,DenseMatrix:l}),u=_9({typed:t});function d(e){return Math.abs(F2(e).exponent)}return t(jte,{number:function(e){var t=I8(e,d(n.relTol));return I8(H2(e,t,n.relTol,n.absTol)?t:e)},"number, number":function(e,t){var r=d(n.relTol);if(t>=r)return I8(e,t);var o=I8(e,r);return I8(H2(e,o,n.relTol,n.absTol)?o:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);return new i(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(zte);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);var n=t.toNumber();return e.round(n)},BigNumber:function(e){var t=new i(e).toDecimalPlaces(d(n.relTol));return(_5(e,t,n.relTol,n.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);var r=d(n.relTol);if(t>=r)return e.toDecimalPlaces(t.toNumber());var o=e.toDecimalPlaces(r);return(_5(e,o,n.relTol,n.absTol)?o:e).toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(zte);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf((e=>function(t,n,r){var o=t.toNumeric(r);return r.multiply(e(o,n))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix, number, Unit":t.referToSelf((e=>(t,n,r)=>a8(t,(t=>e(t,n,r))))),"Array | Matrix, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Array | Matrix, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>s(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>u(r(t),n,e,!1).valueOf())),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf((e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):c(n,t,e,!0))),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf((e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):u(n,t,e,!0))),"number | Complex | BigNumber | Fraction, Array":t.referToSelf((e=>(t,n)=>u(r(n),t,e,!0).valueOf()))})})),Ute=k2("log",["config","typed","divideScalar","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,Complex:o}=e;return t("log",{number:function(e){return e>=0||n.predictable?function(e){return Math.log(e)}(e):new o(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||n.predictable?e.ln():new o(e.toNumber(),0).log()},"any, any":t.referToSelf((e=>(t,n)=>r(e(t),e(n))))})})),Hte="log1p",qte=k2(Hte,["typed","config","divideScalar","log","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,log:o,Complex:a}=e;return t(Hte,{number:function(e){return e>=-1||n.predictable?M2(e):i(new a(e,0))},Complex:i,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():i(new a(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"any, any":t.referToSelf((e=>(t,n)=>r(e(t),o(n))))});function i(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}})),Wte="nthRoots",Gte=k2(Wte,["config","typed","divideScalar","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,Complex:o}=e,a=[function(e){return new o(e,0)},function(e){return new o(0,e)},function(e){return new o(-e,0)},function(e){return new o(0,-e)}];function i(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new o(0,0)];var n,r="number"==typeof e;(r||0===e.re||0===e.im)&&(n=r?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var i=e.arg(),l=e.abs(),s=[],c=Math.pow(l,1/t),u=0;u<t;u++){var d=(n+4*u)/t;d!==Math.round(d)?s.push(new o({r:c,phi:(i+2*Math.PI*u)/t})):s.push(a[d%4](c))}return s}return t(Wte,{Complex:function(e){return i(e,2)},"Complex, number":i})})),Yte="dotPow",Kte=k2(Yte,["typed","equalScalar","matrix","pow","DenseMatrix","concat"],(e=>{var{typed:t,equalScalar:n,matrix:r,pow:o,DenseMatrix:a,concat:i}=e,l=$9({typed:t}),s=$7({typed:t,DenseMatrix:a}),c=x9({typed:t,equalScalar:n}),u=C9({typed:t,DenseMatrix:a}),d=W9({typed:t,matrix:r,concat:i}),p={};for(var f in o.signatures)Object.prototype.hasOwnProperty.call(o.signatures,f)&&(f.includes("Matrix")||f.includes("Array")||(p[f]=o.signatures[f]));var h=t(p);return t(Yte,d({elop:h,SS:s,DS:l,Ss:c,sS:u}))})),Xte="dotDivide",Jte=k2(Xte,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,divideScalar:o,DenseMatrix:a,concat:i}=e,l=j9({typed:t,equalScalar:r}),s=$9({typed:t}),c=$7({typed:t,DenseMatrix:a}),u=x9({typed:t,equalScalar:r}),d=C9({typed:t,DenseMatrix:a}),p=W9({typed:t,matrix:n,concat:i});return t(Xte,p({elop:o,SS:c,DS:s,SD:l,Ss:u,sS:d}))}));function Zte(e){var{DenseMatrix:t}=e;return function(e,n,r){var o=e.size();if(2!==o.length)throw new RangeError("Matrix must be two dimensional (size: "+h6(o)+")");var a=o[0];if(a!==o[1])throw new RangeError("Matrix must be square (size: "+h6(o)+")");var i=[];if(B1(n)){var l=n.size(),s=n._data;if(1===l.length){if(l[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c<a;c++)i[c]=[s[c]];return new t({data:i,size:[a,1],datatype:n._datatype})}if(2===l.length){if(l[0]!==a||1!==l[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(P1(n)){if(r){i=[];for(var u=0;u<a;u++)i[u]=[s[u][0]];return new t({data:i,size:[a,1],datatype:n._datatype})}return n}if(L1(n)){for(var d=0;d<a;d++)i[d]=[0];for(var p=n._values,f=n._index,h=n._ptr,m=h[1],v=h[0];v<m;v++){i[f[v]][0]=p[v]}return new t({data:i,size:[a,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(O1(n)){var g=C6(n);if(1===g.length){if(g[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var y=0;y<a;y++)i[y]=[n[y]];return new t({data:i,size:[a,1]})}if(2===g.length){if(g[0]!==a||1!==g[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<a;b++)i[b]=[n[b][0]];return new t({data:i,size:[a,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Qte="lsolve",ene=k2(Qte,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(Qte,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=[],m=0;m<u;m++){var v=n[m][0]||0;if(i(v,0))h[m]=[0];else{for(var g=0,y=[],b=[],w=f[m],x=f[m+1],C=w;C<x;C++){var _=p[C];_===m?g=d[C]:_>m&&(y.push(d[C]),b.push(_))}if(i(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var E=r(v,g),S=0,k=b.length;S<k;S++){var T=b[S];n[T]=[a(n[T][0]||0,o(E,y[S]))]}h[m]=[E]}}return new l({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(n(e),t).valueOf()}});function c(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=[],p=e._data,f=0;f<u;f++){var h=n[f][0]||0,m=void 0;if(i(h,0))m=0;else{var v=p[f][f];if(i(v,0))throw new Error("Linear system cannot be solved since matrix is singular");m=r(h,v);for(var g=f+1;g<c;g++)n[g]=[a(n[g][0]||0,o(m,p[g][f]))]}d[f]=[m]}return new l({data:d,size:[c,1]})}})),tne="usolve",nne=k2(tne,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(tne,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=[],m=u-1;m>=0;m--){var v=n[m][0]||0;if(i(v,0))h[m]=[0];else{for(var g=0,y=[],b=[],w=f[m],x=f[m+1]-1;x>=w;x--){var C=p[x];C===m?g=d[x]:C<m&&(y.push(d[x]),b.push(C))}if(i(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var _=r(v,g),E=0,S=b.length;E<S;E++){var k=b[E];n[k]=[a(n[k][0],o(_,y[E]))]}h[m]=[_]}}return new l({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(n(e),t).valueOf()}});function c(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=[],p=e._data,f=u-1;f>=0;f--){var h=n[f][0]||0,m=void 0;if(i(h,0))m=0;else{var v=p[f][f];if(i(v,0))throw new Error("Linear system cannot be solved since matrix is singular");m=r(h,v);for(var g=f-1;g>=0;g--)n[g]=[a(n[g][0]||0,o(m,p[g][f]))]}d[f]=[m]}return new l({data:d,size:[c,1]})}})),rne="lsolveAll",one=k2(rne,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(rne,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=0;h<u;h++)for(var m=n.length,v=0;v<m;v++){for(var g=n[v],y=[],b=[],w=f[h],x=f[h+1],C=0,_=w;_<x;_++){var E=p[_];E===h?C=d[_]:E>h&&(y.push(d[_]),b.push(E))}if(i(C,0))if(i(g[h],0)){if(0===v){var S=[...g];S[h]=1;for(var k=0,T=b.length;k<T;k++){var N=b[k];S[N]=a(S[N],y[k])}n.push(S)}}else{if(0===v)return[];n.splice(v,1),v-=1,m-=1}else{g[h]=r(g[h],C);for(var D=0,A=b.length;D<A;D++){var I=b[D];g[I]=a(g[I],o(g[h],y[D]))}}}return n.map((e=>new l({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(n(e),t).map((e=>e.valueOf()))}});function c(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._data,u=e._size[0],d=e._size[1],p=0;p<d;p++)for(var f=n.length,h=0;h<f;h++){var m=n[h];if(i(c[p][p],0))if(i(m[p],0)){if(0===h){var v=[...m];v[p]=1;for(var g=p+1;g<d;g++)v[g]=a(v[g],c[g][p]);n.push(v)}}else{if(0===h)return[];n.splice(h,1),h-=1,f-=1}else{m[p]=r(m[p],c[p][p]);for(var y=p+1;y<d;y++)m[y]=a(m[y],o(m[p],c[y][p]))}}return n.map((e=>new l({data:e.map((e=>[e])),size:[u,1]})))}})),ane="usolveAll",ine=k2(ane,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(ane,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=u-1;h>=0;h--)for(var m=n.length,v=0;v<m;v++){for(var g=n[v],y=[],b=[],w=f[h],x=0,C=f[h+1]-1;C>=w;C--){var _=p[C];_===h?x=d[C]:_<h&&(y.push(d[C]),b.push(_))}if(i(x,0))if(i(g[h],0)){if(0===v){var E=[...g];E[h]=1;for(var S=0,k=b.length;S<k;S++){var T=b[S];E[T]=a(E[T],y[S])}n.push(E)}}else{if(0===v)return[];n.splice(v,1),v-=1,m-=1}else{g[h]=r(g[h],x);for(var N=0,D=b.length;N<D;N++){var A=b[N];g[A]=a(g[A],o(g[h],y[N]))}}}return n.map((e=>new l({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(n(e),t).map((e=>e.valueOf()))}});function c(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._data,u=e._size[0],d=e._size[1]-1;d>=0;d--)for(var p=n.length,f=0;f<p;f++){var h=n[f];if(i(c[d][d],0))if(i(h[d],0)){if(0===f){var m=[...h];m[d]=1;for(var v=d-1;v>=0;v--)m[v]=a(m[v],c[v][d]);n.push(m)}}else{if(0===f)return[];n.splice(f,1),f-=1,p-=1}else{h[d]=r(h[d],c[d][d]);for(var g=d-1;g>=0;g--)h[g]=a(h[g],o(h[d],c[g][d]))}}return n.map((e=>new l({data:e.map((e=>[e])),size:[u,1]})))}})),lne=k2("matAlgo08xS0Sid",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");if(!a||!u)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));for(var x,C,_,E,S=[],k=[],T=[],N=[],D=[],A=0;A<g;A++){T[A]=k.length;var I=A+1;for(C=l[A],_=l[A+1],x=C;x<_;x++)D[E=i[x]]=I,N[E]=a[x],k.push(E);for(C=p[A],_=p[A+1],x=C;x<_;x++)D[E=d[x]]===I&&(N[E]=w(N[E],u[x]));for(x=T[A];x<k.length;){var R=N[E=k[x]];y(R,b)?k.splice(x,1):(S.push(R),x++)}}return T[g]=k.length,e.createSparseMatrix({values:S,index:k,ptr:T,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),sne=k2("useMatrixForArrayScalar",["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return{"Array, number":t.referTo("DenseMatrix, number",(e=>(t,r)=>e(n(t),r).valueOf())),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",(e=>(t,r)=>e(n(t),r).valueOf())),"number, Array":t.referTo("number, DenseMatrix",(e=>(t,r)=>e(t,n(r)).valueOf())),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",(e=>(t,r)=>e(t,n(r)).valueOf()))}})),cne="leftShift",une=k2(cne,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,DenseMatrix:a,concat:i}=e,l=Y9({typed:t}),s=j9({typed:t,equalScalar:r}),c=lne({typed:t,equalScalar:r}),u=X9({typed:t,DenseMatrix:a}),d=x9({typed:t,equalScalar:r}),p=_9({typed:t}),f=W9({typed:t,matrix:n,concat:i}),h=sne({typed:t,matrix:n});return t(cne,{"number, number":P8,"BigNumber, BigNumber":O7,"bigint, bigint":(e,t)=>e<<t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):u(n,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):p(n,t,e,!0)))},h,f({SS:c,DS:l,SD:s}))})),dne="rightArithShift",pne=k2(dne,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,DenseMatrix:a,concat:i}=e,l=Y9({typed:t}),s=j9({typed:t,equalScalar:r}),c=lne({typed:t,equalScalar:r}),u=X9({typed:t,DenseMatrix:a}),d=x9({typed:t,equalScalar:r}),p=_9({typed:t}),f=W9({typed:t,matrix:n,concat:i}),h=sne({typed:t,matrix:n});return t(dne,{"number, number":L8,"BigNumber, BigNumber":B7,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):u(n,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):p(n,t,e,!0)))},h,f({SS:c,DS:l,SD:s}))})),fne="rightLogShift",hne=k2(fne,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,DenseMatrix:a,concat:i}=e,l=Y9({typed:t}),s=j9({typed:t,equalScalar:r}),c=lne({typed:t,equalScalar:r}),u=X9({typed:t,DenseMatrix:a}),d=x9({typed:t,equalScalar:r}),p=_9({typed:t}),f=W9({typed:t,matrix:n,concat:i}),h=sne({typed:t,matrix:n});return t(fne,{"number, number":F8,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):u(n,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):p(n,t,e,!0)))},h,f({SS:c,DS:l,SD:s}))})),mne=k2("and",["typed","matrix","equalScalar","zeros","not","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i}=e,l=j9({typed:t,equalScalar:r}),s=r7({typed:t,equalScalar:r}),c=x9({typed:t,equalScalar:r}),u=_9({typed:t}),d=W9({typed:t,matrix:n,concat:i});return t("and",{"number, number":K8,"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":K8,"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t.value||0,n.value||0))),"SparseMatrix, any":t.referToSelf((e=>(t,n)=>a(n)?o(t.size(),t.storage()):c(t,n,e,!1))),"DenseMatrix, any":t.referToSelf((e=>(t,n)=>a(n)?o(t.size(),t.storage()):u(t,n,e,!1))),"any, SparseMatrix":t.referToSelf((e=>(t,n)=>a(t)?o(t.size(),t.storage()):c(n,t,e,!0))),"any, DenseMatrix":t.referToSelf((e=>(t,n)=>a(t)?o(t.size(),t.storage()):u(n,t,e,!0))),"Array, any":t.referToSelf((e=>(t,r)=>e(n(t),r).valueOf())),"any, Array":t.referToSelf((e=>(t,r)=>e(t,n(r)).valueOf()))},d({SS:s,DS:l}))})),vne="compare",gne=k2(vne,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],(e=>{var{typed:t,config:n,equalScalar:r,matrix:o,BigNumber:a,Fraction:i,DenseMatrix:l,concat:s}=e,c=$9({typed:t}),u=U9({typed:t,equalScalar:r}),d=C9({typed:t,DenseMatrix:l}),p=W9({typed:t,matrix:o,concat:s}),f=L5({typed:t});return t(vne,yne({typed:t,config:n}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return _5(e,t,n.relTol,n.absTol)?new a(0):new a(e.cmp(t))},"bigint, bigint":function(e,t){return e===t?0n:e>t?1n:-1n},"Fraction, Fraction":function(e,t){return new i(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,p({SS:u,DS:c,Ss:d}))})),yne=k2(vne,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(vne,{"number, number":function(e,t){return H2(e,t,n.relTol,n.absTol)?0:e>t?1:-1}})})),bne=function e(t,n){var r,o,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,u=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=u(t).replace(i,"")||"",p=u(n).replace(i,"")||"",f=d.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(d.match(s),16)||1!==f.length&&d.match(l)&&Date.parse(d),v=parseInt(p.match(s),16)||m&&p.match(l)&&Date.parse(p)||null;if(v){if(m<v)return-1;if(m>v)return 1}for(var g=0,y=Math.max(f.length,h.length);g<y;g++){if(r=!(f[g]||"").match(c)&&parseFloat(f[g])||f[g]||0,o=!(h[g]||"").match(c)&&parseFloat(h[g])||h[g]||0,isNaN(r)!==isNaN(o))return isNaN(r)?1:-1;if(typeof r!=typeof o&&(r+="",o+=""),r<o)return-1;if(r>o)return 1}return 0};const wne=P(bne);var xne="compareNatural",Cne=k2(xne,["typed","compare"],(e=>{var{typed:t,compare:n}=e,r=n.signatures["boolean,boolean"];return t(xne,{"any, any":function e(t,i){var l,s=m2(t),c=m2(i);if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==c&&"BigNumber"!==c&&"Fraction"!==c))return"0"!==(l=n(t,i)).toString()?l>0?1:-1:wne(s,c);var u=["Array","DenseMatrix","SparseMatrix"];if(u.includes(s)||u.includes(c))return 0!==(l=o(e,t,i))?l:wne(s,c);if(s!==c)return wne(s,c);if("Complex"===s)return function(e,t){if(e.re>t.re)return 1;if(e.re<t.re)return-1;if(e.im>t.im)return 1;if(e.im<t.im)return-1;return 0}(t,i);if("Unit"===s)return t.equalBase(i)?e(t.value,i.value):a(e,t.formatUnits(),i.formatUnits());if("boolean"===s)return r(t,i);if("string"===s)return wne(t,i);if("Object"===s)return function(e,t,n){var r=Object.keys(t),o=Object.keys(n);r.sort(wne),o.sort(wne);var i=a(e,r,o);if(0!==i)return i;for(var l=0;l<r.length;l++){var s=e(t[r[l]],n[o[l]]);if(0!==s)return s}return 0}(e,t,i);if("null"===s)return 0;if("undefined"===s)return 0;throw new TypeError('Unsupported type of value "'+s+'"')}});function o(e,t,n){return L1(t)&&L1(n)?a(e,t.toJSON().values,n.toJSON().values):L1(t)?o(e,t.toArray(),n):L1(n)?o(e,t,n.toArray()):P1(t)?o(e,t.toJSON().data,n):P1(n)?o(e,t,n.toJSON().data):Array.isArray(t)?Array.isArray(n)?a(e,t,n):o(e,t,[n]):o(e,[t],n)}function a(e,t,n){for(var r=0,o=Math.min(t.length,n.length);r<o;r++){var a=e(t[r],n[r]);if(0!==a)return a}return t.length>n.length?1:t.length<n.length?-1:0}}));var _ne="compareText",Ene=["typed","matrix","concat"];b6.signature="any, any";var Sne=k2(_ne,Ene,(e=>{var{typed:t,matrix:n,concat:r}=e,o=W9({typed:t,matrix:n,concat:r});return t(_ne,b6,o({elop:b6,Ds:!0}))})),kne="equal",Tne=k2(kne,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:n,concat:a});return t(kne,Nne({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:i,Ss:s}))})),Nne=k2(kne,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(kne,{"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:n(e,t)}})})),Dne="equalText",Ane=k2(Dne,["typed","compareText","isZero"],(e=>{var{typed:t,compareText:n,isZero:r}=e;return t(Dne,{"any, any":function(e,t){return r(n(e,t))}})})),Ine="smaller",Rne=k2(Ine,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(Ine,Mne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<t,"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!_5(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e<t,"Fraction, Fraction":(e,t)=>-1===e.compare(t),"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),Mne=k2(Ine,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(Ine,{"number, number":function(e,t){return e<t&&!H2(e,t,n.relTol,n.absTol)}})})),One="smallerEq",Bne=k2(One,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(One,Vne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||_5(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e<=t,"Fraction, Fraction":(e,t)=>1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),Vne=k2(One,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(One,{"number, number":function(e,t){return e<=t||H2(e,t,n.relTol,n.absTol)}})})),Pne="larger",Lne=k2(Pne,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(Pne,Fne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!_5(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>1===e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),Fne=k2(Pne,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(Pne,{"number, number":function(e,t){return e>t&&!H2(e,t,n.relTol,n.absTol)}})})),zne="largerEq",jne=k2(zne,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(zne,$ne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||_5(e,t,n.relTol,n.absTol)},"bigint, bigint":function(e,t){return e>=t},"Fraction, Fraction":(e,t)=>-1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),$ne=k2(zne,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(zne,{"number, number":function(e,t){return e>=t||H2(e,t,n.relTol,n.absTol)}})})),Une="deepEqual",Hne=k2(Une,["typed","equal"],(e=>{var{typed:t,equal:n}=e;return t(Une,{"any, any":function(e,t){return r(e.valueOf(),t.valueOf())}});function r(e,t){if(Array.isArray(e)){if(Array.isArray(t)){var o=e.length;if(o!==t.length)return!1;for(var a=0;a<o;a++)if(!r(e[a],t[a]))return!1;return!0}return!1}return!Array.isArray(t)&&n(e,t)}})),qne="unequal",Wne=k2(qne,["typed","config","equalScalar","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,equalScalar:r,matrix:o,DenseMatrix:a,concat:i}=e,l=$9({typed:t}),s=$7({typed:t,DenseMatrix:a}),c=C9({typed:t,DenseMatrix:a}),u=W9({typed:t,matrix:o,concat:i});return t(qne,Gne({typed:t,equalScalar:r}),u({elop:function(e,t){return!r(e,t)},SS:s,DS:l,Ss:c}))})),Gne=k2(qne,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(qne,{"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:!n(e,t)}})})),Yne="partitionSelect",Kne=k2(Yne,["typed","isNumeric","isNaN","compare"],(e=>{var{typed:t,isNumeric:n,isNaN:r,compare:o}=e,a=o,i=(e,t)=>-o(e,t);return t(Yne,{"Array | Matrix, number":function(e,t){return l(e,t,a)},"Array | Matrix, number, string":function(e,t,n){if("asc"===n)return l(e,t,a);if("desc"===n)return l(e,t,i);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(e,t,n){if(!N2(t)||t<0)throw new Error("k must be a non-negative integer");if(B1(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return s(e.valueOf(),t,n)}if(Array.isArray(e))return s(e,t,n)}function s(e,t,o){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a<e.length;a++)if(n(e[a])&&r(e[a]))return e[a];for(var i=0,l=e.length-1;i<l;){for(var s=i,c=l,u=e[Math.floor(Math.random()*(l-i+1))+i];s<c;)if(o(e[s],u)>=0){var d=e[c];e[c]=e[s],e[s]=d,--c}else++s;o(e[s],u)>0&&--s,t<=s?l=s:i=s+1}return e[t]}})),Xne="sort",Jne=k2(Xne,["typed","matrix","compare","compareNatural"],(e=>{var{typed:t,matrix:n,compare:r,compareNatural:o}=e,a=r,i=(e,t)=>-r(e,t);return t(Xne,{Array:function(e){return s(e),e.sort(a)},Matrix:function(e){return c(e),n(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return s(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),n(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return s(e),e.sort(l(t))},"Matrix, string":function(e,t){return c(e),n(e.toArray().sort(l(t)),e.storage())}});function l(e){if("asc"===e)return a;if("desc"===e)return i;if("natural"===e)return o;throw new Error('String "asc", "desc", or "natural" expected')}function s(e){if(1!==C6(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),Zne=k2("max",["typed","config","numeric","larger"],(e=>{var{typed:t,config:n,numeric:r,larger:o}=e;return t("max",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){return i8(e,t.valueOf(),a)},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function max");return i(e)}});function a(e,t){try{return o(e,t)?e:t}catch(n){throw xte(n,"max",t)}}function i(e){var t;if(o8(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||o(e,t))&&(t=e)}catch(n){throw xte(n,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=r(t,D2(t,n))),t}})),Qne=k2("min",["typed","config","numeric","smaller"],(e=>{var{typed:t,config:n,numeric:r,smaller:o}=e;return t("min",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){return i8(e,t.valueOf(),a)},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function min");return i(e)}});function a(e,t){try{return o(e,t)?e:t}catch(n){throw xte(n,"min",t)}}function i(e){var t;if(o8(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||o(e,t))&&(t=e)}catch(n){throw xte(n,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=r(t,D2(t,n))),t}})),ere=k2("ImmutableDenseMatrix",["smaller","DenseMatrix"],(e=>{var{smaller:t,DenseMatrix:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M1(t))throw new Error("Invalid datatype: "+t);if(B1(e)||O1(e)){var o=new n(e,t);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(e&&O1(e.data)&&O1(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 new TypeError("Unsupported type of data ("+m2(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return B1(t)?new r({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:v2(this._data),size:v2(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(n){(null===e||t(n,e))&&(e=n)})),this._min=null!==e?e:void 0}return this._min},r.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(n){(null===e||t(e,n))&&(e=n)})),this._max=null!==e?e:void 0}return this._max},r}),{isClass:!0}),tre=k2("Index",["ImmutableDenseMatrix","getMatrixDataType"],(e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var t=0,a=arguments.length;t<a;t++){var i=arguments[t],l=O1(i),s=B1(i),c=null;if(F1(i))this._dimensions.push(i),this._isScalar=!1;else if(l||s){var u=void 0;"boolean"===n(i)?(l&&(u=o(nre(i).valueOf())),s&&(u=o(nre(i._data).valueOf())),c=i.valueOf().length):u=o(i.valueOf()),this._dimensions.push(u);var d=u.size();1===d.length&&1===d[0]&&null===c||(this._isScalar=!1)}else if("number"==typeof i)this._dimensions.push(o([i]));else{if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(i)}this._sourceSize.push(c)}}function o(e){for(var n=0,r=e.length;n<r;n++)if("number"!=typeof e[n]||!N2(e[n]))throw new TypeError("Index parameters must be positive integer numbers");return new t(e)}return r.prototype.type="Index",r.prototype.isIndex=!0,r.prototype.clone=function(){var e=new r;return e._dimensions=v2(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},r.create=function(e){var t=new r;return r.apply(t,e),t},r.prototype.size=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"==typeof r?1:r.size()[0]}return e},r.prototype.max=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"==typeof r?r:r.max()}return e},r.prototype.min=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"==typeof r?r:r.min()}return e},r.prototype.forEach=function(e){for(var t=0,n=this._dimensions.length;t<n;t++)e(this._dimensions[t],t,this)},r.prototype.dimension=function(e){return this._dimensions[e]||null},r.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e.push("string"==typeof r?r:r.toArray())}return e},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];"string"==typeof r?e.push(JSON.stringify(r)):e.push(r.toString())}return"["+e.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(e){return r.create(e.dimensions)},r}),{isClass:!0});function nre(e){var t=[];return e.forEach(((e,n)=>{e&&t.push(n)})),t}var rre=k2("FibonacciHeap",["smaller","larger"],(e=>{var{smaller:t,larger:n}=e,r=1/Math.log((1+Math.sqrt(5))/2);function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,t,n){t.left.right=t.right,t.right.left=t.left,n.degree--,n.child===t&&(n.child=t.right),0===n.degree&&(n.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function i(e,t){var n=t.parent;n&&(t.mark?(a(e,t,n),i(n)):t.mark=!0)}o.prototype.type="FibonacciHeap",o.prototype.isFibonacciHeap=!0,o.prototype.insert=function(e,n){var r={key:e,value:n,degree:0};if(this._minimum){var o=this._minimum;r.left=o,r.right=o.right,o.right=r,r.right.left=r,t(e,o.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},o.prototype.size=function(){return this._size},o.prototype.clear=function(){this._minimum=null,this._size=0},o.prototype.isEmpty=function(){return 0===this._size},o.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var o=this._minimum,a=e.degree,i=e.child;a>0;){var s=i.right;i.left.right=i.right,i.right.left=i.left,i.left=o,i.right=o.right,o.right=i,i.right.left=i,i.parent=null,i=s,a--}return e.left.right=e.right,e.right.left=e.left,o=e===e.right?null:function(e,o){var a,i=Math.floor(Math.log(o)*r)+1,s=new Array(i),c=0,u=e;if(u)for(c++,u=u.right;u!==e;)c++,u=u.right;for(;c>0;){for(var d=u.degree,p=u.right;a=s[d];){if(n(u.key,a.key)){var f=a;a=u,u=f}l(a,u),s[d]=null,d++}s[d]=u,u=p,c--}e=null;for(var h=0;h<i;h++)(a=s[h])&&(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}(o=e.right,this._size),this._size--,this._minimum=o,e},o.prototype.remove=function(e){this._minimum=function(e,n,r){n.key=r;var o=n.parent;o&&t(n.key,o.key)&&(a(e,n,o),i(e,o));t(n.key,e.key)&&(e=n);return e}(this._minimum,e,-1),this.extractMinimum()};var l=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 o}),{isClass:!0}),ore=k2("Spa",["addScalar","equalScalar","FibonacciHeap"],(e=>{var{addScalar:t,equalScalar:n,FibonacciHeap:r}=e;function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new r}return o.prototype.type="Spa",o.prototype.isSpa=!0,o.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var n=this._heap.insert(e,t);this._values[e]=n}},o.prototype.get=function(e){var t=this._values[e];return t?t.value:0},o.prototype.accumulate=function(e,n){var r=this._values[e];r?r.value=t(r.value,n):(r=this._heap.insert(e,n),this._values[e]=r)},o.prototype.forEach=function(e,t,r){var o=this._heap,a=this._values,i=[],l=o.extractMinimum();for(l&&i.push(l);l&&l.key<=t;)l.key>=e&&(n(l.value,0)||r(l.key,l.value,this)),(l=o.extractMinimum())&&i.push(l);for(var s=0;s<i.length;s++){var c=i[s];a[(l=o.insert(c.key,c.value)).key]=l}},o.prototype.swap=function(e,t){var n=this._values[e],r=this._values[t];if(!n&&r)n=this._heap.insert(e,r.value),this._heap.remove(r),this._values[e]=n,this._values[t]=void 0;else if(n&&!r)r=this._heap.insert(t,n.value),this._heap.remove(n),this._values[t]=r,this._values[e]=void 0;else if(n&&r){var o=n.value;n.value=r.value,r.value=o}},o}),{isClass:!0});function are(e){var t=0,n=1,r=Object.create(null),o=Object.create(null),a=0,i=function(e){var i=o[e];if(i&&(delete r[i],delete o[e],--t,n===i)){if(!t)return a=0,void(n=1);for(;!Object.prototype.hasOwnProperty.call(r,++n););}};return e=Math.abs(e),{hit:function(l){var s=o[l],c=++a;if(r[c]=l,o[l]=c,!s){if(++t<=e)return;return l=r[n],i(l),l}if(delete r[s],n===s)for(;!Object.prototype.hasOwnProperty.call(r,++n););},delete:i,clear:function(){t=a=0,n=1,r=Object.create(null),o=Object.create(null)}}}function ire(e){var{hasher:t,limit:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=null==n?Number.POSITIVE_INFINITY:n,t=null==t?JSON.stringify:t,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:are(n||Number.POSITIVE_INFINITY)});for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var i=t(o);if(r.cache.values.has(i))return r.cache.lru.hit(i),r.cache.values.get(i);var l=e.apply(e,o);return r.cache.values.set(i,l),r.cache.values.delete(r.cache.lru.hit(i)),l}}var lre=ire((function(e){return new e(1).exp()}),{hasher:dre}),sre=ire((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),{hasher:dre}),cre=ire((function(e){return e.acos(-1)}),{hasher:dre}),ure=ire((function(e){return cre(e).times(2)}),{hasher:dre});function dre(e){return e[0].precision}function pre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pre(Object(n),!0).forEach((function(t){ste(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pre(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hre=k2("Unit",["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],(e=>{var t,n,r,{on:o,config:a,addScalar:i,subtractScalar:l,multiplyScalar:s,divideScalar:c,pow:u,abs:d,fix:p,round:f,equal:h,isNumeric:m,format:v,number:g,Complex:y,BigNumber:b,Fraction:w}=e,x=g;function C(e,t){if(!(this instanceof C))throw new Error("Constructor must be called with the new operator");if(null!=e&&!m(e)&&!A1(e))throw new 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=M.map((e=>0));else if("string"==typeof t){var n=C.parse(t);this.units=n.units,this.dimensions=n.dimensions}else{if(!R1(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map((e=>h1({},e)))}this.value=this._normalize(e)}function _(){for(;" "===r||"\t"===r;)S()}function E(e){return e>="0"&&e<="9"}function S(){n++,r=t.charAt(n)}function k(e){n=e,r=t.charAt(n)}function T(){var e,t="",o=n;if("+"===r?S():"-"===r&&(t+=r,S()),!((e=r)>="0"&&e<="9"||"."===e))return k(o),null;if("."===r){if(t+=r,S(),!E(r))return k(o),null}else{for(;E(r);)t+=r,S();"."===r&&(t+=r,S())}for(;E(r);)t+=r,S();if("E"===r||"e"===r){var a="",i=n;if(a+=r,S(),"+"!==r&&"-"!==r||(a+=r,S()),!E(r))return k(i),t;for(t+=a;E(r);)t+=r,S()}return t}function N(){for(var e="";E(r)||C.isValidAlpha(r);)e+=r,S();var t=e.charAt(0);return C.isValidAlpha(t)?e:null}function D(e){return r===e?(S(),e):null}Object.defineProperty(C,"name",{value:"Unit"}),C.prototype.constructor=C,C.prototype.type="Unit",C.prototype.isUnit=!0,C.parse=function(e,o){if(o=o||{},n=-1,r="","string"!=typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var i=new C;i.units=[];var l=1,s=!1;S(),_();var c=T(),u=null;if(c){if("BigNumber"===a.number)u=new b(c);else if("Fraction"===a.number)try{u=new w(c)}catch(E){u=parseFloat(c)}else u=parseFloat(c);_(),D("*")?(l=1,s=!0):D("/")&&(l=-1,s=!0)}for(var d=[],p=1;;){for(_();"("===r;)d.push(l),p*=l,l=1,S(),_();var f=void 0;if(!r)break;var h=r;if(null===(f=N()))throw new SyntaxError('Unexpected "'+h+'" in "'+t+'" at index '+n.toString());var m=A(f);if(null===m)throw new SyntaxError('Unit "'+f+'" not found.');var v=l*p;if(_(),D("^")){_();var g=T();if(null===g)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');v*=g}i.units.push({unit:m.unit,prefix:m.prefix,power:v});for(var y=0;y<M.length;y++)i.dimensions[y]+=(m.unit.dimensions[y]||0)*v;for(_();")"===r;){if(0===d.length)throw new SyntaxError('Unmatched ")" in "'+t+'" at index '+n.toString());p/=d.pop(),S(),_()}if(s=!1,D("*")?(l=1,s=!0):D("/")?(l=-1,s=!0):l=1,m.unit.base){var x=m.unit.base.key;z.auto[x]={unit:m.unit,prefix:m.prefix}}}if(_(),r)throw new SyntaxError('Could not parse: "'+e+'"');if(s)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==d.length)throw new SyntaxError('Unmatched "(" in "'+t+'"');if(0===i.units.length&&!o.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return i.value=void 0!==u?i._normalize(u):null,i},C.prototype.clone=function(){var e=new C;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=v2(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var n in e.units[t]={},this.units[t])b2(this.units[t],n)&&(e.units[t][n]=this.units[t][n]);return e},C.prototype.valueType=function(){return m2(this.value)},C.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},C.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,n=C._getNumberConverter(m2(e)),r=0;r<this.units.length;r++){var o=n(this.units[r].unit.value),a=n(this.units[r].prefix.value),i=n(this.units[r].power);t=s(t,u(s(o,a),i))}return t},C.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var n=e,r=C._getNumberConverter(m2(e)),o=0;o<this.units.length;o++){var a=r(this.units[o].unit.value),i=r(this.units[o].prefix.value),l=r(this.units[o].power);n=c(n,u(s(a,i),l))}return n};var A=ire((e=>{if(b2(P,e)){var t=P[e];return{unit:t,prefix:t.prefixes[""]}}for(var n in P)if(b2(P,n)&&f6(e,n)){var r=P[n],o=e.length-n.length,a=e.substring(0,o),i=b2(r.prefixes,a)?r.prefixes[a]:void 0;if(void 0!==i)return{unit:r,prefix:i}}return null}),{hasher:e=>e[0],limit:100});function I(e){return e.equalBase(O.NONE)&&null!==e.value&&!a.predictable?e.value:e}C.isValuelessUnit=function(e){return null!==A(e)},C.prototype.hasBase=function(e){if("string"==typeof e&&(e=O[e]),!e)return!1;for(var t=0;t<M.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equalBase=function(e){for(var t=0;t<M.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equals=function(e){return this.equalBase(e)&&h(this.value,e.value)},C.prototype.multiply=function(e){for(var t=this.clone(),n=R1(e)?e:new C(e),r=0;r<M.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(n.dimensions[r]||0);for(var o=0;o<n.units.length;o++){var a=fre({},n.units[o]);t.units.push(a)}if(null!==this.value||null!==n.value){var i=null===this.value?this._normalize(1):this.value,l=null===n.value?n._normalize(1):n.value;t.value=s(i,l)}else t.value=null;return R1(e)&&(t.skipAutomaticSimplification=!1),I(t)},C.prototype.divideInto=function(e){return new C(e).divide(this)},C.prototype.divide=function(e){for(var t=this.clone(),n=R1(e)?e:new C(e),r=0;r<M.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(n.dimensions[r]||0);for(var o=0;o<n.units.length;o++){var a=fre(fre({},n.units[o]),{},{power:-n.units[o].power});t.units.push(a)}if(null!==this.value||null!==n.value){var i=null===this.value?this._normalize(1):this.value,l=null===n.value?n._normalize(1):n.value;t.value=c(i,l)}else t.value=null;return R1(e)&&(t.skipAutomaticSimplification=!1),I(t)},C.prototype.pow=function(e){for(var t=this.clone(),n=0;n<M.length;n++)t.dimensions[n]=(this.dimensions[n]||0)*e;for(var r=0;r<t.units.length;r++)t.units[r].power*=e;return null!==t.value?t.value=u(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,I(t)},C.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=d(e.value);else{var t=e._numberConverter(),n=t(e.units[0].unit.value),r=t(e.units[0].unit.offset),o=s(n,r);e.value=l(d(i(e.value,o)),o)}for(var a in e.units)"VA"!==e.units[a].unit.name&&"VAR"!==e.units[a].unit.name||(e.units[a].unit=P.W);return e},C.prototype.to=function(e){var t,n=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=C.parse(e);else{if(!R1(e))throw new Error("String or Unit expected as parameter");t=e.clone()}if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new 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=v2(n);else{var r=C._getNumberConverter(m2(n)),o=this.units[0].unit.value,a=this.units[0].unit.offset,c=s(o,a),u=t.units[0].unit.value,d=t.units[0].unit.offset,p=s(u,d);t.value=i(n,r(l(c,p)))}return t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},C.prototype.toNumber=function(e){return x(this.toNumeric(e))},C.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)},C.prototype.toString=function(){return this.format()},C.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},C.fromJSON=function(e){var t,n=new C(e.value,null!==(t=e.unit)&&void 0!==t?t:void 0);return n.fixPrefix=e.fixPrefix||!1,n},C.prototype.valueOf=C.prototype.toString,C.prototype.simplify=function(){var e,t,n=this.clone(),r=[];for(var o in j)if(b2(j,o)&&n.hasBase(O[o])){e=o;break}if("NONE"===e)n.units=[];else if(e&&b2(j,e)&&(t=j[e]),t)n.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,i=0;i<M.length;i++){var l=M[i];Math.abs(n.dimensions[i]||0)>1e-12&&(b2(j,l)?r.push({unit:j[l].unit,prefix:j[l].prefix,power:n.dimensions[i]||0}):a=!0)}r.length<n.units.length&&!a&&(n.units=r)}return n},C.prototype.toSI=function(){for(var e=this.clone(),t=[],n=0;n<M.length;n++){var r=M[n];if(Math.abs(e.dimensions[n]||0)>1e-12){if(!b2(z.si,r))throw new Error("Cannot express custom unit "+r+" in SI units");t.push({unit:z.si[r].unit,prefix:z.si[r].prefix,power:e.dimensions[n]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},C.prototype.formatUnits=function(){for(var e="",t="",n=0,r=0,o=0;o<this.units.length;o++)this.units[o].power>0?(n++,e+=" "+this.units[o].prefix.name+this.units[o].unit.name,Math.abs(this.units[o].power-1)>1e-15&&(e+="^"+this.units[o].power)):this.units[o].power<0&&r++;if(r>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(n>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),n>1&&r>0&&(e="("+e+")"),r>1&&n>0&&(t="("+t+")");var i=e;return n>0&&r>0&&(i+=" / "),i+=t},C.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),n=!1;for(var r in void 0!==t.value&&null!==t.value&&A1(t.value)&&(n=Math.abs(t.value.re)<1e-14),t.units)b2(t.units,r)&&t.units[r].unit&&("VA"===t.units[r].unit.name&&n?t.units[r].unit=P.VAR:"VAR"!==t.units[r].unit.name||n||(t.units[r].unit=P.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var o=t._denormalize(t.value),a=null!==t.value?v(o,e||{}):"",i=t.formatUnits();return t.value&&A1(t.value)&&(a="("+a+")"),i.length>0&&a.length>0&&(a+=" "),a+=i},C.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?d(this.value):0,t=d(this.units[0].unit.value),n=this.units[0].prefix;if(0===e)return n;var r=this.units[0].power,o=Math.log(e/Math.pow(n.value*t,r))/Math.LN10-1.2;if(o>-2.200001&&o<1.800001)return n;o=Math.abs(o);var a=this.units[0].unit.prefixes;for(var i in a)if(b2(a,i)){var l=a[i];if(l.scientific){var s=Math.abs(Math.log(e/Math.pow(l.value*t,r))/Math.LN10-1.2);(s<o||s===o&&l.name.length<n.name.length)&&(n=l,o=s)}}return n},C.prototype.splitUnit=function(e){for(var t=this.clone(),n=[],r=0;r<e.length&&(t=t.to(e[r]),r!==e.length-1);r++){var o=t.toNumeric(),a=f(o),s=new C(h(a,o)?a:p(t.toNumeric()),e[r].toString());n.push(s),t=l(t,s)}for(var c=0,u=0;u<n.length;u++)c=i(c,n[u].value);return h(c,this.value)&&(t.value=0),n.push(t),n};var R={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:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),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:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};R.SHORTLONG=h1({},R.SHORT,R.LONG),R.BINARY_SHORT=h1({},R.BINARY_SHORT_SI,R.BINARY_SHORT_IEC),R.BINARY_LONG=h1({},R.BINARY_LONG_SI,R.BINARY_LONG_IEC);var M=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],O={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 B in O)b2(O,B)&&(O[B].key=B);var V={name:"",base:{},value:1,offset:0,dimensions:M.map((e=>0))},P={meter:{name:"meter",base:O.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:O.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:O.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:O.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:O.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:O.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:O.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:O.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:O.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:O.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:O.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:O.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:O.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:O.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:O.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:O.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:O.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:O.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:O.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:O.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:O.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:O.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:O.SURFACE,prefixes:R.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:O.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:O.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:O.SURFACE,prefixes:R.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:O.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:O.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:O.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:O.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:O.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:O.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:O.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:O.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:O.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:O.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:O.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:O.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:O.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:O.VOLUME,prefixes:R.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:"fluiddram",base:O.VOLUME,prefixes:R.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:O.VOLUME,prefixes:R.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:O.VOLUME,prefixes:R.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:O.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:O.VOLUME,prefixes:R.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:O.VOLUME,prefixes:R.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:O.VOLUME,prefixes:R.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:O.VOLUME,prefixes:R.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:O.VOLUME,prefixes:R.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:O.VOLUME,prefixes:R.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:O.VOLUME,prefixes:R.NONE,value:.238480942392,offset:0},g:{name:"g",base:O.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:O.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:O.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:O.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:O.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:O.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:O.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:O.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:O.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:O.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:O.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:O.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:O.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:O.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:O.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:O.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:O.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:O.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:O.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:O.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:O.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:O.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:O.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:O.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:O.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:O.TIME,prefixes:R.NONE,value:604800,offset:0},month:{name:"month",base:O.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:O.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:O.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:O.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:O.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:O.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:O.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:O.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:O.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:O.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:O.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:O.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:O.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:O.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:O.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:O.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:O.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:O.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:O.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:O.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:O.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:O.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:O.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:O.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:O.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:O.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:O.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:O.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:O.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:O.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:O.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:O.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:O.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:O.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:O.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:O.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:O.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:O.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:O.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:O.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:O.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:O.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:O.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:O.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:O.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:O.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:O.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:O.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:O.POWER,prefixes:R.SHORT,value:y.I,offset:0},VA:{name:"VA",base:O.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:O.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:O.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:O.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:O.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:O.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:O.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:O.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:O.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:O.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:O.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:O.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:O.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:O.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:O.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:O.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:O.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:O.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:O.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:O.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:O.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:O.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:O.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:O.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:O.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:O.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:O.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:O.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},L={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 F(e){if("BigNumber"===e.number){var t=cre(b);P.rad.value=new b(1),P.deg.value=t.div(180),P.grad.value=t.div(200),P.cycle.value=t.times(2),P.arcsec.value=t.div(648e3),P.arcmin.value=t.div(10800)}else P.rad.value=1,P.deg.value=Math.PI/180,P.grad.value=Math.PI/200,P.cycle.value=2*Math.PI,P.arcsec.value=Math.PI/648e3,P.arcmin.value=Math.PI/10800;P.radian.value=P.rad.value,P.degree.value=P.deg.value,P.gradian.value=P.grad.value}F(a),o&&o("config",(function(e,t){e.number!==t.number&&F(e)}));var z={si:{NONE:{unit:V,prefix:R.NONE[""]},LENGTH:{unit:P.m,prefix:R.SHORT[""]},MASS:{unit:P.g,prefix:R.SHORT.k},TIME:{unit:P.s,prefix:R.SHORT[""]},CURRENT:{unit:P.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:P.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:P.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:P.mol,prefix:R.SHORT[""]},ANGLE:{unit:P.rad,prefix:R.SHORT[""]},BIT:{unit:P.bits,prefix:R.SHORT[""]},FORCE:{unit:P.N,prefix:R.SHORT[""]},ENERGY:{unit:P.J,prefix:R.SHORT[""]},POWER:{unit:P.W,prefix:R.SHORT[""]},PRESSURE:{unit:P.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:P.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:P.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:P.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:P.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:P.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:P.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:P.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:P.T,prefix:R.SHORT[""]},FREQUENCY:{unit:P.Hz,prefix:R.SHORT[""]}}};z.cgs=JSON.parse(JSON.stringify(z.si)),z.cgs.LENGTH={unit:P.m,prefix:R.SHORT.c},z.cgs.MASS={unit:P.g,prefix:R.SHORT[""]},z.cgs.FORCE={unit:P.dyn,prefix:R.SHORT[""]},z.cgs.ENERGY={unit:P.erg,prefix:R.NONE[""]},z.us=JSON.parse(JSON.stringify(z.si)),z.us.LENGTH={unit:P.ft,prefix:R.NONE[""]},z.us.MASS={unit:P.lbm,prefix:R.NONE[""]},z.us.TEMPERATURE={unit:P.degF,prefix:R.NONE[""]},z.us.FORCE={unit:P.lbf,prefix:R.NONE[""]},z.us.ENERGY={unit:P.BTU,prefix:R.BTU[""]},z.us.POWER={unit:P.hp,prefix:R.NONE[""]},z.us.PRESSURE={unit:P.psi,prefix:R.NONE[""]},z.auto=JSON.parse(JSON.stringify(z.si));var j=z.auto;for(var $ in C.setUnitSystem=function(e){if(!b2(z,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(z).join(", "));j=z[e]},C.getUnitSystem=function(){for(var e in z)if(b2(z,e)&&z[e]===j)return e},C.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new b(e.n).div(e.d).times(e.s):new b(e+"")},Fraction:function(e){return new w(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?g(e):e}},C.prototype._numberConverter=function(){var e=C.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},C._getNumberConverter=function(e){if(!C.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return C.typeConverters[e]},P)if(b2(P,$)){var U=P[$];U.dimensions=U.base.dimensions}for(var H in L)if(b2(L,H)){var q=P[L[H]],W={};for(var G in q)b2(q,G)&&(W[G]=q[G]);W.name=H,P[H]=W}return C.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},C.createUnit=function(e,t){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var n in e)if(b2(e,n)&&C.deleteUnit(n),e[n].aliases)for(var r=0;r<e[n].aliases.length;r++)C.deleteUnit(e[n].aliases[r]);var o;for(var a in e)b2(e,a)&&(o=C.createUnitSingle(a,e[a]));return o},C.createUnitSingle=function(e,t){if(null==t&&(t={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(b2(P,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){if(r=e.charAt(t),0===t&&!C.isValidAlpha(r))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!C.isValidAlpha(r)&&!E(r))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var n,o,a,i=null,l=[],s=0;if(t&&"Unit"===t.type)i=t.clone();else if("string"==typeof t)""!==t&&(n=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');n=t.definition,o=t.prefixes,s=t.offset,a=t.baseName,t.aliases&&(l=t.aliases.valueOf())}if(l)for(var c=0;c<l.length;c++)if(b2(P,l[c]))throw new Error('Cannot create alias "'+l[c]+'": a unit with that name already exists');if(n&&"string"==typeof n&&!i)try{i=C.parse(n,{allowNoUnits:!0})}catch(S){throw S.message='Could not create unit "'+e+'" from "'+n+'": '+S.message,S}else n&&"Unit"===n.type&&(i=n.clone());l=l||[],s=s||0,o=o&&o.toUpperCase&&R[o.toUpperCase()]||R.NONE;var u={};if(i){u={name:e,value:i.value,dimensions:i.dimensions.slice(0),prefixes:o,offset:s};var d=!1;for(var p in O)if(b2(O,p)){for(var f=!0,h=0;h<M.length;h++)if(Math.abs((u.dimensions[h]||0)-(O[p].dimensions[h]||0))>1e-12){f=!1;break}if(f){d=!0,u.base=O[p];break}}if(!d){a=a||e+"_STUFF";var m={dimensions:i.dimensions.slice(0)};m.key=a,O[a]=m,j[a]={unit:u,prefix:R.NONE[""]},u.base=O[a]}}else{if(a=a||e+"_STUFF",M.indexOf(a)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var v in M.push(a),O)b2(O,v)&&(O[v].dimensions[M.length-1]=0);for(var g={dimensions:[]},y=0;y<M.length;y++)g.dimensions[y]=0;g.dimensions[M.length-1]=1,g.key=a,O[a]=g,u={name:e,value:1,dimensions:O[a].dimensions.slice(0),prefixes:o,offset:s,base:O[a]},j[a]={unit:u,prefix:R.NONE[""]}}C.UNITS[e]=u;for(var b=0;b<l.length;b++){var w=l[b],x={};for(var _ in u)b2(u,_)&&(x[_]=u[_]);x.name=w,C.UNITS[w]=x}return delete A.cache,new C(null,e)},C.deleteUnit=function(e){delete C.UNITS[e],delete A.cache},C.PREFIXES=R,C.BASE_DIMENSIONS=M,C.BASE_UNITS=O,C.UNIT_SYSTEMS=z,C.UNITS=P,C}),{isClass:!0}),mre="unit",vre=k2(mre,["typed","Unit"],(e=>{var{typed:t,Unit:n}=e;return t(mre,{Unit:function(e){return e.clone()},string:function(e){return n.isValuelessUnit(e)?new n(null,e):n.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new n(e,t)},"number | BigNumber | Fraction":function(e){return new n(e)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),gre="sparse",yre=k2(gre,["typed","SparseMatrix"],(e=>{var{typed:t,SparseMatrix:n}=e;return t(gre,{"":function(){return new n([])},string:function(e){return new n([],e)},"Array | Matrix":function(e){return new n(e)},"Array | Matrix, string":function(e,t){return new n(e,t)}})})),bre="createUnit",wre=k2(bre,["typed","Unit"],(e=>{var{typed:t,Unit:n}=e;return t(bre,{"Object, Object":function(e,t){return n.createUnit(e,t)},Object:function(e){return n.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var o={};return o[e]=t,n.createUnit(o,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,n.createUnit(r,{})},string:function(e){var t={};return t[e]={},n.createUnit(t,{})}})})),xre="acos",Cre=k2(xre,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(xre,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.acos(e):new r(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})})),_re="acosh",Ere=k2(_re,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(_re,{number:function(e){return e>=1||n.predictable?r5(e):e<=-1?new r(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})})),Sre="acot",kre=k2(Sre,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Sre,{number:o5,Complex:function(e){return e.acot()},BigNumber:function(e){return new n(1).div(e).atan()}})})),Tre="acoth",Nre=k2(Tre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Tre,{number:function(e){return e>=1||e<=-1||n.predictable?a5(e):new r(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new o(1).div(e).atanh()}})})),Dre="acsc",Are=k2(Dre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Dre,{number:function(e){return e<=-1||e>=1||n.predictable?i5(e):new r(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new o(1).div(e).asin()}})})),Ire="acsch",Rre=k2(Ire,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Ire,{number:l5,Complex:function(e){return e.acsch()},BigNumber:function(e){return new n(1).div(e).asinh()}})})),Mre="asec",Ore=k2(Mre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Mre,{number:function(e){return e<=-1||e>=1||n.predictable?s5(e):new r(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new o(1).div(e).acos()}})})),Bre="asech",Vre=k2(Bre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Bre,{number:function(e){if(e<=1&&e>=-1||n.predictable){var t=1/e;if(t>0||n.predictable)return c5(e);var o=Math.sqrt(t*t-1);return new r(Math.log(o-t),Math.PI)}return new r(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new o(1).div(e).acosh()}})})),Pre="asin",Lre=k2(Pre,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(Pre,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.asin(e):new r(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})})),Fre=k2("asinh",["typed"],(e=>{var{typed:t}=e;return t("asinh",{number:u5,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})})),zre=k2("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()}})})),jre="atan2",$re=k2(jre,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:o,DenseMatrix:a,concat:i}=e,l=j9({typed:t,equalScalar:r}),s=$9({typed:t}),c=S7({typed:t,equalScalar:r}),u=x9({typed:t,equalScalar:r}),d=C9({typed:t,DenseMatrix:a}),p=W9({typed:t,matrix:n,concat:i});return t(jre,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,t)=>o.atan2(e,t)},p({scalar:"number | BigNumber",SS:c,DS:s,SD:l,Ss:u,sS:d}))})),Ure="atanh",Hre=k2(Ure,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(Ure,{number:function(e){return e<=1&&e>=-1||n.predictable?d5(e):new r(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})})),qre=k2("trigUnit",["typed"],(e=>{var{typed:t}=e;return{Unit:t.referToSelf((e=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,n.valueType())(n.value)}))}})),Wre=k2("cos",["typed"],(e=>{var{typed:t}=e,n=qre({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},n)})),Gre="cosh",Yre=k2(Gre,["typed"],(e=>{var{typed:t}=e;return t(Gre,{number:Y2,"Complex | BigNumber":e=>e.cosh()})})),Kre=k2("cot",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("cot",{number:p5,Complex:e=>e.cot(),BigNumber:e=>new n(1).div(e.tan())},qre({typed:t}))})),Xre="coth",Jre=k2(Xre,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Xre,{number:f5,Complex:e=>e.coth(),BigNumber:e=>new n(1).div(e.tanh())})})),Zre=k2("csc",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("csc",{number:h5,Complex:e=>e.csc(),BigNumber:e=>new n(1).div(e.sin())},qre({typed:t}))})),Qre="csch",eoe=k2(Qre,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Qre,{number:m5,Complex:e=>e.csch(),BigNumber:e=>new n(1).div(e.sinh())})})),toe=k2("sec",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("sec",{number:v5,Complex:e=>e.sec(),BigNumber:e=>new n(1).div(e.cos())},qre({typed:t}))})),noe="sech",roe=k2(noe,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(noe,{number:g5,Complex:e=>e.sech(),BigNumber:e=>new n(1).div(e.cosh())})})),ooe=k2("sin",["typed"],(e=>{var{typed:t}=e,n=qre({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},n)})),aoe="sinh",ioe=k2(aoe,["typed"],(e=>{var{typed:t}=e;return t(aoe,{number:y5,"Complex | BigNumber":e=>e.sinh()})})),loe=k2("tan",["typed"],(e=>{var{typed:t}=e,n=qre({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},n)})),soe=k2("tanh",["typed"],(e=>{var{typed:t}=e;return t("tanh",{number:X2,"Complex | BigNumber":e=>e.tanh()})})),coe="setCartesian",uoe=k2(coe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(coe,{"Array | Matrix, Array | Matrix":function(e,t){var l=[];if(0!==r(n(e),new a(0))&&0!==r(n(t),new a(0))){var s=P6(Array.isArray(e)?e:e.toArray()).sort(o),c=P6(Array.isArray(t)?t:t.toArray()).sort(o);l=[];for(var u=0;u<s.length;u++)for(var d=0;d<c.length;d++)l.push([s[u],c[d]])}return Array.isArray(e)&&Array.isArray(t)?l:new i(l)}})})),doe="setDifference",poe=k2(doe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(doe,{"Array | Matrix, Array | Matrix":function(e,t){var l;if(0===r(n(e),new a(0)))l=[];else{if(0===r(n(t),new a(0)))return P6(e.toArray());var s,c=U6(P6(Array.isArray(e)?e:e.toArray()).sort(o)),u=U6(P6(Array.isArray(t)?t:t.toArray()).sort(o));l=[];for(var d=0;d<c.length;d++){s=!1;for(var p=0;p<u.length;p++)if(0===o(c[d].value,u[p].value)&&c[d].identifier===u[p].identifier){s=!0;break}s||l.push(c[d])}}return Array.isArray(e)&&Array.isArray(t)?H6(l):new i(H6(l))}})})),foe="setDistinct",hoe=k2(foe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(foe,{"Array | Matrix":function(e){var t;if(0===r(n(e),new a(0)))t=[];else{var l=P6(Array.isArray(e)?e:e.toArray()).sort(o);(t=[]).push(l[0]);for(var s=1;s<l.length;s++)0!==o(l[s],l[s-1])&&t.push(l[s])}return Array.isArray(e)?t:new i(t)}})})),moe="setIntersect",voe=k2(moe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(moe,{"Array | Matrix, Array | Matrix":function(e,t){var l;if(0===r(n(e),new a(0))||0===r(n(t),new a(0)))l=[];else{var s=U6(P6(Array.isArray(e)?e:e.toArray()).sort(o)),c=U6(P6(Array.isArray(t)?t:t.toArray()).sort(o));l=[];for(var u=0;u<s.length;u++)for(var d=0;d<c.length;d++)if(0===o(s[u].value,c[d].value)&&s[u].identifier===c[d].identifier){l.push(s[u]);break}}return Array.isArray(e)&&Array.isArray(t)?H6(l):new i(H6(l))}})})),goe="setIsSubset",yoe=k2(goe,["typed","size","subset","compareNatural","Index"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a}=e;return t(goe,{"Array | Matrix, Array | Matrix":function(e,t){if(0===r(n(e),new a(0)))return!0;if(0===r(n(t),new a(0)))return!1;for(var i,l=U6(P6(Array.isArray(e)?e:e.toArray()).sort(o)),s=U6(P6(Array.isArray(t)?t:t.toArray()).sort(o)),c=0;c<l.length;c++){i=!1;for(var u=0;u<s.length;u++)if(0===o(l[c].value,s[u].value)&&l[c].identifier===s[u].identifier){i=!0;break}if(!1===i)return!1}return!0}})})),boe="setMultiplicity",woe=k2(boe,["typed","size","subset","compareNatural","Index"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a}=e;return t(boe,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===r(n(t),new a(0)))return 0;for(var i=P6(Array.isArray(t)?t:t.toArray()),l=0,s=0;s<i.length;s++)0===o(i[s],e)&&l++;return l}})})),xoe="setPowerset",Coe=k2(xoe,["typed","size","subset","compareNatural","Index"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a}=e;return t(xoe,{"Array | Matrix":function(e){if(0===r(n(e),new a(0)))return[];for(var t=P6(Array.isArray(e)?e:e.toArray()).sort(o),l=[],s=0;s.toString(2).length<=t.length;)l.push(i(t,s.toString(2).split("").reverse())),s++;return function(e){for(var t=[],n=e.length-1;n>0;n--)for(var r=0;r<n;r++)e[r].length>e[r+1].length&&(t=e[r],e[r]=e[r+1],e[r+1]=t);return e}(l)}});function i(e,t){for(var n=[],r=0;r<t.length;r++)"1"===t[r]&&n.push(e[r]);return n}})),_oe="setSize",Eoe=k2(_oe,["typed","compareNatural"],(e=>{var{typed:t,compareNatural:n}=e;return t(_oe,{"Array | Matrix":function(e){return Array.isArray(e)?P6(e).length:P6(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?P6(e).length:P6(e.toArray()).length;for(var r=P6(Array.isArray(e)?e:e.toArray()).sort(n),o=1,a=1;a<r.length;a++)0!==n(r[a],r[a-1])&&o++;return o}})})),Soe="setSymDifference",koe=k2(Soe,["typed","size","concat","subset","setDifference","Index"],(e=>{var{typed:t,size:n,concat:r,subset:o,setDifference:a,Index:i}=e;return t(Soe,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(n(e),new i(0)))return P6(t);if(0===o(n(t),new i(0)))return P6(e);var l=P6(e),s=P6(t);return r(a(l,s),a(s,l))}})})),Toe="setUnion",Noe=k2(Toe,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(e=>{var{typed:t,size:n,concat:r,subset:o,setIntersect:a,setSymDifference:i,Index:l}=e;return t(Toe,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(n(e),new l(0)))return P6(t);if(0===o(n(t),new l(0)))return P6(e);var s=P6(e),c=P6(t);return r(i(s,c),a(s,c))}})})),Doe=k2("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],(e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:o,DenseMatrix:a,SparseMatrix:i,concat:l}=e,s=Y9({typed:t}),c=K9({typed:t,equalScalar:o}),u=X9({typed:t,DenseMatrix:a}),d=W9({typed:t,matrix:n,concat:l});return t("add",{"any, any":r,"any, any, ...any":t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o}))},d({elop:r,DS:s,SS:c,Ss:u}))})),Aoe="hypot",Ioe=k2(Aoe,["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],(e=>{var{typed:t,abs:n,addScalar:r,divideScalar:o,multiplyScalar:a,sqrt:i,smaller:l,isPositive:s}=e;return t(Aoe,{"... number | BigNumber":c,Array:c,Matrix:e=>c(P6(e.toArray()))});function c(e){for(var t=0,c=0,u=0;u<e.length;u++){if(A1(e[u]))throw new TypeError("Unexpected type of argument to hypot");var d=n(e[u]);l(c,d)?(t=a(t,a(o(c,d),o(c,d))),t=r(t,1),c=d):t=r(t,s(d)?a(o(d,c),o(d,c)):d)}return a(c,i(t))}})),Roe="norm",Moe=k2(Roe,["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],(e=>{var{typed:t,abs:n,add:r,pow:o,conj:a,sqrt:i,multiply:l,equalScalar:s,larger:c,smaller:u,matrix:d,ctranspose:p,eigs:f}=e;return t(Roe,{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 v(d(e),2)},Matrix:function(e){return v(e,2)},"Array, number | BigNumber | string":function(e,t){return v(d(e),t)},"Matrix, number | BigNumber | string":function(e,t){return v(e,t)}});function h(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var r=n(e);c(r,t)&&(t=r)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var r=n(e);t&&!u(r,t)||(t=r)}),!0),t||0}(e);if("fro"===t)return v(e,2);if("number"==typeof t&&!isNaN(t)){if(!s(t,0)){var a=0;return e.forEach((function(e){a=r(o(n(e),t),a)}),!0),o(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function m(e,t){if(1===t)return function(e){var t=[],o=0;return e.forEach((function(e,a){var i=a[1],l=r(t[i]||0,n(e));c(l,o)&&(o=l),t[i]=l}),!0),o}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=[],o=0;return e.forEach((function(e,a){var i=a[0],l=r(t[i]||0,n(e));c(l,o)&&(o=l),t[i]=l}),!0),o}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,n){t=r(t,l(e,a(e)))})),n(i(t))}(e);if(2===t)return function(e){var t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");var r=p(e),o=l(r,e),a=f(o).values.toArray(),s=a[a.length-1];return n(i(s))}(e);throw new Error("Unsupported parameter value "+t)}function v(e,t){var n=e.size();if(1===n.length)return h(e,t);if(2===n.length){if(n[0]&&n[1])return m(e,t);throw new RangeError("Invalid matrix dimensions")}}})),Ooe=k2("dot",["typed","addScalar","multiplyScalar","conj","size"],(e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:o,size:a}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var s=i(e,a),c=B1(e)?e._data:e,u=B1(e)?e._datatype||e.getDataType():void 0,d=B1(a)?a._data:a,p=B1(a)?a._datatype||a.getDataType():void 0,f=2===l(e).length,h=2===l(a).length,m=n,v=r;if(u&&p&&u===p&&"string"==typeof u&&"mixed"!==u){var g=u;m=t.find(n,[g,g]),v=t.find(r,[g,g])}if(!f&&!h){for(var y=v(o(c[0]),d[0]),b=1;b<s;b++)y=m(y,v(o(c[b]),d[b]));return y}if(!f&&h){for(var w=v(o(c[0]),d[0][0]),x=1;x<s;x++)w=m(w,v(o(c[x]),d[x][0]));return w}if(f&&!h){for(var C=v(o(c[0][0]),d[0]),_=1;_<s;_++)C=m(C,v(o(c[_][0]),d[_]));return C}if(f&&h){for(var E=v(o(c[0][0]),d[0][0]),S=1;S<s;S++)E=m(E,v(o(c[S][0]),d[S][0]));return E}},"SparseMatrix, SparseMatrix":function(e,t){i(e,t);var o=e._index,a=e._values,l=t._index,s=t._values,c=0,u=n,d=r,p=0,f=0;for(;p<o.length&&f<l.length;){var h=o[p],m=l[f];h<m?p++:h>m?f++:h===m&&(c=u(c,d(a[p],s[f])),p++,f++)}return c}});function i(e,t){var n,r,o=l(e),a=l(t);if(1===o.length)n=o[0];else{if(2!==o.length||1!==o[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+o.join(", ")+")");n=o[0]}if(1===a.length)r=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");r=a[0]}if(n!==r)throw new RangeError("Vectors must have equal length ("+n+" != "+r+")");if(0===n)throw new RangeError("Cannot calculate the dot product of empty vectors");return n}function l(e){return B1(e)?e.size():a(e)}})),Boe=k2("trace",["typed","matrix","add"],(e=>{var{typed:t,matrix:n,add:r}=e;return t("trace",{Array:function(e){return o(n(e))},SparseMatrix:function(e){var t=e._values,n=e._index,o=e._ptr,a=e._size,i=a[0],l=a[1];if(i===l){var s=0;if(t.length>0)for(var c=0;c<l;c++)for(var u=o[c],d=o[c+1],p=u;p<d;p++){var f=n[p];if(f===c){s=r(s,t[p]);break}if(f>c)break}return s}throw new RangeError("Matrix must be square (size: "+h6(a)+")")},DenseMatrix:o,any:v2});function o(e){var t=e._size,n=e._data;switch(t.length){case 1:if(1===t[0])return v2(n[0]);throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:var o=t[0];if(o===t[1]){for(var a=0,i=0;i<o;i++)a=r(a,n[i][i]);return a}throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}}})),Voe="index",Poe=k2(Voe,["typed","Index"],(e=>{var{typed:t,Index:n}=e;return t(Voe,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return N1(e)?e.toNumber():O1(e)||B1(e)?e.map((function(e){return N1(e)?e.toNumber():e})):e})),r=new n;return n.apply(r,t),r}})})),Loe=new Set(["end"]),Foe=k2("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,{}),n={};return{evaluate:function(t){var r=k1(t);return function(e){for(var t of[...Loe])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(r),e(r,n,null)}}}_compile(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw new Error("Cannot run forEach on a Node interface")}map(e){throw new Error("Cannot run map on a Node interface")}_ifNode(e){if(!l2(e))throw new TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),function e(t,n){t.forEach((function(t,r,o){n(t,r,o),e(t,n)}))}(this,e)}transform(e){return function t(n,r,o){var a=e(n,r,o);return a!==n?a:n.map(t)}(this,null,null)}filter(e){var t=[];return this.traverse((function(n,r,o){e(n,r,o)&&t.push(n)})),t}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map((function(e){return e.cloneDeep()}))}equals(e){return!!e&&(this.type===e.type&&y2(this,e))}toString(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new 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 new 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 new 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 new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}}),{isClass:!0,isNode:!0});function zoe(e){return e&&e.isIndexError?new x6(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function joe(e){var{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"==typeof e.subset)return e.subset(n);if("string"==typeof e)return t(e,n);if("object"==typeof e){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return v1(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(r){throw zoe(r)}}}var $oe="AccessorNode",Uoe=k2($oe,["subset","Node"],(e=>{var{subset:t,Node:n}=e,r=joe({subset:t});function o(e){return!(J1(e)||Z1(e)||n2(e)||a2(e)||s2(e)||u2(e)||f2(e))}class a extends n{constructor(e,t){if(super(),!l2(e))throw new TypeError('Node expected for parameter "object"');if(!i2(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=t}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return $oe}get isAccessorNode(){return!0}_compile(e,t){var n=this.object._compile(e,t),o=this.index._compile(e,t);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,t,r){return v1(n(e,t,r),a)}}return function(e,t,a){var i=n(e,t,a),l=o(e,t,i);return r(i,l)}}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)))}clone(){return new a(this.object,this.index)}_toString(e){var t=this.object.toString(e);return o(this.object)&&(t="("+t+")"),t+this.index.toString(e)}_toHTML(e){var t=this.object.toHTML(e);return o(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 o(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}toJSON(){return{mathjs:$oe,object:this.object,index:this.index}}static fromJSON(e){return new a(e.object,e.index)}}return ste(a,"name",$oe),a}),{isClass:!0,isNode:!0}),Hoe="ArrayNode",qoe=k2(Hoe,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(l2))throw new TypeError("Array containing Nodes expected")}get type(){return Hoe}get isArrayNode(){return!0}_compile(e,t){var n=L6(this.items,(function(n){return n._compile(e,t)}));if("Array"!==e.config.matrix){var r=e.matrix;return function(e,t,o){return r(L6(n,(function(n){return n(e,t,o)})))}}return function(e,t,r){return L6(n,(function(n){return n(e,t,r)}))}}forEach(e){for(var t=0;t<this.items.length;t++){e(this.items[t],"items["+t+"]",this)}}map(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new n(t)}clone(){return new n(this.items.slice(0))}_toString(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"}toJSON(){return{mathjs:Hoe,items:this.items}}static fromJSON(e){return new n(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(n,r){var o=n.some(Z1)&&!n.every(Z1),a=r||o,i=a?"&":"\\\\",l=n.map((function(n){return n.items?t(n.items,!r):n.toTex(e)})).join(i);return o||!a||a&&!r?"\\begin{bmatrix}"+l+"\\end{bmatrix}":l}(this.items,!1)}}return ste(n,"name",Hoe),n}),{isClass:!0,isNode:!0});var Woe=[{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:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Goe(e,t){if(!t||"auto"!==t)return e;for(var n=e;u2(n);)n=n.content;return n}function Yoe(e,t,n,r){var o=e;"keep"!==t&&(o=e.getContent());for(var a=o.getIdentifier(),i=null,l=0;l<Woe.length;l++)if(a in Woe[l]){i=l;break}if("OperatorNode:multiply"===a&&o.implicit&&"show"!==n){var s=Goe(o.args[0],t);n2(s)&&r&&"OperatorNode:divide"===r.getIdentifier()&&r2(Goe(r.args[0],t))||"OperatorNode:divide"===s.getIdentifier()&&r2(Goe(s.args[0],t))&&n2(Goe(s.args[1]))||(i+=1)}return i}function Koe(e,t){var n=e;"keep"!==t&&(n=e.getContent());var r=n.getIdentifier(),o=Yoe(n,t);if(null===o)return null;var a=Woe[o][r];if(b2(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+r+"' has the invalid associativity '"+a.associativity+"'.")}return null}function Xoe(e,t,n){var r="keep"!==n?e.getContent():e,o="keep"!==n?e.getContent():t,a=r.getIdentifier(),i=o.getIdentifier(),l=Yoe(r,n);if(null===l)return null;var s=Woe[l][a];if(b2(s,"associativeWith")&&s.associativeWith instanceof Array){for(var c=0;c<s.associativeWith.length;c++)if(s.associativeWith[c]===i)return!0;return!1}return null}var Joe="AssignmentNode",Zoe=k2(Joe,["subset","?matrix","Node"],(e=>{var{subset:t,matrix:n,Node:r}=e,o=joe({subset:t}),a=function(e){var{subset:t,matrix:n}=e;return function(e,r,o){try{if(Array.isArray(e))return n(e).subset(r,o).valueOf().forEach(((t,n)=>{e[n]=t})),e;if(e&&"function"==typeof e.subset)return e.subset(r,o);if("string"==typeof e)return t(e,r,o);if("object"==typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return g1(e,r.getObjectProperty(),o),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw zoe(a)}}}({subset:t,matrix:n});function i(e,t,n){t||(t="keep");var r=Yoe(e,t,n),o=Yoe(e.value,t,n);return"all"===t||null!==o&&o<=r}class l extends r{constructor(e,t,n){if(super(),this.object=e,this.index=n?t:null,this.value=n||t,!f2(e)&&!J1(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(f2(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!i2(this.index))throw new TypeError('IndexNode expected as "index"');if(!l2(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Joe}get isAssignmentNode(){return!0}_compile(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,i=this.value._compile(e,t),l=this.object.name;if(this.index){if(this.index.isObjectProperty()){var s=this.index.getObjectProperty();return function(e,t,r){var o=n(e,t,r),a=i(e,t,r);return g1(o,s,a),a}}if(f2(this.object))return function(e,t,o){var s=n(e,t,o),c=i(e,t,o),u=r(e,t,s);return e.set(l,a(s,u,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var u=this.object.index.getObjectProperty();return function(e,t,n){var o=c(e,t,n),l=v1(o,u),s=r(e,t,l),d=i(e,t,n);return g1(o,u,a(l,s,d)),d}}var d=this.object.index._compile(e,t);return function(e,t,n){var l=c(e,t,n),s=d(e,t,l),u=o(l,s),p=r(e,t,u),f=i(e,t,n);return a(l,s,a(u,p,f)),f}}if(!f2(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){var r=i(e,t,n);return e.set(l,r),r}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){var t=this._ifNode(e(this.object,"object",this)),n=this.index?this._ifNode(e(this.index,"index",this)):null,r=this._ifNode(e(this.value,"value",this));return new l(t,n,r)}clone(){return new l(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):"",r=this.value.toString(e);return i(this,e&&e.parenthesis,e&&e.implicit)&&(r="("+r+")"),t+n+" = "+r}toJSON(){return{mathjs:Joe,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new l(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"",r=this.value.toHTML(e);return i(this,e&&e.parenthesis,e&&e.implicit)&&(r='<span class="math-paranthesis math-round-parenthesis">(</span>'+r+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+n+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+r}_toTex(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):"",r=this.value.toTex(e);return i(this,e&&e.parenthesis,e&&e.implicit)&&(r="\\left(".concat(r,"\\right)")),t+n+"="+r}}return ste(l,"name",Joe),l}),{isClass:!0,isNode:!0}),Qoe="BlockNode",eae=k2(Qoe,["ResultSet","Node"],(e=>{var{ResultSet:t,Node:n}=e;class r extends n{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!l2(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}get type(){return Qoe}get isBlockNode(){return!0}_compile(e,n){var r=L6(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,o){var a=[];return F6(r,(function(t){var r=t.evaluate(e,n,o);t.visible&&a.push(r)})),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=[],n=0;n<this.blocks.length;n++){var o=this.blocks[n],a=this._ifNode(e(o.node,"blocks["+n+"].node",this));t[n]={node:a,visible:o.visible}}return new r(t)}clone(){var e=this.blocks.map((function(e){return{node:e.node,visible:e.visible}}));return new r(e)}_toString(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")}toJSON(){return{mathjs:Qoe,blocks:this.blocks}}static fromJSON(e){return new r(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 ste(r,"name",Qoe),r}),{isClass:!0,isNode:!0}),tae="ConditionalNode",nae=k2(tae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e,t,n){if(super(),!l2(e))throw new TypeError("Parameter condition must be a Node");if(!l2(t))throw new TypeError("Parameter trueExpr must be a Node");if(!l2(n))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=n}get type(){return tae}get isConditionalNode(){return!0}_compile(e,t){var n=this.condition._compile(e,t),r=this.trueExpr._compile(e,t),o=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(N1(e))return!e.isZero();if(A1(e))return!(!e.re&&!e.im);if(R1(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+m2(e)+'"')}(n(e,t,a))?r(e,t,a):o(e,t,a)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Yoe(this,t,e&&e.implicit),r=this.condition.toString(e),o=Yoe(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r="("+r+")");var a=this.trueExpr.toString(e),i=Yoe(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==i&&i<=n)&&(a="("+a+")");var l=this.falseExpr.toString(e),s=Yoe(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=n)&&(l="("+l+")"),r+" ? "+a+" : "+l}toJSON(){return{mathjs:tae,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new n(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Yoe(this,t,e&&e.implicit),r=this.condition.toHTML(e),o=Yoe(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),i=Yoe(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==i&&i<=n)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var l=this.falseExpr.toHTML(e),s=Yoe(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=n)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+l}_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 ste(n,"name",tae),n}),{isClass:!0,isNode:!0}),rae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oae={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},aae={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},iae=function(e,t){return rae({},e,t)};const lae=P((function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preserveFormatting,r=void 0!==n&&n,o=t.escapeMapFn,a=void 0===o?iae:o,i=String(e),l="",s=a(rae({},oae),r?rae({},aae):{}),c=Object.keys(s),u=function(){var e=!1;c.forEach((function(t,n){e||i.length>=t.length&&i.slice(0,t.length)===t&&(l+=s[c[n]],i=i.slice(t.length,i.length),e=!0)})),e||(l+=i.slice(0,1),i=i.slice(1,i.length))};i;)u();return l}));var sae={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{?}"},cae={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"},uae={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(cae.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(cae.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(cae.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(cae.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(cae.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},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(cae.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(cae.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(cae.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(cae.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(cae.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(cae.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(cae.bitAnd,"${args[1]}\\right)")},bitNot:{1:cae.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(cae.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(cae.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(cae.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(cae.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(cae.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(cae.and,"${args[1]}\\right)")},not:{1:cae.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(cae.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(cae.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(cae.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(cae.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(cae.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(cae.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(cae.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(cae.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(cae.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(cae.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(cae.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(cae.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(cae.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(sae.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)"}},dae={deg:"^\\circ"};function pae(e){return lae(e,{preserveFormatting:!0})}function fae(e,t){return(t=void 0!==t&&t)?b2(dae,e)?dae[e]:"\\mathrm{"+pae(e)+"}":b2(sae,e)?sae[e]:pae(e)}var hae="ConstantNode",mae=k2(hae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){super(),this.value=e}get type(){return hae}get isConstantNode(){return!0}_compile(e,t){var n=this.value;return function(){return n}}forEach(e){}map(e){return this.clone()}clone(){return new n(this.value)}_toString(e){return h6(this.value,e)}_toHTML(e){var t=this._toString(e);switch(m2(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:hae,value:this.value}}static fromJSON(e){return new n(e.value)}_toTex(e){var t=this._toString(e),n=m2(this.value);switch(n){case"string":return"\\mathtt{"+pae(t)+"}";case"number":case"BigNumber":if(!("BigNumber"===n?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?"-\\infty":"\\infty";var r=t.toLowerCase().indexOf("e");return-1!==r?t.substring(0,r)+"\\cdot10^{"+t.substring(r+1)+"}":t;case"bigint":return t.toString();case"Fraction":return this.value.toLatex();default:return t}}}return ste(n,"name",hae),n}),{isClass:!0,isNode:!0}),vae="FunctionAssignmentNode",gae=k2(vae,["typed","Node"],(e=>{var{typed:t,Node:n}=e;function r(e,t,n){var r=Yoe(e,t,n),o=Yoe(e.expr,t,n);return"all"===t||null!==o&&o<=r}class o extends n{constructor(e,t,n){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!l2(n))throw new TypeError('Node expected for parameter "expr"');if(Loe.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');var r=new Set;for(var o of t){var a="string"==typeof o?o:o.name;if(r.has(a))throw new Error('Duplicate parameter name "'.concat(a,'"'));r.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=n}get type(){return vae}get isFunctionAssignmentNode(){return!0}_compile(e,n){var r=Object.create(n);F6(this.params,(function(e){r[e]=!0}));var o=this.expr._compile(e,r),a=this.name,i=this.params,l=$6(this.types,","),s=a+"("+$6(this.params,", ")+")";return function(e,n,r){var c={};c[l]=function(){for(var t=Object.create(n),a=0;a<i.length;a++)t[i[a]]=arguments[a];return o(e,t,r)};var u=t(a,c);return u.syntax=s,e.set(a,u),u}}forEach(e){e(this.expr,"expr",this)}map(e){var t=this._ifNode(e(this.expr,"expr",this));return new o(this.name,this.params.slice(0),t)}clone(){return new o(this.name,this.params.slice(0),this.expr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toString(e);return r(this,t,e&&e.implicit)&&(n="("+n+")"),this.name+"("+this.params.join(", ")+") = "+n}toJSON(){var e=this.types;return{mathjs:vae,name:this.name,params:this.params.map((function(t,n){return{name:t,type:e[n]}})),expr:this.expr}}static fromJSON(e){return new o(e.name,e.params,e.expr)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=[],o=0;o<this.params.length;o++)n.push('<span class="math-symbol math-parameter">'+g6(this.params[o])+"</span>");var a=this.expr.toHTML(e);return r(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">'+g6(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+n.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",n=this.expr.toTex(e);return r(this,t,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(fae).join(",")+"\\right)="+n}}return ste(o,"name",vae),o}),{isClass:!0,isNode:!0}),yae="IndexNode",bae=k2(yae,["Node","size"],(e=>{var{Node:t,size:n}=e;class r extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(l2))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return yae}get isIndexNode(){return!0}_compile(e,t){var r=L6(this.dimensions,(function(r,o){if(r.filter((e=>e.isSymbolNode&&"end"===e.name)).length>0){var a=Object.create(t);a.end=!0;var i=r._compile(e,a);return function(e,t,r){if(!B1(r)&&!O1(r)&&!M1(r))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+m2(r));var a=n(r).valueOf(),l=Object.create(t);return l.end=a[o],i(e,l,r)}}return r._compile(e,t)})),o=v1(e,"index");return function(e,t,n){var a=L6(r,(function(r){return r(e,t,n)}));return o(...a)}}forEach(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}map(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this._ifNode(e(this.dimensions[n],"dimensions["+n+"]",this));return new r(t,this.dotNotation)}clone(){return new r(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return 1===this.dimensions.length&&n2(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:yae,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(e){return new r(e.dimensions,e.dotNotation)}_toHTML(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this.dimensions[n].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+g6(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 ste(r,"name",yae),r}),{isClass:!0,isNode:!0}),wae="ObjectNode",xae=k2(wae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every((function(t){return l2(e[t])}))))throw new TypeError("Object containing Nodes expected")}get type(){return wae}get isObjectNode(){return!0}_compile(e,t){var n={};for(var r in this.properties)if(b2(this.properties,r)){var o=m6(r),a=JSON.parse(o),i=v1(this.properties,r);n[a]=i._compile(e,t)}return function(e,t,r){var o={};for(var a in n)b2(n,a)&&(o[a]=n[a](e,t,r));return o}}forEach(e){for(var t in this.properties)b2(this.properties,t)&&e(this.properties[t],"properties["+m6(t)+"]",this)}map(e){var t={};for(var r in this.properties)b2(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+m6(r)+"]",this)));return new n(t)}clone(){var e={};for(var t in this.properties)b2(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)}_toString(e){var t=[];for(var n in this.properties)b2(this.properties,n)&&t.push(m6(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:wae,properties:this.properties}}static fromJSON(e){return new n(e.properties)}_toHTML(e){var t=[];for(var n in this.properties)b2(this.properties,n)&&t.push('<span class="math-symbol math-property">'+g6(n)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[n].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 n in this.properties)b2(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return ste(n,"name",wae),n}),{isClass:!0,isNode:!0});function Cae(e,t){return new _1(e,new C1(t),new Set(Object.keys(t)))}var _ae="OperatorNode",Eae=k2(_ae,["Node"],(e=>{var{Node:t}=e;function n(e,t){var r=e;if("auto"===t)for(;u2(r);)r=r.content;return!!n2(r)||!!c2(r)&&n(r.args[0],t)}function r(e,t,r,o,a){var i,l=Yoe(e,t,r),s=Koe(e,t);if("all"===t||o.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return o.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(o.length){case 0:i=[];break;case 1:var c=Yoe(o[0],t,r,e);if(a&&null!==c){var u,d;if("keep"===t?(u=o[0].getIdentifier(),d=e.getIdentifier()):(u=o[0].getContent().getIdentifier(),d=e.getContent().getIdentifier()),!1===Woe[l][d].latexLeftParens){i=[!1];break}if(!1===Woe[c][u].latexParens){i=[!1];break}}if(null===c){i=[!1];break}if(c<=l){i=[!0];break}i=[!1];break;case 2:var p,f,h=Yoe(o[0],t,r,e),m=Xoe(e,o[0],t);p=null!==h&&(h===l&&"right"===s&&!m||h<l);var v,g,y,b=Yoe(o[1],t,r,e),w=Xoe(e,o[1],t);if(f=null!==b&&(b===l&&"left"===s&&!w||b<l),a)"keep"===t?(v=e.getIdentifier(),g=e.args[0].getIdentifier(),y=e.args[1].getIdentifier()):(v=e.getContent().getIdentifier(),g=e.args[0].getContent().getIdentifier(),y=e.args[1].getContent().getIdentifier()),null!==h&&(!1===Woe[l][v].latexLeftParens&&(p=!1),!1===Woe[h][g].latexParens&&(p=!1)),null!==b&&(!1===Woe[l][v].latexRightParens&&(f=!1),!1===Woe[b][y].latexParens&&(f=!1));i=[p,f];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(i=o.map((function(n){var o=Yoe(n,t,r,e),a=Xoe(e,n,t),i=Koe(n,t);return null!==o&&(l===o&&s===i&&!a||o<l)})))}if(o.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===r)for(var x=1;x<i.length;++x)!n(o[x],t)||i[x-1]||"keep"===t&&u2(o[x-1])||(i[x]=!0);return i}class o extends t{constructor(e,t,n,r,o){if(super(),"string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(n)||!n.every(l2))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===r,this.isPercentage=!0===o,this.op=e,this.fn=t,this.args=n||[]}get type(){return _ae}get isOperatorNode(){return!0}_compile(e,t){if("string"!=typeof this.fn||!b1(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var n=v1(e,this.fn),r=L6(this.args,(function(n){return n._compile(e,t)}));if("function"==typeof n&&!0===n.rawArgs){var o=this.args;return function(t,r,a){return n(o,e,Cae(t,r))}}if(1===r.length){var a=r[0];return function(e,t,r){return n(a(e,t,r))}}if(2===r.length){var i=r[0],l=r[1];return function(e,t,r){return n(i(e,t,r),l(e,t,r))}}return function(e,t,o){return n.apply(null,L6(r,(function(n){return n(e,t,o)})))}}forEach(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){for(var t=[],n=0;n<this.args.length;n++)t[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new o(this.op,this.fn,t,this.implicit,this.isPercentage)}clone(){return new o(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",o=this.args,a=r(this,t,n,o,!1);if(1===o.length){var i=Koe(this,t),l=o[0].toString(e);a[0]&&(l="("+l+")");var s=/[a-zA-Z]+/.test(this.op);return"right"===i?this.op+(s?" ":"")+l:"left"===i?l+(s?" ":"")+this.op:l+this.op}if(2===o.length){var c=o[0].toString(e),u=o[1].toString(e);return a[0]&&(c="("+c+")"),a[1]&&(u="("+u+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c+" "+u:c+" "+this.op+" "+u}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var d=o.map((function(t,n){return t=t.toString(e),a[n]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?d.join(" "):d.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:_ae,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new o(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",o=this.args,a=r(this,t,n,o,!1);if(1===o.length){var i=Koe(this,t),l=o[0].toHTML(e);return a[0]&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===i?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+g6(this.op)+"</span>"+l:l+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+g6(this.op)+"</span>"}if(2===o.length){var s=o[0].toHTML(e),c=o[1].toHTML(e);return a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<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?s+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:s+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+g6(this.op)+"</span>"+c}var u=o.map((function(t,n){return t=t.toHTML(e),a[n]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?u.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):u.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+g6(this.op)+"</span>"):'<span class="math-function">'+g6(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+u.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",o=this.args,a=r(this,t,n,o,!0),i=cae[this.fn];if(i=void 0===i?this.op:i,1===o.length){var l=Koe(this,t),s=o[0].toTex(e);return a[0]&&(s="\\left(".concat(s,"\\right)")),"right"===l?i+s:s+i}if(2===o.length){var c=o[0],u=c.toTex(e);a[0]&&(u="\\left(".concat(u,"\\right)"));var d,p=o[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),d="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return i+"{"+u+"}{"+p+"}";case"OperatorNode:pow":switch(u="{"+u+"}",p="{"+p+"}",d){case"ConditionalNode":case"OperatorNode:divide":u="\\left(".concat(u,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return u+"~"+p}return u+i+p}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var f=o.map((function(t,n){return t=t.toTex(e),a[n]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===n?f.join("~"):f.join(i)}return"\\mathrm{"+this.fn+"}\\left("+o.map((function(t){return t.toTex(e)})).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return ste(o,"name",_ae),o}),{isClass:!0,isNode:!0}),Sae="ParenthesisNode",kae=k2(Sae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),!l2(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return Sae}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){var t=e(this.content,"content",this);return new n(t)}clone(){return new n(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:Sae,content:this.content}}static fromJSON(e){return new n(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 ste(n,"name",Sae),n}),{isClass:!0,isNode:!0}),Tae="RangeNode",Nae=k2(Tae,["Node"],(e=>{var{Node:t}=e;function n(e,t,n){var r=Yoe(e,t,n),o={},a=Yoe(e.start,t,n);if(o.start=null!==a&&a<=r||"all"===t,e.step){var i=Yoe(e.step,t,n);o.step=null!==i&&i<=r||"all"===t}var l=Yoe(e.end,t,n);return o.end=null!==l&&l<=r||"all"===t,o}class r extends t{constructor(e,t,n){if(super(),!l2(e))throw new TypeError("Node expected");if(!l2(t))throw new TypeError("Node expected");if(n&&!l2(n))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=n||null}get type(){return Tae}get isRangeNode(){return!0}needsEnd(){return this.filter((function(e){return f2(e)&&"end"===e.name})).length>0}_compile(e,t){var n=e.range,r=this.start._compile(e,t),o=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,i){return n(r(e,t,i),o(e,t,i),a(e,t,i))}}return function(e,t,a){return n(r(e,t,a),o(e,t,a))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new r(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 r(this.start,this.end,this.step&&this.step)}_toString(e){var t,r=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),o=this.start.toString(e);if(r.start&&(o="("+o+")"),t=o,this.step){var a=this.step.toString(e);r.step&&(a="("+a+")"),t+=":"+a}var i=this.end.toString(e);return r.end&&(i="("+i+")"),t+=":"+i}toJSON(){return{mathjs:Tae,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new r(e.start,e.end,e.step)}_toHTML(e){var t,r=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),o=this.start.toHTML(e);if(r.start&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=o,this.step){var a=this.step.toHTML(e);r.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 i=this.end.toHTML(e);return r.end&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+i}_toTex(e){var t=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),r=this.start.toTex(e);if(t.start&&(r="\\left(".concat(r,"\\right)")),this.step){var o=this.step.toTex(e);t.step&&(o="\\left(".concat(o,"\\right)")),r+=":"+o}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),r+=":"+a}}return ste(r,"name",Tae),r}),{isClass:!0,isNode:!0}),Dae="RelationalNode",Aae=k2(Dae,["Node"],(e=>{var{Node:t}=e,n={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class r extends t{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}get type(){return Dae}get isRelationalNode(){return!0}_compile(e,t){var n=this,r=this.params.map((n=>n._compile(e,t)));return function(t,o,a){for(var i,l=r[0](t,o,a),s=0;s<n.conditionals.length;s++){if(i=l,l=r[s+1](t,o,a),!v1(e,n.conditionals[s])(i,l))return!1}return!0}}forEach(e){this.params.forEach(((t,n)=>e(t,"params["+n+"]",this)),this)}map(e){return new r(this.conditionals.slice(),this.params.map(((t,n)=>this._ifNode(e(t,"params["+n+"]",this))),this))}clone(){return new r(this.conditionals,this.params)}_toString(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=Yoe(this,t,e&&e.implicit),o=this.params.map((function(n,o){var a=Yoe(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?"("+n.toString(e)+")":n.toString(e)})),a=o[0],i=0;i<this.conditionals.length;i++)a+=" "+n[this.conditionals[i]],a+=" "+o[i+1];return a}toJSON(){return{mathjs:Dae,conditionals:this.conditionals,params:this.params}}static fromJSON(e){return new r(e.conditionals,e.params)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=Yoe(this,t,e&&e.implicit),o=this.params.map((function(n,o){var a=Yoe(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?'<span class="math-parenthesis math-round-parenthesis">(</span>'+n.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':n.toHTML(e)})),a=o[0],i=0;i<this.conditionals.length;i++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+g6(n[this.conditionals[i]])+"</span>"+o[i+1];return a}_toTex(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Yoe(this,t,e&&e.implicit),r=this.params.map((function(r,o){var a=Yoe(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)})),o=r[0],a=0;a<this.conditionals.length;a++)o+=cae[this.conditionals[a]]+r[a+1];return o}}return ste(r,"name",Dae),r}),{isClass:!0,isNode:!0}),Iae=k2("SymbolNode",["math","?Unit","Node"],(e=>{var{math:t,Unit:n,Node:r}=e;function o(e){return!!n&&n.isValuelessUnit(e)}class a extends r{constructor(e){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,t){var r=this.name;if(!0===t[r])return function(e,t,n){return v1(t,r)};if(r in e)return function(t,n,o){return t.has(r)?t.get(r):v1(e,r)};var i=o(r);return function(e,t,o){return e.has(r)?e.get(r):i?new n(null,r):a.onUndefinedSymbol(r)}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error("Undefined symbol "+e)}clone(){return new a(this.name)}_toString(e){return this.name}_toHTML(e){var t=g6(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new a(e.name)}_toTex(e){var n=!1;void 0===t[this.name]&&o(this.name)&&(n=!0);var r=fae(this.name,n);return"\\"===r[0]?r:" "+r}}return a}),{isClass:!0,isNode:!0}),Rae="FunctionNode",Mae=k2(Rae,["math","Node","SymbolNode"],(e=>{var t,{math:n,Node:r,SymbolNode:o}=e,a=e=>h6(e,{truncate:78});function i(e,t,n){for(var r,o="",a=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,i=0;null!==(r=a.exec(e));)if(o+=e.substring(i,r.index),i=r.index,"$$"===r[0])o+="$",i++;else{i+=r[0].length;var l=t[r[1]];if(!l)throw new ReferenceError("Template: Property "+r[1]+" does not exist.");if(void 0===r[2])switch(typeof l){case"string":o+=l;break;case"object":if(l2(l))o+=l.toTex(n);else{if(!Array.isArray(l))throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes");o+=l.map((function(e,t){if(l2(e))return e.toTex(n);throw new TypeError("Template: "+r[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes")}else{if(!l2(l[r[2]]&&l[r[2]]))throw new TypeError("Template: "+r[1]+"["+r[2]+"] is not a Node.");o+=l[r[2]].toTex(n)}}return o+=e.slice(i)}class l extends r{constructor(e,t){if(super(),"string"==typeof e&&(e=new o(e)),!l2(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(l2))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[]}get name(){return this.fn.name||""}get type(){return Rae}get isFunctionNode(){return!0}_compile(e,t){var n=this.args.map((n=>n._compile(e,t)));if(!f2(this.fn)){if(J1(this.fn)&&i2(this.fn.index)&&this.fn.index.isObjectProperty()){var r=this.fn.object._compile(e,t),o=this.fn.index.getObjectProperty(),i=this.args;return function(t,a,l){var s=r(t,a,l),c=function(e,t){if(!b1(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(s,o);if(null!=c&&c.rawArgs)return c(i,e,Cae(t,a));var u=n.map((e=>e(t,a,l)));return c.apply(s,u)}}var s=this.fn.toString(),c=this.fn._compile(e,t),u=this.args;return function(t,r,o){var i=c(t,r,o);if("function"!=typeof i)throw new TypeError("Expression '".concat(s,"' did not evaluate to a function; value is:")+"\n ".concat(a(i)));if(i.rawArgs)return i(u,e,Cae(t,r));var l=n.map((e=>e(t,r,o)));return i.apply(i,l)}}var d=this.fn.name;if(t[d]){var p=this.args;return function(t,r,o){var i=v1(r,d);if("function"!=typeof i)throw new TypeError("Argument '".concat(d,"' was not a function; received: ").concat(a(i)));if(i.rawArgs)return i(p,e,Cae(t,r));var l=n.map((e=>e(t,r,o)));return i.apply(i,l)}}var f=d in e?v1(e,d):void 0,h="function"==typeof f&&!0===f.rawArgs,m=t=>{var n;if(t.has(d))n=t.get(d);else{if(!(d in e))return l.onUndefinedFunction(d);n=v1(e,d)}if("function"==typeof n)return n;throw new TypeError("'".concat(d,"' is not a function; its value is:\n ").concat(a(n)))};if(h){var v=this.args;return function(t,r,o){var a=m(t);return!0===a.rawArgs?a(v,e,Cae(t,r)):a(...n.map((e=>e(t,r,o))))}}switch(n.length){case 0:return function(e,t,n){return m(e)()};case 1:return function(e,t,r){return m(e)((0,n[0])(e,t,r))};case 2:return function(e,t,r){var o=m(e),a=n[0],i=n[1];return o(a(e,t,r),i(e,t,r))};default:return function(e,t,r){return m(e)(...n.map((n=>n(e,t,r))))}}}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)),n=[],r=0;r<this.args.length;r++)n[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new l(t,n)}clone(){return new l(this.fn,this.args.slice(0))}toString(e){var t,n=this.fn.toString(e);return e&&"object"==typeof e.handler&&b2(e.handler,n)&&(t=e.handler[n](this,e)),void 0!==t?t:super.toString(e)}_toString(e){var t=this.args.map((function(t){return t.toString(e)}));return(o2(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}toJSON(){return{mathjs:Rae,fn:this.fn,args:this.args}}_toHTML(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+g6(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&&b2(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:super.toTex(e)}_toTex(e){var t,r,o=this.args.map((function(t){return t.toTex(e)}));switch(uae[this.name]&&(t=uae[this.name]),!n[this.name]||"function"!=typeof n[this.name].toTex&&"object"!=typeof n[this.name].toTex&&"string"!=typeof n[this.name].toTex||(t=n[this.name].toTex),typeof t){case"function":r=t(this,e);break;case"string":r=i(t,this,e);break;case"object":switch(typeof t[o.length]){case"function":r=t[o.length](this,e);break;case"string":r=i(t[o.length],this,e)}}return void 0!==r?r:i("\\mathrm{${name}}\\left(${args}\\right)",this,e)}getIdentifier(){return this.type+":"+this.name}}return t=l,ste(l,"name",Rae),ste(l,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),ste(l,"fromJSON",(function(e){return new t(e.fn,e.args)})),l}),{isClass:!0,isNode:!0}),Oae="parse",Bae=k2(Oae,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(e=>{var{typed:t,numeric:n,config:r,AccessorNode:o,ArrayNode:a,AssignmentNode:i,BlockNode:l,ConditionalNode:s,ConstantNode:c,FunctionAssignmentNode:u,FunctionNode:d,IndexNode:p,ObjectNode:f,OperatorNode:h,ParenthesisNode:m,RangeNode:v,RelationalNode:g,SymbolNode:y}=e,b=t(Oae,{string:function(e){return V(e,{})},"Array | Matrix":function(e){return w(e,{})},"string, Object":function(e,t){return V(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":w});function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0!==t.nodes?t.nodes:{};return a8(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return V(e,n)}))}var x={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},C={",":!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},_={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},E={true:!0,false:!1,null:null,undefined:void 0},S=["NaN","Infinity"],k={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function T(e,t){return e.expression.substr(e.index,t)}function N(e){return T(e,1)}function D(e){e.index++}function A(e){return e.expression.charAt(e.index-1)}function I(e){return e.expression.charAt(e.index+1)}function R(e){for(e.tokenType=x.NULL,e.token="",e.comment="";;){if("#"===N(e))for(;"\n"!==N(e)&&""!==N(e);)e.comment+=N(e),D(e);if(!b.isWhitespace(N(e),e.nestingLevel))break;D(e)}if(""!==N(e)){if("\n"===N(e)&&!e.nestingLevel)return e.tokenType=x.DELIMITER,e.token=N(e),void D(e);var t=N(e),n=T(e,2),r=T(e,3);if(3===r.length&&C[r])return e.tokenType=x.DELIMITER,e.token=r,D(e),D(e),void D(e);if(2===n.length&&C[n])return e.tokenType=x.DELIMITER,e.token=n,D(e),void D(e);if(C[t])return e.tokenType=x.DELIMITER,e.token=t,void D(e);if(b.isDigitDot(t)){e.tokenType=x.NUMBER;var o=T(e,2);if("0b"===o||"0o"===o||"0x"===o){for(e.token+=N(e),D(e),e.token+=N(e),D(e);b.isHexDigit(N(e));)e.token+=N(e),D(e);if("."===N(e))for(e.token+=".",D(e);b.isHexDigit(N(e));)e.token+=N(e),D(e);else if("i"===N(e))for(e.token+="i",D(e);b.isDigit(N(e));)e.token+=N(e),D(e);return}if("."===N(e)){if(e.token+=N(e),D(e),!b.isDigit(N(e)))return void(e.tokenType=x.DELIMITER)}else{for(;b.isDigit(N(e));)e.token+=N(e),D(e);b.isDecimalMark(N(e),I(e))&&(e.token+=N(e),D(e))}for(;b.isDigit(N(e));)e.token+=N(e),D(e);if("E"===N(e)||"e"===N(e))if(b.isDigit(I(e))||"-"===I(e)||"+"===I(e)){if(e.token+=N(e),D(e),"+"!==N(e)&&"-"!==N(e)||(e.token+=N(e),D(e)),!b.isDigit(N(e)))throw re(e,'Digit expected, got "'+N(e)+'"');for(;b.isDigit(N(e));)e.token+=N(e),D(e);if(b.isDecimalMark(N(e),I(e)))throw re(e,'Digit expected, got "'+N(e)+'"')}else if("."===I(e))throw D(e),re(e,'Digit expected, got "'+N(e)+'"')}else{if(!b.isAlpha(N(e),A(e),I(e))){for(e.tokenType=x.UNKNOWN;""!==N(e);)e.token+=N(e),D(e);throw re(e,'Syntax error in part "'+e.token+'"')}for(;b.isAlpha(N(e),A(e),I(e))||b.isDigit(N(e));)e.token+=N(e),D(e);b2(_,e.token)?e.tokenType=x.DELIMITER:e.tokenType=x.SYMBOL}}else e.tokenType=x.DELIMITER}function M(e){do{R(e)}while("\n"===e.token)}function O(e){e.nestingLevel++}function B(e){e.nestingLevel--}function V(e,t){var n={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:x.NULL,nestingLevel:0,conditionalLevel:null};h1(n,{expression:e,extraNodes:t}),R(n);var r=function(e){var t,n,r=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=P(e),e.comment&&(t.comment=e.comment));for(;"\n"===e.token||";"===e.token;)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),R(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=P(e),e.comment&&(t.comment=e.comment),n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new l(r):(t||(t=new c(void 0),e.comment&&(t.comment=e.comment)),t)}(n);if(""!==n.token)throw n.tokenType===x.DELIMITER?oe(n,"Unexpected operator "+n.token):re(n,'Unexpected part "'+n.token+'"');return r}function P(e){var t,n,r,o,a=function(e){var t=function(e){var t=L(e);for(;"or"===e.token;)M(e),t=new h("or","or",[t,L(e)]);return t}(e);for(;"?"===e.token;){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,M(e);var r=t,o=P(e);if(":"!==e.token)throw re(e,"False part of conditional expression expected");e.conditionalLevel=null,M(e);var a=P(e);t=new s(r,o,a),e.conditionalLevel=n}return t}(e);if("="===e.token){if(f2(a))return t=a.name,M(e),r=P(e),new i(new y(t),r);if(J1(a))return M(e),r=P(e),new i(a.object,a.index,r);if(a2(a)&&f2(a.fn)&&(o=!0,n=[],t=a.name,a.args.forEach((function(e,t){f2(e)?n[t]=e.name:o=!1})),o))return M(e),r=P(e),new u(t,n,r);throw re(e,"Invalid left hand side of assignment operator =")}return a}function L(e){for(var t=F(e);"xor"===e.token;)M(e),t=new h("xor","xor",[t,F(e)]);return t}function F(e){for(var t=z(e);"and"===e.token;)M(e),t=new h("and","and",[t,z(e)]);return t}function z(e){for(var t=j(e);"|"===e.token;)M(e),t=new h("|","bitOr",[t,j(e)]);return t}function j(e){for(var t=$(e);"^|"===e.token;)M(e),t=new h("^|","bitXor",[t,$(e)]);return t}function $(e){for(var t=U(e);"&"===e.token;)M(e),t=new h("&","bitAnd",[t,U(e)]);return t}function U(e){for(var t=[H(e)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};b2(r,e.token);){var o={name:e.token,fn:r[e.token]};n.push(o),M(e),t.push(H(e))}return 1===t.length?t[0]:2===t.length?new h(n[0].name,n[0].fn,t):new g(n.map((e=>e.fn)),t)}function H(e){var t,n,r,o;t=q(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};b2(a,e.token);)r=a[n=e.token],M(e),o=[t,q(e)],t=new h(n,r,o);return t}function q(e){var t,n,r,o;t=W(e);for(var a={to:"to",in:"to"};b2(a,e.token);)r=a[n=e.token],M(e),"in"===n&&""===e.token?t=new h("*","multiply",[t,new y("in")],!0):(o=[t,W(e)],t=new h(n,r,o));return t}function W(e){var t,n=[];if(t=":"===e.token?new c(1):G(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(n.push(t);":"===e.token&&n.length<3;)M(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new y("end")):n.push(G(e));t=3===n.length?new v(n[0],n[2],n[1]):new v(n[0],n[1])}return t}function G(e){var t,n,r,o;t=Y(e);for(var a={"+":"add","-":"subtract"};b2(a,e.token);){r=a[n=e.token],M(e);var i=Y(e);o=i.isPercentage?[t,new h("*","multiply",[t,i])]:[t,i],t=new h(n,r,o)}return t}function Y(e){var t,n,r,o;n=t=K(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};b2(a,e.token);)o=a[r=e.token],M(e),n=K(e),t=new h(r,o,[t,n]);return t}function K(e){var t,n;for(n=t=X(e);e.tokenType===x.SYMBOL||"in"===e.token&&n2(t)||!(e.tokenType!==x.NUMBER||n2(n)||c2(n)&&"!"!==n.op)||"("===e.token;)n=X(e),t=new h("*","multiply",[t,n],!0);return t}function X(e){for(var t=J(e),n=t,r=[];"/"===e.token&&r2(n);){if(r.push(h1({},e)),M(e),e.tokenType!==x.NUMBER){h1(e,r.pop());break}if(r.push(h1({},e)),M(e),e.tokenType!==x.SYMBOL&&"("!==e.token){r.pop(),h1(e,r.pop());break}h1(e,r.pop()),r.pop(),n=J(e),t=new h("/","divide",[t,n])}return t}function J(e){var t,n,r,o;t=Z(e);for(var a={"%":"mod",mod:"mod"};b2(a,e.token);)r=a[n=e.token],M(e),"%"===n&&e.tokenType===x.DELIMITER&&"("!==e.token?t=new h("/","divide",[t,new c(100)],!1,!0):(o=[t,Z(e)],t=new h(n,r,o));return t}function Z(e){var t,o,i,l={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return b2(l,e.token)?(i=l[e.token],t=e.token,M(e),o=[Z(e)],new h(t,i,o)):function(e){var t,o,i,l;t=function(e){var t,o,i;t=function(e){var t=[];if(e.tokenType===x.SYMBOL&&b2(e.extraNodes,e.token)){var o=e.extraNodes[e.token];if(R(e),"("===e.token){if(t=[],O(e),R(e),")"!==e.token)for(t.push(P(e));","===e.token;)R(e),t.push(P(e));if(")"!==e.token)throw re(e,"Parenthesis ) expected");B(e),R(e)}return new o(t)}return function(e){var t;if(e.tokenType===x.SYMBOL||e.tokenType===x.DELIMITER&&e.token in _)return t=e.token,R(e),Q(e,b2(E,t)?new c(E[t]):S.includes(t)?new c(n(t,"number")):new y(t));return function(e){var t;if('"'===e.token||"'"===e.token)return t=ee(e,e.token),Q(e,new c(t));return function(e){var t,o,i,l;if("["===e.token){if(O(e),R(e),"]"!==e.token){var s=te(e);if(";"===e.token){for(i=1,o=[s];";"===e.token;)R(e),"]"!==e.token&&(o[i]=te(e),i++);if("]"!==e.token)throw re(e,"End of matrix ] expected");B(e),R(e),l=o[0].items.length;for(var u=1;u<i;u++)if(o[u].items.length!==l)throw oe(e,"Column dimensions mismatch ("+o[u].items.length+" !== "+l+")");t=new a(o)}else{if("]"!==e.token)throw re(e,"End of matrix ] expected");B(e),R(e),t=s}}else B(e),R(e),t=new a([]);return Q(e,t)}return function(e){if("{"===e.token){var t;O(e);var o={};do{if(R(e),"}"!==e.token){if('"'===e.token||"'"===e.token)t=ee(e,e.token);else{if(!(e.tokenType===x.SYMBOL||e.tokenType===x.DELIMITER&&e.token in _))throw re(e,"Symbol or string expected as object key");t=e.token,R(e)}if(":"!==e.token)throw re(e,"Colon : expected after object key");R(e),o[t]=P(e)}}while(","===e.token);if("}"!==e.token)throw re(e,"Comma , or bracket } expected after object value");B(e),R(e);var a=new f(o);return a=Q(e,a)}return function(e){var t;if(e.tokenType===x.NUMBER){t=e.token,R(e);var o=D2(t,r),a=n(t,o);return new c(a)}return function(e){var t;if("("===e.token){if(O(e),R(e),t=P(e),")"!==e.token)throw re(e,"Parenthesis ) expected");return B(e),R(e),t=Q(e,t=new m(t))}return function(e){throw""===e.token?re(e,"Unexpected end of expression"):re(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);var l={"!":"factorial","'":"ctranspose"};for(;b2(l,e.token);)i=l[o=e.token],R(e),t=Q(e,t=new h(o,i,[t]));return t}(e),("^"===e.token||".^"===e.token)&&(i="^"===(o=e.token)?"pow":"dotPow",M(e),l=[t,Z(e)],t=new h(o,i,l));return t}(e)}function Q(e,t,n){for(var r;"("===e.token||"["===e.token||"."===e.token;)if(r=[],"("===e.token){if(!f2(t)&&!J1(t))return t;if(O(e),R(e),")"!==e.token)for(r.push(P(e));","===e.token;)R(e),r.push(P(e));if(")"!==e.token)throw re(e,"Parenthesis ) expected");B(e),R(e),t=new d(t,r)}else if("["===e.token){if(O(e),R(e),"]"!==e.token)for(r.push(P(e));","===e.token;)R(e),r.push(P(e));if("]"!==e.token)throw re(e,"Parenthesis ] expected");B(e),R(e),t=new o(t,new p(r))}else{if(R(e),!(e.tokenType===x.SYMBOL||e.tokenType===x.DELIMITER&&e.token in _))throw re(e,"Property name expected after dot");r.push(new c(e.token)),R(e);t=new o(t,new p(r,!0))}return t}function ee(e,t){for(var n="";""!==N(e)&&N(e)!==t;)if("\\"===N(e)){D(e);var r=N(e),o=k[r];if(void 0!==o)n+=o,e.index+=1;else{if("u"!==r)throw re(e,"Bad escape character \\".concat(r));var a=e.expression.slice(e.index+1,e.index+5);if(!/^[0-9A-Fa-f]{4}$/.test(a))throw re(e,"Invalid unicode character \\u".concat(a));n+=String.fromCharCode(parseInt(a,16)),e.index+=5}}else n+=N(e),D(e);if(R(e),e.token!==t)throw re(e,"End of string ".concat(t," expected"));return R(e),n}function te(e){for(var t=[P(e)],n=1;","===e.token;)R(e),"]"!==e.token&&";"!==e.token&&(t[n]=P(e),n++);return new a(t)}function ne(e){return e.index-e.token.length+1}function re(e,t){var n=ne(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}function oe(e,t){var n=ne(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}return b.isAlpha=function(e,t,n){return b.isValidLatinOrGreek(e)||b.isValidMathSymbol(e,n)||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||"\t"===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"},b.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},t.addConversion({from:"string",to:"Node",convert:b}),b})),Vae="compile",Pae=k2(Vae,["typed","parse"],(e=>{var{typed:t,parse:n}=e;return t(Vae,{string:function(e){return n(e).compile()},"Array | Matrix":function(e){return a8(e,(function(e){return n(e).compile()}))}})})),Lae="evaluate",Fae=k2(Lae,["typed","parse"],(e=>{var{typed:t,parse:n}=e;return t(Lae,{string:function(e){var t=S1();return n(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=S1();return a8(e,(function(e){return n(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return a8(e,(function(e){return n(e).compile().evaluate(t)}))}})})),zae=k2("Parser",["evaluate"],(e=>{var{evaluate:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:S1(),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(){return function(e){if(e instanceof C1)return e.wrappedObject;var t={};for(var n of e.keys())g1(t,n,e.get(n));return t}(this.scope)},n.prototype.getAllAsMap=function(){return this.scope},n.prototype.set=function(e,t){return this.scope.set(e,t),t},n.prototype.remove=function(e){this.scope.delete(e)},n.prototype.clear=function(){this.scope.clear()},n}),{isClass:!0}),jae="parser",$ae=k2(jae,["typed","Parser"],(e=>{var{typed:t,Parser:n}=e;return t(jae,{"":function(){return new n}})})),Uae=k2("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(e=>{var{typed:t,matrix:n,abs:r,addScalar:o,divideScalar:a,multiplyScalar:i,subtractScalar:l,larger:s,equalScalar:c,unaryMinus:u,DenseMatrix:d,SparseMatrix:p,Spa:f}=e;return t("lup",{DenseMatrix:function(e){return h(e)},SparseMatrix:function(e){return function(e){var t,n,o,l=e._size[0],d=e._size[1],h=Math.min(l,d),m=e._values,v=e._index,g=e._ptr,y=[],b=[],w=[],x=[l,h],C=[],_=[],E=[],S=[h,d],k=[],T=[];for(t=0;t<l;t++)k[t]=t,T[t]=t;var N=function(e,t){var n=T[e],r=T[t];k[n]=t,k[r]=e,T[e]=r,T[t]=n},D=function(){var e=new f;n<l&&(w.push(y.length),y.push(1),b.push(n)),E.push(C.length);var d=g[n],h=g[n+1];for(o=d;o<h;o++)t=v[o],e.set(k[t],m[o]);n>0&&e.forEach(0,n-1,(function(t,n){p._forEachRow(t,y,b,w,(function(r,o){r>t&&e.accumulate(r,u(i(o,n)))}))}));var T=n,D=e.get(n),A=r(D);e.forEach(n+1,l-1,(function(e,t){var n=r(t);s(n,A)&&(T=e,A=n,D=t)})),n!==T&&(p._swapRows(n,T,x[1],y,b,w),p._swapRows(n,T,S[1],C,_,E),e.swap(n,T),N(n,T)),e.forEach(0,l-1,(function(e,t){e<=n?(C.push(t),_.push(e)):(t=a(t,D),c(t,0)||(y.push(t),b.push(e)))}))};for(n=0;n<d;n++)D();return E.push(C.length),w.push(y.length),{L:new p({values:y,index:b,ptr:w,size:x}),U:new p({values:C,index:_,ptr:E,size:S}),p:k,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){var t=h(n(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function h(e){var t,n,u,p=e._size[0],f=e._size[1],h=Math.min(p,f),m=v2(e._data),v=[],g=[p,h],y=[],b=[h,f],w=[];for(t=0;t<p;t++)w[t]=t;for(n=0;n<f;n++){if(n>0)for(t=0;t<p;t++){var x=Math.min(t,n),C=0;for(u=0;u<x;u++)C=o(C,i(m[t][u],m[u][n]));m[t][n]=l(m[t][n],C)}var _=n,E=0,S=0;for(t=n;t<p;t++){var k=m[t][n],T=r(k);s(T,E)&&(_=t,E=T,S=k)}if(n!==_&&(w[n]=[w[_],w[_]=w[n]][0],d._swapRows(n,_,m)),n<p)for(t=n+1;t<p;t++){var N=m[t][n];c(N,0)||(m[t][n]=a(m[t][n],S))}}for(n=0;n<f;n++)for(t=0;t<p;t++)0===n&&(t<f&&(y[t]=[]),v[t]=[]),t<n?(t<f&&(y[t][n]=m[t][n]),n<p&&(v[t][n]=0)):t!==n?(t<f&&(y[t][n]=0),n<p&&(v[t][n]=m[t][n])):(t<f&&(y[t][n]=m[t][n]),n<p&&(v[t][n]=1));var D=new d({data:v,size:g}),A=new d({data:y,size:b}),I=[];for(t=0,h=w.length;t<h;t++)I[w[t]]=t;return{L:D,U:A,p:I,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}})),Hae=k2("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],(e=>{var{typed:t,matrix:n,zeros:r,identity:o,isZero:a,equal:i,sign:l,sqrt:s,conj:c,unaryMinus:u,addScalar:d,divideScalar:p,multiplyScalar:f,subtractScalar:h,complex:m}=e;return h1(t("qr",{DenseMatrix:function(e){return g(e)},SparseMatrix:function(e){return function(){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=g(n(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:v});function v(e){var t,n,m,v=e._size[0],g=e._size[1],y=o([v],"dense"),b=y._data,w=e.clone(),x=w._data,C=r([v],"");for(m=0;m<Math.min(g,v);++m){var _=x[m][m],E=u(i(_,0)?1:l(_)),S=c(E),k=0;for(t=m;t<v;t++)k=d(k,f(x[t][m],c(x[t][m])));var T=f(E,s(k));if(!a(T)){var N=h(_,T);for(C[m]=1,t=m+1;t<v;t++)C[t]=p(x[t][m],N);var D=u(c(p(N,T))),A=void 0;for(n=m;n<g;n++){for(A=0,t=m;t<v;t++)A=d(A,f(c(C[t]),x[t][n]));for(A=f(A,D),t=m;t<v;t++)x[t][n]=f(h(x[t][n],f(C[t],A)),S)}for(t=0;t<v;t++){for(A=0,n=m;n<v;n++)A=d(A,f(b[t][n],C[n]));for(A=f(A,D),n=m;n<v;++n)b[t][n]=p(h(b[t][n],f(A,c(C[n]))),S)}}}return{Q:y,R:w,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function g(e){var t=v(e),n=t.R._data;if(e._data.length>0)for(var r="Complex"===n[0][0].type?m(0):0,o=0;o<n.length;++o)for(var a=0;a<o&&a<(n[0]||[]).length;++a)n[o][a]=r;return t}}));function qae(e,t,n,r,o,a,i){var l=0;for(n[i]=e;l>=0;){var s=n[i+l],c=n[r+s];-1===c?(l--,a[t++]=s):(n[r+s]=n[o+c],n[i+ ++l]=c)}return t}function Wae(e){return-e-2}var Gae=k2("csAmd",["add","multiply","transpose"],(e=>{var{add:t,multiply:n,transpose:r}=e;return function(e,i){if(!i||e<=0||e>3)return null;var l=i._size,s=l[0],c=l[1],u=0,d=Math.max(16,10*Math.sqrt(c)),p=function(e,o,a,i,l){var s=r(o);if(1===e&&i===a)return t(o,s);if(2===e){for(var c=s._index,u=s._ptr,d=0,p=0;p<a;p++){var f=u[p];if(u[p]=d,!(u[p+1]-f>l))for(var h=u[p+1];f<h;f++)c[d++]=c[f]}return u[a]=d,o=r(s),n(s,o)}return n(s,o)}(e,i,s,c,d=Math.min(c-2,d));!function(e,t,n){for(var r=e._values,o=e._index,a=e._ptr,i=e._size[1],l=0,s=0;s<i;s++){var c=a[s];for(a[s]=l;c<a[s+1];c++)t(o[c],s,r?r[c]:1,n)&&(o[l]=o[c],r&&(r[l]=r[c]),l++)}a[i]=l,o.splice(l,o.length-l),r&&r.splice(l,r.length-l)}(p,a,null);for(var f,h,m,v,g,y,b,w,x,C,_,E,S,k,T,N,D=p._index,A=p._ptr,I=A[c],R=[],M=[],O=c+1,B=2*(c+1),V=3*(c+1),P=4*(c+1),L=5*(c+1),F=6*(c+1),z=7*(c+1),j=R,$=function(e,t,n,r,a,i,l,s,c,u,d,p){for(var f=0;f<e;f++)n[r+f]=t[f+1]-t[f];n[r+e]=0;for(var h=0;h<=e;h++)n[a+h]=-1,i[h]=-1,n[l+h]=-1,n[s+h]=-1,n[c+h]=1,n[u+h]=1,n[d+h]=0,n[p+h]=n[r+h];var m=o(0,0,n,u,e);return n[d+e]=-2,t[e]=-1,n[u+e]=0,m}(c,A,M,0,V,j,B,z,O,F,P,L),U=function(e,t,n,r,o,a,i,l,s,c,u){for(var d=0,p=0;p<e;p++){var f=n[r+p];if(0===f)n[o+p]=-2,d++,t[p]=-1,n[a+p]=0;else if(f>i)n[l+p]=0,n[o+p]=-1,d++,t[p]=Wae(e),n[l+e]++;else{var h=n[s+f];-1!==h&&(c[h]=p),n[u+p]=n[s+f],n[s+f]=p}}return d}(c,A,M,L,P,F,d,O,V,j,B),H=0;U<c;){for(m=-1;H<c&&-1===(m=M[V+H]);H++);-1!==M[B+m]&&(j[M[B+m]]=-1),M[V+H]=M[B+m];var q=M[P+m],W=M[O+m];U+=W;var G=0;M[O+m]=-W;var Y=A[m],K=0===q?Y:I,X=K;for(v=1;v<=q+1;v++){for(v>q?(y=m,b=Y,w=M[0+m]-q):(b=A[y=D[Y++]],w=M[0+y]),g=1;g<=w;g++)(x=M[O+(f=D[b++])])<=0||(G+=x,M[O+f]=-x,D[X++]=f,-1!==M[B+f]&&(j[M[B+f]]=j[f]),-1!==j[f]?M[B+j[f]]=M[B+f]:M[V+M[L+f]]=M[B+f]);y!==m&&(A[y]=Wae(m),M[F+y]=0)}for(0!==q&&(I=X),M[L+m]=G,A[m]=K,M[0+m]=X-K,M[P+m]=-2,$=o($,u,M,F,c),C=K;C<X;C++)if(!((_=M[P+(f=D[C])])<=0)){var J=$-(x=-M[O+f]);for(Y=A[f],E=A[f]+_-1;Y<=E;Y++)M[F+(y=D[Y])]>=$?M[F+y]-=x:0!==M[F+y]&&(M[F+y]=M[L+y]+J)}for(C=K;C<X;C++){for(S=(E=A[f=D[C]])+M[P+f]-1,k=E,T=0,N=0,Y=E;Y<=S;Y++)if(0!==M[F+(y=D[Y])]){var Z=M[F+y]-$;Z>0?(N+=Z,D[k++]=y,T+=y):(A[y]=Wae(m),M[F+y]=0)}M[P+f]=k-E+1;var Q=k,ee=E+M[0+f];for(Y=S+1;Y<ee;Y++){var te=M[O+(h=D[Y])];te<=0||(N+=te,D[k++]=h,T+=h)}0===N?(A[f]=Wae(m),G-=x=-M[O+f],W+=x,U+=x,M[O+f]=0,M[P+f]=-1):(M[L+f]=Math.min(M[L+f],N),D[k]=D[Q],D[Q]=D[E],D[E]=m,M[0+f]=k-E+1,T=(T<0?-T:T)%c,M[B+f]=M[z+T],M[z+T]=f,j[f]=T)}for(M[L+m]=G,$=o($+(u=Math.max(u,G)),u,M,F,c),C=K;C<X;C++)if(!(M[O+(f=D[C])]>=0))for(f=M[z+(T=j[f])],M[z+T]=-1;-1!==f&&-1!==M[B+f];f=M[B+f],$++){for(w=M[0+f],_=M[P+f],Y=A[f]+1;Y<=A[f]+w-1;Y++)M[F+D[Y]]=$;var ne=f;for(h=M[B+f];-1!==h;){var re=M[0+h]===w&&M[P+h]===_;for(Y=A[h]+1;re&&Y<=A[h]+w-1;Y++)M[F+D[Y]]!==$&&(re=0);re?(A[h]=Wae(f),M[O+f]+=M[O+h],M[O+h]=0,M[P+h]=-1,h=M[B+h],M[B+ne]=h):(ne=h,h=M[B+h])}}for(Y=K,C=K;C<X;C++)(x=-M[O+(f=D[C])])<=0||(M[O+f]=x,N=M[L+f]+G-x,-1!==M[V+(N=Math.min(N,c-U-x))]&&(j[M[V+N]]=f),M[B+f]=M[V+N],j[f]=-1,M[V+N]=f,H=Math.min(H,N),M[L+f]=N,D[Y++]=f);M[O+m]=W,0===(M[0+m]=Y-K)&&(A[m]=-1,M[F+m]=0),0!==q&&(I=Y)}for(f=0;f<c;f++)A[f]=Wae(A[f]);for(h=0;h<=c;h++)M[V+h]=-1;for(h=c;h>=0;h--)M[O+h]>0||(M[B+h]=M[V+A[h]],M[V+A[h]]=h);for(y=c;y>=0;y--)M[O+y]<=0||-1!==A[y]&&(M[B+y]=M[V+A[y]],M[V+A[y]]=y);for(m=0,f=0;f<=c;f++)-1===A[f]&&(m=qae(f,m,M,V,B,R,F));return R.splice(R.length-1,1),R};function o(e,t,n,r,o){if(e<2||e+t<0){for(var a=0;a<o;a++)0!==n[r+a]&&(n[r+a]=1);e=2}return e}function a(e,t){return e!==t}}));function Yae(e,t,n,r,o,a,i){var l,s,c,u=0;if(e<=t||n[r+t]<=n[o+e])return-1;n[o+e]=n[r+t];var d=n[a+e];if(n[a+e]=t,-1===d)u=1,c=e;else{for(u=2,c=d;c!==n[i+c];c=n[i+c]);for(l=d;l!==c;l=s)s=n[i+l],n[i+l]=c}return{jleaf:u,q:c}}var Kae=k2("csCounts",["transpose"],(e=>{var{transpose:t}=e;return function(e,n,r,o){if(!e||!n||!r)return null;var a,i,l,s,c,u,d,p=e._size,f=p[0],h=p[1],m=4*h+(o?h+f+1:0),v=[],g=h,y=2*h,b=3*h,w=4*h,x=5*h+1;for(l=0;l<m;l++)v[l]=-1;var C=[],_=t(e),E=_._index,S=_._ptr;for(l=0;l<h;l++)for(C[i=r[l]]=-1===v[b+i]?1:0;-1!==i&&-1===v[b+i];i=n[i])v[b+i]=l;if(o){for(l=0;l<h;l++)v[r[l]]=l;for(a=0;a<f;a++){for(l=h,u=S[a],d=S[a+1],c=u;c<d;c++)l=Math.min(l,v[E[c]]);v[x+a]=v[w+l],v[w+l]=a}}for(a=0;a<h;a++)v[0+a]=a;for(l=0;l<h;l++){for(-1!==n[i=r[l]]&&C[n[i]]--,s=o?v[w+l]:i;-1!==s;s=o?v[x+s]:-1)for(c=S[s];c<S[s+1];c++){var k=Yae(a=E[c],i,v,b,g,y,0);k.jleaf>=1&&C[i]++,2===k.jleaf&&C[k.q]--}-1!==n[i]&&(v[0+i]=n[i])}for(i=0;i<h;i++)-1!==n[i]&&(C[n[i]]+=C[i]);return C}})),Xae=k2("csSqr",["add","multiply","transpose"],(e=>{var{add:t,multiply:n,transpose:r}=e,o=Gae({add:t,multiply:n,transpose:r}),a=Kae({transpose:r});return function(e,t,n){var r,i=t._ptr,l=t._size[1],s={};if(s.q=o(e,t),e&&!s.q)return null;if(n){var c=e?function(e,t,n){e._values;for(var r=e._index,o=e._ptr,a=e._size,i=e._datatype,l=a[0],s=a[1],c=[],u=[],d=0,p=0;p<s;p++){u[p]=d;for(var f=n?n[p]:p,h=o[f],m=o[f+1],v=h;v<m;v++){var g=r[v];c[d]=g,d++}}return u[s]=d,e.createSparseMatrix({values:null,index:c,ptr:u,size:[l,s],datatype:i})}(t,0,s.q):t;s.parent=function(e){if(!e)return null;var t,n,r=e._index,o=e._ptr,a=e._size,i=a[0],l=a[1],s=[],c=[],u=l;for(t=0;t<i;t++)c[u+t]=-1;for(var d=0;d<l;d++){s[d]=-1,c[0+d]=-1;for(var p=o[d],f=o[d+1],h=p;h<f;h++){var m=r[h];for(t=c[u+m];-1!==t&&t<d;t=n)n=c[0+t],c[0+t]=d,-1===n&&(s[t]=d);c[u+m]=d}}return s}(c);var u=function(e,t){if(!e)return null;var n,r=0,o=[],a=[],i=t,l=2*t;for(n=0;n<t;n++)a[0+n]=-1;for(n=t-1;n>=0;n--)-1!==e[n]&&(a[i+n]=a[0+e[n]],a[0+e[n]]=n);for(n=0;n<t;n++)-1===e[n]&&(r=qae(n,r,a,0,i,o,l));return o}(s.parent,l);if(s.cp=a(c,s.parent,u,1),c&&s.parent&&s.cp&&function(e,t){var n=e._ptr,r=e._index,o=e._size,a=o[0],i=o[1];t.pinv=[],t.leftmost=[];var l,s,c,u,d,p=t.parent,f=t.pinv,h=t.leftmost,m=[],v=0,g=a,y=a+i,b=a+2*i;for(s=0;s<i;s++)m[g+s]=-1,m[y+s]=-1,m[b+s]=0;for(l=0;l<a;l++)h[l]=-1;for(s=i-1;s>=0;s--)for(u=n[s],d=n[s+1],c=u;c<d;c++)h[r[c]]=s;for(l=a-1;l>=0;l--)f[l]=-1,-1!==(s=h[l])&&(0===m[b+s]++&&(m[y+s]=l),m[v+l]=m[g+s],m[g+s]=l);for(t.lnz=0,t.m2=a,s=0;s<i;s++)if(l=m[g+s],t.lnz++,l<0&&(l=t.m2++),f[l]=s,!(--b[s]<=0)){t.lnz+=m[b+s];var w=p[s];-1!==w&&(0===m[b+w]&&(m[y+w]=m[y+s]),m[v+m[y+s]]=m[g+w],m[g+w]=m[v+l],m[b+w]+=m[b+s])}for(l=0;l<a;l++)f[l]<0&&(f[l]=s++);return!0}(c,s))for(s.unz=0,r=0;r<l;r++)s.unz+=s.cp[r]}else s.unz=4*i[l]+l,s.lnz=s.unz;return s}}));function Jae(e,t){return e[t]<0}function Zae(e,t){e[t]=Wae(e[t])}function Qae(e){return e<0?Wae(e):e}function eie(e,t,n,r,o){var a,i,l,s=t._index,c=t._ptr,u=t._size[1],d=0;for(r[0]=e;d>=0;){e=r[d];var p=o?o[e]:e;Jae(c,e)||(Zae(c,e),r[u+d]=p<0?0:Qae(c[p]));var f=1;for(i=r[u+d],l=p<0?0:Qae(c[p+1]);i<l;i++)if(!Jae(c,a=s[i])){r[u+d]=i,r[++d]=a,f=0;break}f&&(d--,r[--n]=e)}return n}var tie=k2("csSpsolve",["divideScalar","multiply","subtract"],(e=>{var{divideScalar:t,multiply:n,subtract:r}=e;return function(e,o,a,i,l,s,c){var u,d,p,f,h=e._values,m=e._index,v=e._ptr,g=e._size[1],y=o._values,b=o._index,w=o._ptr,x=function(e,t,n,r,o){var a,i,l,s=e._ptr,c=e._size,u=t._index,d=t._ptr,p=c[1],f=p;for(i=d[n],l=d[n+1],a=i;a<l;a++){var h=u[a];Jae(s,h)||(f=eie(h,e,f,r,o))}for(a=f;a<p;a++)Zae(s,r[a]);return f}(e,o,a,i,s);for(u=x;u<g;u++)l[i[u]]=0;for(d=w[a],p=w[a+1],u=d;u<p;u++)l[b[u]]=y[u];for(var C=x;C<g;C++){var _=i[C],E=s?s[_]:_;if(!(E<0))for(d=v[E],p=v[E+1],l[_]=t(l[_],h[c?d:p-1]),u=c?d+1:d,f=c?p:p-1;u<f;u++){var S=m[u];l[S]=r(l[S],n(h[u],l[_]))}}return x}})),nie=k2("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],(e=>{var{abs:t,divideScalar:n,multiply:r,subtract:o,larger:a,largerEq:i,SparseMatrix:l}=e,s=tie({divideScalar:n,multiply:r,subtract:o});return function(e,o,c){if(!e)return null;var u,d=e._size[1],p=100,f=100;o&&(u=o.q,p=o.lnz||p,f=o.unz||f);var h,m,v=[],g=[],y=[],b=new l({values:v,index:g,ptr:y,size:[d,d]}),w=[],x=[],C=[],_=new l({values:w,index:x,ptr:C,size:[d,d]}),E=[],S=[],k=[];for(h=0;h<d;h++)S[h]=0,E[h]=-1,y[h+1]=0;p=0,f=0;for(var T=0;T<d;T++){y[T]=p,C[T]=f;var N=u?u[T]:T,D=s(b,e,N,k,S,E,1),A=-1,I=-1;for(m=D;m<d;m++)if(E[h=k[m]]<0){var R=t(S[h]);a(R,I)&&(I=R,A=h)}else x[f]=E[h],w[f++]=S[h];if(-1===A||I<=0)return null;E[N]<0&&i(t(S[N]),r(I,c))&&(A=N);var M=S[A];for(x[f]=T,w[f++]=M,E[A]=T,g[p]=A,v[p++]=1,m=D;m<d;m++)E[h=k[m]]<0&&(g[p]=h,v[p++]=n(S[h],M)),S[h]=0}for(y[d]=p,C[d]=f,m=0;m<p;m++)g[m]=E[g[m]];return v.splice(p,v.length-p),g.splice(p,g.length-p),w.splice(f,w.length-f),x.splice(f,x.length-f),{L:b,U:_,pinv:E}}})),rie=k2("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],(e=>{var{typed:t,abs:n,add:r,multiply:o,transpose:a,divideScalar:i,subtract:l,larger:s,largerEq:c,SparseMatrix:u}=e,d=Xae({add:r,multiply:o,transpose:a}),p=nie({abs:n,divideScalar:i,multiply:o,subtract:l,larger:s,largerEq:c,SparseMatrix:u});return t("slu",{"SparseMatrix, number, number":function(e,t,n){if(!N2(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var r=d(t,e,!1),o=p(e,r,n);return{L:o.L,U:o.U,p:o.pinv,q:r.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));function oie(e,t){var n,r=t.length,o=[];if(e)for(n=0;n<r;n++)o[e[n]]=t[n];else for(n=0;n<r;n++)o[n]=t[n];return o}var aie="lusolve",iie=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],lie=k2(aie,iie,(e=>{var{typed:t,matrix:n,lup:r,slu:o,usolve:a,lsolve:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(aie,{"Array, Array | Matrix":function(e,t){e=n(e);var o=r(e);return u(o.L,o.U,o.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var n=r(e);return u(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var n=r(e);return u(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,n,r){var a=o(e,n,r);return u(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return u(e.L,e.U,e.p,e.q,t)}});function c(e){if(B1(e))return e;if(O1(e))return n(e);throw new TypeError("Invalid Matrix LU decomposition")}function u(e,t,n,r,o){e=c(e),t=c(t),n&&((o=s(e,o,!0))._data=oie(n,o._data));var l=i(e,o),u=a(t,l);return r&&(u._data=oie(r,u._data)),u}})),sie="polynomialRoot",cie=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],uie=k2(sie,cie,(e=>{var{typed:t,isZero:n,equalScalar:r,add:o,subtract:a,multiply:i,divide:l,sqrt:s,unaryMinus:c,cbrt:u,typeOf:d,im:p,re:f}=e;return t(sie,{"number|Complex, ...number|Complex":(e,t)=>{for(var h=[e,...t];h.length>0&&n(h[h.length-1]);)h.pop();if(h.length<2)throw new RangeError("Polynomial [".concat(e,", ").concat(t,"] must have a non-zero non-constant coefficient"));switch(h.length){case 2:return[c(l(h[0],h[1]))];case 3:var[m,v,g]=h,y=i(2,g),b=i(v,v),w=i(4,g,m);if(r(b,w))return[l(c(v),y)];var x=s(a(b,w));return[l(a(x,v),y),l(a(c(x),v),y)];case 4:var[C,_,E,S]=h,k=c(i(3,S)),T=i(E,E),N=i(3,S,_),D=o(i(2,E,E,E),i(27,S,S,C)),A=i(9,S,E,_);if(r(T,N)&&r(D,A))return[l(E,k)];var I,R=a(T,N),M=a(D,A),O=o(i(18,S,E,_,C),i(E,E,_,_)),B=o(i(4,E,E,E,C),i(4,S,_,_,_),i(27,S,S,C,C));if(r(O,B))return[l(a(i(4,S,E,_),o(i(9,S,S,C),i(E,E,E))),i(S,R)),l(a(i(9,S,C),i(E,_)),i(2,R))];I=r(T,N)?M:l(o(M,s(a(i(M,M),i(4,R,R,R)))),2);var V=u(I,!0).toArray().map((e=>l(o(E,e,l(R,e)),k)));return V.map((e=>"Complex"===d(e)&&r(f(e),f(e)+p(e))?f(e):e));default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(h))}}})})),die=["evaluate"],pie=k2("Help",die,(e=>{var{evaluate:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){var e=this.doc||{},n="\n";if(e.name&&(n+="Name: "+e.name+"\n\n"),e.category&&(n+="Category: "+e.category+"\n\n"),e.description&&(n+="Description:\n "+e.description+"\n\n"),e.syntax&&(n+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){n+="Examples:\n";for(var r=!1,o=t("config()"),a={config:e=>(r=!0,t("config(newConfig)",{newConfig:e}))},i=0;i<e.examples.length;i++){var l=e.examples[i];n+=" "+l+"\n";var s=void 0;try{s=t(l,a)}catch(HT){s=HT}void 0===s||U1(s)||(n+=" "+h6(s,{precision:14})+"\n")}n+="\n",r&&t("config(originalConfig)",{originalConfig:o})}return e.mayThrow&&e.mayThrow.length&&(n+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(n+="See also: "+e.seealso.join(", ")+"\n"),n},n.prototype.toJSON=function(){var e=v2(this.doc);return e.mathjs="Help",e},n.fromJSON=function(e){var t={};return Object.keys(e).filter((e=>"mathjs"!==e)).forEach((n=>{t[n]=e[n]})),new n(t)},n.prototype.valueOf=n.prototype.toString,n}),{isClass:!0}),fie=["?on","math","typed"],hie=k2("Chain",fie,(e=>{var{on:t,math:n,typed:r}=e;function o(e){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");h2(e)?this.value=e.value:this.value=e}function a(e,t){var n,r,a,l,s;n=o.prototype,r=e,a=function(){var e=t();if("function"==typeof e)return i(e)},s=!0,Object.defineProperty(n,r,{get:function(){return s&&(l=a(),s=!1),l},set:function(e){l=e,s=!1},configurable:!0,enumerable:!0})}function i(e){return function(){if(0===arguments.length)return new o(e(this.value));for(var t=[this.value],n=0;n<arguments.length;n++)t[n+1]=arguments[n];if(r.isTypedFunction(e)){var a=r.resolve(e,t);if(1===a.params.length)throw new Error("chain function "+e.name+" cannot match rest parameter between chain value and additional arguments.");return new o(a.implementation.apply(e,t))}return new o(e.apply(e,t))}}o.prototype.type="Chain",o.prototype.isChain=!0,o.prototype.done=function(){return this.value},o.prototype.valueOf=function(){return this.value},o.prototype.toString=function(){return h6(this.value)},o.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},o.fromJSON=function(e){return new o(e.value)},o.createProxy=function(e,t){if("string"==typeof e)!function(e,t){"function"==typeof t&&(o.prototype[e]=i(t))}(e,t);else{var n=function(t){b2(e,t)&&void 0===l[t]&&a(t,(()=>e[t]))};for(var r in e)n(r)}};var l={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return o.createProxy(n),t&&t("import",(function(e,t,n){n||a(e,t)})),o}),{isClass:!0}),mie={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"]},vie={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"]},gie={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:mie,E:mie,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:vie,PI:vie,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",examples:["coulomb"]},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)"],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)"],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)"],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)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)"],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)"],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>1, -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:"he 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"]},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:[]},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:[]},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"]},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"]},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"]},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.",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.",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.",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.",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","sum","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:[]},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"]},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"]},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"]}},yie="help",bie=k2(yie,["typed","mathWithTransform","Help"],(e=>{var{typed:t,mathWithTransform:n,Help:r}=e;return t(yie,{any:function(e){var t,o=e;if("string"!=typeof e)for(t in n)if(b2(n,t)&&e===n[t]){o=t;break}var a=v1(gie,o);if(!a){var i="function"==typeof o?o.name:o;throw new Error('No documentation found on "'+i+'"')}return new r(a)}})})),wie="chain",xie=k2(wie,["typed","Chain"],(e=>{var{typed:t,Chain:n}=e;return t(wie,{"":function(){return new n},any:function(e){return new n(e)}})})),Cie=k2("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],(e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:o,divideScalar:a,isZero:i,unaryMinus:l}=e;return t("det",{any:function(e){return v2(e)},"Array | Matrix":function(e){var t;switch((t=B1(e)?e.size():Array.isArray(e)?(e=n(e)).size():[]).length){case 0:return v2(e);case 1:if(1===t[0])return v2(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:var s=t[0],c=t[1];if(s===c)return function(e,t){if(1===t)return v2(e[0][0]);if(2===t)return r(o(e[0][0],e[1][1]),o(e[1][0],e[0][1]));for(var n=!1,s=new Array(t).fill(0).map(((e,t)=>t)),c=0;c<t;c++){var u=s[c];if(i(e[u][c])){var d=void 0;for(d=c+1;d<t;d++)if(!i(e[s[d]][c])){u=s[d],s[d]=s[c],s[c]=u,n=!n;break}if(d===t)return e[u][c]}for(var p=e[u][c],f=0===c?1:e[s[c-1]][c-1],h=c+1;h<t;h++)for(var m=s[h],v=c+1;v<t;v++)e[m][v]=a(r(o(e[m][v],p),o(e[m][c],e[u][v])),f)}var g=e[s[t-1]][t-1];return n?l(g):g}(e.clone().valueOf(),s);if(0===c)return 1;throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}}})})),_ie=k2("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],(e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:o,multiply:a,unaryMinus:i,det:l,identity:s,abs:c}=e;return t("inv",{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);switch(t.length){case 1:if(1===t[0])return B1(e)?n([r(1,e.valueOf()[0])]):[r(1,e[0])];throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:var o=t[0],a=t[1];if(o===a)return B1(e)?n(u(e.valueOf(),o,a),e.storage()):u(e,o,a);throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}},any:function(e){return r(1,e)}});function u(e,t,n){var u,d,p,f,h;if(1===t){if(0===(f=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,f)]]}if(2===t){var m=l(e);if(0===m)throw Error("Cannot calculate inverse, determinant is zero");return[[r(e[1][1],m),r(i(e[0][1]),m)],[r(i(e[1][0]),m),r(e[0][0],m)]]}var v=e.concat();for(u=0;u<t;u++)v[u]=v[u].concat();for(var g=s(t).valueOf(),y=0;y<n;y++){var b=c(v[y][y]),w=y;for(u=y+1;u<t;)c(v[u][y])>b&&(b=c(v[u][y]),w=u),u++;if(0===b)throw Error("Cannot calculate inverse, determinant is zero");(u=w)!==y&&(h=v[y],v[y]=v[u],v[u]=h,h=g[y],g[y]=g[u],g[u]=h);var x=v[y],C=g[y];for(u=0;u<t;u++){var _=v[u],E=g[u];if(u!==y){if(0!==_[y]){for(p=r(i(_[y]),x[y]),d=y;d<n;d++)_[d]=o(_[d],a(p,x[d]));for(d=0;d<n;d++)E[d]=o(E[d],a(p,C[d]))}}else{for(p=x[y],d=y;d<n;d++)_[d]=r(_[d],p);for(d=0;d<n;d++)E[d]=r(E[d],p)}}}return g}})),Eie="pinv",Sie=k2(Eie,["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],(e=>{var{typed:t,matrix:n,inv:r,deepEqual:o,equal:a,dotDivide:i,dot:l,ctranspose:s,divideScalar:c,multiply:u,add:d,Complex:p}=e;return t(Eie,{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);switch(t.length){case 1:return m(e)?s(e):1===t[0]?r(e):i(s(e),l(e,e));case 2:if(m(e))return s(e);var o=t[0],a=t[1];if(o===a)try{return r(e)}catch(c){if(!(c instanceof Error&&c.message.match(/Cannot calculate inverse, determinant is zero/)))throw c}return B1(e)?n(f(e.valueOf(),o,a),e.storage()):f(e,o,a);default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}},any:function(e){return a(e,0)?v2(e):c(1,e)}});function f(e,t,n){var{C:o,F:a}=function(e,t,n){var r=function(e,t,n){for(var r=v2(e),o=0,a=0;a<t;a++){if(n<=o)return r;for(var l=a;h(r[l][o]);)if(t===++l&&(l=a,n===++o))return r;[r[l],r[a]]=[r[a],r[l]];for(var s=r[a][o],c=0;c<n;c++)r[a][c]=i(r[a][c],s);for(var p=0;p<t;p++)if(p!==a){s=r[p][o];for(var f=0;f<n;f++)r[p][f]=d(r[p][f],u(-1,u(s,r[a][f])))}o++}return r}(e,t,n),o=e.map(((e,n)=>e.filter(((e,n)=>n<t&&!h(l(r[n],r[n])))))),a=r.filter(((e,t)=>!h(l(r[t],r[t]))));return{C:o,F:a}}(e,t,n),c=u(r(u(s(o),o)),s(o)),p=u(s(a),r(u(a,s(a))));return u(p,c)}function h(e){return a(d(e,p(1,1)),d(0,p(1,1)))}function m(e){return o(d(e,p(1,1)),d(u(e,0),p(1,1)))}}));function kie(e){var{addScalar:t,subtract:n,flatten:r,multiply:o,multiplyScalar:a,divideScalar:i,sqrt:l,abs:s,bignumber:c,diag:u,size:d,reshape:p,inv:f,qr:h,usolve:m,usolveAll:v,equal:g,complex:y,larger:b,smaller:w,matrixFromColumns:x,dot:C}=e;function _(e,r,o,i){var s=t(e,i),c=n(a(e,i),a(r,o)),u=a(s,.5),d=a(l(n(a(s,s),a(4,c))),.5);return[t(u,d),n(u,d)]}function E(e,t,r,o,a,i,l,u){var d="BigNumber"===u,p="Complex"===u,f=d?c(0):p?y(0):0,h=d?c(1):p?y(1):1;if(w(s(r),l))return[[h,f],[f,h]];if(b(s(n(a,i)),l))return[[n(a,o),n(i,o)],[r,r]];var m=n(e,a),v=n(o,a);return w(s(t),l)&&w(s(v),l)?[[m,h],[r,f]]:[[t,f],[v,h]]}function S(e,t){for(var n=0;n<e.length;n++)e[n].push(...Array(t-e[n].length).fill(0));for(var r=e.length;r<t;r++)e.push(Array(t).fill(0)),e[r][r]=1;return e}function k(e,t,n){for(var r=0;r<e.length;r++)if(n(e[r],t))return r;return-1}function T(e,t,n,r,o){for(var a,i="BigNumber"===o?c(1e3):1e3,l=0;l<5;++l){a=N(t,n,o);try{a=m(e,a)}catch(u){continue}if(b(A(a),i))break}if(l>=5)return null;for(l=0;;){var s=m(e,a);if(w(A(D(a,[s])),r))break;if(++l>=10)return null;a=I(s)}return a}function N(e,t,n){var r="BigNumber"===n,o="Complex"===n,a=Array(e).fill(0).map((e=>2*Math.random()-1));return r&&(a=a.map((e=>c(e)))),o&&(a=a.map((e=>y(e)))),I(a=D(a,t),n)}function D(e,t){var r=d(e);for(var a of t)a=p(a,r),e=n(e,o(i(C(a,e),C(a,a)),a));return e}function A(e){return s(l(C(e,e)))}function I(e,t){var n="Complex"===t,r="BigNumber"===t?c(1):n?y(1):1;return o(i(r,A(e)),e)}return function(e,l,d,p){var m=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],x=function(e,n,r,o,l){var d,p="BigNumber"===o,f="Complex"===o,h=p?c(0):0,m=p?c(1):f?y(1):1,v=p?c(1):1,x=p?c(10):2,C=a(x,x);l&&(d=Array(n).fill(m));var _=!1;for(;!_;){_=!0;for(var E=0;E<n;E++){for(var S=h,k=h,T=0;T<n;T++)E!==T&&(S=t(S,s(e[T][E])),k=t(k,s(e[E][T])));if(!g(S,0)&&!g(k,0)){for(var N=v,D=S,A=i(k,x),I=a(k,x);w(D,A);)D=a(D,C),N=a(N,x);for(;b(D,I);)D=i(D,C),N=i(N,x);if(w(i(t(D,k),N),a(t(S,k),.95))){_=!1;for(var R=i(1,N),M=0;M<n;M++)E!==M&&(e[E][M]=a(e[E][M],R),e[M][E]=a(e[M][E],N));l&&(d[E]=a(d[E],R))}}}}return l?u(d):null}(e,l,0,p,m);!function(e,r,o,l,u,d){var p="BigNumber"===l,f="Complex"===l,h=p?c(0):f?y(0):0;p&&(o=c(o));for(var m=0;m<r-2;m++){for(var v=0,g=h,b=m+1;b<r;b++){var x=e[b][m];w(s(g),s(x))&&(g=x,v=b)}if(!w(s(g),o)){if(v!==m+1){var C=e[v];e[v]=e[m+1],e[m+1]=C;for(var _=0;_<r;_++){var E=e[_][v];e[_][v]=e[_][m+1],e[_][m+1]=E}if(u){var S=d[v];d[v]=d[m+1],d[m+1]=S}}for(var k=m+2;k<r;k++){var T=i(e[k][m],g);if(0!==T){for(var N=0;N<r;N++)e[k][N]=n(e[k][N],a(T,e[m+1][N]));for(var D=0;D<r;D++)e[D][m+1]=t(e[D][m+1],a(T,e[D][k]));if(u)for(var A=0;A<r;A++)d[k][A]=n(d[k][A],a(T,d[m+1][A]))}}}}}(e,l,d,p,m,x);var{values:C,C:N}=function(e,r,a,i,l){var d="BigNumber"===i,p="Complex"===i,f=d?c(1):p?y(1):1;d&&(a=c(a));var m=v2(e),v=[],g=r,b=[],x=l?u(Array(r).fill(f)):void 0,C=l?u(Array(g).fill(f)):void 0,k=0;for(;k<=100;){k+=1;for(var T=m[g-1][g-1],N=0;N<g;N++)m[N][N]=n(m[N][N],T);var{Q:D,R:A}=h(m);m=o(A,D);for(var I=0;I<g;I++)m[I][I]=t(m[I][I],T);if(l&&(C=o(C,D)),1===g||w(s(m[g-1][g-2]),a)){k=0,v.push(m[g-1][g-1]),l&&(b.unshift([[1]]),S(C,r),x=o(x,C),g>1&&(C=u(Array(g-1).fill(f)))),g-=1,m.pop();for(var R=0;R<g;R++)m[R].pop()}else if(2===g||w(s(m[g-2][g-3]),a)){k=0;var M=_(m[g-2][g-2],m[g-2][g-1],m[g-1][g-2],m[g-1][g-1]);v.push(...M),l&&(b.unshift(E(m[g-2][g-2],m[g-2][g-1],m[g-1][g-2],m[g-1][g-1],M[0],M[1],a,i)),S(C,r),x=o(x,C),g>2&&(C=u(Array(g-2).fill(f)))),g-=2,m.pop(),m.pop();for(var O=0;O<g;O++)m[O].pop(),m[O].pop()}if(0===g)break}if(v.sort(((e,t)=>+n(s(e),s(t)))),k>100){var B=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+v.join(", "));throw B.values=v,B.vectors=[],B}var V=l?o(x,function(e,t){for(var n=[],r=0;r<t;r++)n[r]=Array(t).fill(0);var o=0;for(var a of e){for(var i=a.length,l=0;l<i;l++)for(var s=0;s<i;s++)n[o+l][o+s]=a[l][s];o+=i}return n}(b,r)):void 0;return{values:v,C:V}}(e,l,d,p,m);if(m){var D=function(e,t,a,i,l,s,d){var p=f(a),h=o(p,e,a),m="BigNumber"===d,b="Complex"===d,w=m?c(0):b?y(0):0,x=m?c(1):b?y(1):1,C=[],_=[];for(var E of l){var S=k(C,E,g);-1===S?(C.push(E),_.push(1)):_[S]+=1}for(var N=[],D=C.length,A=Array(t).fill(w),I=u(Array(t).fill(x)),R=function(){var e=C[M],l=n(h,o(e,I)),c=v(l,A);for(c.shift();c.length<_[M];){var u=T(l,t,c,s,d);if(null===u)break;c.push(u)}var p=o(f(i),a);c=c.map((e=>o(p,e))),N.push(...c.map((t=>({value:e,vector:r(t)}))))},M=0;M<D;M++)R();return N}(e,l,N,x,C,d,p);return{values:C,eigenvectors:D}}return{values:C}}}function Tie(e){var{config:t,addScalar:n,subtract:r,abs:o,atan:a,cos:i,sin:l,multiplyScalar:s,inv:c,bignumber:u,multiply:d,add:p}=e;function f(e,n,r){var o=n-e;return Math.abs(o)<=t.relTol?Math.PI/4:.5*Math.atan(2*r/(n-e))}function h(e,n,i){var l=r(n,e);return o(l)<=t.relTol?u(-1).acos().div(4):s(.5,a(d(2,i,c(l))))}function m(e,t,n,r){for(var o=e.length,a=Math.cos(t),i=Math.sin(t),l=Array(o).fill(0),s=Array(o).fill(0),c=0;c<o;c++)l[c]=a*e[c][n]-i*e[c][r],s[c]=i*e[c][n]+a*e[c][r];for(var u=0;u<o;u++)e[u][n]=l[u],e[u][r]=s[u];return e}function v(e,t,o,a){for(var c=e.length,d=i(t),p=l(t),f=Array(c).fill(u(0)),h=Array(c).fill(u(0)),m=0;m<c;m++)f[m]=r(s(d,e[m][o]),s(p,e[m][a])),h[m]=n(s(p,e[m][o]),s(d,e[m][a]));for(var v=0;v<c;v++)e[v][o]=f[v],e[v][a]=h[v];return e}function g(e,t,o,a){for(var c=e.length,f=u(i(t)),h=u(l(t)),m=s(f,f),v=s(h,h),g=Array(c).fill(u(0)),y=Array(c).fill(u(0)),b=d(u(2),f,h,e[o][a]),w=n(r(s(m,e[o][o]),b),s(v,e[a][a])),x=p(s(v,e[o][o]),b,s(m,e[a][a])),C=0;C<c;C++)g[C]=r(s(f,e[o][C]),s(h,e[a][C])),y[C]=n(s(h,e[o][C]),s(f,e[a][C]));e[o][o]=w,e[a][a]=x,e[o][a]=u(0),e[a][o]=u(0);for(var _=0;_<c;_++)_!==o&&_!==a&&(e[o][_]=g[_],e[_][o]=g[_],e[a][_]=y[_],e[_][a]=y[_]);return e}function y(e,t,n,r){for(var o=e.length,a=Math.cos(t),i=Math.sin(t),l=a*a,s=i*i,c=Array(o).fill(0),u=Array(o).fill(0),d=l*e[n][n]-2*a*i*e[n][r]+s*e[r][r],p=s*e[n][n]+2*a*i*e[n][r]+l*e[r][r],f=0;f<o;f++)c[f]=a*e[n][f]-i*e[r][f],u[f]=i*e[n][f]+a*e[r][f];e[n][n]=d,e[r][r]=p,e[n][r]=0,e[r][n]=0;for(var h=0;h<o;h++)h!==n&&h!==r&&(e[n][h]=c[h],e[h][n]=c[h],e[r][h]=u[h],e[h][r]=u[h]);return e}function b(e){for(var t=e.length,n=0,r=[0,1],o=0;o<t;o++)for(var a=o+1;a<t;a++)Math.abs(n)<Math.abs(e[o][a])&&(n=Math.abs(e[o][a]),r=[o,a]);return[r,n]}function w(e){for(var t=e.length,n=0,r=[0,1],a=0;a<t;a++)for(var i=a+1;i<t;i++)o(n)<o(e[a][i])&&(n=o(e[a][i]),r=[a,i]);return[r,n]}function x(e,t,n){var r,a=e.length,i=Array(a);if(n){r=Array(a);for(var l=0;l<a;l++)r[l]=Array(a)}for(var s=0;s<a;s++){for(var c=0,u=e[0],d=0;d<e.length;d++)o(e[d])<o(u)&&(u=e[c=d]);if(i[s]=e.splice(c,1)[0],n)for(var p=0;p<a;p++)r[s][p]=t[p][c],t[p].splice(c,1)}if(!n)return{values:i};var f=r.map(((e,t)=>({value:i[t],vector:e})));return{values:i,eigenvectors:f}}return function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.relTol,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if("number"===a)return function(e,t,n){var r,o,a=e.length,i=Math.abs(t/a);if(n){o=new Array(a);for(var l=0;l<a;l++)o[l]=Array(a).fill(0),o[l][l]=1}var s=b(e);for(;Math.abs(s[1])>=Math.abs(i);){var c=s[0][0],u=s[0][1];e=y(e,r=f(e[c][c],e[u][u],e[c][u]),c,u),n&&(o=m(o,r,c,u)),s=b(e)}for(var d=Array(a).fill(0),p=0;p<a;p++)d[p]=e[p][p];return x(v2(d),o,n)}(e,r,i);if("BigNumber"===a)return function(e,t,n){var r,a,i=e.length,l=o(t/i);if(n){a=new Array(i);for(var s=0;s<i;s++)a[s]=Array(i).fill(0),a[s][s]=1}var c=w(e);for(;o(c[1])>=o(l);){var u=c[0][0],d=c[0][1];e=g(e,r=h(e[u][u],e[d][d],e[u][d]),u,d),n&&(a=v(a,r,u,d)),c=w(e)}for(var p=Array(i).fill(0),f=0;f<i;f++)p[f]=e[f][f];return x(v2(p),a,n)}(e,r,i);throw TypeError("Unsupported data type: "+a)}}var Nie=k2("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:n,matrix:r,addScalar:o,subtract:a,equal:i,abs:l,atan:s,cos:c,sin:u,multiplyScalar:d,divideScalar:p,inv:f,bignumber:h,multiply:m,add:v,larger:g,column:y,flatten:b,number:w,complex:x,sqrt:C,diag:_,size:E,reshape:S,qr:k,usolve:T,usolveAll:N,im:D,re:A,smaller:I,matrixFromColumns:R,dot:M}=e,O=Tie({config:t,addScalar:o,subtract:a,abs:l,atan:s,cos:c,sin:u,multiplyScalar:d,inv:f,bignumber:h,multiply:m,add:v}),B=kie({addScalar:o,subtract:a,multiply:m,multiplyScalar:d,flatten:b,divideScalar:p,sqrt:C,abs:l,bignumber:h,diag:_,size:E,reshape:S,qr:k,inv:f,usolve:T,usolveAll:N,equal:i,complex:x,larger:g,smaller:I,matrixFromColumns:R,dot:M});return n("eigs",{Array:function(e){return V(r(e))},"Array, number|BigNumber":function(e,t){return V(r(e),{precision:t})},"Array, Object":(e,t)=>V(r(e),t),Matrix:function(e){return V(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return V(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){var n={matricize:!0};return h1(n,t),V(e,n)}});function V(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!("eigenvectors"in o)||o.eigenvectors,s=function(e,t,n){var r=e.toArray(),o=e.size();if(2!==o.length||o[0]!==o[1])throw new RangeError("Matrix must be square (size: ".concat(h6(o),")"));var i=o[0];if(function(e,t,n){for(var r=0;r<t;r++)for(var o=0;o<t;o++)if(g(h(l(D(e[r][o]))),n))return!1;return!0}(r,i,t)&&(function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)e[n][r]=A(e[n][r])}(r,i),function(e,t,n){for(var r=0;r<t;r++)for(var o=r;o<t;o++)if(g(h(l(a(e[r][o],e[o][r]))),n))return!1;return!0}(r,i,t))){var s=P(e,r,i);return O(r,i,t,s,n)}var c=P(e,r,i);return B(r,i,t,c,n)}(e,null!==(n=o.precision)&&void 0!==n?n:t.relTol,i);return o.matricize&&(s.values=r(s.values),i&&(s.eigenvectors=s.eigenvectors.map((e=>{var{value:t,vector:n}=e;return{value:t,vector:r(n)}})))),i&&Object.defineProperty(s,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),s}function P(e,t,n){var r=e.datatype();if("number"===r||"BigNumber"===r||"Complex"===r)return r;for(var o=!1,a=!1,i=!1,l=0;l<n;l++)for(var s=0;s<n;s++){var c=t[l][s];if(T1(c)||I1(c))o=!0;else if(N1(c))a=!0;else{if(!A1(c))throw TypeError("Unsupported type in Matrix: "+m2(c));i=!0}}if(a&&i&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),i){for(var u=0;u<n;u++)for(var d=0;d<n;d++)t[u][d]=x(t[u][d]);return"Complex"}if(a){for(var p=0;p<n;p++)for(var f=0;f<n;f++)t[p][f]=h(t[p][f]);return"BigNumber"}if(o){for(var m=0;m<n;m++)for(var v=0;v<n;v++)t[m][v]=w(t[m][v]);return"number"}throw TypeError("Matrix contains unsupported types only.")}})),Die="expm",Aie=k2(Die,["typed","abs","add","identity","inv","multiply"],(e=>{var{typed:t,abs:n,add:r,identity:o,inv:a,multiply:i}=e;return t(Die,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+h6(t)+")");for(var s=t[0],c=function(e){for(var t=e.size()[0],r=0,o=0;o<t;o++){for(var a=0,i=0;i<t;i++)a+=n(e.get([o,i]));r=Math.max(a,r)}return r}(e),u=function(e,t){for(var n=30,r=0;r<n;r++)for(var o=0;o<=r;o++){var a=r-o;if(l(e,o,a)<t)return{q:o,j:a}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(c,1e-15),d=u.q,p=u.j,f=i(e,Math.pow(2,-p)),h=o(s),m=o(s),v=1,g=f,y=-1,b=1;b<=d;b++)b>1&&(g=i(g,f),y=-y),h=r(h,i(v=v*(d-b+1)/((2*d-b+1)*b),g)),m=r(m,i(v*y,g));for(var w=i(a(m),h),x=0;x<p;x++)w=i(w,w);return L1(e)?e.createSparseMatrix(w):w}});function l(e,t,n){for(var r=1,o=2;o<=t;o++)r*=o;for(var a=r,i=t+1;i<=2*t;i++)a*=i;var l=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,n),2*t)*r*r/(a*l)}})),Iie="sqrtm",Rie=k2(Iie,["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],(e=>{var{typed:t,abs:n,add:r,multiply:o,map:a,sqrt:i,subtract:l,inv:s,size:c,max:u,identity:d}=e,p=1e-6;return t(Iie,{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);switch(t.length){case 1:if(1===t[0])return a(e,i);throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:if(t[0]===t[1])return function(e){var t,a=0,i=e,f=d(c(e));do{var h=i;if(i=o(.5,r(h,s(f))),f=o(.5,r(f,s(h))),(t=u(n(l(i,h))))>p&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>p);return i}(e);throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+h6(t)+")")}}})})),Mie="sylvester",Oie=k2(Mie,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],(e=>{var{typed:t,schur:n,matrixFromColumns:r,matrix:o,multiply:a,range:i,concat:l,transpose:s,index:c,subset:u,add:d,subtract:p,identity:f,lusolve:h,abs:m}=e;return t(Mie,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(e,t,n){return v(o(e),t,n)},"Array, Array, Matrix":function(e,t,n){return v(o(e),o(t),n)},"Array, Matrix, Array":function(e,t,n){return v(o(e),t,o(n))},"Matrix, Array, Matrix":function(e,t,n){return v(e,o(t),n)},"Matrix, Array, Array":function(e,t,n){return v(e,o(t),o(n))},"Matrix, Matrix, Array":function(e,t,n){return v(e,t,o(n))},"Array, Array, Array":function(e,t,n){return v(o(e),o(t),o(n)).toArray()}});function v(e,t,v){for(var g=t.size()[0],y=e.size()[0],b=n(e),w=b.T,x=b.U,C=n(a(-1,t)),_=C.T,E=C.U,S=a(a(s(x),v),E),k=i(0,y),T=[],N=(e,t)=>l(e,t,1),D=(e,t)=>l(e,t,0),A=0;A<g;A++)if(A<g-1&&m(u(_,c(A+1,A)))>1e-5){for(var I=D(u(S,c(k,A)),u(S,c(k,A+1))),R=0;R<A;R++)I=d(I,D(a(T[R],u(_,c(R,A))),a(T[R],u(_,c(R,A+1)))));var M=a(f(y),a(-1,u(_,c(A,A)))),O=a(f(y),a(-1,u(_,c(A+1,A)))),B=a(f(y),a(-1,u(_,c(A,A+1)))),V=a(f(y),a(-1,u(_,c(A+1,A+1)))),P=D(N(d(w,M),O),N(B,d(w,V))),L=h(P,I);T[A]=L.subset(c(i(0,y),0)),T[A+1]=L.subset(c(i(y,2*y),0)),A++}else{for(var F=u(S,c(k,A)),z=0;z<A;z++)F=d(F,a(T[z],u(_,c(z,A))));var j=u(_,c(A,A)),$=p(w,a(j,f(y)));T[A]=h($,F)}var U=o(r(...T));return a(x,a(U,s(E)))}})),Bie="schur",Vie=k2(Bie,["typed","matrix","identity","multiply","qr","norm","subtract"],(e=>{var{typed:t,matrix:n,identity:r,multiply:o,qr:a,norm:i,subtract:l}=e;return t(Bie,{Array:function(e){var t=s(n(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return s(e)}});function s(e){var t,n=e.size()[0],s=e,c=r(n),u=0;do{t=s;var d=a(s),p=d.Q,f=d.R;if(s=o(f,p),c=o(c,p),u++>100)break}while(i(l(s,t))>1e-4);return{U:c,T:s}}})),Pie="lyap",Lie=k2(Pie,["typed","matrix","sylvester","multiply","transpose"],(e=>{var{typed:t,matrix:n,sylvester:r,multiply:o,transpose:a}=e;return t(Pie,{"Matrix, Matrix":function(e,t){return r(e,a(e),o(-1,t))},"Array, Matrix":function(e,t){return r(n(e),a(n(e)),o(-1,t))},"Matrix, Array":function(e,t){return r(e,a(n(e)),n(o(-1,t)))},"Array, Array":function(e,t){return r(n(e),a(n(e)),n(o(-1,t))).toArray()}})})),Fie=k2("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(e=>{var{typed:t,matrix:n,multiply:r,equalScalar:o,divideScalar:a,inv:i}=e,l=x9({typed:t,equalScalar:o}),s=_9({typed:t});return t("divide",g2({"Array | Matrix, Array | Matrix":function(e,t){return r(e,i(t))},"DenseMatrix, any":function(e,t){return s(e,t,a,!1)},"SparseMatrix, any":function(e,t){return l(e,t,a,!1)},"Array, any":function(e,t){return s(n(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return r(e,i(t))}},a.signatures))})),zie="distance",jie=k2(zie,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],(e=>{var{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:o,divideScalar:a,deepEqual:i,sqrt:l,abs:s}=e;return t(zie,{"Array, Array, Array":function(e,t,n){if(2===e.length&&2===t.length&&2===n.length){if(!u(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(i(t,n))throw new TypeError("LinePoint1 should not be same with LinePoint2");var a=r(n[1],t[1]),l=r(t[0],n[0]),s=r(o(n[0],t[1]),o(t[0],n[1]));return m(e[0],e[1],a,l,s)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,n){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(n).length){if(!u(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(n))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(i(h(t),h(n)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in n&&"lineTwoPtY"in n){var a=r(n.lineTwoPtY,t.lineOnePtY),l=r(t.lineOnePtX,n.lineTwoPtX),s=r(o(n.lineTwoPtX,t.lineOnePtY),o(t.lineOnePtX,n.lineTwoPtY));return m(e.pointX,e.pointY,a,l,s)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!u(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!d(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return m(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!d(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!f(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(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(!p(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return g(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!u(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!d(t))throw new 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 m(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!d(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!f(t))throw new 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 v(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!u(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(t))throw new 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 g([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!d(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!d(t))throw new 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 g([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new 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;if(e.some((e=>3!==e.length||!c(e[0])||!c(e[1])||!c(e[2]))))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],n=[],r=[],o=0;o<e.length-1;o++)for(var a=o+1;a<e.length;a++)2===e[0].length?(n=[e[o][0],e[o][1]],r=[e[a][0],e[a][1]]):3===e[0].length&&(n=[e[o][0],e[o][1],e[o][2]],r=[e[a][0],e[a][1],e[a][2]]),t.push(g(n,r));return t}(e)}});function c(e){return"number"==typeof e||N1(e)}function u(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])}function d(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])&&c(e[2])}function p(e){return Array.isArray(e)||(e=h(e)),e.every(c)}function f(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])&&c(e[2])&&c(e[3])&&c(e[4])&&c(e[5])}function h(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++)n.push(e[t[r]]);return n}function m(e,t,r,i,c){var u=s(n(n(o(r,e),o(i,t)),c)),d=l(n(o(r,r),o(i,i)));return a(u,d)}function v(e,t,i,s,c,u,d,p,f){var h=[r(o(r(c,t),f),o(r(u,i),p)),r(o(r(u,i),d),o(r(s,e),f)),r(o(r(s,e),p),o(r(c,t),d))];h=l(n(n(o(h[0],h[0]),o(h[1],h[1])),o(h[2],h[2])));var m=l(n(n(o(d,d),o(p,p)),o(f,f)));return a(h,m)}function g(e,t){for(var a=e.length,i=0,s=0,c=0;c<a;c++)s=r(e[c],t[c]),i=n(o(s,s),i);return l(i)}})),$ie=k2("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],(e=>{var{typed:t,config:n,abs:r,add:o,addScalar:a,matrix:i,multiply:l,multiplyScalar:s,divideScalar:c,subtract:u,smaller:d,equalScalar:p,flatten:f,isZero:h,isNumeric:m}=e;return t("intersect",{"Array, Array, Array":v,"Array, Array, Array, Array":g,"Matrix, Matrix, Matrix":function(e,t,n){var r=v(e.valueOf(),t.valueOf(),n.valueOf());return null===r?null:i(r)},"Matrix, Matrix, Matrix, Matrix":function(e,t,n,r){var o=g(e.valueOf(),t.valueOf(),n.valueOf(),r.valueOf());return null===o?null:i(o)}});function v(e,t,n){if(e=y(e),t=y(t),n=y(n),!w(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&m(e[0])&&m(e[1])&&m(e[2])&&m(e[3])}(n))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,n,r,o,i,l,d,p,f){var h=s(e,l),m=s(r,l),v=s(t,d),g=s(o,d),y=s(n,p),b=s(i,p),w=u(u(u(f,h),v),y),x=u(u(u(a(a(m,g),b),h),v),y),C=c(w,x),_=a(e,s(C,u(r,e))),E=a(t,s(C,u(o,t))),S=a(n,s(C,u(i,n)));return[_,E,S]}(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3])}function g(e,t,i,f){if(e=y(e),t=y(t),i=y(i),f=y(f),2===e.length){if(!b(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(i))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(f))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,i,p){var f=e,m=i,v=u(f,t),g=u(m,p),y=u(s(v[0],g[1]),s(g[0],v[1]));if(h(y))return null;if(d(r(y),n.relTol))return null;var b=s(g[0],f[1]),w=s(g[1],f[0]),x=s(g[0],m[1]),C=s(g[1],m[0]),_=c(a(u(u(b,w),x),C),y);return o(l(v,_),f)}(e,t,i,f)}if(3===e.length){if(!w(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(i))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!w(f))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,n,r,o,i,l,d,f,m,v,g){var y=x(e,l,m,l,t,d,v,d,n,f,g,f),b=x(m,l,r,e,v,d,o,t,g,f,i,n),w=x(e,l,r,e,t,d,o,t,n,f,i,n),C=x(m,l,m,l,v,d,v,d,g,f,g,f),_=x(r,e,r,e,o,t,o,t,i,n,i,n),E=u(s(y,b),s(w,C)),S=u(s(_,C),s(b,b));if(h(S))return null;var k=c(E,S),T=c(a(y,s(k,b)),C),N=a(e,s(k,u(r,e))),D=a(t,s(k,u(o,t))),A=a(n,s(k,u(i,n))),I=a(l,s(T,u(m,l))),R=a(d,s(T,u(v,d))),M=a(f,s(T,u(g,f)));return p(N,I)&&p(D,R)&&p(A,M)?[N,D,A]:null}(e[0],e[1],e[2],t[0],t[1],t[2],i[0],i[1],i[2],f[0],f[1],f[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function y(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((e=>Array.isArray(e)&&1===e.length))?f(e):e}function b(e){return 2===e.length&&m(e[0])&&m(e[1])}function w(e){return 3===e.length&&m(e[0])&&m(e[1])&&m(e[2])}function x(e,t,n,r,o,i,l,c,d,p,f,h){var m=s(u(e,t),u(n,r)),v=s(u(o,i),u(l,c)),g=s(u(d,p),u(f,h));return a(a(m,v),g)}})),Uie=k2("sum",["typed","config","add","numeric"],(e=>{var{typed:t,config:n,add:r,numeric:o}=e;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return i8(e,t,r)}catch(n){throw xte(n,"sum")}},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return o8(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(n){throw xte(n,"sum",e)}})),void 0===t&&(t=o(0,n.number)),"string"==typeof t&&(t=o(t,D2(t,n))),t}})),Hie="cumsum",qie=k2(Hie,["typed","add","unaryPlus"],(e=>{var{typed:t,add:n,unaryPlus:r}=e;return t(Hie,{Array:o,Matrix:function(e){return e.create(o(e.valueOf(),e.datatype()))},"Array, number | BigNumber":i,"Matrix, number | BigNumber":function(e,t){return e.create(i(e.valueOf(),t),e.datatype())},"...":function(e){if(r8(e))throw new TypeError("All values expected to be scalar in function cumsum");return o(e)}});function o(e){try{return a(e)}catch(t){throw xte(t,Hie)}}function a(e){if(0===e.length)return[];for(var t=[r(e[0])],o=1;o<e.length;++o)t.push(n(t[o-1],e[o]));return t}function i(e,t){var n=C6(e);if(t<0||t>=n.length)throw new x6(t,n.length);try{return l(e,t)}catch(r){throw xte(r,Hie)}}function l(e,t){var n,r,o;if(t<=0){var i=e[0][0];if(Array.isArray(i)){for(o=n8(e),r=[],n=0;n<o.length;n++)r[n]=l(o[n],t-1);return r}return a(e)}for(r=[],n=0;n<e.length;n++)r[n]=l(e[n],t-1);return r}})),Wie="mean",Gie=k2(Wie,["typed","add","divide"],(e=>{var{typed:t,add:n,divide:r}=e;return t(Wie,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){try{var o=i8(e,t,n),a=Array.isArray(e)?C6(e):e.size();return r(o,a[t])}catch(i){throw xte(i,"mean")}},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function mean");return o(e)}});function o(e){var t,o=0;if(o8(e,(function(e){try{t=void 0===t?e:n(t,e),o++}catch(r){throw xte(r,"mean",e)}})),0===o)throw new Error("Cannot calculate the mean of an empty array");return r(t,o)}})),Yie="median",Kie=k2(Yie,["typed","add","divide","compare","partitionSelect"],(e=>{var{typed:t,add:n,divide:r,compare:o,partitionSelect:a}=e;function i(e){try{var t=(e=P6(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var n=t/2-1,r=a(e,n+1),i=e[n],c=0;c<n;++c)o(e[c],i)>0&&(i=e[c]);return s(i,r)}var u=a(e,(t-1)/2);return l(u)}catch(d){throw xte(d,"median")}}var l=t({"number | BigNumber | Complex | Unit":function(e){return e}}),s=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return r(n(e,t),2)}});return t(Yie,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function median");return i(e)}})})),Xie=k2("mad",["typed","abs","map","median","subtract"],(e=>{var{typed:t,abs:n,map:r,median:o,subtract:a}=e;return t("mad",{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=P6(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=o(e);return o(r(e,(function(e){return n(a(e,t))})))}catch(i){throw i instanceof TypeError&&i.message.includes("median")?new TypeError(i.message.replace("median","mad")):xte(i,"mad")}}})),Jie="unbiased",Zie="variance",Qie=k2(Zie,["typed","add","subtract","multiply","divide","apply","isNaN"],(e=>{var{typed:t,add:n,subtract:r,multiply:o,divide:a,apply:i,isNaN:l}=e;return t(Zie,{"Array | Matrix":function(e){return s(e,Jie)},"Array | Matrix, string":s,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,Jie)},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return s(e,Jie)}});function s(e,t){var i,s=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(o8(e,(function(e){try{i=void 0===i?e:n(i,e),s++}catch(t){throw xte(t,"variance",e)}})),0===s)throw new Error("Cannot calculate variance of an empty array");var c=a(i,s);if(i=void 0,o8(e,(function(e){var t=r(e,c);i=void 0===i?o(t,t):n(i,o(t,t))})),l(i))return i;switch(t){case"uncorrected":return a(i,s);case"biased":return a(i,s+1);case"unbiased":var u=N1(i)?i.mul(0):0;return 1===s?u:a(i,s-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,n){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return i(e,t,(e=>s(e,n)))}catch(r){throw xte(r,"variance")}}})),ele="quantileSeq",tle=k2(ele,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(e=>{var{typed:t,bignumber:n,add:r,subtract:o,divide:a,multiply:i,partitionSelect:l,compare:s,isInteger:c,smaller:u,smallerEq:d,larger:p}=e,f=f9({typed:t,isInteger:c});return t(ele,{"Array | Matrix, number | BigNumber":(e,t)=>m(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,n)=>h(e,t,!1,n,m),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>h(e,t,n,r,m),"Array | Matrix, Array | Matrix":(e,t)=>v(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,n)=>h(e,t,!1,n,v),"Array | Matrix, Array | Matrix, boolean":v,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>h(e,t,n,r,v)});function h(e,t,n,r,o){return f(e,r,(e=>o(e,t,n)))}function m(e,t,o){var i,l=e.valueOf();if(u(t,0))throw new Error("N/prob must be non-negative");if(d(t,1))return T1(t)?g(l,t,o):n(g(l,t,o));if(p(t,1)){if(!c(t))throw new Error("N must be a positive integer");if(p(t,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var s=r(t,1);i=[];for(var f=0;u(f,t);f++){var h=a(f+1,s);i.push(g(l,h,o))}return T1(t)?i:n(i)}}function v(e,t,n){for(var r=e.valueOf(),o=t.valueOf(),a=[],i=0;i<o.length;++i)a.push(g(r,o[i],n));return a}function g(e,t,n){var a=P6(e),u=a.length;if(0===u)throw new Error("Cannot calculate quantile of an empty sequence");var d,p,f=T1(t)?t*(u-1):t.times(u-1),h=T1(t)?Math.floor(f):f.floor().toNumber(),m=T1(t)?f%1:f.minus(h);if(c(f))return n?a[f]:l(a,T1(t)?f:f.valueOf());if(n)d=a[h],p=a[h+1];else{p=l(a,h+1),d=a[h];for(var v=0;v<h;++v)s(a[v],d)>0&&(d=a[v])}return r(i(d,o(1,m)),i(p,m))}})),nle=k2("std",["typed","map","sqrt","variance"],(e=>{var{typed:t,map:n,sqrt:r,variance:o}=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 new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=o.apply(null,arguments);return V1(a)?n(a,r):r(a)}catch(i){throw i instanceof TypeError&&i.message.includes(" variance")?new TypeError(i.message.replace(" variance"," std")):i}}})),rle="corr",ole=k2(rle,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],(e=>{var{typed:t,matrix:n,sqrt:r,sum:o,add:a,subtract:i,multiply:l,pow:s,divide:c}=e;return t(rle,{"Array, Array":function(e,t){return u(e,t)},"Matrix, Matrix":function(e,t){var r=u(e.toArray(),t.toArray());return Array.isArray(r)?n(r):r}});function u(e,t){var n=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var r=0;r<e.length;r++){if(e[r].length!==t[r].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");n.push(d(e[r],t[r]))}return n}if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return d(e,t)}function d(e,t){var n=e.length,u=o(e),d=o(t),p=e.reduce(((e,n,r)=>a(e,l(n,t[r]))),0),f=o(e.map((e=>s(e,2)))),h=o(t.map((e=>s(e,2)))),m=i(l(n,p),l(u,d)),v=r(l(i(l(n,f),s(u,2)),i(l(n,h),s(d,2))));return c(m,v)}})),ale="combinations",ile=k2(ale,["typed"],(e=>{var{typed:t}=e;return t(ale,{"number, number":j8,"BigNumber, BigNumber":function(e,t){var n,r,o=e.constructor,a=e.minus(t),i=new o(1);if(!lle(e)||!lle(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(n=i,t.lt(a))for(r=i;r.lte(a);r=r.plus(i))n=n.times(t.plus(r)).dividedBy(r);else for(r=i;r.lte(t);r=r.plus(i))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function lle(e){return e.isInteger()&&e.gte(0)}var sle="combinationsWithRep",cle=k2(sle,["typed"],(e=>{var{typed:t}=e;return t(sle,{"number, number":function(e,t){if(!N2(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!N2(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t<e-1?z8(e,e+t-1)/z8(1,t):z8(t+1,e+t-1)/z8(1,e-1)},"BigNumber, BigNumber":function(e,t){var n,r,o=new(0,e.constructor)(1),a=e.minus(o);if(!ule(e)||!ule(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(o))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(n=o,t.lt(a))for(r=o;r.lte(a);r=r.plus(o))n=n.times(t.plus(r)).dividedBy(r);else for(r=o;r.lte(t);r=r.plus(o))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function ule(e){return e.isInteger()&&e.gte(0)}var dle="gamma",ple=k2(dle,["typed","config","multiplyScalar","pow","BigNumber","Complex"],(e=>{var{typed:t,config:n,multiplyScalar:r,pow:o,BigNumber:a,Complex:i}=e;return t(dle,{number:X8,Complex:function e(t){if(0===t.im)return X8(t.re);if(t.re<.5){var n=new i(1-t.re,-t.im),r=new i(Math.PI*t.re,Math.PI*t.im);return new i(Math.PI).div(r.sin()).div(e(n))}t=new i(t.re-1,t.im);for(var o=new i(Z8[0],0),a=1;a<Z8.length;++a){var l=new i(Z8[a],0);o=o.add(l.div(t.add(a)))}var s=new i(t.re+J8+.5,t.im),c=Math.sqrt(2*Math.PI),u=s.pow(t.add(.5)),d=s.neg().exp();return o.mul(c).mul(u).mul(d)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new a(1/0):l(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function l(e){if(e<8)return new a([1,1,2,6,24,120,720,5040][e]);var t=n.precision+(0|Math.log(e.toNumber())),r=a.clone({precision:t});if(e%2==1)return e.times(l(new a(e-1)));for(var o=e,i=new r(e),s=e.toNumber();o>2;)s+=o-=2,i=i.times(s);return new a(i.toPrecision(a.precision))}})),fle="lgamma",hle=k2(fle,["Complex","typed"],(e=>{var{Complex:t,typed:n}=e,r=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return n(fle,{number:t5,Complex:function e(n){if(n.isNaN())return new t(NaN,NaN);if(0===n.im)return new t(t5(n.re),0);if(n.re>=7||Math.abs(n.im)>=7)return o(n);if(n.re<=.1){var r=(s=6.283185307179586,(!0^((c=n.im)>0||!(c<0)&&1/c==1/0)?-6.283185307179586:s)*Math.floor(.5*n.re+.25)),i=n.mul(Math.PI).sin().log(),l=e(new t(1-n.re,-n.im));return new t(1.1447298858494002,r).sub(i).sub(l)}return n.im>=0?a(n):a(n.conjugate()).conjugate();var s,c},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(e){for(var n=e.sub(.5).mul(e.log()).sub(e).add(Q8),o=new t(1,0).div(e),a=o.div(e),i=r[0],l=r[1],s=2*a.re,c=a.re*a.re+a.im*a.im,u=2;u<8;u++){var d=l;l=-c*i+r[u],i=s*i+d}var p=o.mul(a.mul(i).add(l));return n.add(p)}function a(e){var n=0,r=0,a=e;for(e=e.add(1);e.re<=7;){var i=(a=a.mul(e)).im<0?1:0;0!==i&&0===r&&n++,r=i,e=e.add(1)}return o(e).sub(a.log()).sub(new t(0,2*n*Math.PI*1))}})),mle="factorial",vle=k2(mle,["typed","gamma"],(e=>{var{typed:t,gamma:n}=e;return t(mle,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return n(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return n(e.plus(1))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),gle="kldivergence",yle=k2(gle,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],(e=>{var{typed:t,matrix:n,divide:r,sum:o,multiply:a,map:i,dotDivide:l,log:s,isNumeric:c}=e;return t(gle,{"Array, Array":function(e,t){return u(n(e),n(t))},"Matrix, Array":function(e,t){return u(e,n(t))},"Array, Matrix":function(e,t){return u(n(e),t)},"Matrix, Matrix":function(e,t){return u(e,t)}});function u(e,t){var n=t.size().length,u=e.size().length;if(n>1)throw new Error("first object must be one dimensional");if(u>1)throw new Error("second object must be one dimensional");if(n!==u)throw new Error("Length of two vectors must be equal");if(0===o(e))throw new Error("Sum of elements in first object must be non zero");if(0===o(t))throw new Error("Sum of elements in second object must be non zero");var d=r(e,o(e)),p=r(t,o(t)),f=o(a(d,i(l(d,p),(e=>s(e)))));return c(f)?f:Number.NaN}})),ble="multinomial",wle=k2(ble,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(e=>{var{typed:t,add:n,divide:r,multiply:o,factorial:a,isInteger:i,isPositive:l}=e;return t(ble,{"Array | Matrix":function(e){var t=0,s=1;return o8(e,(function(e){if(!i(e)||!l(e))throw new TypeError("Positive integer value expected in function multinomial");t=n(t,e),s=o(s,a(e))})),r(a(t),s)}})})),xle="permutations",Cle=k2(xle,["typed","factorial"],(e=>{var{typed:t,factorial:n}=e;return t(xle,{"number | BigNumber":n,"number, number":function(e,t){if(!N2(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!N2(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return z8(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var n,r;if(!_le(e)||!_le(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(n=e.mul(0).add(1),r=e.minus(t).plus(1);r.lte(e);r=r.plus(1))n=n.times(r);return n}})}));function _le(e){return e.isInteger()&&e.gte(0)}var Ele={exports:{}};!function(e,t){function n(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function r(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function o(e,t){var o=new n(e),a=t&&t.state,i=o.next;return i.int32=function(){return 4294967296*o.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.alea=o}(0,Ele);var Sle=Ele.exports,kle={exports:{}};!function(e,t){function n(e){var t=this,n="";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:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xor128=o}(0,kle);var Tle=kle.exports,Nle={exports:{}};!function(e,t){function n(e){var t=this,n="";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:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function r(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 o(e,t){var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xorwow=o}(0,Nle);var Dle=Nle.exports,Ale={exports:{}};!function(e,t){function n(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&(a.x&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xorshift7=o}(0,Ale);var Ile=Ale.exports,Rle={exports:{}};!function(e,t){function n(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,a=t.i;return t.w=r=r+1640531527|0,n=o[a+34&127],e=o[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,o,a,i,l=[],s=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,s=Math.max(s,t.length)),o=0,a=-32;a<s;++a)t&&(r^=t.charCodeAt((a+32)%t.length)),0===a&&(i=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,o=0==(n=l[127&a]^=r+i)?o+1:0);for(o>=128&&(l[127&(t&&t.length||0)]=-1),o=127,a=512;a>0;--a)r=l[o+34&127],n=l[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,l[o]=r^n;e.w=i,e.X=l,e.i=o}(t,e)}function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&(a.X&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xor4096=o}(0,Rle);var Mle=Rle.exports,Ole={exports:{}};!function(e,t){function n(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.tychei=o}(0,Ole);var Ble=Ole.exports,Vle={exports:{}};!function(e){!function(t,n,r){var o,a=256,i="random",l=r.pow(a,6),s=r.pow(2,52),c=2*s,u=255;function d(e,u,d){var g=[],y=m(h((u=1==u?{entropy:!0}:u||{}).entropy?[e,v(n)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(a):(e=new Uint8Array(a),(t.crypto||t.msCrypto).getRandomValues(e)),v(e)}catch(HT){var r=t.navigator,i=r&&r.plugins;return[+new Date,t,i,t.screen,v(n)]}}():e,3),g),b=new p(g),w=function(){for(var e=b.g(6),t=l,n=0;e<s;)e=(e+n)*a,t*=a,n=b.g(1);for(;e>=c;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|b.g(4)},w.quick=function(){return b.g(4)/4294967296},w.double=w,m(v(b.S),n),(u.pass||d||function(e,t,n,o){return o&&(o.S&&f(o,b),e.state=function(){return f(b,{})}),n?(r[i]=e,t):e})(w,y,"global"in u?u.global:this==r,u.state)}function p(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,l=r.S=[];for(n||(e=[n++]);o<a;)l[o]=o++;for(o=0;o<a;o++)l[o]=l[i=u&i+e[o%n]+(t=l[o])],l[i]=t;(r.g=function(e){for(var t,n=0,o=r.i,i=r.j,l=r.S;e--;)t=l[o=u&o+1],n=n*a+l[u&(l[o]=l[i=u&i+t])+(l[i]=t)];return r.i=o,r.j=i,n})(a)}function f(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function h(e,t){var n,r=[],o=typeof e;if(t&&"object"==o)for(n in e)try{r.push(h(e[n],t-1))}catch(HT){}return r.length?r:"string"==o?e:e+"\0"}function m(e,t){for(var n,r=e+"",o=0;o<r.length;)t[u&o]=u&(n^=19*t[u&o])+r.charCodeAt(o++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(m(r.random(),n),e.exports){e.exports=d;try{o=Tq}catch(g){}}else r["seed"+i]=d}("undefined"!=typeof self?self:V,[],Math)}(Vle);var Ple=Sle,Lle=Tle,Fle=Dle,zle=Ile,jle=Mle,$le=Ble,Ule=Vle.exports;Ule.alea=Ple,Ule.xor128=Lle,Ule.xorwow=Fle,Ule.xorshift7=zle,Ule.xor4096=jle,Ule.tychei=$le;const Hle=P(Ule);var qle=Hle(Date.now());function Wle(e){var t,n;return t=null===(n=e)?qle:Hle(String(n)),function(){return t()}}var Gle="pickRandom",Yle=k2(Gle,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,o=Wle(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=Wle(e.randomSeed))})),t(Gle,{"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,n){return a(e,{number:n,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,n){return a(e,{number:t,weights:n})}});function a(e,t){var{number:n,weights:r,elementWise:a=!0}=t,i=void 0===n;i&&(n=1);var l=B1(e)?e.create:B1(r)?r.create:null;e=e.valueOf(),r&&(r=r.valueOf()),!0===a&&(e=P6(e),r=P6(r));var s=0;if(void 0!==r){if(r.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var c=0,u=r.length;c<u;c++){if(!T1(r[c])||r[c]<0)throw new Error("Weights must be an array of positive numbers");s+=r[c]}}for(var d,p=e.length,f=[];f.length<n;){if(void 0===r)d=e[Math.floor(o()*p)];else for(var h=o()*s,m=0,v=e.length;m<v;m++)if((h-=r[m])<0){d=e[m];break}f.push(d)}return i?f[0]:l?l(f):f}}));function Kle(e,t){var n=[];if((e=e.slice(0)).length>1)for(var r=0,o=e.shift();r<o;r++)n.push(Kle(e,t));else for(var a=0,i=e.shift();a<i;a++)n.push(t());return n}var Xle="random",Jle=k2(Xle,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,o=Wle(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=Wle(e.randomSeed))})),t(Xle,{"":()=>i(0,1),number:e=>i(0,e),"number, number":(e,t)=>i(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=Kle(e.valueOf(),(()=>i(t,n)));return B1(e)?e.create(r,"number"):r}function i(e,t){return e+o()*(t-e)}})),Zle="randomInt",Qle=k2(Zle,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,o=Wle(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=Wle(e.randomSeed))})),t(Zle,{"":()=>i(0,1),number:e=>i(0,e),"number, number":(e,t)=>i(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=Kle(e.valueOf(),(()=>i(t,n)));return B1(e)?e.create(r,"number"):r}function i(e,t){return Math.floor(e+o()*(t-e))}})),ese="stirlingS2",tse=k2(ese,["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],(e=>{var{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:o,divideScalar:a,pow:i,factorial:l,combinations:s,isNegative:c,isInteger:u,number:d,bignumber:p,larger:f}=e,h=[],m=[];return t(ese,{"number | BigNumber, number | BigNumber":function(e,t){if(!u(e)||c(e)||!u(t)||c(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(f(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");var r=!(T1(e)&&T1(t)),a=r?m:h,i=r?p:d,l=d(e),s=d(t);if(a[l]&&a[l].length>s)return a[l][s];for(var v=0;v<=l;++v)if(a[v]||(a[v]=[i(0===v?1:0)]),0!==v)for(var g=a[v],y=a[v-1],b=g.length;b<=v&&b<=s;++b)g[b]=b===v?1:n(o(i(b),y[b]),y[b-1]);return a[l][s]}})})),nse="bellNumbers",rse=k2(nse,["typed","addScalar","isNegative","isInteger","stirlingS2"],(e=>{var{typed:t,addScalar:n,isNegative:r,isInteger:o,stirlingS2:a}=e;return t(nse,{"number | BigNumber":function(e){if(!o(e)||r(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,i=0;i<=e;i++)t=n(t,a(e,i));return t}})})),ose="catalan",ase=k2(ose,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(e=>{var{typed:t,addScalar:n,divideScalar:r,multiplyScalar:o,combinations:a,isNegative:i,isInteger:l}=e;return t(ose,{"number | BigNumber":function(e){if(!l(e)||i(e))throw new TypeError("Non-negative integer value expected in function catalan");return r(a(o(e,2),e),n(e,1))}})})),ise="composition",lse=k2(ise,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(e=>{var{typed:t,addScalar:n,combinations:r,isPositive:o,isNegative:a,isInteger:i,larger:l}=e;return t(ise,{"number | BigNumber, number | BigNumber":function(e,t){if(!(i(e)&&o(e)&&i(t)&&o(t)))throw new TypeError("Positive integer value expected in function composition");if(l(t,e))throw new TypeError("k must be less than or equal to n in function composition");return r(n(e,-1),n(t,-1))}})})),sse="leafCount",cse=k2(sse,["parse","typed"],(e=>{var{parse:t,typed:n}=e;function r(e){var t=0;return e.forEach((e=>{t+=r(e)})),t||1}return n(sse,{Node:function(e){return r(e)}})}));function use(e){return n2(e)||c2(e)&&e.isUnary()&&n2(e.args[0])}function dse(e){return!!n2(e)||(!(!a2(e)&&!c2(e)||!e.args.every(dse))||!(!u2(e)||!dse(e.content)))}function pse(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fse(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pse(Object(n),!0).forEach((function(t){ste(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pse(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hse=k2("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(e=>{var{FunctionNode:t,OperatorNode:n,SymbolNode:r}=e,o=!0,a=!1,i="defaultF",l={add:{trivial:o,total:o,commutative:o,associative:o},unaryPlus:{trivial:o,total:o,commutative:o,associative:o},subtract:{trivial:a,total:o,commutative:a,associative:a},multiply:{trivial:o,total:o,commutative:o,associative:o},divide:{trivial:a,total:o,commutative:a,associative:a},paren:{trivial:o,total:o,commutative:o,associative:a},defaultF:{trivial:a,total:o,commutative:a,associative:a}};function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,r=i;if("string"==typeof e?r=e:c2(e)?r=e.fn.toString():a2(e)?r=e.name:u2(e)&&(r="paren"),b2(n,r)){var o=n[r];if(b2(o,t))return o[t];if(b2(l,r))return l[r][t]}if(b2(n,i)){var a=n[i];return b2(a,t)?a[t]:l[i][t]}if(b2(l,r)){var s=l[r];if(b2(s,t))return s[t]}return l[i][t]}function c(e){return s(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:l)}function u(e,t){var n,r=[],o=function(e){for(var t=0;t<e.args.length;t++){var a=e.args[t];c2(a)&&n===a.op?o(a):r.push(a)}};return c(e,t)?(n=e.op,o(e),r):e.args}function d(e){return c2(e)?function(t){try{return new n(e.op,e.fn,t,e.implicit)}catch(r){return console.error(r),[]}}:function(n){return new t(new r(e.name),n)}}return{createMakeNodeFunction:d,hasProperty:s,isCommutative:function(e){return s(e,"commutative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:l)},isAssociative:c,mergeContext:function(e,t){var n=fse({},e);for(var r in t)b2(e,r)?n[r]=fse(fse({},t[r]),e[r]):n[r]=t[r];return n},flatten:function e(t,n){if(!t.args||0===t.args.length)return t;t.args=u(t,n);for(var r=0;r<t.args.length;r++)e(t.args[r],n)},allChildren:u,unflattenr:function e(t,n){if(t.args&&0!==t.args.length){for(var r=d(t),o=t.args.length,a=0;a<o;a++)e(t.args[a],n);if(o>2&&c(t,n)){for(var i=t.args.pop();t.args.length>0;)i=r([t.args.pop(),i]);t.args=i.args}}},unflattenl:function e(t,n){if(t.args&&0!==t.args.length){for(var r=d(t),o=t.args.length,a=0;a<o;a++)e(t.args[a],n);if(o>2&&c(t,n)){for(var i=t.args.shift();t.args.length>0;)i=r([i,t.args.shift()]);t.args=i.args}}},defaultContext:l,realContext:{divide:{total:a},log:{total:a}},positiveContext:{subtract:{total:a},abs:{trivial:o},log:{total:o}}}})),mse=k2("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{config:t,typed:n,parse:r,add:o,subtract:a,multiply:i,divide:l,pow:s,isZero:c,equal:u,resolve:d,simplifyConstant:p,simplifyCore:f,fraction:h,bignumber:m,mathWithTransform:v,matrix:g,AccessorNode:y,ArrayNode:b,ConstantNode:w,FunctionNode:x,IndexNode:C,ObjectNode:_,OperatorNode:E,ParenthesisNode:S,SymbolNode:k}=e,{hasProperty:T,isCommutative:N,isAssociative:D,mergeContext:A,flatten:I,unflattenr:R,unflattenl:M,createMakeNodeFunction:O,defaultContext:B,realContext:V,positiveContext:P}=hse({FunctionNode:x,OperatorNode:E,SymbolNode:k});n.addConversion({from:"Object",to:"Map",convert:k1});var L=n("simplify",{Node:H,"Node, Map":(e,t)=>H(e,!1,t),"Node, Map, Object":(e,t,n)=>H(e,!1,t,n),"Node, Array":H,"Node, Array, Map":H,"Node, Array, Map, Object":H});function F(e){return e.transform((function(e,t,n){return u2(e)?F(e.content):e}))}n.removeConversion({from:"Object",to:"Map",convert:k1}),L.defaultContext=B,L.realContext=V,L.positiveContext=P;var z={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};function j(e,t){var n={};if(e.s){var o=e.s.split("->");if(2!==o.length)throw SyntaxError("Could not parse rule: "+e.s);n.l=o[0],n.r=o[1]}else n.l=e.l,n.r=e.r;for(var a of(n.l=F(r(n.l)),n.r=F(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 i,l=!N(n.l,t);l&&(i=U());var s=O(n.l),c=U();n.expanded={},n.expanded.l=s([n.l,c]),I(n.expanded.l,t),R(n.expanded.l,t),n.expanded.r=s([n.r,c]),l&&(n.expandedNC1={},n.expandedNC1.l=s([i,n.l]),n.expandedNC1.r=s([i,n.r]),n.expandedNC2={},n.expandedNC2.l=s([i,n.expanded.l]),n.expandedNC2.r=s([i,n.expanded.r]))}return n}L.rules=[f,{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}}},p,{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}}},p,{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 U(){return new k("_p"+$++)}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S1(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.consoleDebug;t=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r],a=void 0,i=typeof o;switch(i){case"string":o={s:o};case"object":a=j(o,t);break;case"function":a=o;break;default:throw TypeError("Unsupported type of rule: "+i)}n.push(a)}return n}(t||L.rules,r.context);for(var a=d(e,n),i={},l=(a=F(a)).toString({parenthesis:"all"});!i[l];){i[l]=!0,$=0;for(var s=l,c=0;c<t.length;c++){if("function"==typeof t[c]?(a=t[c](a,r),o&&t[c].name):(I(a,r.context),a=W(a,t[c],r.context),o&&"".concat(t[c].l.toString()," -> ").concat(t[c].r.toString())),o){var u=a.toString({parenthesis:"all"});u!==s&&(s=u)}M(a,r.context)}l=a.toString({parenthesis:"all"})}return a}function q(e,t,n){var r=e;if(e)for(var o=0;o<e.length;++o){var a=W(e[o],t,n);a!==e[o]&&(r===e&&(r=e.slice()),r[o]=a)}return r}function W(e,t,n){if(t.assuming)for(var r in t.assuming)for(var o in t.assuming[r])if(T(r,o,n)!==t.assuming[r][o])return e;var a=A(t.imposeContext,n),i=e;if(i instanceof E||i instanceof x){var l=q(i.args,t,n);l!==i.args&&((i=i.clone()).args=l)}else if(i instanceof S){if(i.content){var s=W(i.content,t,n);s!==i.content&&(i=new S(s))}}else if(i instanceof b){var c=q(i.items,t,n);c!==i.items&&(i=new b(c))}else if(i instanceof y){var u=i.object;i.object&&(u=W(i.object,t,n));var d=i.index;i.index&&(d=W(i.index,t,n)),u===i.object&&d===i.index||(i=new y(u,d))}else if(i instanceof C){var p=q(i.dimensions,t,n);p!==i.dimensions&&(i=new C(p))}else if(i instanceof _){var f=!1,h={};for(var m in i.properties)h[m]=W(i.properties[m],t,n),h[m]!==i.properties[m]&&(f=!0);f&&(i=new _(h))}var v=t.r,g=K(t.l,i,a)[0];if(!g&&t.expanded&&(v=t.expanded.r,g=K(t.expanded.l,i,a)[0]),!g&&t.expandedNC1&&(v=t.expandedNC1.r,(g=K(t.expandedNC1.l,i,a)[0])||(v=t.expandedNC2.r,g=K(t.expandedNC2.l,i,a)[0])),g){var w=i.implicit;i=v.clone(),w&&"implicit"in v&&(i.implicit=!0),i=i.transform((function(e){return e.isSymbolNode&&b2(g.placeholders,e.name)?g.placeholders[e.name].clone():e}))}return t.repeat&&i!==e&&(i=W(i,t,n)),i}function G(e,t){var n={placeholders:{}};if(!e.placeholders&&!t.placeholders)return n;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var r in e.placeholders)if(b2(e.placeholders,r)&&(n.placeholders[r]=e.placeholders[r],b2(t.placeholders,r)&&!X(e.placeholders[r],t.placeholders[r])))return null;for(var o in t.placeholders)b2(t.placeholders,o)&&(n.placeholders[o]=t.placeholders[o]);return n}function Y(e,t){var n,r=[];if(0===e.length||0===t.length)return r;for(var o=0;o<e.length;o++)for(var a=0;a<t.length;a++)(n=G(e[o],t[a]))&&r.push(n);return r}function K(e,t,n,r){var o=[{placeholders:{}}];if(e instanceof E&&t instanceof E||e instanceof x&&t instanceof x){if(e instanceof E){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof x&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!D(t,n)&&t.args.length===e.args.length||r)){if(t.args.length>=2&&2===e.args.length){for(var a=function(e,t){var n,r,o=[],a=O(e);if(N(e,t))for(var i=0;i<e.args.length;i++)(r=e.args.slice(0)).splice(i,1),n=1===r.length?r[0]:a(r),o.push(a([e.args[i],n]));else for(var l=1;l<e.args.length;l++){var s=e.args[0];l>1&&(s=a(e.args.slice(0,l))),n=1===(r=e.args.slice(l)).length?r[0]:a(r),o.push(a([s,n]))}return o}(t,n),i=[],l=0;l<a.length;l++){var s=K(e,a[l],n,!0);i=i.concat(s)}return i}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var c=[],d=0;d<e.args.length;d++){var p=K(e.args[d],t.args[d],n);if(0===p.length)break;c.push(p)}if(c.length!==e.args.length){if(!N(t,n)||1===e.args.length)return[];if(e.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var f=K(e.args[0],t.args[1],n);if(0===f.length)return[];var h=K(e.args[1],t.args[0],n);if(0===h.length)return[];c=[f,h]}o=function(e){if(0===e.length)return e;for(var t=e.reduce(Y),n=[],r={},o=0;o<t.length;o++){var a=JSON.stringify(t[o]);r[a]||(r[a]=!0,n.push(t[o]))}return n}(c)}else if(e instanceof k){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(z[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":o[0].placeholders[e.name]=t;break;case"c":case"cl":if(!n2(t))return[];o[0].placeholders[e.name]=t;break;case"v":if(n2(t))return[];o[0].placeholders[e.name]=t;break;case"vl":if(!f2(t))return[];o[0].placeholders[e.name]=t;break;case"cd":if(!use(t))return[];o[0].placeholders[e.name]=t;break;case"vd":if(use(t))return[];o[0].placeholders[e.name]=t;break;case"ce":if(!dse(t))return[];o[0].placeholders[e.name]=t;break;case"ve":if(dse(t))return[];o[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof w))return[];if(!u(e.value,t.value))return[]}return o}function X(e,t){if(e instanceof w&&t instanceof w){if(!u(e.value,t.value))return!1}else if(e instanceof k&&t instanceof k){if(e.name!==t.name)return!1}else{if(!(e instanceof E&&t instanceof E||e instanceof x&&t instanceof x))return!1;if(e instanceof E){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof x&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var n=0;n<e.args.length;n++)if(!X(e.args[n],t.args[n]))return!1}return!0}return L})),vse=k2("simplifyConstant",["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],(e=>{var{typed:t,config:n,mathWithTransform:r,matrix:o,fraction:a,bignumber:i,AccessorNode:l,ArrayNode:s,ConstantNode:c,FunctionNode:u,IndexNode:d,ObjectNode:p,OperatorNode:f,SymbolNode:h}=e,{isCommutative:m,isAssociative:v,allChildren:g,createMakeNodeFunction:y}=hse({FunctionNode:u,OperatorNode:f,SymbolNode:h}),b=t("simplifyConstant",{Node:e=>_(N(e,{})),"Node, Object":function(e,t){return _(N(e,t))}});function w(e){return I1(e)?e.valueOf():e instanceof Array?e.map(w):B1(e)?o(w(e.valueOf())):e}function x(e,t,n){try{return r[e].apply(null,t)}catch(o){return t=t.map(w),S(r[e].apply(null,t),n)}}var C=t({Fraction:function(e){var t,n=e.s*e.n;t=n<0?new f("-","unaryMinus",[new c(-n)]):new c(n);if(1===e.d)return t;return new f("/","divide",[t,new c(e.d)])},number:function(e){return e<0?k(new c(-e)):new c(e)},BigNumber:function(e){return e<0?k(new c(-e)):new c(e)},bigint:function(e){return e<0n?k(new c(-e)):new c(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new c(e)},Matrix:function(e){return new s(e.valueOf().map((e=>C(e))))}});function _(e){return l2(e)?e:C(e)}function E(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&a){var n=a(e),r=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(n.valueOf()===e&&n.n<r&&n.d<r)return n}return e}var S=t({"string, Object":function(e,t){var r=D2(e,n);return"BigNumber"===r?(void 0===i&&Nee(),i(e)):"bigint"===r?BigInt(e):"Fraction"===r?(void 0===a&&Dee(),a(e)):E(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return E(e,t)},"bigint, Object":function(e,t){return e},"Complex, Object":function(e,t){return 0!==e.im?e:E(e.re,t)},"Matrix, Object":function(e,t){return o(E(e.valueOf()))},"Array, Object":function(e,t){return e.map(E)}});function k(e){return new f("-","unaryMinus",[e])}function T(e,t,n,r){var o=t.shift(),a=t.reduce(((t,o)=>{if(!l2(o)){var a=t.pop();if(l2(a))return[a,o];try{return t.push(x(e,[a,o],r)),t}catch(l){t.push(a)}}t.push(_(t.pop()));var i=1===t.length?t[0]:n(t);return[n([i,_(o)])]}),[o]);return 1===a.length?a[0]:n([a[0],C(a[1])])}function N(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":case"bigint":return S(e.value,t);case"string":return e.value;default:if(!isNaN(e.value))return S(e.value,t)}return e;case"FunctionNode":if(r[e.name]&&r[e.name].rawArgs)return e;if(!["add","multiply"].includes(e.name)){var n=e.args.map((e=>N(e,t)));if(!n.some(l2))try{return x(e.name,n,t)}catch(M){}if("size"===e.name&&1===n.length&&Z1(n[0])){for(var a=[],i=n[0];Z1(i);)a.push(i.items.length),i=i.items[0];return o(a)}return new u(e.name,n.map(_))}case"OperatorNode":var f,h,w=e.fn.toString(),C=y(e);if(c2(e)&&e.isUnary())h=l2((f=[N(e.args[0],t)])[0])?C(f):x(w,f,t);else if(v(e,t.context))if(f=(f=g(e,t.context)).map((e=>N(e,t))),m(w,t.context)){for(var E=[],k=[],D=0;D<f.length;D++)l2(f[D])?k.push(f[D]):E.push(f[D]);E.length>1?(h=T(w,E,C,t),k.unshift(h),h=T(w,k,C,t)):h=T(w,f,C,t)}else h=T(w,f,C,t);else h=T(w,f=e.args.map((e=>N(e,t))),C,t);return h;case"ParenthesisNode":return N(e.content,t);case"AccessorNode":return function(e,t,n){if(!i2(t))return new l(_(e),_(t));if(Z1(e)||B1(e)){for(var r=Array.from(t.dimensions);r.length>0;)if(n2(r[0])&&"string"!=typeof r[0].value){var a=S(r.shift().value,n);Z1(e)?e=e.items[a-1]:(e=e.valueOf()[a-1])instanceof Array&&(e=o(e))}else{if(!(r.length>1&&n2(r[1])&&"string"!=typeof r[1].value))break;var i=S(r[1].value,n),u=[],p=Z1(e)?e.items:e.valueOf();for(var f of p)if(Z1(f))u.push(f.items[i-1]);else{if(!B1(e))break;u.push(f[i-1])}if(u.length!==p.length)break;e=Z1(e)?new s(u):o(u),r.splice(1,1)}return r.length===t.dimensions.length?new l(_(e),t):r.length>0?(t=new d(r),new l(_(e),t)):e}if(s2(e)&&1===t.dimensions.length&&n2(t.dimensions[0])){var h=t.dimensions[0].value;return h in e.properties?e.properties[h]:new c}return new l(_(e),t)}(N(e.object,t),N(e.index,t),t);case"ArrayNode":var A=e.items.map((e=>N(e,t)));return A.some(l2)?new s(A.map(_)):o(A);case"IndexNode":return new d(e.dimensions.map((e=>b(e,t))));case"ObjectNode":var I={};for(var R in e.properties)I[R]=b(e.properties[R],t);return new p(I);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return b})),gse="simplifyCore",yse=k2(gse,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{typed:t,parse:n,equal:r,isZero:o,add:a,subtract:i,multiply:l,divide:s,pow:c,AccessorNode:u,ArrayNode:d,ConstantNode:p,FunctionNode:f,IndexNode:h,ObjectNode:m,OperatorNode:v,ParenthesisNode:g,SymbolNode:y}=e,b=new p(0),w=new p(1),x=new p(!0),C=new p(!1);function _(e){return c2(e)&&["and","not","or"].includes(e.op)}var{hasProperty:E,isCommutative:S}=hse({FunctionNode:f,OperatorNode:v,SymbolNode:y});function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?t.context:void 0;if(E(e,"trivial",n)){if(a2(e)&&1===e.args.length)return k(e.args[0],t);var a=!1,i=0;if(e.forEach((e=>{1===++i&&(a=k(e,t))})),1===i)return a}var l=e;if(a2(l)){var s=function(e){var t="OperatorNode:"+e;for(var n of Woe)if(t in n)return n[t].op;return null}(l.name);if(!s)return new f(k(l.fn),l.args.map((e=>k(e,t))));if(l.args.length>2&&E(l,"associative",n))for(;l.args.length>2;){var c=l.args.pop(),p=l.args.pop();l.args.push(new v(s,l.name,[c,p]))}l=new v(s,l.name,l.args)}if(c2(l)&&l.isUnary()){var g=k(l.args[0],t);if("~"===l.op&&c2(g)&&g.isUnary()&&"~"===g.op)return g.args[0];if("not"===l.op&&c2(g)&&g.isUnary()&&"not"===g.op&&_(g.args[0]))return g.args[0];var y=!0;if("-"===l.op&&c2(g)&&(g.isBinary()&&"subtract"===g.fn&&(l=new v("-","subtract",[g.args[1],g.args[0]]),y=!1),g.isUnary()&&"-"===g.op))return g.args[0];if(y)return new v(l.op,l.fn,[g])}if(c2(l)&&l.isBinary()){var T=k(l.args[0],t),N=k(l.args[1],t);if("+"===l.op){if(n2(T)&&o(T.value))return N;if(n2(N)&&o(N.value))return T;c2(N)&&N.isUnary()&&"-"===N.op&&(N=N.args[0],l=new v("-","subtract",[T,N]))}if("-"===l.op)return c2(N)&&N.isUnary()&&"-"===N.op?k(new v("+","add",[T,N.args[0]]),t):n2(T)&&o(T.value)?k(new v("-","unaryMinus",[N])):n2(N)&&o(N.value)?T:new v(l.op,l.fn,[T,N]);if("*"===l.op){if(n2(T)){if(o(T.value))return b;if(r(T.value,1))return N}if(n2(N)){if(o(N.value))return b;if(r(N.value,1))return T;if(S(l,n))return new v(l.op,l.fn,[N,T],l.implicit)}return new v(l.op,l.fn,[T,N],l.implicit)}if("/"===l.op)return n2(T)&&o(T.value)?b:n2(N)&&r(N.value,1)?T:new v(l.op,l.fn,[T,N]);if("^"===l.op&&n2(N)){if(o(N.value))return w;if(r(N.value,1))return T}if("and"===l.op){if(n2(T)){if(!T.value)return C;if(_(N))return N;if(n2(N))return N.value?x:C}if(n2(N)){if(!N.value)return C;if(_(T))return T}}if("or"===l.op){if(n2(T)){if(T.value)return x;if(_(N))return N}if(n2(N)){if(N.value)return x;if(_(T))return T}}return new v(l.op,l.fn,[T,N])}if(c2(l))return new v(l.op,l.fn,l.args.map((e=>k(e,t))));if(Z1(l))return new d(l.items.map((e=>k(e,t))));if(J1(l))return new u(k(l.object,t),k(l.index,t));if(i2(l))return new h(l.dimensions.map((e=>k(e,t))));if(s2(l)){var D={};for(var A in l.properties)D[A]=k(l.properties[A],t);return new m(D)}return l}return t(gse,{Node:k,"Node,Object":k})})),bse=k2("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],(e=>{var{typed:t,parse:n,ConstantNode:r,FunctionNode:o,OperatorNode:a,ParenthesisNode:i}=e;function l(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if(f2(e)){if(s.has(e.name)){var c=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(c,"}"))}var u=t.get(e.name);if(l2(u)){var d=new Set(s);return d.add(e.name),l(u,t,d)}return"number"==typeof u?n(String(u)):void 0!==u?new r(u):e}if(c2(e)){var p=e.args.map((function(e){return l(e,t,s)}));return new a(e.op,e.fn,p,e.implicit)}if(u2(e))return new i(l(e.content,t,s));if(a2(e)){var f=e.args.map((function(e){return l(e,t,s)}));return new o(e.name,f)}return e.map((e=>l(e,t,s)))}return t("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(e,t)=>l(e,k1(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,n)=>e(t,k1(n)))),"Matrix, Object":t.referTo("Matrix,Map",(e=>(t,n)=>e(t,k1(n)))),"Array | Matrix, Map":t.referToSelf((e=>(t,n)=>t.map((t=>e(t,n)))))})})),wse="symbolicEqual",xse=k2(wse,["parse","simplify","typed","OperatorNode"],(e=>{var{parse:t,simplify:n,typed:r,OperatorNode:o}=e;function a(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new o("-","subtract",[e,t]),i=n(a,{},r);return n2(i)&&!i.value}return r(wse,{"Node, Node":a,"Node, Node, Object":a})})),Cse="derivative",_se=k2(Cse,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{typed:t,config:n,parse:r,simplify:o,equal:a,isZero:i,numeric:l,ConstantNode:s,FunctionNode:c,OperatorNode:u,ParenthesisNode:d,SymbolNode:p}=e;function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0},r={};v(r,e,t.name);var a=g(e,r);return n.simplify?o(a):a}t.addConversion({from:"identifier",to:"SymbolNode",convert:r});var h=t(Cse,{"Node, SymbolNode":f,"Node, SymbolNode, Object":f});t.removeConversion({from:"identifier",to:"SymbolNode",convert:r}),h._simplify=!0,h.toTex=function(e){return m.apply(null,e.args)};var m=t("_derivTex",{"Node, SymbolNode":function(e,t){return n2(e)&&"string"===m2(e.value)?m(r(e.value).toString(),t.toString(),1):m(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===m2(t.value))return m(e,r(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,n){return m(e.toString(),t.name,n.value)},"string, string, number":function(e,t,n){return(1===n?"{d\\over d"+t+"}":"{d^{"+n+"}\\over d"+t+"^{"+n+"}}")+"\\left[".concat(e,"\\right]")}}),v=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,n){return t.name!==n&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,n){return v(e,t.content,n)},"Object, FunctionAssignmentNode, string":function(e,t,n){return t.params.includes(n)?v(e,t.expr,n):(e[t]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(e,t,n){if(t.args.length>0){for(var r=v(e,t.args[0],n),o=1;o<t.args.length;++o)r=v(e,t.args[o],n)&&r;if(r)return e[t]=!0,!0}return!1}}),g=t("_derivative",{"ConstantNode, Object":function(e){return y(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?y(0):y(1)},"ParenthesisNode, Object":function(e,t){return new d(g(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?y(0):g(e.expr,t)},"FunctionNode, Object":function(e,t){if(void 0!==t[e])return y(0);var n,r,o,a,i=e.args[0],l=!1,s=!1;switch(e.name){case"cbrt":l=!0,r=new u("*","multiply",[y(3),new u("^","pow",[i,new u("/","divide",[y(2),y(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)l=!0,r=new u("*","multiply",[y(2),new c("sqrt",[i])]);else if(2===e.args.length)return t[n=new u("/","divide",[y(1),e.args[1]])]=t[e.args[1]],g(new u("^","pow",[i,n]),t);break;case"log10":n=y(10);case"log":if(n||1!==e.args.length){if(1===e.args.length&&n||2===e.args.length&&void 0!==t[e.args[1]])r=new u("*","multiply",[i.clone(),new c("log",[n||e.args[1]])]),l=!0;else if(2===e.args.length)return g(new u("/","divide",[new c("log",[i]),new c("log",[e.args[1]])]),t)}else r=i.clone(),l=!0;break;case"pow":if(2===e.args.length)return t[n]=t[e.args[1]],g(new u("^","pow",[i,e.args[1]]),t);break;case"exp":r=new c("exp",[i.clone()]);break;case"sin":r=new c("cos",[i.clone()]);break;case"cos":r=new u("-","unaryMinus",[new c("sin",[i.clone()])]);break;case"tan":r=new u("^","pow",[new c("sec",[i.clone()]),y(2)]);break;case"sec":r=new u("*","multiply",[e,new c("tan",[i.clone()])]);break;case"csc":s=!0,r=new u("*","multiply",[e,new c("cot",[i.clone()])]);break;case"cot":s=!0,r=new u("^","pow",[new c("csc",[i.clone()]),y(2)]);break;case"asin":l=!0,r=new c("sqrt",[new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])])]);break;case"acos":l=!0,s=!0,r=new c("sqrt",[new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])])]);break;case"atan":l=!0,r=new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)]);break;case"asec":l=!0,r=new u("*","multiply",[new c("abs",[i.clone()]),new c("sqrt",[new u("-","subtract",[new u("^","pow",[i.clone(),y(2)]),y(1)])])]);break;case"acsc":l=!0,s=!0,r=new u("*","multiply",[new c("abs",[i.clone()]),new c("sqrt",[new u("-","subtract",[new u("^","pow",[i.clone(),y(2)]),y(1)])])]);break;case"acot":l=!0,s=!0,r=new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)]);break;case"sinh":r=new c("cosh",[i.clone()]);break;case"cosh":r=new c("sinh",[i.clone()]);break;case"tanh":r=new u("^","pow",[new c("sech",[i.clone()]),y(2)]);break;case"sech":s=!0,r=new u("*","multiply",[e,new c("tanh",[i.clone()])]);break;case"csch":s=!0,r=new u("*","multiply",[e,new c("coth",[i.clone()])]);break;case"coth":s=!0,r=new u("^","pow",[new c("csch",[i.clone()]),y(2)]);break;case"asinh":l=!0,r=new c("sqrt",[new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)])]);break;case"acosh":l=!0,r=new c("sqrt",[new u("-","subtract",[new u("^","pow",[i.clone(),y(2)]),y(1)])]);break;case"atanh":l=!0,r=new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])]);break;case"asech":l=!0,s=!0,r=new u("*","multiply",[i.clone(),new c("sqrt",[new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])])])]);break;case"acsch":l=!0,s=!0,r=new u("*","multiply",[new c("abs",[i.clone()]),new c("sqrt",[new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)])])]);break;case"acoth":l=!0,s=!0,r=new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])]);break;case"abs":r=new u("/","divide",[new c(new p("abs"),[i.clone()]),i.clone()]);break;default:throw new 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')}l?(o="/",a="divide"):(o="*",a="multiply");var d=g(i,t);return s&&(d=new u("-","unaryMinus",[d])),new u(o,a,[d,r])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return y(0);if("+"===e.op)return new u(e.op,e.fn,e.args.map((function(e){return g(e,t)})));if("-"===e.op){if(e.isUnary())return new u(e.op,e.fn,[g(e.args[0],t)]);if(e.isBinary())return new u(e.op,e.fn,[g(e.args[0],t),g(e.args[1],t)])}if("*"===e.op){var n=e.args.filter((function(e){return void 0!==t[e]}));if(n.length>0){var r=e.args.filter((function(e){return void 0===t[e]})),o=1===r.length?r[0]:new u("*","multiply",r),l=n.concat(g(o,t));return new u("*","multiply",l)}return new u("+","add",e.args.map((function(n){return new u("*","multiply",e.args.map((function(e){return e===n?g(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var s=e.args[0],d=e.args[1];return void 0!==t[d]?new u("/","divide",[g(s,t),d]):void 0!==t[s]?new u("*","multiply",[new u("-","unaryMinus",[s]),new u("/","divide",[g(d,t),new u("^","pow",[d.clone(),y(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[g(s,t),d.clone()]),new u("*","multiply",[s.clone(),g(d,t)])]),new u("^","pow",[d.clone(),y(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],f=e.args[1];if(void 0!==t[p])return n2(p)&&(i(p.value)||a(p.value,1))?y(0):new u("*","multiply",[e,new u("*","multiply",[new c("log",[p.clone()]),g(f.clone(),t)])]);if(void 0!==t[f]){if(n2(f)){if(i(f.value))return y(0);if(a(f.value,1))return g(p,t)}var h=new u("^","pow",[p.clone(),new u("-","subtract",[f,y(1)])]);return new u("*","multiply",[f.clone(),new u("*","multiply",[g(p,t),h])])}return new u("*","multiply",[new u("^","pow",[p.clone(),f.clone()]),new u("+","add",[new u("*","multiply",[g(p,t),new u("/","divide",[f.clone(),p.clone()])]),new u("*","multiply",[g(f,t),new c("log",[p.clone()])])])])}throw new 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 y(e,t){return new s(l(e,D2(String(e),n)))}return h})),Ese="rationalize",Sse=k2(Ese,["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:n,equal:r,isZero:o,add:a,subtract:i,multiply:l,divide:s,pow:c,parse:u,simplifyConstant:d,simplifyCore:p,simplify:f,fraction:h,bignumber:m,mathWithTransform:v,matrix:g,AccessorNode:y,ArrayNode:b,ConstantNode:w,FunctionNode:x,IndexNode:C,ObjectNode:_,OperatorNode:E,SymbolNode:S,ParenthesisNode:k}=e;function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=function(){var e=[p,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},d,{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"}],t=[{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)"}],n=[{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)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],o={};return o.firstRules=e.concat(t,r),o.distrDivRules=n,o.sucDivRules=r,o.firstRulesAgain=e.concat(t),o.finalRules=[p,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},d,{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))"}],o}(),o=function(e,t,n,r){var o=[],a=f(e,r,t,{exactFractions:!1}),i="+-*"+((n=!!n)?"/":"");s(a);var l={};return l.expression=a,l.variables=o,l;function s(e){var t=e.type;if("FunctionNode"===t)throw new Error("There is an unsolved function call");if("OperatorNode"===t)if("^"===e.op){if("ConstantNode"!==e.args[1].type||!N2(parseFloat(e.args[1].value)))throw new Error("There is a non-integer exponent");s(e.args[0])}else{if(!i.includes(e.op))throw new Error("Operator "+e.op+" invalid in polynomial expression");for(var n=0;n<e.args.length;n++)s(e.args[n])}else if("SymbolNode"===t){var r=e.name;-1===o.indexOf(r)&&o.push(r)}else if("ParenthesisNode"===t)s(e.content);else if("ConstantNode"!==t)throw new Error("type "+t+" is not allowed in polynomial expression")}}(e,t,!0,r.firstRules),a=o.variables.length,i={exactFractions:!1},l={exactFractions:!0};if(e=o.expression,a>=1){var s,c;e=N(e);var u,h=!0,m=!1;for(e=f(e,r.firstRules,{},i);c=h?r.distrDivRules:r.sucDivRules,h=!h,(u=(e=f(e,c,{},l)).toString())!==s;)m=!0,s=u;m&&(e=f(e,r.firstRulesAgain,{},i)),e=f(e,r.finalRules,{},i)}var v=[],g={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===a&&(e.args[0]=D(e.args[0],v),e.args[1]=D(e.args[1])),n&&(g.numerator=e.args[0],g.denominator=e.args[1])):(1===a&&(e=D(e,v)),n&&(g.numerator=e,g.denominator=null)),n?(g.coefficients=v,g.variables=o.variables,g.expression=e,g):e}return n(Ese,{Node:T,"Node, boolean":(e,t)=>T(e,{},t),"Node, Object":T,"Node, Object, boolean":T});function N(e,t,n){var r=e.type,o=arguments.length>1;if("OperatorNode"===r&&e.isBinary()){var a,i=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(i=(a=parseFloat(e.args[1].value))>=2&&N2(a))),i){if(a>2){var l=e.args[0],s=new E("^","pow",[e.args[0].cloneDeep(),new w(a-1)]);e=new E("*","multiply",[l,s])}else e=new E("*","multiply",[e.args[0],e.args[0].cloneDeep()]);o&&("content"===n?t.content=e:t.args[n]=e)}}if("ParenthesisNode"===r)N(e.content,e,"content");else if("ConstantNode"!==r&&"SymbolNode"!==r)for(var c=0;c<e.args.length;c++)N(e.args[c],e,c);if(!o)return e}function D(e,t){void 0===t&&(t=[]),t[0]=0;var n={cte:1,oper:"+",fire:""},r=0,o="";!function e(n,a,i){var l=n.type;if("FunctionNode"===l)throw new Error("There is an unsolved function call");if("OperatorNode"===l){if(!"+-*^".includes(n.op))throw new Error("Operator "+n.op+" invalid");if(null!==a){if(("unaryMinus"===n.fn||"pow"===n.fn)&&"add"!==a.fn&&"subtract"!==a.fn&&"multiply"!==a.fn)throw new Error("Invalid "+n.op+" placing");if(("subtract"===n.fn||"add"===n.fn||"multiply"===n.fn)&&"add"!==a.fn&&"subtract"!==a.fn)throw new Error("Invalid "+n.op+" placing");if(("subtract"===n.fn||"add"===n.fn||"unaryMinus"===n.fn)&&0!==i.noFil)throw new Error("Invalid "+n.op+" placing")}"^"!==n.op&&"*"!==n.op||(i.fire=n.op);for(var s=0;s<n.args.length;s++)"unaryMinus"===n.fn&&(i.oper="-"),"+"!==n.op&&"subtract"!==n.fn||(i.fire="",i.cte=1,i.oper=0===s?"+":n.op),i.noFil=s,e(n.args[s],n,i)}else if("SymbolNode"===l){if(n.name!==o&&""!==o)throw new Error("There is more than one variable");if(o=n.name,null===a)return void(t[1]=1);if("^"===a.op&&0!==i.noFil)throw new Error("In power the variable should be the first parameter");if("*"===a.op&&1!==i.noFil)throw new Error("In multiply the variable should be the second parameter");""!==i.fire&&"*"!==i.fire||(r<1&&(t[1]=0),t[1]+=i.cte*("+"===i.oper?1:-1),r=Math.max(1,r))}else{if("ConstantNode"!==l)throw new Error("Type "+l+" is not allowed");var c=parseFloat(n.value);if(null===a)return void(t[0]=c);if("^"===a.op){if(1!==i.noFil)throw new Error("Constant cannot be powered");if(!N2(c)||c<=0)throw new Error("Non-integer exponent is not allowed");for(var u=r+1;u<c;u++)t[u]=0;return c>r&&(t[c]=0),t[c]+=i.cte*("+"===i.oper?1:-1),void(r=Math.max(c,r))}i.cte=c,""===i.fire&&(t[0]+=i.cte*("+"===i.oper?1:-1))}}(e,null,n);for(var a,i=!0,l=r=t.length-1;l>=0;l--)if(0!==t[l]){var s=new w(i?t[l]:Math.abs(t[l])),c=t[l]<0?"-":"+";if(l>0){var u=new S(o);if(l>1){var d=new w(l);u=new E("^","pow",[u,d])}s=-1===t[l]&&i?new E("-","unaryMinus",[u]):1===Math.abs(t[l])?u:new E("*","multiply",[s,u])}a=i?s:"+"===c?new E("+","add",[a,s]):new E("-","subtract",[a,s]),i=!1}return i?new w(0):a}})),kse="zpk2tf",Tse=k2(kse,["typed","add","multiply","Complex","number"],(e=>{var{typed:t,add:n,multiply:r,Complex:o,number:a}=e;return t(kse,{"Array,Array,number":function(e,t,n){return i(e,t,n)},"Array,Array":function(e,t){return i(e,t,1)},"Matrix,Matrix,number":function(e,t,n){return i(e.valueOf(),t.valueOf(),n)},"Matrix,Matrix":function(e,t){return i(e.valueOf(),t.valueOf(),1)}});function i(e,t,n){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 i=[o(1,0)],s=[o(1,0)],c=0;c<e.length;c++){var u=e[c];"number"==typeof u&&(u=o(u,0)),i=l(i,[o(1,0),o(-u.re,-u.im)])}for(var d=0;d<t.length;d++){var p=t[d];"number"==typeof p&&(p=o(p,0)),s=l(s,[o(1,0),o(-p.re,-p.im)])}for(var f=0;f<i.length;f++)i[f]=r(i[f],n);return[i,s]}function l(e,t){for(var a=[],i=0;i<e.length+t.length-1;i++){a[i]=o(0,0);for(var l=0;l<e.length;l++)i-l>=0&&i-l<t.length&&(a[i]=n(a[i],r(e[l],t[i-l])))}return a}})),Nse="freqz",Dse=k2(Nse,["typed","add","multiply","Complex","divide","matrix"],(e=>{var{typed:t,add:n,multiply:r,Complex:o,divide:a,matrix:i}=e;return t(Nse,{"Array, Array":function(e,t){return l(e,t,s(512))},"Array, Array, Array":function(e,t,n){return l(e,t,n)},"Array, Array, number":function(e,t,n){if(n<0)throw new Error("w must be a positive number");return l(e,t,s(n))},"Matrix, Matrix":function(e,t){var n=s(512),{w:r,h:o}=l(e.valueOf(),t.valueOf(),n);return{w:i(r),h:i(o)}},"Matrix, Matrix, Matrix":function(e,t,n){var{h:r}=l(e.valueOf(),t.valueOf(),n.valueOf());return{h:i(r),w:i(n)}},"Matrix, Matrix, number":function(e,t,n){if(n<0)throw new Error("w must be a positive number");var r=s(n),{h:o}=l(e.valueOf(),t.valueOf(),r);return{h:i(o),w:i(r)}}});function l(e,t,i){for(var l=[],s=[],c=0;c<i.length;c++){for(var u=o(0,0),d=o(0,0),p=0;p<e.length;p++)u=n(u,r(e[p],o(Math.cos(-p*i[c]),Math.sin(-p*i[c]))));for(var f=0;f<t.length;f++)d=n(d,r(t[f],o(Math.cos(-f*i[c]),Math.sin(-f*i[c]))));l.push(u),s.push(d)}for(var h=[],m=0;m<l.length;m++)h.push(a(l[m],s[m]));return{h:h,w:i}}function s(e){for(var t=[],n=0;n<e;n++)t.push(n/e*Math.PI);return t}})),Ase=k2("reviver",["classes"],(e=>{var{classes:t}=e;return function(e,n){var r=t[n&&n.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(n):n}})),Ise=k2("replacer",[],(()=>function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?"bigint"==typeof t?{mathjs:"bigint",value:String(t)}:t:{mathjs:"number",value:String(t)}})),Rse=k2("true",[],(()=>!0)),Mse=k2("false",[],(()=>!1)),Ose=k2("null",[],(()=>null)),Bse=Kse("Infinity",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1/0):1/0})),Vse=Kse("NaN",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(NaN):NaN})),Pse=Kse("pi",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?cre(n):$8})),Lse=Kse("tau",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?ure(n):U8})),Fse=Kse("e",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?lre(n):H8})),zse=Kse("phi",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?sre(n):1.618033988749895})),jse=Kse("LN2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).ln():Math.LN2})),$se=Kse("LN10",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(10).ln():Math.LN10})),Use=Kse("LOG2E",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(2).ln()):Math.LOG2E})),Hse=Kse("LOG10E",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(10).ln()):Math.LOG10E})),qse=Kse("SQRT1_2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n("0.5").sqrt():Math.SQRT1_2})),Wse=Kse("SQRT2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).sqrt():Math.SQRT2})),Gse=Kse("i",["Complex"],(e=>{var{Complex:t}=e;return t.I})),Yse=k2("version",[],(()=>"13.1.1"));function Kse(e,t,n){return k2(e,t,n,{recreateOnConfigChange:!0})}var Xse=Wce("speedOfLight","299792458","m s^-1"),Jse=Wce("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Zse=Wce("planckConstant","6.62607015e-34","J s"),Qse=Wce("reducedPlanckConstant","1.0545718176461565e-34","J s"),ece=Wce("magneticConstant","1.25663706212e-6","N A^-2"),tce=Wce("electricConstant","8.8541878128e-12","F m^-1"),nce=Wce("vacuumImpedance","376.730313667","ohm"),rce=Wce("coulomb","8.987551792261171e9","N m^2 C^-2"),oce=Wce("elementaryCharge","1.602176634e-19","C"),ace=Wce("bohrMagneton","9.2740100783e-24","J T^-1"),ice=Wce("conductanceQuantum","7.748091729863649e-5","S"),lce=Wce("inverseConductanceQuantum","12906.403729652257","ohm"),sce=Wce("magneticFluxQuantum","2.0678338484619295e-15","Wb"),cce=Wce("nuclearMagneton","5.0507837461e-27","J T^-1"),uce=Wce("klitzing","25812.807459304513","ohm"),dce=Wce("bohrRadius","5.29177210903e-11","m"),pce=Wce("classicalElectronRadius","2.8179403262e-15","m"),fce=Wce("electronMass","9.1093837015e-31","kg"),hce=Wce("fermiCoupling","1.1663787e-5","GeV^-2"),mce=Gce("fineStructure",.0072973525693),vce=Wce("hartreeEnergy","4.3597447222071e-18","J"),gce=Wce("protonMass","1.67262192369e-27","kg"),yce=Wce("deuteronMass","3.3435830926e-27","kg"),bce=Wce("neutronMass","1.6749271613e-27","kg"),wce=Wce("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),xce=Wce("rydberg","10973731.568160","m^-1"),Cce=Wce("thomsonCrossSection","6.6524587321e-29","m^2"),_ce=Gce("weakMixingAngle",.2229),Ece=Gce("efimovFactor",22.7),Sce=Wce("atomicMass","1.66053906660e-27","kg"),kce=Wce("avogadro","6.02214076e23","mol^-1"),Tce=Wce("boltzmann","1.380649e-23","J K^-1"),Nce=Wce("faraday","96485.33212331001","C mol^-1"),Dce=Wce("firstRadiation","3.7417718521927573e-16","W m^2"),Ace=Wce("loschmidt","2.686780111798444e25","m^-3"),Ice=Wce("gasConstant","8.31446261815324","J K^-1 mol^-1"),Rce=Wce("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Mce=Wce("molarVolume","0.022413969545014137","m^3 mol^-1"),Oce=Gce("sackurTetrode",-1.16487052358),Bce=Wce("secondRadiation","0.014387768775039337","m K"),Vce=Wce("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Pce=Wce("wienDisplacement","2.897771955e-3","m K"),Lce=Wce("molarMass","0.99999999965e-3","kg mol^-1"),Fce=Wce("molarMassC12","11.9999999958e-3","kg mol^-1"),zce=Wce("gravity","9.80665","m s^-2"),jce=Wce("planckLength","1.616255e-35","m"),$ce=Wce("planckMass","2.176435e-8","kg"),Uce=Wce("planckTime","5.391245e-44","s"),Hce=Wce("planckCharge","1.87554603778e-18","C"),qce=Wce("planckTemperature","1.416785e+32","K");function Wce(e,t,n){return k2(e,["config","Unit","BigNumber"],(e=>{var{config:r,Unit:o,BigNumber:a}=e,i=new o("BigNumber"===r.number?new a(t):parseFloat(t),n);return i.fixPrefix=!0,i}))}function Gce(e,t){return k2(e,["config","BigNumber"],(e=>{var{config:n,BigNumber:r}=e;return"BigNumber"===n.number?new r(t):t}))}var Yce=k2("apply",["typed","isInteger"],(e=>{var{typed:t,isInteger:n}=e,r=f9({typed:t,isInteger:n});return t("apply",{"...any":function(e){var t=e[1];T1(t)?e[1]=t-1:N1(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(n){throw zoe(n)}}})}),{isTransformFunction:!0}),Kce=k2("column",["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:o}=e,a=nee({typed:t,Index:n,matrix:r,range:o});return t("column",{"...any":function(e){var t=e.length-1,n=e[t];T1(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(r){throw zoe(r)}}})}),{isTransformFunction:!0});function Xce(e,t,n){var r=e.filter((function(e){return f2(e)&&!(e.name in t)&&!n.has(e.name)}))[0];if(!r)throw new Error('No undefined variable found in inline expression "'+e+'"');var o=r.name,a=new Map,i=new _1(n,a,new Set([o])),l=e.compile();return function(e){return a.set(o,e),l.evaluate(i)}}var Jce=k2("filter",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var o,a;return e[0]&&(o=e[0].compile().evaluate(n)),e[1]&&(a=f2(e[1])||o2(e[1])?e[1].compile().evaluate(n):Xce(e[1],t,n)),r(o,a)}n.rawArgs=!0;var r=t("filter",{"Array, function":Zce,"Matrix, function":function(e,t){return e.create(Zce(e.toArray(),t),e.datatype())},"Array, RegExp":j6,"Matrix, RegExp":function(e,t){return e.create(j6(e.toArray(),t),e.datatype())}});return n}),{isTransformFunction:!0});function Zce(e,t){return z6(e,(function(e,n,r){return Z6(t,e,[n+1],r,"filter")}))}var Qce=k2("forEach",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var o,a;return e[0]&&(o=e[0].compile().evaluate(n)),e[1]&&(a=f2(e[1])||o2(e[1])?e[1].compile().evaluate(n):Xce(e[1],t,n)),r(o,a)}n.rawArgs=!0;var r=t("forEach",{"Array | Matrix, function":function(e,t){var n=function(r,o){if(!Array.isArray(r))return Z6(t,r,o,e,"forEach");F6(r,(function(e,t){n(e,o.concat(t+1))}))};n(e.valueOf(),[])}});return n}),{isTransformFunction:!0}),eue=k2("index",["Index","getMatrixDataType"],(e=>{var{Index:t,getMatrixDataType:n}=e;return function(){for(var e=[],r=0,o=arguments.length;r<o;r++){var a=arguments[r];if(F1(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(O1(a)||B1(a))"boolean"!==n(a)&&(a=a.map((function(e){return e-1})));else if(T1(a))a--;else if(N1(a))a=a.toNumber()-1;else if("string"!=typeof a)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[r]=a}var i=new t;return t.apply(i,e),i}}),{isTransformFunction:!0}),tue=k2("map",["typed"],(e=>{var{typed:t}=e,n=Cee({typed:t});function r(e,r,a){if(0===e.length)return n();if(1===e.length)return n(e[0]);var i,l,s=e.length-1;return l=e[s],i=(i=e.slice(0,s)).map((e=>c(e,a))),l&&(l=f2(l)||o2(l)?c(l,a):Xce(l,r,a)),n(...i,function(e,n){return t.isTypedFunction(e)?o(e,n):nue(e,e.length,n)}(l,s));function c(e,t){return e.compile().evaluate(t)}}return r.rawArgs=!0,r;function o(e,n){var r=Object.fromEntries(Object.entries(e.signatures).map((e=>{var[r,a]=e,i=r.split(",").length;return t.isTypedFunction(a)?[r,o(a,n)]:[r,nue(a,i,n)]})));return"string"==typeof e.name?t(e.name,r):t(r)}}),{isTransformFunction:!0});function nue(e,t,n){return t===n?e:t===n+1?function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=r.slice(0,n),i=rue(r[n]);return e(...a,i)}:t>n+1?function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=r.slice(0,n),i=rue(r[n]),l=r.slice(n+1);return e(...a,i,...l)}:e}function rue(e){return e.map((e=>e.isBigNumber?e.plus(1):e+1))}function oue(e){if(2===e.length&&V1(e[0])){var t=(e=e.slice())[1];(T1(n=t)||N1(n))&&(e[1]=function(e){return T1(e)?e-1:N1(e)?e.minus(1):e}(t))}var n;return e}var aue=["typed","config","numeric","larger"],iue=k2("max",aue,(e=>{var{typed:t,config:n,numeric:r,larger:o}=e,a=Zne({typed:t,config:n,numeric:r,larger:o});return t("max",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),lue=["typed","add","divide"],sue=k2("mean",lue,(e=>{var{typed:t,add:n,divide:r}=e,o=Gie({typed:t,add:n,divide:r});return t("mean",{"...any":function(e){e=oue(e);try{return o.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),cue=["typed","config","numeric","smaller"],uue=k2("min",cue,(e=>{var{typed:t,config:n,numeric:r,smaller:o}=e,a=Qne({typed:t,config:n,numeric:r,smaller:o});return t("min",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),due=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],pue=k2("range",due,(e=>{var{typed:t,config:n,matrix:r,bignumber:o,smaller:a,smallerEq:i,larger:l,largerEq:s,add:c,isPositive:u}=e,d=Ree({typed:t,config:n,matrix:r,bignumber:o,smaller:a,smallerEq:i,larger:l,largerEq:s,add:c,isPositive:u});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),d.apply(null,e)}})}),{isTransformFunction:!0}),fue=["typed","Index","matrix","range"],hue=k2("row",fue,(e=>{var{typed:t,Index:n,matrix:r,range:o}=e,a=zee({typed:t,Index:n,matrix:r,range:o});return t("row",{"...any":function(e){var t=e.length-1,n=e[t];T1(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(r){throw zoe(r)}}})}),{isTransformFunction:!0}),mue=["typed","matrix","zeros","add"],vue=k2("subset",mue,(e=>{var{typed:t,matrix:n,zeros:r,add:o}=e,a=Wee({typed:t,matrix:n,zeros:r,add:o});return t("subset",{"...any":function(e){try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),gue=["typed","matrix","isInteger"],yue=k2("concat",gue,(e=>{var{typed:t,matrix:n,isInteger:r}=e,o=eee({typed:t,matrix:n,isInteger:r});return t("concat",{"...any":function(e){var t=e.length-1,n=e[t];T1(n)?e[t]=n-1:N1(n)&&(e[t]=n.minus(1));try{return o.apply(null,e)}catch(r){throw zoe(r)}}})}),{isTransformFunction:!0}),bue="diff",wue=["typed","matrix","subtract","number","bignumber"],xue=k2(bue,wue,(e=>{var{typed:t,matrix:n,subtract:r,number:o,bignumber:a}=e,i=kee({typed:t,matrix:n,subtract:r,number:o,bignumber:a});return t(bue,{"...any":function(e){e=oue(e);try{return i.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),Cue=["typed","map","sqrt","variance"],_ue=k2("std",Cue,(e=>{var{typed:t,map:n,sqrt:r,variance:o}=e,a=nle({typed:t,map:n,sqrt:r,variance:o});return t("std",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),Eue=["typed","config","add","numeric"],Sue=k2("sum",Eue,(e=>{var{typed:t,config:n,add:r,numeric:o}=e,a=Uie({typed:t,config:n,add:r,numeric:o});return t("sum",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),kue=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Tue=k2("quantileSeq",kue,(e=>{var{typed:t,bignumber:n,add:r,subtract:o,divide:a,multiply:i,partitionSelect:l,compare:s,isInteger:c,smaller:u,smallerEq:d,larger:p}=e,f=tle({typed:t,bignumber:n,add:r,subtract:o,divide:a,multiply:i,partitionSelect:l,compare:s,isInteger:c,smaller:u,smallerEq:d,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":f,"Array | Matrix, number | BigNumber, number":(e,t,n)=>f(e,t,h(n)),"Array | Matrix, number | BigNumber, boolean":f,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>f(e,t,n,h(r)),"Array | Matrix, Array | Matrix":f,"Array | Matrix, Array | Matrix, number":(e,t,n)=>f(e,t,h(n)),"Array | Matrix, Array | Matrix, boolean":f,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>f(e,t,n,h(r))});function h(e){return oue([[],e])[1]}}),{isTransformFunction:!0}),Nue="cumsum",Due=["typed","add","unaryPlus"],Aue=k2(Nue,Due,(e=>{var{typed:t,add:n,unaryPlus:r}=e,o=qie({typed:t,add:n,unaryPlus:r});return t(Nue,{"...any":function(e){if(2===e.length&&V1(e[0])){var t=e[1];T1(t)?e[1]=t-1:N1(t)&&(e[1]=t.minus(1))}try{return o.apply(null,e)}catch(n){throw zoe(n)}}})}),{isTransformFunction:!0}),Iue="variance",Rue=["typed","add","subtract","multiply","divide","apply","isNaN"],Mue=k2(Iue,Rue,(e=>{var{typed:t,add:n,subtract:r,multiply:o,divide:a,apply:i,isNaN:l}=e,s=Qie({typed:t,add:n,subtract:r,multiply:o,divide:a,apply:i,isNaN:l});return t(Iue,{"...any":function(e){e=oue(e);try{return s.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),Oue="print",Bue=["typed","matrix","zeros","add"],Vue=k2(Oue,Bue,(e=>{var{typed:t,matrix:n,zeros:r,add:o}=e,a=Ite({typed:t,matrix:n,zeros:r,add:o});return t(Oue,{"string, Object | Array":function(e,t){return a(i(e),t)},"string, Object | Array, number | Object":function(e,t,n){return a(i(e),t,n)}});function i(e){return e.replace(Dte,(e=>"$"+e.slice(1).split(".").map((function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e})).join(".")))}}),{isTransformFunction:!0}),Pue=["typed","matrix","zeros","add","equalScalar","not","concat"],Lue=k2("and",Pue,(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i}=e,l=mne({typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i});function s(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)&&!l(r,!0))return!1;var o=e[1].compile().evaluate(n);return l(r,o)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Fue=["typed","matrix","equalScalar","DenseMatrix","concat"],zue=k2("or",Fue,(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=J7({typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a});function l(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)&&i(r,!1))return!0;var o=e[1].compile().evaluate(n);return i(r,o)}return l.rawArgs=!0,l}),{isTransformFunction:!0}),jue=["typed","matrix","zeros","add","equalScalar","not","concat"],$ue=k2("bitAnd",jue,(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i}=e,l=P7({typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i});function s(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)){if(isNaN(r))return NaN;if(0===r||!1===r)return 0}var o=e[1].compile().evaluate(n);return l(r,o)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Uue=["typed","matrix","equalScalar","DenseMatrix","concat"],Hue=k2("bitOr",Uue,(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=j7({typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a});function l(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)){if(isNaN(r))return NaN;if(-1===r)return-1;if(!0===r)return 1}var o=e[1].compile().evaluate(n);return i(r,o)}return l.rawArgs=!0,l}),{isTransformFunction:!0}),que=z3({config:w2}),Wue=K3({}),Gue=Fse({BigNumber:que,config:w2}),Yue=Mse({}),Kue=mce({BigNumber:que,config:w2}),Xue=i6({}),Jue=Gse({Complex:Wue}),Zue=Bse({BigNumber:que,config:w2}),Que=$se({BigNumber:que,config:w2}),ede=Hse({BigNumber:que,config:w2}),tde=s6({}),nde=Vse({BigNumber:que,config:w2}),rde=Ose({}),ode=zse({BigNumber:que,config:w2}),ade=l6({}),ide=i4({}),lde=qse({BigNumber:que,config:w2}),sde=Oce({BigNumber:que,config:w2}),cde=Lse({BigNumber:que,config:w2}),ude=Rse({}),dde=Yse({}),pde=Q6({Matrix:tde}),fde=Ece({BigNumber:que,config:w2}),hde=jse({BigNumber:que,config:w2}),mde=Pse({BigNumber:que,config:w2}),vde=Ise({}),gde=Wse({BigNumber:que,config:w2}),yde=e4({BigNumber:que,Complex:Wue,DenseMatrix:pde,Fraction:Xue}),bde=_ce({BigNumber:que,config:w2}),wde=d9({typed:yde}),xde=Cre({Complex:Wue,config:w2,typed:yde}),Cde=kre({BigNumber:que,typed:yde}),_de=Are({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Ede=v9({typed:yde}),Sde=q7({typed:yde}),kde=Vre({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Tde=Fre({typed:yde}),Nde=zre({typed:yde}),Dde=Hre({Complex:Wue,config:w2,typed:yde}),Ade=U5({typed:yde}),Ide=F7({typed:yde}),Rde=G5({typed:yde}),Mde=t8({typed:yde}),Ode=ile({typed:yde}),Bde=K5({Complex:Wue,typed:yde}),Vde=G7({typed:yde}),Pde=Wre({typed:yde}),Lde=Kre({BigNumber:que,typed:yde}),Fde=Zre({BigNumber:que,typed:yde}),zde=D9({typed:yde}),jde=z5({config:w2,typed:yde}),$de=dte({typed:yde}),Ude=A9({typed:yde}),Hde=R9({Complex:Wue,typed:yde}),qde=cee({typed:yde}),Wde=pee({typed:yde}),Gde=hee({typed:yde}),Yde=Ste({typed:yde}),Kde=gee({typed:yde}),Xde=Nte({format:Yde,typed:yde}),Jde=Y7({typed:yde}),Zde=u8({typed:yde}),Qde=S5({config:w2,typed:yde}),epe=I5({config:w2,typed:yde}),tpe=M5({equalScalar:jde,typed:yde}),npe=Use({BigNumber:que,config:w2}),rpe=hle({Complex:Wue,typed:yde}),ope=i7({Complex:Wue,config:w2,typed:yde}),ape=s7({Complex:Wue,config:w2,typed:yde}),ipe=Cee({typed:yde}),lpe=c7({typed:yde}),spe=X7({typed:yde}),cpe=$5({typed:yde}),upe=Tte({format:Yde,typed:yde}),dpe=Yle({config:w2,typed:yde}),ppe=Ite({typed:yde}),fpe=Jle({config:w2,typed:yde}),hpe=K7({typed:yde}),mpe=toe({BigNumber:que,typed:yde}),vpe=m7({BigNumber:que,Fraction:Xue,complex:Bde,typed:yde}),gpe=ooe({typed:yde}),ype=j5({Matrix:tde,equalScalar:jde,typed:yde}),bpe=i9({typed:yde}),wpe=y7({typed:yde}),xpe=q5({typed:yde}),Cpe=y9({typed:yde}),_pe=loe({typed:yde}),Epe=P5({typed:yde}),Spe=Ere({Complex:Wue,config:w2,typed:yde}),kpe=Rre({BigNumber:que,typed:yde}),Tpe=f9({isInteger:Zde,typed:yde}),Npe=Ore({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Dpe=Y5({BigNumber:que,typed:yde}),Ape=cle({typed:yde}),Ipe=Yre({typed:yde}),Rpe=eoe({BigNumber:que,typed:yde}),Mpe=B5({typed:yde}),Ope=Bte({typed:yde}),Bpe=Qle({config:w2,typed:yde}),Vpe=roe({BigNumber:que,typed:yde}),Ppe=ioe({typed:yde}),Lpe=yre({SparseMatrix:ype,typed:yde}),Fpe=v7({Complex:Wue,config:w2,typed:yde}),zpe=Hee({typed:yde}),jpe=soe({typed:yde}),$pe=s9({typed:yde}),Upe=Nre({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Hpe=kte({format:Yde,typed:yde}),qpe=Jre({BigNumber:que,typed:yde}),Wpe=X5({Fraction:Xue,typed:yde}),Gpe=T5({typed:yde}),Ype=Z5({DenseMatrix:pde,Matrix:tde,SparseMatrix:ype,typed:yde}),Kpe=e9({isZero:tpe,matrix:Ype,typed:yde}),Xpe=wte({isNaN:Mpe,isNumeric:Gpe,typed:yde}),Jpe=Vte({bignumber:Dpe,fraction:Wpe,number:cpe}),Zpe=_te({config:w2,multiplyScalar:lpe,numeric:Jpe,typed:yde}),Qpe=Oee({isInteger:Zde,matrix:Ype,typed:yde}),efe=$ee({matrix:Ype,config:w2,typed:yde}),tfe=Zee({matrix:Ype,typed:yde}),nfe=C7({BigNumber:que,config:w2,matrix:Ype,typed:yde}),rfe=nte({BigNumber:que,config:w2,matrix:Ype,typed:yde}),ofe=Lre({Complex:Wue,config:w2,typed:yde}),afe=w9({BigNumber:que,Complex:Wue,Fraction:Xue,config:w2,isNegative:Qde,matrix:Ype,typed:yde,unaryMinus:$pe}),ife=eee({isInteger:Zde,matrix:Ype,typed:yde}),lfe=oee({prod:Zpe,size:efe,typed:yde}),sfe=ete({conj:Vde,transpose:tfe,typed:yde}),cfe=see({DenseMatrix:pde,SparseMatrix:ype,matrix:Ype,typed:yde}),ufe=Lte({numeric:Jpe,typed:yde}),dfe=Jte({DenseMatrix:pde,concat:ife,divideScalar:ufe,equalScalar:jde,matrix:Ype,typed:yde}),pfe=Tne({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),ffe=D5({isNumeric:Gpe,typed:yde}),hfe=bee({BigNumber:que,DenseMatrix:pde,SparseMatrix:ype,config:w2,matrix:Ype,typed:yde}),mfe=xee({matrix:Ype,multiplyScalar:lpe,typed:yde}),vfe=jne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),gfe=une({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),yfe=ene({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),bfe=o9({flatten:Wde,matrix:Ype,size:efe,typed:yde}),wfe=f7({BigNumber:que,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),xfe=Tee({BigNumber:que,config:w2,matrix:Ype,typed:yde}),Cfe=Hae({addScalar:Ede,complex:Bde,conj:Vde,divideScalar:ufe,equal:pfe,identity:hfe,isZero:tpe,matrix:Ype,multiplyScalar:lpe,sign:vpe,sqrt:Fpe,subtractScalar:Cpe,typed:yde,unaryMinus:$pe,zeros:rfe}),_fe=Bee({config:w2,matrix:Ype}),Efe=pne({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),Sfe=$te({BigNumber:que,DenseMatrix:pde,config:w2,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),kfe=Rne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),Tfe=w7({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,subtractScalar:Cpe,typed:yde,unaryMinus:$pe}),Nfe=Mte({concat:ife,matrix:Ype,typed:yde}),Dfe=u9({config:w2,numeric:Jpe,typed:yde}),Afe=nne({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),Ife=Z7({DenseMatrix:pde,concat:ife,matrix:Ype,typed:yde}),Rfe=Doe({DenseMatrix:pde,SparseMatrix:ype,addScalar:Ede,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Mfe=$re({BigNumber:que,DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Ofe=P7({concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Bfe=j7({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Vfe=H7({DenseMatrix:pde,concat:ife,matrix:Ype,typed:yde}),Pfe=ase({addScalar:Ede,combinations:Ode,divideScalar:ufe,isInteger:Zde,isNegative:Qde,multiplyScalar:lpe,typed:yde}),Lfe=gne({BigNumber:que,DenseMatrix:pde,Fraction:Xue,concat:ife,config:w2,equalScalar:jde,matrix:Ype,typed:yde}),Ffe=Sne({concat:ife,matrix:Ype,typed:yde}),zfe=qie({add:Rfe,typed:yde,unaryPlus:Dfe}),jfe=Hne({equal:pfe,typed:yde}),$fe=kee({matrix:Ype,number:cpe,subtract:Tfe,typed:yde}),Ufe=jie({abs:wde,addScalar:Ede,deepEqual:jfe,divideScalar:ufe,multiplyScalar:lpe,sqrt:Fpe,subtractScalar:Cpe,typed:yde}),Hfe=Ooe({addScalar:Ede,conj:Vde,multiplyScalar:lpe,size:efe,typed:yde}),qfe=Ane({compareText:Ffe,isZero:tpe,typed:yde}),Wfe=z9({DenseMatrix:pde,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),Gfe=n7({BigNumber:que,DenseMatrix:pde,concat:ife,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),Yfe=Ioe({abs:wde,addScalar:Ede,divideScalar:ufe,isPositive:epe,multiplyScalar:lpe,smaller:kfe,sqrt:Fpe,typed:yde}),Kfe=ere({DenseMatrix:pde,smaller:kfe}),Xfe=tre({ImmutableDenseMatrix:Kfe,getMatrixDataType:Kde}),Jfe=Lne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),Zfe=Ute({Complex:Wue,config:w2,divideScalar:ufe,typed:yde}),Qfe=one({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),ehe=n9({flatten:Wde,matrix:Ype,size:efe,typed:yde}),the=Qne({config:w2,numeric:Jpe,smaller:kfe,typed:yde}),nhe=G9({DenseMatrix:pde,concat:ife,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),rhe=d7({addScalar:Ede,dot:Hfe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,typed:yde}),ohe=Gte({Complex:Wue,config:w2,divideScalar:ufe,typed:yde}),ahe=J7({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),ihe=Kne({compare:Lfe,isNaN:Mpe,isNumeric:Gpe,typed:yde}),lhe=hne({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),she=rie({SparseMatrix:ype,abs:wde,add:Rfe,divideScalar:ufe,larger:Jfe,largerEq:vfe,multiply:rhe,subtract:Tfe,transpose:tfe,typed:yde}),che=Wee({add:Rfe,matrix:Ype,typed:yde,zeros:rfe}),uhe=Uie({add:Rfe,config:w2,numeric:Jpe,typed:yde}),dhe=Boe({add:Rfe,matrix:Ype,typed:yde}),phe=ine({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),fhe=Tse({Complex:Wue,add:Rfe,multiply:rhe,number:cpe,typed:yde}),hhe=T9({DenseMatrix:pde,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),mhe=Cne({compare:Lfe,typed:yde}),vhe=lse({addScalar:Ede,combinations:Ode,isInteger:Zde,isNegative:Qde,isPositive:epe,larger:Jfe,typed:yde}),ghe=iee({matrix:Ype,multiply:rhe,subtract:Tfe,typed:yde}),yhe=Cie({divideScalar:ufe,isZero:tpe,matrix:Ype,multiply:rhe,subtractScalar:Cpe,typed:yde,unaryMinus:$pe}),bhe=T7({concat:ife,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,typed:yde}),whe=rre({larger:Jfe,smaller:kfe}),xhe=V9({Complex:Wue,DenseMatrix:pde,ceil:hhe,equalScalar:jde,floor:Wfe,matrix:Ype,typed:yde,zeros:rfe}),Che=Poe({Index:Xfe,typed:yde}),_he=$ie({abs:wde,add:Rfe,addScalar:Ede,config:w2,divideScalar:ufe,equalScalar:jde,flatten:Wde,isNumeric:Gpe,isZero:tpe,matrix:Ype,multiply:rhe,multiplyScalar:lpe,smaller:kfe,subtract:Tfe,typed:yde}),Ehe=E7({BigNumber:que,add:Rfe,config:w2,equal:pfe,isInteger:Zde,mod:nhe,smaller:kfe,typed:yde,xgcd:nfe}),She=o7({concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),khe=qte({Complex:Wue,config:w2,divideScalar:ufe,log:Zfe,typed:yde}),The=Zne({config:w2,larger:Jfe,numeric:Jpe,typed:yde}),Nhe=uoe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Dhe=hoe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Ahe=yoe({Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Ihe=Coe({Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Rhe=Bne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),Mhe=Jne({compare:Lfe,compareNatural:mhe,matrix:Ype,typed:yde}),Ohe=Wne({DenseMatrix:pde,concat:ife,config:w2,equalScalar:jde,matrix:Ype,typed:yde}),Bhe=mne({concat:ife,equalScalar:jde,matrix:Ype,not:spe,typed:yde,zeros:rfe}),Vhe=Ree({bignumber:Dpe,matrix:Ype,add:Rfe,config:w2,isPositive:epe,larger:Jfe,largerEq:vfe,smaller:kfe,smallerEq:Rhe,typed:yde}),Phe=zee({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),Lhe=poe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Fhe=woe({Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),zhe=koe({Index:Xfe,concat:ife,setDifference:Lhe,size:efe,subset:che,typed:yde}),jhe=ore({FibonacciHeap:whe,addScalar:Ede,equalScalar:jde}),$he=nee({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),Uhe=_ie({abs:wde,addScalar:Ede,det:yhe,divideScalar:ufe,identity:hfe,matrix:Ype,multiply:rhe,typed:yde,unaryMinus:$pe}),Hhe=Uae({DenseMatrix:pde,Spa:jhe,SparseMatrix:ype,abs:wde,addScalar:Ede,divideScalar:ufe,equalScalar:jde,larger:Jfe,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde,unaryMinus:$pe}),qhe=Sie({Complex:Wue,add:Rfe,ctranspose:sfe,deepEqual:jfe,divideScalar:ufe,dot:Hfe,dotDivide:dfe,equal:pfe,inv:Uhe,matrix:Ype,multiply:rhe,typed:yde}),Whe=Fte({Complex:Wue,config:w2,fraction:Wpe,identity:hfe,inv:Uhe,matrix:Ype,multiply:rhe,number:cpe,typed:yde}),Ghe=voe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Yhe=Noe({Index:Xfe,concat:ife,setIntersect:Ghe,setSymDifference:zhe,size:efe,subset:che,typed:yde}),Khe=Rie({abs:wde,add:Rfe,identity:hfe,inv:Uhe,map:ipe,max:The,multiply:rhe,size:efe,sqrt:Fpe,subtract:Tfe,typed:yde}),Xhe=hre({BigNumber:que,Complex:Wue,Fraction:Xue,abs:wde,addScalar:Ede,config:w2,divideScalar:ufe,equal:pfe,fix:xhe,format:Yde,isNumeric:Gpe,multiplyScalar:lpe,number:cpe,pow:Whe,round:Sfe,subtractScalar:Cpe}),Jhe=nce({BigNumber:que,Unit:Xhe,config:w2}),Zhe=Pce({BigNumber:que,Unit:Xhe,config:w2}),Qhe=Sce({BigNumber:que,Unit:Xhe,config:w2}),eme=ace({BigNumber:que,Unit:Xhe,config:w2}),tme=Tce({BigNumber:que,Unit:Xhe,config:w2}),nme=ice({BigNumber:que,Unit:Xhe,config:w2}),rme=rce({BigNumber:que,Unit:Xhe,config:w2}),ome=yce({BigNumber:que,Unit:Xhe,config:w2}),ame=Kte({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,pow:Whe,typed:yde}),ime=tce({BigNumber:que,Unit:Xhe,config:w2}),lme=oce({BigNumber:que,Unit:Xhe,config:w2}),sme=Aie({abs:wde,add:Rfe,identity:hfe,inv:Uhe,multiply:rhe,typed:yde}),cme=Nce({BigNumber:que,Unit:Xhe,config:w2}),ume=rte({addScalar:Ede,ceil:hhe,conj:Vde,divideScalar:ufe,dotDivide:dfe,exp:Ude,i:Jue,log2:ape,matrix:Ype,multiplyScalar:lpe,pow:Whe,tau:cde,typed:yde}),dme=ple({BigNumber:que,Complex:Wue,config:w2,multiplyScalar:lpe,pow:Whe,typed:yde}),pme=Jse({BigNumber:que,Unit:Xhe,config:w2}),fme=vce({BigNumber:que,Unit:Xhe,config:w2}),hme=ate({conj:Vde,dotDivide:dfe,fft:ume,typed:yde}),mme=uce({BigNumber:que,Unit:Xhe,config:w2}),vme=Ace({BigNumber:que,Unit:Xhe,config:w2}),gme=ece({BigNumber:que,Unit:Xhe,config:w2}),yme=Lce({BigNumber:que,Unit:Xhe,config:w2}),bme=Rce({BigNumber:que,Unit:Xhe,config:w2}),wme=bce({BigNumber:que,Unit:Xhe,config:w2}),xme=cce({BigNumber:que,Unit:Xhe,config:w2}),Cme=Hce({BigNumber:que,Unit:Xhe,config:w2}),_me=jce({BigNumber:que,Unit:Xhe,config:w2}),Eme=qce({BigNumber:que,Unit:Xhe,config:w2}),Sme=gce({BigNumber:que,Unit:Xhe,config:w2}),kme=wce({BigNumber:que,Unit:Xhe,config:w2}),Tme=Qse({BigNumber:que,Unit:Xhe,config:w2}),Nme=xce({BigNumber:que,Unit:Xhe,config:w2}),Dme=Bce({BigNumber:que,Unit:Xhe,config:w2}),Ame=Xse({BigNumber:que,Unit:Xhe,config:w2}),Ime=Vce({BigNumber:que,Unit:Xhe,config:w2}),Rme=Cce({BigNumber:que,Unit:Xhe,config:w2}),Mme=kce({BigNumber:que,Unit:Xhe,config:w2}),Ome=dce({BigNumber:que,Unit:Xhe,config:w2}),Bme=wre({Unit:Xhe,typed:yde}),Vme=Fie({divideScalar:ufe,equalScalar:jde,inv:Uhe,matrix:Ype,multiply:rhe,typed:yde}),Pme=fce({BigNumber:que,Unit:Xhe,config:w2}),Lme=vle({gamma:dme,typed:yde}),Fme=Dce({BigNumber:que,Unit:Xhe,config:w2}),zme=zce({BigNumber:que,Unit:Xhe,config:w2}),jme=lce({BigNumber:que,Unit:Xhe,config:w2}),$me=lie({DenseMatrix:pde,lsolve:yfe,lup:Hhe,matrix:Ype,slu:she,typed:yde,usolve:Afe}),Ume=sce({BigNumber:que,Unit:Xhe,config:w2}),Hme=Fce({BigNumber:que,Unit:Xhe,config:w2}),qme=wle({add:Rfe,divide:Vme,factorial:Lme,isInteger:Zde,isPositive:epe,multiply:rhe,typed:yde}),Wme=Cle({factorial:Lme,typed:yde}),Gme=$ce({BigNumber:que,Unit:Xhe,config:w2}),Yme=uie({add:Rfe,cbrt:afe,divide:Vme,equalScalar:jde,im:Jde,isZero:tpe,multiply:rhe,re:hpe,sqrt:Fpe,subtract:Tfe,typeOf:Epe,typed:yde,unaryMinus:$pe}),Kme=Eoe({compareNatural:mhe,typed:yde}),Xme=ute({abs:wde,add:Rfe,bignumber:Dpe,divide:Vme,isNegative:Qde,isPositive:epe,larger:Jfe,map:ipe,matrix:Ype,max:The,multiply:rhe,smaller:kfe,subtract:Tfe,typed:yde,unaryMinus:$pe}),Jme=tse({bignumber:Dpe,addScalar:Ede,combinations:Ode,divideScalar:ufe,factorial:Lme,isInteger:Zde,isNegative:Qde,larger:Jfe,multiplyScalar:lpe,number:cpe,pow:Whe,subtractScalar:Cpe,typed:yde}),Zme=vre({Unit:Xhe,typed:yde}),Qme=rse({addScalar:Ede,isInteger:Zde,isNegative:Qde,stirlingS2:Jme,typed:yde}),eve=Nie({abs:wde,add:Rfe,addScalar:Ede,atan:Nde,bignumber:Dpe,column:$he,complex:Bde,config:w2,cos:Pde,diag:cfe,divideScalar:ufe,dot:Hfe,equal:pfe,flatten:Wde,im:Jde,inv:Uhe,larger:Jfe,matrix:Ype,matrixFromColumns:bfe,multiply:rhe,multiplyScalar:lpe,number:cpe,qr:Cfe,re:hpe,reshape:Qpe,sin:gpe,size:efe,smaller:kfe,sqrt:Fpe,subtract:Tfe,typed:yde,usolve:Afe,usolveAll:phe}),tve=hce({BigNumber:que,Unit:Xhe,config:w2}),nve=Ice({BigNumber:que,Unit:Xhe,config:w2}),rve=yle({divide:Vme,dotDivide:dfe,isNumeric:Gpe,log:Zfe,map:ipe,matrix:Ype,multiply:rhe,sum:uhe,typed:yde}),ove=Gie({add:Rfe,divide:Vme,typed:yde}),ave=Mce({BigNumber:que,Unit:Xhe,config:w2}),ive=Zse({BigNumber:que,Unit:Xhe,config:w2}),lve=tle({bignumber:Dpe,add:Rfe,compare:Lfe,divide:Vme,isInteger:Zde,larger:Jfe,multiply:rhe,partitionSelect:ihe,smaller:kfe,smallerEq:Rhe,subtract:Tfe,typed:yde}),sve=Qie({add:Rfe,apply:Tpe,divide:Vme,isNaN:Mpe,multiply:rhe,subtract:Tfe,typed:yde}),cve=pce({BigNumber:que,Unit:Xhe,config:w2}),uve=Kie({add:Rfe,compare:Lfe,divide:Vme,partitionSelect:ihe,typed:yde}),dve=ole({add:Rfe,divide:Vme,matrix:Ype,mean:ove,multiply:rhe,pow:Whe,sqrt:Fpe,subtract:Tfe,sum:uhe,typed:yde}),pve=Dse({Complex:Wue,add:Rfe,divide:Vme,matrix:Ype,multiply:rhe,typed:yde}),fve=Xie({abs:wde,map:ipe,median:uve,subtract:Tfe,typed:yde}),hve=nle({map:ipe,sqrt:Fpe,typed:yde,variance:sve}),mve=yte({BigNumber:que,Complex:Wue,add:Rfe,config:w2,divide:Vme,equal:pfe,factorial:Lme,gamma:dme,isNegative:Qde,multiply:rhe,pi:mde,pow:Whe,sin:gpe,smallerEq:Rhe,subtract:Tfe,typed:yde}),vve=Moe({abs:wde,add:Rfe,conj:Vde,ctranspose:sfe,eigs:eve,equalScalar:jde,larger:Jfe,matrix:Ype,multiply:rhe,pow:Whe,smaller:kfe,sqrt:Fpe,typed:yde}),gve=Fee({BigNumber:que,DenseMatrix:pde,SparseMatrix:ype,addScalar:Ede,config:w2,cos:Pde,matrix:Ype,multiplyScalar:lpe,norm:vve,sin:gpe,typed:yde,unaryMinus:$pe}),yve=Uce({BigNumber:que,Unit:Xhe,config:w2}),bve=Vie({identity:hfe,matrix:Ype,multiply:rhe,norm:vve,qr:Cfe,subtract:Tfe,typed:yde}),wve=Pee({multiply:rhe,rotationMatrix:gve,typed:yde}),xve=Oie({abs:wde,add:Rfe,concat:ife,identity:hfe,index:Che,lusolve:$me,matrix:Ype,matrixFromColumns:bfe,multiply:rhe,range:Vhe,schur:bve,subset:che,subtract:Tfe,transpose:tfe,typed:yde}),Cve=Lie({matrix:Ype,multiply:rhe,sylvester:xve,transpose:tfe,typed:yde}),_ve={},Eve={},Sve={},kve=Foe({mathWithTransform:Eve}),Tve=xae({Node:kve}),Nve=Eae({Node:kve}),Dve=kae({Node:kve}),Ave=Aae({Node:kve}),Ive=qoe({Node:kve}),Rve=eae({Node:kve,ResultSet:ide}),Mve=nae({Node:kve}),Ove=mae({Node:kve}),Bve=Nae({Node:kve}),Vve=Ase({classes:Sve}),Pve=hie({math:_ve,typed:yde}),Lve=gae({Node:kve,typed:yde}),Fve=xie({Chain:Pve,typed:yde}),zve=bae({Node:kve,size:efe}),jve=Uoe({Node:kve,subset:che}),$ve=Zoe({matrix:Ype,Node:kve,subset:che}),Uve=Iae({Unit:Xhe,Node:kve,math:_ve}),Hve=Mae({Node:kve,SymbolNode:Uve,math:_ve}),qve=Bae({AccessorNode:jve,ArrayNode:Ive,AssignmentNode:$ve,BlockNode:Rve,ConditionalNode:Mve,ConstantNode:Ove,FunctionAssignmentNode:Lve,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,RangeNode:Bve,RelationalNode:Ave,SymbolNode:Uve,config:w2,numeric:Jpe,typed:yde}),Wve=bse({ConstantNode:Ove,FunctionNode:Hve,OperatorNode:Nve,ParenthesisNode:Dve,parse:qve,typed:yde}),Gve=vse({bignumber:Dpe,fraction:Wpe,AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,SymbolNode:Uve,config:w2,mathWithTransform:Eve,matrix:Ype,typed:yde}),Yve=Pae({parse:qve,typed:yde}),Kve=yse({AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,add:Rfe,divide:Vme,equal:pfe,isZero:tpe,multiply:rhe,parse:qve,pow:Whe,subtract:Tfe,typed:yde}),Xve=Fae({parse:qve,typed:yde}),Jve=pie({evaluate:Xve}),Zve=zae({evaluate:Xve}),Qve=mse({bignumber:Dpe,fraction:Wpe,AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,add:Rfe,config:w2,divide:Vme,equal:pfe,isZero:tpe,mathWithTransform:Eve,matrix:Ype,multiply:rhe,parse:qve,pow:Whe,resolve:Wve,simplifyConstant:Gve,simplifyCore:Kve,subtract:Tfe,typed:yde}),ege=xse({OperatorNode:Nve,parse:qve,simplify:Qve,typed:yde}),tge=cse({parse:qve,typed:yde}),nge=$ae({Parser:Zve,typed:yde}),rge=Sse({bignumber:Dpe,fraction:Wpe,AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,add:Rfe,config:w2,divide:Vme,equal:pfe,isZero:tpe,mathWithTransform:Eve,matrix:Ype,multiply:rhe,parse:qve,pow:Whe,simplify:Qve,simplifyConstant:Gve,simplifyCore:Kve,subtract:Tfe,typed:yde}),oge=_se({ConstantNode:Ove,FunctionNode:Hve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,config:w2,equal:pfe,isZero:tpe,numeric:Jpe,parse:qve,simplify:Qve,typed:yde}),age=bie({Help:Jve,mathWithTransform:Eve,typed:yde});h1(_ve,{e:Gue,false:Yue,fineStructure:Kue,i:Jue,Infinity:Zue,LN10:Que,LOG10E:ede,NaN:nde,null:rde,phi:ode,SQRT1_2:lde,sackurTetrode:sde,tau:cde,true:ude,E:Gue,version:dde,efimovFactor:fde,LN2:hde,pi:mde,replacer:vde,reviver:Vve,SQRT2:gde,typed:yde,PI:mde,weakMixingAngle:bde,abs:wde,acos:xde,acot:Cde,acsc:_de,addScalar:Ede,arg:Sde,asech:kde,asinh:Tde,atan:Nde,atanh:Dde,bigint:Ade,bitNot:Ide,boolean:Rde,clone:Mde,combinations:Ode,complex:Bde,conj:Vde,cos:Pde,cot:Lde,csc:Fde,cube:zde,equalScalar:jde,erf:$de,exp:Ude,expm1:Hde,filter:qde,flatten:Wde,forEach:Gde,format:Yde,getMatrixDataType:Kde,hex:Xde,im:Jde,isInteger:Zde,isNegative:Qde,isPositive:epe,isZero:tpe,LOG2E:npe,lgamma:rpe,log10:ope,log2:ape,map:ipe,multiplyScalar:lpe,not:spe,number:cpe,oct:upe,pickRandom:dpe,print:ppe,random:fpe,re:hpe,sec:mpe,sign:vpe,sin:gpe,splitUnit:bpe,square:wpe,string:xpe,subtractScalar:Cpe,tan:_pe,typeOf:Epe,acosh:Spe,acsch:kpe,apply:Tpe,asec:Npe,bignumber:Dpe,chain:Fve,combinationsWithRep:Ape,cosh:Ipe,csch:Rpe,isNaN:Mpe,isPrime:Ope,randomInt:Bpe,sech:Vpe,sinh:Ppe,sparse:Lpe,sqrt:Fpe,squeeze:zpe,tanh:jpe,unaryMinus:$pe,acoth:Upe,bin:Hpe,coth:qpe,fraction:Wpe,isNumeric:Gpe,matrix:Ype,matrixFromFunction:Kpe,mode:Xpe,numeric:Jpe,prod:Zpe,reshape:Qpe,size:efe,transpose:tfe,xgcd:nfe,zeros:rfe,asin:ofe,cbrt:afe,concat:ife,count:lfe,ctranspose:sfe,diag:cfe,divideScalar:ufe,dotDivide:dfe,equal:pfe,hasNumericValue:ffe,identity:hfe,kron:mfe,largerEq:vfe,leftShift:gfe,lsolve:yfe,matrixFromColumns:bfe,nthRoot:wfe,ones:xfe,qr:Cfe,resize:_fe,rightArithShift:Efe,round:Sfe,smaller:kfe,subtract:Tfe,to:Nfe,unaryPlus:Dfe,usolve:Afe,xor:Ife,add:Rfe,atan2:Mfe,bitAnd:Ofe,bitOr:Bfe,bitXor:Vfe,catalan:Pfe,compare:Lfe,compareText:Ffe,cumsum:zfe,deepEqual:jfe,diff:$fe,distance:Ufe,dot:Hfe,equalText:qfe,floor:Wfe,gcd:Gfe,hypot:Yfe,larger:Jfe,log:Zfe,lsolveAll:Qfe,matrixFromRows:ehe,min:the,mod:nhe,multiply:rhe,nthRoots:ohe,or:ahe,partitionSelect:ihe,rightLogShift:lhe,slu:she,subset:che,sum:uhe,trace:dhe,usolveAll:phe,zpk2tf:fhe,ceil:hhe,compareNatural:mhe,composition:vhe,cross:ghe,det:yhe,dotMultiply:bhe,fix:xhe,index:Che,intersect:_he,invmod:Ehe,lcm:She,log1p:khe,max:The,setCartesian:Nhe,setDistinct:Dhe,setIsSubset:Ahe,setPowerset:Ihe,smallerEq:Rhe,sort:Mhe,unequal:Ohe,and:Bhe,range:Vhe,row:Phe,setDifference:Lhe,setMultiplicity:Fhe,setSymDifference:zhe,column:$he,inv:Uhe,lup:Hhe,pinv:qhe,pow:Whe,setIntersect:Ghe,setUnion:Yhe,sqrtm:Khe,vacuumImpedance:Jhe,wienDisplacement:Zhe,atomicMass:Qhe,bohrMagneton:eme,boltzmann:tme,conductanceQuantum:nme,coulomb:rme,deuteronMass:ome,dotPow:ame,electricConstant:ime,elementaryCharge:lme,expm:sme,faraday:cme,fft:ume,gamma:dme,gravitationConstant:pme,hartreeEnergy:fme,ifft:hme,klitzing:mme,loschmidt:vme,magneticConstant:gme,molarMass:yme,molarPlanckConstant:bme,neutronMass:wme,nuclearMagneton:xme,planckCharge:Cme,planckLength:_me,planckTemperature:Eme,protonMass:Sme,quantumOfCirculation:kme,reducedPlanckConstant:Tme,rydberg:Nme,secondRadiation:Dme,speedOfLight:Ame,stefanBoltzmann:Ime,thomsonCrossSection:Rme,avogadro:Mme,bohrRadius:Ome,createUnit:Bme,divide:Vme,electronMass:Pme,factorial:Lme,firstRadiation:Fme,gravity:zme,inverseConductanceQuantum:jme,lusolve:$me,magneticFluxQuantum:Ume,molarMassC12:Hme,multinomial:qme,parse:qve,permutations:Wme,planckMass:Gme,polynomialRoot:Yme,resolve:Wve,setSize:Kme,simplifyConstant:Gve,solveODE:Xme,stirlingS2:Jme,unit:Zme,bellNumbers:Qme,compile:Yve,eigs:eve,fermiCoupling:tve,gasConstant:nve,kldivergence:rve,mean:ove,molarVolume:ave,planckConstant:ive,quantileSeq:lve,simplifyCore:Kve,variance:sve,classicalElectronRadius:cve,evaluate:Xve,median:uve,simplify:Qve,symbolicEqual:ege,corr:dve,freqz:pve,leafCount:tge,mad:fve,parser:nge,rationalize:rge,std:hve,zeta:mve,derivative:oge,norm:vve,rotationMatrix:gve,help:age,planckTime:yve,schur:bve,rotate:wve,sylvester:xve,lyap:Cve,config:w2}),h1(Eve,_ve,{filter:Jce({typed:yde}),forEach:Qce({typed:yde}),map:tue({typed:yde}),apply:Yce({isInteger:Zde,typed:yde}),or:zue({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),and:Lue({add:Rfe,concat:ife,equalScalar:jde,matrix:Ype,not:spe,typed:yde,zeros:rfe}),concat:yue({isInteger:Zde,matrix:Ype,typed:yde}),max:iue({config:w2,larger:Jfe,numeric:Jpe,typed:yde}),print:Vue({add:Rfe,matrix:Ype,typed:yde,zeros:rfe}),bitAnd:$ue({add:Rfe,concat:ife,equalScalar:jde,matrix:Ype,not:spe,typed:yde,zeros:rfe}),diff:xue({bignumber:Dpe,matrix:Ype,number:cpe,subtract:Tfe,typed:yde}),min:uue({config:w2,numeric:Jpe,smaller:kfe,typed:yde}),subset:vue({add:Rfe,matrix:Ype,typed:yde,zeros:rfe}),bitOr:Hue({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),cumsum:Aue({add:Rfe,typed:yde,unaryPlus:Dfe}),index:eue({Index:Xfe,getMatrixDataType:Kde}),sum:Sue({add:Rfe,config:w2,numeric:Jpe,typed:yde}),range:pue({bignumber:Dpe,matrix:Ype,add:Rfe,config:w2,isPositive:epe,larger:Jfe,largerEq:vfe,smaller:kfe,smallerEq:Rhe,typed:yde}),row:hue({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),column:Kce({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),mean:sue({add:Rfe,divide:Vme,typed:yde}),quantileSeq:Tue({add:Rfe,bignumber:Dpe,compare:Lfe,divide:Vme,isInteger:Zde,larger:Jfe,multiply:rhe,partitionSelect:ihe,smaller:kfe,smallerEq:Rhe,subtract:Tfe,typed:yde}),variance:Mue({add:Rfe,apply:Tpe,divide:Vme,isNaN:Mpe,multiply:rhe,subtract:Tfe,typed:yde}),std:_ue({map:ipe,sqrt:Fpe,typed:yde,variance:sve})}),h1(Sve,{BigNumber:que,Complex:Wue,Fraction:Xue,Matrix:tde,Node:kve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,Range:ade,RelationalNode:Ave,ResultSet:ide,ArrayNode:Ive,BlockNode:Rve,ConditionalNode:Mve,ConstantNode:Ove,DenseMatrix:pde,RangeNode:Bve,Chain:Pve,FunctionAssignmentNode:Lve,SparseMatrix:ype,IndexNode:zve,ImmutableDenseMatrix:Kfe,Index:Xfe,AccessorNode:jve,AssignmentNode:$ve,FibonacciHeap:whe,Spa:jhe,Unit:Xhe,SymbolNode:Uve,FunctionNode:Hve,Help:Jve,Parser:Zve}),Pve.createProxy(_ve);const ige=n.ref(2);function lge(e,t){const n=t.filter(pge);let r=Dpe(n[0]);for(let o=1;o<n.length;o++){const t=n[o];r=r[e](t)}return Number.parseFloat(String(r)).toFixed(ige.value??0)}function sge(e,t){const n=t.filter(pge);let r=Dpe(n[0]);for(let o=1;o<n.length;o++){const t=n[o];r=r[e](t)}return Number.parseFloat(String(r))}function cge(e,t=-1,n=14){const r=-1==t?ige.value:t;let o=e||0;"number"!=typeof o&&(o=Xve(o)),o=Yde(o,{precision:n});let a=o?Number(o):0,i=JSON.stringify(a);const l=i.indexOf(".");if(l>=0){i=i.substring(l+1);const e=i.length;if(e>8){a+=Number("0."+new Array(e-1).join("0")+"1")}if(e>t){if("5"===i.slice(t,t+1)){a+=Number("0."+new Array(t+1).join("0")+"1")}}}return Number.parseFloat(String(o)).toFixed(r)}function uge(e){return e.filter((e=>dge(e)))}function dge(e){return"number"==typeof e&&![NaN,1/0,-1/0].includes(e)}function pge(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function fge(e){let t,n,r,o=new Array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖"),a=new Array("","拾","佰","仟"),i=new Array("","万","亿","兆"),l=new Array("角","分","毫","厘"),s="";if(""===e||null===e)return"";if("string"==typeof e&&(e=parseFloat(e)),e>=1e15)return"";if(0==e)return s=o[0]+"元整",s;if(-1==(e=e.toString()).indexOf(".")?(t=e,n=""):(r=e.split("."),t=r[0],n=r[1].substr(0,4)),parseInt(t,10)>0){let e=0,n=t.length;for(let r=0;r<n;r++){let l=t.substr(r,1),c=n-r-1,u=c/4,d=c%4;"0"==l?e++:(e>0&&(s+=o[0]),e=0,s+=o[parseInt(l)]+a[d]),0==d&&e<4&&(s+=i[u])}s+="元"}if(""!=n){let e=n.length;for(let t=0;t<e;t++){let e=n.substr(t,1);"0"!=e&&(s+=o[Number(e)]+l[t])}}return""==s?s+=o[0]+"元整":""==n&&(s+="整"),s}function hge(e){const t=new URLSearchParams(e||location.search.substring(1));return[...t.keys()].reduce(((e,n)=>{if(""==n)return e;let r=t.get(n);return/^\d+$/.test(r)&&r.length<17&&(r=Number(r)),"true"!=r&&"false"!=r||(r="true"==r),e[n]=r,e}),{})}function mge(e,t={}){if(U.isEmpty(t))return e;const[n,r=""]=e.split("?"),o=new URLSearchParams(r);return Object.keys(t).forEach((e=>{o.set(e,t[e])})),`${n}?${o.toString()}`}let vge=n.ref(),gge=n.ref(),yge=n.ref(),bge=n.ref();const wge="configkey",xge=e=>{if(!e)return e;if(1==gge.value)return U.cloneDeep(e);try{return pG.AES.encrypt(JSON.stringify(e),wge).toString()}catch(HT){return e}},Cge=e=>{if(!e)return e;if(1==gge.value)return e;try{const t=pG.AES.decrypt(e,wge);return JSON.parse(t.toString(pG.enc.Utf8))}catch(HT){return e}},_ge={encrypt:xge,decrypt:Cge},Ege={setKey:e=>`${vge.value?vge.value:"hs-admin-ui"}:${e}`,set(e,t){window.localStorage.setItem(Ege.setKey(e),JSON.stringify(t))},get(e){let t=window.localStorage.getItem(Ege.setKey(e));return t?JSON.parse(t):null},remove(e){window.localStorage.removeItem(Ege.setKey(e))},clear(){window.localStorage.clear()}},Sge={set(e,t){if("token"===e)return xq.set(e,t);window.sessionStorage.setItem(Ege.setKey(e),JSON.stringify(t))},get(e){if("token"===e)return xq.get(e);let t=window.sessionStorage.getItem(Ege.setKey(e));return t?JSON.parse(t):null},remove(e){if("token"===e)return xq.remove(e);window.sessionStorage.removeItem(Ege.setKey(e))},clear(){xq.remove("token"),window.sessionStorage.clear()}};const kge=new class{constructor(){t(this,"store"),this.store=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:"systemConfig_00000_001",storeName:"systemConfig",version:1,description:"系统信息"})}setKey(e){return`${vge.value?vge.value:"hs-admin-ui"}:${e}`}set(e,t){return this.store.setItem(this.setKey(e),xge(t))}get(e){return this.store.getItem(this.setKey(e)).then((e=>Cge(e)))}async getToken(){return this.getUserByProject().then((e=>null==e?void 0:e.access_token))}getUserByProject(e){var t;const n=vge.value?vge.value:"hs-admin-ui",r=e||(null==(t=hge())?void 0:t.project),o=r?`hs-${r}-web`:n;return this.store.getItem(`${o}:userInfo`).then((e=>Cge(e)))}remove(e){return this.store.removeItem(this.setKey(e))}clear(){return this.store.clear()}drop(e){return this.store.dropInstance({name:e})}};function Tge({mid:e,id:t,uid:n},r=""){const o=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((async a=>{const i=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${n||a.id}_${e}`,version:1,description:"配置系统"}),l=r?`${o}:${r}`:`${o}:${t}`,s=await i.getItem(l);return s?Cge(s):null}))}function Nge({mid:e,id:t,uid:n},r,o=""){const a=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((i=>{const l=`${n||i.id}_${e}`,s=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:l,version:1,description:"配置系统"}),c=o?`${a}:${o}`:`${a}:${t}`;return s.setItem(c,xge(r))}))}function Dge(e,t){return kge.get("userInfo").then((n=>Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||n.id}_${e}`,version:1,description:"配置系统"}).clear()))}function Age({table_id:e,uid:t}){const n=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((async r=>{const o=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||r.id}`,version:1,description:"配置系统列宽属性"}),a=`${n}:${e}`,i=await o.getItem(a);return i?Cge(i):null}))}function Ige({table_id:e,uid:t},n){const r=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((o=>{const a=`${t||o.id}`,i=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:a,version:1,description:"配置系统列宽属性"}),l=`${r}:${e}`;return i.setItem(l,xge(n))}))}function Rge(e=["systemConfig_00000_001","emscripten_filesystem"]){return indexedDB.databases().then((function(t){return Promise.all(t.filter((t=>!e.includes(t.name))).map((e=>kge.drop(e.name)))).then((()=>{zj.success("清除缓存成功!")}))}))}async function Mge(e){const t=await kge.get("system_params")||{},n=e.find((e=>"sys_input_8"===e.param_code));n&&(ige.value=Number(n.param_value),t.decimal_digits=Number(n.param_value));const r=e.find((e=>"sys_input_10"===e.param_code));r&&(t._sys_pageSize=Number(r.param_value),t._sys_pageSize_s=JSON.parse(r.json_data||"[]").map((e=>Number(e.value)))),await kge.set("system_params",t)}function Oge(e,t){const n=e||hge().mid;return n?kge.get("userInfo").then((async e=>{const r=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||e.id}_${n}`,version:1,description:"配置系统"}),o=vge.value?vge.value:"hs-admin-ui",a=await r.getItem(`${o}:auth`);if(!a)return{};return Cge(a).dict_functions.map((e=>{const t=JSON.parse(e.json_data||"[]").filter((e=>["true",!0].includes(e.show))).map((e=>({...e,name:e.dict_child_name,code:e.dict_child_code}))).sort(((e,t)=>e.sort-t.sort));return{code:e.code,json_data:t}})).reduce(((e,t)=>(e[t.code]=t.json_data,e)),{})})):(console.error("未获取到mid,请检查url中是否存在mid参数"),Promise.resolve({}))}function Bge(e,t){const n=e||hge().mid;return n?kge.get("userInfo").then((async e=>{const r=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||e.id}_${n}`,version:1,description:"配置系统"}),o=vge.value?vge.value:"hs-admin-ui",a=await r.getItem(`${o}:auth`);if(!a)return{};return Cge(a).field_functions})):(console.error("未获取到mid,请检查url中是否存在mid参数"),Promise.resolve({}))}const Vge=r.createPinia(),Pge=r.defineStore("requestOldRoutes",{state:()=>({requestOldRoutes:[]}),actions:{async setRequestOldRoutes(e){this.requestOldRoutes=e}}}),Lge={start:()=>{const e=document.body,t=document.createElement("div");t.setAttribute("class","loading-next");t.innerHTML='\n\t\t\t<div class="loading-next-box">\n\t\t\t\t<div class="loading-next-box-warp">\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t',e.insertBefore(t,e.childNodes[0]),window.nextLoading=!0},done:(e=0)=>{n.nextTick((()=>{setTimeout((()=>{var e;window.nextLoading=!1;const t=document.querySelector(".loading-next");null==(e=null==t?void 0:t.parentNode)||e.removeChild(t)}),e)}))}},Fge=[{path:"/",name:"/",component:()=>Promise.resolve().then((()=>require("./index-DgY6992I.js"))),redirect:"/home",meta:{isKeepAlive:!0},children:[]}],zge=[{path:"/:path(.*)*",name:"notFound",component:()=>Promise.resolve().then((()=>require("./404-BcDKlaGx.js"))),meta:{title:"找不到此页面",isHide:!0}},{path:"/401",name:"noPower",component:()=>Promise.resolve().then((()=>require("./401-BJUEr3zO.js"))),meta:{title:"没有权限",isHide:!0}}],jge=[{path:"/login",name:"login",component:()=>Promise.resolve().then((()=>require("./index-D8ri1xcm.js"))),meta:{title:"登录"}}];var $ge={exports:{}};
67
+ */function pQ(e){return(pQ="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)}var fQ={name:"Safari",match:function(e){return e.indexOf("Safari")>-1},version:function(e){var t;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},hQ={name:"Chrome",match:function(e){return e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1},version:function(e){var t,n;return(null===(t=e.match(/Chrome\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/CriOS\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},mQ={name:"Edge",match:function(e){return e.indexOf("Edge")>-1||e.indexOf("Edg/")>-1||e.indexOf("EdgA")>-1||e.indexOf("EdgiOS")>-1},version:function(e){var t,n,r,o;return(null===(t=e.match(/Edge\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/Edg\/([\d.]+)/))||void 0===n?void 0:n[1])||(null===(r=e.match(/EdgA\/([\d.]+)/))||void 0===r?void 0:r[1])||(null===(o=e.match(/EdgiOS\/([\d.]+)/))||void 0===o?void 0:o[1])||""}},vQ={name:"IE",match:function(e){return e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1},version:function(e){var t,n;return(null===(t=e.match(/MSIE ([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/rv:([\d.]+)/))||void 0===n?void 0:n[1])||""}},gQ={name:"Firefox",match:function(e){return e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1},version:function(e){var t,n;return(null===(t=e.match(/Firefox\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/FxiOS\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},yQ={name:"Firefox Focus",match:function(e){return e.indexOf("Focus")>-1},version:function(e){var t;return(null===(t=e.match(/Focus\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},bQ={name:"Chromium",match:function(e){return e.indexOf("Chromium")>-1},version:function(e){var t;return(null===(t=e.match(/Chromium\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},wQ={name:"Opera",match:function(e){return e.indexOf("Opera")>-1||e.indexOf("OPR")>-1},version:function(e){var t,n;return(null===(t=e.match(/Opera\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/OPR\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},xQ={name:"Vivaldi",match:function(e){return e.indexOf("Vivaldi")>-1},version:function(e){var t;return(null===(t=e.match(/Vivaldi\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},CQ={name:"Yandex",match:function(e){return e.indexOf("YaBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/YaBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},_Q={};"undefined"!=typeof globalThis?_Q=globalThis:"undefined"!=typeof self?_Q=self:"undefined"!=typeof window?_Q=window:"undefined"!=typeof global&&(_Q=global);var EQ=_Q,SQ={name:"Brave",match:function(e){var t;return!(null==EQ||null===(t=EQ.navigator)||void 0===t||!t.brave)},version:function(e){var t;return(null===(t=e.match(/Chrome\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},kQ={name:"Arora",match:function(e){return e.indexOf("Arora")>-1},version:function(e){var t;return(null===(t=e.match(/Arora\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},TQ={name:"Lunascape",match:function(e){return e.indexOf("Lunascape")>-1},version:function(e){var t;return(null===(t=e.match(/Lunascape[\/\s]([\d.]+)/))||void 0===t?void 0:t[1])||""}},NQ={name:"QupZilla",match:function(e){return e.indexOf("QupZilla")>-1},version:function(e){var t;return(null===(t=e.match(/QupZilla[\/\s]([\d.]+)/))||void 0===t?void 0:t[1])||""}},DQ={name:"Coc Coc",match:function(e){return e.indexOf("coc_coc_browser")>-1},version:function(e){var t;return(null===(t=e.match(/coc_coc_browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},AQ={name:"Kindle",match:function(e){return e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1},version:function(e){var t;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},IQ={name:"Iceweasel",match:function(e){return e.indexOf("Iceweasel")>-1},version:function(e){var t;return(null===(t=e.match(/Iceweasel\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},RQ={name:"Konqueror",match:function(e){return e.indexOf("Konqueror")>-1},version:function(e){var t;return(null===(t=e.match(/Konqueror\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},MQ={name:"Iceape",match:function(e){return e.indexOf("Iceape")>-1},version:function(e){var t;return(null===(t=e.match(/Iceape\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},OQ={name:"SeaMonkey",match:function(e){return e.indexOf("SeaMonkey")>-1},version:function(e){var t;return(null===(t=e.match(/SeaMonkey\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},BQ={name:"Epiphany",match:function(e){return e.indexOf("Epiphany")>-1},version:function(e){var t;return(null===(t=e.match(/Epiphany\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},VQ={name:"Huawei",match:function(e){return e.indexOf("HuaweiBrowser")>-1||e.indexOf("HUAWEI")>-1||e.indexOf("HONOR")>-1||e.indexOf("HBPC/")>-1},version:function(e){var t,n,r;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/HuaweiBrowser\/([\d.]+)/))||void 0===n?void 0:n[1])||(null===(r=e.match(/HBPC\/([\d.]+)/))||void 0===r?void 0:r[1])||""}},PQ={name:"OPPO",match:function(e){return e.indexOf("HeyTapBrowser")>-1||e.indexOf("OPPO")>-1},version:function(e){var t;return(null===(t=e.match(/HeyTapBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},LQ={name:"Vivo",match:function(e){return e.indexOf("VivoBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/VivoBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},FQ={name:"Xiaomi",match:function(e){return e.indexOf("MiuiBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/MiuiBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},zQ={name:"Meizu",match:function(e){return e.indexOf("MZBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/MZBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},jQ={name:"Samsung",match:function(e){return e.indexOf("SamsungBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/SamsungBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}};function $Q(e,t){var n,r=null==EQ||null===(n=EQ.navigator)||void 0===n?void 0:n.mimeTypes;for(var o in r)if(r[o][e]&&r[o][e]==t)return r[o];return null}var UQ={name:"360",match:function(e){var t=!1;if(null!=EQ&&EQ.chrome){var n=e.replace(/^.*Chrome\/([\d]+).*$/,"$1");$Q("type","application/360softmgrplugin")||$Q("type","application/mozilla-npqihooquicklogin")||n>36&&null!=EQ&&EQ.showModalDialog?t=!0:n>45&&!(t=$Q("type","application/vnd.chromium.remoting-viewer"))&&n>=69&&(t=$Q("type","application/hwepass2001.installepass2001")||$Q("type","application/asx"))}return e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1||t},version:function(e){var t;return(null===(t=e.match(/QihooBrowser(HD)?\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},HQ={name:"360SE",match:function(e){var t,n=!1;return UQ.match(e)&&($Q("type","application/gameplugin")||null!=EQ&&null!==(t=EQ.navigator)&&void 0!==t&&null!==(t=t.userAgentData)&&void 0!==t&&t.brands.filter((function(e){return"Not.A/Brand"==e.brand})).length)&&(n=!0),e.indexOf("360SE")>-1||n},version:function(e){return{114:"15.0",108:"14.0",86:"13.0",78:"12.0",69:"11.0",63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[parseInt(hQ.version(e))]||""}},qQ={name:"360EE",match:function(e){var t=!1;if($Q("type","application/cenroll.cenroll.version.1")||$Q("type","application/hwepass2001.installepass2001"))t=!0;else if(UQ.match(e)){var n;null!=EQ&&null!==(n=EQ.navigator)&&void 0!==n&&null!==(n=n.userAgentData)&&void 0!==n&&n.brands.filter((function(e){return"Not A(Brand"==e.brand})).length&&(t=!0)}return e.indexOf("360EE")>-1||t},version:function(e){return{119:"(X)22.0",108:"14.0",95:"(X)21.0",86:"13.0",78:"12.0",69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[parseInt(hQ.version(e))]||""}},WQ={name:"UC",match:function(e){return e.indexOf("UCBrowser")>-1||e.indexOf(" UBrowser")>-1||e.indexOf("UCWEB")>-1},version:function(e){var t;return(null===(t=e.match(/UC?Browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},GQ={name:"QQBrowser",match:function(e){return e.indexOf("QQBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/QQBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},YQ={name:"QQ",match:function(e){return e.indexOf("QQ/")>-1},version:function(e){var t;return(null===(t=e.match(/QQ\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},KQ={name:"Baidu",match:function(e){return e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1||e.indexOf("baidubrowser")>-1||e.indexOf("baiduboxapp")>-1||e.indexOf("BaiduD")>-1},version:function(e){var t,n;return(null===(t=e.match(/BIDUBrowser[\s\/]([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/baiduboxapp\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},XQ={name:"Maxthon",match:function(e){return e.indexOf("Maxthon")>-1||(null==EQ?void 0:EQ.maxthon)},version:function(e){var t;return{109:"7.0",78:"6.0"}[parseInt(hQ.version(e))]||(null===(t=e.match(/Maxthon\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},JQ={name:"Sogou",match:function(e){return e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1},version:function(e){var t,n;return{94:"12.0",80:"11.0"}[(null===(t=e.match(/Chrome\/([\d]+)/))||void 0===t?void 0:t[1])||""]||(null===(n=e.match(/SogouMobileBrowser\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},ZQ={name:"Liebao",match:function(e){return e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1||(null==EQ?void 0:EQ.liebao)},version:function(e){var t="";e.indexOf("LieBaoFast")>-1&&(t=e.replace(/LieBaoFast\/([\d.]+)/,"$1"));var n=parseInt(hQ.version(e));return t||{79:"8.0",57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""}},QQ={name:"2345Explorer",match:function(e){var t,n,r=(null==EQ?void 0:EQ.chrome)&&((null==EQ||null===(t=EQ.chrome)||void 0===t?void 0:t.adblock2345)||(null==EQ||null===(n=EQ.chrome)||void 0===n?void 0:n.common2345));return e.indexOf("2345Explorer")>-1||e.indexOf("Mb2345Browser")>-1||e.indexOf("2345chrome")>-1||r},version:function(e){var t,n;return{69:"10.0",55:"9.9"}[parseInt(hQ.version(e))]||(null===(t=e.match(/2345Explorer\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/Mb2345Browser\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},e0={name:"115Browser",match:function(e){return e.indexOf("115Browser")>-1},version:function(e){var t;return(null===(t=e.match(/115Browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},t0={name:"TheWorld",match:function(e){return e.indexOf("TheWorld")>-1},version:function(e){var t;return(null===(t=e.match(/TheWorld ([\d.]+)/))||void 0===t?void 0:t[1])||""}},n0={name:"Quark",match:function(e){return e.indexOf("Quark")>-1},version:function(e){var t;return(null===(t=e.match(/Quark\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},r0={name:"Qiyu",match:function(e){return e.indexOf("Qiyu")>-1},version:function(e){var t;return(null===(t=e.match(/Qiyu\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},o0={name:"Wechat",match:function(e){return e.indexOf("MicroMessenger")>-1},version:function(e){var t;return(null===(t=e.match(/MicroMessenger\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},a0={name:"WechatWork",match:function(e){return e.indexOf("wxwork/")>-1},version:function(e){var t;return(null===(t=e.match(/wxwork\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},i0={name:"Taobao",match:function(e){return e.indexOf("AliApp(TB")>-1},version:function(e){var t;return(null===(t=e.match(/AliApp\(TB\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},l0={name:"Alipay",match:function(e){return e.indexOf("AliApp(AP")>-1},version:function(e){var t;return(null===(t=e.match(/AliApp\(AP\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},s0={name:"Weibo",match:function(e){return e.indexOf("Weibo")>-1},version:function(e){var t;return(null===(t=e.match(/weibo__([\d.]+)/))||void 0===t?void 0:t[1])||""}},c0={name:"Douban",match:function(e){return e.indexOf("com.douban.frodo")>-1},version:function(e){var t;return(null===(t=e.match(/com.douban.frodo\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},u0={name:"Suning",match:function(e){return e.indexOf("SNEBUY-APP")>-1},version:function(e){var t;return(null===(t=e.match(/SNEBUY-APP([\d.]+)/))||void 0===t?void 0:t[1])||""}},d0={name:"iQIYI",match:function(e){return e.indexOf("IqiyiApp")>-1},version:function(e){var t;return(null===(t=e.match(/IqiyiVersion\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},p0={name:"DingTalk",match:function(e){return e.indexOf("DingTalk")>-1},version:function(e){var t;return(null===(t=e.match(/DingTalk\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},f0={name:"Douyin",match:function(e){return e.indexOf("aweme")>-1},version:function(e){var t;return(null===(t=e.match(/app_version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},h0={name:"Googlebot",match:function(e){return e.indexOf("Googlebot")>-1},version:function(e){var t;return(null===(t=e.match(/Googlebot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},m0={name:"Baiduspider",match:function(e){return e.indexOf("Baiduspider")>-1},version:function(e){var t;return(null===(t=e.match(/Baiduspider(-render)?\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},v0={name:"Sogouspider",match:function(e){return e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1},version:function(e){var t;return(null===(t=e.match(/Sogou (\S+) Spider\/([\d.]+)/i))||void 0===t?void 0:t[1])||""}},g0={name:"Bingbot",match:function(e){return e.indexOf("bingbot")>-1},version:function(e){var t;return(null===(t=e.match(/bingbot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},y0={name:"360Spider",match:function(e){return e.indexOf("360Spider")>-1||e.indexOf("HaosouSpider")>-1},version:function(e){return""}},b0={name:"Bytespider",match:function(e){return e.indexOf("Bytespider")>-1},version:function(e){return""}},w0={name:"YisouSpider",match:function(e){return e.indexOf("YisouSpider")>-1},version:function(e){var t;return(null===(t=e.match(/YisouSpider\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},x0={name:"YodaoBot",match:function(e){return e.indexOf("YodaoBot")>-1},version:function(e){var t;return(null===(t=e.match(/YodaoBot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},C0={name:"YandexBot",match:function(e){return e.indexOf("YandexBot")>-1},version:function(e){var t;return(null===(t=e.match(/YandexBot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}};function _0(e,t){var n,r=e.userAgent;e.browser="",e.browserVersion="",[fQ,hQ,mQ,vQ,gQ,yQ,bQ,wQ,xQ,CQ,SQ,kQ,TQ,NQ,DQ,AQ,IQ,RQ,MQ,OQ,BQ,VQ,PQ,LQ,FQ,zQ,jQ,UQ,qQ,HQ,WQ,GQ,YQ,KQ,XQ,JQ,ZQ,QQ,e0,t0,n0,r0,o0,a0,i0,l0,s0,c0,u0,d0,p0,f0,h0,m0,v0,g0,y0,b0,w0,x0,C0].forEach((function(n){n.match(r)&&(e.browser=n.name,e.browserVersion=n.version(r,t))})),"Chrome"==e.browser&&r.match(/\S+Browser/)&&(e.browser=r.match(/\S+Browser/)[0],e.browserVersion=(null===(n=r.replace(/^.*Browser\/([\d.]+).*$/))||void 0===n?void 0:n[1])||"")}var E0={name:"Mobile",match:function(e){return e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1}},S0={name:"Tablet",match:function(e){var t=(null==EQ?void 0:EQ.navigator)||{};return e.indexOf("Tablet")>-1||e.indexOf("Pad")>-1||e.indexOf("Nexus 7")>-1||"MacIntel"===t.platform&&t.maxTouchPoints>1}};function k0(e){e.device="Desktop",[E0,S0].forEach((function(t){t.match(e.userAgent)&&(e.device=t.name)}))}var T0={name:"WebKit",match:function(e){return e.indexOf("AppleWebKit")>-1}},N0={name:"Trident",match:function(e){return e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1}},D0={name:"Gecko",match:function(e){return e.indexOf("Gecko/")>-1}},A0={name:"Presto",match:function(e){return e.indexOf("Presto")>-1}},I0={name:"KHTML",match:function(e){return e.indexOf("KHTML/")>-1}};function R0(e){e.engine="",[T0,N0,D0,A0,I0].forEach((function(t){t.match(e.userAgent)&&(e.engine=t.name)})),"Edge"==e.browser?e.engine=parseInt(e.browserVersion)>75?"Blink":"EdgeHTML":(hQ.match(e.userAgent)&&"WebKit"==e.engine&&parseInt(hQ.version(e.userAgent))>27||"Opera"==e.browser&&parseInt(e.browserVersion)>12||"Yandex"==e.browser)&&(e.engine="Blink")}var M0={name:"Windows",match:function(e){return e.indexOf("Windows")>-1},version:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(null===(t=e.match(/^Mozilla\/\d.0 \(Windows NT ([\d.]+)[;)].*$/))||void 0===t?void 0:t[1])||"",o={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return n?new Promise((function(e){var t;null!=EQ&&null!==(t=EQ.navigator)&&void 0!==t&&t.userAgentData?EQ.navigator.userAgentData.getHighEntropyValues(["platformVersion"]).then((function(t){var n="";"Windows"===navigator.userAgentData.platform&&(n=parseInt(t.platformVersion.split(".")[0])>=13?"11":"10"),e(n)})):e(o[r]||r)})):o[r]||r}},O0={name:"Linux",match:function(e){return e.indexOf("Linux")>-1||e.indexOf("X11")>-1},version:function(e){return""}},B0={name:"macOS",match:function(e){return e.indexOf("Macintosh")>-1},version:function(e){var t;return(null===(t=e.match(/Mac OS X -?([\d_]+)/))||void 0===t?void 0:t[1].replace(/_/g,"."))||""}},V0={name:"Android",match:function(e){return e.indexOf("Android")>-1||e.indexOf("Adr")>-1},version:function(e){var t;return(null===(t=e.match(/Android ([\d.]+);/))||void 0===t?void 0:t[1])||""}},P0={name:"HarmonyOS",match:function(e){return e.indexOf("HarmonyOS")>-1},version:function(e){var t,n=+(null===(t=e.match(/HMSCore (\d+.\d+)/))||void 0===t?void 0:t[1])||0;return n>=6.1?"4.0":n>=6?"3.0":n>=5?"2.0":n>=4?"1.0":""}},L0={name:"Ubuntu",match:function(e){return e.indexOf("Ubuntu")>-1},version:function(e){return""}},F0={name:"FreeBSD",match:function(e){return e.indexOf("FreeBSD")>-1},version:function(e){return""}},z0={name:"Debian",match:function(e){return e.indexOf("Debian")>-1},version:function(e){var t;return(null===(t=e.match(/Debian\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},j0={name:"iOS",match:function(e){return e.indexOf("like Mac OS X")>-1},version:function(e){var t;return(null===(t=e.match(/OS ([\d_]+) like/))||void 0===t?void 0:t[1].replace(/_/g,"."))||""}},$0={name:"Windows Phone",match:function(e){return e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1},version:function(e){var t;return(null===(t=e.match(/Windows Phone( OS)? ([\d.]+);/))||void 0===t?void 0:t[2])||""}},U0={name:"BlackBerry",match:function(e){return e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1},version:function(e){return""}},H0={name:"MeeGo",match:function(e){return e.indexOf("MeeGo")>-1},version:function(e){return""}},q0={name:"Symbian",match:function(e){return e.indexOf("Symbian")>-1},version:function(e){return""}},W0={name:"Chrome OS",match:function(e){return e.indexOf("CrOS")>-1},version:function(e){var t,n;return(null===(t=e.match(/MSIE ([\d.]+)/))||void 0===t?void 0:t[1])||(null===(n=e.match(/rv:([\d.]+)/))||void 0===n?void 0:n[1])||""}},G0={name:"WebOS",match:function(e){return e.indexOf("hpwOS")>-1},version:function(e){var t;return(null===(t=e.match(/hpwOS\/([\d.]+);/))||void 0===t?void 0:t[1])||""}};function Y0(e,t){var n,r=e.userAgent;e.system="",e.systemVersion="",[M0,O0,B0,V0,P0,L0,F0,z0,j0,$0,U0,H0,q0,W0,G0].forEach((function(n){n.match(r)&&(e.system=n.name,e.systemVersion=n.version(r,t))})),e.platform="",r.match(/(Win64|x64|WOW64|x86_64)/i)?e.platform="Win64":r.match(/(Win32|x86|WOW32)/i)?e.platform="Win32":r.match(/aarch64|arm64/)?e.platform="ARM64":r.match(/arm32/)?e.platform="ARM32":null!=EQ&&null!==(n=EQ.navigator)&&void 0!==n&&n.platform&&(e.platform=EQ.navigator.platform),e.architecture="";var o,a=r+"|"+e.platform;a.match(/armv\d+/i)||a.match(/aarch64/)?e.architecture="arm":a.match(/loongarch64/)?e.architecture="loongarch":e.architecture="x86",e.bitness=r.match(/Win64|x64|WOW64|x86_64|aarch64|arm64|loongarch64/i)?64:32,t&&null!=EQ&&null!==(o=EQ.navigator)&&void 0!==o&&o.userAgentData&&(e.architecture=navigator.userAgentData.getHighEntropyValues(["architecture"]).then((function(e){return e.architecture})),e.bitness=navigator.userAgentData.getHighEntropyValues(["bitness"]).then((function(e){return+e.bitness})))}function K0(e){if(e.gpu="",e.gpuModel="",null!=EQ&&EQ.document){var t,n,r=EQ.document.createElement("canvas").getContext("experimental-webgl"),o=r.getExtension("WEBGL_debug_renderer_info"),a=r.getParameter(o.UNMASKED_RENDERER_WEBGL);e.gpu=(null===(t=a.match(/ANGLE \((.+?),/))||void 0===t?void 0:t[1])||"",e.gpuModel=(null===(n=a.match(/, (.+?) (\(|vs_)/))||void 0===n?void 0:n[1])||""}}function X0(e){e.language=function(e,t){var n=(null==EQ||null===(e=EQ.navigator)||void 0===e?void 0:e.browserLanguage)||(null==EQ||null===(t=EQ.navigator)||void 0===t?void 0:t.language);if("string"!=typeof n)return"Unknown language";var r=n.split("-");return r[1]&&(r[1]=r[1].toUpperCase()),r.join("_")}()}function J0(e){var t,n,r;e.network=(n="unknown",(r=null==EQ||null===(t=EQ.navigator)||void 0===t?void 0:t.connection)&&("2"!=(n=r.type||r.effectiveType)&&"unknown"!=n||(n="wifi")),n)}function Z0(e){e.isWebview=e.userAgent.indexOf("; wv)")>-1,e.isRobot=["Googlebot","Baiduspider","Sogouspider","Bingbot","360Spider","Bytespider","YandexBot"].includes(e.browser)}var Q0=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={};return r.userAgent=e||(null==EQ||null===(t=EQ.navigator)||void 0===t?void 0:t.userAgent)||"",[_0,k0,R0,Y0,K0,X0,J0,Z0].forEach((function(e){return e(r,n)})),r};function e1(e){var t=Q0(e);for(var n in t)"object"==pQ(t[n])&&(t[n]="");return t}e1.getInfo=function(e){var t=Q0(e,!0),n=Object.keys(t),r=Object.values(t).map((function(e){return"object"==pQ(e)?e:Promise.resolve(e)}));return Promise.all(r).then((function(e){var t={};return e.forEach((function(e,r){t[n[r]]=e})),t}))};const t1=function(){const e=e1();return{ip:"",ipv6:"",loc_ip:"",mac:"",browser:e.browser,device:e.device,os:e.system+" "+e.systemVersion,version:e.browserVersion}}(),n1=e=>{if(e&&"[object Object]"===Object.prototype.toString.call(e)){const t=Object.assign({},e);for(let e in t)"undefined"===t[e]||"null"===t[e]||null===t[e]||void 0===t[e]?delete t[e]:"string"==typeof t[e]&&(t[e]=t[e].trim());return t}return e},r1=[[function(e){var t,n;return e&&e.params&&(e.params=n1(e.params),U.get(e,"params.menu_id")||U.set(e,"params.menu_id",null==(t=hge())?void 0:t.mid)),e&&e.data&&(e.data=n1(e.data),U.get(e,"data.menu_id")||U.set(e,"data.menu_id",null==(n=hge())?void 0:n.mid)),e},function(e){throw e}],dQ,[async e=>{var t,n,r,o;const a=await kge.getToken();return a&&!(null==(t=null==e?void 0:e.headers)?void 0:t.Authorization)&&U.set(e,"headers.Authorization",`Bearer ${a}`),"get"!==e.method&&U.set(e,"data.other_log_info",{page_name:null==(n=yge.value)?void 0:n.value.meta.title,action_name:null==(o=null==(r=null==e?void 0:e.data)?void 0:r.other_log_info)?void 0:o.title,...t1}),e},e=>{throw e}]];let o1=!1;const a1=[[async function(e){const{data:t}=e;if(t instanceof Blob)return t;if("object"==typeof t&&!Reflect.has(t,"code"))return t;switch(t.code){case 1:return t;case 401:case 4001:zj.error("你已被登出,请重新登录"),o1||(o1=!0,await kge.remove("userInfo"),window.location.href="/",setTimeout((()=>{o1=!1}),1e3));break;case 2e3:o1||(o1=!0,gge.value?Kj.alert(t.msg,"提示",{confirmButtonText:"确定",callback:async()=>{o1=!1,await kge.remove("userInfo"),window.location.href="/"}}):(zj.error(t.msg),await kge.remove("userInfo"),window.location.href="/"));break;default:return t.msg&&!o1&&(o1=!0,zj.error(t.msg),setTimeout((()=>{o1=!1}),1e3)),Promise.reject(t)}},function(e){return-1!=e.message.indexOf("timeout")?zj.error("网络超时"):"Network Error"==e.message?zj.error("网络连接错误"):"操作太频繁,请稍后再试"==e.message?zj.warning("操作太频繁,请稍后再试"):e.response.data?zj.error(e.response.statusText):zj.error("接口路径找不到"),Promise.reject(e)}]],i1=qY.CancelToken,l1=[],s1=e=>{for(const t in l1){const n=+t,r=l1[t];r.url===e.url&&r.method===e.method&&JSON.stringify(r.params)===JSON.stringify(e.params)&&JSON.stringify(r.data)===JSON.stringify(e.data)&&(r.cancel("操作太频繁,请稍后再试"),l1.splice(n,1))}};const c1=qY.create({baseURL:void 0,timeout:6e4,paramsSerializer:{serialize:e=>uQ.stringify(e,{allowDots:!0})}});var u1;(u1=c1).interceptors.request.use((e=>(s1(e),e.cancelToken=new i1((t=>{-1!==e.url.indexOf("get_menu_perm_version")&&l1.push({url:e.url,method:e.method,params:e.params,data:e.data,cancel:t})})),e)),(e=>Promise.reject(e))),u1.interceptors.response.use((e=>(s1(e.config),Promise.resolve(e))),(e=>Promise.reject(e))),r1.forEach((e=>{c1.interceptors.request.use(...e)})),a1.forEach((e=>{c1.interceptors.response.use(...e)}));const d1=c1.interceptors,p1=c1.request,f1=(e,t={},n="get",r={})=>kge.get("userInfo").then((o=>{const a={url:`/${o.project_code}-web${e}`,method:n,...r},{title:i="",...l}=t;return"get"==n?a.params=Object.assign({other_log_info:{title:i}},l):a.data=Object.assign({other_log_info:{title:i}},l),c1.request(a)}));function h1(){return h1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h1.apply(null,arguments)}var m1={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function v1(e,t){if(y1(e,t))return e[t];if("function"==typeof e[t]&&b1(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function g1(e,t,n){if(y1(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function y1(e,t){return!(!function(e){return"object"==typeof e&&e&&e.constructor===Object}(e)&&!Array.isArray(e))&&(!!b2(w1,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function b1(e,t){return null!=e&&"function"==typeof e[t]&&(!(b2(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!b2(x1,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}var w1={length:!0,name:!0},x1={toString:!0,valueOf:!0,toLocaleString:!0};class C1{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 v1(this.wrappedObject,e)}set(e,t){return g1(this.wrappedObject,e,t),this}has(e){return y1(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return E1(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){y1(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 _1{constructor(e,t,n){this.a=e,this.b=t,this.bKeys=n,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 E1(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 E1(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function S1(){return new Map}function k1(e){if(!e)return S1();if(Y1(e))return e;if(G1(e))return new C1(e);throw new Error("createMap can create maps from objects or Maps")}function T1(e){return"number"==typeof e}function N1(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 D1(e){return"bigint"==typeof e}function A1(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function I1(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function R1(e){return e&&!0===e.constructor.prototype.isUnit||!1}function M1(e){return"string"==typeof e}var O1=Array.isArray;function B1(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function V1(e){return Array.isArray(e)||B1(e)}function P1(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function L1(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function F1(e){return e&&!0===e.constructor.prototype.isRange||!1}function z1(e){return e&&!0===e.constructor.prototype.isIndex||!1}function j1(e){return"boolean"==typeof e}function $1(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function U1(e){return e&&!0===e.constructor.prototype.isHelp||!1}function H1(e){return"function"==typeof e}function q1(e){return e instanceof Date}function W1(e){return e instanceof RegExp}function G1(e){return!(!e||"object"!=typeof e||e.constructor!==Object||A1(e)||I1(e))}function Y1(e){return!!e&&(e instanceof Map||e instanceof C1||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function K1(e){return null===e}function X1(e){return void 0===e}function J1(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function Z1(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function Q1(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function e2(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function t2(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function n2(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function r2(e){return n2(e)||c2(e)&&1===e.args.length&&n2(e.args[0])&&"-+~".includes(e.op)}function o2(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function a2(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function i2(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function l2(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function s2(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function c2(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function u2(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function d2(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function p2(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function f2(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function h2(e){return e&&!0===e.constructor.prototype.isChain||!1}function m2(e){var t=typeof e;return"object"===t?null===e?"null":N1(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function v2(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 v2(e)}));if(e instanceof Date)return new Date(e.valueOf());if(N1(e))return e;if(G1(e))return function(e,t){var n={};for(var r in e)b2(e,r)&&(n[r]=t(e[r]));return n}(e,v2);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function g2(e,t){for(var n in t)b2(t,n)&&(e[n]=t[n]);return e}function y2(e,t){var n,r,o;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,o=e.length;r<o;r++)if(!y2(e[r],t[r]))return!1;return!0}if("function"==typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!y2(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}return e===t}function b2(e,t){return e&&Object.hasOwnProperty.call(e,t)}var w2=function(e){if(e)throw new 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(m1)};function x2(){return!0}function C2(){return!1}function _2(){}h1(w2,m1,{MATRIX_OPTIONS:["Matrix","Array"],NUMBER_OPTIONS:["number","BigNumber","Fraction"]});const E2="Argument is not a typed-function.";const S2=function e(){function t(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const n=[{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:t},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],r={name:"any",test:x2,isAny:!0};let o,a,i=0,l={createCount:0};function s(e){const t=o.get(e);if(t)return t;let n='Unknown type "'+e+'"';const r=e.toLowerCase();let i;for(i of a)if(i.toLowerCase()===r){n+='. Did you mean "'+i+'" ?';break}throw new TypeError(n)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const n=t?s(t).index:a.length,r=[];for(let a=0;a<e.length;++a){if(!e[a]||"string"!=typeof e[a].name||"function"!=typeof e[a].test)throw new TypeError("Object with properties {name: string, test: function} expected");const t=e[a].name;if(o.has(t))throw new TypeError('Duplicate type name "'+t+'"');r.push(t),o.set(t,{name:t,test:e[a].test,isAny:e[a].isAny,index:n+a,conversionsTo:[]})}const i=a.slice(n);a=a.slice(0,n).concat(r).concat(i);for(let l=n+r.length;l<a.length;++l)o.get(a[l]).index=l}function u(){o=new Map,a=[],i=0,c([r],!1)}function d(e){const t=a.filter((t=>{const n=o.get(t);return!n.isAny&&n.test(e)}));return t.length?t:["any"]}function p(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function f(e,t,n){if(!p(e))throw new TypeError(E2);const r=n&&n.exact,o=y(Array.isArray(t)?t.join(","):t),a=h(o);if(!r||a in e.signatures){const t=e._typedFunctionData.signatureMap.get(a);if(t)return t}const i=o.length;let l,s;if(r){let t;for(t in l=[],e.signatures)l.push(e._typedFunctionData.signatureMap.get(t))}else l=e._typedFunctionData.signatures;for(let c=0;c<i;++c){const e=o[c],t=[];let n;for(n of l){const r=C(n.params,c);if(r&&(!e.restParam||r.restParam)){if(!r.hasAny){const t=g(r);if(e.types.some((e=>!t.has(e.name))))continue}t.push(n)}}if(l=t,0===l.length)break}for(s of l)if(s.params.length<=i)return s;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+h(o,", ")+"))")}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function m(e){const t=0===e.indexOf("..."),n=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>s(e.trim())));let r=!1,o=t?"...":"";return{types:n.map((function(e){return r=e.isAny||r,o+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:o.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function v(e){const t=e.types.map((e=>e.name)),n=function(e){if(0===e.length)return[];const t=e.map(s);e.length>1&&t.sort(((e,t)=>e.index-t.index));let n=t[0].conversionsTo;if(1===e.length)return n;n=n.concat([]);const r=new Set(e);for(let o=1;o<t.length;++o){let e;for(e of t[o].conversionsTo)r.has(e.from)||(n.push(e),r.add(e.from))}return n}(t);let r=e.hasAny,o=e.name;const a=n.map((function(e){const t=s(e.from);return r=t.isAny||r,o+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}}));return{types:e.types.concat(a),name:o,hasAny:r,hasConversion:a.length>0,restParam:e.restParam}}function g(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function y(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const n=e.trim();if(""===n)return t;const r=n.split(",");for(let o=0;o<r.length;++o){const e=m(r[o].trim());if(e.restParam&&o!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+r[o]+'": only allowed for the last parameter');if(0===e.types.length)return null;t.push(e)}return t}function b(e){const t=z(e);return!!t&&t.restParam}function w(e){if(e&&0!==e.types.length){if(1===e.types.length)return s(e.types[0].name).test;if(2===e.types.length){const t=s(e.types[0].name).test,n=s(e.types[1].name).test;return function(e){return t(e)||n(e)}}{const t=e.types.map((function(e){return s(e.name).test}));return function(e){for(let n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}}return x2}function x(e){let t,n,r;if(b(e)){t=F(e).map(w);const n=t.length,r=w(z(e)),o=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return o(e)&&e.length>=n+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=w(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=w(e[0]),r=w(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(w),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}function C(e,t){return t<e.length?e[t]:b(e)?z(e):null}function _(e,t){const n=C(e,t);return n?g(n):new Set}function E(e){return null===e.conversion||void 0===e.conversion}function S(e,t){const n=new Set;return e.forEach((e=>{const r=_(e.params,t);let o;for(o of r)n.add(o)})),n.has("any")?["any"]:Array.from(n)}function k(e,t,n){let r,o;const a=e||"unnamed";let i,l=n;for(i=0;i<t.length;i++){const e=[];if(l.forEach((n=>{const r=w(C(n.params,i));(i<n.params.length||b(n.params))&&r(t[i])&&e.push(n)})),0===e.length){if(o=S(l,i),o.length>0){const e=d(t[i]);return r=new TypeError("Unexpected type of argument in function "+a+" (expected: "+o.join(" or ")+", actual: "+e.join(" | ")+", index: "+i+")"),r.data={category:"wrongType",fn:a,index:i,actual:e,expected:o},r}}else l=e}const s=l.map((function(e){return b(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,s))return o=S(l,i),r=new TypeError("Too few arguments in function "+a+" (expected: "+o.join(" or ")+", index: "+t.length+")"),r.data={category:"tooFewArgs",fn:a,index:t.length,expected:o},r;const c=Math.max.apply(null,s);if(t.length>c)return r=new TypeError("Too many arguments in function "+a+" (expected: "+c+", actual: "+t.length+")"),r.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:c},r;const u=[];for(let p=0;p<t.length;++p)u.push(d(t[p]).join("|"));return r=new TypeError('Arguments of type "'+u.join(", ")+'" do not match any of the defined signatures of function '+a+"."),r.data={category:"mismatch",actual:u},r}function T(e){let t=a.length+1;for(let n=0;n<e.types.length;n++)E(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function N(e){let t=i+1;for(let n=0;n<e.types.length;n++)E(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function D(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;const n=T(e)-T(t);if(n<0)return-1;if(n>0)return 1;const r=N(e)-N(t);return r<0?-1:r>0?1:0}function A(e,t){const n=e.params,r=t.params,o=z(n),a=z(r),i=b(n),l=b(r);if(i&&o.hasAny){if(!l||!a.hasAny)return 1}else if(l&&a.hasAny)return-1;let s,c=0,u=0;for(s of n)s.hasAny&&++c,s.hasConversion&&++u;let d=0,p=0;for(s of r)s.hasAny&&++d,s.hasConversion&&++p;if(c!==d)return c-d;if(i&&o.hasConversion){if(!l||!a.hasConversion)return 1}else if(l&&a.hasConversion)return-1;if(u!==p)return u-p;if(i){if(!l)return 1}else if(l)return-1;const f=(n.length-r.length)*(i?-1:1);if(0!==f)return f;const h=[];let m,v=0;for(let g=0;g<n.length;++g){const e=D(n[g],r[g]);h.push(e),v+=e}if(0!==v)return v;for(m of h)if(0!==m)return m;return 0}function I(e,t){let n=t;if(e.some((e=>e.hasConversion))){const r=b(e),o=e.map(R);n=function(){const e=[],n=r?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=o[t](arguments[t]);return r&&(e[n]=arguments[n].map(o[n])),t.apply(this,e)}}let r=n;if(b(e)){const t=e.length-1;r=function(){return n.apply(this,j(arguments,0,t).concat([j(arguments,t)]))}}return r}function R(e){let t,n,r,o;const a=[],i=[];switch(e.types.forEach((function(e){e.conversion&&(a.push(s(e.conversion.from).test),i.push(e.conversion.convert))})),i.length){case 0:return function(e){return e};case 1:return t=a[0],r=i[0],function(e){return t(e)?r(e):e};case 2:return t=a[0],n=a[1],r=i[0],o=i[1],function(e){return t(e)?r(e):n(e)?o(e):e};default:return function(e){for(let t=0;t<i.length;t++)if(a[t](e))return i[t](e);return e}}}function M(e){return function e(t,n,r){if(n<t.length){const i=t[n];let l=[];if(i.restParam){const e=i.types.filter(E);e.length<i.types.length&&l.push({types:e,name:"..."+e.map((e=>e.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),l.push(i)}else l=i.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return o=l,a=function(o){return e(t,n+1,r.concat([o]))},Array.prototype.concat.apply([],o.map(a))}return[r];var o,a}(e,0,[])}function O(e,t){const n=Math.max(e.length,t.length);for(let l=0;l<n;l++){const n=_(e,l),r=_(t,l);let o,a=!1;for(o of r)if(n.has(o)){a=!0;break}if(!a)return!1}const r=e.length,o=t.length,a=b(e),i=b(t);return a?i?r===o:o>=r:i?r>=o:r===o}function B(e,t,n){const r=[];let o;for(o of e){let e=n[o];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+o+'"');if(e=t[e],"function"!=typeof e)return!1;r.push(e)}return r}function V(e,t,n){const r=function(e){return e.map((e=>q(e)?U(e.referToSelf.callback):H(e)?$(e.referTo.references,e.referTo.callback):e))}(e),o=new Array(r.length).fill(!1);let a=!0;for(;a;){a=!1;let e=!0;for(let i=0;i<r.length;++i){if(o[i])continue;const l=r[i];if(q(l))r[i]=l.referToSelf.callback(n),r[i].referToSelf=l.referToSelf,o[i]=!0,e=!1;else if(H(l)){const n=B(l.referTo.references,r,t);n?(r[i]=l.referTo.callback.apply(this,n),r[i].referTo=l.referTo,o[i]=!0,e=!1):a=!0}}if(e&&a)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return r}function P(e,t){if(l.createCount++,0===Object.keys(t).length)throw new SyntaxError("No signatures provided");l.warnAgainstDeprecatedThis&&function(e){const t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach((n=>{const r=e[n];if(t.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}(t);const n=[],r=[],o={},a=[];let i;for(i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const e=y(i);if(!e)continue;n.forEach((function(t){if(O(t,e))throw new TypeError('Conflicting signatures "'+h(t)+'" and "'+h(e)+'".')})),n.push(e);const l=r.length;r.push(t[i]);const s=e.map(v);let c;for(c of M(s)){const e=h(c);a.push({params:c,name:e,fn:l}),c.every((e=>!e.hasConversion))&&(o[e]=l)}}a.sort(A);const s=V(r,o,ae);let c;for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&(o[c]=s[o[c]]);const u=[],d=new Map;for(c of a)d.has(c.name)||(c.fn=s[c.fn],u.push(c),d.set(c.name,c));const p=u[0]&&u[0].params.length<=2&&!b(u[0].params),f=u[1]&&u[1].params.length<=2&&!b(u[1].params),m=u[2]&&u[2].params.length<=2&&!b(u[2].params),g=u[3]&&u[3].params.length<=2&&!b(u[3].params),C=u[4]&&u[4].params.length<=2&&!b(u[4].params),_=u[5]&&u[5].params.length<=2&&!b(u[5].params),E=p&&f&&m&&g&&C&&_;for(let l=0;l<u.length;++l)u[l].test=x(u[l].params);const S=p?w(u[0].params[0]):C2,k=f?w(u[1].params[0]):C2,T=m?w(u[2].params[0]):C2,N=g?w(u[3].params[0]):C2,D=C?w(u[4].params[0]):C2,R=_?w(u[5].params[0]):C2,B=p?w(u[0].params[1]):C2,P=f?w(u[1].params[1]):C2,L=m?w(u[2].params[1]):C2,F=g?w(u[3].params[1]):C2,z=C?w(u[4].params[1]):C2,j=_?w(u[5].params[1]):C2;for(let l=0;l<u.length;++l)u[l].implementation=I(u[l].params,u[l].fn);const $=p?u[0].implementation:_2,U=f?u[1].implementation:_2,H=m?u[2].implementation:_2,q=g?u[3].implementation:_2,W=C?u[4].implementation:_2,G=_?u[5].implementation:_2,Y=p?u[0].params.length:-1,K=f?u[1].params.length:-1,X=m?u[2].params.length:-1,J=g?u[3].params.length:-1,Z=C?u[4].params.length:-1,Q=_?u[5].params.length:-1,ee=E?6:0,te=u.length,ne=u.map((e=>e.test)),re=u.map((e=>e.implementation)),oe=function(){for(let e=ee;e<te;e++)if(ne[e](arguments))return re[e].apply(this,arguments);return l.onMismatch(e,arguments,u)};function ae(e,t){return arguments.length===Y&&S(e)&&B(t)?$.apply(this,arguments):arguments.length===K&&k(e)&&P(t)?U.apply(this,arguments):arguments.length===X&&T(e)&&L(t)?H.apply(this,arguments):arguments.length===J&&N(e)&&F(t)?q.apply(this,arguments):arguments.length===Z&&D(e)&&z(t)?W.apply(this,arguments):arguments.length===Q&&R(e)&&j(t)?G.apply(this,arguments):oe.apply(this,arguments)}try{Object.defineProperty(ae,"name",{value:e})}catch(ie){}return ae.signatures=o,ae._typedFunctionData={signatures:u,signatureMap:d},ae}function L(e,t,n){throw k(e,t,n)}function F(e){return j(e,0,e.length-1)}function z(e){return e[e.length-1]}function j(e,t,n){return Array.prototype.slice.call(e,t,n)}function $(e,t){return{referTo:{references:e,callback:t}}}function U(e){if("function"!=typeof e)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function H(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function q(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function W(e,t){if(!e)return t;if(t&&t!==e){const n=new Error("Function names do not match (expected: "+e+", actual: "+t+")");throw n.data={actual:t,expected:e},n}return e}function G(e){let t;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(p(e[n])||"string"==typeof e[n].signature)&&(t=W(t,e[n].name));return t}function Y(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){const r=new Error('Signature "'+n+'" is defined twice');throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}u(),c(n);const K=l;function X(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw new SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return l=function(e){const n="string"==typeof e;let r=n?e:"";const o={};for(let a=n?1:0;a<arguments.length;++a){const e=arguments[a];let i,l={};if("function"==typeof e?(i=e.name,"string"==typeof e.signature?l[e.signature]=e:p(e)&&(l=e.signatures)):t(e)&&(l=e,n||(i=G(e))),0===Object.keys(l).length){const t=new TypeError("Argument to 'typed' at index "+a+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw t.data={index:a,argument:e},t}n||(r=W(r,i)),Y(o,l)}return P(r||"",o)},l.create=e,l.createCount=K.createCount,l.onMismatch=L,l.throwMismatchError=L,l.createError=k,l.clear=u,l.clearConversions=function(){let e;for(e of a)o.get(e).conversionsTo=[];i=0},l.addTypes=c,l._findType=s,l.referTo=function(){const e=F(arguments).map((e=>h(y(e)))),t=z(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return $(e,t)},l.referToSelf=U,l.convert=function(e,t){const n=s(t);if(n.test(e))return e;const r=n.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+t+" defined.");for(let o=0;o<r.length;o++){if(s(r[o].from).test(e))return r[o].convert(e)}throw new Error("Cannot convert "+e+" to "+t)},l.findSignature=f,l.find=function(e,t,n){return f(e,t,n).implementation},l.isTypedFunction=p,l.warnAgainstDeprecatedThis=!0,l.addType=function(e,t){let n="any";!1!==t&&o.has("Object")&&(n="Object"),l.addTypes([e],n)},l.addConversion=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{override:!1};X(e);const n=s(e.to),r=n.conversionsTo.find((t=>t.from===e.from));if(r){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+n.name+'"');l.removeConversion({from:r.from,to:e.to,convert:r.convert})}n.conversionsTo.push({from:e.from,convert:e.convert,index:i++})},l.addConversions=function(e,t){e.forEach((e=>l.addConversion(e,t)))},l.removeConversion=function(e){X(e);const t=s(e.to),n=function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}(t.conversionsTo,(t=>t.from===e.from));if(!n)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(n.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},l.resolve=function(e,t){if(!p(e))throw new TypeError(E2);const n=e._typedFunctionData.signatures;for(let r=0;r<n.length;++r)if(n[r].test(t))return n[r];return null},l}();function k2(e,t,n,r){function o(r){var o=function(e,t){for(var n={},r=0;r<t.length;r++){var o=t[r],a=e[o];void 0!==a&&(n[o]=a)}return n}(r,t.map(T2));return function(e,t,n){var r=t.filter((e=>!function(e){return e&&"?"===e[0]}(e))).every((e=>void 0!==n[e]));if(!r){var o=t.filter((e=>void 0===n[e]));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(o.map((e=>'"'.concat(e,'"'))).join(", "),"."))}}(e,t,r),n(o)}return o.isFactory=!0,o.fn=e,o.dependencies=t.slice().sort(),r&&(o.meta=r),o}function T2(e){return e&&"?"===e[0]?e.slice(1):e}function N2(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function D2(e,t){return"bigint"!==t.number||/^-?\d+$/.test(e)?t.number:t.numberFallback}var A2=Math.sign||function(e){return e>0?1:e<0?-1:0},I2=Math.log2||function(e){return Math.log(e)/Math.LN2},R2=Math.log10||function(e){return Math.log(e)/Math.LN10},M2=Math.log1p||function(e){return Math.log(e+1)},O2=Math.cbrt||function(e){if(0===e)return e;var t,n=e<0;return n&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,n?-t:t},B2=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function V2(e,t,n){var r={2:"0b",8:"0o",16:"0x"}[t],o="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!N2(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!N2(e))throw new Error("Value must be an integer");e<0&&(e+=2**n),o="i".concat(n)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(r).concat(e.toString(t)).concat(o)}function P2(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:n,precision:r,wordSize:o}=L2(t);switch(n){case"fixed":return z2(e,r);case"exponential":return j2(e,r);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=F2(e),r=$2(n,t),o=r.exponent,a=r.coefficients,i=o%3==0?o:o<0?o-3-o%3:o-o%3;if(T1(t))for(;t>a.length||o-i+1>a.length;)a.push(0);else for(var l=Math.abs(o-i)-(a.length-1),s=0;s<l;s++)a.push(0);var c=Math.abs(o-i),u=1;for(;c>0;)u++,c--;var d=a.slice(u).join(""),p=T1(t)&&d.length||d.match(/[1-9]/)?"."+d:"",f=a.slice(0,u).join("")+p+"e"+(o>=0?"+":"")+i.toString();return r.sign+f}(e,r);case"bin":return V2(e,2,o);case"oct":return V2(e,8,o);case"hex":return V2(e,16,o);case"auto":return function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=Z2(null==n?void 0:n.lowerExp,-3),o=Z2(null==n?void 0:n.upperExp,5),a=F2(e),i=t?$2(a,t):a;if(i.exponent<r||i.exponent>=o)return j2(e,t);var l=i.coefficients,s=i.exponent;l.length<t&&(l=l.concat(U2(t-l.length))),l=l.concat(U2(s-l.length+1+(l.length<t?t-l.length:0)));var c=s>0?s:0;return c<(l=U2(-s).concat(l)).length-1&&l.splice(c+1,0,"."),i.sign+l.join("")}(e,r,t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function L2(e){var t,n,r="auto";if(void 0!==e)if(T1(e))t=e;else if(N1(e))t=e.toNumber();else{if(!G1(e))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==e.precision&&(t=J2(e.precision,(()=>{throw new Error('Option "precision" must be a number or BigNumber')}))),void 0!==e.wordSize&&(n=J2(e.wordSize,(()=>{throw new Error('Option "wordSize" must be a number or BigNumber')}))),e.notation&&(r=e.notation)}return{notation:r,precision:t,wordSize:n}}function F2(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],o=parseFloat(t[4]||"0"),a=r.indexOf(".");o+=-1!==a?a-1:r.length-1;var i=r.replace(".","").replace(/^0*/,(function(e){return o-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===i.length&&(i.push(0),o++),{sign:n,coefficients:i,exponent:o}}function z2(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=F2(e),r="number"==typeof t?$2(n,n.exponent+1+t):n,o=r.coefficients,a=r.exponent+1,i=a+(t||0);return o.length<i&&(o=o.concat(U2(i-o.length))),a<0&&(o=U2(1-a).concat(o),a=1),a<o.length&&o.splice(a,0,0===a?"0.":"."),r.sign+o.join("")}function j2(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=F2(e),r=t?$2(n,t):n,o=r.coefficients,a=r.exponent;o.length<t&&(o=o.concat(U2(t-o.length)));var i=o.shift();return r.sign+i+(o.length>0?"."+o.join(""):"")+"e"+(a>=0?"+":"")+a}function $2(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var o=t-1;for(r[o]++;10===r[o];)r.pop(),0===o&&(r.unshift(0),n.exponent++,o++),r[--o]++}return n}function U2(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function H2(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return!isNaN(e)&&!isNaN(t)&&(isFinite(e)&&isFinite(t)?e===t||Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r):e===t)}var q2=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},W2=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},G2=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Y2=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},K2=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},X2=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function J2(e,t){return T1(e)?e:N1(e)?e.toNumber():void t()}function Z2(e,t){return T1(e)?e:N1(e)?e.toNumber():t}var Q2=function(){return Q2=S2.create,S2},e4=k2("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:o}=e,a=Q2();return a.clear(),a.addTypes([{name:"number",test:T1},{name:"Complex",test:A1},{name:"BigNumber",test:N1},{name:"bigint",test:D1},{name:"Fraction",test:I1},{name:"Unit",test:R1},{name:"identifier",test:e=>M1&&/^(?:[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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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\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\uDE80-\uDEA9\uDEB0\uDEB1\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]|\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]|\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\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\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\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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\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\uDE80-\uDEA9\uDEB0\uDEB1\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]|\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]|\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\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\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\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:M1},{name:"Chain",test:h2},{name:"Array",test:O1},{name:"Matrix",test:B1},{name:"DenseMatrix",test:P1},{name:"SparseMatrix",test:L1},{name:"Range",test:F1},{name:"Index",test:z1},{name:"boolean",test:j1},{name:"ResultSet",test:$1},{name:"Help",test:U1},{name:"function",test:H1},{name:"Date",test:q1},{name:"RegExp",test:W1},{name:"null",test:K1},{name:"undefined",test:X1},{name:"AccessorNode",test:J1},{name:"ArrayNode",test:Z1},{name:"AssignmentNode",test:Q1},{name:"BlockNode",test:e2},{name:"ConditionalNode",test:t2},{name:"ConstantNode",test:n2},{name:"FunctionNode",test:a2},{name:"FunctionAssignmentNode",test:o2},{name:"IndexNode",test:i2},{name:"Node",test:l2},{name:"ObjectNode",test:s2},{name:"OperatorNode",test:c2},{name:"ParenthesisNode",test:u2},{name:"RangeNode",test:d2},{name:"RelationalNode",test:p2},{name:"SymbolNode",test:f2},{name:"Map",test:Y1},{name:"Object",test:G1}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||t4(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new 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 n||n4(e),new n(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return n||n4(e),new n(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new 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||t4(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return o||r4(e),new o(e.toString())}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new 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 n||n4(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){o||r4(e);var t=new o(e);if(t.valueOf()!==e)throw new 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 new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||t4(e);try{return new t(e)}catch(n){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){o||r4(e);try{return new o(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||n4(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||t4(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return o||r4(e),new o(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&V1(t[0])&&n.some((e=>!e.params.includes(",")))){var o=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw o.data=r.data,o}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&V1(t[0])&&n.some((e=>!e.params.includes(",")))){var o=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw o.data=r.data,o}throw r},a}));function t4(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function n4(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function r4(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var o4,a4,i4=k2("ResultSet",[],(()=>{function e(t){if(!(this instanceof e))throw new 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.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0}),l4=9e15,s4=1e9,c4="0123456789abcdef",u4="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",d4="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p4={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:l4,crypto:!1},f4=!0,h4="[DecimalError] ",m4=h4+"Invalid argument: ",v4=h4+"Precision limit exceeded",g4=h4+"crypto unavailable",y4="[object Decimal]",b4=Math.floor,w4=Math.pow,x4=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,C4=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,_4=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,E4=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,S4=1e7,k4=u4.length-1,T4=d4.length-1,N4={toStringTag:y4};function D4(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)(n=7-(r=e[t]+"").length)&&(a+=z4(n)),a+=r;(n=7-(r=(i=e[t])+"").length)&&(a+=z4(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return a+i}function A4(e,t,n){if(e!==~~e||e<t||e>n)throw Error(m4+e)}function I4(e,t,n,r){var o,a,i,l;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,o=0):(o=Math.ceil((t+1)/7),t%=7),a=w4(10,7-t),l=e[o]%a|0,null==r?t<3?(0==t?l=l/100|0:1==t&&(l=l/10|0),i=n<4&&99999==l||n>3&&49999==l||5e4==l||0==l):i=(n<4&&l+1==a||n>3&&l+1==a/2)&&(e[o+1]/a/100|0)==w4(10,t-2)-1||(l==a/2||0==l)&&!(e[o+1]/a/100|0):t<4?(0==t?l=l/1e3|0:1==t?l=l/100|0:2==t&&(l=l/10|0),i=(r||n<4)&&9999==l||!r&&n>3&&4999==l):i=((r||n<4)&&l+1==a||!r&&n>3&&l+1==a/2)&&(e[o+1]/a/1e3|0)==w4(10,t-3)-1,i}function R4(e,t,n){for(var r,o,a=[0],i=0,l=e.length;i<l;){for(o=a.length;o--;)a[o]*=t;for(a[0]+=c4.indexOf(e.charAt(i++)),r=0;r<a.length;r++)a[r]>n-1&&(void 0===a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}N4.absoluteValue=N4.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O4(e)},N4.ceil=function(){return O4(new this.constructor(this),this.e+1,2)},N4.clampedTo=N4.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(m4+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},N4.comparedTo=N4.cmp=function(e){var t,n,r,o,a=this,i=a.d,l=(e=new a.constructor(e)).d,s=a.s,c=e.s;if(!i||!l)return s&&c?s!==c?s:i===l?0:!i^s<0?1:-1:NaN;if(!i[0]||!l[0])return i[0]?s:l[0]?-c:0;if(s!==c)return s;if(a.e!==e.e)return a.e>e.e^s<0?1:-1;for(t=0,n=(r=i.length)<(o=l.length)?r:o;t<n;++t)if(i[t]!==l[t])return i[t]>l[t]^s<0?1:-1;return r===o?0:r>o^s<0?1:-1},N4.cosine=N4.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,o;if(t.isZero())return t;r=t.d.length,r<32?o=(1/K4(4,n=Math.ceil(r/3))).toString():(n=16,o="2.3283064365386962890625e-10");e.precision+=n,t=Y4(e,1,t.times(o),new e(1));for(var a=n;a--;){var i=t.times(t);t=i.times(i).minus(i).times(8).plus(1)}return e.precision-=n,t}(r,X4(r,n)),r.precision=e,r.rounding=t,O4(2==a4||3==a4?n.neg():n,e,t,!0)):new r(1):new r(NaN)},N4.cubeRoot=N4.cbrt=function(){var e,t,n,r,o,a,i,l,s,c,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(f4=!1,(a=u.s*w4(u.s*u,1/3))&&Math.abs(a)!=1/0?r=new d(a.toString()):(n=D4(u.d),(a=((e=u.e)-n.length+1)%3)&&(n+=1==a||-2==a?"0":"00"),a=w4(n,1/3),e=b4((e+1)/3)-(e%3==(e<0?-1:2)),(r=new d(n=a==1/0?"5e"+e:(n=a.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),i=(e=d.precision)+3;;)if(c=(s=(l=r).times(l).times(l)).plus(u),r=M4(c.plus(u).times(l),c.plus(s),i+2,1),D4(l.d).slice(0,i)===(n=D4(r.d)).slice(0,i)){if("9999"!=(n=n.slice(i-3,i+1))&&(o||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(O4(r,e+1,1),t=!r.times(r).times(r).eq(u));break}if(!o&&(O4(l,e+1,0),l.times(l).times(l).eq(u))){r=l;break}i+=4,o=1}return f4=!0,O4(r,e,d.rounding,t)},N4.decimalPlaces=N4.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-b4(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},N4.dividedBy=N4.div=function(e){return M4(this,new this.constructor(e))},N4.dividedToIntegerBy=N4.divToInt=function(e){var t=this.constructor;return O4(M4(this,new t(e),0,1,1),t.precision,t.rounding)},N4.equals=N4.eq=function(e){return 0===this.cmp(e)},N4.floor=function(){return O4(new this.constructor(this),this.e+1,3)},N4.greaterThan=N4.gt=function(e){return this.cmp(e)>0},N4.greaterThanOrEqualTo=N4.gte=function(e){var t=this.cmp(e);return 1==t||0===t},N4.hyperbolicCosine=N4.cosh=function(){var e,t,n,r,o,a=this,i=a.constructor,l=new i(1);if(!a.isFinite())return new i(a.s?1/0:NaN);if(a.isZero())return l;n=i.precision,r=i.rounding,i.precision=n+Math.max(a.e,a.sd())+4,i.rounding=1,(o=a.d.length)<32?t=(1/K4(4,e=Math.ceil(o/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=Y4(i,1,a.times(t),new i(1),!0);for(var s,c=e,u=new i(8);c--;)s=a.times(a),a=l.minus(s.times(u.minus(s.times(u))));return O4(a,i.precision=n,i.rounding=r,!0)},N4.hyperbolicSine=N4.sinh=function(){var e,t,n,r,o=this,a=o.constructor;if(!o.isFinite()||o.isZero())return new a(o);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(o.e,o.sd())+4,a.rounding=1,(r=o.d.length)<3)o=Y4(a,2,o,o,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,o=Y4(a,2,o=o.times(1/K4(5,e)),o,!0);for(var i,l=new a(5),s=new a(16),c=new a(20);e--;)i=o.times(o),o=o.times(l.plus(i.times(s.times(i).plus(c))))}return a.precision=t,a.rounding=n,O4(o,t,n,!0)},N4.hyperbolicTangent=N4.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,M4(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},N4.inverseCosine=N4.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,o=t.rounding;return-1!==n?0===n?e.isNeg()?L4(t,r,o):new t(0):new t(NaN):e.isZero()?L4(t,r+4,o).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=o,e.times(2))},N4.inverseHyperbolicCosine=N4.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,f4=!1,n=n.times(n).minus(1).sqrt().plus(n),f4=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},N4.inverseHyperbolicSine=N4.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,f4=!1,n=n.times(n).plus(1).sqrt().plus(n),f4=!0,r.precision=e,r.rounding=t,n.ln())},N4.inverseHyperbolicTangent=N4.atanh=function(){var e,t,n,r,o=this,a=o.constructor;return o.isFinite()?o.e>=0?new a(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=a.precision,t=a.rounding,r=o.sd(),Math.max(r,e)<2*-o.e-1?O4(new a(o),e,t,!0):(a.precision=n=r-o.e,o=M4(o.plus(1),new a(1).minus(o),n+e,1),a.precision=e+4,a.rounding=1,o=o.ln(),a.precision=e,a.rounding=t,o.times(.5))):new a(NaN)},N4.inverseSine=N4.asin=function(){var e,t,n,r,o=this,a=o.constructor;return o.isZero()?new a(o):(t=o.abs().cmp(1),n=a.precision,r=a.rounding,-1!==t?0===t?((e=L4(a,n+4,r).times(.5)).s=o.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,o=o.div(new a(1).minus(o.times(o)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,o.times(2)))},N4.inverseTangent=N4.atan=function(){var e,t,n,r,o,a,i,l,s,c=this,u=c.constructor,d=u.precision,p=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&d+4<=T4)return(i=L4(u,d+4,p).times(.25)).s=c.s,i}else{if(!c.s)return new u(NaN);if(d+4<=T4)return(i=L4(u,d+4,p).times(.5)).s=c.s,i}for(u.precision=l=d+10,u.rounding=1,e=n=Math.min(28,l/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(f4=!1,t=Math.ceil(l/7),r=1,s=c.times(c),i=new u(c),o=c;-1!==e;)if(o=o.times(s),a=i.minus(o.div(r+=2)),o=o.times(s),void 0!==(i=a.plus(o.div(r+=2))).d[t])for(e=t;i.d[e]===a.d[e]&&e--;);return n&&(i=i.times(2<<n-1)),f4=!0,O4(i,u.precision=d,u.rounding=p,!0)},N4.isFinite=function(){return!!this.d},N4.isInteger=N4.isInt=function(){return!!this.d&&b4(this.e/7)>this.d.length-2},N4.isNaN=function(){return!this.s},N4.isNegative=N4.isNeg=function(){return this.s<0},N4.isPositive=N4.isPos=function(){return this.s>0},N4.isZero=function(){return!!this.d&&0===this.d[0]},N4.lessThan=N4.lt=function(e){return this.cmp(e)<0},N4.lessThanOrEqualTo=N4.lte=function(e){return this.cmp(e)<1},N4.logarithm=N4.log=function(e){var t,n,r,o,a,i,l,s,c=this,u=c.constructor,d=u.precision,p=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(o=n[0];o%10==0;)o/=10;a=1!==o}if(f4=!1,i=q4(c,l=d+5),r=t?P4(u,l+10):q4(e,l),I4((s=M4(i,r,l,1)).d,o=d,p))do{if(i=q4(c,l+=10),r=t?P4(u,l+10):q4(e,l),s=M4(i,r,l,1),!a){+D4(s.d).slice(o+1,o+15)+1==1e14&&(s=O4(s,d+1,0));break}}while(I4(s.d,o+=10,p));return f4=!0,O4(s,d,p)},N4.minus=N4.sub=function(e){var t,n,r,o,a,i,l,s,c,u,d,p,f=this,h=f.constructor;if(e=new h(e),!f.d||!e.d)return f.s&&e.s?f.d?e.s=-e.s:e=new h(e.d||f.s!==e.s?f:NaN):e=new h(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(c=f.d,p=e.d,l=h.precision,s=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===s?-0:0);e=new h(f)}return f4?O4(e,l,s):e}if(n=b4(e.e/7),u=b4(f.e/7),c=c.slice(),a=u-n){for((d=a<0)?(t=c,a=-a,i=p.length):(t=p,n=u,i=c.length),a>(r=Math.max(Math.ceil(l/7),i)+2)&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for((d=(r=c.length)<(i=p.length))&&(i=r),r=0;r<i;r++)if(c[r]!=p[r]){d=c[r]<p[r];break}a=0}for(d&&(t=c,c=p,p=t,e.s=-e.s),i=c.length,r=p.length-i;r>0;--r)c[i++]=0;for(r=p.length;r>a;){if(c[--r]<p[r]){for(o=r;o&&0===c[--o];)c[o]=S4-1;--c[o],c[r]+=S4}c[r]-=p[r]}for(;0===c[--i];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=V4(c,n),f4?O4(e,l,s):e):new h(3===s?-0:0)},N4.modulo=N4.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?O4(new r(n),r.precision,r.rounding):(f4=!1,9==r.modulo?(t=M4(n,e.abs(),0,3,1)).s*=e.s:t=M4(n,e,0,r.modulo,1),t=t.times(e),f4=!0,n.minus(t))},N4.naturalExponential=N4.exp=function(){return H4(this)},N4.naturalLogarithm=N4.ln=function(){return q4(this)},N4.negated=N4.neg=function(){var e=new this.constructor(this);return e.s=-e.s,O4(e)},N4.plus=N4.add=function(e){var t,n,r,o,a,i,l,s,c,u,d=this,p=d.constructor;if(e=new p(e),!d.d||!e.d)return d.s&&e.s?d.d||(e=new p(e.d||d.s===e.s?d:NaN)):e=new p(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(c=d.d,u=e.d,l=p.precision,s=p.rounding,!c[0]||!u[0])return u[0]||(e=new p(d)),f4?O4(e,l,s):e;if(a=b4(d.e/7),r=b4(e.e/7),c=c.slice(),o=a-r){for(o<0?(n=c,o=-o,i=u.length):(n=u,r=a,i=c.length),o>(i=(a=Math.ceil(l/7))>i?a+1:i+1)&&(o=i,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for((i=c.length)-(o=u.length)<0&&(o=i,n=u,u=c,c=n),t=0;o;)t=(c[--o]=c[o]+u[o]+t)/S4|0,c[o]%=S4;for(t&&(c.unshift(t),++r),i=c.length;0==c[--i];)c.pop();return e.d=c,e.e=V4(c,r),f4?O4(e,l,s):e},N4.precision=N4.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(m4+e);return n.d?(t=F4(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},N4.round=function(){var e=this,t=e.constructor;return O4(new t(e),e.e+1,t.rounding)},N4.sine=N4.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Y4(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:0|n,t=t.times(1/K4(5,n)),t=Y4(e,2,t,t);for(var o,a=new e(5),i=new e(16),l=new e(20);n--;)o=t.times(t),t=t.times(a.plus(o.times(i.times(o).minus(l))));return t}(r,X4(r,n)),r.precision=e,r.rounding=t,O4(a4>2?n.neg():n,e,t,!0)):new r(NaN)},N4.squareRoot=N4.sqrt=function(){var e,t,n,r,o,a,i=this,l=i.d,s=i.e,c=i.s,u=i.constructor;if(1!==c||!l||!l[0])return new u(!c||c<0&&(!l||l[0])?NaN:l?i:1/0);for(f4=!1,0==(c=Math.sqrt(+i))||c==1/0?(((t=D4(l)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=b4((s+1)/2)-(s<0||s%2),r=new u(t=c==1/0?"5e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):r=new u(c.toString()),n=(s=u.precision)+3;;)if(r=(a=r).plus(M4(i,a,n+2,1)).times(.5),D4(a.d).slice(0,n)===(t=D4(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(O4(r,s+1,1),e=!r.times(r).eq(i));break}if(!o&&(O4(a,s+1,0),a.times(a).eq(i))){r=a;break}n+=4,o=1}return f4=!0,O4(r,s,u.rounding,e)},N4.tangent=N4.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=M4(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,O4(2==a4||4==a4?n.neg():n,e,t,!0)):new r(NaN)},N4.times=N4.mul=function(e){var t,n,r,o,a,i,l,s,c,u=this,d=u.constructor,p=u.d,f=(e=new d(e)).d;if(e.s*=u.s,!(p&&p[0]&&f&&f[0]))return new d(!e.s||p&&!p[0]&&!f||f&&!f[0]&&!p?NaN:p&&f?0*e.s:e.s/0);for(n=b4(u.e/7)+b4(e.e/7),(s=p.length)<(c=f.length)&&(a=p,p=f,f=a,i=s,s=c,c=i),a=[],r=i=s+c;r--;)a.push(0);for(r=c;--r>=0;){for(t=0,o=s+r;o>r;)l=a[o]+f[r]*p[o-r-1]+t,a[o--]=l%S4|0,t=l/S4|0;a[o]=(a[o]+t)%S4|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=V4(a,n),f4?O4(e,d.precision,d.rounding):e},N4.toBinary=function(e,t){return J4(this,2,e,t)},N4.toDecimalPlaces=N4.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(A4(e,0,s4),void 0===t?t=r.rounding:A4(t,0,8),O4(n,e+n.e+1,t))},N4.toExponential=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=B4(r,!0):(A4(e,0,s4),void 0===t?t=o.rounding:A4(t,0,8),n=B4(r=O4(new o(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},N4.toFixed=function(e,t){var n,r,o=this,a=o.constructor;return void 0===e?n=B4(o):(A4(e,0,s4),void 0===t?t=a.rounding:A4(t,0,8),n=B4(r=O4(new a(o),e+o.e+1,t),!1,e+r.e+1)),o.isNeg()&&!o.isZero()?"-"+n:n},N4.toFraction=function(e){var t,n,r,o,a,i,l,s,c,u,d,p,f=this,h=f.d,m=f.constructor;if(!h)return new m(f);if(c=n=new m(1),r=s=new m(0),i=(a=(t=new m(r)).e=F4(h)-f.e-1)%7,t.d[0]=w4(10,i<0?7+i:i),null==e)e=a>0?t:c;else{if(!(l=new m(e)).isInt()||l.lt(c))throw Error(m4+l);e=l.gt(t)?a>0?t:c:l}for(f4=!1,l=new m(D4(h)),u=m.precision,m.precision=a=7*h.length*2;d=M4(l,t,0,1,1),1!=(o=n.plus(d.times(r))).cmp(e);)n=r,r=o,o=c,c=s.plus(d.times(o)),s=o,o=t,t=l.minus(d.times(o)),l=o;return o=M4(e.minus(n),r,0,1,1),s=s.plus(o.times(c)),n=n.plus(o.times(r)),s.s=c.s=f.s,p=M4(c,r,a,1).minus(f).abs().cmp(M4(s,n,a,1).minus(f).abs())<1?[c,r]:[s,n],m.precision=u,f4=!0,p},N4.toHexadecimal=N4.toHex=function(e,t){return J4(this,16,e,t)},N4.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:A4(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(f4=!1,n=M4(n,e,0,t,1).times(e),f4=!0,O4(n)):(e.s=n.s,n=e),n},N4.toNumber=function(){return+this},N4.toOctal=function(e,t){return J4(this,8,e,t)},N4.toPower=N4.pow=function(e){var t,n,r,o,a,i,l=this,s=l.constructor,c=+(e=new s(e));if(!(l.d&&e.d&&l.d[0]&&e.d[0]))return new s(w4(+l,c));if((l=new s(l)).eq(1))return l;if(r=s.precision,a=s.rounding,e.eq(1))return O4(l,r,a);if((t=b4(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return o=j4(s,l,n,r),e.s<0?new s(1).div(o):O4(o,r,a);if((i=l.s)<0){if(t<e.d.length-1)return new s(NaN);if(1&e.d[t]||(i=1),0==l.e&&1==l.d[0]&&1==l.d.length)return l.s=i,l}return(t=0!=(n=w4(+l,c))&&isFinite(n)?new s(n+"").e:b4(c*(Math.log("0."+D4(l.d))/Math.LN10+l.e+1)))>s.maxE+1||t<s.minE-1?new s(t>0?i/0:0):(f4=!1,s.rounding=l.s=1,n=Math.min(12,(t+"").length),(o=H4(e.times(q4(l,r+n)),r)).d&&I4((o=O4(o,r+5,1)).d,r,a)&&(t=r+10,+D4((o=O4(H4(e.times(q4(l,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(o=O4(o,r+1,0))),o.s=i,f4=!0,s.rounding=a,O4(o,r,a))},N4.toPrecision=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=B4(r,r.e<=o.toExpNeg||r.e>=o.toExpPos):(A4(e,1,s4),void 0===t?t=o.rounding:A4(t,0,8),n=B4(r=O4(new o(r),e,t),e<=r.e||r.e<=o.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},N4.toSignificantDigits=N4.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(A4(e,1,s4),void 0===t?t=n.rounding:A4(t,0,8)),O4(new n(this),e,t)},N4.toString=function(){var e=this,t=e.constructor,n=B4(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},N4.truncated=N4.trunc=function(){return O4(new this.constructor(this),this.e+1,1)},N4.valueOf=N4.toJSON=function(){var e=this,t=e.constructor,n=B4(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var M4=function(){function e(e,t,n){var r,o=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+o,e[a]=r%n|0,o=r/n|0;return o&&e.unshift(o),e}function t(e,t,n,r){var o,a;if(n!=r)a=n>r?1:-1;else for(o=a=0;o<n;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,o,a,i,l,s){var c,u,d,p,f,h,m,v,g,y,b,w,x,C,_,E,S,k,T,N,D=r.constructor,A=r.s==o.s?1:-1,I=r.d,R=o.d;if(!(I&&I[0]&&R&&R[0]))return new D(r.s&&o.s&&(I?!R||I[0]!=R[0]:R)?I&&0==I[0]||!R?0*A:A/0:NaN);for(s?(f=1,u=r.e-o.e):(s=S4,f=7,u=b4(r.e/f)-b4(o.e/f)),T=R.length,S=I.length,y=(g=new D(A)).d=[],d=0;R[d]==(I[d]||0);d++);if(R[d]>(I[d]||0)&&u--,null==a?(C=a=D.precision,i=D.rounding):C=l?a+(r.e-o.e)+1:a,C<0)y.push(1),h=!0;else{if(C=C/f+2|0,d=0,1==T){for(p=0,R=R[0],C++;(d<S||p)&&C--;d++)_=p*s+(I[d]||0),y[d]=_/R|0,p=_%R|0;h=p||d<S}else{for((p=s/(R[0]+1)|0)>1&&(R=e(R,p,s),I=e(I,p,s),T=R.length,S=I.length),E=T,w=(b=I.slice(0,T)).length;w<T;)b[w++]=0;(N=R.slice()).unshift(0),k=R[0],R[1]>=s/2&&++k;do{p=0,(c=t(R,b,T,w))<0?(x=b[0],T!=w&&(x=x*s+(b[1]||0)),(p=x/k|0)>1?(p>=s&&(p=s-1),1==(c=t(m=e(R,p,s),b,v=m.length,w=b.length))&&(p--,n(m,T<v?N:R,v,s))):(0==p&&(c=p=1),m=R.slice()),(v=m.length)<w&&m.unshift(0),n(b,m,w,s),-1==c&&(c=t(R,b,T,w=b.length))<1&&(p++,n(b,T<w?N:R,w,s)),w=b.length):0===c&&(p++,b=[0]),y[d++]=p,c&&b[0]?b[w++]=I[E]||0:(b=[I[E]],w=1)}while((E++<S||void 0!==b[0])&&C--);h=void 0!==b[0]}y[0]||y.shift()}if(1==f)g.e=u,o4=h;else{for(d=1,p=y[0];p>=10;p/=10)d++;g.e=d+u*f-1,O4(g,l?a+g.e+1:a,i,h)}return g}}();function O4(e,t,n,r){var o,a,i,l,s,c,u,d,p,f=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(o=1,l=d[0];l>=10;l/=10)o++;if((a=t-o)<0)a+=7,i=t,s=(u=d[p=0])/w4(10,o-i-1)%10|0;else if((p=Math.ceil((a+1)/7))>=(l=d.length)){if(!r)break e;for(;l++<=p;)d.push(0);u=s=0,o=1,i=(a%=7)-7+1}else{for(u=l=d[p],o=1;l>=10;l/=10)o++;s=(i=(a%=7)-7+o)<0?0:u/w4(10,o-i-1)%10|0}if(r=r||t<0||void 0!==d[p+1]||(i<0?u:u%w4(10,o-i-1)),c=n<4?(s||r)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||r||6==n&&(a>0?i>0?u/w4(10,o-i):0:d[p-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=w4(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==a?(d.length=p,l=1,p--):(d.length=p+1,l=w4(10,7-a),d[p]=i>0?(u/w4(10,o-i)%w4(10,i)|0)*l:0),c)for(;;){if(0==p){for(a=1,i=d[0];i>=10;i/=10)a++;for(i=d[0]+=l,l=1;i>=10;i/=10)l++;a!=l&&(e.e++,d[0]==S4&&(d[0]=1));break}if(d[p]+=l,d[p]!=S4)break;d[p--]=0,l=1}for(a=d.length;0===d[--a];)d.pop()}return f4&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function B4(e,t,n){if(!e.isFinite())return W4(e);var r,o=e.e,a=D4(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+z4(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):o<0?(a="0."+z4(-o-1)+a,n&&(r=n-i)>0&&(a+=z4(r))):o>=i?(a+=z4(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+z4(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=z4(r))),a}function V4(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function P4(e,t,n){if(t>k4)throw f4=!0,n&&(e.precision=n),Error(v4);return O4(new e(u4),t,1,!0)}function L4(e,t,n){if(t>T4)throw Error(v4);return O4(new e(d4),t,n,!0)}function F4(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function z4(e){for(var t="";e--;)t+="0";return t}function j4(e,t,n,r){var o,a=new e(1),i=Math.ceil(r/7+4);for(f4=!1;;){if(n%2&&Z4((a=a.times(t)).d,i)&&(o=!0),0===(n=b4(n/2))){n=a.d.length-1,o&&0===a.d[n]&&++a.d[n];break}Z4((t=t.times(t)).d,i)}return f4=!0,a}function $4(e){return 1&e.d[e.d.length-1]}function U4(e,t,n){for(var r,o,a=new e(t[0]),i=0;++i<t.length;){if(!(o=new e(t[i])).s){a=o;break}((r=a.cmp(o))===n||0===r&&a.s===n)&&(a=o)}return a}function H4(e,t){var n,r,o,a,i,l,s,c=0,u=0,d=0,p=e.constructor,f=p.rounding,h=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(f4=!1,s=h):s=t,l=new p(.03125);e.e>-2;)e=e.times(l),d+=5;for(s+=r=Math.log(w4(2,d))/Math.LN10*2+5|0,n=a=i=new p(1),p.precision=s;;){if(a=O4(a.times(e),s,1),n=n.times(++u),D4((l=i.plus(M4(a,n,s,1))).d).slice(0,s)===D4(i.d).slice(0,s)){for(o=d;o--;)i=O4(i.times(i),s,1);if(null!=t)return p.precision=h,i;if(!(c<3&&I4(i.d,s-r,f,c)))return O4(i,p.precision=h,f,f4=!0);p.precision=s+=10,n=a=l=new p(1),u=0,c++}i=l}}function q4(e,t){var n,r,o,a,i,l,s,c,u,d,p,f=1,h=e,m=h.d,v=h.constructor,g=v.rounding,y=v.precision;if(h.s<0||!m||!m[0]||!h.e&&1==m[0]&&1==m.length)return new v(m&&!m[0]?-1/0:1!=h.s?NaN:m?0:h);if(null==t?(f4=!1,u=y):u=t,v.precision=u+=10,r=(n=D4(m)).charAt(0),!(Math.abs(a=h.e)<15e14))return c=P4(v,u+2,y).times(a+""),h=q4(new v(r+"."+n.slice(1)),u-10).plus(c),v.precision=y,null==t?O4(h,y,g,f4=!0):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=D4((h=h.times(e)).d)).charAt(0),f++;for(a=h.e,r>1?(h=new v("0."+n),a++):h=new v(r+"."+n.slice(1)),d=h,s=i=h=M4(h.minus(1),h.plus(1),u,1),p=O4(h.times(h),u,1),o=3;;){if(i=O4(i.times(p),u,1),D4((c=s.plus(M4(i,new v(o),u,1))).d).slice(0,u)===D4(s.d).slice(0,u)){if(s=s.times(2),0!==a&&(s=s.plus(P4(v,u+2,y).times(a+""))),s=M4(s,new v(f),u,1),null!=t)return v.precision=y,s;if(!I4(s.d,u-10,g,l))return O4(s,v.precision=y,g,f4=!0);v.precision=u+=10,c=i=h=M4(d.minus(1),d.plus(1),u,1),p=O4(h.times(h),u,1),o=l=1}s=c,o+=2}}function W4(e){return String(e.s*e.s/0)}function G4(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(o=t.length;48===t.charCodeAt(o-1);--o);if(t=t.slice(r,o)){if(o-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=7;r<o;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=o;for(;r--;)t+="0";e.d.push(+t),f4&&(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 Y4(e,t,n,r,o){var a,i,l,s,c=e.precision,u=Math.ceil(c/7);for(f4=!1,s=n.times(n),l=new e(r);;){if(i=M4(l.times(s),new e(t++*t++),c,1),l=o?r.plus(i):r.minus(i),r=M4(i.times(s),new e(t++*t++),c,1),void 0!==(i=l.plus(r)).d[u]){for(a=u;i.d[a]===l.d[a]&&a--;);if(-1==a)break}a=l,l=r,r=i,i=a}return f4=!0,i.d.length=u+1,i}function K4(e,t){for(var n=e;--t;)n*=e;return n}function X4(e,t){var n,r=t.s<0,o=L4(e,e.precision,1),a=o.times(.5);if((t=t.abs()).lte(a))return a4=r?4:1,t;if((n=t.divToInt(o)).isZero())a4=r?3:2;else{if((t=t.minus(n.times(o))).lte(a))return a4=$4(n)?r?2:3:r?4:1,t;a4=$4(n)?r?1:4:r?3:2}return t.minus(o).abs()}function J4(e,t,n,r){var o,a,i,l,s,c,u,d,p,f=e.constructor,h=void 0!==n;if(h?(A4(n,1,s4),void 0===r?r=f.rounding:A4(r,0,8)):(n=f.precision,r=f.rounding),e.isFinite()){for(h?(o=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):o=t,(i=(u=B4(e)).indexOf("."))>=0&&(u=u.replace(".",""),(p=new f(1)).e=u.length-i,p.d=R4(B4(p),10,o),p.e=p.d.length),a=s=(d=R4(u,10,o)).length;0==d[--s];)d.pop();if(d[0]){if(i<0?a--:((e=new f(e)).d=d,e.e=a,d=(e=M4(e,p,n,r,0,o)).d,a=e.e,c=o4),i=d[n],l=o/2,c=c||void 0!==d[n+1],c=r<4?(void 0!==i||c)&&(0===r||r===(e.s<0?3:2)):i>l||i===l&&(4===r||c||6===r&&1&d[n-1]||r===(e.s<0?8:7)),d.length=n,c)for(;++d[--n]>o-1;)d[n]=0,n||(++a,d.unshift(1));for(s=d.length;!d[s-1];--s);for(i=0,u="";i<s;i++)u+=c4.charAt(d[i]);if(h){if(s>1)if(16==t||8==t){for(i=16==t?4:3,--s;s%i;s++)u+="0";for(s=(d=R4(u,o,t)).length;!d[s-1];--s);for(i=1,u="1.";i<s;i++)u+=c4.charAt(d[i])}else u=u.charAt(0)+"."+u.slice(1);u=u+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)u="0"+u;u="0."+u}else if(++a>s)for(a-=s;a--;)u+="0";else a<s&&(u=u.slice(0,a)+"."+u.slice(a))}else u=h?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=W4(e);return e.s<0?"-"+u:u}function Z4(e,t){if(e.length>t)return e.length=t,!0}function Q4(e){return new this(e).abs()}function e3(e){return new this(e).acos()}function t3(e){return new this(e).acosh()}function n3(e,t){return new this(e).plus(t)}function r3(e){return new this(e).asin()}function o3(e){return new this(e).asinh()}function a3(e){return new this(e).atan()}function i3(e){return new this(e).atanh()}function l3(e,t){e=new this(e),t=new this(t);var n,r=this.precision,o=this.rounding,a=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?L4(this,r,o):new this(0)).s=e.s:!e.d||t.isZero()?(n=L4(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,n=this.atan(M4(e,t,a,1)),t=L4(this,a,1),this.precision=r,this.rounding=o,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(M4(e,t,a,1)):(n=L4(this,a,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function s3(e){return new this(e).cbrt()}function c3(e){return O4(e=new this(e),e.e+1,2)}function u3(e,t,n){return new this(e).clamp(t,n)}function d3(e){if(!e||"object"!=typeof e)throw Error(h4+"Object expected");var t,n,r,o=!0===e.defaults,a=["precision",1,s4,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,l4,"maxE",0,l4,"minE",-9e15,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],o&&(this[n]=p4[n]),void 0!==(r=e[n])){if(!(b4(r)===r&&r>=a[t+1]&&r<=a[t+2]))throw Error(m4+n+": "+r);this[n]=r}if(n="crypto",o&&(this[n]=p4[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(m4+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(g4);this[n]=!0}else this[n]=!1}return this}function p3(e){return new this(e).cos()}function f3(e){return new this(e).cosh()}function h3(e,t){return new this(e).div(t)}function m3(e){return new this(e).exp()}function v3(e){return O4(e=new this(e),e.e+1,3)}function g3(){var e,t,n=new this(0);for(f4=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return f4=!0,new this(1/0);n=t}return f4=!0,n.sqrt()}function y3(e){return e instanceof F3||e&&e.toStringTag===y4||!1}function b3(e){return new this(e).ln()}function w3(e,t){return new this(e).log(t)}function x3(e){return new this(e).log(2)}function C3(e){return new this(e).log(10)}function _3(){return U4(this,arguments,-1)}function E3(){return U4(this,arguments,1)}function S3(e,t){return new this(e).mod(t)}function k3(e,t){return new this(e).mul(t)}function T3(e,t){return new this(e).pow(t)}function N3(e){var t,n,r,o,a=0,i=new this(1),l=[];if(void 0===e?e=this.precision:A4(e,1,s4),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)(o=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:l[a++]=o%1e7;else{if(!crypto.randomBytes)throw Error(g4);for(t=crypto.randomBytes(r*=4);a<r;)(o=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(l.push(o%1e7),a+=4);a=r/4}else for(;a<r;)l[a++]=1e7*Math.random()|0;for(e%=7,(r=l[--a])&&e&&(o=w4(10,7-e),l[a]=(r/o|0)*o);0===l[a];a--)l.pop();if(a<0)n=0,l=[0];else{for(n=-1;0===l[0];n-=7)l.shift();for(r=1,o=l[0];o>=10;o/=10)r++;r<7&&(n-=7-r)}return i.e=n,i.d=l,i}function D3(e){return O4(e=new this(e),e.e+1,this.rounding)}function A3(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function I3(e){return new this(e).sin()}function R3(e){return new this(e).sinh()}function M3(e){return new this(e).sqrt()}function O3(e,t){return new this(e).sub(t)}function B3(){var e=0,t=arguments,n=new this(t[e]);for(f4=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return f4=!0,O4(n,this.precision,this.rounding)}function V3(e){return new this(e).tan()}function P3(e){return new this(e).tanh()}function L3(e){return O4(e=new this(e),e.e+1,1)}N4[Symbol.for("nodejs.util.inspect.custom")]=N4.toString,N4[Symbol.toStringTag]="Decimal";var F3=N4.constructor=function e(t){var n,r,o;function a(e){var t,n,r,o=this;if(!(o instanceof a))return new a(e);if(o.constructor=a,y3(e))return o.s=e.s,void(f4?!e.d||e.e>a.maxE?(o.e=NaN,o.d=null):e.e<a.minE?(o.e=0,o.d=[0]):(o.e=e.e,o.d=e.d.slice()):(o.e=e.e,o.d=e.d?e.d.slice():e.d));if("number"===(r=typeof e)){if(0===e)return o.s=1/e<0?-1:1,o.e=0,void(o.d=[0]);if(e<0?(e=-e,o.s=-1):o.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(f4?t>a.maxE?(o.e=NaN,o.d=null):t<a.minE?(o.e=0,o.d=[0]):(o.e=t,o.d=[e]):(o.e=t,o.d=[e]))}return 0*e!=0?(e||(o.s=NaN),o.e=NaN,void(o.d=null)):G4(o,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),o.s=-1):(43===n&&(e=e.slice(1)),o.s=1),E4.test(e)?G4(o,e):function(e,t){var n,r,o,a,i,l,s,c,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),E4.test(t))return G4(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(C4.test(t))n=16,t=t.toLowerCase();else if(x4.test(t))n=2;else{if(!_4.test(t))throw Error(m4+t);n=8}for((a=t.search(/p/i))>0?(s=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),i=(a=t.indexOf("."))>=0,r=e.constructor,i&&(a=(l=(t=t.replace(".","")).length)-a,o=j4(r,new r(n),a,2*a)),a=u=(c=R4(t,n,S4)).length-1;0===c[a];--a)c.pop();return a<0?new r(0*e.s):(e.e=V4(c,u),e.d=c,f4=!1,i&&(e=M4(e,o,4*l)),s&&(e=e.times(Math.abs(s)<54?w4(2,s):F3.pow(2,s))),f4=!0,e)}(o,e);if("bigint"===r)return e<0?(e=-e,o.s=-1):o.s=1,G4(o,e.toString());throw Error(m4+e)}if(a.prototype=N4,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=d3,a.clone=e,a.isDecimal=y3,a.abs=Q4,a.acos=e3,a.acosh=t3,a.add=n3,a.asin=r3,a.asinh=o3,a.atan=a3,a.atanh=i3,a.atan2=l3,a.cbrt=s3,a.ceil=c3,a.clamp=u3,a.cos=p3,a.cosh=f3,a.div=h3,a.exp=m3,a.floor=v3,a.hypot=g3,a.ln=b3,a.log=w3,a.log10=C3,a.log2=x3,a.max=_3,a.min=E3,a.mod=S3,a.mul=k3,a.pow=T3,a.random=N3,a.round=D3,a.sign=A3,a.sin=I3,a.sinh=R3,a.sqrt=M3,a.sub=O3,a.sum=B3,a.tan=V3,a.tanh=P3,a.trunc=L3,void 0===t&&(t={}),t&&!0!==t.defaults)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<o.length;)t.hasOwnProperty(r=o[n++])||(t[r]=this[r]);return a.config(t),a}(p4);u4=new F3(u4),d4=new F3(d4);var z3=k2("BigNumber",["?on","config"],(e=>{var{on:t,config:n}=e,r=F3.clone({precision:n.precision,modulo:F3.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})})),r}),{isClass:!0});const j3=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},$3=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},U3=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))},H3=function(){throw SyntaxError("Invalid Param")};function q3(e,t){const n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const W3={re:0,im:0},G3=function(e,t){const n=W3;if(null==e)n.re=n.im=0;else if(void 0!==t)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return Y3.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return Y3.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else 2===e.length?(n.re=e[0],n.im=e[1]):H3();break;case"string":n.im=n.re=0;const t=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let r=1,o=0;null===t&&H3();for(let e=0;e<t.length;e++){const a=t[e];" "===a||"\t"===a||"\n"===a||("+"===a?r++:"-"===a?o++:"i"===a||"I"===a?(r+o===0&&H3()," "===t[e+1]||isNaN(t[e+1])?n.im+=parseFloat((o%2?"-":"")+"1"):(n.im+=parseFloat((o%2?"-":"")+t[e+1]),e++),r=o=0):((r+o===0||isNaN(a))&&H3(),"i"===t[e+1]||"I"===t[e+1]?(n.im+=parseFloat((o%2?"-":"")+a),e++):n.re+=parseFloat((o%2?"-":"")+a),r=o=0))}r+o>0&&H3();break;case"number":n.im=0,n.re=e;break;default:H3()}return isNaN(n.re)||isNaN(n.im),n};function Y3(e,t){if(!(this instanceof Y3))return new Y3(e,t);const n=G3(e,t);this.re=n.re,this.im=n.im}Y3.prototype={re:0,im:0,sign:function(){const e=U3(this.re,this.im);return new Y3(this.re/e,this.im/e)},add:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im));return r||o?r&&o?Y3.NAN:Y3.INFINITY:new Y3(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im));return r||o?r&&o?Y3.NAN:Y3.INFINITY:new Y3(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im)),a=0===this.re&&0===this.im,i=0===n.re&&0===n.im;return r&&i||o&&a?Y3.NAN:r||o?Y3.INFINITY:0===n.im&&0===this.im?new Y3(this.re*n.re,0):new Y3(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=G3(e,t),r=this.isInfinite(),o=!(isFinite(n.re)&&isFinite(n.im)),a=0===this.re&&0===this.im,i=0===n.re&&0===n.im;if(a&&i||r&&o)return Y3.NAN;if(i||r)return Y3.INFINITY;if(a||o)return Y3.ZERO;if(0===n.im)return new Y3(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){const e=n.re/n.im,t=n.re*e+n.im;return new Y3((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{const e=n.im/n.re,t=n.im*e+n.re;return new Y3((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){const n=G3(e,t),r=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return Y3.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new Y3(Math.pow(this.re,n.re),0);if(0===this.re)switch((n.re%4+4)%4){case 0:return new Y3(Math.pow(this.im,n.re),0);case 1:return new Y3(0,Math.pow(this.im,n.re));case 2:return new Y3(-Math.pow(this.im,n.re),0);case 3:return new Y3(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return Y3.ZERO;const o=Math.atan2(this.im,this.re),a=q3(this.re,this.im);let i=Math.exp(n.re*a-n.im*o),l=n.im*a+n.re*o;return new Y3(i*Math.cos(l),i*Math.sin(l))},sqrt:function(){const e=this.re,t=this.im;if(0===t)return e>=0?new Y3(Math.sqrt(e),0):new Y3(0,Math.sqrt(-e));const n=U3(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),o=Math.abs(t)/(2*r);return e>=0?new Y3(r,t<0?-o:o):new Y3(o,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return 0===this.im?new Y3(e,0):new Y3(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new Y3(Math.expm1(e)*Math.cos(t)+function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return 0===t&&e>0?new Y3(Math.log(e),0):new Y3(q3(e,t),Math.atan2(t,e))},abs:function(){return U3(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new Y3(Math.sin(e)*j3(t),Math.cos(e)*$3(t))},cos:function(){const e=this.re,t=this.im;return new Y3(Math.cos(e)*j3(t),-Math.sin(e)*$3(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+j3(t);return new Y3(Math.sin(e)/n,$3(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-j3(t);return new Y3(-Math.sin(e)/n,$3(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*j3(2*t)+.5*Math.cos(2*e);return new Y3(Math.cos(e)*j3(t)/n,Math.sin(e)*$3(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*j3(2*t)-.5*Math.cos(2*e);return new Y3(Math.sin(e)*j3(t)/n,-Math.cos(e)*$3(t)/n)},asin:function(){const e=this.re,t=this.im,n=new Y3(t*t-e*e+1,-2*e*t).sqrt(),r=new Y3(n.re-t,n.im+e).log();return new Y3(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new Y3(t*t-e*e+1,-2*e*t).sqrt(),r=new Y3(n.re-t,n.im+e).log();return new Y3(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(0===e){if(1===t)return new Y3(0,1/0);if(-1===t)return new Y3(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new Y3((1-t*t-e*e)/n,-2*e/n).log();return new Y3(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(0===t)return new Y3(Math.atan2(1,e),0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).atan():new Y3(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Y3(0,1/0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).acos():new Y3(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Y3(Math.PI/2,1/0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).asin():new Y3(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new Y3($3(e)*Math.cos(t),j3(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new Y3(j3(e)*Math.cos(t),$3(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=j3(e)+Math.cos(t);return new Y3($3(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=j3(e)-Math.cos(t);return new Y3($3(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-j3(2*e);return new Y3(-2*$3(e)*Math.cos(t)/n,2*j3(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+j3(2*e);return new Y3(2*j3(e)*Math.cos(t)/n,-2*$3(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&0===t,r=1-e,o=1+e,a=r*r+t*t,i=0!==a?new Y3((o*r-t*t)/a,(t*r+o*t)/a):new Y3(-1!==e?e/0:0,0!==t?t/0:0),l=i.re;return i.re=q3(i.re,i.im)/2,i.im=Math.atan2(i.im,l)/2,n&&(i.im=-i.im),i},acoth:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Y3(0,Math.PI/2);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).atanh():new Y3(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(0===t)return new Y3(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).asinh():new Y3(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return Y3.INFINITY;const n=e*e+t*t;return 0!==n?new Y3(e/n,-t/n).acosh():new Y3(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Y3.INFINITY;if(this.isInfinite())return Y3.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new Y3(e/n,-t/n)},conjugate:function(){return new Y3(this.re,-this.im)},neg:function(){return new Y3(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Y3(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Y3(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Y3(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=G3(e,t);return Math.abs(n.re-this.re)<=Y3.EPSILON&&Math.abs(n.im-this.im)<=Y3.EPSILON},clone:function(){return new Y3(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<Y3.EPSILON&&(e=0),Math.abs(t)<Y3.EPSILON&&(t=0),0===t?n+e:(0!==e?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),1!==t&&(n+=t),n+"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()}},Y3.ZERO=new Y3(0,0),Y3.ONE=new Y3(1,0),Y3.I=new Y3(0,1),Y3.PI=new Y3(Math.PI,0),Y3.E=new Y3(Math.E,0),Y3.INFINITY=new Y3(1/0,1/0),Y3.NAN=new Y3(NaN,NaN),Y3.EPSILON=1e-15;var K3=k2("Complex",[],(()=>(Object.defineProperty(Y3,"name",{value:"Complex"}),Y3.prototype.constructor=Y3,Y3.prototype.type="Complex",Y3.prototype.isComplex=!0,Y3.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Y3.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Y3.prototype.format=function(e){var t=this.im,n=this.re,r=P2(this.re,e),o=P2(this.im,e),a=T1(e)?e:e?e.precision:null;if(null!==a){var i=Math.pow(10,-a);Math.abs(n/t)<i&&(n=0),Math.abs(t/n)<i&&(t=0)}return 0===t?r:0===n?1===t?"i":-1===t?"-i":o+"i":t<0?-1===t?r+" - i":r+" - "+o.substring(1)+"i":1===t?r+" + i":r+" + "+o+"i"},Y3.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return Y3(t);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(T1(n)){if(R1(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),T1(r))return new Y3({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Y3.prototype.valueOf=Y3.prototype.toString,Y3.fromJSON=function(e){return new Y3(e)},Y3.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},Y3)),{isClass:!0}),X3={s:1,n:0,d:1};function J3(e,t){if(isNaN(e=parseInt(e,10)))throw o6();return e*t}function Z3(e,t){if(0===t)throw r6();var n=Object.create(n6.prototype);n.s=e<0?-1:1;var r=t6(e=e<0?-e:e,t);return n.n=e/r,n.d=t/r,n}function Q3(e){for(var t={},n=e,r=2,o=4;o<=n;){for(;n%r===0;)n/=r,t[r]=(t[r]||0)+1;o+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var e6=function(e,t){var n,r=0,o=1,a=1,i=0,l=0,s=0,c=1,u=1,d=0,p=1,f=1,h=1,m=1e7;if(null==e);else if(void 0!==t){if(a=(r=e)*(o=t),r%1!=0||o%1!=0)throw a6()}else switch(typeof e){case"object":if("d"in e&&"n"in e)r=e.n,o=e.d,"s"in e&&(r*=e.s);else{if(!(0 in e))throw o6();r=e[0],1 in e&&(o=e[1])}a=r*o;break;case"number":if(e<0&&(a=e,e=-e),e%1==0)r=e;else if(e>0){for(e>=1&&(e/=u=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));p<=m&&h<=m;){if(e===(n=(d+f)/(p+h))){p+h<=m?(r=d+f,o=p+h):h>p?(r=f,o=h):(r=d,o=p);break}e>n?(d+=f,p+=h):(f+=d,h+=p),p>m?(r=f,o=h):(r=d,o=p)}r*=u}else(isNaN(e)||isNaN(t))&&(o=r=NaN);break;case"string":if(null===(p=e.match(/\d+|./g)))throw o6();if("-"===p[d]?(a=-1,d++):"+"===p[d]&&d++,p.length===d+1?l=J3(p[d++],a):"."===p[d+1]||"."===p[d]?("."!==p[d]&&(i=J3(p[d++],a)),(++d+1===p.length||"("===p[d+1]&&")"===p[d+3]||"'"===p[d+1]&&"'"===p[d+3])&&(l=J3(p[d],a),c=Math.pow(10,p[d].length),d++),("("===p[d]&&")"===p[d+2]||"'"===p[d]&&"'"===p[d+2])&&(s=J3(p[d+1],a),u=Math.pow(10,p[d+1].length)-1,d+=3)):"/"===p[d+1]||":"===p[d+1]?(l=J3(p[d],a),c=J3(p[d+2],1),d+=3):"/"===p[d+3]&&" "===p[d+1]&&(i=J3(p[d],a),l=J3(p[d+2],a),c=J3(p[d+4],1),d+=5),p.length<=d){a=r=s+(o=c*u)*i+u*l;break}default:throw o6()}if(0===o)throw r6();X3.s=a<0?-1:1,X3.n=Math.abs(r),X3.d=Math.abs(o)};function t6(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function n6(e,t){if(e6(e,t),!(this instanceof n6))return Z3(X3.s*X3.n,X3.d);e=t6(X3.d,X3.n),this.s=X3.s,this.n=X3.n/e,this.d=X3.d/e}var r6=function(){return new Error("Division by Zero")},o6=function(){return new Error("Invalid argument")},a6=function(){return new Error("Parameters must be integer")};n6.prototype={s:1,n:0,d:1,abs:function(){return Z3(this.n,this.d)},neg:function(){return Z3(-this.s*this.n,this.d)},add:function(e,t){return e6(e,t),Z3(this.s*this.n*X3.d+X3.s*this.d*X3.n,this.d*X3.d)},sub:function(e,t){return e6(e,t),Z3(this.s*this.n*X3.d-X3.s*this.d*X3.n,this.d*X3.d)},mul:function(e,t){return e6(e,t),Z3(this.s*X3.s*this.n*X3.n,this.d*X3.d)},div:function(e,t){return e6(e,t),Z3(this.s*X3.s*this.n*X3.d,this.d*X3.n)},clone:function(){return Z3(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new n6(NaN);if(void 0===e)return Z3(this.s*this.n%this.d,1);if(e6(e,t),0===X3.n&&0===this.d)throw r6();return Z3(this.s*(X3.d*this.n)%(X3.n*this.d),X3.d*this.d)},gcd:function(e,t){return e6(e,t),Z3(t6(X3.n,this.n)*t6(X3.d,this.d),X3.d*this.d)},lcm:function(e,t){return e6(e,t),0===X3.n&&0===this.n?Z3(0,1):Z3(X3.n*this.n,t6(X3.n,this.n)*t6(X3.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new n6(NaN):Z3(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new n6(NaN):Z3(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new n6(NaN):Z3(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return e6(e,t),Z3(this.s*Math.round(this.n*X3.d/(this.d*X3.n))*X3.n,X3.d)},inverse:function(){return Z3(this.s*this.d,this.n)},pow:function(e,t){if(e6(e,t),1===X3.d)return X3.s<0?Z3(Math.pow(this.s*this.d,X3.n),Math.pow(this.n,X3.n)):Z3(Math.pow(this.s*this.n,X3.n),Math.pow(this.d,X3.n));if(this.s<0)return null;var n=Q3(this.n),r=Q3(this.d),o=1,a=1;for(var i in n)if("1"!==i){if("0"===i){o=0;break}if(n[i]*=X3.n,n[i]%X3.d!==0)return null;n[i]/=X3.d,o*=Math.pow(i,n[i])}for(var i in r)if("1"!==i){if(r[i]*=X3.n,r[i]%X3.d!==0)return null;r[i]/=X3.d,a*=Math.pow(i,r[i])}return X3.s<0?Z3(a,o):Z3(o,a)},equals:function(e,t){return e6(e,t),this.s*this.n*X3.d===X3.s*X3.n*this.d},compare:function(e,t){e6(e,t);var n=this.s*this.n*X3.d-X3.s*X3.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),r=1;r<n.length;r++){for(var o=Z3(n[r-1],1),a=r-2;a>=0;a--)o=o.inverse().add(n[a]);if(Math.abs(o.sub(t).valueOf())<e)return o.mul(this.s)}return this},divisible:function(e,t){return e6(e,t),!(!(X3.n*this.d)||this.n*X3.d%(X3.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,o=this.d;return this.s<0&&(n+="-"),1===o?n+=r:(e&&(t=Math.floor(r/o))>0&&(n+=t,n+=" ",r%=o),n+=r,n+="/",n+=o),n},toLatex:function(e){var t,n="",r=this.n,o=this.d;return this.s<0&&(n+="-"),1===o?n+=r:(e&&(t=Math.floor(r/o))>0&&(n+=t,r%=o),n+="\\frac{",n+=r,n+="}{",n+=o,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do{r.push(Math.floor(t/n)),e=t%n,t=n,n=e}while(1!==t);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var n=10%t,r=1;1!==n;r++)if(n=10*n%t,r>2e3)return 0;return r}(0,n),o=function(e,t,n){for(var r=1,o=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,n,t),a=0;a<300;a++){if(r===o)return a;r=10*r%t,o=10*o%t}return 0}(0,n,r),a=this.s<0?"-":"";if(a+=t/n|0,t%=n,(t*=10)&&(a+="."),r){for(var i=o;i--;)a+=t/n|0,t%=n,t*=10;a+="(";for(i=r;i--;)a+=t/n|0,t%=n,t*=10;a+=")"}else for(i=e;t&&i--;)a+=t/n|0,t%=n,t*=10;return a}};var i6=k2("Fraction",[],(()=>(Object.defineProperty(n6,"name",{value:"Fraction"}),n6.prototype.constructor=n6,n6.prototype.type="Fraction",n6.prototype.isFraction=!0,n6.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},n6.fromJSON=function(e){return new n6(e)},n6)),{isClass:!0}),l6=k2("Range",[],(()=>{function e(t,n,r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var o=null!=t,a=null!=n,i=null!=r;if(o)if(N1(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(a)if(N1(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter end must be a number");if(i)if(N1(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter step must be a number");this.start=o?parseFloat(t):0,this.end=a?parseFloat(n):0,this.step=i?parseFloat(r):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var n=t.split(":").map((function(e){return parseFloat(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[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,n=this.step,r=this.end-t;return A2(n)===A2(r)?e=Math.ceil(r/n):0===r&&(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,n=this.step,r=this.end,o=0;if(n>0)for(;t<r;)e(t,[o],this),t+=n,o++;else if(n<0)for(;t>r;)e(t,[o],this),t+=n,o++},e.prototype.map=function(e){var t=[];return this.forEach((function(n,r,o){t[r[0]]=e(n,r,o)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,n){e[n[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=P2(this.start,e);return 1!==this.step&&(t+=":"+P2(this.step,e)),t+=":"+P2(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}),s6=k2("Matrix",[],(()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0});function c6(e,t,n){var r=new(0,e.constructor)(2),o="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!N2(n))throw new Error("size must be an integer");if(e.greaterThan(r.pow(n-1).sub(1))||e.lessThan(r.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(r.pow(n))),o="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function u6(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:r,wordSize:o}=L2(t);switch(n){case"fixed":return function(e,t){return e.toFixed(t)}(e,r);case"exponential":return d6(e,r);case"engineering":return function(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,o=e.mul(Math.pow(10,-r)),a=o.toPrecision(t);if(a.includes("e")){a=new(0,e.constructor)(a).toFixed()}return a+"e"+(n>=0?"+":"")+r.toString()}(e,r);case"bin":return c6(e,2,o);case"oct":return c6(e,8,o);case"hex":return c6(e,16,o);case"auto":var a=p6(null==t?void 0:t.lowerExp,-3),i=p6(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";var l=e.toSignificantDigits(r),s=l.e;return(s>=a&&s<i?l.toFixed():d6(e,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function d6(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function p6(e,t){return T1(e)?e:N1(e)?e.toNumber():t}function f6(e,t){var n=e.length-t.length,r=e.length;return e.substring(n,r)===t}function h6(e,t){var n=function(e,t){if("number"==typeof e)return P2(e,t);if(N1(e))return u6(e,t);if(function(e){return e&&"object"==typeof e&&"number"==typeof e.s&&"number"==typeof e.n&&"number"==typeof e.d||!1}(e))return t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d;if(Array.isArray(e))return y6(e,t);if(M1(e))return m6(e);if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e){return"function"==typeof e.format?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):"{"+Object.keys(e).map((n=>m6(n)+": "+h6(e[n],t))).join(", ")+"}"}return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function m6(e){for(var t=String(e),n="",r=0;r<t.length;){var o=t.charAt(r);n+=o in v6?v6[o]:o,r++}return'"'+n+'"'}var v6={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function g6(e){var t=String(e);return t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function y6(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,o=0;o<r;o++)0!==o&&(n+=", "),n+=y6(e[o],t);return n+="]"}return h6(e,t)}function b6(e,t){if(!M1(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+m2(e)+", index: 0)");if(!M1(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+m2(t)+", index: 1)");return e===t?0:e>t?1:-1}function w6(e,t,n){if(!(this instanceof w6))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function x6(e,t,n){if(!(this instanceof x6))throw new 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=n),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=(new Error).stack}function C6(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function _6(e,t,n){var r,o=e.length;if(o!==t[n])throw new w6(o,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<o;r++){var i=e[r];if(!Array.isArray(i))throw new w6(t.length-1,t.length,"<");_6(e[r],t,a)}}else for(r=0;r<o;r++)if(Array.isArray(e[r]))throw new w6(t.length+1,t.length,">")}function E6(e,t){if(0===t.length){if(Array.isArray(e))throw new w6(e.length,0)}else _6(e,t,0)}function S6(e,t){var n=e.isMatrix?e._size:C6(e);t._sourceSize.forEach(((e,t)=>{if(null!==e&&e!==n[t])throw new w6(e,n[t])}))}function k6(e,t){if(void 0!==e){if(!T1(e)||!N2(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new x6(e,t)}}function T6(e){for(var t=0;t<e._dimensions.length;++t){var n=e._dimensions[t];if(n._data&&O1(n._data)){if(0===n._size[0])return!0}else if(n.isRange){if(n.start===n.end)return!0}else if(M1(n)&&0===n.length)return!0}return!1}function N6(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach((function(e){if(!T1(e)||!N2(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+h6(t)+")")})),(T1(e)||N1(e))&&(e=[e]),D6(e,t,0,void 0!==n?n:0),e}function D6(e,t,n,r){var o,a,i=e.length,l=t[n],s=Math.min(i,l);if(e.length=l,n<t.length-1){var c=n+1;for(o=0;o<s;o++)a=e[o],Array.isArray(a)||(a=[a],e[o]=a),D6(a,t,c,r);for(o=s;o<l;o++)a=[],e[o]=a,D6(a,t,c,r)}else{for(o=0;o<s;o++)for(;Array.isArray(e[o]);)e[o]=e[o][0];for(o=s;o<l;o++)e[o]=r}}function A6(e,t){var n=P6(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new w6(0,r,"!=");var o=R6(t=I6(t,r));if(r!==o)throw new w6(o,r,"!=");try{return function(e,t){for(var n,r=e,o=t.length-1;o>0;o--){var a=t[o];n=[];for(var i=r.length/a,l=0;l<i;l++)n.push(r.slice(l*a,(l+1)*a));r=n}return r}(n,t)}catch(HT){if(HT instanceof w6)throw new w6(o,r,"!=");throw HT}}function I6(e,t){var n=R6(e),r=e.slice(),o=e.indexOf(-1);if(e.indexOf(-1,o+1)>=0)throw new Error("More than one wildcard in sizes");if(o>=0){if(!(t%n===0))throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);r[o]=-t/n}return r}function R6(e){return e.reduce(((e,t)=>e*t),1)}function M6(e,t){for(var n=C6(e);Array.isArray(e)&&1===e.length;)e=e[0],n.shift();for(var r=n.length;1===n[r-1];)r--;return r<n.length&&(e=O6(e,r,0),n.length=r),e}function O6(e,t,n){var r,o;if(n<t){var a=n+1;for(r=0,o=e.length;r<o;r++)e[r]=O6(e[r],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function B6(e,t,n,r){var o=r||C6(e);if(n)for(var a=0;a<n;a++)e=[e],o.unshift(1);for(e=V6(e,t,0);o.length<t;)o.push(1);return e}function V6(e,t,n){var r,o;if(Array.isArray(e)){var a=n+1;for(r=0,o=e.length;r<o;r++)e[r]=V6(e[r],t,a)}else for(var i=n;i<t;i++)e=[e];return e}function P6(e){if(!Array.isArray(e))return e;var t=[];return e.forEach((function e(n){Array.isArray(n)?n.forEach(e):t.push(n)})),t}function L6(e,t){return Array.prototype.map.call(e,t)}function F6(e,t){Array.prototype.forEach.call(e,t)}function z6(e,t){if(1!==C6(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function j6(e,t){if(1!==C6(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(e=>t.test(e)))}function $6(e,t){return Array.prototype.join.call(e,t)}function U6(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],n=0;t[0]={value:e[0],identifier:0};for(var r=1;r<e.length;r++)e[r]===e[r-1]?n++:n=0,t.push({value:e[r],identifier:n});return t}function H6(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],n=0;n<e.length;n++)t.push(e[n].value);return t}function q6(e,t){for(var n,r=0,o=0;o<e.length;o++){var a=e[o],i=Array.isArray(a);if(0===o&&i&&(r=a.length),i&&a.length!==r)return;var l=i?q6(a,t):t(a);if(void 0===n)n=l;else if(n!==l)return"mixed"}return n}function W6(e,t,n,r){if(r<n){if(e.length!==t.length)throw new w6(e.length,t.length);for(var o=[],a=0;a<e.length;a++)o[a]=W6(e[a],t[a],n,r+1);return o}return e.concat(t)}function G6(){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,n){return W6(e,n,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function Y6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map((e=>e.length)),o=Math.max(...r),a=new Array(o).fill(null),i=0;i<t.length;i++)for(var l=t[i],s=r[i],c=0;c<s;c++){var u=o-s+c;l[c]>a[u]&&(a[u]=l[c])}for(var d=0;d<t.length;d++)K6(t[d],a);return a}function K6(e,t){for(var n=t.length,r=e.length,o=0;o<r;o++){var a=n-r+o;if(e[o]<t[a]&&e[o]>1||e[o]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[o]," to size ").concat(t[a]))}}function X6(e,t){var n=C6(e);if(y2(n,t))return e;K6(n,t);var r,o,a,i=Y6(n,t),l=i.length,s=[...Array(l-n.length).fill(1),...n],c=function(e){return h1([],e)}(e);n.length<l&&(n=C6(c=A6(c,s)));for(var u=0;u<l;u++)n[u]<i[u]&&(r=c,o=i[u],a=u,n=C6(c=G6(...Array(o).fill(r),a)));return c}function J6(e,t){if(!Array.isArray(e))throw new Error("Array expected");var n=C6(e);if(t.length!==n.length)throw new w6(t.length,n.length);for(var r=0;r<t.length;r++)k6(t[r],n[r]);return t.reduce(((e,t)=>e[t]),e)}function Z6(e,t,n,r,o){if(S2.isTypedFunction(e)){var a=[t,n,r],i=S2.resolve(e,a);if(i)return d(i.implementation,a);var l=[t,n],s=S2.resolve(e,l);if(s)return d(s.implementation,l);var c=[t],u=S2.resolve(e,c);return u?d(u.implementation,c):d(e,a)}return e(t,n,r);function d(a,i){try{return a.apply(a,i)}catch(c){var l;if(c instanceof TypeError&&"wrongType"===(null===(l=c.data)||void 0===l?void 0:l.category)){var s=[];throw s.push("value: ".concat(m2(t))),i.length>=2&&s.push("index: ".concat(m2(n))),i.length>=3&&s.push("array: ".concat(m2(r))),new TypeError("Function ".concat(o," cannot apply callback arguments ")+"".concat(e.name,"(").concat(s.join(", "),") at index ").concat(JSON.stringify(n)))}throw new TypeError("Function ".concat(o," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(c.message))}}}w6.prototype=new RangeError,w6.prototype.constructor=RangeError,w6.prototype.name="DimensionError",w6.prototype.isDimensionError=!0,x6.prototype=new RangeError,x6.prototype.constructor=RangeError,x6.prototype.name="IndexError",x6.prototype.isIndexError=!0;var Q6=k2("DenseMatrix",["Matrix"],(e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M1(t))throw new Error("Invalid datatype: "+t);if(B1(e))"DenseMatrix"===e.type?(this._data=v2(e._data),this._size=v2(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&O1(e.data)&&O1(e.size))this._data=e.data,this._size=e.size,E6(this._data,this._size),this._datatype=t||e.datatype;else if(O1(e))this._data=l(e),this._size=C6(this._data),E6(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+m2(e)+")");this._data=[],this._size=[0],this._datatype=t}}function r(e,t,n,o){var a=o===n-1,i=t.dimension(o);return a?i.map((function(t){return k6(t,e.length),e[t]})).valueOf():i.map((function(a){return k6(a,e.length),r(e[a],t,n,o+1)})).valueOf()}function o(e,t,n,r,a){var i=a===r-1,l=t.dimension(a);i?l.forEach((function(t,r){k6(t),e[t]=n[r[0]]})):l.forEach((function(i,l){k6(i),o(e[i],t,n[l[0]],r,a+1)}))}function a(e,t,n){if(0===t.length){for(var r=e._data;O1(r);)r=r[0];return r}return e._size=t.slice(0),e._data=N6(e._data,e._size,n),e}function i(e,t,n){for(var r=e._size.slice(0),o=!1;r.length<t.length;)r.push(0),o=!0;for(var i=0,l=t.length;i<l;i++)t[i]>r[i]&&(r[i]=t[i],o=!0);o&&a(e,r,n)}function l(e){return B1(e)?l(e.valueOf()):O1(e)?e.map(l):e}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 q6(this._data,m2)},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,a){switch(arguments.length){case 1:return function(e,t){if(!z1(t))throw new TypeError("Invalid index");var o=t.isScalar();if(o)return e.get(t.min());var a=t.size();if(a.length!==e._size.length)throw new w6(a.length,e._size.length);for(var i=t.min(),l=t.max(),s=0,c=e._size.length;s<c;s++)k6(i[s],e._size[s]),k6(l[s],e._size[s]);return new n(r(e._data,t,a.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var a,l=t.size(),s=t.isScalar();B1(n)?(a=n.size(),n=n.valueOf()):a=C6(n);if(s){if(0!==a.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(!y2(a,l))try{a=C6(n=0===a.length?X6([n],l):X6(n,l))}catch(f){}if(l.length<e._size.length)throw new w6(l.length,e._size.length,"<");if(a.length<l.length){for(var c=0,u=0;1===l[c]&&1===a[c];)c++;for(;1===l[c];)u++,c++;n=B6(n,l.length,u,a)}if(!y2(l,a))throw new w6(l,a,">");i(e,t.max().map((function(e){return e+1})),r);var d=l.length,p=0;o(e._data,t,n,d,p)}return e}(this,e,t,a);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){return J6(this._data,e)},n.prototype.set=function(e,t,n){if(!O1(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new w6(e.length,this._size.length,"<");var r,o,a;i(this,e.map((function(e){return e+1})),n);var l=this._data;for(r=0,o=e.length-1;r<o;r++)k6(a=e[r],l.length),l=l[a];return k6(a=e[e.length-1],l.length),l[a]=t,this},n.prototype.resize=function(e,t,n){if(!V1(e))throw new TypeError("Array or Matrix expected");var r=e.valueOf().map((e=>Array.isArray(e)&&1===e.length?e[0]:e));return a(n?this.clone():this,r,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;n._data=A6(n._data,e);var r=n._size.reduce(((e,t)=>e*t));return n._size=I6(e,r),n},n.prototype.clone=function(){return new n({data:v2(this._data),size:v2(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function(n,o){return O1(n)?n.map((function(e,t){return r(e,o.concat(t))})):Z6(e,n,o,t,"map")},o=r(this._data,[]);return new n(o,void 0!==this._datatype?q6(o,m2):void 0)},n.prototype.forEach=function(e){var t=this,n=function(r,o){O1(r)?r.forEach((function(e,t){n(e,o.concat(t))})):e(r,o,t)};n(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function*(t,n){if(O1(t))for(var r=0;r<t.length;r++)yield*e(t[r],n.concat(r));else yield{value:t,index:n}};yield*e(this._data,[])},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t=this._data;for(var r of t)e.push(new n([r],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var o=this._data,a=function(r){var a=o.map((e=>[e[r]]));t.push(new n(a,e._datatype))},i=0;i<r[1];i++)a(i);return t},n.prototype.toArray=function(){return v2(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return h6(this._data,e)},n.prototype.toString=function(){return h6(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(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-r,a-t),l=[],s=0;s<i;s++)l[s]=this._data[s+r][s+t];return new n({data:l,size:[i],datatype:this._datatype})},n.diagonal=function(e,t,r,o){if(!O1(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e)||e<1)throw new Error("Size values must be positive integers");return e})),r){if(N1(r)&&(r=r.toNumber()),!T1(r)||!N2(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var a,i=r>0?r:0,l=r<0?-r:0,s=e[0],c=e[1],u=Math.min(s-l,c-i);if(O1(t)){if(t.length!==u)throw new Error("Invalid value array length");a=function(e){return t[e]}}else if(B1(t)){var d=t.size();if(1!==d.length||d[0]!==u)throw new Error("Invalid matrix length");a=function(e){return t.get([e])}}else a=function(){return t};o||(o=N1(a(0))?a(0).mul(0):0);var p=[];if(e.length>0){p=N6(p,e,o);for(var f=0;f<u;f++)p[f+l][f+i]=a(f)}return new n({data:p,size:[s,c]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!(T1(e)&&N2(e)&&T1(t)&&N2(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return k6(e,this._size[0]),k6(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r},n}),{isClass:!0}),e8="clone",t8=k2(e8,["typed"],(e=>{var{typed:t}=e;return t(e8,{any:v2})}));function n8(e){var t,n,r=e.length,o=e[0].length,a=[];for(n=0;n<o;n++){var i=[];for(t=0;t<r;t++)i.push(e[t][n]);a.push(i)}return a}function r8(e){for(var t=0;t<e.length;t++)if(V1(e[t]))return!0;return!1}function o8(e,t){B1(e)&&(e=e.valueOf());for(var n=0,r=e.length;n<r;n++){var o=e[n];Array.isArray(o)?o8(o,t):t(o)}}function a8(e,t,n){return e&&"function"==typeof e.map?e.map((function(e){return a8(e,t)})):t(e)}function i8(e,t,n){var r=Array.isArray(e)?C6(e):e.size();if(t<0||t>=r.length)throw new x6(t,r.length);return B1(e)?e.create(l8(e.valueOf(),t,n),e.datatype()):l8(e,t,n)}function l8(e,t,n){var r,o,a,i;if(t<=0){if(Array.isArray(e[0])){for(i=n8(e),o=[],r=0;r<i.length;r++)o[r]=l8(i[r],t-1,n);return o}for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}for(o=[],r=0;r<e.length;r++)o[r]=l8(e[r],t-1,n);return o}function s8(e,t,n,r,o,a,i,l,s,c,u){var d,p,f,h,m=e._values,v=e._index,g=e._ptr;if(r)for(p=g[t],f=g[t+1],d=p;d<f;d++)n[h=v[d]]!==a?(n[h]=a,i.push(h),r[h]=m[d]):(r[h]=l(r[h],m[d]),o[h]=a);else for(p=g[t],f=g[t+1],d=p;d<f;d++)n[h=v[d]]!==a?(n[h]=a,i.push(h)):o[h]=a}var c8="isInteger",u8=k2(c8,["typed"],(e=>{var{typed:t}=e;return t(c8,{number:N2,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),d8="number",p8="number, number";function f8(e){return Math.abs(e)}function h8(e,t){return e+t}function m8(e,t){return e-t}function v8(e,t){return e*t}function g8(e){return-e}function y8(e){return e}function b8(e){return O2(e)}function w8(e){return e*e*e}function x8(e){return Math.exp(e)}function C8(e){return B2(e)}function _8(e,t){if(!N2(e)||!N2(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var n,r=e*t;0!==t;)t=e%(n=t),e=n;return Math.abs(r/e)}function E8(e){return R2(e)}function S8(e){return I2(e)}function k8(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t<0;if(n&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return n?1/0:0;if(!isFinite(e))return n?0:e;var r=Math.pow(Math.abs(e),1/t);return r=e<0?-r:r,n?1/r:r}function T8(e){return A2(e)}function N8(e){return e*e}function D8(e,t){var n,r,o,a=0,i=1,l=1,s=0;if(!N2(e)||!N2(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)o=e-(r=Math.floor(e/t))*t,n=a,a=i-r*a,i=n,n=l,l=s-r*l,s=n,e=t,t=o;return e<0?[-e,-i,-s]:[e,e?i:0,s]}function A8(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function I8(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!N2(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(z2(e,t))}f8.signature=d8,h8.signature=p8,m8.signature=p8,v8.signature=p8,g8.signature=d8,y8.signature=d8,b8.signature=d8,w8.signature=d8,x8.signature=d8,C8.signature=d8,_8.signature=p8,E8.signature=d8,S8.signature=d8,T8.signature=d8,N8.signature=d8,D8.signature=p8,A8.signature=p8;var R8="number, number";function M8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function bitAnd");return e&t}function O8(e){if(!N2(e))throw new Error("Integer expected in function bitNot");return~e}function B8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function bitOr");return e|t}function V8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function bitXor");return e^t}function P8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function leftShift");return e<<t}function L8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function F8(e,t){if(!N2(e)||!N2(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}function z8(e,t){if(t<e)return 1;if(t===e)return t;var n=t+e>>1;return z8(e,n)*z8(n+1,t)}function j8(e,t){if(!N2(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!N2(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var n=e-t,r=1,o=2,a=t<n?t:n,i=t<n?n+1:t+1;i<=e;++i)for(r*=i;o<=a&&r%o===0;)r/=o,++o;return o<=a&&(r/=z8(o,a)),r}M8.signature=R8,O8.signature="number",B8.signature=R8,V8.signature=R8,P8.signature=R8,L8.signature=R8,F8.signature=R8,j8.signature="number, number";var $8=Math.PI,U8=2*Math.PI,H8=Math.E,q8="number, number";function W8(e){return!e}function G8(e,t){return!(!e&&!t)}function Y8(e,t){return!!e!=!!t}function K8(e,t){return!(!e||!t)}function X8(e){var t;if(N2(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:z8(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*X8(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,o=r*e,a=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*o)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=Z8[0];for(var i=1;i<Z8.length;++i)t+=Z8[i]/(e+i);var l=e+J8+.5;return Math.sqrt(2*Math.PI)*Math.pow(l,e+.5)*Math.exp(-l)*t}W8.signature="number",G8.signature=q8,Y8.signature=q8,K8.signature=q8,X8.signature="number";var J8=4.7421875,Z8=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Q8=.9189385332046728,e5=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function t5(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-t5(1-e);for(var t=(e-=1)+5+.5,n=e5[0],r=6;r>=1;r--)n+=e5[r]/(e+r);return Q8+(e+.5)*Math.log(t)-t+Math.log(n)}t5.signature="number";var n5="number";function r5(e){return q2(e)}function o5(e){return Math.atan(1/e)}function a5(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function i5(e){return Math.asin(1/e)}function l5(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function s5(e){return Math.acos(1/e)}function c5(e){var t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}function u5(e){return W2(e)}function d5(e){return G2(e)}function p5(e){return 1/Math.tan(e)}function f5(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function h5(e){return 1/Math.sin(e)}function m5(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*A2(e)}function v5(e){return 1/Math.cos(e)}function g5(e){return 2/(Math.exp(e)+Math.exp(-e))}function y5(e){return K2(e)}r5.signature=n5,o5.signature=n5,a5.signature=n5,i5.signature=n5,l5.signature=n5,s5.signature=n5,c5.signature=n5,u5.signature=n5,d5.signature=n5,p5.signature=n5,f5.signature=n5,h5.signature=n5,m5.signature=n5,v5.signature=n5,g5.signature=n5,y5.signature=n5;var b5="number";function w5(e){return e<0}function x5(e){return e>0}function C5(e){return Number.isNaN(e)}function _5(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new 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(n),r)):e.eq(t))}w5.signature=b5,x5.signature=b5,C5.signature=b5;var E5="isNegative",S5=k2(E5,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(E5,{number:e=>!H2(e,0,n.relTol,n.absTol)&&w5(e),BigNumber:e=>!_5(e,new e.constructor(0),n.relTol,n.absTol)&&(e.isNeg()&&!e.isZero()&&!e.isNaN()),bigint:e=>e<0n,Fraction:e=>e.s<0,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),k5="isNumeric",T5=k2(k5,["typed"],(e=>{var{typed:t}=e;return t(k5,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),N5="hasNumericValue",D5=k2(N5,["typed","isNumeric"],(e=>{var{typed:t,isNumeric:n}=e;return t(N5,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})})),A5="isPositive",I5=k2(A5,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(A5,{number:e=>!H2(e,0,n.relTol,n.absTol)&&x5(e),BigNumber:e=>!_5(e,new e.constructor(0),n.relTol,n.absTol)&&(!e.isNeg()&&!e.isZero()&&!e.isNaN()),bigint:e=>e>0n,Fraction:e=>e.s>0&&e.n>0,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),R5="isZero",M5=k2(R5,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(R5,{"number | BigNumber | Complex | Fraction":e=>n(e,0),bigint:e=>0n===e,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),O5="isNaN",B5=k2(O5,["typed"],(e=>{var{typed:t}=e;return t(O5,{number:C5,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=>a8(t,e)))})})),V5="typeOf",P5=k2(V5,["typed"],(e=>{var{typed:t}=e;return t(V5,{any:m2})}));var L5=k2("compareUnits",["typed"],(e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf((e=>(n,r)=>{if(!n.equalBase(r))throw new Error("Cannot compare units with different base");return t.find(e,[n.valueType(),r.valueType()])(n.value,r.value)}))}})),F5="equalScalar",z5=k2(F5,["typed","config"],(e=>{var{typed:t,config:n}=e,r=L5({typed:t});return t(F5,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return H2(e,t,n.relTol,n.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||_5(e,t,n.relTol,n.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,n,r){return H2(e.re,t.re,n,r)&&H2(e.im,t.im,n,r)}(e,t,n.relTol,n.absTol)}},r)}));k2(F5,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(F5,{"number, number":function(e,t){return H2(e,t,n.relTol,n.absTol)}})}));var j5=k2("SparseMatrix",["typed","equalScalar","Matrix"],(e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M1(t))throw new Error("Invalid datatype: "+t);if(B1(e))!function(e,t,n){"SparseMatrix"===t.type?(e._values=t._values?v2(t._values):void 0,e._index=v2(t._index),e._ptr=v2(t._ptr),e._size=v2(t._size),e._datatype=n||t._datatype):a(e,t.valueOf(),n||t._datatype)}(this,e,t);else if(e&&O1(e.index)&&O1(e.ptr)&&O1(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(O1(e))a(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+m2(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function a(e,r,o){e._values=[],e._index=[],e._ptr=[],e._datatype=o;var a=r.length,i=0,l=n,s=0;if(M1(o)&&(l=t.find(n,[o,o])||n,s=t.convert(0,o)),a>0){var c=0;do{e._ptr.push(e._index.length);for(var u=0;u<a;u++){var d=r[u];if(O1(d)){if(0===c&&i<d.length&&(i=d.length),c<d.length){var p=d[c];l(p,s)||(e._values.push(p),e._index.push(u))}}else 0===c&&i<1&&(i=1),l(d,s)||(e._values.push(d),e._index.push(u))}c++}while(c<i)}e._ptr.push(e._index.length),e._size=[a,i]}function i(e,t,n,r){if(n-t===0)return n;for(var o=t;o<n;o++)if(r[o]===e)return o;return t}function l(e,t,n,r,o,a,i){o.splice(e,0,r),a.splice(e,0,t);for(var l=n+1;l<i.length;l++)i[l]++}function s(e,r,o,a){var i=a||0,l=n,s=0;M1(e._datatype)&&(l=t.find(n,[e._datatype,e._datatype])||n,s=t.convert(0,e._datatype),i=t.convert(i,e._datatype));var c,u,d,p=!l(i,s),f=e._size[0],h=e._size[1];if(o>h){for(u=h;u<o;u++)if(e._ptr[u]=e._values.length,p)for(c=0;c<f;c++)e._values.push(i),e._index.push(c);e._ptr[o]=e._values.length}else o<h&&(e._ptr.splice(o+1,h-o),e._values.splice(e._ptr[o],e._values.length),e._index.splice(e._ptr[o],e._index.length));if(h=o,r>f){if(p){var m=0;for(u=0;u<h;u++){e._ptr[u]=e._ptr[u]+m,d=e._ptr[u+1]+m;var v=0;for(c=f;c<r;c++,v++)e._values.splice(d+v,0,i),e._index.splice(d+v,0,c),m++}e._ptr[h]=e._values.length}}else if(r<f){var g=0;for(u=0;u<h;u++){e._ptr[u]=e._ptr[u]-g;var y=e._ptr[u],b=e._ptr[u+1]-g;for(d=y;d<b;d++)(c=e._index[d])>r-1&&(e._values.splice(d,1),e._index.splice(d,1),g++)}e._ptr[u]=e._values.length}return e._size[0]=r,e._size[1]=o,e}function c(e,t,n,r,o){var a,i,l=r[0],s=r[1],c=[];for(a=0;a<l;a++)for(c[a]=[],i=0;i<s;i++)c[a][i]=0;for(i=0;i<s;i++)for(var u=n[i],d=n[i+1],p=u;p<d;p++)c[a=t[p]][i]=e?o?v2(e[p]):e[p]:1;return c}return o.prototype=new r,o.prototype.createSparseMatrix=function(e,t){return new o(e,t)},Object.defineProperty(o,"name",{value:"SparseMatrix"}),o.prototype.constructor=o,o.prototype.type="SparseMatrix",o.prototype.isSparseMatrix=!0,o.prototype.getDataType=function(){return q6(this._values,m2)},o.prototype.storage=function(){return"sparse"},o.prototype.datatype=function(){return this._datatype},o.prototype.create=function(e,t){return new o(e,t)},o.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},o.prototype.subset=function(e,t,n){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!z1(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,r,a,i,l=t.size();if(l.length!==e._size.length)throw new w6(l.length,e._size.length);var s=t.min(),c=t.max();for(n=0,r=e._size.length;n<r;n++)k6(s[n],e._size[n]),k6(c[n],e._size[n]);var u=e._values,d=e._index,p=e._ptr,f=t.dimension(0),h=t.dimension(1),m=[],v=[];f.forEach((function(e,t){v[e]=t[0],m[e]=!0}));var g=u?[]:void 0,y=[],b=[];return h.forEach((function(e){for(b.push(y.length),a=p[e],i=p[e+1];a<i;a++)n=d[a],!0===m[n]&&(y.push(v[n]),g&&g.push(u[a]))})),b.push(y.length),new o({values:g,index:y,ptr:b,size:l,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var o,a=t.size(),i=t.isScalar();B1(n)?(o=n.size(),n=n.toArray()):o=C6(n);if(i){if(0!==o.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(1!==a.length&&2!==a.length)throw new w6(a.length,e._size.length,"<");if(o.length<a.length){for(var l=0,s=0;1===a[l]&&1===o[l];)l++;for(;1===a[l];)s++,l++;n=B6(n,a.length,s,o)}if(!y2(a,o))throw new w6(a,o,">");if(1===a.length){t.dimension(0).forEach((function(t,o){k6(t),e.set([t,0],n[o[0]],r)}))}else{var c=t.dimension(0),u=t.dimension(1);c.forEach((function(t,o){k6(t),u.forEach((function(a,i){k6(a),e.set([t,a],n[o[0]][i[0]],r)}))}))}}return e}(this,e,t,n);default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.get=function(e){if(!O1(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new w6(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];k6(t,this._size[0]),k6(n,this._size[1]);var r=i(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},o.prototype.set=function(e,r,o){if(!O1(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new w6(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var a=e[0],c=e[1],u=this._size[0],d=this._size[1],p=n,f=0;M1(this._datatype)&&(p=t.find(n,[this._datatype,this._datatype])||n,f=t.convert(0,this._datatype)),(a>u-1||c>d-1)&&(s(this,Math.max(a+1,u),Math.max(c+1,d),o),u=this._size[0],d=this._size[1]),k6(a,u),k6(c,d);var h=i(a,this._ptr[c],this._ptr[c+1],this._index);return h<this._ptr[c+1]&&this._index[h]===a?p(r,f)?function(e,t,n,r,o){n.splice(e,1),r.splice(e,1);for(var a=t+1;a<o.length;a++)o[a]--}(h,c,this._values,this._index,this._ptr):this._values[h]=r:p(r,f)||l(h,a,c,r,this._values,this._index,this._ptr),this},o.prototype.resize=function(e,t,n){if(!V1(e))throw new TypeError("Array or Matrix expected");var r=e.valueOf().map((e=>Array.isArray(e)&&1===e.length?e[0]:e));if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(e){if(!T1(e)||!N2(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+h6(r)+")")})),s(n?this.clone():this,r[0],r[1],t)},o.prototype.reshape=function(e,t){if(!O1(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!T1(t)||!N2(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+h6(e)+")")}));var n=this._size[0]*this._size[1];if(n!==(e=I6(e,n))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;for(var o=[],a=0;a<r._ptr.length;a++)for(var s=0;s<r._ptr[a+1]-r._ptr[a];s++)o.push(a);for(var c=r._values.slice(),u=r._index.slice(),d=0;d<r._index.length;d++){var p=u[d],f=o[d],h=p*r._size[1]+f;o[d]=h%e[1],u[d]=Math.floor(h/e[1])}r._values.length=0,r._index.length=0,r._ptr.length=e[1]+1,r._size=e.slice();for(var m=0;m<r._ptr.length;m++)r._ptr[m]=0;for(var v=0;v<c.length;v++){var g=u[v],y=o[v],b=c[v];l(i(g,r._ptr[y],r._ptr[y+1],r._index),g,y,b,r._values,r._index,r._ptr)}return r},o.prototype.clone=function(){return new o({values:this._values?v2(this._values):void 0,index:v2(this._index),ptr:v2(this._ptr),size:v2(this._size),datatype:this._datatype})},o.prototype.size=function(){return this._size.slice(0)},o.prototype.map=function(e,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var a=this;return function(e,r,a,i,l,s,c){var u=[],d=[],p=[],f=n,h=0;M1(e._datatype)&&(f=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype));for(var m=function(e,t,n){var r=s(e,t,n);f(r,h)||(u.push(r),d.push(t))},v=i;v<=l;v++){p.push(u.length);var g=e._ptr[v],y=e._ptr[v+1];if(c)for(var b=g;b<y;b++){var w=e._index[b];w>=r&&w<=a&&m(e._values[b],w-r,v-i)}else{for(var x={},C=g;C<y;C++){x[e._index[C]]=e._values[C]}for(var _=r;_<=a;_++){m(_ in x?x[_]:0,_-r,v-i)}}}return p.push(u.length),new o({values:u,index:d,ptr:p,size:[a-r+1,l-i+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,(function(t,n,r){return Z6(e,t,[n,r],a,"map")}),r)},o.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],o=0;o<r;o++){var a=this._ptr[o],i=this._ptr[o+1];if(t)for(var l=a;l<i;l++){var s=this._index[l];e(this._values[l],[s,o],this)}else{for(var c={},u=a;u<i;u++){c[this._index[u]]=this._values[u]}for(var d=0;d<n;d++){e(d in c?c[d]:0,[d,o],this)}}}},o.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],r=this._ptr[t+1],o=n;o<r;o++){var a=this._index[o];yield{value:this._values[o],index:[a,t]}}},o.prototype.toArray=function(){return c(this._values,this._index,this._ptr,this._size,!0)},o.prototype.valueOf=function(){return c(this._values,this._index,this._ptr,this._size,!1)},o.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),o="Sparse Matrix ["+h6(t,e)+" x "+h6(n,e)+"] density: "+h6(r,e)+"\n",a=0;a<n;a++)for(var i=this._ptr[a],l=this._ptr[a+1],s=i;s<l;s++){o+="\n ("+h6(this._index[s],e)+", "+h6(a,e)+") ==> "+(this._values?h6(this._values[s],e):"X")}return o},o.prototype.toString=function(){return h6(this.toArray())},o.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},o.prototype.diagonal=function(e){if(e){if(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],a=this._size[1],i=Math.min(r-n,a-t),l=[],s=[],c=[];c[0]=0;for(var u=t;u<a&&l.length<i;u++)for(var d=this._ptr[u],p=this._ptr[u+1],f=d;f<p;f++){var h=this._index[f];if(h===u-t+n){l.push(this._values[f]),s[l.length-1]=h-n;break}}return c.push(l.length),new o({values:l,index:s,ptr:c,size:[i,1]})},o.fromJSON=function(e){return new o(e)},o.diagonal=function(e,r,a,i,l){if(!O1(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(N1(e)&&(e=e.toNumber()),!T1(e)||!N2(e)||e<1)throw new Error("Size values must be positive integers");return e})),a){if(N1(a)&&(a=a.toNumber()),!T1(a)||!N2(a))throw new TypeError("The parameter k must be an integer number")}else a=0;var s=n,c=0;M1(l)&&(s=t.find(n,[l,l])||n,c=t.convert(0,l));var u,d=a>0?a:0,p=a<0?-a:0,f=e[0],h=e[1],m=Math.min(f-p,h-d);if(O1(r)){if(r.length!==m)throw new Error("Invalid value array length");u=function(e){return r[e]}}else if(B1(r)){var v=r.size();if(1!==v.length||v[0]!==m)throw new Error("Invalid matrix length");u=function(e){return r.get([e])}}else u=function(){return r};for(var g=[],y=[],b=[],w=0;w<h;w++){b.push(g.length);var x=w-d;if(x>=0&&x<m){var C=u(x);s(C,c)||(y.push(x+p),g.push(C))}}return b.push(g.length),new o({values:g,index:y,ptr:b,size:[f,h]})},o.prototype.swapRows=function(e,t){if(!(T1(e)&&N2(e)&&T1(t)&&N2(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return k6(e,this._size[0]),k6(t,this._size[0]),o._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},o._forEachRow=function(e,t,n,r,o){for(var a=r[e],i=r[e+1],l=a;l<i;l++)o(n[l],t[l])},o._swapRows=function(e,t,n,r,o,a){for(var l=0;l<n;l++){var s=a[l],c=a[l+1],u=i(e,s,c,o),d=i(t,s,c,o);if(u<c&&d<c&&o[u]===e&&o[d]===t){if(r){var p=r[u];r[u]=r[d],r[d]=p}}else if(u<c&&o[u]===e&&(d>=c||o[d]!==t)){var f=r?r[u]:void 0;o.splice(d,0,t),r&&r.splice(d,0,f),o.splice(d<=u?u+1:u,1),r&&r.splice(d<=u?u+1:u,1)}else if(d<c&&o[d]===t&&(u>=c||o[u]!==e)){var h=r?r[d]:void 0;o.splice(u,0,e),r&&r.splice(u,0,h),o.splice(u<=d?d+1:d,1),r&&r.splice(u<=d?d+1:d,1)}}},o}),{isClass:!0});var $5=k2("number",["typed"],(e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t,n,r=(n=(t=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:t,radix:{"0b":2,"0o":8,"0x":16}[n[1]],integerPart:n[2],fractionalPart:n[3]}:null;if(r)return function(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++)n+=parseInt(e.fractionalPart[r],e.radix)/Math.pow(e.radix,r+1);var o=t+n;if(isNaN(o))throw new SyntaxError('String "'+e.input+'" is not a valid number');return o}(r);var o=0,a=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);a&&(o=Number(a[2]),e=a[1]);var i=Number(e);if(isNaN(i))throw new SyntaxError('String "'+e+'" is not a valid number');if(a){if(i>2**o-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));i>=2**(o-1)&&(i-=2**o)}return i},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((e=>t=>{var n=t.clone();return n.value=e(t.value),n})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))});return n.fromJSON=function(e){return parseFloat(e.value)},n})),U5=k2("bigint",["typed"],(e=>{var{typed:t}=e,n=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=>a8(t,e)))});return n.fromJSON=function(e){return BigInt(e.value)},n})),H5="string",q5=k2(H5,["typed"],(e=>{var{typed:t}=e;return t(H5,{"":function(){return""},number:P2,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),any:function(e){return String(e)}})})),W5="boolean",G5=k2(W5,["typed"],(e=>{var{typed:t}=e;return t(W5,{"":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 n=Number(e);if(""!==e&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),Y5=k2("bignumber",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(e){return new n(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var r=t[2],o=n(t[1]),a=new n(2).pow(Number(r));if(o.gt(a.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var i=new n(2).pow(Number(r)-1);return o.gte(i)?o.sub(a):o}return new n(e)},BigNumber:function(e){return e},bigint:function(e){return new n(e.toString())},Unit:t.referToSelf((e=>t=>{var n=t.clone();return n.value=e(t.value),n})),Fraction:function(e){return new n(e.n).div(e.d).times(e.s)},null:function(e){return new n(0)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),K5=k2("complex",["typed","Complex"],(e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(e){return new n(e,0)},"number, number":function(e,t){return new n(e,t)},"BigNumber, BigNumber":function(e,t){return new n(e.toNumber(),t.toNumber())},Fraction:function(e){return new n(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return n(e)},null:function(e){return n(0)},Object:function(e){if("re"in e&&"im"in e)return new n(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new n(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),X5=k2("fraction",["typed","Fraction"],(e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new n(e)},string:function(e){return new n(e)},"number, number":function(e,t){return new n(e,t)},null:function(e){return new n(0)},BigNumber:function(e){return new n(e.toString())},bigint:function(e){return new n(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((e=>t=>{var n=t.clone();return n.value=e(t.value),n})),Object:function(e){return new n(e)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),J5="matrix",Z5=k2(J5,["typed","Matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:o}=e;return t(J5,{"":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,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new o(e,n);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Q5="matrixFromFunction",e9=k2(Q5,["typed","matrix","isZero"],(e=>{var{typed:t,matrix:n,isZero:r}=e;return t(Q5,{"Array | Matrix, function, string, string":function(e,t,n,r){return o(e,t,n,r)},"Array | Matrix, function, string":function(e,t,n){return o(e,t,n)},"Matrix, function":function(e,t){return o(e,t,"dense")},"Array, function":function(e,t){return o(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,n){return o(e,n,t)},"Array | Matrix, string, string, function":function(e,t,n,r){return o(e,r,t,n)}});function o(e,t,o,a){var i;return(i=void 0!==a?n(o,a):n(o)).resize(e),i.forEach((function(e,n){var o=t(n);r(o)||i.set(n,o)})),i}})),t9="matrixFromRows",n9=k2(t9,["typed","matrix","flatten","size"],(e=>{var{typed:t,matrix:n,flatten:r,size:o}=e;return t(t9,{"...Array":function(e){return a(e)},"...Matrix":function(e){return n(a(e.map((e=>e.toArray()))))}});function a(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var t=i(e[0]),n=[];for(var o of e){var a=i(o);if(a!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|a));n.push(r(o))}return n}function i(e){var t=o(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),r9="matrixFromColumns",o9=k2(r9,["typed","matrix","flatten","size"],(e=>{var{typed:t,matrix:n,flatten:r,size:o}=e;return t(r9,{"...Array":function(e){return a(e)},"...Matrix":function(e){return n(a(e.map((e=>e.toArray()))))}});function a(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var t=i(e[0]),n=[],o=0;o<t;o++)n[o]=[];for(var a of e){var l=i(a);if(l!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|l));for(var s=r(a),c=0;c<t;c++)n[c].push(s[c])}return n}function i(e){var t=o(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),a9="splitUnit",i9=k2(a9,["typed"],(e=>{var{typed:t}=e;return t(a9,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),l9="unaryMinus",s9=k2(l9,["typed"],(e=>{var{typed:t}=e;return t(l9,{number:g8,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf((e=>n=>{var r=n.clone();return r.value=t.find(e,r.valueType())(n.value),r})),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),c9="unaryPlus",u9=k2(c9,["typed","config","numeric"],(e=>{var{typed:t,config:n,numeric:r}=e;return t(c9,{number:y8,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=>a8(t,e))),boolean:function(e){return r(e?1:0,n.number)},string:function(e){return r(e,D2(e,n))}})})),d9=k2("abs",["typed"],(e=>{var{typed:t}=e;return t("abs",{number:f8,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),p9="apply",f9=k2(p9,["typed","isInteger"],(e=>{var{typed:t,isInteger:n}=e;return t(p9,{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(e)?C6(e):e.size();if(t<0||t>=o.length)throw new x6(t,o.length);return B1(e)?e.create(h9(e.valueOf(),t,r),e.datatype()):h9(e,t,r)}})}));function h9(e,t,n){var r,o,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,n,r=e.length,o=e[0].length,a=[];for(n=0;n<o;n++){var i=[];for(t=0;t<r;t++)i.push(e[t][n]);a.push(i)}return a}(e),o=[],r=0;r<a.length;r++)o[r]=h9(a[r],t-1,n);return o}return n(e)}for(o=[],r=0;r<e.length;r++)o[r]=h9(e[r],t-1,n);return o}var m9="addScalar",v9=k2(m9,["typed"],(e=>{var{typed:t}=e;return t(m9,{"number, number":h8,"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=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(e,[o.valueType(),r.valueType()])(o.value,r.value),o.fixPrefix=!1,o}))})})),g9="subtractScalar",y9=k2(g9,["typed"],(e=>{var{typed:t}=e;return t(g9,{"number, number":m8,"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=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(e,[o.valueType(),r.valueType()])(o.value,r.value),o.fixPrefix=!1,o}))})})),b9="cbrt",w9=k2(b9,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(e=>{var{config:t,typed:n,isNegative:r,unaryMinus:o,matrix:a,Complex:i,BigNumber:l,Fraction:s}=e;return n(b9,{number:b8,Complex:c,"Complex, boolean":c,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&A1(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=c(e.value),t}var n,a=r(e.value);a&&(e.value=o(e.value)),n=N1(e.value)?new l(1).div(3):I1(e.value)?new s(1,3):1/3;var i=e.pow(n);return a&&(i.value=o(i.value)),i}});function c(e,n){var r=e.arg()/3,o=e.abs(),l=new i(b8(o),0).mul(new i(0,r).exp());if(n){var s=[l,new i(b8(o),0).mul(new i(0,r+2*Math.PI/3).exp()),new i(b8(o),0).mul(new i(0,r-2*Math.PI/3).exp())];return"Array"===t.matrix?s:a(s)}return l}})),x9=k2("matAlgo11xS0s",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o,a){var i=e._values,l=e._index,s=e._ptr,c=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,p=c[0],f=c[1],h=n,m=0,v=o;"string"==typeof u&&(d=u,h=t.find(n,[d,d]),m=t.convert(0,d),r=t.convert(r,d),v=t.find(o,[d,d]));for(var g=[],y=[],b=[],w=0;w<f;w++){b[w]=y.length;for(var x=s[w],C=s[w+1],_=x;_<C;_++){var E=l[_],S=a?v(r,i[_]):v(i[_],r);h(S,m)||(y.push(E),g.push(S))}}return b[f]=y.length,e.createSparseMatrix({values:g,index:y,ptr:b,size:[p,f],datatype:d})}})),C9=k2("matAlgo12xSfs",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,o,a){var i=e._values,l=e._index,s=e._ptr,c=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,p=c[0],f=c[1],h=o;"string"==typeof u&&(d=u,r=t.convert(r,d),h=t.find(o,[d,d]));for(var m=[],v=[],g=[],y=0;y<f;y++){for(var b=y+1,w=s[y],x=s[y+1],C=w;C<x;C++){var _=l[C];v[_]=i[C],g[_]=b}for(var E=0;E<p;E++)0===y&&(m[E]=[]),g[E]===b?m[E][y]=a?h(r,v[E]):h(v[E],r):m[E][y]=a?h(r,0):h(0,r)}return new n({data:m,size:[p,f],datatype:d})}})),_9=k2("matAlgo14xDs",["typed"],(e=>{var{typed:t}=e;return function(e,r,o,a){var i,l=e._data,s=e._size,c=e._datatype,u=o;"string"==typeof c&&(i=c,r=t.convert(r,i),u=t.find(o,[i,i]));var d=s.length>0?n(u,0,s,s[0],l,r,a):[];return e.createDenseMatrix({data:d,size:v2(s),datatype:i})};function n(e,t,r,o,a,i,l){var s=[];if(t===r.length-1)for(var c=0;c<o;c++)s[c]=l?e(i,a[c]):e(a[c],i);else for(var u=0;u<o;u++)s[u]=n(e,t+1,r,r[t+1],a[u],i,l);return s}})),E9="ceil",S9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],k9=k2(E9,["typed","config","round"],(e=>{var{typed:t,config:n,round:r}=e;return t(E9,{number:function(e){return H2(e,r(e),n.relTol,n.absTol)?r(e):Math.ceil(e)},"number, number":function(e,t){if(H2(e,r(e,t),n.relTol,n.absTol))return r(e,t);var[o,a]="".concat(e,"e").split("e"),i=Math.ceil(Number("".concat(o,"e").concat(Number(a)+t)));return[o,a]="".concat(i,"e").split("e"),Number("".concat(o,"e").concat(Number(a)-t))}})})),T9=k2(E9,S9,(e=>{var{typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l}=e,s=x9({typed:t,equalScalar:a}),c=C9({typed:t,DenseMatrix:l}),u=_9({typed:t}),d=k9({typed:t,config:n,round:r});return t("ceil",{number:d.signatures.number,"number,number":d.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:function(e){return _5(e,r(e),n.relTol,n.absTol)?r(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return _5(e,r(e,t),n.relTol,n.absTol)?r(e,t):e.toDecimalPlaces(t.toNumber(),F3.ROUND_CEIL)},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())},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>a8(t,(t=>e(t,n))))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>s(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>u(o(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>a(t,0)?i(n.size(),n.storage()):"dense"===n.storage()?u(n,t,e,!0):c(n,t,e,!0)))})})),N9="cube",D9=k2(N9,["typed"],(e=>{var{typed:t}=e;return t(N9,{number:w8,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)}})})),A9=k2("exp",["typed"],(e=>{var{typed:t}=e;return t("exp",{number:x8,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),I9="expm1",R9=k2(I9,["typed","Complex"],(e=>{var{typed:t,Complex:n}=e;return t(I9,{number:C8,Complex:function(e){var t=Math.exp(e.re);return new n(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})})),M9="fix",O9=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],B9=k2(M9,["typed","ceil","floor"],(e=>{var{typed:t,ceil:n,floor:r}=e;return t(M9,{number:function(e){return e>0?r(e):n(e)},"number, number":function(e,t){return e>0?r(e,t):n(e,t)}})})),V9=k2(M9,O9,(e=>{var{typed:t,Complex:n,matrix:r,ceil:o,floor:a,equalScalar:i,zeros:l,DenseMatrix:s}=e,c=C9({typed:t,DenseMatrix:s}),u=_9({typed:t}),d=B9({typed:t,ceil:o,floor:a});return t("fix",{number:d.signatures.number,"number, number | BigNumber":d.signatures["number,number"],Complex:function(e){return new n(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 n(e.re>0?a(e.re,t):o(e.re,t),e.im>0?a(e.im,t):o(e.im,t))},"Complex, BigNumber":function(e,t){var r=t.toNumber();return new n(e.re>0?a(e.re,r):o(e.re,r),e.im>0?a(e.im,r):o(e.im,r))},BigNumber:function(e){return e.isNegative()?o(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?o(e,t):a(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?o(e,t):a(e,t)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"Array | Matrix, number | BigNumber":t.referToSelf((e=>(t,n)=>a8(t,(t=>e(t,n))))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>u(r(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>i(t,0)?l(n.size(),n.storage()):"dense"===n.storage()?u(n,t,e,!0):c(n,t,e,!0)))})})),P9="floor",L9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],F9=k2(P9,["typed","config","round"],(e=>{var{typed:t,config:n,round:r}=e;return t(P9,{number:function(e){return H2(e,r(e),n.relTol,n.absTol)?r(e):Math.floor(e)},"number, number":function(e,t){if(H2(e,r(e,t),n.relTol,n.absTol))return r(e,t);var[o,a]="".concat(e,"e").split("e"),i=Math.floor(Number("".concat(o,"e").concat(Number(a)+t)));return[o,a]="".concat(i,"e").split("e"),Number("".concat(o,"e").concat(Number(a)-t))}})})),z9=k2(P9,L9,(e=>{var{typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l}=e,s=x9({typed:t,equalScalar:a}),c=C9({typed:t,DenseMatrix:l}),u=_9({typed:t}),d=F9({typed:t,config:n,round:r});return t("floor",{number:d.signatures.number,"number,number":d.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:function(e){return _5(e,r(e),n.relTol,n.absTol)?r(e):e.floor()},"BigNumber, BigNumber":function(e,t){return _5(e,r(e,t),n.relTol,n.absTol)?r(e,t):e.toDecimalPlaces(t.toNumber(),F3.ROUND_FLOOR)},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())},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>a8(t,(t=>e(t,n))))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>s(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>u(o(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>a(t,0)?i(n.size(),n.storage()):"dense"===n.storage()?u(n,t,e,!0):c(n,t,e,!0)))})})),j9=k2("matAlgo02xDS0",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o,a){var i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=r._values,u=r._index,d=r._ptr,p=r._size,f=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(l.length!==p.length)throw new w6(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,m=l[0],v=l[1],g=n,y=0,b=o;"string"==typeof s&&s===f&&"mixed"!==s&&(h=s,g=t.find(n,[h,h]),y=t.convert(0,h),b=t.find(o,[h,h]));for(var w=[],x=[],C=[],_=0;_<v;_++){C[_]=x.length;for(var E=d[_],S=d[_+1],k=E;k<S;k++){var T=u[k],N=a?b(c[k],i[T][_]):b(i[T][_],c[k]);g(N,y)||(x.push(T),w.push(N))}}return C[v]=x.length,r.createSparseMatrix({values:w,index:x,ptr:C,size:[m,v],datatype:s===e._datatype&&f===r._datatype?h:void 0})}})),$9=k2("matAlgo03xDSf",["typed"],(e=>{var{typed:t}=e;return function(e,n,r,o){var a=e._data,i=e._size,l=e._datatype||e.getDataType(),s=n._values,c=n._index,u=n._ptr,d=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(i.length!==d.length)throw new w6(i.length,d.length);if(i[0]!==d[0]||i[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+d+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var f,h=i[0],m=i[1],v=0,g=r;"string"==typeof l&&l===p&&"mixed"!==l&&(f=l,v=t.convert(0,f),g=t.find(r,[f,f]));for(var y=[],b=0;b<h;b++)y[b]=[];for(var w=[],x=[],C=0;C<m;C++){for(var _=C+1,E=u[C],S=u[C+1],k=E;k<S;k++){var T=c[k];w[T]=o?g(s[k],a[T][C]):g(a[T][C],s[k]),x[T]=_}for(var N=0;N<h;N++)x[N]===_?y[N][C]=w[N]:y[N][C]=o?g(v,a[N][C]):g(a[N][C],v)}return e.createDenseMatrix({data:y,size:[h,m],datatype:l===e._datatype&&p===n._datatype?f:void 0})}})),U9=k2("matAlgo05xSfSf",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));var x,C,_,E,S=a&&u?[]:void 0,k=[],T=[],N=S?[]:void 0,D=S?[]:void 0,A=[],I=[];for(C=0;C<g;C++){T[C]=k.length;var R=C+1;for(_=l[C],E=l[C+1];_<E;_++)x=i[_],k.push(x),A[x]=R,N&&(N[x]=a[_]);for(_=p[C],E=p[C+1];_<E;_++)A[x=d[_]]!==R&&k.push(x),I[x]=R,D&&(D[x]=u[_]);if(S)for(_=T[C];_<k.length;){var M=A[x=k[_]],O=I[x];if(M===R||O===R){var B=w(M===R?N[x]:b,O===R?D[x]:b);y(B,b)?k.splice(_,1):(S.push(B),_++)}}}return T[g]=k.length,e.createSparseMatrix({values:S,index:k,ptr:T,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),H9=k2("matAlgo13xDD",["typed"],(e=>{var{typed:t}=e;return function(e,r,o){var a,i=e._data,l=e._size,s=e._datatype,c=r._data,u=r._size,d=r._datatype,p=[];if(l.length!==u.length)throw new w6(l.length,u.length);for(var f=0;f<l.length;f++){if(l[f]!==u[f])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+u+")");p[f]=l[f]}var h=o;"string"==typeof s&&s===d&&(a=s,h=t.find(o,[a,a]));var m=p.length>0?n(h,0,p,p[0],i,c):[];return e.createDenseMatrix({data:m,size:p,datatype:a})};function n(e,t,r,o,a,i){var l=[];if(t===r.length-1)for(var s=0;s<o;s++)l[s]=e(a[s],i[s]);else for(var c=0;c<o;c++)l[c]=n(e,t+1,r,r[t+1],a[c],i[c]);return l}}));function q9(e,t){if(y2(e.size(),t.size()))return[e,t];var n=Y6(e.size(),t.size());return[e,t].map((e=>function(e,t){if(y2(e.size(),t))return e;return e.create(X6(e.valueOf(),t),e.datatype())}(e,n)))}var W9=k2("matrixAlgorithmSuite",["typed","matrix"],(e=>{var{typed:t,matrix:n}=e,r=H9({typed:t}),o=_9({typed:t});return function(e){var a,i=e.elop,l=e.SD||e.DS;i?(a={"DenseMatrix, DenseMatrix":(e,t)=>r(...q9(e,t),i),"Array, Array":(e,t)=>r(...q9(n(e),n(t)),i).valueOf(),"Array, DenseMatrix":(e,t)=>r(...q9(n(e),t),i),"DenseMatrix, Array":(e,t)=>r(...q9(e,n(t)),i)},e.SS&&(a["SparseMatrix, SparseMatrix"]=(t,n)=>e.SS(...q9(t,n),i,!1)),e.DS&&(a["DenseMatrix, SparseMatrix"]=(t,n)=>e.DS(...q9(t,n),i,!1),a["Array, SparseMatrix"]=(t,r)=>e.DS(...q9(n(t),r),i,!1)),l&&(a["SparseMatrix, DenseMatrix"]=(e,t)=>l(...q9(t,e),i,!0),a["SparseMatrix, Array"]=(e,t)=>l(...q9(n(t),e),i,!0))):(a={"DenseMatrix, DenseMatrix":t.referToSelf((e=>(t,n)=>r(...q9(t,n),e))),"Array, Array":t.referToSelf((e=>(t,o)=>r(...q9(n(t),n(o)),e).valueOf())),"Array, DenseMatrix":t.referToSelf((e=>(t,o)=>r(...q9(n(t),o),e))),"DenseMatrix, Array":t.referToSelf((e=>(t,o)=>r(...q9(t,n(o)),e)))},e.SS&&(a["SparseMatrix, SparseMatrix"]=t.referToSelf((t=>(n,r)=>e.SS(...q9(n,r),t,!1)))),e.DS&&(a["DenseMatrix, SparseMatrix"]=t.referToSelf((t=>(n,r)=>e.DS(...q9(n,r),t,!1))),a["Array, SparseMatrix"]=t.referToSelf((t=>(r,o)=>e.DS(...q9(n(r),o),t,!1)))),l&&(a["SparseMatrix, DenseMatrix"]=t.referToSelf((e=>(t,n)=>l(...q9(n,t),e,!0))),a["SparseMatrix, Array"]=t.referToSelf((e=>(t,r)=>l(...q9(n(r),t),e,!0)))));var s=e.scalar||"any";(e.Ds||e.Ss)&&(i?(a["DenseMatrix,"+s]=(e,t)=>o(e,t,i,!1),a[s+", DenseMatrix"]=(e,t)=>o(t,e,i,!0),a["Array,"+s]=(e,t)=>o(n(e),t,i,!1).valueOf(),a[s+", Array"]=(e,t)=>o(n(t),e,i,!0).valueOf()):(a["DenseMatrix,"+s]=t.referToSelf((e=>(t,n)=>o(t,n,e,!1))),a[s+", DenseMatrix"]=t.referToSelf((e=>(t,n)=>o(n,t,e,!0))),a["Array,"+s]=t.referToSelf((e=>(t,r)=>o(n(t),r,e,!1).valueOf())),a[s+", Array"]=t.referToSelf((e=>(t,r)=>o(n(r),t,e,!0).valueOf()))));var c=void 0!==e.sS?e.sS:e.Ss;return i?(e.Ss&&(a["SparseMatrix,"+s]=(t,n)=>e.Ss(t,n,i,!1)),c&&(a[s+", SparseMatrix"]=(e,t)=>c(t,e,i,!0))):(e.Ss&&(a["SparseMatrix,"+s]=t.referToSelf((t=>(n,r)=>e.Ss(n,r,t,!1)))),c&&(a[s+", SparseMatrix"]=t.referToSelf((e=>(t,n)=>c(n,t,e,!0))))),i&&i.signatures&&g2(a,i.signatures),a}})),G9=k2("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l,concat:s}=e,c=z9({typed:t,config:n,round:r,matrix:o,equalScalar:a,zeros:i,DenseMatrix:l}),u=j9({typed:t,equalScalar:a}),d=$9({typed:t}),p=U9({typed:t,equalScalar:a}),f=x9({typed:t,equalScalar:a}),h=C9({typed:t,DenseMatrix:l});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 n=e%t;return 0n===n?n:n+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},W9({typed:t,matrix:o,concat:s})({SS:p,DS:d,SD:u,Ss:f,sS:h}))})),Y9=k2("matAlgo01xDSid",["typed"],(e=>{var{typed:t}=e;return function(e,n,r,o){var a=e._data,i=e._size,l=e._datatype||e.getDataType(),s=n._values,c=n._index,u=n._ptr,d=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(i.length!==d.length)throw new w6(i.length,d.length);if(i[0]!==d[0]||i[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+d+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var f,h,m=i[0],v=i[1],g="string"==typeof l&&"mixed"!==l&&l===p?l:void 0,y=g?t.find(r,[g,g]):r,b=[];for(f=0;f<m;f++)b[f]=[];var w=[],x=[];for(h=0;h<v;h++){for(var C=h+1,_=u[h],E=u[h+1],S=_;S<E;S++)w[f=c[S]]=o?y(s[S],a[f][h]):y(a[f][h],s[S]),x[f]=C;for(f=0;f<m;f++)x[f]===C?b[f][h]=w[f]:b[f][h]=a[f][h]}return e.createDenseMatrix({data:b,size:[m,v],datatype:l===e._datatype&&p===n._datatype?g:void 0})}})),K9=k2("matAlgo04xSidSid",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));var x,C,_,E,S,k=a&&u?[]:void 0,T=[],N=[],D=a&&u?[]:void 0,A=a&&u?[]:void 0,I=[],R=[];for(C=0;C<g;C++){N[C]=T.length;var M=C+1;for(E=l[C],S=l[C+1],_=E;_<S;_++)x=i[_],T.push(x),I[x]=M,D&&(D[x]=a[_]);for(E=p[C],S=p[C+1],_=E;_<S;_++)if(I[x=d[_]]===M){if(D){var O=w(D[x],u[_]);y(O,b)?I[x]=null:D[x]=O}}else T.push(x),R[x]=M,A&&(A[x]=u[_]);if(D&&A)for(_=N[C];_<T.length;)I[x=T[_]]===M?(k[_]=D[x],_++):R[x]===M?(k[_]=A[x],_++):T.splice(_,1)}return N[g]=T.length,e.createSparseMatrix({values:k,index:T,ptr:N,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),X9=k2("matAlgo10xSids",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,o,a){var i=e._values,l=e._index,s=e._ptr,c=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,p=c[0],f=c[1],h=o;"string"==typeof u&&(d=u,r=t.convert(r,d),h=t.find(o,[d,d]));for(var m=[],v=[],g=[],y=0;y<f;y++){for(var b=y+1,w=s[y],x=s[y+1],C=w;C<x;C++){var _=l[C];v[_]=i[C],g[_]=b}for(var E=0;E<p;E++)0===y&&(m[E]=[]),g[E]===b?m[E][y]=a?h(r,v[E]):h(v[E],r):m[E][y]=r}return new n({data:m,size:[p,f],datatype:d})}}));function J9(e,t,n,r){if(!(this instanceof J9))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}J9.prototype=new Error,J9.prototype.constructor=Error,J9.prototype.name="ArgumentsError",J9.prototype.isArgumentsError=!0;var Z9=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],Q9="number | BigNumber | Fraction | Matrix | Array",e7="".concat(Q9,", ").concat(Q9,", ...").concat(Q9);function t7(e){return!e.some((e=>Array.isArray(e)))}var n7=k2("gcd",Z9,(e=>{var{typed:t,matrix:n,config:r,round:o,equalScalar:a,zeros:i,BigNumber:l,DenseMatrix:s,concat:c}=e,u=G9({typed:t,config:r,round:o,matrix:n,equalScalar:a,zeros:i,DenseMatrix:s,concat:c}),d=Y9({typed:t}),p=K9({typed:t,equalScalar:a}),f=X9({typed:t,DenseMatrix:s});return t("gcd",{"number, number":function(e,t){if(!N2(e)||!N2(t))throw new Error("Parameters in function gcd must be integer numbers");var n;for(;0!==t;)n=u(e,t),e=t,t=n;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var n=new l(0);for(;!t.isZero();){var r=u(e,t);e=t,t=r}return e.lt(n)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},W9({typed:t,matrix:n,concat:c})({SS:p,DS:d,Ss:f}),{[e7]:t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o})),Array:t.referToSelf((e=>t=>{if(1===t.length&&Array.isArray(t[0])&&t7(t[0]))return e(...t[0]);if(t7(t))return e(...t);throw new J9("gcd() supports only 1d matrices!")})),Matrix:t.referToSelf((e=>t=>e(t.toArray())))})})),r7=k2("matAlgo06xS0S0",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._size,l=e._datatype||void 0===e._data?e._datatype:e.getDataType(),s=r._values,c=r._size,u=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(i.length!==c.length)throw new w6(i.length,c.length);if(i[0]!==c[0]||i[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+c+")");var d,p=i[0],f=i[1],h=n,m=0,v=o;"string"==typeof l&&l===u&&"mixed"!==l&&(d=l,h=t.find(n,[d,d]),m=t.convert(0,d),v=t.find(o,[d,d]));for(var g=a&&s?[]:void 0,y=[],b=[],w=g?[]:void 0,x=[],C=[],_=0;_<f;_++){b[_]=y.length;var E=_+1;if(s8(e,_,x,w,C,E,y,v),s8(r,_,x,w,C,E,y,v),w)for(var S=b[_];S<y.length;){var k=y[S];if(C[k]===E){var T=w[k];h(T,m)?y.splice(S,1):(g.push(T),S++)}else y.splice(S,1)}else for(var N=b[_];N<y.length;){C[y[N]]!==E?y.splice(N,1):N++}}return b[f]=y.length,e.createSparseMatrix({values:g,index:y,ptr:b,size:[p,f],datatype:l===e._datatype&&u===r._datatype?d:void 0})}})),o7=k2("lcm",["typed","matrix","equalScalar","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,concat:o}=e,a=j9({typed:t,equalScalar:r}),i=r7({typed:t,equalScalar:r}),l=x9({typed:t,equalScalar:r}),s=W9({typed:t,matrix:n,concat:o}),c="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(c,", ").concat(c,", ...").concat(c)]=t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o})),t("lcm",{"number, number":_8,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;var n=e.times(t);for(;!t.isZero();){var r=t;t=e.mod(r),e=r}return n.div(e).abs()},"Fraction, Fraction":(e,t)=>e.lcm(t)},s({SS:i,DS:a,Ss:l}),u)})),a7="log10",i7=k2(a7,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(a7,{number:function(e){return e>=0||n.predictable?E8(e):new r(e,0).log().div(Math.LN10)},Complex:function(e){return new r(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||n.predictable?e.log():new r(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),l7="log2",s7=k2(l7,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(l7,{number:function(e){return e>=0||n.predictable?S8(e):o(new r(e,0))},Complex:o,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log(2):o(new r(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))});function o(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),c7=k2("multiplyScalar",["typed"],(e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":v8,"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)})})),u7="multiply",d7=k2(u7,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:o,equalScalar:a,dot:i}=e,l=x9({typed:t,equalScalar:a}),s=_9({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new 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 new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}function u(e,n){if("dense"!==n.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,n){var a,i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._data,u=n._size,d=n._datatype||n.getDataType(),p=l[0],f=u[1],h=r,m=o;s&&d&&s===d&&"string"==typeof s&&"mixed"!==s&&(a=s,h=t.find(r,[a,a]),m=t.find(o,[a,a]));for(var v=[],g=0;g<f;g++){for(var y=m(i[0],c[0][g]),b=1;b<p;b++)y=h(y,m(i[b],c[b][g]));v[g]=y}return e.createDenseMatrix({data:v,size:[f],datatype:s===e._datatype&&d===n._datatype?a:void 0})}(e,n)}var d=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,n){var a,i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._data,u=n._datatype||n.getDataType(),d=l[0],p=l[1],f=r,h=o;s&&u&&s===u&&"string"==typeof s&&"mixed"!==s&&(a=s,f=t.find(r,[a,a]),h=t.find(o,[a,a]));for(var m=[],v=0;v<d;v++){for(var g=i[v],y=h(g[0],c[0]),b=1;b<p;b++)y=f(y,h(g[b],c[b]));m[v]=y}return e.createDenseMatrix({data:m,size:[d],datatype:s===e._datatype&&u===n._datatype?a:void 0})},"SparseMatrix, any":function(e,n){var i=e._values,l=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!i)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var u,d=n._data,p=n._datatype||n.getDataType(),f=e._size[0],h=n._size[0],m=[],v=[],g=[],y=r,b=o,w=a,x=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(u=c,y=t.find(r,[u,u]),b=t.find(o,[u,u]),w=t.find(a,[u,u]),x=t.convert(0,u));var C=[],_=[];g[0]=0;for(var E=0;E<h;E++){var S=d[E];if(!w(S,x))for(var k=s[E],T=s[E+1],N=k;N<T;N++){var D=l[N];_[D]?C[D]=y(C[D],b(S,i[N])):(_[D]=!0,v.push(D),C[D]=b(S,i[N]))}}for(var A=v.length,I=0;I<A;I++){var R=v[I];m[I]=C[R]}return g[1]=v.length,e.createSparseMatrix({values:m,index:v,ptr:g,size:[f,1],datatype:c===e._datatype&&p===n._datatype?u:void 0})}}),p=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,n){var a,i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._data,u=n._size,d=n._datatype||n.getDataType(),p=l[0],f=l[1],h=u[1],m=r,v=o;s&&d&&s===d&&"string"==typeof s&&"mixed"!==s&&"mixed"!==s&&(a=s,m=t.find(r,[a,a]),v=t.find(o,[a,a]));for(var g=[],y=0;y<p;y++){var b=i[y];g[y]=[];for(var w=0;w<h;w++){for(var x=v(b[0],c[0][w]),C=1;C<f;C++)x=m(x,v(b[C],c[C][w]));g[y][w]=x}}return e.createDenseMatrix({data:g,size:[p,h],datatype:s===e._datatype&&d===n._datatype?a:void 0})},"DenseMatrix, SparseMatrix":function(e,n){var i=e._data,l=e._size,s=e._datatype||e.getDataType(),c=n._values,u=n._index,d=n._ptr,p=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(!c)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var h,m=l[0],v=p[1],g=r,y=o,b=a,w=0;s&&f&&s===f&&"string"==typeof s&&"mixed"!==s&&(h=s,g=t.find(r,[h,h]),y=t.find(o,[h,h]),b=t.find(a,[h,h]),w=t.convert(0,h));for(var x=[],C=[],_=[],E=n.createSparseMatrix({values:x,index:C,ptr:_,size:[m,v],datatype:s===e._datatype&&f===n._datatype?h:void 0}),S=0;S<v;S++){_[S]=C.length;var k=d[S],T=d[S+1];if(T>k)for(var N=0,D=0;D<m;D++){for(var A=D+1,I=void 0,R=k;R<T;R++){var M=u[R];N!==A?(I=y(i[D][M],c[R]),N=A):I=g(I,y(i[D][M],c[R]))}N!==A||b(I,w)||(C.push(D),x.push(I))}}return _[v]=C.length,E},"SparseMatrix, DenseMatrix":function(e,n){var i=e._values,l=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!i)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var u,d=n._data,p=n._datatype||n.getDataType(),f=e._size[0],h=n._size[0],m=n._size[1],v=r,g=o,y=a,b=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(u=c,v=t.find(r,[u,u]),g=t.find(o,[u,u]),y=t.find(a,[u,u]),b=t.convert(0,u));for(var w=[],x=[],C=[],_=e.createSparseMatrix({values:w,index:x,ptr:C,size:[f,m],datatype:c===e._datatype&&p===n._datatype?u:void 0}),E=[],S=[],k=0;k<m;k++){C[k]=x.length;for(var T=k+1,N=0;N<h;N++){var D=d[N][k];if(!y(D,b))for(var A=s[N],I=s[N+1],R=A;R<I;R++){var M=l[R];S[M]!==T?(S[M]=T,x.push(M),E[M]=g(D,i[R])):E[M]=v(E[M],g(D,i[R]))}}for(var O=C[k],B=x.length,V=O;V<B;V++){var P=x[V];w[V]=E[P]}}return C[m]=x.length,_},"SparseMatrix, SparseMatrix":function(e,n){var a,i=e._values,l=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=n._values,d=n._index,p=n._ptr,f=n._datatype||void 0===n._data?n._datatype:n.getDataType(),h=e._size[0],m=n._size[1],v=i&&u,g=r,y=o;c&&f&&c===f&&"string"==typeof c&&"mixed"!==c&&(a=c,g=t.find(r,[a,a]),y=t.find(o,[a,a]));for(var b,w,x,C,_,E,S,k,T=v?[]:void 0,N=[],D=[],A=e.createSparseMatrix({values:T,index:N,ptr:D,size:[h,m],datatype:c===e._datatype&&f===n._datatype?a:void 0}),I=v?[]:void 0,R=[],M=0;M<m;M++){D[M]=N.length;var O=M+1;for(_=p[M],E=p[M+1],C=_;C<E;C++)if(k=d[C],v)for(w=s[k],x=s[k+1],b=w;b<x;b++)R[S=l[b]]!==O?(R[S]=O,N.push(S),I[S]=y(u[C],i[b])):I[S]=g(I[S],y(u[C],i[b]));else for(w=s[k],x=s[k+1],b=w;b<x;b++)R[S=l[b]]!==O&&(R[S]=O,N.push(S));if(v)for(var B=D[M],V=N.length,P=B;P<V;P++){var L=N[P];T[P]=I[L]}}return D[m]=N.length,A}});return t(u7,o,{"Array, Array":t.referTo("Matrix, Matrix",(e=>(t,r)=>{c(C6(t),C6(r));var o=e(n(t),n(r));return B1(o)?o.valueOf():o})),"Matrix, Matrix":function(e,t){var n=e.size(),r=t.size();return c(n,r),1===n.length?1===r.length?function(e,t,n){if(0===n)throw new Error("Cannot multiply two empty vectors");return i(e,t)}(e,t,n[0]):u(e,t):1===r.length?d(e,t):p(e,t)},"Matrix, Array":t.referTo("Matrix,Matrix",(e=>(t,r)=>e(t,n(r)))),"Array, Matrix":t.referToSelf((e=>(t,r)=>e(n(t,r.storage()),r))),"SparseMatrix, any":function(e,t){return l(e,t,o,!1)},"DenseMatrix, any":function(e,t){return s(e,t,o,!1)},"any, SparseMatrix":function(e,t){return l(t,e,o,!0)},"any, DenseMatrix":function(e,t){return s(t,e,o,!0)},"Array, any":function(e,t){return s(n(e),t,o,!1).valueOf()},"any, Array":function(e,t){return s(n(t),e,o,!0).valueOf()},"any, any":o,"any, any, ...any":t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o}))})})),p7="nthRoot",f7=k2(p7,["typed","matrix","equalScalar","BigNumber","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:o,concat:a}=e,i=Y9({typed:t}),l=j9({typed:t,equalScalar:r}),s=r7({typed:t,equalScalar:r}),c=x9({typed:t,equalScalar:r}),u=W9({typed:t,matrix:n,concat:a});function d(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(p7,{number:k8,"number, number":k8,BigNumber:e=>p(e,new o(2)),"BigNumber, BigNumber":p,Complex:d,"Complex, number":d,Array:t.referTo("DenseMatrix,number",(e=>t=>e(n(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,n)=>{if(1===n.density())return s(t,n,e);throw new Error("Root must be non-zero")})),"DenseMatrix, SparseMatrix":t.referToSelf((e=>(t,n)=>{if(1===n.density())return i(t,n,e,!1);throw new Error("Root must be non-zero")})),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",(e=>(t,r)=>e(n(t),r))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>{if(1===n.density())return c(n,t,e,!0);throw new Error("Root must be non-zero")}))},u({scalar:"number | BigNumber",SD:l,Ss:c,sS:!1}));function p(e,t){var n=o.precision,r=o.clone({precision:n+2}),a=new o(0),i=new r(1),l=t.isNegative();if(l&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return l?new r(1/0):0;if(!e.isFinite())return l?a:e;var s=e.abs().pow(i.div(t));return s=e.isNeg()?s.neg():s,new o((l?i.div(s):s).toPrecision(n))}})),h7="sign",m7=k2(h7,["typed","BigNumber","Fraction","complex"],(e=>{var{typed:t,BigNumber:n,complex:r,Fraction:o}=e;return t(h7,{number:T8,Complex:function(e){return 0===e.im?r(T8(e.re)):e.sign()},BigNumber:function(e){return new n(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return new o(e.s,1)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),Unit:t.referToSelf((e=>n=>{if(!n._isDerived()&&0!==n.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,n.valueType())(n.value)}))})})),v7=k2("sqrt",["config","typed","Complex"],(e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:o,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():o(e.toNumber())},Unit:function(e){return e.pow(.5)}});function o(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new r(e,0).sqrt()}})),g7="square",y7=k2(g7,["typed"],(e=>{var{typed:t}=e;return t(g7,{number:N8,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)}})})),b7="subtract",w7=k2(b7,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:o,unaryMinus:a,DenseMatrix:i,concat:l}=e,s=Y9({typed:t}),c=$9({typed:t}),u=U9({typed:t,equalScalar:r}),d=X9({typed:t,DenseMatrix:i}),p=C9({typed:t,DenseMatrix:i}),f=W9({typed:t,matrix:n,concat:l});return t(b7,{"any, any":o},f({elop:o,SS:u,DS:s,SD:c,Ss:p,sS:d}))})),x7="xgcd",C7=k2(x7,["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o}=e;return t(x7,{"number, number":function(e,t){var o=D8(e,t);return"Array"===n.matrix?o:r(o)},"BigNumber, BigNumber":function(e,t){var a,i,l,s,c=new o(0),u=new o(1),d=c,p=u,f=u,h=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)i=e.div(t).floor(),l=e.mod(t),a=d,d=p.minus(i.times(d)),p=a,a=f,f=h.minus(i.times(f)),h=a,e=t,t=l;s=e.lt(c)?[e.neg(),p.neg(),h.neg()]:[e,e.isZero()?0:p,h];return"Array"===n.matrix?s:r(s)}})})),_7="invmod",E7=k2(_7,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],(e=>{var{typed:t,config:n,BigNumber:r,xgcd:o,equal:a,smaller:i,mod:l,add:s,isInteger:c}=e;return t(_7,{"number, number":u,"BigNumber, BigNumber":u});function u(e,t){if(!c(e)||!c(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=l(e,t),a(t,0))throw new Error("Divisor must be non zero");var n=o(e,t);n=n.valueOf();var[u,d]=n;return a(u,r(1))?(d=l(d,t),i(d,r(0))&&(d=s(d,t)),d):NaN}})),S7=k2("matAlgo09xS0Sf",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));var x,C,_,E,S,k=a&&u?[]:void 0,T=[],N=[],D=k?[]:void 0,A=[];for(C=0;C<g;C++){N[C]=T.length;var I=C+1;if(D)for(E=p[C],S=p[C+1],_=E;_<S;_++)A[x=d[_]]=I,D[x]=u[_];for(E=l[C],S=l[C+1],_=E;_<S;_++)if(x=i[_],D){var R=A[x]===I?D[x]:b,M=w(a[_],R);y(M,b)||(T.push(x),k.push(M))}else T.push(x)}return N[g]=T.length,e.createSparseMatrix({values:k,index:T,ptr:N,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),k7="dotMultiply",T7=k2(k7,["typed","matrix","equalScalar","multiplyScalar","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,multiplyScalar:o,concat:a}=e,i=j9({typed:t,equalScalar:r}),l=S7({typed:t,equalScalar:r}),s=x9({typed:t,equalScalar:r}),c=W9({typed:t,matrix:n,concat:a});return t(k7,c({elop:o,SS:l,DS:i,Ss:s}))}));function N7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(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 n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return I7(e,t,(function(e,t){return e&t}))}function D7(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,n=t.precision;t.config({precision:1e9});var r=e.plus(new t(1));return r.s=-r.s||null,t.config({precision:n}),r}function A7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);var r=new n(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:e.isFinite()&&t.isFinite()?I7(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function I7(e,t,n){var r,o,a,i,l,s=e.constructor,c=+(e.s<0),u=+(t.s<0);if(c){r=R7(D7(e));for(var d=0;d<r.length;++d)r[d]^=1}else r=R7(e);if(u){o=R7(D7(t));for(var p=0;p<o.length;++p)o[p]^=1}else o=R7(t);r.length<=o.length?(a=r,i=o,l=c):(a=o,i=r,l=u);var f=a.length,h=i.length,m=1^n(c,u),v=new s(1^m),g=new s(1),y=new s(2),b=s.precision;for(s.config({precision:1e9});f>0;)n(a[--f],i[--h])===m&&(v=v.plus(g)),g=g.times(y);for(;h>0;)n(l,i[--h])===m&&(v=v.plus(g)),g=g.times(y);return s.config({precision:b}),0===m&&(v.s=-v.s),v}function R7(e){for(var t=e.d,n=t[0]+"",r=1;r<t.length;++r){for(var o=t[r]+"",a=7-o.length;a--;)o="0"+o;n+=o}for(var i=n.length;"0"===n.charAt(i);)i--;var l=e.e,s=n.slice(0,i+1||1),c=s.length;if(l>0)if(++l>c)for(l-=c;l--;)s+="0";else l<c&&(s=s.slice(0,l)+"."+s.slice(l));for(var u=[0],d=0;d<s.length;){for(var p=u.length;p--;)u[p]*=10;u[0]+=parseInt(s.charAt(d++));for(var f=0;f<u.length;++f)u[f]>1&&(null!==u[f+1]&&void 0!==u[f+1]||(u[f+1]=0),u[f+1]+=u[f]>>1,u[f]&=1)}return u.reverse()}function M7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new n(0);var r=new n(-1);return e.eq(r)?D7(t):t.eq(r)?D7(e):e.isFinite()&&t.isFinite()?I7(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new n(e.isNegative()===t.isNegative()?1/0:-1/0):r}function O7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new n(2).pow(t)):new n(NaN)}function B7(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new n(2).pow(t)).floor():e.isNegative()?new n(-1):e.isFinite()?new n(0):new n(NaN)}var V7="bitAnd",P7=k2(V7,["typed","matrix","equalScalar","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,concat:o}=e,a=j9({typed:t,equalScalar:r}),i=r7({typed:t,equalScalar:r}),l=x9({typed:t,equalScalar:r}),s=W9({typed:t,matrix:n,concat:o});return t(V7,{"number, number":M8,"BigNumber, BigNumber":N7,"bigint, bigint":(e,t)=>e&t},s({SS:i,DS:a,Ss:l}))})),L7="bitNot",F7=k2(L7,["typed"],(e=>{var{typed:t}=e;return t(L7,{number:O8,BigNumber:D7,bigint:e=>~e,"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),z7="bitOr",j7=k2(z7,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=Y9({typed:t}),l=K9({typed:t,equalScalar:r}),s=X9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:n,concat:a});return t(z7,{"number, number":B8,"BigNumber, BigNumber":A7,"bigint, bigint":(e,t)=>e|t},c({SS:l,DS:i,Ss:s}))})),$7=k2("matAlgo07xSSf",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,o,a){var i=e._size,l=e._datatype||void 0===e._data?e._datatype:e.getDataType(),s=o._size,c=o._datatype||void 0===o._data?o._datatype:o.getDataType();if(i.length!==s.length)throw new w6(i.length,s.length);if(i[0]!==s[0]||i[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+s+")");var u,d,p,f=i[0],h=i[1],m=0,v=a;"string"==typeof l&&l===c&&"mixed"!==l&&(u=l,m=t.convert(0,u),v=t.find(a,[u,u]));var g=[];for(d=0;d<f;d++)g[d]=[];var y=[],b=[],w=[],x=[];for(p=0;p<h;p++){var C=p+1;for(r(e,p,w,y,C),r(o,p,x,b,C),d=0;d<f;d++){var _=w[d]===C?y[d]:m,E=x[d]===C?b[d]:m;g[d][p]=v(_,E)}}return new n({data:g,size:[f,h],datatype:l===e._datatype&&c===o._datatype?u:void 0})};function r(e,t,n,r,o){for(var a=e._values,i=e._index,l=e._ptr,s=l[t],c=l[t+1];s<c;s++){var u=i[s];n[u]=o,r[u]=a[s]}}})),U7="bitXor",H7=k2(U7,["typed","matrix","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,concat:o}=e,a=$9({typed:t}),i=$7({typed:t,DenseMatrix:r}),l=C9({typed:t,DenseMatrix:r}),s=W9({typed:t,matrix:n,concat:o});return t(U7,{"number, number":V8,"BigNumber, BigNumber":M7,"bigint, bigint":(e,t)=>e^t},s({SS:i,DS:a,Ss:l}))})),q7=k2("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=>a8(t,e)))})})),W7="conj",G7=k2(W7,["typed"],(e=>{var{typed:t}=e;return t(W7,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),Y7=k2("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=>a8(t,e)))})})),K7=k2("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=>a8(t,e)))})})),X7=k2("not",["typed"],(e=>{var{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:W8,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=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),J7=k2("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=U9({typed:t,equalScalar:r}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:n,concat:a});return t("or",{"number, number":G8,"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":G8,"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t.value||0,n.value||0)))},c({SS:l,DS:i,Ss:s}))})),Z7=k2("xor",["typed","matrix","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,concat:o}=e,a=$9({typed:t}),i=$7({typed:t,DenseMatrix:r}),l=C9({typed:t,DenseMatrix:r}),s=W9({typed:t,matrix:n,concat:o});return t("xor",{"number, number":Y8,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"bigint, bigint":Y8,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t.value||0,n.value||0)))},s({SS:i,DS:a,Ss:l}))})),Q7="concat",eee=k2(Q7,["typed","matrix","isInteger"],(e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(Q7,{"...Array | Matrix | number | BigNumber":function(e){var t,o,a=e.length,i=-1,l=!1,s=[];for(t=0;t<a;t++){var c=e[t];if(B1(c)&&(l=!0),T1(c)||N1(c)){if(t!==a-1)throw new Error("Dimension must be specified as last argument");if(o=i,i=c.valueOf(),!r(i))throw new TypeError("Integer number expected for dimension");if(i<0||t>0&&i>o)throw new x6(i,o+1)}else{var u=v2(c).valueOf(),d=C6(u);if(s[t]=u,o=i,i=d.length-1,t>0&&i!==o)throw new w6(o+1,i+1)}}if(0===s.length)throw new SyntaxError("At least one matrix expected");for(var p=s.shift();s.length;)p=G6(p,s.shift(),i);return l?n(p):p},"...string":function(e){return e.join("")}})})),tee="column",nee=k2(tee,["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:o}=e;return t(tee,{"Matrix, number":a,"Array, number":function(e,t){return a(r(v2(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");k6(t,e.size()[1]);var a=o(0,e.size()[0]),i=new n(a,t),l=e.subset(i);return B1(l)?l:r([[l]])}})),ree="count",oee=k2(ree,["typed","size","prod"],(e=>{var{typed:t,size:n,prod:r}=e;return t(ree,{string:function(e){return e.length},"Matrix | Array":function(e){return r(n(e))}})})),aee="cross",iee=k2(aee,["typed","matrix","subtract","multiply"],(e=>{var{typed:t,matrix:n,subtract:r,multiply:o}=e;return t(aee,{"Matrix, Matrix":function(e,t){return n(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(a(e.toArray(),t))},"Array, Matrix":function(e,t){return n(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var n=Math.max(C6(e).length,C6(t).length);e=M6(e),t=M6(t);var a=C6(e),i=C6(t);if(1!==a.length||1!==i.length||3!==a[0]||3!==i[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+i.join(", ")+"])");var l=[r(o(e[1],t[2]),o(e[2],t[1])),r(o(e[2],t[0]),o(e[0],t[2])),r(o(e[0],t[1]),o(e[1],t[0]))];return n>1?[l]:l}})),lee="diag",see=k2(lee,["typed","matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:o}=e;return t(lee,{Array:function(e){return a(e,0,C6(e),null)},"Array, number":function(e,t){return a(e,t,C6(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),C6(e),null)},"Array, string":function(e,t){return a(e,0,C6(e),t)},"Array, number, string":function(e,t,n){return a(e,t,C6(e),n)},"Array, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),C6(e),n)},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,n){return a(e,t,e.size(),n)},"Matrix, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),e.size(),n)}});function a(e,t,a,i){if(!N2(t))throw new TypeError("Second parameter in function diag must be an integer");var l=t>0?t:0,s=t<0?-t:0;switch(a.length){case 1:return function(e,t,n,a,i,l){var s=[a+i,a+l];if(n&&"sparse"!==n&&"dense"!==n)throw new TypeError("Unknown matrix type ".concat(n,'"'));var c="sparse"===n?o.diagonal(s,e,t):r.diagonal(s,e,t);return null!==n?c:c.valueOf()}(e,t,i,a[0],s,l);case 2:return function(e,t,r,o,a,i){if(B1(e)){var l=e.diagonal(t);return null!==r?r!==l.storage()?n(l,r):l:l.valueOf()}for(var s=Math.min(o[0]-a,o[1]-i),c=[],u=0;u<s;u++)c[u]=e[u+a][u+i];return null!==r?n(c):c}(e,t,i,a,s,l)}throw new RangeError("Matrix for function diag must be 2 dimensional")}})),cee=k2("filter",["typed"],(e=>{var{typed:t}=e;return t("filter",{"Array, function":uee,"Matrix, function":function(e,t){return e.create(uee(e.valueOf(),t),e.datatype())},"Array, RegExp":j6,"Matrix, RegExp":function(e,t){return e.create(j6(e.valueOf(),t),e.datatype())}})}));function uee(e,t){return z6(e,(function(e,n,r){return Z6(t,e,[n],r,"filter")}))}var dee="flatten",pee=k2(dee,["typed"],(e=>{var{typed:t}=e;return t(dee,{Array:function(e){return P6(e)},Matrix:function(e){return e.create(P6(e.toArray()),e.datatype())}})})),fee="forEach",hee=k2(fee,["typed"],(e=>{var{typed:t}=e;return t(fee,{"Array, function":mee,"Matrix, function":function(e,t){e.forEach(t)}})}));function mee(e,t){var n=function(r,o){if(!Array.isArray(r))return Z6(t,r,o,e,"forEach");F6(r,(function(e,t){n(e,o.concat(t))}))};n(e,[])}var vee="getMatrixDataType",gee=k2(vee,["typed"],(e=>{var{typed:t}=e;return t(vee,{Array:function(e){return q6(e,m2)},Matrix:function(e){return e.getDataType()}})})),yee="identity",bee=k2(yee,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o,DenseMatrix:a,SparseMatrix:i}=e;return t(yee,{"":function(){return"Matrix"===n.matrix?r([]):[]},string:function(e){return r(e)},"number | BigNumber":function(e){return s(e,e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return s(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return s(e,t,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,n){return s(e,t,n)},Array:function(e){return l(e)},"Array, string":function(e,t){return l(e,t)},Matrix:function(e){return l(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return l(e.valueOf(),t)}});function l(e,t){switch(e.length){case 0:return t?r(t):[];case 1:return s(e[0],e[0],t);case 2:return s(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function s(e,t,n){var r=N1(e)||N1(t)?o:null;if(N1(e)&&(e=e.toNumber()),N1(t)&&(t=t.toNumber()),!N2(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!N2(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var l=r?new o(1):1,s=r?new r(0):0,c=[e,t];if(n){if("sparse"===n)return i.diagonal(c,l,0,s);if("dense"===n)return a.diagonal(c,l,0,s);throw new TypeError('Unknown matrix type "'.concat(n,'"'))}for(var u=N6([],c,s),d=e<t?e:t,p=0;p<d;p++)u[p][p]=l;return u}})),wee="kron",xee=k2(wee,["typed","matrix","multiplyScalar"],(e=>{var{typed:t,matrix:n,multiplyScalar:r}=e;return t(wee,{"Matrix, Matrix":function(e,t){return n(o(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(o(e.toArray(),t))},"Array, Matrix":function(e,t){return n(o(e,t.toArray()))},"Array, Array":o});function o(e,t){if(1===C6(e).length&&(e=[e]),1===C6(t).length&&(t=[t]),C6(e).length>2||C6(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var n=[],o=[];return e.map((function(e){return t.map((function(t){return o=[],n.push(o),e.map((function(e){return t.map((function(t){return o.push(r(e,t))}))}))}))}))&&n}})),Cee=k2("map",["typed"],(e=>{var{typed:t}=e;return t("map",{"Array, function":_ee,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,n,r)=>function(e,n){if("function"!=typeof n)throw new Error("Last argument must be a callback function");var r,o=e[0].isMatrix,a=Y6(...e.map((e=>e.isMatrix?e.size():C6(e)))),i=o?(e,t)=>e.get(t):J6,l=o?e.map((t=>t.isMatrix?t.create(X6(t.toArray(),a),t.datatype()):e[0].create(X6(t.valueOf(),a)))):e.map((e=>e.isMatrix?X6(e.toArray(),a):X6(e,a)));if(t.isTypedFunction(n)){var s=a.map((()=>0)),c=l.map((e=>i(e,s))),u=v(n,c,s,l);r=h(u)}else{var d=e.length,p=m(n,d);r=h(p)}var f=(e,t)=>r([e,...l.slice(1).map((e=>i(e,t)))],t);return o?l[0].map(f):_ee(l[0],f);function h(e){switch(e){case 0:return e=>n(...e);case 1:return(e,t)=>n(...e,t);case 2:return(e,t)=>n(...e,t,...l)}}function m(e,t){return e.length>t+1?2:e.length===t+1?1:0}function v(e,n,r,o){return null!==t.resolve(e,[...n,r,...o])?2:null!==t.resolve(e,[...n,r])?1:(t.resolve(e,n),0)}}([e,n,...r.slice(0,r.length-1)],r[r.length-1])})}));function _ee(e,t){return Eee(e,[],e,t)}function Eee(e,t,n,r){return Array.isArray(e)?e.map((function(e,o){return Eee(e,t.concat(o),n,r)})):Z6(r,e,t,n,"map")}var See="diff",kee=k2(See,["typed","matrix","subtract","number"],(e=>{var{typed:t,matrix:n,subtract:r,number:o}=e;return t(See,{"Array | Matrix":function(e){return B1(e)?n(i(e.toArray())):i(e)},"Array | Matrix, number":function(e,t){if(!N2(t))throw new RangeError("Dimension must be a whole number");return B1(e)?n(a(e.toArray(),t)):a(e,t)},"Array, BigNumber":t.referTo("Array,number",(e=>(t,n)=>e(t,o(n)))),"Matrix, BigNumber":t.referTo("Matrix,number",(e=>(t,n)=>e(t,o(n))))});function a(e,t){if(B1(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var n=[];return e.forEach((e=>{n.push(a(e,t-1))})),n}if(0===t)return i(e);throw RangeError("Cannot have negative dimension")}function i(e){for(var t=[],n=e.length,r=1;r<n;r++)t.push(l(e[r-1],e[r]));return t}function l(e,t){B1(e)&&(e=e.toArray()),B1(t)&&(t=t.toArray());var n=Array.isArray(e),o=Array.isArray(t);if(n&&o)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var n=[],r=e.length,o=0;o<r;o++)n.push(l(e[o],t[o]));return n}(e,t);if(!n&&!o)return r(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}})),Tee=k2("ones",["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o}=e;return t("ones",{"":function(){return"Array"===n.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"===n.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 n=function(e){var t=!1;return e.forEach((function(e,n,r){N1(e)&&(t=!0,r[n]=e.toNumber())})),t}(e),a=n?new o(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!N2(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var i=r(t);return e.length>0?i.resize(e,a):i}var l=[];return e.length>0?N6(l,e,a):l}}));function Nee(){throw new Error('No "bignumber" implementation available')}function Dee(){throw new Error('No "fraction" implementation available')}function Aee(){throw new Error('No "matrix" implementation available')}var Iee="range",Ree=k2(Iee,["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(e=>{var{typed:t,config:n,matrix:r,bignumber:o,smaller:a,smallerEq:i,larger:l,largerEq:s,add:c,isPositive:u}=e;return t(Iee,{string:p,"string, boolean":p,"number, number":function(e,t){return d(f(e,t,1,!1))},"number, number, number":function(e,t,n){return d(f(e,t,n,!1))},"number, number, boolean":function(e,t,n){return d(f(e,t,1,n))},"number, number, number, boolean":function(e,t,n,r){return d(f(e,t,n,r))},"BigNumber, BigNumber":function(e,t){return d(f(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,n){return d(f(e,t,n,!1))},"BigNumber, BigNumber, boolean":function(e,t,n){return d(f(e,t,new(0,e.constructor)(1),n))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,n,r){return d(f(e,t,n,r))},"Unit, Unit, Unit":function(e,t,n){return d(f(e,t,n,!1))},"Unit, Unit, Unit, boolean":function(e,t,n,r){return d(f(e,t,n,r))}});function d(e){return"Matrix"===n.matrix?r?r(e):Aee():e}function p(e,t){var r=function(e){var t=e.split(":"),n=t.map((function(e){return Number(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return{start:n[0],end:n[1],step:1};case 3:return{start:n[0],end:n[2],step:n[1]};default:return null}}(e);if(!r)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===n.number?(void 0===o&&Nee(),d(f(o(r.start),o(r.end),o(r.step)))):d(f(r.start,r.end,r.step,t))}function f(e,t,n,r){for(var o=[],d=u(n)?r?i:a:r?s:l,p=e;d(p,t);)o.push(p),p=c(p,n);return o}})),Mee="reshape",Oee=k2(Mee,["typed","isInteger","matrix"],(e=>{var{typed:t,isInteger:n}=e;return t(Mee,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach((function(e){if(!n(e))throw new TypeError("Invalid size for dimension: "+e)})),A6(e,t)}})})),Bee=k2("resize",["config","matrix"],(e=>{var{config:t,matrix:n}=e;return function(e,r,o){if(2!==arguments.length&&3!==arguments.length)throw new J9("resize",arguments.length,2,3);if(B1(r)&&(r=r.valueOf()),N1(r[0])&&(r=r.map((function(e){return N1(e)?e.toNumber():e}))),B1(e))return e.resize(r,o,!0);if("string"==typeof e)return function(e,t,n){if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";if(1!==t.length)throw new w6(t.length,1);var r=t[0];if("number"!=typeof r||!N2(r))throw new TypeError("Invalid size, must contain positive integers (size: "+h6(t)+")");if(e.length>r)return e.substring(0,r);if(e.length<r){for(var o=e,a=0,i=r-e.length;a<i;a++)o+=n;return o}return e}(e,r,o);var a=!Array.isArray(e)&&"Array"!==t.matrix;if(0===r.length){for(;Array.isArray(e);)e=e[0];return v2(e)}Array.isArray(e)||(e=[e]);var i=N6(e=v2(e),r,o);return a?n(i):i}})),Vee="rotate",Pee=k2(Vee,["typed","multiply","rotationMatrix"],(e=>{var{typed:t,multiply:n,rotationMatrix:r}=e;return t(Vee,{"Array , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),n(r(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),n(r(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return o(e,3),n(r(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return o(e,3),n(r(t,a),e)}});function o(e,t){var n=Array.isArray(e)?C6(e):e.size();if(n.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===n.length&&1!==n[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(n[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}})),Lee="rotationMatrix",Fee=k2(Lee,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],(e=>{var{typed:t,config:n,multiplyScalar:r,addScalar:o,unaryMinus:a,norm:i,BigNumber:l,matrix:s,DenseMatrix:c,SparseMatrix:u,cos:d,sin:p}=e;return t(Lee,{"":function(){return"Matrix"===n.matrix?s([]):[]},string:function(e){return s(e)},"number | BigNumber | Complex | Unit":function(e){return f(e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return f(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var n=s(t);return h(n),g(e,n,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){h(t);var r=t.storage()||("Matrix"===n.matrix?"dense":void 0);return g(e,t,r)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,n){var r=s(t);return h(r),g(e,r,n)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,n){return h(t),g(e,t,n)}});function f(e,t){var n=N1(e)?new l(-1):-1,o=d(e),a=p(e);return v([[o,r(n,a)],[a,o]],t)}function h(e){var t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function m(e){return e.reduce(((e,t)=>r(e,t)))}function v(e,t){if(t){if("sparse"===t)return new u(e);if("dense"===t)return new c(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function g(e,t,n){var r=i(t);if(0===r)throw new RangeError("Rotation around zero vector");var s=N1(e)?l:null,c=s?new s(1):1,u=s?new s(-1):-1,f=s?new s(t.get([0])/r):t.get([0])/r,h=s?new s(t.get([1])/r):t.get([1])/r,g=s?new s(t.get([2])/r):t.get([2])/r,y=d(e),b=o(c,a(y)),w=p(e);return v([[o(y,m([f,f,b])),o(m([f,h,b]),m([u,g,w])),o(m([f,g,b]),m([h,w]))],[o(m([f,h,b]),m([g,w])),o(y,m([h,h,b])),o(m([h,g,b]),m([u,f,w]))],[o(m([f,g,b]),m([u,h,w])),o(m([h,g,b]),m([f,w])),o(y,m([g,g,b]))]],n)}})),zee=k2("row",["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:o}=e;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(r(v2(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");k6(t,e.size()[0]);var a=o(0,e.size()[1]),i=new n(t,a),l=e.subset(i);return B1(l)?l:r([[l]])}})),jee="size",$ee=k2(jee,["typed","config","?matrix"],(e=>{var{typed:t,config:n,matrix:r}=e;return t(jee,{Matrix:function(e){return e.create(e.size(),"number")},Array:C6,string:function(e){return"Array"===n.matrix?[e.length]:r([e.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===n.matrix?[]:r?r([],"dense","number"):Aee()}})})),Uee="squeeze",Hee=k2(Uee,["typed"],(e=>{var{typed:t}=e;return t(Uee,{Array:function(e){return M6(v2(e))},Matrix:function(e){var t=M6(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return v2(e)}})})),qee="subset",Wee=k2(qee,["typed","matrix","zeros","add"],(e=>{var{typed:t,matrix:n,zeros:r,add:o}=e;return t(qee,{"Matrix, Index":function(e,t){return T6(t)?n():(S6(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",(function(e){return function(t,r){var o=e(n(t),r);return r.isScalar()?o:o.valueOf()}})),"Object, Index":Kee,"string, Index":Gee,"Matrix, Index, any, any":function(e,t,n,a){return T6(t)?e:(S6(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t._isScalar)return e;var n=t.size();if(!n.every((e=>e>0)))return e;try{return o(e,r(n))}catch(a){return e}}(n,t),a))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,o,a){var i=e(n(t),r,o,a);return i.isMatrix?i.valueOf():i}})),"Array, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,o){return e(n(t),r,o,void 0).valueOf()}})),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,r){return e(t,n,r,void 0)}})),"string, Index, string":Yee,"string, Index, string, string":Yee,"Object, Index, any":Xee})}));function Gee(e,t){if(!z1(t))throw new TypeError("Index expected");if(T6(t))return"";if(S6(Array.from(e),t),1!==t.size().length)throw new w6(t.size().length,1);var n=e.length;k6(t.min()[0],n),k6(t.max()[0],n);var r=t.dimension(0),o="";return r.forEach((function(t){o+=e.charAt(t)})),o}function Yee(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(T6(t))return e;if(S6(Array.from(e),t),1!==t.size().length)throw new w6(t.size().length,1);if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";var o=t.dimension(0);if(o.size()[0]!==n.length)throw new w6(o.size()[0],n.length);var a=e.length;k6(t.min()[0]),k6(t.max()[0]);for(var i=[],l=0;l<a;l++)i[l]=e.charAt(l);if(o.forEach((function(e,t){i[e]=n.charAt(t[0])})),i.length>a)for(var s=a-1,c=i.length;s<c;s++)i[s]||(i[s]=r);return i.join("")}function Kee(e,t){if(!T6(t)){if(1!==t.size().length)throw new w6(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");return v1(e,n)}}function Xee(e,t,n){if(T6(t))return e;if(1!==t.size().length)throw new w6(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");var o=v2(e);return g1(o,r,n),o}var Jee="transpose",Zee=k2(Jee,["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return t(Jee,{Array:e=>r(n(e)).valueOf(),Matrix:r,any:v2});function r(e){var t,n=e.size();switch(n.length){case 1:t=e.clone();break;case 2:var r=n[0],o=n[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+h6(n)+")");switch(e.storage()){case"dense":t=function(e,t,n){for(var r,o=e._data,a=[],i=0;i<n;i++){r=a[i]=[];for(var l=0;l<t;l++)r[l]=v2(o[l][i])}return e.createDenseMatrix({data:a,size:[n,t],datatype:e._datatype})}(e,r,o);break;case"sparse":t=function(e,t,n){for(var r,o,a,i=e._values,l=e._index,s=e._ptr,c=i?[]:void 0,u=[],d=[],p=[],f=0;f<t;f++)p[f]=0;for(r=0,o=l.length;r<o;r++)p[l[r]]++;for(var h=0,m=0;m<t;m++)d.push(h),h+=p[m],p[m]=d[m];for(d.push(h),a=0;a<n;a++)for(var v=s[a],g=s[a+1],y=v;y<g;y++){var b=p[l[y]]++;u[b]=a,i&&(c[b]=v2(i[y]))}return e.createSparseMatrix({values:c,index:u,ptr:d,size:[n,t],datatype:e._datatype})}(e,r,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+h6(n)+")")}return t}})),Qee="ctranspose",ete=k2(Qee,["typed","transpose","conj"],(e=>{var{typed:t,transpose:n,conj:r}=e;return t(Qee,{any:function(e){return r(n(e))}})})),tte="zeros",nte=k2(tte,["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:o}=e;return t(tte,{"":function(){return"Array"===n.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"===n.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 n=function(e){var t=!1;return e.forEach((function(e,n,r){N1(e)&&(t=!0,r[n]=e.toNumber())})),t}(e),a=n?new o(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!N2(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var i=r(t);return e.length>0?i.resize(e,a):i}var l=[];return e.length>0?N6(l,e,a):l}})),rte=k2("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],(e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:o,divideScalar:a,exp:i,tau:l,i:s,dotDivide:c,conj:u,pow:d,ceil:p,log2:f}=e;return t("fft",{Array:h,Matrix:function(e){return e.create(h(e.valueOf()),e.datatype())}});function h(e){var t=C6(e);return 1===t.length?v(e,t[0]):m(e.map((e=>h(e,t.slice(1)))),0)}function m(e,t){var n=C6(e);if(0!==t)return new Array(n[0]).fill(0).map(((n,r)=>m(e[r],t-1)));if(1===n.length)return v(e);function r(e){var t=C6(e);return new Array(t[1]).fill(0).map(((n,r)=>new Array(t[0]).fill(0).map(((t,n)=>e[n][r]))))}return r(m(r(e),1))}function v(e){var t=e.length;if(1===t)return[e[0]];if(t%2==0){for(var n=[...v(e.filter(((e,t)=>t%2==0))),...v(e.filter(((e,t)=>t%2==1)))],m=0;m<t/2;m++){var g=n[m],y=o(n[m+t/2],i(o(o(l,s),a(-m,t))));n[m]=r(g,y),n[m+t/2]=r(g,o(-1,y))}return n}return function(e){for(var t=e.length,n=i(a(o(-1,o(s,l)),t)),r=[],m=1-t;m<t;m++)r.push(d(n,a(d(m,2),2)));for(var g=d(2,p(f(t+t-1))),y=[...new Array(t).fill(0).map(((n,a)=>o(e[a],r[t-1+a]))),...new Array(g-t).fill(0)],b=[...new Array(t+t-1).fill(0).map(((e,t)=>a(1,r[t]))),...new Array(g-(t+t-1)).fill(0)],w=v(y),x=v(b),C=new Array(g).fill(0).map(((e,t)=>o(w[t],x[t]))),_=c(u(h(u(C))),g),E=[],S=t-1;S<t+t-1;S++)E.push(o(_[S],r[S]));return E}(e)}})),ote="ifft",ate=k2(ote,["typed","fft","dotDivide","conj"],(e=>{var{typed:t,fft:n,dotDivide:r,conj:o}=e;return t(ote,{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);return r(o(n(o(e))),t.reduce(((e,t)=>e*t),1))}})}));function ite(e){return(ite="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 lte(e){var t=function(e,t){if("object"!=ite(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ite(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ite(t)?t:t+""}function ste(e,t,n){return(t=lte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cte(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ute=k2("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],(e=>{var{typed:t,add:n,subtract:r,multiply:o,divide:a,max:i,map:l,abs:s,isPositive:c,isNegative:u,larger:d,smaller:p,matrix:f,bignumber:h,unaryMinus:m}=e;function v(e){return function(t,f,v,g){if(!(2===f.length&&(f.every(w)||f.every(R1))))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var y=f[0],b=f[1],x=d(b,y),C=g.firstStep;if(void 0!==C&&!c(C))throw new Error('"firstStep" must be positive');var _=g.maxStep;if(void 0!==_&&!c(_))throw new Error('"maxStep" must be positive');var E=g.minStep;if(E&&u(E))throw new Error('"minStep" must be positive or zero');var S=[y,b,C,E,_].filter((e=>void 0!==e));if(!S.every(w)&&!S.every(R1))throw new Error('Inconsistent type of "t" dependant variables');for(var k=g.tol?g.tol:1e-4,T=g.minDelta?g.minDelta:.2,N=g.maxDelta?g.maxDelta:5,D=g.maxIter?g.maxIter:1e4,A=[y,b,...v,_,E].some(N1),[I,R,M,O]=A?[h(e.a),h(e.c),h(e.b),h(e.bp)]:[e.a,e.c,e.b,e.bp],B=C?x?C:m(C):a(r(b,y),1),V=[y],P=[v],L=r(M,O),F=0,z=0,j=function(e){return e?p:d}(x),$=function(e){var t=e?d:p;return function(e,o,a){var i=n(e,a);return t(i,o)?r(o,e):a}}(x);j(V[F],b);){var U=[];B=$(V[F],b,B),U.push(t(V[F],P[F]));for(var H=1;H<R.length;++H)U.push(t(n(V[F],o(R[H],B)),n(P[F],o(B,I[H],U))));var q=i(s(l(o(L,U),(e=>R1(e)?e.value:e))));q<k&&k/q>1/4&&(V.push(n(V[F],B)),P.push(n(P[F],o(B,M,U))),F++);var W=.84*(k/q)**.2;if(p(W,T)?W=T:d(W,N)&&(W=N),W=A?h(W):W,B=o(B,W),_&&d(s(B),_)?B=x?_:m(_):E&&p(s(B),E)&&(B=x?E:m(E)),++z>D)throw new Error("Maximum number of iterations reached, try changing options")}return{t:V,y:P}}}function g(e,t,n,r){return v({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,n,r)}function y(e,t,n,r){return v({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,n,r)}function b(e,t,n,r){var o=r.method?r.method:"RK45",a={RK23:g,RK45:y};if(o.toUpperCase()in a){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cte(Object(n),!0).forEach((function(t){ste(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cte(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r);return delete i.method,a[o.toUpperCase()](e,t,n,i)}var l=Object.keys(a).map((e=>'"'.concat(e,'"'))),s="".concat(l.slice(0,-1).join(", ")," and ").concat(l.slice(-1));throw new Error('Unavailable method "'.concat(o,'". Available methods are ').concat(s))}function w(e){return N1(e)||T1(e)}function x(e,t,n,r){var o=b(e,t.toArray(),n.toArray(),r);return{t:f(o.t),y:f(o.y)}}return t("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":x,"function, Array, Array":(e,t,n)=>b(e,t,n,{}),"function, Matrix, Matrix":(e,t,n)=>x(e,t,n,{}),"function, Array, number | BigNumber | Unit":(e,t,n)=>{var r=b(e,t,[n],{});return{t:r.t,y:r.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit":(e,t,n)=>{var r=b(e,t.toArray(),[n],{});return{t:f(r.t),y:f(r.y.map((e=>e[0])))}},"function, Array, number | BigNumber | Unit, Object":(e,t,n,r)=>{var o=b(e,t,[n],r);return{t:o.t,y:o.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,n,r)=>{var o=b(e,t.toArray(),[n],r);return{t:f(o.t),y:f(o.y.map((e=>e[0])))}}})})),dte=k2("erf",["typed"],(e=>{var{typed:t}=e;return t("name",{number:function(e){var t=Math.abs(e);return t>=vte?A2(e):t<=pte?A2(e)*function(e){var t,n=e*e,r=hte[0][4]*n,o=n;for(t=0;t<3;t+=1)r=(r+hte[0][t])*n,o=(o+mte[0][t])*n;return e*(r+hte[0][3])/(o+mte[0][3])}(t):t<=4?A2(e)*(1-function(e){var t,n=hte[1][8]*e,r=e;for(t=0;t<7;t+=1)n=(n+hte[1][t])*e,r=(r+mte[1][t])*e;var o=(n+hte[1][7])/(r+mte[1][7]),a=parseInt(16*e)/16,i=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-i)*o}(t)):A2(e)*(1-function(e){var t,n=1/(e*e),r=hte[2][5]*n,o=n;for(t=0;t<4;t+=1)r=(r+hte[2][t])*n,o=(o+mte[2][t])*n;var a=n*(r+hte[2][4])/(o+mte[2][4]);a=(fte-a)/e,n=parseInt(16*e)/16;var i=(e-n)*(e+n);return Math.exp(-n*n)*Math.exp(-i)*a}(t))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),pte=.46875,fte=.5641895835477563,hte=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],mte=[[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]],vte=Math.pow(2,53),gte="zeta",yte=k2(gte,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],(e=>{var{typed:t,config:n,multiply:r,pow:o,divide:a,factorial:i,equal:l,smallerEq:s,isNegative:c,gamma:u,sin:d,subtract:p,add:f,Complex:h,BigNumber:m,pi:v}=e;return t(gte,{number:e=>g(e,(e=>e),(()=>20)),BigNumber:e=>g(e,(e=>new m(e)),(()=>Math.abs(Math.log10(n.relTol)))),Complex:function(e){if(0===e.re&&0===e.im)return new h(-.5);if(1===e.re)return new h(NaN,NaN);if(e.re===1/0&&0===e.im)return new h(1);if(e.im===1/0||e.re===-1/0)return new h(NaN,NaN);return y(e,(e=>e),(e=>Math.round(19.5+.9*Math.abs(e.im))),(e=>e.re))}});function g(e,t,n){return l(e,0)?t(-.5):l(e,1)?t(NaN):isFinite(e)?y(e,t,n,(e=>e)):c(e)?t(NaN):t(1)}function y(e,t,n,i){var l=n(e);if(i(e)>-(l-1)/2)return function(e,t,n){for(var i=a(1,r(b(n(0),t),p(1,o(2,p(1,e))))),l=n(0),c=n(1);s(c,t);c=f(c,1))l=f(l,a(r((-1)**(c-1),b(c,t)),o(c,e)));return r(i,l)}(e,t(l),t);var c=r(o(2,e),o(t(v),p(e,1)));return c=r(c,d(r(a(t(v),2),e))),c=r(c,u(p(1,e))),r(c,y(p(1,e),t,n,i))}function b(e,t){for(var n=e,l=e;s(l,t);l=f(l,1)){var c=a(r(i(f(t,p(l,1))),o(4,l)),r(i(p(t,l)),i(r(2,l))));n=f(n,c)}return r(t,n)}})),bte="mode",wte=k2(bte,["typed","isNaN","isNumeric"],(e=>{var{typed:t,isNaN:n,isNumeric:r}=e;return t(bte,{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=P6(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},o=[],a=0,i=0;i<e.length;i++){var l=e[i];if(r(l)&&n(l))throw new Error("Cannot calculate mode of an array containing NaN values");l in t||(t[l]=0),t[l]++,t[l]===a?o.push(l):t[l]>a&&(a=t[l],o=[l])}return o}}));function xte(e,t,n){var r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+m2(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+m2(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var Cte="prod",_te=k2(Cte,["typed","config","multiplyScalar","numeric"],(e=>{var{typed:t,config:n,multiplyScalar:r,numeric:o}=e;return t(Cte,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var t;if(o8(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(n){throw xte(n,"prod",e)}})),"string"==typeof t&&(t=o(t,D2(t,n))),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),Ete="format",Ste=k2(Ete,["typed"],(e=>{var{typed:t}=e;return t(Ete,{any:h6,"any, Object | function | number | BigNumber":h6})})),kte=k2("bin",["typed","format"],(e=>{var{typed:t,format:n}=e;return t("bin",{"number | BigNumber":function(e){return n(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"bin",wordSize:t})}})})),Tte=k2("oct",["typed","format"],(e=>{var{typed:t,format:n}=e;return t("oct",{"number | BigNumber":function(e){return n(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"oct",wordSize:t})}})})),Nte=k2("hex",["typed","format"],(e=>{var{typed:t,format:n}=e;return t("hex",{"number | BigNumber":function(e){return n(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"hex",wordSize:t})}})})),Dte=/\$([\w.]+)/g,Ate="print",Ite=k2(Ate,["typed"],(e=>{var{typed:t}=e;return t(Ate,{"string, Object | Array":Rte,"string, Object | Array, number | Object":Rte})}));function Rte(e,t,n){return e.replace(Dte,(function(e,r){var o=r.split("."),a=t[o.shift()];for(void 0!==a&&a.isMatrix&&(a=a.toArray());o.length&&void 0!==a;){var i=o.shift();a=i?a[i]:a+"."}return void 0!==a?M1(a)?a:h6(a,n):e}))}var Mte=k2("to",["typed","matrix","concat"],(e=>{var{typed:t,matrix:n,concat:r}=e;return t("to",{"Unit, Unit | string":(e,t)=>e.to(t)},W9({typed:t,matrix:n,concat:r})({Ds:!0}))})),Ote="isPrime",Bte=k2(Ote,["typed"],(e=>{var{typed:t}=e;return t(Ote,{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(Math.pow(2,32))){for(var t=e.toNumber(),n=5;n*n<=t;n+=6)if(t%n===0||t%(n+2)===0)return!1;return!0}function r(e,t,n){for(var r=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(n)):(t=t.sub(1),r=e.mul(r).mod(n));return r}for(var o=e.constructor.clone({precision:2*e.toFixed(0).length}),a=0,i=(e=new o(e)).sub(1);i.mod(2).eq(0);)i=i.div(2),a+=1;var l=null;if(e.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((t=>t<e));else{var s=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));l=[];for(var c=2;c<=s;c+=1)l.push(s)}for(var u=0;u<l.length;u+=1){var d=l[u],p=r(e.sub(e).add(d),i,e);if(!p.eq(1))for(var f=0,h=p;!h.eq(e.sub(1));f+=1,h=h.mul(h).mod(e))if(f===a-1)return!1}return!0},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),Vte=k2("numeric",["number","?bignumber","?fraction"],(e=>{var{number:t,bignumber:n,fraction:r}=e,o={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:n?e=>n(e):Nee,bigint:e=>BigInt(e),Fraction:r?e=>r(e):Dee};return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");var n=m2(e);if(!(n in o))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; valid input types are '+Object.keys(o).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===n?e:a[t](e)}})),Pte="divideScalar",Lte=k2(Pte,["typed","numeric"],(e=>{var{typed:t,numeric:n}=e;return t(Pte,{"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)})})),Fte=k2("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],(e=>{var{typed:t,config:n,identity:r,multiply:o,matrix:a,inv:i,number:l,fraction:s,Complex:c}=e;return t("pow",{"number, number":u,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||n.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 r=e.pow(t);if(null!=r)return r;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(e.valueOf(),t.valueOf())},"Array, number":d,"Array, BigNumber":function(e,t){return d(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function u(e,t){if(n.predictable&&!N2(t)&&e<0)try{var r=s(t),o=l(r);if((t===o||Math.abs((t-o)/t)<1e-14)&&r.d%2==1)return(r.n%2==0?1:-1)*Math.pow(-e,t)}catch(a){}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:N2(t)||e>=0||n.predictable?A8(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new c(e,0).pow(t,0)}function d(e,t){if(!N2(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");var n=C6(e);if(2!==n.length)throw new Error("For A^b, A must be 2 dimensional (A has "+n.length+" dimensions)");if(n[0]!==n[1])throw new Error("For A^b, A must be square (size is "+n[0]+"x"+n[1]+")");if(t<0)try{return d(i(e),-t)}catch(s){if("Cannot calculate inverse, determinant is zero"===s.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw s}for(var a=r(n[0]).valueOf(),l=e;t>=1;)1&~t||(a=o(l,a)),t>>=1,l=o(l,l);return a}function p(e,t){return a(d(e.valueOf(),t))}})),zte="Number of decimals in function round must be an integer",jte="round",$te=k2(jte,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(e=>{var{typed:t,config:n,matrix:r,equalScalar:o,zeros:a,BigNumber:i,DenseMatrix:l}=e,s=x9({typed:t,equalScalar:o}),c=C9({typed:t,DenseMatrix:l}),u=_9({typed:t});function d(e){return Math.abs(F2(e).exponent)}return t(jte,{number:function(e){var t=I8(e,d(n.relTol));return I8(H2(e,t,n.relTol,n.absTol)?t:e)},"number, number":function(e,t){var r=d(n.relTol);if(t>=r)return I8(e,t);var o=I8(e,r);return I8(H2(e,o,n.relTol,n.absTol)?o:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);return new i(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(zte);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);var n=t.toNumber();return e.round(n)},BigNumber:function(e){var t=new i(e).toDecimalPlaces(d(n.relTol));return(_5(e,t,n.relTol,n.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);var r=d(n.relTol);if(t>=r)return e.toDecimalPlaces(t.toNumber());var o=e.toDecimalPlaces(r);return(_5(e,o,n.relTol,n.absTol)?o:e).toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(zte);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(zte);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf((e=>function(t,n,r){var o=t.toNumeric(r);return r.multiply(e(o,n))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix, number, Unit":t.referToSelf((e=>(t,n,r)=>a8(t,(t=>e(t,n,r))))),"Array | Matrix, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Array | Matrix, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>s(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>u(r(t),n,e,!1).valueOf())),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf((e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):c(n,t,e,!0))),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf((e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):u(n,t,e,!0))),"number | Complex | BigNumber | Fraction, Array":t.referToSelf((e=>(t,n)=>u(r(n),t,e,!0).valueOf()))})})),Ute=k2("log",["config","typed","divideScalar","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,Complex:o}=e;return t("log",{number:function(e){return e>=0||n.predictable?function(e){return Math.log(e)}(e):new o(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||n.predictable?e.ln():new o(e.toNumber(),0).log()},"any, any":t.referToSelf((e=>(t,n)=>r(e(t),e(n))))})})),Hte="log1p",qte=k2(Hte,["typed","config","divideScalar","log","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,log:o,Complex:a}=e;return t(Hte,{number:function(e){return e>=-1||n.predictable?M2(e):i(new a(e,0))},Complex:i,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():i(new a(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e))),"any, any":t.referToSelf((e=>(t,n)=>r(e(t),o(n))))});function i(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}})),Wte="nthRoots",Gte=k2(Wte,["config","typed","divideScalar","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,Complex:o}=e,a=[function(e){return new o(e,0)},function(e){return new o(0,e)},function(e){return new o(-e,0)},function(e){return new o(0,-e)}];function i(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new o(0,0)];var n,r="number"==typeof e;(r||0===e.re||0===e.im)&&(n=r?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var i=e.arg(),l=e.abs(),s=[],c=Math.pow(l,1/t),u=0;u<t;u++){var d=(n+4*u)/t;d!==Math.round(d)?s.push(new o({r:c,phi:(i+2*Math.PI*u)/t})):s.push(a[d%4](c))}return s}return t(Wte,{Complex:function(e){return i(e,2)},"Complex, number":i})})),Yte="dotPow",Kte=k2(Yte,["typed","equalScalar","matrix","pow","DenseMatrix","concat"],(e=>{var{typed:t,equalScalar:n,matrix:r,pow:o,DenseMatrix:a,concat:i}=e,l=$9({typed:t}),s=$7({typed:t,DenseMatrix:a}),c=x9({typed:t,equalScalar:n}),u=C9({typed:t,DenseMatrix:a}),d=W9({typed:t,matrix:r,concat:i}),p={};for(var f in o.signatures)Object.prototype.hasOwnProperty.call(o.signatures,f)&&(f.includes("Matrix")||f.includes("Array")||(p[f]=o.signatures[f]));var h=t(p);return t(Yte,d({elop:h,SS:s,DS:l,Ss:c,sS:u}))})),Xte="dotDivide",Jte=k2(Xte,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,divideScalar:o,DenseMatrix:a,concat:i}=e,l=j9({typed:t,equalScalar:r}),s=$9({typed:t}),c=$7({typed:t,DenseMatrix:a}),u=x9({typed:t,equalScalar:r}),d=C9({typed:t,DenseMatrix:a}),p=W9({typed:t,matrix:n,concat:i});return t(Xte,p({elop:o,SS:c,DS:s,SD:l,Ss:u,sS:d}))}));function Zte(e){var{DenseMatrix:t}=e;return function(e,n,r){var o=e.size();if(2!==o.length)throw new RangeError("Matrix must be two dimensional (size: "+h6(o)+")");var a=o[0];if(a!==o[1])throw new RangeError("Matrix must be square (size: "+h6(o)+")");var i=[];if(B1(n)){var l=n.size(),s=n._data;if(1===l.length){if(l[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c<a;c++)i[c]=[s[c]];return new t({data:i,size:[a,1],datatype:n._datatype})}if(2===l.length){if(l[0]!==a||1!==l[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(P1(n)){if(r){i=[];for(var u=0;u<a;u++)i[u]=[s[u][0]];return new t({data:i,size:[a,1],datatype:n._datatype})}return n}if(L1(n)){for(var d=0;d<a;d++)i[d]=[0];for(var p=n._values,f=n._index,h=n._ptr,m=h[1],v=h[0];v<m;v++){i[f[v]][0]=p[v]}return new t({data:i,size:[a,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(O1(n)){var g=C6(n);if(1===g.length){if(g[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var y=0;y<a;y++)i[y]=[n[y]];return new t({data:i,size:[a,1]})}if(2===g.length){if(g[0]!==a||1!==g[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<a;b++)i[b]=[n[b][0]];return new t({data:i,size:[a,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Qte="lsolve",ene=k2(Qte,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(Qte,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=[],m=0;m<u;m++){var v=n[m][0]||0;if(i(v,0))h[m]=[0];else{for(var g=0,y=[],b=[],w=f[m],x=f[m+1],C=w;C<x;C++){var _=p[C];_===m?g=d[C]:_>m&&(y.push(d[C]),b.push(_))}if(i(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var E=r(v,g),S=0,k=b.length;S<k;S++){var T=b[S];n[T]=[a(n[T][0]||0,o(E,y[S]))]}h[m]=[E]}}return new l({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(n(e),t).valueOf()}});function c(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=[],p=e._data,f=0;f<u;f++){var h=n[f][0]||0,m=void 0;if(i(h,0))m=0;else{var v=p[f][f];if(i(v,0))throw new Error("Linear system cannot be solved since matrix is singular");m=r(h,v);for(var g=f+1;g<c;g++)n[g]=[a(n[g][0]||0,o(m,p[g][f]))]}d[f]=[m]}return new l({data:d,size:[c,1]})}})),tne="usolve",nne=k2(tne,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(tne,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=[],m=u-1;m>=0;m--){var v=n[m][0]||0;if(i(v,0))h[m]=[0];else{for(var g=0,y=[],b=[],w=f[m],x=f[m+1]-1;x>=w;x--){var C=p[x];C===m?g=d[x]:C<m&&(y.push(d[x]),b.push(C))}if(i(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var _=r(v,g),E=0,S=b.length;E<S;E++){var k=b[E];n[k]=[a(n[k][0],o(_,y[E]))]}h[m]=[_]}}return new l({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(n(e),t).valueOf()}});function c(e,t){for(var n=(t=s(e,t,!0))._data,c=e._size[0],u=e._size[1],d=[],p=e._data,f=u-1;f>=0;f--){var h=n[f][0]||0,m=void 0;if(i(h,0))m=0;else{var v=p[f][f];if(i(v,0))throw new Error("Linear system cannot be solved since matrix is singular");m=r(h,v);for(var g=f-1;g>=0;g--)n[g]=[a(n[g][0]||0,o(m,p[g][f]))]}d[f]=[m]}return new l({data:d,size:[c,1]})}})),rne="lsolveAll",one=k2(rne,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(rne,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=0;h<u;h++)for(var m=n.length,v=0;v<m;v++){for(var g=n[v],y=[],b=[],w=f[h],x=f[h+1],C=0,_=w;_<x;_++){var E=p[_];E===h?C=d[_]:E>h&&(y.push(d[_]),b.push(E))}if(i(C,0))if(i(g[h],0)){if(0===v){var S=[...g];S[h]=1;for(var k=0,T=b.length;k<T;k++){var N=b[k];S[N]=a(S[N],y[k])}n.push(S)}}else{if(0===v)return[];n.splice(v,1),v-=1,m-=1}else{g[h]=r(g[h],C);for(var D=0,A=b.length;D<A;D++){var I=b[D];g[I]=a(g[I],o(g[h],y[D]))}}}return n.map((e=>new l({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(n(e),t).map((e=>e.valueOf()))}});function c(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._data,u=e._size[0],d=e._size[1],p=0;p<d;p++)for(var f=n.length,h=0;h<f;h++){var m=n[h];if(i(c[p][p],0))if(i(m[p],0)){if(0===h){var v=[...m];v[p]=1;for(var g=p+1;g<d;g++)v[g]=a(v[g],c[g][p]);n.push(v)}}else{if(0===h)return[];n.splice(h,1),h-=1,f-=1}else{m[p]=r(m[p],c[p][p]);for(var y=p+1;y<d;y++)m[y]=a(m[y],o(m[p],c[y][p]))}}return n.map((e=>new l({data:e.map((e=>[e])),size:[u,1]})))}})),ane="usolveAll",ine=k2(ane,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:o,subtractScalar:a,equalScalar:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(ane,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],u=e._size[1],d=e._values,p=e._index,f=e._ptr,h=u-1;h>=0;h--)for(var m=n.length,v=0;v<m;v++){for(var g=n[v],y=[],b=[],w=f[h],x=0,C=f[h+1]-1;C>=w;C--){var _=p[C];_===h?x=d[C]:_<h&&(y.push(d[C]),b.push(_))}if(i(x,0))if(i(g[h],0)){if(0===v){var E=[...g];E[h]=1;for(var S=0,k=b.length;S<k;S++){var T=b[S];E[T]=a(E[T],y[S])}n.push(E)}}else{if(0===v)return[];n.splice(v,1),v-=1,m-=1}else{g[h]=r(g[h],x);for(var N=0,D=b.length;N<D;N++){var A=b[N];g[A]=a(g[A],o(g[h],y[N]))}}}return n.map((e=>new l({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(n(e),t).map((e=>e.valueOf()))}});function c(e,t){for(var n=[s(e,t,!0)._data.map((e=>e[0]))],c=e._data,u=e._size[0],d=e._size[1]-1;d>=0;d--)for(var p=n.length,f=0;f<p;f++){var h=n[f];if(i(c[d][d],0))if(i(h[d],0)){if(0===f){var m=[...h];m[d]=1;for(var v=d-1;v>=0;v--)m[v]=a(m[v],c[v][d]);n.push(m)}}else{if(0===f)return[];n.splice(f,1),f-=1,p-=1}else{h[d]=r(h[d],c[d][d]);for(var g=d-1;g>=0;g--)h[g]=a(h[g],o(h[d],c[g][d]))}}return n.map((e=>new l({data:e.map((e=>[e])),size:[u,1]})))}})),lne=k2("matAlgo08xS0Sid",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,o){var a=e._values,i=e._index,l=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,d=r._index,p=r._ptr,f=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==f.length)throw new w6(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");if(!a||!u)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var m,v=s[0],g=s[1],y=n,b=0,w=o;"string"==typeof c&&c===h&&"mixed"!==c&&(m=c,y=t.find(n,[m,m]),b=t.convert(0,m),w=t.find(o,[m,m]));for(var x,C,_,E,S=[],k=[],T=[],N=[],D=[],A=0;A<g;A++){T[A]=k.length;var I=A+1;for(C=l[A],_=l[A+1],x=C;x<_;x++)D[E=i[x]]=I,N[E]=a[x],k.push(E);for(C=p[A],_=p[A+1],x=C;x<_;x++)D[E=d[x]]===I&&(N[E]=w(N[E],u[x]));for(x=T[A];x<k.length;){var R=N[E=k[x]];y(R,b)?k.splice(x,1):(S.push(R),x++)}}return T[g]=k.length,e.createSparseMatrix({values:S,index:k,ptr:T,size:[v,g],datatype:c===e._datatype&&h===r._datatype?m:void 0})}})),sne=k2("useMatrixForArrayScalar",["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return{"Array, number":t.referTo("DenseMatrix, number",(e=>(t,r)=>e(n(t),r).valueOf())),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",(e=>(t,r)=>e(n(t),r).valueOf())),"number, Array":t.referTo("number, DenseMatrix",(e=>(t,r)=>e(t,n(r)).valueOf())),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",(e=>(t,r)=>e(t,n(r)).valueOf()))}})),cne="leftShift",une=k2(cne,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,DenseMatrix:a,concat:i}=e,l=Y9({typed:t}),s=j9({typed:t,equalScalar:r}),c=lne({typed:t,equalScalar:r}),u=X9({typed:t,DenseMatrix:a}),d=x9({typed:t,equalScalar:r}),p=_9({typed:t}),f=W9({typed:t,matrix:n,concat:i}),h=sne({typed:t,matrix:n});return t(cne,{"number, number":P8,"BigNumber, BigNumber":O7,"bigint, bigint":(e,t)=>e<<t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):u(n,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):p(n,t,e,!0)))},h,f({SS:c,DS:l,SD:s}))})),dne="rightArithShift",pne=k2(dne,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,DenseMatrix:a,concat:i}=e,l=Y9({typed:t}),s=j9({typed:t,equalScalar:r}),c=lne({typed:t,equalScalar:r}),u=X9({typed:t,DenseMatrix:a}),d=x9({typed:t,equalScalar:r}),p=_9({typed:t}),f=W9({typed:t,matrix:n,concat:i}),h=sne({typed:t,matrix:n});return t(dne,{"number, number":L8,"BigNumber, BigNumber":B7,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):u(n,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):p(n,t,e,!0)))},h,f({SS:c,DS:l,SD:s}))})),fne="rightLogShift",hne=k2(fne,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,DenseMatrix:a,concat:i}=e,l=Y9({typed:t}),s=j9({typed:t,equalScalar:r}),c=lne({typed:t,equalScalar:r}),u=X9({typed:t,DenseMatrix:a}),d=x9({typed:t,equalScalar:r}),p=_9({typed:t}),f=W9({typed:t,matrix:n,concat:i}),h=sne({typed:t,matrix:n});return t(fne,{"number, number":F8,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):u(n,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,n)=>r(t,0)?o(n.size(),n.storage()):p(n,t,e,!0)))},h,f({SS:c,DS:l,SD:s}))})),mne=k2("and",["typed","matrix","equalScalar","zeros","not","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i}=e,l=j9({typed:t,equalScalar:r}),s=r7({typed:t,equalScalar:r}),c=x9({typed:t,equalScalar:r}),u=_9({typed:t}),d=W9({typed:t,matrix:n,concat:i});return t("and",{"number, number":K8,"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":K8,"Unit, Unit":t.referToSelf((e=>(t,n)=>e(t.value||0,n.value||0))),"SparseMatrix, any":t.referToSelf((e=>(t,n)=>a(n)?o(t.size(),t.storage()):c(t,n,e,!1))),"DenseMatrix, any":t.referToSelf((e=>(t,n)=>a(n)?o(t.size(),t.storage()):u(t,n,e,!1))),"any, SparseMatrix":t.referToSelf((e=>(t,n)=>a(t)?o(t.size(),t.storage()):c(n,t,e,!0))),"any, DenseMatrix":t.referToSelf((e=>(t,n)=>a(t)?o(t.size(),t.storage()):u(n,t,e,!0))),"Array, any":t.referToSelf((e=>(t,r)=>e(n(t),r).valueOf())),"any, Array":t.referToSelf((e=>(t,r)=>e(t,n(r)).valueOf()))},d({SS:s,DS:l}))})),vne="compare",gne=k2(vne,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],(e=>{var{typed:t,config:n,equalScalar:r,matrix:o,BigNumber:a,Fraction:i,DenseMatrix:l,concat:s}=e,c=$9({typed:t}),u=U9({typed:t,equalScalar:r}),d=C9({typed:t,DenseMatrix:l}),p=W9({typed:t,matrix:o,concat:s}),f=L5({typed:t});return t(vne,yne({typed:t,config:n}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return _5(e,t,n.relTol,n.absTol)?new a(0):new a(e.cmp(t))},"bigint, bigint":function(e,t){return e===t?0n:e>t?1n:-1n},"Fraction, Fraction":function(e,t){return new i(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,p({SS:u,DS:c,Ss:d}))})),yne=k2(vne,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(vne,{"number, number":function(e,t){return H2(e,t,n.relTol,n.absTol)?0:e>t?1:-1}})})),bne=function e(t,n){var r,o,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,u=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=u(t).replace(i,"")||"",p=u(n).replace(i,"")||"",f=d.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(d.match(s),16)||1!==f.length&&d.match(l)&&Date.parse(d),v=parseInt(p.match(s),16)||m&&p.match(l)&&Date.parse(p)||null;if(v){if(m<v)return-1;if(m>v)return 1}for(var g=0,y=Math.max(f.length,h.length);g<y;g++){if(r=!(f[g]||"").match(c)&&parseFloat(f[g])||f[g]||0,o=!(h[g]||"").match(c)&&parseFloat(h[g])||h[g]||0,isNaN(r)!==isNaN(o))return isNaN(r)?1:-1;if(typeof r!=typeof o&&(r+="",o+=""),r<o)return-1;if(r>o)return 1}return 0};const wne=P(bne);var xne="compareNatural",Cne=k2(xne,["typed","compare"],(e=>{var{typed:t,compare:n}=e,r=n.signatures["boolean,boolean"];return t(xne,{"any, any":function e(t,i){var l,s=m2(t),c=m2(i);if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==c&&"BigNumber"!==c&&"Fraction"!==c))return"0"!==(l=n(t,i)).toString()?l>0?1:-1:wne(s,c);var u=["Array","DenseMatrix","SparseMatrix"];if(u.includes(s)||u.includes(c))return 0!==(l=o(e,t,i))?l:wne(s,c);if(s!==c)return wne(s,c);if("Complex"===s)return function(e,t){if(e.re>t.re)return 1;if(e.re<t.re)return-1;if(e.im>t.im)return 1;if(e.im<t.im)return-1;return 0}(t,i);if("Unit"===s)return t.equalBase(i)?e(t.value,i.value):a(e,t.formatUnits(),i.formatUnits());if("boolean"===s)return r(t,i);if("string"===s)return wne(t,i);if("Object"===s)return function(e,t,n){var r=Object.keys(t),o=Object.keys(n);r.sort(wne),o.sort(wne);var i=a(e,r,o);if(0!==i)return i;for(var l=0;l<r.length;l++){var s=e(t[r[l]],n[o[l]]);if(0!==s)return s}return 0}(e,t,i);if("null"===s)return 0;if("undefined"===s)return 0;throw new TypeError('Unsupported type of value "'+s+'"')}});function o(e,t,n){return L1(t)&&L1(n)?a(e,t.toJSON().values,n.toJSON().values):L1(t)?o(e,t.toArray(),n):L1(n)?o(e,t,n.toArray()):P1(t)?o(e,t.toJSON().data,n):P1(n)?o(e,t,n.toJSON().data):Array.isArray(t)?Array.isArray(n)?a(e,t,n):o(e,t,[n]):o(e,[t],n)}function a(e,t,n){for(var r=0,o=Math.min(t.length,n.length);r<o;r++){var a=e(t[r],n[r]);if(0!==a)return a}return t.length>n.length?1:t.length<n.length?-1:0}}));var _ne="compareText",Ene=["typed","matrix","concat"];b6.signature="any, any";var Sne=k2(_ne,Ene,(e=>{var{typed:t,matrix:n,concat:r}=e,o=W9({typed:t,matrix:n,concat:r});return t(_ne,b6,o({elop:b6,Ds:!0}))})),kne="equal",Tne=k2(kne,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:n,concat:a});return t(kne,Nne({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:i,Ss:s}))})),Nne=k2(kne,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(kne,{"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:n(e,t)}})})),Dne="equalText",Ane=k2(Dne,["typed","compareText","isZero"],(e=>{var{typed:t,compareText:n,isZero:r}=e;return t(Dne,{"any, any":function(e,t){return r(n(e,t))}})})),Ine="smaller",Rne=k2(Ine,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(Ine,Mne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<t,"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!_5(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e<t,"Fraction, Fraction":(e,t)=>-1===e.compare(t),"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),Mne=k2(Ine,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(Ine,{"number, number":function(e,t){return e<t&&!H2(e,t,n.relTol,n.absTol)}})})),One="smallerEq",Bne=k2(One,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(One,Vne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||_5(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e<=t,"Fraction, Fraction":(e,t)=>1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),Vne=k2(One,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(One,{"number, number":function(e,t){return e<=t||H2(e,t,n.relTol,n.absTol)}})})),Pne="larger",Lne=k2(Pne,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(Pne,Fne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!_5(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>1===e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),Fne=k2(Pne,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(Pne,{"number, number":function(e,t){return e>t&&!H2(e,t,n.relTol,n.absTol)}})})),zne="largerEq",jne=k2(zne,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:o,concat:a}=e,i=$9({typed:t}),l=$7({typed:t,DenseMatrix:o}),s=C9({typed:t,DenseMatrix:o}),c=W9({typed:t,matrix:r,concat:a}),u=L5({typed:t});return t(zne,$ne({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||_5(e,t,n.relTol,n.absTol)},"bigint, bigint":function(e,t){return e>=t},"Fraction, Fraction":(e,t)=>-1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,c({SS:l,DS:i,Ss:s}))})),$ne=k2(zne,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(zne,{"number, number":function(e,t){return e>=t||H2(e,t,n.relTol,n.absTol)}})})),Une="deepEqual",Hne=k2(Une,["typed","equal"],(e=>{var{typed:t,equal:n}=e;return t(Une,{"any, any":function(e,t){return r(e.valueOf(),t.valueOf())}});function r(e,t){if(Array.isArray(e)){if(Array.isArray(t)){var o=e.length;if(o!==t.length)return!1;for(var a=0;a<o;a++)if(!r(e[a],t[a]))return!1;return!0}return!1}return!Array.isArray(t)&&n(e,t)}})),qne="unequal",Wne=k2(qne,["typed","config","equalScalar","matrix","DenseMatrix","concat"],(e=>{var{typed:t,config:n,equalScalar:r,matrix:o,DenseMatrix:a,concat:i}=e,l=$9({typed:t}),s=$7({typed:t,DenseMatrix:a}),c=C9({typed:t,DenseMatrix:a}),u=W9({typed:t,matrix:o,concat:i});return t(qne,Gne({typed:t,equalScalar:r}),u({elop:function(e,t){return!r(e,t)},SS:s,DS:l,Ss:c}))})),Gne=k2(qne,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(qne,{"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:!n(e,t)}})})),Yne="partitionSelect",Kne=k2(Yne,["typed","isNumeric","isNaN","compare"],(e=>{var{typed:t,isNumeric:n,isNaN:r,compare:o}=e,a=o,i=(e,t)=>-o(e,t);return t(Yne,{"Array | Matrix, number":function(e,t){return l(e,t,a)},"Array | Matrix, number, string":function(e,t,n){if("asc"===n)return l(e,t,a);if("desc"===n)return l(e,t,i);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(e,t,n){if(!N2(t)||t<0)throw new Error("k must be a non-negative integer");if(B1(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return s(e.valueOf(),t,n)}if(Array.isArray(e))return s(e,t,n)}function s(e,t,o){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a<e.length;a++)if(n(e[a])&&r(e[a]))return e[a];for(var i=0,l=e.length-1;i<l;){for(var s=i,c=l,u=e[Math.floor(Math.random()*(l-i+1))+i];s<c;)if(o(e[s],u)>=0){var d=e[c];e[c]=e[s],e[s]=d,--c}else++s;o(e[s],u)>0&&--s,t<=s?l=s:i=s+1}return e[t]}})),Xne="sort",Jne=k2(Xne,["typed","matrix","compare","compareNatural"],(e=>{var{typed:t,matrix:n,compare:r,compareNatural:o}=e,a=r,i=(e,t)=>-r(e,t);return t(Xne,{Array:function(e){return s(e),e.sort(a)},Matrix:function(e){return c(e),n(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return s(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),n(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return s(e),e.sort(l(t))},"Matrix, string":function(e,t){return c(e),n(e.toArray().sort(l(t)),e.storage())}});function l(e){if("asc"===e)return a;if("desc"===e)return i;if("natural"===e)return o;throw new Error('String "asc", "desc", or "natural" expected')}function s(e){if(1!==C6(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),Zne=k2("max",["typed","config","numeric","larger"],(e=>{var{typed:t,config:n,numeric:r,larger:o}=e;return t("max",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){return i8(e,t.valueOf(),a)},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function max");return i(e)}});function a(e,t){try{return o(e,t)?e:t}catch(n){throw xte(n,"max",t)}}function i(e){var t;if(o8(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||o(e,t))&&(t=e)}catch(n){throw xte(n,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=r(t,D2(t,n))),t}})),Qne=k2("min",["typed","config","numeric","smaller"],(e=>{var{typed:t,config:n,numeric:r,smaller:o}=e;return t("min",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){return i8(e,t.valueOf(),a)},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function min");return i(e)}});function a(e,t){try{return o(e,t)?e:t}catch(n){throw xte(n,"min",t)}}function i(e){var t;if(o8(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||o(e,t))&&(t=e)}catch(n){throw xte(n,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=r(t,D2(t,n))),t}})),ere=k2("ImmutableDenseMatrix",["smaller","DenseMatrix"],(e=>{var{smaller:t,DenseMatrix:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M1(t))throw new Error("Invalid datatype: "+t);if(B1(e)||O1(e)){var o=new n(e,t);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(e&&O1(e.data)&&O1(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 new TypeError("Unsupported type of data ("+m2(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return B1(t)?new r({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:v2(this._data),size:v2(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(n){(null===e||t(n,e))&&(e=n)})),this._min=null!==e?e:void 0}return this._min},r.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(n){(null===e||t(e,n))&&(e=n)})),this._max=null!==e?e:void 0}return this._max},r}),{isClass:!0}),tre=k2("Index",["ImmutableDenseMatrix","getMatrixDataType"],(e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var t=0,a=arguments.length;t<a;t++){var i=arguments[t],l=O1(i),s=B1(i),c=null;if(F1(i))this._dimensions.push(i),this._isScalar=!1;else if(l||s){var u=void 0;"boolean"===n(i)?(l&&(u=o(nre(i).valueOf())),s&&(u=o(nre(i._data).valueOf())),c=i.valueOf().length):u=o(i.valueOf()),this._dimensions.push(u);var d=u.size();1===d.length&&1===d[0]&&null===c||(this._isScalar=!1)}else if("number"==typeof i)this._dimensions.push(o([i]));else{if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(i)}this._sourceSize.push(c)}}function o(e){for(var n=0,r=e.length;n<r;n++)if("number"!=typeof e[n]||!N2(e[n]))throw new TypeError("Index parameters must be positive integer numbers");return new t(e)}return r.prototype.type="Index",r.prototype.isIndex=!0,r.prototype.clone=function(){var e=new r;return e._dimensions=v2(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},r.create=function(e){var t=new r;return r.apply(t,e),t},r.prototype.size=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"==typeof r?1:r.size()[0]}return e},r.prototype.max=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"==typeof r?r:r.max()}return e},r.prototype.min=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"==typeof r?r:r.min()}return e},r.prototype.forEach=function(e){for(var t=0,n=this._dimensions.length;t<n;t++)e(this._dimensions[t],t,this)},r.prototype.dimension=function(e){return this._dimensions[e]||null},r.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e.push("string"==typeof r?r:r.toArray())}return e},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];"string"==typeof r?e.push(JSON.stringify(r)):e.push(r.toString())}return"["+e.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(e){return r.create(e.dimensions)},r}),{isClass:!0});function nre(e){var t=[];return e.forEach(((e,n)=>{e&&t.push(n)})),t}var rre=k2("FibonacciHeap",["smaller","larger"],(e=>{var{smaller:t,larger:n}=e,r=1/Math.log((1+Math.sqrt(5))/2);function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,t,n){t.left.right=t.right,t.right.left=t.left,n.degree--,n.child===t&&(n.child=t.right),0===n.degree&&(n.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function i(e,t){var n=t.parent;n&&(t.mark?(a(e,t,n),i(n)):t.mark=!0)}o.prototype.type="FibonacciHeap",o.prototype.isFibonacciHeap=!0,o.prototype.insert=function(e,n){var r={key:e,value:n,degree:0};if(this._minimum){var o=this._minimum;r.left=o,r.right=o.right,o.right=r,r.right.left=r,t(e,o.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},o.prototype.size=function(){return this._size},o.prototype.clear=function(){this._minimum=null,this._size=0},o.prototype.isEmpty=function(){return 0===this._size},o.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var o=this._minimum,a=e.degree,i=e.child;a>0;){var s=i.right;i.left.right=i.right,i.right.left=i.left,i.left=o,i.right=o.right,o.right=i,i.right.left=i,i.parent=null,i=s,a--}return e.left.right=e.right,e.right.left=e.left,o=e===e.right?null:function(e,o){var a,i=Math.floor(Math.log(o)*r)+1,s=new Array(i),c=0,u=e;if(u)for(c++,u=u.right;u!==e;)c++,u=u.right;for(;c>0;){for(var d=u.degree,p=u.right;a=s[d];){if(n(u.key,a.key)){var f=a;a=u,u=f}l(a,u),s[d]=null,d++}s[d]=u,u=p,c--}e=null;for(var h=0;h<i;h++)(a=s[h])&&(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}(o=e.right,this._size),this._size--,this._minimum=o,e},o.prototype.remove=function(e){this._minimum=function(e,n,r){n.key=r;var o=n.parent;o&&t(n.key,o.key)&&(a(e,n,o),i(e,o));t(n.key,e.key)&&(e=n);return e}(this._minimum,e,-1),this.extractMinimum()};var l=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 o}),{isClass:!0}),ore=k2("Spa",["addScalar","equalScalar","FibonacciHeap"],(e=>{var{addScalar:t,equalScalar:n,FibonacciHeap:r}=e;function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new r}return o.prototype.type="Spa",o.prototype.isSpa=!0,o.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var n=this._heap.insert(e,t);this._values[e]=n}},o.prototype.get=function(e){var t=this._values[e];return t?t.value:0},o.prototype.accumulate=function(e,n){var r=this._values[e];r?r.value=t(r.value,n):(r=this._heap.insert(e,n),this._values[e]=r)},o.prototype.forEach=function(e,t,r){var o=this._heap,a=this._values,i=[],l=o.extractMinimum();for(l&&i.push(l);l&&l.key<=t;)l.key>=e&&(n(l.value,0)||r(l.key,l.value,this)),(l=o.extractMinimum())&&i.push(l);for(var s=0;s<i.length;s++){var c=i[s];a[(l=o.insert(c.key,c.value)).key]=l}},o.prototype.swap=function(e,t){var n=this._values[e],r=this._values[t];if(!n&&r)n=this._heap.insert(e,r.value),this._heap.remove(r),this._values[e]=n,this._values[t]=void 0;else if(n&&!r)r=this._heap.insert(t,n.value),this._heap.remove(n),this._values[t]=r,this._values[e]=void 0;else if(n&&r){var o=n.value;n.value=r.value,r.value=o}},o}),{isClass:!0});function are(e){var t=0,n=1,r=Object.create(null),o=Object.create(null),a=0,i=function(e){var i=o[e];if(i&&(delete r[i],delete o[e],--t,n===i)){if(!t)return a=0,void(n=1);for(;!Object.prototype.hasOwnProperty.call(r,++n););}};return e=Math.abs(e),{hit:function(l){var s=o[l],c=++a;if(r[c]=l,o[l]=c,!s){if(++t<=e)return;return l=r[n],i(l),l}if(delete r[s],n===s)for(;!Object.prototype.hasOwnProperty.call(r,++n););},delete:i,clear:function(){t=a=0,n=1,r=Object.create(null),o=Object.create(null)}}}function ire(e){var{hasher:t,limit:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=null==n?Number.POSITIVE_INFINITY:n,t=null==t?JSON.stringify:t,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:are(n||Number.POSITIVE_INFINITY)});for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var i=t(o);if(r.cache.values.has(i))return r.cache.lru.hit(i),r.cache.values.get(i);var l=e.apply(e,o);return r.cache.values.set(i,l),r.cache.values.delete(r.cache.lru.hit(i)),l}}var lre=ire((function(e){return new e(1).exp()}),{hasher:dre}),sre=ire((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),{hasher:dre}),cre=ire((function(e){return e.acos(-1)}),{hasher:dre}),ure=ire((function(e){return cre(e).times(2)}),{hasher:dre});function dre(e){return e[0].precision}function pre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pre(Object(n),!0).forEach((function(t){ste(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pre(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hre=k2("Unit",["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],(e=>{var t,n,r,{on:o,config:a,addScalar:i,subtractScalar:l,multiplyScalar:s,divideScalar:c,pow:u,abs:d,fix:p,round:f,equal:h,isNumeric:m,format:v,number:g,Complex:y,BigNumber:b,Fraction:w}=e,x=g;function C(e,t){if(!(this instanceof C))throw new Error("Constructor must be called with the new operator");if(null!=e&&!m(e)&&!A1(e))throw new 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=M.map((e=>0));else if("string"==typeof t){var n=C.parse(t);this.units=n.units,this.dimensions=n.dimensions}else{if(!R1(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map((e=>h1({},e)))}this.value=this._normalize(e)}function _(){for(;" "===r||"\t"===r;)S()}function E(e){return e>="0"&&e<="9"}function S(){n++,r=t.charAt(n)}function k(e){n=e,r=t.charAt(n)}function T(){var e,t="",o=n;if("+"===r?S():"-"===r&&(t+=r,S()),!((e=r)>="0"&&e<="9"||"."===e))return k(o),null;if("."===r){if(t+=r,S(),!E(r))return k(o),null}else{for(;E(r);)t+=r,S();"."===r&&(t+=r,S())}for(;E(r);)t+=r,S();if("E"===r||"e"===r){var a="",i=n;if(a+=r,S(),"+"!==r&&"-"!==r||(a+=r,S()),!E(r))return k(i),t;for(t+=a;E(r);)t+=r,S()}return t}function N(){for(var e="";E(r)||C.isValidAlpha(r);)e+=r,S();var t=e.charAt(0);return C.isValidAlpha(t)?e:null}function D(e){return r===e?(S(),e):null}Object.defineProperty(C,"name",{value:"Unit"}),C.prototype.constructor=C,C.prototype.type="Unit",C.prototype.isUnit=!0,C.parse=function(e,o){if(o=o||{},n=-1,r="","string"!=typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var i=new C;i.units=[];var l=1,s=!1;S(),_();var c=T(),u=null;if(c){if("BigNumber"===a.number)u=new b(c);else if("Fraction"===a.number)try{u=new w(c)}catch(E){u=parseFloat(c)}else u=parseFloat(c);_(),D("*")?(l=1,s=!0):D("/")&&(l=-1,s=!0)}for(var d=[],p=1;;){for(_();"("===r;)d.push(l),p*=l,l=1,S(),_();var f=void 0;if(!r)break;var h=r;if(null===(f=N()))throw new SyntaxError('Unexpected "'+h+'" in "'+t+'" at index '+n.toString());var m=A(f);if(null===m)throw new SyntaxError('Unit "'+f+'" not found.');var v=l*p;if(_(),D("^")){_();var g=T();if(null===g)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');v*=g}i.units.push({unit:m.unit,prefix:m.prefix,power:v});for(var y=0;y<M.length;y++)i.dimensions[y]+=(m.unit.dimensions[y]||0)*v;for(_();")"===r;){if(0===d.length)throw new SyntaxError('Unmatched ")" in "'+t+'" at index '+n.toString());p/=d.pop(),S(),_()}if(s=!1,D("*")?(l=1,s=!0):D("/")?(l=-1,s=!0):l=1,m.unit.base){var x=m.unit.base.key;z.auto[x]={unit:m.unit,prefix:m.prefix}}}if(_(),r)throw new SyntaxError('Could not parse: "'+e+'"');if(s)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==d.length)throw new SyntaxError('Unmatched "(" in "'+t+'"');if(0===i.units.length&&!o.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return i.value=void 0!==u?i._normalize(u):null,i},C.prototype.clone=function(){var e=new C;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=v2(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var n in e.units[t]={},this.units[t])b2(this.units[t],n)&&(e.units[t][n]=this.units[t][n]);return e},C.prototype.valueType=function(){return m2(this.value)},C.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},C.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,n=C._getNumberConverter(m2(e)),r=0;r<this.units.length;r++){var o=n(this.units[r].unit.value),a=n(this.units[r].prefix.value),i=n(this.units[r].power);t=s(t,u(s(o,a),i))}return t},C.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var n=e,r=C._getNumberConverter(m2(e)),o=0;o<this.units.length;o++){var a=r(this.units[o].unit.value),i=r(this.units[o].prefix.value),l=r(this.units[o].power);n=c(n,u(s(a,i),l))}return n};var A=ire((e=>{if(b2(P,e)){var t=P[e];return{unit:t,prefix:t.prefixes[""]}}for(var n in P)if(b2(P,n)&&f6(e,n)){var r=P[n],o=e.length-n.length,a=e.substring(0,o),i=b2(r.prefixes,a)?r.prefixes[a]:void 0;if(void 0!==i)return{unit:r,prefix:i}}return null}),{hasher:e=>e[0],limit:100});function I(e){return e.equalBase(O.NONE)&&null!==e.value&&!a.predictable?e.value:e}C.isValuelessUnit=function(e){return null!==A(e)},C.prototype.hasBase=function(e){if("string"==typeof e&&(e=O[e]),!e)return!1;for(var t=0;t<M.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equalBase=function(e){for(var t=0;t<M.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equals=function(e){return this.equalBase(e)&&h(this.value,e.value)},C.prototype.multiply=function(e){for(var t=this.clone(),n=R1(e)?e:new C(e),r=0;r<M.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(n.dimensions[r]||0);for(var o=0;o<n.units.length;o++){var a=fre({},n.units[o]);t.units.push(a)}if(null!==this.value||null!==n.value){var i=null===this.value?this._normalize(1):this.value,l=null===n.value?n._normalize(1):n.value;t.value=s(i,l)}else t.value=null;return R1(e)&&(t.skipAutomaticSimplification=!1),I(t)},C.prototype.divideInto=function(e){return new C(e).divide(this)},C.prototype.divide=function(e){for(var t=this.clone(),n=R1(e)?e:new C(e),r=0;r<M.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(n.dimensions[r]||0);for(var o=0;o<n.units.length;o++){var a=fre(fre({},n.units[o]),{},{power:-n.units[o].power});t.units.push(a)}if(null!==this.value||null!==n.value){var i=null===this.value?this._normalize(1):this.value,l=null===n.value?n._normalize(1):n.value;t.value=c(i,l)}else t.value=null;return R1(e)&&(t.skipAutomaticSimplification=!1),I(t)},C.prototype.pow=function(e){for(var t=this.clone(),n=0;n<M.length;n++)t.dimensions[n]=(this.dimensions[n]||0)*e;for(var r=0;r<t.units.length;r++)t.units[r].power*=e;return null!==t.value?t.value=u(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,I(t)},C.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=d(e.value);else{var t=e._numberConverter(),n=t(e.units[0].unit.value),r=t(e.units[0].unit.offset),o=s(n,r);e.value=l(d(i(e.value,o)),o)}for(var a in e.units)"VA"!==e.units[a].unit.name&&"VAR"!==e.units[a].unit.name||(e.units[a].unit=P.W);return e},C.prototype.to=function(e){var t,n=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=C.parse(e);else{if(!R1(e))throw new Error("String or Unit expected as parameter");t=e.clone()}if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new 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=v2(n);else{var r=C._getNumberConverter(m2(n)),o=this.units[0].unit.value,a=this.units[0].unit.offset,c=s(o,a),u=t.units[0].unit.value,d=t.units[0].unit.offset,p=s(u,d);t.value=i(n,r(l(c,p)))}return t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},C.prototype.toNumber=function(e){return x(this.toNumeric(e))},C.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)},C.prototype.toString=function(){return this.format()},C.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},C.fromJSON=function(e){var t,n=new C(e.value,null!==(t=e.unit)&&void 0!==t?t:void 0);return n.fixPrefix=e.fixPrefix||!1,n},C.prototype.valueOf=C.prototype.toString,C.prototype.simplify=function(){var e,t,n=this.clone(),r=[];for(var o in j)if(b2(j,o)&&n.hasBase(O[o])){e=o;break}if("NONE"===e)n.units=[];else if(e&&b2(j,e)&&(t=j[e]),t)n.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,i=0;i<M.length;i++){var l=M[i];Math.abs(n.dimensions[i]||0)>1e-12&&(b2(j,l)?r.push({unit:j[l].unit,prefix:j[l].prefix,power:n.dimensions[i]||0}):a=!0)}r.length<n.units.length&&!a&&(n.units=r)}return n},C.prototype.toSI=function(){for(var e=this.clone(),t=[],n=0;n<M.length;n++){var r=M[n];if(Math.abs(e.dimensions[n]||0)>1e-12){if(!b2(z.si,r))throw new Error("Cannot express custom unit "+r+" in SI units");t.push({unit:z.si[r].unit,prefix:z.si[r].prefix,power:e.dimensions[n]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},C.prototype.formatUnits=function(){for(var e="",t="",n=0,r=0,o=0;o<this.units.length;o++)this.units[o].power>0?(n++,e+=" "+this.units[o].prefix.name+this.units[o].unit.name,Math.abs(this.units[o].power-1)>1e-15&&(e+="^"+this.units[o].power)):this.units[o].power<0&&r++;if(r>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(n>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),n>1&&r>0&&(e="("+e+")"),r>1&&n>0&&(t="("+t+")");var i=e;return n>0&&r>0&&(i+=" / "),i+=t},C.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),n=!1;for(var r in void 0!==t.value&&null!==t.value&&A1(t.value)&&(n=Math.abs(t.value.re)<1e-14),t.units)b2(t.units,r)&&t.units[r].unit&&("VA"===t.units[r].unit.name&&n?t.units[r].unit=P.VAR:"VAR"!==t.units[r].unit.name||n||(t.units[r].unit=P.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var o=t._denormalize(t.value),a=null!==t.value?v(o,e||{}):"",i=t.formatUnits();return t.value&&A1(t.value)&&(a="("+a+")"),i.length>0&&a.length>0&&(a+=" "),a+=i},C.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?d(this.value):0,t=d(this.units[0].unit.value),n=this.units[0].prefix;if(0===e)return n;var r=this.units[0].power,o=Math.log(e/Math.pow(n.value*t,r))/Math.LN10-1.2;if(o>-2.200001&&o<1.800001)return n;o=Math.abs(o);var a=this.units[0].unit.prefixes;for(var i in a)if(b2(a,i)){var l=a[i];if(l.scientific){var s=Math.abs(Math.log(e/Math.pow(l.value*t,r))/Math.LN10-1.2);(s<o||s===o&&l.name.length<n.name.length)&&(n=l,o=s)}}return n},C.prototype.splitUnit=function(e){for(var t=this.clone(),n=[],r=0;r<e.length&&(t=t.to(e[r]),r!==e.length-1);r++){var o=t.toNumeric(),a=f(o),s=new C(h(a,o)?a:p(t.toNumeric()),e[r].toString());n.push(s),t=l(t,s)}for(var c=0,u=0;u<n.length;u++)c=i(c,n[u].value);return h(c,this.value)&&(t.value=0),n.push(t),n};var R={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:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),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:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};R.SHORTLONG=h1({},R.SHORT,R.LONG),R.BINARY_SHORT=h1({},R.BINARY_SHORT_SI,R.BINARY_SHORT_IEC),R.BINARY_LONG=h1({},R.BINARY_LONG_SI,R.BINARY_LONG_IEC);var M=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],O={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 B in O)b2(O,B)&&(O[B].key=B);var V={name:"",base:{},value:1,offset:0,dimensions:M.map((e=>0))},P={meter:{name:"meter",base:O.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:O.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:O.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:O.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:O.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:O.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:O.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:O.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:O.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:O.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:O.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:O.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:O.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:O.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:O.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:O.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:O.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:O.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:O.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:O.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:O.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:O.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:O.SURFACE,prefixes:R.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:O.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:O.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:O.SURFACE,prefixes:R.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:O.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:O.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:O.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:O.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:O.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:O.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:O.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:O.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:O.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:O.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:O.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:O.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:O.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:O.VOLUME,prefixes:R.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:"fluiddram",base:O.VOLUME,prefixes:R.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:O.VOLUME,prefixes:R.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:O.VOLUME,prefixes:R.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:O.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:O.VOLUME,prefixes:R.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:O.VOLUME,prefixes:R.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:O.VOLUME,prefixes:R.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:O.VOLUME,prefixes:R.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:O.VOLUME,prefixes:R.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:O.VOLUME,prefixes:R.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:O.VOLUME,prefixes:R.NONE,value:.238480942392,offset:0},g:{name:"g",base:O.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:O.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:O.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:O.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:O.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:O.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:O.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:O.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:O.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:O.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:O.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:O.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:O.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:O.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:O.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:O.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:O.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:O.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:O.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:O.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:O.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:O.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:O.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:O.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:O.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:O.TIME,prefixes:R.NONE,value:604800,offset:0},month:{name:"month",base:O.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:O.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:O.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:O.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:O.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:O.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:O.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:O.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:O.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:O.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:O.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:O.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:O.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:O.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:O.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:O.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:O.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:O.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:O.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:O.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:O.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:O.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:O.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:O.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:O.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:O.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:O.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:O.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:O.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:O.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:O.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:O.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:O.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:O.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:O.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:O.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:O.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:O.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:O.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:O.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:O.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:O.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:O.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:O.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:O.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:O.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:O.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:O.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:O.POWER,prefixes:R.SHORT,value:y.I,offset:0},VA:{name:"VA",base:O.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:O.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:O.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:O.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:O.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:O.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:O.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:O.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:O.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:O.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:O.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:O.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:O.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:O.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:O.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:O.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:O.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:O.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:O.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:O.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:O.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:O.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:O.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:O.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:O.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:O.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:O.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:O.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},L={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 F(e){if("BigNumber"===e.number){var t=cre(b);P.rad.value=new b(1),P.deg.value=t.div(180),P.grad.value=t.div(200),P.cycle.value=t.times(2),P.arcsec.value=t.div(648e3),P.arcmin.value=t.div(10800)}else P.rad.value=1,P.deg.value=Math.PI/180,P.grad.value=Math.PI/200,P.cycle.value=2*Math.PI,P.arcsec.value=Math.PI/648e3,P.arcmin.value=Math.PI/10800;P.radian.value=P.rad.value,P.degree.value=P.deg.value,P.gradian.value=P.grad.value}F(a),o&&o("config",(function(e,t){e.number!==t.number&&F(e)}));var z={si:{NONE:{unit:V,prefix:R.NONE[""]},LENGTH:{unit:P.m,prefix:R.SHORT[""]},MASS:{unit:P.g,prefix:R.SHORT.k},TIME:{unit:P.s,prefix:R.SHORT[""]},CURRENT:{unit:P.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:P.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:P.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:P.mol,prefix:R.SHORT[""]},ANGLE:{unit:P.rad,prefix:R.SHORT[""]},BIT:{unit:P.bits,prefix:R.SHORT[""]},FORCE:{unit:P.N,prefix:R.SHORT[""]},ENERGY:{unit:P.J,prefix:R.SHORT[""]},POWER:{unit:P.W,prefix:R.SHORT[""]},PRESSURE:{unit:P.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:P.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:P.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:P.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:P.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:P.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:P.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:P.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:P.T,prefix:R.SHORT[""]},FREQUENCY:{unit:P.Hz,prefix:R.SHORT[""]}}};z.cgs=JSON.parse(JSON.stringify(z.si)),z.cgs.LENGTH={unit:P.m,prefix:R.SHORT.c},z.cgs.MASS={unit:P.g,prefix:R.SHORT[""]},z.cgs.FORCE={unit:P.dyn,prefix:R.SHORT[""]},z.cgs.ENERGY={unit:P.erg,prefix:R.NONE[""]},z.us=JSON.parse(JSON.stringify(z.si)),z.us.LENGTH={unit:P.ft,prefix:R.NONE[""]},z.us.MASS={unit:P.lbm,prefix:R.NONE[""]},z.us.TEMPERATURE={unit:P.degF,prefix:R.NONE[""]},z.us.FORCE={unit:P.lbf,prefix:R.NONE[""]},z.us.ENERGY={unit:P.BTU,prefix:R.BTU[""]},z.us.POWER={unit:P.hp,prefix:R.NONE[""]},z.us.PRESSURE={unit:P.psi,prefix:R.NONE[""]},z.auto=JSON.parse(JSON.stringify(z.si));var j=z.auto;for(var $ in C.setUnitSystem=function(e){if(!b2(z,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(z).join(", "));j=z[e]},C.getUnitSystem=function(){for(var e in z)if(b2(z,e)&&z[e]===j)return e},C.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new b(e.n).div(e.d).times(e.s):new b(e+"")},Fraction:function(e){return new w(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?g(e):e}},C.prototype._numberConverter=function(){var e=C.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},C._getNumberConverter=function(e){if(!C.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return C.typeConverters[e]},P)if(b2(P,$)){var U=P[$];U.dimensions=U.base.dimensions}for(var H in L)if(b2(L,H)){var q=P[L[H]],W={};for(var G in q)b2(q,G)&&(W[G]=q[G]);W.name=H,P[H]=W}return C.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},C.createUnit=function(e,t){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var n in e)if(b2(e,n)&&C.deleteUnit(n),e[n].aliases)for(var r=0;r<e[n].aliases.length;r++)C.deleteUnit(e[n].aliases[r]);var o;for(var a in e)b2(e,a)&&(o=C.createUnitSingle(a,e[a]));return o},C.createUnitSingle=function(e,t){if(null==t&&(t={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(b2(P,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){if(r=e.charAt(t),0===t&&!C.isValidAlpha(r))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!C.isValidAlpha(r)&&!E(r))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var n,o,a,i=null,l=[],s=0;if(t&&"Unit"===t.type)i=t.clone();else if("string"==typeof t)""!==t&&(n=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');n=t.definition,o=t.prefixes,s=t.offset,a=t.baseName,t.aliases&&(l=t.aliases.valueOf())}if(l)for(var c=0;c<l.length;c++)if(b2(P,l[c]))throw new Error('Cannot create alias "'+l[c]+'": a unit with that name already exists');if(n&&"string"==typeof n&&!i)try{i=C.parse(n,{allowNoUnits:!0})}catch(S){throw S.message='Could not create unit "'+e+'" from "'+n+'": '+S.message,S}else n&&"Unit"===n.type&&(i=n.clone());l=l||[],s=s||0,o=o&&o.toUpperCase&&R[o.toUpperCase()]||R.NONE;var u={};if(i){u={name:e,value:i.value,dimensions:i.dimensions.slice(0),prefixes:o,offset:s};var d=!1;for(var p in O)if(b2(O,p)){for(var f=!0,h=0;h<M.length;h++)if(Math.abs((u.dimensions[h]||0)-(O[p].dimensions[h]||0))>1e-12){f=!1;break}if(f){d=!0,u.base=O[p];break}}if(!d){a=a||e+"_STUFF";var m={dimensions:i.dimensions.slice(0)};m.key=a,O[a]=m,j[a]={unit:u,prefix:R.NONE[""]},u.base=O[a]}}else{if(a=a||e+"_STUFF",M.indexOf(a)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var v in M.push(a),O)b2(O,v)&&(O[v].dimensions[M.length-1]=0);for(var g={dimensions:[]},y=0;y<M.length;y++)g.dimensions[y]=0;g.dimensions[M.length-1]=1,g.key=a,O[a]=g,u={name:e,value:1,dimensions:O[a].dimensions.slice(0),prefixes:o,offset:s,base:O[a]},j[a]={unit:u,prefix:R.NONE[""]}}C.UNITS[e]=u;for(var b=0;b<l.length;b++){var w=l[b],x={};for(var _ in u)b2(u,_)&&(x[_]=u[_]);x.name=w,C.UNITS[w]=x}return delete A.cache,new C(null,e)},C.deleteUnit=function(e){delete C.UNITS[e],delete A.cache},C.PREFIXES=R,C.BASE_DIMENSIONS=M,C.BASE_UNITS=O,C.UNIT_SYSTEMS=z,C.UNITS=P,C}),{isClass:!0}),mre="unit",vre=k2(mre,["typed","Unit"],(e=>{var{typed:t,Unit:n}=e;return t(mre,{Unit:function(e){return e.clone()},string:function(e){return n.isValuelessUnit(e)?new n(null,e):n.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new n(e,t)},"number | BigNumber | Fraction":function(e){return new n(e)},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),gre="sparse",yre=k2(gre,["typed","SparseMatrix"],(e=>{var{typed:t,SparseMatrix:n}=e;return t(gre,{"":function(){return new n([])},string:function(e){return new n([],e)},"Array | Matrix":function(e){return new n(e)},"Array | Matrix, string":function(e,t){return new n(e,t)}})})),bre="createUnit",wre=k2(bre,["typed","Unit"],(e=>{var{typed:t,Unit:n}=e;return t(bre,{"Object, Object":function(e,t){return n.createUnit(e,t)},Object:function(e){return n.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var o={};return o[e]=t,n.createUnit(o,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,n.createUnit(r,{})},string:function(e){var t={};return t[e]={},n.createUnit(t,{})}})})),xre="acos",Cre=k2(xre,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(xre,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.acos(e):new r(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})})),_re="acosh",Ere=k2(_re,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(_re,{number:function(e){return e>=1||n.predictable?r5(e):e<=-1?new r(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})})),Sre="acot",kre=k2(Sre,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Sre,{number:o5,Complex:function(e){return e.acot()},BigNumber:function(e){return new n(1).div(e).atan()}})})),Tre="acoth",Nre=k2(Tre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Tre,{number:function(e){return e>=1||e<=-1||n.predictable?a5(e):new r(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new o(1).div(e).atanh()}})})),Dre="acsc",Are=k2(Dre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Dre,{number:function(e){return e<=-1||e>=1||n.predictable?i5(e):new r(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new o(1).div(e).asin()}})})),Ire="acsch",Rre=k2(Ire,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Ire,{number:l5,Complex:function(e){return e.acsch()},BigNumber:function(e){return new n(1).div(e).asinh()}})})),Mre="asec",Ore=k2(Mre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Mre,{number:function(e){return e<=-1||e>=1||n.predictable?s5(e):new r(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new o(1).div(e).acos()}})})),Bre="asech",Vre=k2(Bre,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:o}=e;return t(Bre,{number:function(e){if(e<=1&&e>=-1||n.predictable){var t=1/e;if(t>0||n.predictable)return c5(e);var o=Math.sqrt(t*t-1);return new r(Math.log(o-t),Math.PI)}return new r(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new o(1).div(e).acosh()}})})),Pre="asin",Lre=k2(Pre,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(Pre,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.asin(e):new r(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})})),Fre=k2("asinh",["typed"],(e=>{var{typed:t}=e;return t("asinh",{number:u5,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})})),zre=k2("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()}})})),jre="atan2",$re=k2(jre,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],(e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:o,DenseMatrix:a,concat:i}=e,l=j9({typed:t,equalScalar:r}),s=$9({typed:t}),c=S7({typed:t,equalScalar:r}),u=x9({typed:t,equalScalar:r}),d=C9({typed:t,DenseMatrix:a}),p=W9({typed:t,matrix:n,concat:i});return t(jre,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,t)=>o.atan2(e,t)},p({scalar:"number | BigNumber",SS:c,DS:s,SD:l,Ss:u,sS:d}))})),Ure="atanh",Hre=k2(Ure,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(Ure,{number:function(e){return e<=1&&e>=-1||n.predictable?d5(e):new r(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})})),qre=k2("trigUnit",["typed"],(e=>{var{typed:t}=e;return{Unit:t.referToSelf((e=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,n.valueType())(n.value)}))}})),Wre=k2("cos",["typed"],(e=>{var{typed:t}=e,n=qre({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},n)})),Gre="cosh",Yre=k2(Gre,["typed"],(e=>{var{typed:t}=e;return t(Gre,{number:Y2,"Complex | BigNumber":e=>e.cosh()})})),Kre=k2("cot",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("cot",{number:p5,Complex:e=>e.cot(),BigNumber:e=>new n(1).div(e.tan())},qre({typed:t}))})),Xre="coth",Jre=k2(Xre,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Xre,{number:f5,Complex:e=>e.coth(),BigNumber:e=>new n(1).div(e.tanh())})})),Zre=k2("csc",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("csc",{number:h5,Complex:e=>e.csc(),BigNumber:e=>new n(1).div(e.sin())},qre({typed:t}))})),Qre="csch",eoe=k2(Qre,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Qre,{number:m5,Complex:e=>e.csch(),BigNumber:e=>new n(1).div(e.sinh())})})),toe=k2("sec",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("sec",{number:v5,Complex:e=>e.sec(),BigNumber:e=>new n(1).div(e.cos())},qre({typed:t}))})),noe="sech",roe=k2(noe,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(noe,{number:g5,Complex:e=>e.sech(),BigNumber:e=>new n(1).div(e.cosh())})})),ooe=k2("sin",["typed"],(e=>{var{typed:t}=e,n=qre({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},n)})),aoe="sinh",ioe=k2(aoe,["typed"],(e=>{var{typed:t}=e;return t(aoe,{number:y5,"Complex | BigNumber":e=>e.sinh()})})),loe=k2("tan",["typed"],(e=>{var{typed:t}=e,n=qre({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},n)})),soe=k2("tanh",["typed"],(e=>{var{typed:t}=e;return t("tanh",{number:X2,"Complex | BigNumber":e=>e.tanh()})})),coe="setCartesian",uoe=k2(coe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(coe,{"Array | Matrix, Array | Matrix":function(e,t){var l=[];if(0!==r(n(e),new a(0))&&0!==r(n(t),new a(0))){var s=P6(Array.isArray(e)?e:e.toArray()).sort(o),c=P6(Array.isArray(t)?t:t.toArray()).sort(o);l=[];for(var u=0;u<s.length;u++)for(var d=0;d<c.length;d++)l.push([s[u],c[d]])}return Array.isArray(e)&&Array.isArray(t)?l:new i(l)}})})),doe="setDifference",poe=k2(doe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(doe,{"Array | Matrix, Array | Matrix":function(e,t){var l;if(0===r(n(e),new a(0)))l=[];else{if(0===r(n(t),new a(0)))return P6(e.toArray());var s,c=U6(P6(Array.isArray(e)?e:e.toArray()).sort(o)),u=U6(P6(Array.isArray(t)?t:t.toArray()).sort(o));l=[];for(var d=0;d<c.length;d++){s=!1;for(var p=0;p<u.length;p++)if(0===o(c[d].value,u[p].value)&&c[d].identifier===u[p].identifier){s=!0;break}s||l.push(c[d])}}return Array.isArray(e)&&Array.isArray(t)?H6(l):new i(H6(l))}})})),foe="setDistinct",hoe=k2(foe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(foe,{"Array | Matrix":function(e){var t;if(0===r(n(e),new a(0)))t=[];else{var l=P6(Array.isArray(e)?e:e.toArray()).sort(o);(t=[]).push(l[0]);for(var s=1;s<l.length;s++)0!==o(l[s],l[s-1])&&t.push(l[s])}return Array.isArray(e)?t:new i(t)}})})),moe="setIntersect",voe=k2(moe,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a,DenseMatrix:i}=e;return t(moe,{"Array | Matrix, Array | Matrix":function(e,t){var l;if(0===r(n(e),new a(0))||0===r(n(t),new a(0)))l=[];else{var s=U6(P6(Array.isArray(e)?e:e.toArray()).sort(o)),c=U6(P6(Array.isArray(t)?t:t.toArray()).sort(o));l=[];for(var u=0;u<s.length;u++)for(var d=0;d<c.length;d++)if(0===o(s[u].value,c[d].value)&&s[u].identifier===c[d].identifier){l.push(s[u]);break}}return Array.isArray(e)&&Array.isArray(t)?H6(l):new i(H6(l))}})})),goe="setIsSubset",yoe=k2(goe,["typed","size","subset","compareNatural","Index"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a}=e;return t(goe,{"Array | Matrix, Array | Matrix":function(e,t){if(0===r(n(e),new a(0)))return!0;if(0===r(n(t),new a(0)))return!1;for(var i,l=U6(P6(Array.isArray(e)?e:e.toArray()).sort(o)),s=U6(P6(Array.isArray(t)?t:t.toArray()).sort(o)),c=0;c<l.length;c++){i=!1;for(var u=0;u<s.length;u++)if(0===o(l[c].value,s[u].value)&&l[c].identifier===s[u].identifier){i=!0;break}if(!1===i)return!1}return!0}})})),boe="setMultiplicity",woe=k2(boe,["typed","size","subset","compareNatural","Index"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a}=e;return t(boe,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===r(n(t),new a(0)))return 0;for(var i=P6(Array.isArray(t)?t:t.toArray()),l=0,s=0;s<i.length;s++)0===o(i[s],e)&&l++;return l}})})),xoe="setPowerset",Coe=k2(xoe,["typed","size","subset","compareNatural","Index"],(e=>{var{typed:t,size:n,subset:r,compareNatural:o,Index:a}=e;return t(xoe,{"Array | Matrix":function(e){if(0===r(n(e),new a(0)))return[];for(var t=P6(Array.isArray(e)?e:e.toArray()).sort(o),l=[],s=0;s.toString(2).length<=t.length;)l.push(i(t,s.toString(2).split("").reverse())),s++;return function(e){for(var t=[],n=e.length-1;n>0;n--)for(var r=0;r<n;r++)e[r].length>e[r+1].length&&(t=e[r],e[r]=e[r+1],e[r+1]=t);return e}(l)}});function i(e,t){for(var n=[],r=0;r<t.length;r++)"1"===t[r]&&n.push(e[r]);return n}})),_oe="setSize",Eoe=k2(_oe,["typed","compareNatural"],(e=>{var{typed:t,compareNatural:n}=e;return t(_oe,{"Array | Matrix":function(e){return Array.isArray(e)?P6(e).length:P6(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?P6(e).length:P6(e.toArray()).length;for(var r=P6(Array.isArray(e)?e:e.toArray()).sort(n),o=1,a=1;a<r.length;a++)0!==n(r[a],r[a-1])&&o++;return o}})})),Soe="setSymDifference",koe=k2(Soe,["typed","size","concat","subset","setDifference","Index"],(e=>{var{typed:t,size:n,concat:r,subset:o,setDifference:a,Index:i}=e;return t(Soe,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(n(e),new i(0)))return P6(t);if(0===o(n(t),new i(0)))return P6(e);var l=P6(e),s=P6(t);return r(a(l,s),a(s,l))}})})),Toe="setUnion",Noe=k2(Toe,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(e=>{var{typed:t,size:n,concat:r,subset:o,setIntersect:a,setSymDifference:i,Index:l}=e;return t(Toe,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(n(e),new l(0)))return P6(t);if(0===o(n(t),new l(0)))return P6(e);var s=P6(e),c=P6(t);return r(i(s,c),a(s,c))}})})),Doe=k2("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],(e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:o,DenseMatrix:a,SparseMatrix:i,concat:l}=e,s=Y9({typed:t}),c=K9({typed:t,equalScalar:o}),u=X9({typed:t,DenseMatrix:a}),d=W9({typed:t,matrix:n,concat:l});return t("add",{"any, any":r,"any, any, ...any":t.referToSelf((e=>(t,n,r)=>{for(var o=e(t,n),a=0;a<r.length;a++)o=e(o,r[a]);return o}))},d({elop:r,DS:s,SS:c,Ss:u}))})),Aoe="hypot",Ioe=k2(Aoe,["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],(e=>{var{typed:t,abs:n,addScalar:r,divideScalar:o,multiplyScalar:a,sqrt:i,smaller:l,isPositive:s}=e;return t(Aoe,{"... number | BigNumber":c,Array:c,Matrix:e=>c(P6(e.toArray()))});function c(e){for(var t=0,c=0,u=0;u<e.length;u++){if(A1(e[u]))throw new TypeError("Unexpected type of argument to hypot");var d=n(e[u]);l(c,d)?(t=a(t,a(o(c,d),o(c,d))),t=r(t,1),c=d):t=r(t,s(d)?a(o(d,c),o(d,c)):d)}return a(c,i(t))}})),Roe="norm",Moe=k2(Roe,["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],(e=>{var{typed:t,abs:n,add:r,pow:o,conj:a,sqrt:i,multiply:l,equalScalar:s,larger:c,smaller:u,matrix:d,ctranspose:p,eigs:f}=e;return t(Roe,{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 v(d(e),2)},Matrix:function(e){return v(e,2)},"Array, number | BigNumber | string":function(e,t){return v(d(e),t)},"Matrix, number | BigNumber | string":function(e,t){return v(e,t)}});function h(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var r=n(e);c(r,t)&&(t=r)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var r=n(e);t&&!u(r,t)||(t=r)}),!0),t||0}(e);if("fro"===t)return v(e,2);if("number"==typeof t&&!isNaN(t)){if(!s(t,0)){var a=0;return e.forEach((function(e){a=r(o(n(e),t),a)}),!0),o(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function m(e,t){if(1===t)return function(e){var t=[],o=0;return e.forEach((function(e,a){var i=a[1],l=r(t[i]||0,n(e));c(l,o)&&(o=l),t[i]=l}),!0),o}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=[],o=0;return e.forEach((function(e,a){var i=a[0],l=r(t[i]||0,n(e));c(l,o)&&(o=l),t[i]=l}),!0),o}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,n){t=r(t,l(e,a(e)))})),n(i(t))}(e);if(2===t)return function(e){var t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");var r=p(e),o=l(r,e),a=f(o).values.toArray(),s=a[a.length-1];return n(i(s))}(e);throw new Error("Unsupported parameter value "+t)}function v(e,t){var n=e.size();if(1===n.length)return h(e,t);if(2===n.length){if(n[0]&&n[1])return m(e,t);throw new RangeError("Invalid matrix dimensions")}}})),Ooe=k2("dot",["typed","addScalar","multiplyScalar","conj","size"],(e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:o,size:a}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var s=i(e,a),c=B1(e)?e._data:e,u=B1(e)?e._datatype||e.getDataType():void 0,d=B1(a)?a._data:a,p=B1(a)?a._datatype||a.getDataType():void 0,f=2===l(e).length,h=2===l(a).length,m=n,v=r;if(u&&p&&u===p&&"string"==typeof u&&"mixed"!==u){var g=u;m=t.find(n,[g,g]),v=t.find(r,[g,g])}if(!f&&!h){for(var y=v(o(c[0]),d[0]),b=1;b<s;b++)y=m(y,v(o(c[b]),d[b]));return y}if(!f&&h){for(var w=v(o(c[0]),d[0][0]),x=1;x<s;x++)w=m(w,v(o(c[x]),d[x][0]));return w}if(f&&!h){for(var C=v(o(c[0][0]),d[0]),_=1;_<s;_++)C=m(C,v(o(c[_][0]),d[_]));return C}if(f&&h){for(var E=v(o(c[0][0]),d[0][0]),S=1;S<s;S++)E=m(E,v(o(c[S][0]),d[S][0]));return E}},"SparseMatrix, SparseMatrix":function(e,t){i(e,t);var o=e._index,a=e._values,l=t._index,s=t._values,c=0,u=n,d=r,p=0,f=0;for(;p<o.length&&f<l.length;){var h=o[p],m=l[f];h<m?p++:h>m?f++:h===m&&(c=u(c,d(a[p],s[f])),p++,f++)}return c}});function i(e,t){var n,r,o=l(e),a=l(t);if(1===o.length)n=o[0];else{if(2!==o.length||1!==o[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+o.join(", ")+")");n=o[0]}if(1===a.length)r=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");r=a[0]}if(n!==r)throw new RangeError("Vectors must have equal length ("+n+" != "+r+")");if(0===n)throw new RangeError("Cannot calculate the dot product of empty vectors");return n}function l(e){return B1(e)?e.size():a(e)}})),Boe=k2("trace",["typed","matrix","add"],(e=>{var{typed:t,matrix:n,add:r}=e;return t("trace",{Array:function(e){return o(n(e))},SparseMatrix:function(e){var t=e._values,n=e._index,o=e._ptr,a=e._size,i=a[0],l=a[1];if(i===l){var s=0;if(t.length>0)for(var c=0;c<l;c++)for(var u=o[c],d=o[c+1],p=u;p<d;p++){var f=n[p];if(f===c){s=r(s,t[p]);break}if(f>c)break}return s}throw new RangeError("Matrix must be square (size: "+h6(a)+")")},DenseMatrix:o,any:v2});function o(e){var t=e._size,n=e._data;switch(t.length){case 1:if(1===t[0])return v2(n[0]);throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:var o=t[0];if(o===t[1]){for(var a=0,i=0;i<o;i++)a=r(a,n[i][i]);return a}throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}}})),Voe="index",Poe=k2(Voe,["typed","Index"],(e=>{var{typed:t,Index:n}=e;return t(Voe,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return N1(e)?e.toNumber():O1(e)||B1(e)?e.map((function(e){return N1(e)?e.toNumber():e})):e})),r=new n;return n.apply(r,t),r}})})),Loe=new Set(["end"]),Foe=k2("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,{}),n={};return{evaluate:function(t){var r=k1(t);return function(e){for(var t of[...Loe])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(r),e(r,n,null)}}}_compile(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw new Error("Cannot run forEach on a Node interface")}map(e){throw new Error("Cannot run map on a Node interface")}_ifNode(e){if(!l2(e))throw new TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),function e(t,n){t.forEach((function(t,r,o){n(t,r,o),e(t,n)}))}(this,e)}transform(e){return function t(n,r,o){var a=e(n,r,o);return a!==n?a:n.map(t)}(this,null,null)}filter(e){var t=[];return this.traverse((function(n,r,o){e(n,r,o)&&t.push(n)})),t}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map((function(e){return e.cloneDeep()}))}equals(e){return!!e&&(this.type===e.type&&y2(this,e))}toString(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new 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 new 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 new 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 new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}}),{isClass:!0,isNode:!0});function zoe(e){return e&&e.isIndexError?new x6(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function joe(e){var{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"==typeof e.subset)return e.subset(n);if("string"==typeof e)return t(e,n);if("object"==typeof e){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return v1(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(r){throw zoe(r)}}}var $oe="AccessorNode",Uoe=k2($oe,["subset","Node"],(e=>{var{subset:t,Node:n}=e,r=joe({subset:t});function o(e){return!(J1(e)||Z1(e)||n2(e)||a2(e)||s2(e)||u2(e)||f2(e))}class a extends n{constructor(e,t){if(super(),!l2(e))throw new TypeError('Node expected for parameter "object"');if(!i2(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=t}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return $oe}get isAccessorNode(){return!0}_compile(e,t){var n=this.object._compile(e,t),o=this.index._compile(e,t);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,t,r){return v1(n(e,t,r),a)}}return function(e,t,a){var i=n(e,t,a),l=o(e,t,i);return r(i,l)}}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)))}clone(){return new a(this.object,this.index)}_toString(e){var t=this.object.toString(e);return o(this.object)&&(t="("+t+")"),t+this.index.toString(e)}_toHTML(e){var t=this.object.toHTML(e);return o(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 o(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}toJSON(){return{mathjs:$oe,object:this.object,index:this.index}}static fromJSON(e){return new a(e.object,e.index)}}return ste(a,"name",$oe),a}),{isClass:!0,isNode:!0}),Hoe="ArrayNode",qoe=k2(Hoe,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(l2))throw new TypeError("Array containing Nodes expected")}get type(){return Hoe}get isArrayNode(){return!0}_compile(e,t){var n=L6(this.items,(function(n){return n._compile(e,t)}));if("Array"!==e.config.matrix){var r=e.matrix;return function(e,t,o){return r(L6(n,(function(n){return n(e,t,o)})))}}return function(e,t,r){return L6(n,(function(n){return n(e,t,r)}))}}forEach(e){for(var t=0;t<this.items.length;t++){e(this.items[t],"items["+t+"]",this)}}map(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new n(t)}clone(){return new n(this.items.slice(0))}_toString(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"}toJSON(){return{mathjs:Hoe,items:this.items}}static fromJSON(e){return new n(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(n,r){var o=n.some(Z1)&&!n.every(Z1),a=r||o,i=a?"&":"\\\\",l=n.map((function(n){return n.items?t(n.items,!r):n.toTex(e)})).join(i);return o||!a||a&&!r?"\\begin{bmatrix}"+l+"\\end{bmatrix}":l}(this.items,!1)}}return ste(n,"name",Hoe),n}),{isClass:!0,isNode:!0});var Woe=[{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:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Goe(e,t){if(!t||"auto"!==t)return e;for(var n=e;u2(n);)n=n.content;return n}function Yoe(e,t,n,r){var o=e;"keep"!==t&&(o=e.getContent());for(var a=o.getIdentifier(),i=null,l=0;l<Woe.length;l++)if(a in Woe[l]){i=l;break}if("OperatorNode:multiply"===a&&o.implicit&&"show"!==n){var s=Goe(o.args[0],t);n2(s)&&r&&"OperatorNode:divide"===r.getIdentifier()&&r2(Goe(r.args[0],t))||"OperatorNode:divide"===s.getIdentifier()&&r2(Goe(s.args[0],t))&&n2(Goe(s.args[1]))||(i+=1)}return i}function Koe(e,t){var n=e;"keep"!==t&&(n=e.getContent());var r=n.getIdentifier(),o=Yoe(n,t);if(null===o)return null;var a=Woe[o][r];if(b2(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+r+"' has the invalid associativity '"+a.associativity+"'.")}return null}function Xoe(e,t,n){var r="keep"!==n?e.getContent():e,o="keep"!==n?e.getContent():t,a=r.getIdentifier(),i=o.getIdentifier(),l=Yoe(r,n);if(null===l)return null;var s=Woe[l][a];if(b2(s,"associativeWith")&&s.associativeWith instanceof Array){for(var c=0;c<s.associativeWith.length;c++)if(s.associativeWith[c]===i)return!0;return!1}return null}var Joe="AssignmentNode",Zoe=k2(Joe,["subset","?matrix","Node"],(e=>{var{subset:t,matrix:n,Node:r}=e,o=joe({subset:t}),a=function(e){var{subset:t,matrix:n}=e;return function(e,r,o){try{if(Array.isArray(e))return n(e).subset(r,o).valueOf().forEach(((t,n)=>{e[n]=t})),e;if(e&&"function"==typeof e.subset)return e.subset(r,o);if("string"==typeof e)return t(e,r,o);if("object"==typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return g1(e,r.getObjectProperty(),o),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw zoe(a)}}}({subset:t,matrix:n});function i(e,t,n){t||(t="keep");var r=Yoe(e,t,n),o=Yoe(e.value,t,n);return"all"===t||null!==o&&o<=r}class l extends r{constructor(e,t,n){if(super(),this.object=e,this.index=n?t:null,this.value=n||t,!f2(e)&&!J1(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(f2(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!i2(this.index))throw new TypeError('IndexNode expected as "index"');if(!l2(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Joe}get isAssignmentNode(){return!0}_compile(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,i=this.value._compile(e,t),l=this.object.name;if(this.index){if(this.index.isObjectProperty()){var s=this.index.getObjectProperty();return function(e,t,r){var o=n(e,t,r),a=i(e,t,r);return g1(o,s,a),a}}if(f2(this.object))return function(e,t,o){var s=n(e,t,o),c=i(e,t,o),u=r(e,t,s);return e.set(l,a(s,u,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var u=this.object.index.getObjectProperty();return function(e,t,n){var o=c(e,t,n),l=v1(o,u),s=r(e,t,l),d=i(e,t,n);return g1(o,u,a(l,s,d)),d}}var d=this.object.index._compile(e,t);return function(e,t,n){var l=c(e,t,n),s=d(e,t,l),u=o(l,s),p=r(e,t,u),f=i(e,t,n);return a(l,s,a(u,p,f)),f}}if(!f2(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){var r=i(e,t,n);return e.set(l,r),r}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){var t=this._ifNode(e(this.object,"object",this)),n=this.index?this._ifNode(e(this.index,"index",this)):null,r=this._ifNode(e(this.value,"value",this));return new l(t,n,r)}clone(){return new l(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):"",r=this.value.toString(e);return i(this,e&&e.parenthesis,e&&e.implicit)&&(r="("+r+")"),t+n+" = "+r}toJSON(){return{mathjs:Joe,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new l(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"",r=this.value.toHTML(e);return i(this,e&&e.parenthesis,e&&e.implicit)&&(r='<span class="math-paranthesis math-round-parenthesis">(</span>'+r+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+n+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+r}_toTex(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):"",r=this.value.toTex(e);return i(this,e&&e.parenthesis,e&&e.implicit)&&(r="\\left(".concat(r,"\\right)")),t+n+"="+r}}return ste(l,"name",Joe),l}),{isClass:!0,isNode:!0}),Qoe="BlockNode",eae=k2(Qoe,["ResultSet","Node"],(e=>{var{ResultSet:t,Node:n}=e;class r extends n{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!l2(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}get type(){return Qoe}get isBlockNode(){return!0}_compile(e,n){var r=L6(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,o){var a=[];return F6(r,(function(t){var r=t.evaluate(e,n,o);t.visible&&a.push(r)})),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=[],n=0;n<this.blocks.length;n++){var o=this.blocks[n],a=this._ifNode(e(o.node,"blocks["+n+"].node",this));t[n]={node:a,visible:o.visible}}return new r(t)}clone(){var e=this.blocks.map((function(e){return{node:e.node,visible:e.visible}}));return new r(e)}_toString(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")}toJSON(){return{mathjs:Qoe,blocks:this.blocks}}static fromJSON(e){return new r(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 ste(r,"name",Qoe),r}),{isClass:!0,isNode:!0}),tae="ConditionalNode",nae=k2(tae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e,t,n){if(super(),!l2(e))throw new TypeError("Parameter condition must be a Node");if(!l2(t))throw new TypeError("Parameter trueExpr must be a Node");if(!l2(n))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=n}get type(){return tae}get isConditionalNode(){return!0}_compile(e,t){var n=this.condition._compile(e,t),r=this.trueExpr._compile(e,t),o=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(N1(e))return!e.isZero();if(A1(e))return!(!e.re&&!e.im);if(R1(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+m2(e)+'"')}(n(e,t,a))?r(e,t,a):o(e,t,a)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Yoe(this,t,e&&e.implicit),r=this.condition.toString(e),o=Yoe(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r="("+r+")");var a=this.trueExpr.toString(e),i=Yoe(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==i&&i<=n)&&(a="("+a+")");var l=this.falseExpr.toString(e),s=Yoe(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=n)&&(l="("+l+")"),r+" ? "+a+" : "+l}toJSON(){return{mathjs:tae,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new n(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Yoe(this,t,e&&e.implicit),r=this.condition.toHTML(e),o=Yoe(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),i=Yoe(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==i&&i<=n)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var l=this.falseExpr.toHTML(e),s=Yoe(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=n)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+l}_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 ste(n,"name",tae),n}),{isClass:!0,isNode:!0}),rae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oae={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},aae={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},iae=function(e,t){return rae({},e,t)};const lae=P((function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preserveFormatting,r=void 0!==n&&n,o=t.escapeMapFn,a=void 0===o?iae:o,i=String(e),l="",s=a(rae({},oae),r?rae({},aae):{}),c=Object.keys(s),u=function(){var e=!1;c.forEach((function(t,n){e||i.length>=t.length&&i.slice(0,t.length)===t&&(l+=s[c[n]],i=i.slice(t.length,i.length),e=!0)})),e||(l+=i.slice(0,1),i=i.slice(1,i.length))};i;)u();return l}));var sae={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{?}"},cae={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"},uae={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(cae.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(cae.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(cae.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(cae.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(cae.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},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(cae.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(cae.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(cae.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(cae.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(cae.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(cae.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(cae.bitAnd,"${args[1]}\\right)")},bitNot:{1:cae.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(cae.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(cae.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(cae.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(cae.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(cae.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(cae.and,"${args[1]}\\right)")},not:{1:cae.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(cae.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(cae.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(cae.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(cae.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(cae.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(cae.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(cae.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(cae.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(cae.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(cae.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(cae.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(cae.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(cae.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(sae.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)"}},dae={deg:"^\\circ"};function pae(e){return lae(e,{preserveFormatting:!0})}function fae(e,t){return(t=void 0!==t&&t)?b2(dae,e)?dae[e]:"\\mathrm{"+pae(e)+"}":b2(sae,e)?sae[e]:pae(e)}var hae="ConstantNode",mae=k2(hae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){super(),this.value=e}get type(){return hae}get isConstantNode(){return!0}_compile(e,t){var n=this.value;return function(){return n}}forEach(e){}map(e){return this.clone()}clone(){return new n(this.value)}_toString(e){return h6(this.value,e)}_toHTML(e){var t=this._toString(e);switch(m2(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:hae,value:this.value}}static fromJSON(e){return new n(e.value)}_toTex(e){var t=this._toString(e),n=m2(this.value);switch(n){case"string":return"\\mathtt{"+pae(t)+"}";case"number":case"BigNumber":if(!("BigNumber"===n?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?"-\\infty":"\\infty";var r=t.toLowerCase().indexOf("e");return-1!==r?t.substring(0,r)+"\\cdot10^{"+t.substring(r+1)+"}":t;case"bigint":return t.toString();case"Fraction":return this.value.toLatex();default:return t}}}return ste(n,"name",hae),n}),{isClass:!0,isNode:!0}),vae="FunctionAssignmentNode",gae=k2(vae,["typed","Node"],(e=>{var{typed:t,Node:n}=e;function r(e,t,n){var r=Yoe(e,t,n),o=Yoe(e.expr,t,n);return"all"===t||null!==o&&o<=r}class o extends n{constructor(e,t,n){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!l2(n))throw new TypeError('Node expected for parameter "expr"');if(Loe.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');var r=new Set;for(var o of t){var a="string"==typeof o?o:o.name;if(r.has(a))throw new Error('Duplicate parameter name "'.concat(a,'"'));r.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=n}get type(){return vae}get isFunctionAssignmentNode(){return!0}_compile(e,n){var r=Object.create(n);F6(this.params,(function(e){r[e]=!0}));var o=this.expr._compile(e,r),a=this.name,i=this.params,l=$6(this.types,","),s=a+"("+$6(this.params,", ")+")";return function(e,n,r){var c={};c[l]=function(){for(var t=Object.create(n),a=0;a<i.length;a++)t[i[a]]=arguments[a];return o(e,t,r)};var u=t(a,c);return u.syntax=s,e.set(a,u),u}}forEach(e){e(this.expr,"expr",this)}map(e){var t=this._ifNode(e(this.expr,"expr",this));return new o(this.name,this.params.slice(0),t)}clone(){return new o(this.name,this.params.slice(0),this.expr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toString(e);return r(this,t,e&&e.implicit)&&(n="("+n+")"),this.name+"("+this.params.join(", ")+") = "+n}toJSON(){var e=this.types;return{mathjs:vae,name:this.name,params:this.params.map((function(t,n){return{name:t,type:e[n]}})),expr:this.expr}}static fromJSON(e){return new o(e.name,e.params,e.expr)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=[],o=0;o<this.params.length;o++)n.push('<span class="math-symbol math-parameter">'+g6(this.params[o])+"</span>");var a=this.expr.toHTML(e);return r(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">'+g6(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+n.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",n=this.expr.toTex(e);return r(this,t,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(fae).join(",")+"\\right)="+n}}return ste(o,"name",vae),o}),{isClass:!0,isNode:!0}),yae="IndexNode",bae=k2(yae,["Node","size"],(e=>{var{Node:t,size:n}=e;class r extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(l2))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return yae}get isIndexNode(){return!0}_compile(e,t){var r=L6(this.dimensions,(function(r,o){if(r.filter((e=>e.isSymbolNode&&"end"===e.name)).length>0){var a=Object.create(t);a.end=!0;var i=r._compile(e,a);return function(e,t,r){if(!B1(r)&&!O1(r)&&!M1(r))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+m2(r));var a=n(r).valueOf(),l=Object.create(t);return l.end=a[o],i(e,l,r)}}return r._compile(e,t)})),o=v1(e,"index");return function(e,t,n){var a=L6(r,(function(r){return r(e,t,n)}));return o(...a)}}forEach(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}map(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this._ifNode(e(this.dimensions[n],"dimensions["+n+"]",this));return new r(t,this.dotNotation)}clone(){return new r(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return 1===this.dimensions.length&&n2(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:yae,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(e){return new r(e.dimensions,e.dotNotation)}_toHTML(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this.dimensions[n].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+g6(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 ste(r,"name",yae),r}),{isClass:!0,isNode:!0}),wae="ObjectNode",xae=k2(wae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every((function(t){return l2(e[t])}))))throw new TypeError("Object containing Nodes expected")}get type(){return wae}get isObjectNode(){return!0}_compile(e,t){var n={};for(var r in this.properties)if(b2(this.properties,r)){var o=m6(r),a=JSON.parse(o),i=v1(this.properties,r);n[a]=i._compile(e,t)}return function(e,t,r){var o={};for(var a in n)b2(n,a)&&(o[a]=n[a](e,t,r));return o}}forEach(e){for(var t in this.properties)b2(this.properties,t)&&e(this.properties[t],"properties["+m6(t)+"]",this)}map(e){var t={};for(var r in this.properties)b2(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+m6(r)+"]",this)));return new n(t)}clone(){var e={};for(var t in this.properties)b2(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)}_toString(e){var t=[];for(var n in this.properties)b2(this.properties,n)&&t.push(m6(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:wae,properties:this.properties}}static fromJSON(e){return new n(e.properties)}_toHTML(e){var t=[];for(var n in this.properties)b2(this.properties,n)&&t.push('<span class="math-symbol math-property">'+g6(n)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[n].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 n in this.properties)b2(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return ste(n,"name",wae),n}),{isClass:!0,isNode:!0});function Cae(e,t){return new _1(e,new C1(t),new Set(Object.keys(t)))}var _ae="OperatorNode",Eae=k2(_ae,["Node"],(e=>{var{Node:t}=e;function n(e,t){var r=e;if("auto"===t)for(;u2(r);)r=r.content;return!!n2(r)||!!c2(r)&&n(r.args[0],t)}function r(e,t,r,o,a){var i,l=Yoe(e,t,r),s=Koe(e,t);if("all"===t||o.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return o.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(o.length){case 0:i=[];break;case 1:var c=Yoe(o[0],t,r,e);if(a&&null!==c){var u,d;if("keep"===t?(u=o[0].getIdentifier(),d=e.getIdentifier()):(u=o[0].getContent().getIdentifier(),d=e.getContent().getIdentifier()),!1===Woe[l][d].latexLeftParens){i=[!1];break}if(!1===Woe[c][u].latexParens){i=[!1];break}}if(null===c){i=[!1];break}if(c<=l){i=[!0];break}i=[!1];break;case 2:var p,f,h=Yoe(o[0],t,r,e),m=Xoe(e,o[0],t);p=null!==h&&(h===l&&"right"===s&&!m||h<l);var v,g,y,b=Yoe(o[1],t,r,e),w=Xoe(e,o[1],t);if(f=null!==b&&(b===l&&"left"===s&&!w||b<l),a)"keep"===t?(v=e.getIdentifier(),g=e.args[0].getIdentifier(),y=e.args[1].getIdentifier()):(v=e.getContent().getIdentifier(),g=e.args[0].getContent().getIdentifier(),y=e.args[1].getContent().getIdentifier()),null!==h&&(!1===Woe[l][v].latexLeftParens&&(p=!1),!1===Woe[h][g].latexParens&&(p=!1)),null!==b&&(!1===Woe[l][v].latexRightParens&&(f=!1),!1===Woe[b][y].latexParens&&(f=!1));i=[p,f];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(i=o.map((function(n){var o=Yoe(n,t,r,e),a=Xoe(e,n,t),i=Koe(n,t);return null!==o&&(l===o&&s===i&&!a||o<l)})))}if(o.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===r)for(var x=1;x<i.length;++x)!n(o[x],t)||i[x-1]||"keep"===t&&u2(o[x-1])||(i[x]=!0);return i}class o extends t{constructor(e,t,n,r,o){if(super(),"string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(n)||!n.every(l2))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===r,this.isPercentage=!0===o,this.op=e,this.fn=t,this.args=n||[]}get type(){return _ae}get isOperatorNode(){return!0}_compile(e,t){if("string"!=typeof this.fn||!b1(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var n=v1(e,this.fn),r=L6(this.args,(function(n){return n._compile(e,t)}));if("function"==typeof n&&!0===n.rawArgs){var o=this.args;return function(t,r,a){return n(o,e,Cae(t,r))}}if(1===r.length){var a=r[0];return function(e,t,r){return n(a(e,t,r))}}if(2===r.length){var i=r[0],l=r[1];return function(e,t,r){return n(i(e,t,r),l(e,t,r))}}return function(e,t,o){return n.apply(null,L6(r,(function(n){return n(e,t,o)})))}}forEach(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){for(var t=[],n=0;n<this.args.length;n++)t[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new o(this.op,this.fn,t,this.implicit,this.isPercentage)}clone(){return new o(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",o=this.args,a=r(this,t,n,o,!1);if(1===o.length){var i=Koe(this,t),l=o[0].toString(e);a[0]&&(l="("+l+")");var s=/[a-zA-Z]+/.test(this.op);return"right"===i?this.op+(s?" ":"")+l:"left"===i?l+(s?" ":"")+this.op:l+this.op}if(2===o.length){var c=o[0].toString(e),u=o[1].toString(e);return a[0]&&(c="("+c+")"),a[1]&&(u="("+u+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c+" "+u:c+" "+this.op+" "+u}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var d=o.map((function(t,n){return t=t.toString(e),a[n]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?d.join(" "):d.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:_ae,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new o(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",o=this.args,a=r(this,t,n,o,!1);if(1===o.length){var i=Koe(this,t),l=o[0].toHTML(e);return a[0]&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===i?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+g6(this.op)+"</span>"+l:l+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+g6(this.op)+"</span>"}if(2===o.length){var s=o[0].toHTML(e),c=o[1].toHTML(e);return a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<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?s+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:s+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+g6(this.op)+"</span>"+c}var u=o.map((function(t,n){return t=t.toHTML(e),a[n]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?u.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):u.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+g6(this.op)+"</span>"):'<span class="math-function">'+g6(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+u.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",o=this.args,a=r(this,t,n,o,!0),i=cae[this.fn];if(i=void 0===i?this.op:i,1===o.length){var l=Koe(this,t),s=o[0].toTex(e);return a[0]&&(s="\\left(".concat(s,"\\right)")),"right"===l?i+s:s+i}if(2===o.length){var c=o[0],u=c.toTex(e);a[0]&&(u="\\left(".concat(u,"\\right)"));var d,p=o[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),d="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return i+"{"+u+"}{"+p+"}";case"OperatorNode:pow":switch(u="{"+u+"}",p="{"+p+"}",d){case"ConditionalNode":case"OperatorNode:divide":u="\\left(".concat(u,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return u+"~"+p}return u+i+p}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var f=o.map((function(t,n){return t=t.toTex(e),a[n]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===n?f.join("~"):f.join(i)}return"\\mathrm{"+this.fn+"}\\left("+o.map((function(t){return t.toTex(e)})).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return ste(o,"name",_ae),o}),{isClass:!0,isNode:!0}),Sae="ParenthesisNode",kae=k2(Sae,["Node"],(e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),!l2(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return Sae}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){var t=e(this.content,"content",this);return new n(t)}clone(){return new n(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:Sae,content:this.content}}static fromJSON(e){return new n(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 ste(n,"name",Sae),n}),{isClass:!0,isNode:!0}),Tae="RangeNode",Nae=k2(Tae,["Node"],(e=>{var{Node:t}=e;function n(e,t,n){var r=Yoe(e,t,n),o={},a=Yoe(e.start,t,n);if(o.start=null!==a&&a<=r||"all"===t,e.step){var i=Yoe(e.step,t,n);o.step=null!==i&&i<=r||"all"===t}var l=Yoe(e.end,t,n);return o.end=null!==l&&l<=r||"all"===t,o}class r extends t{constructor(e,t,n){if(super(),!l2(e))throw new TypeError("Node expected");if(!l2(t))throw new TypeError("Node expected");if(n&&!l2(n))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=n||null}get type(){return Tae}get isRangeNode(){return!0}needsEnd(){return this.filter((function(e){return f2(e)&&"end"===e.name})).length>0}_compile(e,t){var n=e.range,r=this.start._compile(e,t),o=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,i){return n(r(e,t,i),o(e,t,i),a(e,t,i))}}return function(e,t,a){return n(r(e,t,a),o(e,t,a))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new r(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 r(this.start,this.end,this.step&&this.step)}_toString(e){var t,r=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),o=this.start.toString(e);if(r.start&&(o="("+o+")"),t=o,this.step){var a=this.step.toString(e);r.step&&(a="("+a+")"),t+=":"+a}var i=this.end.toString(e);return r.end&&(i="("+i+")"),t+=":"+i}toJSON(){return{mathjs:Tae,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new r(e.start,e.end,e.step)}_toHTML(e){var t,r=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),o=this.start.toHTML(e);if(r.start&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=o,this.step){var a=this.step.toHTML(e);r.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 i=this.end.toHTML(e);return r.end&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+i}_toTex(e){var t=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),r=this.start.toTex(e);if(t.start&&(r="\\left(".concat(r,"\\right)")),this.step){var o=this.step.toTex(e);t.step&&(o="\\left(".concat(o,"\\right)")),r+=":"+o}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),r+=":"+a}}return ste(r,"name",Tae),r}),{isClass:!0,isNode:!0}),Dae="RelationalNode",Aae=k2(Dae,["Node"],(e=>{var{Node:t}=e,n={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class r extends t{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}get type(){return Dae}get isRelationalNode(){return!0}_compile(e,t){var n=this,r=this.params.map((n=>n._compile(e,t)));return function(t,o,a){for(var i,l=r[0](t,o,a),s=0;s<n.conditionals.length;s++){if(i=l,l=r[s+1](t,o,a),!v1(e,n.conditionals[s])(i,l))return!1}return!0}}forEach(e){this.params.forEach(((t,n)=>e(t,"params["+n+"]",this)),this)}map(e){return new r(this.conditionals.slice(),this.params.map(((t,n)=>this._ifNode(e(t,"params["+n+"]",this))),this))}clone(){return new r(this.conditionals,this.params)}_toString(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=Yoe(this,t,e&&e.implicit),o=this.params.map((function(n,o){var a=Yoe(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?"("+n.toString(e)+")":n.toString(e)})),a=o[0],i=0;i<this.conditionals.length;i++)a+=" "+n[this.conditionals[i]],a+=" "+o[i+1];return a}toJSON(){return{mathjs:Dae,conditionals:this.conditionals,params:this.params}}static fromJSON(e){return new r(e.conditionals,e.params)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=Yoe(this,t,e&&e.implicit),o=this.params.map((function(n,o){var a=Yoe(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?'<span class="math-parenthesis math-round-parenthesis">(</span>'+n.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':n.toHTML(e)})),a=o[0],i=0;i<this.conditionals.length;i++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+g6(n[this.conditionals[i]])+"</span>"+o[i+1];return a}_toTex(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Yoe(this,t,e&&e.implicit),r=this.params.map((function(r,o){var a=Yoe(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)})),o=r[0],a=0;a<this.conditionals.length;a++)o+=cae[this.conditionals[a]]+r[a+1];return o}}return ste(r,"name",Dae),r}),{isClass:!0,isNode:!0}),Iae=k2("SymbolNode",["math","?Unit","Node"],(e=>{var{math:t,Unit:n,Node:r}=e;function o(e){return!!n&&n.isValuelessUnit(e)}class a extends r{constructor(e){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,t){var r=this.name;if(!0===t[r])return function(e,t,n){return v1(t,r)};if(r in e)return function(t,n,o){return t.has(r)?t.get(r):v1(e,r)};var i=o(r);return function(e,t,o){return e.has(r)?e.get(r):i?new n(null,r):a.onUndefinedSymbol(r)}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error("Undefined symbol "+e)}clone(){return new a(this.name)}_toString(e){return this.name}_toHTML(e){var t=g6(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new a(e.name)}_toTex(e){var n=!1;void 0===t[this.name]&&o(this.name)&&(n=!0);var r=fae(this.name,n);return"\\"===r[0]?r:" "+r}}return a}),{isClass:!0,isNode:!0}),Rae="FunctionNode",Mae=k2(Rae,["math","Node","SymbolNode"],(e=>{var t,{math:n,Node:r,SymbolNode:o}=e,a=e=>h6(e,{truncate:78});function i(e,t,n){for(var r,o="",a=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,i=0;null!==(r=a.exec(e));)if(o+=e.substring(i,r.index),i=r.index,"$$"===r[0])o+="$",i++;else{i+=r[0].length;var l=t[r[1]];if(!l)throw new ReferenceError("Template: Property "+r[1]+" does not exist.");if(void 0===r[2])switch(typeof l){case"string":o+=l;break;case"object":if(l2(l))o+=l.toTex(n);else{if(!Array.isArray(l))throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes");o+=l.map((function(e,t){if(l2(e))return e.toTex(n);throw new TypeError("Template: "+r[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes")}else{if(!l2(l[r[2]]&&l[r[2]]))throw new TypeError("Template: "+r[1]+"["+r[2]+"] is not a Node.");o+=l[r[2]].toTex(n)}}return o+=e.slice(i)}class l extends r{constructor(e,t){if(super(),"string"==typeof e&&(e=new o(e)),!l2(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(l2))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[]}get name(){return this.fn.name||""}get type(){return Rae}get isFunctionNode(){return!0}_compile(e,t){var n=this.args.map((n=>n._compile(e,t)));if(!f2(this.fn)){if(J1(this.fn)&&i2(this.fn.index)&&this.fn.index.isObjectProperty()){var r=this.fn.object._compile(e,t),o=this.fn.index.getObjectProperty(),i=this.args;return function(t,a,l){var s=r(t,a,l),c=function(e,t){if(!b1(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(s,o);if(null!=c&&c.rawArgs)return c(i,e,Cae(t,a));var u=n.map((e=>e(t,a,l)));return c.apply(s,u)}}var s=this.fn.toString(),c=this.fn._compile(e,t),u=this.args;return function(t,r,o){var i=c(t,r,o);if("function"!=typeof i)throw new TypeError("Expression '".concat(s,"' did not evaluate to a function; value is:")+"\n ".concat(a(i)));if(i.rawArgs)return i(u,e,Cae(t,r));var l=n.map((e=>e(t,r,o)));return i.apply(i,l)}}var d=this.fn.name;if(t[d]){var p=this.args;return function(t,r,o){var i=v1(r,d);if("function"!=typeof i)throw new TypeError("Argument '".concat(d,"' was not a function; received: ").concat(a(i)));if(i.rawArgs)return i(p,e,Cae(t,r));var l=n.map((e=>e(t,r,o)));return i.apply(i,l)}}var f=d in e?v1(e,d):void 0,h="function"==typeof f&&!0===f.rawArgs,m=t=>{var n;if(t.has(d))n=t.get(d);else{if(!(d in e))return l.onUndefinedFunction(d);n=v1(e,d)}if("function"==typeof n)return n;throw new TypeError("'".concat(d,"' is not a function; its value is:\n ").concat(a(n)))};if(h){var v=this.args;return function(t,r,o){var a=m(t);return!0===a.rawArgs?a(v,e,Cae(t,r)):a(...n.map((e=>e(t,r,o))))}}switch(n.length){case 0:return function(e,t,n){return m(e)()};case 1:return function(e,t,r){return m(e)((0,n[0])(e,t,r))};case 2:return function(e,t,r){var o=m(e),a=n[0],i=n[1];return o(a(e,t,r),i(e,t,r))};default:return function(e,t,r){return m(e)(...n.map((n=>n(e,t,r))))}}}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)),n=[],r=0;r<this.args.length;r++)n[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new l(t,n)}clone(){return new l(this.fn,this.args.slice(0))}toString(e){var t,n=this.fn.toString(e);return e&&"object"==typeof e.handler&&b2(e.handler,n)&&(t=e.handler[n](this,e)),void 0!==t?t:super.toString(e)}_toString(e){var t=this.args.map((function(t){return t.toString(e)}));return(o2(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}toJSON(){return{mathjs:Rae,fn:this.fn,args:this.args}}_toHTML(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+g6(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&&b2(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:super.toTex(e)}_toTex(e){var t,r,o=this.args.map((function(t){return t.toTex(e)}));switch(uae[this.name]&&(t=uae[this.name]),!n[this.name]||"function"!=typeof n[this.name].toTex&&"object"!=typeof n[this.name].toTex&&"string"!=typeof n[this.name].toTex||(t=n[this.name].toTex),typeof t){case"function":r=t(this,e);break;case"string":r=i(t,this,e);break;case"object":switch(typeof t[o.length]){case"function":r=t[o.length](this,e);break;case"string":r=i(t[o.length],this,e)}}return void 0!==r?r:i("\\mathrm{${name}}\\left(${args}\\right)",this,e)}getIdentifier(){return this.type+":"+this.name}}return t=l,ste(l,"name",Rae),ste(l,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),ste(l,"fromJSON",(function(e){return new t(e.fn,e.args)})),l}),{isClass:!0,isNode:!0}),Oae="parse",Bae=k2(Oae,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(e=>{var{typed:t,numeric:n,config:r,AccessorNode:o,ArrayNode:a,AssignmentNode:i,BlockNode:l,ConditionalNode:s,ConstantNode:c,FunctionAssignmentNode:u,FunctionNode:d,IndexNode:p,ObjectNode:f,OperatorNode:h,ParenthesisNode:m,RangeNode:v,RelationalNode:g,SymbolNode:y}=e,b=t(Oae,{string:function(e){return V(e,{})},"Array | Matrix":function(e){return w(e,{})},"string, Object":function(e,t){return V(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":w});function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0!==t.nodes?t.nodes:{};return a8(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return V(e,n)}))}var x={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},C={",":!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},_={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},E={true:!0,false:!1,null:null,undefined:void 0},S=["NaN","Infinity"],k={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function T(e,t){return e.expression.substr(e.index,t)}function N(e){return T(e,1)}function D(e){e.index++}function A(e){return e.expression.charAt(e.index-1)}function I(e){return e.expression.charAt(e.index+1)}function R(e){for(e.tokenType=x.NULL,e.token="",e.comment="";;){if("#"===N(e))for(;"\n"!==N(e)&&""!==N(e);)e.comment+=N(e),D(e);if(!b.isWhitespace(N(e),e.nestingLevel))break;D(e)}if(""!==N(e)){if("\n"===N(e)&&!e.nestingLevel)return e.tokenType=x.DELIMITER,e.token=N(e),void D(e);var t=N(e),n=T(e,2),r=T(e,3);if(3===r.length&&C[r])return e.tokenType=x.DELIMITER,e.token=r,D(e),D(e),void D(e);if(2===n.length&&C[n])return e.tokenType=x.DELIMITER,e.token=n,D(e),void D(e);if(C[t])return e.tokenType=x.DELIMITER,e.token=t,void D(e);if(b.isDigitDot(t)){e.tokenType=x.NUMBER;var o=T(e,2);if("0b"===o||"0o"===o||"0x"===o){for(e.token+=N(e),D(e),e.token+=N(e),D(e);b.isHexDigit(N(e));)e.token+=N(e),D(e);if("."===N(e))for(e.token+=".",D(e);b.isHexDigit(N(e));)e.token+=N(e),D(e);else if("i"===N(e))for(e.token+="i",D(e);b.isDigit(N(e));)e.token+=N(e),D(e);return}if("."===N(e)){if(e.token+=N(e),D(e),!b.isDigit(N(e)))return void(e.tokenType=x.DELIMITER)}else{for(;b.isDigit(N(e));)e.token+=N(e),D(e);b.isDecimalMark(N(e),I(e))&&(e.token+=N(e),D(e))}for(;b.isDigit(N(e));)e.token+=N(e),D(e);if("E"===N(e)||"e"===N(e))if(b.isDigit(I(e))||"-"===I(e)||"+"===I(e)){if(e.token+=N(e),D(e),"+"!==N(e)&&"-"!==N(e)||(e.token+=N(e),D(e)),!b.isDigit(N(e)))throw re(e,'Digit expected, got "'+N(e)+'"');for(;b.isDigit(N(e));)e.token+=N(e),D(e);if(b.isDecimalMark(N(e),I(e)))throw re(e,'Digit expected, got "'+N(e)+'"')}else if("."===I(e))throw D(e),re(e,'Digit expected, got "'+N(e)+'"')}else{if(!b.isAlpha(N(e),A(e),I(e))){for(e.tokenType=x.UNKNOWN;""!==N(e);)e.token+=N(e),D(e);throw re(e,'Syntax error in part "'+e.token+'"')}for(;b.isAlpha(N(e),A(e),I(e))||b.isDigit(N(e));)e.token+=N(e),D(e);b2(_,e.token)?e.tokenType=x.DELIMITER:e.tokenType=x.SYMBOL}}else e.tokenType=x.DELIMITER}function M(e){do{R(e)}while("\n"===e.token)}function O(e){e.nestingLevel++}function B(e){e.nestingLevel--}function V(e,t){var n={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:x.NULL,nestingLevel:0,conditionalLevel:null};h1(n,{expression:e,extraNodes:t}),R(n);var r=function(e){var t,n,r=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=P(e),e.comment&&(t.comment=e.comment));for(;"\n"===e.token||";"===e.token;)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),R(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=P(e),e.comment&&(t.comment=e.comment),n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new l(r):(t||(t=new c(void 0),e.comment&&(t.comment=e.comment)),t)}(n);if(""!==n.token)throw n.tokenType===x.DELIMITER?oe(n,"Unexpected operator "+n.token):re(n,'Unexpected part "'+n.token+'"');return r}function P(e){var t,n,r,o,a=function(e){var t=function(e){var t=L(e);for(;"or"===e.token;)M(e),t=new h("or","or",[t,L(e)]);return t}(e);for(;"?"===e.token;){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,M(e);var r=t,o=P(e);if(":"!==e.token)throw re(e,"False part of conditional expression expected");e.conditionalLevel=null,M(e);var a=P(e);t=new s(r,o,a),e.conditionalLevel=n}return t}(e);if("="===e.token){if(f2(a))return t=a.name,M(e),r=P(e),new i(new y(t),r);if(J1(a))return M(e),r=P(e),new i(a.object,a.index,r);if(a2(a)&&f2(a.fn)&&(o=!0,n=[],t=a.name,a.args.forEach((function(e,t){f2(e)?n[t]=e.name:o=!1})),o))return M(e),r=P(e),new u(t,n,r);throw re(e,"Invalid left hand side of assignment operator =")}return a}function L(e){for(var t=F(e);"xor"===e.token;)M(e),t=new h("xor","xor",[t,F(e)]);return t}function F(e){for(var t=z(e);"and"===e.token;)M(e),t=new h("and","and",[t,z(e)]);return t}function z(e){for(var t=j(e);"|"===e.token;)M(e),t=new h("|","bitOr",[t,j(e)]);return t}function j(e){for(var t=$(e);"^|"===e.token;)M(e),t=new h("^|","bitXor",[t,$(e)]);return t}function $(e){for(var t=U(e);"&"===e.token;)M(e),t=new h("&","bitAnd",[t,U(e)]);return t}function U(e){for(var t=[H(e)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};b2(r,e.token);){var o={name:e.token,fn:r[e.token]};n.push(o),M(e),t.push(H(e))}return 1===t.length?t[0]:2===t.length?new h(n[0].name,n[0].fn,t):new g(n.map((e=>e.fn)),t)}function H(e){var t,n,r,o;t=q(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};b2(a,e.token);)r=a[n=e.token],M(e),o=[t,q(e)],t=new h(n,r,o);return t}function q(e){var t,n,r,o;t=W(e);for(var a={to:"to",in:"to"};b2(a,e.token);)r=a[n=e.token],M(e),"in"===n&&""===e.token?t=new h("*","multiply",[t,new y("in")],!0):(o=[t,W(e)],t=new h(n,r,o));return t}function W(e){var t,n=[];if(t=":"===e.token?new c(1):G(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(n.push(t);":"===e.token&&n.length<3;)M(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new y("end")):n.push(G(e));t=3===n.length?new v(n[0],n[2],n[1]):new v(n[0],n[1])}return t}function G(e){var t,n,r,o;t=Y(e);for(var a={"+":"add","-":"subtract"};b2(a,e.token);){r=a[n=e.token],M(e);var i=Y(e);o=i.isPercentage?[t,new h("*","multiply",[t,i])]:[t,i],t=new h(n,r,o)}return t}function Y(e){var t,n,r,o;n=t=K(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};b2(a,e.token);)o=a[r=e.token],M(e),n=K(e),t=new h(r,o,[t,n]);return t}function K(e){var t,n;for(n=t=X(e);e.tokenType===x.SYMBOL||"in"===e.token&&n2(t)||!(e.tokenType!==x.NUMBER||n2(n)||c2(n)&&"!"!==n.op)||"("===e.token;)n=X(e),t=new h("*","multiply",[t,n],!0);return t}function X(e){for(var t=J(e),n=t,r=[];"/"===e.token&&r2(n);){if(r.push(h1({},e)),M(e),e.tokenType!==x.NUMBER){h1(e,r.pop());break}if(r.push(h1({},e)),M(e),e.tokenType!==x.SYMBOL&&"("!==e.token){r.pop(),h1(e,r.pop());break}h1(e,r.pop()),r.pop(),n=J(e),t=new h("/","divide",[t,n])}return t}function J(e){var t,n,r,o;t=Z(e);for(var a={"%":"mod",mod:"mod"};b2(a,e.token);)r=a[n=e.token],M(e),"%"===n&&e.tokenType===x.DELIMITER&&"("!==e.token?t=new h("/","divide",[t,new c(100)],!1,!0):(o=[t,Z(e)],t=new h(n,r,o));return t}function Z(e){var t,o,i,l={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return b2(l,e.token)?(i=l[e.token],t=e.token,M(e),o=[Z(e)],new h(t,i,o)):function(e){var t,o,i,l;t=function(e){var t,o,i;t=function(e){var t=[];if(e.tokenType===x.SYMBOL&&b2(e.extraNodes,e.token)){var o=e.extraNodes[e.token];if(R(e),"("===e.token){if(t=[],O(e),R(e),")"!==e.token)for(t.push(P(e));","===e.token;)R(e),t.push(P(e));if(")"!==e.token)throw re(e,"Parenthesis ) expected");B(e),R(e)}return new o(t)}return function(e){var t;if(e.tokenType===x.SYMBOL||e.tokenType===x.DELIMITER&&e.token in _)return t=e.token,R(e),Q(e,b2(E,t)?new c(E[t]):S.includes(t)?new c(n(t,"number")):new y(t));return function(e){var t;if('"'===e.token||"'"===e.token)return t=ee(e,e.token),Q(e,new c(t));return function(e){var t,o,i,l;if("["===e.token){if(O(e),R(e),"]"!==e.token){var s=te(e);if(";"===e.token){for(i=1,o=[s];";"===e.token;)R(e),"]"!==e.token&&(o[i]=te(e),i++);if("]"!==e.token)throw re(e,"End of matrix ] expected");B(e),R(e),l=o[0].items.length;for(var u=1;u<i;u++)if(o[u].items.length!==l)throw oe(e,"Column dimensions mismatch ("+o[u].items.length+" !== "+l+")");t=new a(o)}else{if("]"!==e.token)throw re(e,"End of matrix ] expected");B(e),R(e),t=s}}else B(e),R(e),t=new a([]);return Q(e,t)}return function(e){if("{"===e.token){var t;O(e);var o={};do{if(R(e),"}"!==e.token){if('"'===e.token||"'"===e.token)t=ee(e,e.token);else{if(!(e.tokenType===x.SYMBOL||e.tokenType===x.DELIMITER&&e.token in _))throw re(e,"Symbol or string expected as object key");t=e.token,R(e)}if(":"!==e.token)throw re(e,"Colon : expected after object key");R(e),o[t]=P(e)}}while(","===e.token);if("}"!==e.token)throw re(e,"Comma , or bracket } expected after object value");B(e),R(e);var a=new f(o);return a=Q(e,a)}return function(e){var t;if(e.tokenType===x.NUMBER){t=e.token,R(e);var o=D2(t,r),a=n(t,o);return new c(a)}return function(e){var t;if("("===e.token){if(O(e),R(e),t=P(e),")"!==e.token)throw re(e,"Parenthesis ) expected");return B(e),R(e),t=Q(e,t=new m(t))}return function(e){throw""===e.token?re(e,"Unexpected end of expression"):re(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);var l={"!":"factorial","'":"ctranspose"};for(;b2(l,e.token);)i=l[o=e.token],R(e),t=Q(e,t=new h(o,i,[t]));return t}(e),("^"===e.token||".^"===e.token)&&(i="^"===(o=e.token)?"pow":"dotPow",M(e),l=[t,Z(e)],t=new h(o,i,l));return t}(e)}function Q(e,t,n){for(var r;"("===e.token||"["===e.token||"."===e.token;)if(r=[],"("===e.token){if(!f2(t)&&!J1(t))return t;if(O(e),R(e),")"!==e.token)for(r.push(P(e));","===e.token;)R(e),r.push(P(e));if(")"!==e.token)throw re(e,"Parenthesis ) expected");B(e),R(e),t=new d(t,r)}else if("["===e.token){if(O(e),R(e),"]"!==e.token)for(r.push(P(e));","===e.token;)R(e),r.push(P(e));if("]"!==e.token)throw re(e,"Parenthesis ] expected");B(e),R(e),t=new o(t,new p(r))}else{if(R(e),!(e.tokenType===x.SYMBOL||e.tokenType===x.DELIMITER&&e.token in _))throw re(e,"Property name expected after dot");r.push(new c(e.token)),R(e);t=new o(t,new p(r,!0))}return t}function ee(e,t){for(var n="";""!==N(e)&&N(e)!==t;)if("\\"===N(e)){D(e);var r=N(e),o=k[r];if(void 0!==o)n+=o,e.index+=1;else{if("u"!==r)throw re(e,"Bad escape character \\".concat(r));var a=e.expression.slice(e.index+1,e.index+5);if(!/^[0-9A-Fa-f]{4}$/.test(a))throw re(e,"Invalid unicode character \\u".concat(a));n+=String.fromCharCode(parseInt(a,16)),e.index+=5}}else n+=N(e),D(e);if(R(e),e.token!==t)throw re(e,"End of string ".concat(t," expected"));return R(e),n}function te(e){for(var t=[P(e)],n=1;","===e.token;)R(e),"]"!==e.token&&";"!==e.token&&(t[n]=P(e),n++);return new a(t)}function ne(e){return e.index-e.token.length+1}function re(e,t){var n=ne(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}function oe(e,t){var n=ne(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}return b.isAlpha=function(e,t,n){return b.isValidLatinOrGreek(e)||b.isValidMathSymbol(e,n)||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||"\t"===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"},b.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},t.addConversion({from:"string",to:"Node",convert:b}),b})),Vae="compile",Pae=k2(Vae,["typed","parse"],(e=>{var{typed:t,parse:n}=e;return t(Vae,{string:function(e){return n(e).compile()},"Array | Matrix":function(e){return a8(e,(function(e){return n(e).compile()}))}})})),Lae="evaluate",Fae=k2(Lae,["typed","parse"],(e=>{var{typed:t,parse:n}=e;return t(Lae,{string:function(e){var t=S1();return n(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=S1();return a8(e,(function(e){return n(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return a8(e,(function(e){return n(e).compile().evaluate(t)}))}})})),zae=k2("Parser",["evaluate"],(e=>{var{evaluate:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:S1(),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(){return function(e){if(e instanceof C1)return e.wrappedObject;var t={};for(var n of e.keys())g1(t,n,e.get(n));return t}(this.scope)},n.prototype.getAllAsMap=function(){return this.scope},n.prototype.set=function(e,t){return this.scope.set(e,t),t},n.prototype.remove=function(e){this.scope.delete(e)},n.prototype.clear=function(){this.scope.clear()},n}),{isClass:!0}),jae="parser",$ae=k2(jae,["typed","Parser"],(e=>{var{typed:t,Parser:n}=e;return t(jae,{"":function(){return new n}})})),Uae=k2("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(e=>{var{typed:t,matrix:n,abs:r,addScalar:o,divideScalar:a,multiplyScalar:i,subtractScalar:l,larger:s,equalScalar:c,unaryMinus:u,DenseMatrix:d,SparseMatrix:p,Spa:f}=e;return t("lup",{DenseMatrix:function(e){return h(e)},SparseMatrix:function(e){return function(e){var t,n,o,l=e._size[0],d=e._size[1],h=Math.min(l,d),m=e._values,v=e._index,g=e._ptr,y=[],b=[],w=[],x=[l,h],C=[],_=[],E=[],S=[h,d],k=[],T=[];for(t=0;t<l;t++)k[t]=t,T[t]=t;var N=function(e,t){var n=T[e],r=T[t];k[n]=t,k[r]=e,T[e]=r,T[t]=n},D=function(){var e=new f;n<l&&(w.push(y.length),y.push(1),b.push(n)),E.push(C.length);var d=g[n],h=g[n+1];for(o=d;o<h;o++)t=v[o],e.set(k[t],m[o]);n>0&&e.forEach(0,n-1,(function(t,n){p._forEachRow(t,y,b,w,(function(r,o){r>t&&e.accumulate(r,u(i(o,n)))}))}));var T=n,D=e.get(n),A=r(D);e.forEach(n+1,l-1,(function(e,t){var n=r(t);s(n,A)&&(T=e,A=n,D=t)})),n!==T&&(p._swapRows(n,T,x[1],y,b,w),p._swapRows(n,T,S[1],C,_,E),e.swap(n,T),N(n,T)),e.forEach(0,l-1,(function(e,t){e<=n?(C.push(t),_.push(e)):(t=a(t,D),c(t,0)||(y.push(t),b.push(e)))}))};for(n=0;n<d;n++)D();return E.push(C.length),w.push(y.length),{L:new p({values:y,index:b,ptr:w,size:x}),U:new p({values:C,index:_,ptr:E,size:S}),p:k,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){var t=h(n(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function h(e){var t,n,u,p=e._size[0],f=e._size[1],h=Math.min(p,f),m=v2(e._data),v=[],g=[p,h],y=[],b=[h,f],w=[];for(t=0;t<p;t++)w[t]=t;for(n=0;n<f;n++){if(n>0)for(t=0;t<p;t++){var x=Math.min(t,n),C=0;for(u=0;u<x;u++)C=o(C,i(m[t][u],m[u][n]));m[t][n]=l(m[t][n],C)}var _=n,E=0,S=0;for(t=n;t<p;t++){var k=m[t][n],T=r(k);s(T,E)&&(_=t,E=T,S=k)}if(n!==_&&(w[n]=[w[_],w[_]=w[n]][0],d._swapRows(n,_,m)),n<p)for(t=n+1;t<p;t++){var N=m[t][n];c(N,0)||(m[t][n]=a(m[t][n],S))}}for(n=0;n<f;n++)for(t=0;t<p;t++)0===n&&(t<f&&(y[t]=[]),v[t]=[]),t<n?(t<f&&(y[t][n]=m[t][n]),n<p&&(v[t][n]=0)):t!==n?(t<f&&(y[t][n]=0),n<p&&(v[t][n]=m[t][n])):(t<f&&(y[t][n]=m[t][n]),n<p&&(v[t][n]=1));var D=new d({data:v,size:g}),A=new d({data:y,size:b}),I=[];for(t=0,h=w.length;t<h;t++)I[w[t]]=t;return{L:D,U:A,p:I,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}})),Hae=k2("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],(e=>{var{typed:t,matrix:n,zeros:r,identity:o,isZero:a,equal:i,sign:l,sqrt:s,conj:c,unaryMinus:u,addScalar:d,divideScalar:p,multiplyScalar:f,subtractScalar:h,complex:m}=e;return h1(t("qr",{DenseMatrix:function(e){return g(e)},SparseMatrix:function(e){return function(){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=g(n(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:v});function v(e){var t,n,m,v=e._size[0],g=e._size[1],y=o([v],"dense"),b=y._data,w=e.clone(),x=w._data,C=r([v],"");for(m=0;m<Math.min(g,v);++m){var _=x[m][m],E=u(i(_,0)?1:l(_)),S=c(E),k=0;for(t=m;t<v;t++)k=d(k,f(x[t][m],c(x[t][m])));var T=f(E,s(k));if(!a(T)){var N=h(_,T);for(C[m]=1,t=m+1;t<v;t++)C[t]=p(x[t][m],N);var D=u(c(p(N,T))),A=void 0;for(n=m;n<g;n++){for(A=0,t=m;t<v;t++)A=d(A,f(c(C[t]),x[t][n]));for(A=f(A,D),t=m;t<v;t++)x[t][n]=f(h(x[t][n],f(C[t],A)),S)}for(t=0;t<v;t++){for(A=0,n=m;n<v;n++)A=d(A,f(b[t][n],C[n]));for(A=f(A,D),n=m;n<v;++n)b[t][n]=p(h(b[t][n],f(A,c(C[n]))),S)}}}return{Q:y,R:w,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function g(e){var t=v(e),n=t.R._data;if(e._data.length>0)for(var r="Complex"===n[0][0].type?m(0):0,o=0;o<n.length;++o)for(var a=0;a<o&&a<(n[0]||[]).length;++a)n[o][a]=r;return t}}));function qae(e,t,n,r,o,a,i){var l=0;for(n[i]=e;l>=0;){var s=n[i+l],c=n[r+s];-1===c?(l--,a[t++]=s):(n[r+s]=n[o+c],n[i+ ++l]=c)}return t}function Wae(e){return-e-2}var Gae=k2("csAmd",["add","multiply","transpose"],(e=>{var{add:t,multiply:n,transpose:r}=e;return function(e,i){if(!i||e<=0||e>3)return null;var l=i._size,s=l[0],c=l[1],u=0,d=Math.max(16,10*Math.sqrt(c)),p=function(e,o,a,i,l){var s=r(o);if(1===e&&i===a)return t(o,s);if(2===e){for(var c=s._index,u=s._ptr,d=0,p=0;p<a;p++){var f=u[p];if(u[p]=d,!(u[p+1]-f>l))for(var h=u[p+1];f<h;f++)c[d++]=c[f]}return u[a]=d,o=r(s),n(s,o)}return n(s,o)}(e,i,s,c,d=Math.min(c-2,d));!function(e,t,n){for(var r=e._values,o=e._index,a=e._ptr,i=e._size[1],l=0,s=0;s<i;s++){var c=a[s];for(a[s]=l;c<a[s+1];c++)t(o[c],s,r?r[c]:1,n)&&(o[l]=o[c],r&&(r[l]=r[c]),l++)}a[i]=l,o.splice(l,o.length-l),r&&r.splice(l,r.length-l)}(p,a,null);for(var f,h,m,v,g,y,b,w,x,C,_,E,S,k,T,N,D=p._index,A=p._ptr,I=A[c],R=[],M=[],O=c+1,B=2*(c+1),V=3*(c+1),P=4*(c+1),L=5*(c+1),F=6*(c+1),z=7*(c+1),j=R,$=function(e,t,n,r,a,i,l,s,c,u,d,p){for(var f=0;f<e;f++)n[r+f]=t[f+1]-t[f];n[r+e]=0;for(var h=0;h<=e;h++)n[a+h]=-1,i[h]=-1,n[l+h]=-1,n[s+h]=-1,n[c+h]=1,n[u+h]=1,n[d+h]=0,n[p+h]=n[r+h];var m=o(0,0,n,u,e);return n[d+e]=-2,t[e]=-1,n[u+e]=0,m}(c,A,M,0,V,j,B,z,O,F,P,L),U=function(e,t,n,r,o,a,i,l,s,c,u){for(var d=0,p=0;p<e;p++){var f=n[r+p];if(0===f)n[o+p]=-2,d++,t[p]=-1,n[a+p]=0;else if(f>i)n[l+p]=0,n[o+p]=-1,d++,t[p]=Wae(e),n[l+e]++;else{var h=n[s+f];-1!==h&&(c[h]=p),n[u+p]=n[s+f],n[s+f]=p}}return d}(c,A,M,L,P,F,d,O,V,j,B),H=0;U<c;){for(m=-1;H<c&&-1===(m=M[V+H]);H++);-1!==M[B+m]&&(j[M[B+m]]=-1),M[V+H]=M[B+m];var q=M[P+m],W=M[O+m];U+=W;var G=0;M[O+m]=-W;var Y=A[m],K=0===q?Y:I,X=K;for(v=1;v<=q+1;v++){for(v>q?(y=m,b=Y,w=M[0+m]-q):(b=A[y=D[Y++]],w=M[0+y]),g=1;g<=w;g++)(x=M[O+(f=D[b++])])<=0||(G+=x,M[O+f]=-x,D[X++]=f,-1!==M[B+f]&&(j[M[B+f]]=j[f]),-1!==j[f]?M[B+j[f]]=M[B+f]:M[V+M[L+f]]=M[B+f]);y!==m&&(A[y]=Wae(m),M[F+y]=0)}for(0!==q&&(I=X),M[L+m]=G,A[m]=K,M[0+m]=X-K,M[P+m]=-2,$=o($,u,M,F,c),C=K;C<X;C++)if(!((_=M[P+(f=D[C])])<=0)){var J=$-(x=-M[O+f]);for(Y=A[f],E=A[f]+_-1;Y<=E;Y++)M[F+(y=D[Y])]>=$?M[F+y]-=x:0!==M[F+y]&&(M[F+y]=M[L+y]+J)}for(C=K;C<X;C++){for(S=(E=A[f=D[C]])+M[P+f]-1,k=E,T=0,N=0,Y=E;Y<=S;Y++)if(0!==M[F+(y=D[Y])]){var Z=M[F+y]-$;Z>0?(N+=Z,D[k++]=y,T+=y):(A[y]=Wae(m),M[F+y]=0)}M[P+f]=k-E+1;var Q=k,ee=E+M[0+f];for(Y=S+1;Y<ee;Y++){var te=M[O+(h=D[Y])];te<=0||(N+=te,D[k++]=h,T+=h)}0===N?(A[f]=Wae(m),G-=x=-M[O+f],W+=x,U+=x,M[O+f]=0,M[P+f]=-1):(M[L+f]=Math.min(M[L+f],N),D[k]=D[Q],D[Q]=D[E],D[E]=m,M[0+f]=k-E+1,T=(T<0?-T:T)%c,M[B+f]=M[z+T],M[z+T]=f,j[f]=T)}for(M[L+m]=G,$=o($+(u=Math.max(u,G)),u,M,F,c),C=K;C<X;C++)if(!(M[O+(f=D[C])]>=0))for(f=M[z+(T=j[f])],M[z+T]=-1;-1!==f&&-1!==M[B+f];f=M[B+f],$++){for(w=M[0+f],_=M[P+f],Y=A[f]+1;Y<=A[f]+w-1;Y++)M[F+D[Y]]=$;var ne=f;for(h=M[B+f];-1!==h;){var re=M[0+h]===w&&M[P+h]===_;for(Y=A[h]+1;re&&Y<=A[h]+w-1;Y++)M[F+D[Y]]!==$&&(re=0);re?(A[h]=Wae(f),M[O+f]+=M[O+h],M[O+h]=0,M[P+h]=-1,h=M[B+h],M[B+ne]=h):(ne=h,h=M[B+h])}}for(Y=K,C=K;C<X;C++)(x=-M[O+(f=D[C])])<=0||(M[O+f]=x,N=M[L+f]+G-x,-1!==M[V+(N=Math.min(N,c-U-x))]&&(j[M[V+N]]=f),M[B+f]=M[V+N],j[f]=-1,M[V+N]=f,H=Math.min(H,N),M[L+f]=N,D[Y++]=f);M[O+m]=W,0===(M[0+m]=Y-K)&&(A[m]=-1,M[F+m]=0),0!==q&&(I=Y)}for(f=0;f<c;f++)A[f]=Wae(A[f]);for(h=0;h<=c;h++)M[V+h]=-1;for(h=c;h>=0;h--)M[O+h]>0||(M[B+h]=M[V+A[h]],M[V+A[h]]=h);for(y=c;y>=0;y--)M[O+y]<=0||-1!==A[y]&&(M[B+y]=M[V+A[y]],M[V+A[y]]=y);for(m=0,f=0;f<=c;f++)-1===A[f]&&(m=qae(f,m,M,V,B,R,F));return R.splice(R.length-1,1),R};function o(e,t,n,r,o){if(e<2||e+t<0){for(var a=0;a<o;a++)0!==n[r+a]&&(n[r+a]=1);e=2}return e}function a(e,t){return e!==t}}));function Yae(e,t,n,r,o,a,i){var l,s,c,u=0;if(e<=t||n[r+t]<=n[o+e])return-1;n[o+e]=n[r+t];var d=n[a+e];if(n[a+e]=t,-1===d)u=1,c=e;else{for(u=2,c=d;c!==n[i+c];c=n[i+c]);for(l=d;l!==c;l=s)s=n[i+l],n[i+l]=c}return{jleaf:u,q:c}}var Kae=k2("csCounts",["transpose"],(e=>{var{transpose:t}=e;return function(e,n,r,o){if(!e||!n||!r)return null;var a,i,l,s,c,u,d,p=e._size,f=p[0],h=p[1],m=4*h+(o?h+f+1:0),v=[],g=h,y=2*h,b=3*h,w=4*h,x=5*h+1;for(l=0;l<m;l++)v[l]=-1;var C=[],_=t(e),E=_._index,S=_._ptr;for(l=0;l<h;l++)for(C[i=r[l]]=-1===v[b+i]?1:0;-1!==i&&-1===v[b+i];i=n[i])v[b+i]=l;if(o){for(l=0;l<h;l++)v[r[l]]=l;for(a=0;a<f;a++){for(l=h,u=S[a],d=S[a+1],c=u;c<d;c++)l=Math.min(l,v[E[c]]);v[x+a]=v[w+l],v[w+l]=a}}for(a=0;a<h;a++)v[0+a]=a;for(l=0;l<h;l++){for(-1!==n[i=r[l]]&&C[n[i]]--,s=o?v[w+l]:i;-1!==s;s=o?v[x+s]:-1)for(c=S[s];c<S[s+1];c++){var k=Yae(a=E[c],i,v,b,g,y,0);k.jleaf>=1&&C[i]++,2===k.jleaf&&C[k.q]--}-1!==n[i]&&(v[0+i]=n[i])}for(i=0;i<h;i++)-1!==n[i]&&(C[n[i]]+=C[i]);return C}})),Xae=k2("csSqr",["add","multiply","transpose"],(e=>{var{add:t,multiply:n,transpose:r}=e,o=Gae({add:t,multiply:n,transpose:r}),a=Kae({transpose:r});return function(e,t,n){var r,i=t._ptr,l=t._size[1],s={};if(s.q=o(e,t),e&&!s.q)return null;if(n){var c=e?function(e,t,n){e._values;for(var r=e._index,o=e._ptr,a=e._size,i=e._datatype,l=a[0],s=a[1],c=[],u=[],d=0,p=0;p<s;p++){u[p]=d;for(var f=n?n[p]:p,h=o[f],m=o[f+1],v=h;v<m;v++){var g=r[v];c[d]=g,d++}}return u[s]=d,e.createSparseMatrix({values:null,index:c,ptr:u,size:[l,s],datatype:i})}(t,0,s.q):t;s.parent=function(e){if(!e)return null;var t,n,r=e._index,o=e._ptr,a=e._size,i=a[0],l=a[1],s=[],c=[],u=l;for(t=0;t<i;t++)c[u+t]=-1;for(var d=0;d<l;d++){s[d]=-1,c[0+d]=-1;for(var p=o[d],f=o[d+1],h=p;h<f;h++){var m=r[h];for(t=c[u+m];-1!==t&&t<d;t=n)n=c[0+t],c[0+t]=d,-1===n&&(s[t]=d);c[u+m]=d}}return s}(c);var u=function(e,t){if(!e)return null;var n,r=0,o=[],a=[],i=t,l=2*t;for(n=0;n<t;n++)a[0+n]=-1;for(n=t-1;n>=0;n--)-1!==e[n]&&(a[i+n]=a[0+e[n]],a[0+e[n]]=n);for(n=0;n<t;n++)-1===e[n]&&(r=qae(n,r,a,0,i,o,l));return o}(s.parent,l);if(s.cp=a(c,s.parent,u,1),c&&s.parent&&s.cp&&function(e,t){var n=e._ptr,r=e._index,o=e._size,a=o[0],i=o[1];t.pinv=[],t.leftmost=[];var l,s,c,u,d,p=t.parent,f=t.pinv,h=t.leftmost,m=[],v=0,g=a,y=a+i,b=a+2*i;for(s=0;s<i;s++)m[g+s]=-1,m[y+s]=-1,m[b+s]=0;for(l=0;l<a;l++)h[l]=-1;for(s=i-1;s>=0;s--)for(u=n[s],d=n[s+1],c=u;c<d;c++)h[r[c]]=s;for(l=a-1;l>=0;l--)f[l]=-1,-1!==(s=h[l])&&(0===m[b+s]++&&(m[y+s]=l),m[v+l]=m[g+s],m[g+s]=l);for(t.lnz=0,t.m2=a,s=0;s<i;s++)if(l=m[g+s],t.lnz++,l<0&&(l=t.m2++),f[l]=s,!(--b[s]<=0)){t.lnz+=m[b+s];var w=p[s];-1!==w&&(0===m[b+w]&&(m[y+w]=m[y+s]),m[v+m[y+s]]=m[g+w],m[g+w]=m[v+l],m[b+w]+=m[b+s])}for(l=0;l<a;l++)f[l]<0&&(f[l]=s++);return!0}(c,s))for(s.unz=0,r=0;r<l;r++)s.unz+=s.cp[r]}else s.unz=4*i[l]+l,s.lnz=s.unz;return s}}));function Jae(e,t){return e[t]<0}function Zae(e,t){e[t]=Wae(e[t])}function Qae(e){return e<0?Wae(e):e}function eie(e,t,n,r,o){var a,i,l,s=t._index,c=t._ptr,u=t._size[1],d=0;for(r[0]=e;d>=0;){e=r[d];var p=o?o[e]:e;Jae(c,e)||(Zae(c,e),r[u+d]=p<0?0:Qae(c[p]));var f=1;for(i=r[u+d],l=p<0?0:Qae(c[p+1]);i<l;i++)if(!Jae(c,a=s[i])){r[u+d]=i,r[++d]=a,f=0;break}f&&(d--,r[--n]=e)}return n}var tie=k2("csSpsolve",["divideScalar","multiply","subtract"],(e=>{var{divideScalar:t,multiply:n,subtract:r}=e;return function(e,o,a,i,l,s,c){var u,d,p,f,h=e._values,m=e._index,v=e._ptr,g=e._size[1],y=o._values,b=o._index,w=o._ptr,x=function(e,t,n,r,o){var a,i,l,s=e._ptr,c=e._size,u=t._index,d=t._ptr,p=c[1],f=p;for(i=d[n],l=d[n+1],a=i;a<l;a++){var h=u[a];Jae(s,h)||(f=eie(h,e,f,r,o))}for(a=f;a<p;a++)Zae(s,r[a]);return f}(e,o,a,i,s);for(u=x;u<g;u++)l[i[u]]=0;for(d=w[a],p=w[a+1],u=d;u<p;u++)l[b[u]]=y[u];for(var C=x;C<g;C++){var _=i[C],E=s?s[_]:_;if(!(E<0))for(d=v[E],p=v[E+1],l[_]=t(l[_],h[c?d:p-1]),u=c?d+1:d,f=c?p:p-1;u<f;u++){var S=m[u];l[S]=r(l[S],n(h[u],l[_]))}}return x}})),nie=k2("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],(e=>{var{abs:t,divideScalar:n,multiply:r,subtract:o,larger:a,largerEq:i,SparseMatrix:l}=e,s=tie({divideScalar:n,multiply:r,subtract:o});return function(e,o,c){if(!e)return null;var u,d=e._size[1],p=100,f=100;o&&(u=o.q,p=o.lnz||p,f=o.unz||f);var h,m,v=[],g=[],y=[],b=new l({values:v,index:g,ptr:y,size:[d,d]}),w=[],x=[],C=[],_=new l({values:w,index:x,ptr:C,size:[d,d]}),E=[],S=[],k=[];for(h=0;h<d;h++)S[h]=0,E[h]=-1,y[h+1]=0;p=0,f=0;for(var T=0;T<d;T++){y[T]=p,C[T]=f;var N=u?u[T]:T,D=s(b,e,N,k,S,E,1),A=-1,I=-1;for(m=D;m<d;m++)if(E[h=k[m]]<0){var R=t(S[h]);a(R,I)&&(I=R,A=h)}else x[f]=E[h],w[f++]=S[h];if(-1===A||I<=0)return null;E[N]<0&&i(t(S[N]),r(I,c))&&(A=N);var M=S[A];for(x[f]=T,w[f++]=M,E[A]=T,g[p]=A,v[p++]=1,m=D;m<d;m++)E[h=k[m]]<0&&(g[p]=h,v[p++]=n(S[h],M)),S[h]=0}for(y[d]=p,C[d]=f,m=0;m<p;m++)g[m]=E[g[m]];return v.splice(p,v.length-p),g.splice(p,g.length-p),w.splice(f,w.length-f),x.splice(f,x.length-f),{L:b,U:_,pinv:E}}})),rie=k2("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],(e=>{var{typed:t,abs:n,add:r,multiply:o,transpose:a,divideScalar:i,subtract:l,larger:s,largerEq:c,SparseMatrix:u}=e,d=Xae({add:r,multiply:o,transpose:a}),p=nie({abs:n,divideScalar:i,multiply:o,subtract:l,larger:s,largerEq:c,SparseMatrix:u});return t("slu",{"SparseMatrix, number, number":function(e,t,n){if(!N2(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var r=d(t,e,!1),o=p(e,r,n);return{L:o.L,U:o.U,p:o.pinv,q:r.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));function oie(e,t){var n,r=t.length,o=[];if(e)for(n=0;n<r;n++)o[e[n]]=t[n];else for(n=0;n<r;n++)o[n]=t[n];return o}var aie="lusolve",iie=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],lie=k2(aie,iie,(e=>{var{typed:t,matrix:n,lup:r,slu:o,usolve:a,lsolve:i,DenseMatrix:l}=e,s=Zte({DenseMatrix:l});return t(aie,{"Array, Array | Matrix":function(e,t){e=n(e);var o=r(e);return u(o.L,o.U,o.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var n=r(e);return u(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var n=r(e);return u(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,n,r){var a=o(e,n,r);return u(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return u(e.L,e.U,e.p,e.q,t)}});function c(e){if(B1(e))return e;if(O1(e))return n(e);throw new TypeError("Invalid Matrix LU decomposition")}function u(e,t,n,r,o){e=c(e),t=c(t),n&&((o=s(e,o,!0))._data=oie(n,o._data));var l=i(e,o),u=a(t,l);return r&&(u._data=oie(r,u._data)),u}})),sie="polynomialRoot",cie=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],uie=k2(sie,cie,(e=>{var{typed:t,isZero:n,equalScalar:r,add:o,subtract:a,multiply:i,divide:l,sqrt:s,unaryMinus:c,cbrt:u,typeOf:d,im:p,re:f}=e;return t(sie,{"number|Complex, ...number|Complex":(e,t)=>{for(var h=[e,...t];h.length>0&&n(h[h.length-1]);)h.pop();if(h.length<2)throw new RangeError("Polynomial [".concat(e,", ").concat(t,"] must have a non-zero non-constant coefficient"));switch(h.length){case 2:return[c(l(h[0],h[1]))];case 3:var[m,v,g]=h,y=i(2,g),b=i(v,v),w=i(4,g,m);if(r(b,w))return[l(c(v),y)];var x=s(a(b,w));return[l(a(x,v),y),l(a(c(x),v),y)];case 4:var[C,_,E,S]=h,k=c(i(3,S)),T=i(E,E),N=i(3,S,_),D=o(i(2,E,E,E),i(27,S,S,C)),A=i(9,S,E,_);if(r(T,N)&&r(D,A))return[l(E,k)];var I,R=a(T,N),M=a(D,A),O=o(i(18,S,E,_,C),i(E,E,_,_)),B=o(i(4,E,E,E,C),i(4,S,_,_,_),i(27,S,S,C,C));if(r(O,B))return[l(a(i(4,S,E,_),o(i(9,S,S,C),i(E,E,E))),i(S,R)),l(a(i(9,S,C),i(E,_)),i(2,R))];I=r(T,N)?M:l(o(M,s(a(i(M,M),i(4,R,R,R)))),2);var V=u(I,!0).toArray().map((e=>l(o(E,e,l(R,e)),k)));return V.map((e=>"Complex"===d(e)&&r(f(e),f(e)+p(e))?f(e):e));default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(h))}}})})),die=["evaluate"],pie=k2("Help",die,(e=>{var{evaluate:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){var e=this.doc||{},n="\n";if(e.name&&(n+="Name: "+e.name+"\n\n"),e.category&&(n+="Category: "+e.category+"\n\n"),e.description&&(n+="Description:\n "+e.description+"\n\n"),e.syntax&&(n+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){n+="Examples:\n";for(var r=!1,o=t("config()"),a={config:e=>(r=!0,t("config(newConfig)",{newConfig:e}))},i=0;i<e.examples.length;i++){var l=e.examples[i];n+=" "+l+"\n";var s=void 0;try{s=t(l,a)}catch(HT){s=HT}void 0===s||U1(s)||(n+=" "+h6(s,{precision:14})+"\n")}n+="\n",r&&t("config(originalConfig)",{originalConfig:o})}return e.mayThrow&&e.mayThrow.length&&(n+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(n+="See also: "+e.seealso.join(", ")+"\n"),n},n.prototype.toJSON=function(){var e=v2(this.doc);return e.mathjs="Help",e},n.fromJSON=function(e){var t={};return Object.keys(e).filter((e=>"mathjs"!==e)).forEach((n=>{t[n]=e[n]})),new n(t)},n.prototype.valueOf=n.prototype.toString,n}),{isClass:!0}),fie=["?on","math","typed"],hie=k2("Chain",fie,(e=>{var{on:t,math:n,typed:r}=e;function o(e){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");h2(e)?this.value=e.value:this.value=e}function a(e,t){var n,r,a,l,s;n=o.prototype,r=e,a=function(){var e=t();if("function"==typeof e)return i(e)},s=!0,Object.defineProperty(n,r,{get:function(){return s&&(l=a(),s=!1),l},set:function(e){l=e,s=!1},configurable:!0,enumerable:!0})}function i(e){return function(){if(0===arguments.length)return new o(e(this.value));for(var t=[this.value],n=0;n<arguments.length;n++)t[n+1]=arguments[n];if(r.isTypedFunction(e)){var a=r.resolve(e,t);if(1===a.params.length)throw new Error("chain function "+e.name+" cannot match rest parameter between chain value and additional arguments.");return new o(a.implementation.apply(e,t))}return new o(e.apply(e,t))}}o.prototype.type="Chain",o.prototype.isChain=!0,o.prototype.done=function(){return this.value},o.prototype.valueOf=function(){return this.value},o.prototype.toString=function(){return h6(this.value)},o.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},o.fromJSON=function(e){return new o(e.value)},o.createProxy=function(e,t){if("string"==typeof e)!function(e,t){"function"==typeof t&&(o.prototype[e]=i(t))}(e,t);else{var n=function(t){b2(e,t)&&void 0===l[t]&&a(t,(()=>e[t]))};for(var r in e)n(r)}};var l={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return o.createProxy(n),t&&t("import",(function(e,t,n){n||a(e,t)})),o}),{isClass:!0}),mie={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"]},vie={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"]},gie={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:mie,E:mie,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:vie,PI:vie,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",examples:["coulomb"]},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)"],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)"],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)"],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)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)"],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)"],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>1, -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:"he 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"]},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:[]},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:[]},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"]},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"]},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"]},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.",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.",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.",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.",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","sum","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:[]},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"]},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"]},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"]}},yie="help",bie=k2(yie,["typed","mathWithTransform","Help"],(e=>{var{typed:t,mathWithTransform:n,Help:r}=e;return t(yie,{any:function(e){var t,o=e;if("string"!=typeof e)for(t in n)if(b2(n,t)&&e===n[t]){o=t;break}var a=v1(gie,o);if(!a){var i="function"==typeof o?o.name:o;throw new Error('No documentation found on "'+i+'"')}return new r(a)}})})),wie="chain",xie=k2(wie,["typed","Chain"],(e=>{var{typed:t,Chain:n}=e;return t(wie,{"":function(){return new n},any:function(e){return new n(e)}})})),Cie=k2("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],(e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:o,divideScalar:a,isZero:i,unaryMinus:l}=e;return t("det",{any:function(e){return v2(e)},"Array | Matrix":function(e){var t;switch((t=B1(e)?e.size():Array.isArray(e)?(e=n(e)).size():[]).length){case 0:return v2(e);case 1:if(1===t[0])return v2(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:var s=t[0],c=t[1];if(s===c)return function(e,t){if(1===t)return v2(e[0][0]);if(2===t)return r(o(e[0][0],e[1][1]),o(e[1][0],e[0][1]));for(var n=!1,s=new Array(t).fill(0).map(((e,t)=>t)),c=0;c<t;c++){var u=s[c];if(i(e[u][c])){var d=void 0;for(d=c+1;d<t;d++)if(!i(e[s[d]][c])){u=s[d],s[d]=s[c],s[c]=u,n=!n;break}if(d===t)return e[u][c]}for(var p=e[u][c],f=0===c?1:e[s[c-1]][c-1],h=c+1;h<t;h++)for(var m=s[h],v=c+1;v<t;v++)e[m][v]=a(r(o(e[m][v],p),o(e[m][c],e[u][v])),f)}var g=e[s[t-1]][t-1];return n?l(g):g}(e.clone().valueOf(),s);if(0===c)return 1;throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}}})})),_ie=k2("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],(e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:o,multiply:a,unaryMinus:i,det:l,identity:s,abs:c}=e;return t("inv",{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);switch(t.length){case 1:if(1===t[0])return B1(e)?n([r(1,e.valueOf()[0])]):[r(1,e[0])];throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:var o=t[0],a=t[1];if(o===a)return B1(e)?n(u(e.valueOf(),o,a),e.storage()):u(e,o,a);throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}},any:function(e){return r(1,e)}});function u(e,t,n){var u,d,p,f,h;if(1===t){if(0===(f=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,f)]]}if(2===t){var m=l(e);if(0===m)throw Error("Cannot calculate inverse, determinant is zero");return[[r(e[1][1],m),r(i(e[0][1]),m)],[r(i(e[1][0]),m),r(e[0][0],m)]]}var v=e.concat();for(u=0;u<t;u++)v[u]=v[u].concat();for(var g=s(t).valueOf(),y=0;y<n;y++){var b=c(v[y][y]),w=y;for(u=y+1;u<t;)c(v[u][y])>b&&(b=c(v[u][y]),w=u),u++;if(0===b)throw Error("Cannot calculate inverse, determinant is zero");(u=w)!==y&&(h=v[y],v[y]=v[u],v[u]=h,h=g[y],g[y]=g[u],g[u]=h);var x=v[y],C=g[y];for(u=0;u<t;u++){var _=v[u],E=g[u];if(u!==y){if(0!==_[y]){for(p=r(i(_[y]),x[y]),d=y;d<n;d++)_[d]=o(_[d],a(p,x[d]));for(d=0;d<n;d++)E[d]=o(E[d],a(p,C[d]))}}else{for(p=x[y],d=y;d<n;d++)_[d]=r(_[d],p);for(d=0;d<n;d++)E[d]=r(E[d],p)}}}return g}})),Eie="pinv",Sie=k2(Eie,["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],(e=>{var{typed:t,matrix:n,inv:r,deepEqual:o,equal:a,dotDivide:i,dot:l,ctranspose:s,divideScalar:c,multiply:u,add:d,Complex:p}=e;return t(Eie,{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);switch(t.length){case 1:return m(e)?s(e):1===t[0]?r(e):i(s(e),l(e,e));case 2:if(m(e))return s(e);var o=t[0],a=t[1];if(o===a)try{return r(e)}catch(c){if(!(c instanceof Error&&c.message.match(/Cannot calculate inverse, determinant is zero/)))throw c}return B1(e)?n(f(e.valueOf(),o,a),e.storage()):f(e,o,a);default:throw new RangeError("Matrix must be two dimensional (size: "+h6(t)+")")}},any:function(e){return a(e,0)?v2(e):c(1,e)}});function f(e,t,n){var{C:o,F:a}=function(e,t,n){var r=function(e,t,n){for(var r=v2(e),o=0,a=0;a<t;a++){if(n<=o)return r;for(var l=a;h(r[l][o]);)if(t===++l&&(l=a,n===++o))return r;[r[l],r[a]]=[r[a],r[l]];for(var s=r[a][o],c=0;c<n;c++)r[a][c]=i(r[a][c],s);for(var p=0;p<t;p++)if(p!==a){s=r[p][o];for(var f=0;f<n;f++)r[p][f]=d(r[p][f],u(-1,u(s,r[a][f])))}o++}return r}(e,t,n),o=e.map(((e,n)=>e.filter(((e,n)=>n<t&&!h(l(r[n],r[n])))))),a=r.filter(((e,t)=>!h(l(r[t],r[t]))));return{C:o,F:a}}(e,t,n),c=u(r(u(s(o),o)),s(o)),p=u(s(a),r(u(a,s(a))));return u(p,c)}function h(e){return a(d(e,p(1,1)),d(0,p(1,1)))}function m(e){return o(d(e,p(1,1)),d(u(e,0),p(1,1)))}}));function kie(e){var{addScalar:t,subtract:n,flatten:r,multiply:o,multiplyScalar:a,divideScalar:i,sqrt:l,abs:s,bignumber:c,diag:u,size:d,reshape:p,inv:f,qr:h,usolve:m,usolveAll:v,equal:g,complex:y,larger:b,smaller:w,matrixFromColumns:x,dot:C}=e;function _(e,r,o,i){var s=t(e,i),c=n(a(e,i),a(r,o)),u=a(s,.5),d=a(l(n(a(s,s),a(4,c))),.5);return[t(u,d),n(u,d)]}function E(e,t,r,o,a,i,l,u){var d="BigNumber"===u,p="Complex"===u,f=d?c(0):p?y(0):0,h=d?c(1):p?y(1):1;if(w(s(r),l))return[[h,f],[f,h]];if(b(s(n(a,i)),l))return[[n(a,o),n(i,o)],[r,r]];var m=n(e,a),v=n(o,a);return w(s(t),l)&&w(s(v),l)?[[m,h],[r,f]]:[[t,f],[v,h]]}function S(e,t){for(var n=0;n<e.length;n++)e[n].push(...Array(t-e[n].length).fill(0));for(var r=e.length;r<t;r++)e.push(Array(t).fill(0)),e[r][r]=1;return e}function k(e,t,n){for(var r=0;r<e.length;r++)if(n(e[r],t))return r;return-1}function T(e,t,n,r,o){for(var a,i="BigNumber"===o?c(1e3):1e3,l=0;l<5;++l){a=N(t,n,o);try{a=m(e,a)}catch(u){continue}if(b(A(a),i))break}if(l>=5)return null;for(l=0;;){var s=m(e,a);if(w(A(D(a,[s])),r))break;if(++l>=10)return null;a=I(s)}return a}function N(e,t,n){var r="BigNumber"===n,o="Complex"===n,a=Array(e).fill(0).map((e=>2*Math.random()-1));return r&&(a=a.map((e=>c(e)))),o&&(a=a.map((e=>y(e)))),I(a=D(a,t),n)}function D(e,t){var r=d(e);for(var a of t)a=p(a,r),e=n(e,o(i(C(a,e),C(a,a)),a));return e}function A(e){return s(l(C(e,e)))}function I(e,t){var n="Complex"===t,r="BigNumber"===t?c(1):n?y(1):1;return o(i(r,A(e)),e)}return function(e,l,d,p){var m=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],x=function(e,n,r,o,l){var d,p="BigNumber"===o,f="Complex"===o,h=p?c(0):0,m=p?c(1):f?y(1):1,v=p?c(1):1,x=p?c(10):2,C=a(x,x);l&&(d=Array(n).fill(m));var _=!1;for(;!_;){_=!0;for(var E=0;E<n;E++){for(var S=h,k=h,T=0;T<n;T++)E!==T&&(S=t(S,s(e[T][E])),k=t(k,s(e[E][T])));if(!g(S,0)&&!g(k,0)){for(var N=v,D=S,A=i(k,x),I=a(k,x);w(D,A);)D=a(D,C),N=a(N,x);for(;b(D,I);)D=i(D,C),N=i(N,x);if(w(i(t(D,k),N),a(t(S,k),.95))){_=!1;for(var R=i(1,N),M=0;M<n;M++)E!==M&&(e[E][M]=a(e[E][M],R),e[M][E]=a(e[M][E],N));l&&(d[E]=a(d[E],R))}}}}return l?u(d):null}(e,l,0,p,m);!function(e,r,o,l,u,d){var p="BigNumber"===l,f="Complex"===l,h=p?c(0):f?y(0):0;p&&(o=c(o));for(var m=0;m<r-2;m++){for(var v=0,g=h,b=m+1;b<r;b++){var x=e[b][m];w(s(g),s(x))&&(g=x,v=b)}if(!w(s(g),o)){if(v!==m+1){var C=e[v];e[v]=e[m+1],e[m+1]=C;for(var _=0;_<r;_++){var E=e[_][v];e[_][v]=e[_][m+1],e[_][m+1]=E}if(u){var S=d[v];d[v]=d[m+1],d[m+1]=S}}for(var k=m+2;k<r;k++){var T=i(e[k][m],g);if(0!==T){for(var N=0;N<r;N++)e[k][N]=n(e[k][N],a(T,e[m+1][N]));for(var D=0;D<r;D++)e[D][m+1]=t(e[D][m+1],a(T,e[D][k]));if(u)for(var A=0;A<r;A++)d[k][A]=n(d[k][A],a(T,d[m+1][A]))}}}}}(e,l,d,p,m,x);var{values:C,C:N}=function(e,r,a,i,l){var d="BigNumber"===i,p="Complex"===i,f=d?c(1):p?y(1):1;d&&(a=c(a));var m=v2(e),v=[],g=r,b=[],x=l?u(Array(r).fill(f)):void 0,C=l?u(Array(g).fill(f)):void 0,k=0;for(;k<=100;){k+=1;for(var T=m[g-1][g-1],N=0;N<g;N++)m[N][N]=n(m[N][N],T);var{Q:D,R:A}=h(m);m=o(A,D);for(var I=0;I<g;I++)m[I][I]=t(m[I][I],T);if(l&&(C=o(C,D)),1===g||w(s(m[g-1][g-2]),a)){k=0,v.push(m[g-1][g-1]),l&&(b.unshift([[1]]),S(C,r),x=o(x,C),g>1&&(C=u(Array(g-1).fill(f)))),g-=1,m.pop();for(var R=0;R<g;R++)m[R].pop()}else if(2===g||w(s(m[g-2][g-3]),a)){k=0;var M=_(m[g-2][g-2],m[g-2][g-1],m[g-1][g-2],m[g-1][g-1]);v.push(...M),l&&(b.unshift(E(m[g-2][g-2],m[g-2][g-1],m[g-1][g-2],m[g-1][g-1],M[0],M[1],a,i)),S(C,r),x=o(x,C),g>2&&(C=u(Array(g-2).fill(f)))),g-=2,m.pop(),m.pop();for(var O=0;O<g;O++)m[O].pop(),m[O].pop()}if(0===g)break}if(v.sort(((e,t)=>+n(s(e),s(t)))),k>100){var B=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+v.join(", "));throw B.values=v,B.vectors=[],B}var V=l?o(x,function(e,t){for(var n=[],r=0;r<t;r++)n[r]=Array(t).fill(0);var o=0;for(var a of e){for(var i=a.length,l=0;l<i;l++)for(var s=0;s<i;s++)n[o+l][o+s]=a[l][s];o+=i}return n}(b,r)):void 0;return{values:v,C:V}}(e,l,d,p,m);if(m){var D=function(e,t,a,i,l,s,d){var p=f(a),h=o(p,e,a),m="BigNumber"===d,b="Complex"===d,w=m?c(0):b?y(0):0,x=m?c(1):b?y(1):1,C=[],_=[];for(var E of l){var S=k(C,E,g);-1===S?(C.push(E),_.push(1)):_[S]+=1}for(var N=[],D=C.length,A=Array(t).fill(w),I=u(Array(t).fill(x)),R=function(){var e=C[M],l=n(h,o(e,I)),c=v(l,A);for(c.shift();c.length<_[M];){var u=T(l,t,c,s,d);if(null===u)break;c.push(u)}var p=o(f(i),a);c=c.map((e=>o(p,e))),N.push(...c.map((t=>({value:e,vector:r(t)}))))},M=0;M<D;M++)R();return N}(e,l,N,x,C,d,p);return{values:C,eigenvectors:D}}return{values:C}}}function Tie(e){var{config:t,addScalar:n,subtract:r,abs:o,atan:a,cos:i,sin:l,multiplyScalar:s,inv:c,bignumber:u,multiply:d,add:p}=e;function f(e,n,r){var o=n-e;return Math.abs(o)<=t.relTol?Math.PI/4:.5*Math.atan(2*r/(n-e))}function h(e,n,i){var l=r(n,e);return o(l)<=t.relTol?u(-1).acos().div(4):s(.5,a(d(2,i,c(l))))}function m(e,t,n,r){for(var o=e.length,a=Math.cos(t),i=Math.sin(t),l=Array(o).fill(0),s=Array(o).fill(0),c=0;c<o;c++)l[c]=a*e[c][n]-i*e[c][r],s[c]=i*e[c][n]+a*e[c][r];for(var u=0;u<o;u++)e[u][n]=l[u],e[u][r]=s[u];return e}function v(e,t,o,a){for(var c=e.length,d=i(t),p=l(t),f=Array(c).fill(u(0)),h=Array(c).fill(u(0)),m=0;m<c;m++)f[m]=r(s(d,e[m][o]),s(p,e[m][a])),h[m]=n(s(p,e[m][o]),s(d,e[m][a]));for(var v=0;v<c;v++)e[v][o]=f[v],e[v][a]=h[v];return e}function g(e,t,o,a){for(var c=e.length,f=u(i(t)),h=u(l(t)),m=s(f,f),v=s(h,h),g=Array(c).fill(u(0)),y=Array(c).fill(u(0)),b=d(u(2),f,h,e[o][a]),w=n(r(s(m,e[o][o]),b),s(v,e[a][a])),x=p(s(v,e[o][o]),b,s(m,e[a][a])),C=0;C<c;C++)g[C]=r(s(f,e[o][C]),s(h,e[a][C])),y[C]=n(s(h,e[o][C]),s(f,e[a][C]));e[o][o]=w,e[a][a]=x,e[o][a]=u(0),e[a][o]=u(0);for(var _=0;_<c;_++)_!==o&&_!==a&&(e[o][_]=g[_],e[_][o]=g[_],e[a][_]=y[_],e[_][a]=y[_]);return e}function y(e,t,n,r){for(var o=e.length,a=Math.cos(t),i=Math.sin(t),l=a*a,s=i*i,c=Array(o).fill(0),u=Array(o).fill(0),d=l*e[n][n]-2*a*i*e[n][r]+s*e[r][r],p=s*e[n][n]+2*a*i*e[n][r]+l*e[r][r],f=0;f<o;f++)c[f]=a*e[n][f]-i*e[r][f],u[f]=i*e[n][f]+a*e[r][f];e[n][n]=d,e[r][r]=p,e[n][r]=0,e[r][n]=0;for(var h=0;h<o;h++)h!==n&&h!==r&&(e[n][h]=c[h],e[h][n]=c[h],e[r][h]=u[h],e[h][r]=u[h]);return e}function b(e){for(var t=e.length,n=0,r=[0,1],o=0;o<t;o++)for(var a=o+1;a<t;a++)Math.abs(n)<Math.abs(e[o][a])&&(n=Math.abs(e[o][a]),r=[o,a]);return[r,n]}function w(e){for(var t=e.length,n=0,r=[0,1],a=0;a<t;a++)for(var i=a+1;i<t;i++)o(n)<o(e[a][i])&&(n=o(e[a][i]),r=[a,i]);return[r,n]}function x(e,t,n){var r,a=e.length,i=Array(a);if(n){r=Array(a);for(var l=0;l<a;l++)r[l]=Array(a)}for(var s=0;s<a;s++){for(var c=0,u=e[0],d=0;d<e.length;d++)o(e[d])<o(u)&&(u=e[c=d]);if(i[s]=e.splice(c,1)[0],n)for(var p=0;p<a;p++)r[s][p]=t[p][c],t[p].splice(c,1)}if(!n)return{values:i};var f=r.map(((e,t)=>({value:i[t],vector:e})));return{values:i,eigenvectors:f}}return function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.relTol,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if("number"===a)return function(e,t,n){var r,o,a=e.length,i=Math.abs(t/a);if(n){o=new Array(a);for(var l=0;l<a;l++)o[l]=Array(a).fill(0),o[l][l]=1}var s=b(e);for(;Math.abs(s[1])>=Math.abs(i);){var c=s[0][0],u=s[0][1];e=y(e,r=f(e[c][c],e[u][u],e[c][u]),c,u),n&&(o=m(o,r,c,u)),s=b(e)}for(var d=Array(a).fill(0),p=0;p<a;p++)d[p]=e[p][p];return x(v2(d),o,n)}(e,r,i);if("BigNumber"===a)return function(e,t,n){var r,a,i=e.length,l=o(t/i);if(n){a=new Array(i);for(var s=0;s<i;s++)a[s]=Array(i).fill(0),a[s][s]=1}var c=w(e);for(;o(c[1])>=o(l);){var u=c[0][0],d=c[0][1];e=g(e,r=h(e[u][u],e[d][d],e[u][d]),u,d),n&&(a=v(a,r,u,d)),c=w(e)}for(var p=Array(i).fill(0),f=0;f<i;f++)p[f]=e[f][f];return x(v2(p),a,n)}(e,r,i);throw TypeError("Unsupported data type: "+a)}}var Nie=k2("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:n,matrix:r,addScalar:o,subtract:a,equal:i,abs:l,atan:s,cos:c,sin:u,multiplyScalar:d,divideScalar:p,inv:f,bignumber:h,multiply:m,add:v,larger:g,column:y,flatten:b,number:w,complex:x,sqrt:C,diag:_,size:E,reshape:S,qr:k,usolve:T,usolveAll:N,im:D,re:A,smaller:I,matrixFromColumns:R,dot:M}=e,O=Tie({config:t,addScalar:o,subtract:a,abs:l,atan:s,cos:c,sin:u,multiplyScalar:d,inv:f,bignumber:h,multiply:m,add:v}),B=kie({addScalar:o,subtract:a,multiply:m,multiplyScalar:d,flatten:b,divideScalar:p,sqrt:C,abs:l,bignumber:h,diag:_,size:E,reshape:S,qr:k,inv:f,usolve:T,usolveAll:N,equal:i,complex:x,larger:g,smaller:I,matrixFromColumns:R,dot:M});return n("eigs",{Array:function(e){return V(r(e))},"Array, number|BigNumber":function(e,t){return V(r(e),{precision:t})},"Array, Object":(e,t)=>V(r(e),t),Matrix:function(e){return V(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return V(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){var n={matricize:!0};return h1(n,t),V(e,n)}});function V(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!("eigenvectors"in o)||o.eigenvectors,s=function(e,t,n){var r=e.toArray(),o=e.size();if(2!==o.length||o[0]!==o[1])throw new RangeError("Matrix must be square (size: ".concat(h6(o),")"));var i=o[0];if(function(e,t,n){for(var r=0;r<t;r++)for(var o=0;o<t;o++)if(g(h(l(D(e[r][o]))),n))return!1;return!0}(r,i,t)&&(function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)e[n][r]=A(e[n][r])}(r,i),function(e,t,n){for(var r=0;r<t;r++)for(var o=r;o<t;o++)if(g(h(l(a(e[r][o],e[o][r]))),n))return!1;return!0}(r,i,t))){var s=P(e,r,i);return O(r,i,t,s,n)}var c=P(e,r,i);return B(r,i,t,c,n)}(e,null!==(n=o.precision)&&void 0!==n?n:t.relTol,i);return o.matricize&&(s.values=r(s.values),i&&(s.eigenvectors=s.eigenvectors.map((e=>{var{value:t,vector:n}=e;return{value:t,vector:r(n)}})))),i&&Object.defineProperty(s,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),s}function P(e,t,n){var r=e.datatype();if("number"===r||"BigNumber"===r||"Complex"===r)return r;for(var o=!1,a=!1,i=!1,l=0;l<n;l++)for(var s=0;s<n;s++){var c=t[l][s];if(T1(c)||I1(c))o=!0;else if(N1(c))a=!0;else{if(!A1(c))throw TypeError("Unsupported type in Matrix: "+m2(c));i=!0}}if(a&&i&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),i){for(var u=0;u<n;u++)for(var d=0;d<n;d++)t[u][d]=x(t[u][d]);return"Complex"}if(a){for(var p=0;p<n;p++)for(var f=0;f<n;f++)t[p][f]=h(t[p][f]);return"BigNumber"}if(o){for(var m=0;m<n;m++)for(var v=0;v<n;v++)t[m][v]=w(t[m][v]);return"number"}throw TypeError("Matrix contains unsupported types only.")}})),Die="expm",Aie=k2(Die,["typed","abs","add","identity","inv","multiply"],(e=>{var{typed:t,abs:n,add:r,identity:o,inv:a,multiply:i}=e;return t(Die,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+h6(t)+")");for(var s=t[0],c=function(e){for(var t=e.size()[0],r=0,o=0;o<t;o++){for(var a=0,i=0;i<t;i++)a+=n(e.get([o,i]));r=Math.max(a,r)}return r}(e),u=function(e,t){for(var n=30,r=0;r<n;r++)for(var o=0;o<=r;o++){var a=r-o;if(l(e,o,a)<t)return{q:o,j:a}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(c,1e-15),d=u.q,p=u.j,f=i(e,Math.pow(2,-p)),h=o(s),m=o(s),v=1,g=f,y=-1,b=1;b<=d;b++)b>1&&(g=i(g,f),y=-y),h=r(h,i(v=v*(d-b+1)/((2*d-b+1)*b),g)),m=r(m,i(v*y,g));for(var w=i(a(m),h),x=0;x<p;x++)w=i(w,w);return L1(e)?e.createSparseMatrix(w):w}});function l(e,t,n){for(var r=1,o=2;o<=t;o++)r*=o;for(var a=r,i=t+1;i<=2*t;i++)a*=i;var l=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,n),2*t)*r*r/(a*l)}})),Iie="sqrtm",Rie=k2(Iie,["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],(e=>{var{typed:t,abs:n,add:r,multiply:o,map:a,sqrt:i,subtract:l,inv:s,size:c,max:u,identity:d}=e,p=1e-6;return t(Iie,{"Array | Matrix":function(e){var t=B1(e)?e.size():C6(e);switch(t.length){case 1:if(1===t[0])return a(e,i);throw new RangeError("Matrix must be square (size: "+h6(t)+")");case 2:if(t[0]===t[1])return function(e){var t,a=0,i=e,f=d(c(e));do{var h=i;if(i=o(.5,r(h,s(f))),f=o(.5,r(f,s(h))),(t=u(n(l(i,h))))>p&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>p);return i}(e);throw new RangeError("Matrix must be square (size: "+h6(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+h6(t)+")")}}})})),Mie="sylvester",Oie=k2(Mie,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],(e=>{var{typed:t,schur:n,matrixFromColumns:r,matrix:o,multiply:a,range:i,concat:l,transpose:s,index:c,subset:u,add:d,subtract:p,identity:f,lusolve:h,abs:m}=e;return t(Mie,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(e,t,n){return v(o(e),t,n)},"Array, Array, Matrix":function(e,t,n){return v(o(e),o(t),n)},"Array, Matrix, Array":function(e,t,n){return v(o(e),t,o(n))},"Matrix, Array, Matrix":function(e,t,n){return v(e,o(t),n)},"Matrix, Array, Array":function(e,t,n){return v(e,o(t),o(n))},"Matrix, Matrix, Array":function(e,t,n){return v(e,t,o(n))},"Array, Array, Array":function(e,t,n){return v(o(e),o(t),o(n)).toArray()}});function v(e,t,v){for(var g=t.size()[0],y=e.size()[0],b=n(e),w=b.T,x=b.U,C=n(a(-1,t)),_=C.T,E=C.U,S=a(a(s(x),v),E),k=i(0,y),T=[],N=(e,t)=>l(e,t,1),D=(e,t)=>l(e,t,0),A=0;A<g;A++)if(A<g-1&&m(u(_,c(A+1,A)))>1e-5){for(var I=D(u(S,c(k,A)),u(S,c(k,A+1))),R=0;R<A;R++)I=d(I,D(a(T[R],u(_,c(R,A))),a(T[R],u(_,c(R,A+1)))));var M=a(f(y),a(-1,u(_,c(A,A)))),O=a(f(y),a(-1,u(_,c(A+1,A)))),B=a(f(y),a(-1,u(_,c(A,A+1)))),V=a(f(y),a(-1,u(_,c(A+1,A+1)))),P=D(N(d(w,M),O),N(B,d(w,V))),L=h(P,I);T[A]=L.subset(c(i(0,y),0)),T[A+1]=L.subset(c(i(y,2*y),0)),A++}else{for(var F=u(S,c(k,A)),z=0;z<A;z++)F=d(F,a(T[z],u(_,c(z,A))));var j=u(_,c(A,A)),$=p(w,a(j,f(y)));T[A]=h($,F)}var U=o(r(...T));return a(x,a(U,s(E)))}})),Bie="schur",Vie=k2(Bie,["typed","matrix","identity","multiply","qr","norm","subtract"],(e=>{var{typed:t,matrix:n,identity:r,multiply:o,qr:a,norm:i,subtract:l}=e;return t(Bie,{Array:function(e){var t=s(n(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return s(e)}});function s(e){var t,n=e.size()[0],s=e,c=r(n),u=0;do{t=s;var d=a(s),p=d.Q,f=d.R;if(s=o(f,p),c=o(c,p),u++>100)break}while(i(l(s,t))>1e-4);return{U:c,T:s}}})),Pie="lyap",Lie=k2(Pie,["typed","matrix","sylvester","multiply","transpose"],(e=>{var{typed:t,matrix:n,sylvester:r,multiply:o,transpose:a}=e;return t(Pie,{"Matrix, Matrix":function(e,t){return r(e,a(e),o(-1,t))},"Array, Matrix":function(e,t){return r(n(e),a(n(e)),o(-1,t))},"Matrix, Array":function(e,t){return r(e,a(n(e)),n(o(-1,t)))},"Array, Array":function(e,t){return r(n(e),a(n(e)),n(o(-1,t))).toArray()}})})),Fie=k2("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(e=>{var{typed:t,matrix:n,multiply:r,equalScalar:o,divideScalar:a,inv:i}=e,l=x9({typed:t,equalScalar:o}),s=_9({typed:t});return t("divide",g2({"Array | Matrix, Array | Matrix":function(e,t){return r(e,i(t))},"DenseMatrix, any":function(e,t){return s(e,t,a,!1)},"SparseMatrix, any":function(e,t){return l(e,t,a,!1)},"Array, any":function(e,t){return s(n(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return r(e,i(t))}},a.signatures))})),zie="distance",jie=k2(zie,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],(e=>{var{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:o,divideScalar:a,deepEqual:i,sqrt:l,abs:s}=e;return t(zie,{"Array, Array, Array":function(e,t,n){if(2===e.length&&2===t.length&&2===n.length){if(!u(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(i(t,n))throw new TypeError("LinePoint1 should not be same with LinePoint2");var a=r(n[1],t[1]),l=r(t[0],n[0]),s=r(o(n[0],t[1]),o(t[0],n[1]));return m(e[0],e[1],a,l,s)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,n){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(n).length){if(!u(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(n))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(i(h(t),h(n)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in n&&"lineTwoPtY"in n){var a=r(n.lineTwoPtY,t.lineOnePtY),l=r(t.lineOnePtX,n.lineTwoPtX),s=r(o(n.lineTwoPtX,t.lineOnePtY),o(t.lineOnePtX,n.lineTwoPtY));return m(e.pointX,e.pointY,a,l,s)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!u(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!d(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return m(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!d(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!f(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(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(!p(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return g(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!u(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!d(t))throw new 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 m(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!d(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!f(t))throw new 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 v(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!u(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(t))throw new 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 g([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!d(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!d(t))throw new 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 g([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new 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;if(e.some((e=>3!==e.length||!c(e[0])||!c(e[1])||!c(e[2]))))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],n=[],r=[],o=0;o<e.length-1;o++)for(var a=o+1;a<e.length;a++)2===e[0].length?(n=[e[o][0],e[o][1]],r=[e[a][0],e[a][1]]):3===e[0].length&&(n=[e[o][0],e[o][1],e[o][2]],r=[e[a][0],e[a][1],e[a][2]]),t.push(g(n,r));return t}(e)}});function c(e){return"number"==typeof e||N1(e)}function u(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])}function d(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])&&c(e[2])}function p(e){return Array.isArray(e)||(e=h(e)),e.every(c)}function f(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])&&c(e[2])&&c(e[3])&&c(e[4])&&c(e[5])}function h(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++)n.push(e[t[r]]);return n}function m(e,t,r,i,c){var u=s(n(n(o(r,e),o(i,t)),c)),d=l(n(o(r,r),o(i,i)));return a(u,d)}function v(e,t,i,s,c,u,d,p,f){var h=[r(o(r(c,t),f),o(r(u,i),p)),r(o(r(u,i),d),o(r(s,e),f)),r(o(r(s,e),p),o(r(c,t),d))];h=l(n(n(o(h[0],h[0]),o(h[1],h[1])),o(h[2],h[2])));var m=l(n(n(o(d,d),o(p,p)),o(f,f)));return a(h,m)}function g(e,t){for(var a=e.length,i=0,s=0,c=0;c<a;c++)s=r(e[c],t[c]),i=n(o(s,s),i);return l(i)}})),$ie=k2("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],(e=>{var{typed:t,config:n,abs:r,add:o,addScalar:a,matrix:i,multiply:l,multiplyScalar:s,divideScalar:c,subtract:u,smaller:d,equalScalar:p,flatten:f,isZero:h,isNumeric:m}=e;return t("intersect",{"Array, Array, Array":v,"Array, Array, Array, Array":g,"Matrix, Matrix, Matrix":function(e,t,n){var r=v(e.valueOf(),t.valueOf(),n.valueOf());return null===r?null:i(r)},"Matrix, Matrix, Matrix, Matrix":function(e,t,n,r){var o=g(e.valueOf(),t.valueOf(),n.valueOf(),r.valueOf());return null===o?null:i(o)}});function v(e,t,n){if(e=y(e),t=y(t),n=y(n),!w(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&m(e[0])&&m(e[1])&&m(e[2])&&m(e[3])}(n))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,n,r,o,i,l,d,p,f){var h=s(e,l),m=s(r,l),v=s(t,d),g=s(o,d),y=s(n,p),b=s(i,p),w=u(u(u(f,h),v),y),x=u(u(u(a(a(m,g),b),h),v),y),C=c(w,x),_=a(e,s(C,u(r,e))),E=a(t,s(C,u(o,t))),S=a(n,s(C,u(i,n)));return[_,E,S]}(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3])}function g(e,t,i,f){if(e=y(e),t=y(t),i=y(i),f=y(f),2===e.length){if(!b(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(i))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(f))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,i,p){var f=e,m=i,v=u(f,t),g=u(m,p),y=u(s(v[0],g[1]),s(g[0],v[1]));if(h(y))return null;if(d(r(y),n.relTol))return null;var b=s(g[0],f[1]),w=s(g[1],f[0]),x=s(g[0],m[1]),C=s(g[1],m[0]),_=c(a(u(u(b,w),x),C),y);return o(l(v,_),f)}(e,t,i,f)}if(3===e.length){if(!w(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(i))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!w(f))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,n,r,o,i,l,d,f,m,v,g){var y=x(e,l,m,l,t,d,v,d,n,f,g,f),b=x(m,l,r,e,v,d,o,t,g,f,i,n),w=x(e,l,r,e,t,d,o,t,n,f,i,n),C=x(m,l,m,l,v,d,v,d,g,f,g,f),_=x(r,e,r,e,o,t,o,t,i,n,i,n),E=u(s(y,b),s(w,C)),S=u(s(_,C),s(b,b));if(h(S))return null;var k=c(E,S),T=c(a(y,s(k,b)),C),N=a(e,s(k,u(r,e))),D=a(t,s(k,u(o,t))),A=a(n,s(k,u(i,n))),I=a(l,s(T,u(m,l))),R=a(d,s(T,u(v,d))),M=a(f,s(T,u(g,f)));return p(N,I)&&p(D,R)&&p(A,M)?[N,D,A]:null}(e[0],e[1],e[2],t[0],t[1],t[2],i[0],i[1],i[2],f[0],f[1],f[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function y(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((e=>Array.isArray(e)&&1===e.length))?f(e):e}function b(e){return 2===e.length&&m(e[0])&&m(e[1])}function w(e){return 3===e.length&&m(e[0])&&m(e[1])&&m(e[2])}function x(e,t,n,r,o,i,l,c,d,p,f,h){var m=s(u(e,t),u(n,r)),v=s(u(o,i),u(l,c)),g=s(u(d,p),u(f,h));return a(a(m,v),g)}})),Uie=k2("sum",["typed","config","add","numeric"],(e=>{var{typed:t,config:n,add:r,numeric:o}=e;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return i8(e,t,r)}catch(n){throw xte(n,"sum")}},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return o8(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(n){throw xte(n,"sum",e)}})),void 0===t&&(t=o(0,n.number)),"string"==typeof t&&(t=o(t,D2(t,n))),t}})),Hie="cumsum",qie=k2(Hie,["typed","add","unaryPlus"],(e=>{var{typed:t,add:n,unaryPlus:r}=e;return t(Hie,{Array:o,Matrix:function(e){return e.create(o(e.valueOf(),e.datatype()))},"Array, number | BigNumber":i,"Matrix, number | BigNumber":function(e,t){return e.create(i(e.valueOf(),t),e.datatype())},"...":function(e){if(r8(e))throw new TypeError("All values expected to be scalar in function cumsum");return o(e)}});function o(e){try{return a(e)}catch(t){throw xte(t,Hie)}}function a(e){if(0===e.length)return[];for(var t=[r(e[0])],o=1;o<e.length;++o)t.push(n(t[o-1],e[o]));return t}function i(e,t){var n=C6(e);if(t<0||t>=n.length)throw new x6(t,n.length);try{return l(e,t)}catch(r){throw xte(r,Hie)}}function l(e,t){var n,r,o;if(t<=0){var i=e[0][0];if(Array.isArray(i)){for(o=n8(e),r=[],n=0;n<o.length;n++)r[n]=l(o[n],t-1);return r}return a(e)}for(r=[],n=0;n<e.length;n++)r[n]=l(e[n],t-1);return r}})),Wie="mean",Gie=k2(Wie,["typed","add","divide"],(e=>{var{typed:t,add:n,divide:r}=e;return t(Wie,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){try{var o=i8(e,t,n),a=Array.isArray(e)?C6(e):e.size();return r(o,a[t])}catch(i){throw xte(i,"mean")}},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function mean");return o(e)}});function o(e){var t,o=0;if(o8(e,(function(e){try{t=void 0===t?e:n(t,e),o++}catch(r){throw xte(r,"mean",e)}})),0===o)throw new Error("Cannot calculate the mean of an empty array");return r(t,o)}})),Yie="median",Kie=k2(Yie,["typed","add","divide","compare","partitionSelect"],(e=>{var{typed:t,add:n,divide:r,compare:o,partitionSelect:a}=e;function i(e){try{var t=(e=P6(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var n=t/2-1,r=a(e,n+1),i=e[n],c=0;c<n;++c)o(e[c],i)>0&&(i=e[c]);return s(i,r)}var u=a(e,(t-1)/2);return l(u)}catch(d){throw xte(d,"median")}}var l=t({"number | BigNumber | Complex | Unit":function(e){return e}}),s=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return r(n(e,t),2)}});return t(Yie,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(r8(e))throw new TypeError("Scalar values expected in function median");return i(e)}})})),Xie=k2("mad",["typed","abs","map","median","subtract"],(e=>{var{typed:t,abs:n,map:r,median:o,subtract:a}=e;return t("mad",{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=P6(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=o(e);return o(r(e,(function(e){return n(a(e,t))})))}catch(i){throw i instanceof TypeError&&i.message.includes("median")?new TypeError(i.message.replace("median","mad")):xte(i,"mad")}}})),Jie="unbiased",Zie="variance",Qie=k2(Zie,["typed","add","subtract","multiply","divide","apply","isNaN"],(e=>{var{typed:t,add:n,subtract:r,multiply:o,divide:a,apply:i,isNaN:l}=e;return t(Zie,{"Array | Matrix":function(e){return s(e,Jie)},"Array | Matrix, string":s,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,Jie)},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return s(e,Jie)}});function s(e,t){var i,s=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(o8(e,(function(e){try{i=void 0===i?e:n(i,e),s++}catch(t){throw xte(t,"variance",e)}})),0===s)throw new Error("Cannot calculate variance of an empty array");var c=a(i,s);if(i=void 0,o8(e,(function(e){var t=r(e,c);i=void 0===i?o(t,t):n(i,o(t,t))})),l(i))return i;switch(t){case"uncorrected":return a(i,s);case"biased":return a(i,s+1);case"unbiased":var u=N1(i)?i.mul(0):0;return 1===s?u:a(i,s-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,n){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return i(e,t,(e=>s(e,n)))}catch(r){throw xte(r,"variance")}}})),ele="quantileSeq",tle=k2(ele,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(e=>{var{typed:t,bignumber:n,add:r,subtract:o,divide:a,multiply:i,partitionSelect:l,compare:s,isInteger:c,smaller:u,smallerEq:d,larger:p}=e,f=f9({typed:t,isInteger:c});return t(ele,{"Array | Matrix, number | BigNumber":(e,t)=>m(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,n)=>h(e,t,!1,n,m),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>h(e,t,n,r,m),"Array | Matrix, Array | Matrix":(e,t)=>v(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,n)=>h(e,t,!1,n,v),"Array | Matrix, Array | Matrix, boolean":v,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>h(e,t,n,r,v)});function h(e,t,n,r,o){return f(e,r,(e=>o(e,t,n)))}function m(e,t,o){var i,l=e.valueOf();if(u(t,0))throw new Error("N/prob must be non-negative");if(d(t,1))return T1(t)?g(l,t,o):n(g(l,t,o));if(p(t,1)){if(!c(t))throw new Error("N must be a positive integer");if(p(t,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var s=r(t,1);i=[];for(var f=0;u(f,t);f++){var h=a(f+1,s);i.push(g(l,h,o))}return T1(t)?i:n(i)}}function v(e,t,n){for(var r=e.valueOf(),o=t.valueOf(),a=[],i=0;i<o.length;++i)a.push(g(r,o[i],n));return a}function g(e,t,n){var a=P6(e),u=a.length;if(0===u)throw new Error("Cannot calculate quantile of an empty sequence");var d,p,f=T1(t)?t*(u-1):t.times(u-1),h=T1(t)?Math.floor(f):f.floor().toNumber(),m=T1(t)?f%1:f.minus(h);if(c(f))return n?a[f]:l(a,T1(t)?f:f.valueOf());if(n)d=a[h],p=a[h+1];else{p=l(a,h+1),d=a[h];for(var v=0;v<h;++v)s(a[v],d)>0&&(d=a[v])}return r(i(d,o(1,m)),i(p,m))}})),nle=k2("std",["typed","map","sqrt","variance"],(e=>{var{typed:t,map:n,sqrt:r,variance:o}=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 new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=o.apply(null,arguments);return V1(a)?n(a,r):r(a)}catch(i){throw i instanceof TypeError&&i.message.includes(" variance")?new TypeError(i.message.replace(" variance"," std")):i}}})),rle="corr",ole=k2(rle,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],(e=>{var{typed:t,matrix:n,sqrt:r,sum:o,add:a,subtract:i,multiply:l,pow:s,divide:c}=e;return t(rle,{"Array, Array":function(e,t){return u(e,t)},"Matrix, Matrix":function(e,t){var r=u(e.toArray(),t.toArray());return Array.isArray(r)?n(r):r}});function u(e,t){var n=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var r=0;r<e.length;r++){if(e[r].length!==t[r].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");n.push(d(e[r],t[r]))}return n}if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return d(e,t)}function d(e,t){var n=e.length,u=o(e),d=o(t),p=e.reduce(((e,n,r)=>a(e,l(n,t[r]))),0),f=o(e.map((e=>s(e,2)))),h=o(t.map((e=>s(e,2)))),m=i(l(n,p),l(u,d)),v=r(l(i(l(n,f),s(u,2)),i(l(n,h),s(d,2))));return c(m,v)}})),ale="combinations",ile=k2(ale,["typed"],(e=>{var{typed:t}=e;return t(ale,{"number, number":j8,"BigNumber, BigNumber":function(e,t){var n,r,o=e.constructor,a=e.minus(t),i=new o(1);if(!lle(e)||!lle(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(n=i,t.lt(a))for(r=i;r.lte(a);r=r.plus(i))n=n.times(t.plus(r)).dividedBy(r);else for(r=i;r.lte(t);r=r.plus(i))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function lle(e){return e.isInteger()&&e.gte(0)}var sle="combinationsWithRep",cle=k2(sle,["typed"],(e=>{var{typed:t}=e;return t(sle,{"number, number":function(e,t){if(!N2(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!N2(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t<e-1?z8(e,e+t-1)/z8(1,t):z8(t+1,e+t-1)/z8(1,e-1)},"BigNumber, BigNumber":function(e,t){var n,r,o=new(0,e.constructor)(1),a=e.minus(o);if(!ule(e)||!ule(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(o))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(n=o,t.lt(a))for(r=o;r.lte(a);r=r.plus(o))n=n.times(t.plus(r)).dividedBy(r);else for(r=o;r.lte(t);r=r.plus(o))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function ule(e){return e.isInteger()&&e.gte(0)}var dle="gamma",ple=k2(dle,["typed","config","multiplyScalar","pow","BigNumber","Complex"],(e=>{var{typed:t,config:n,multiplyScalar:r,pow:o,BigNumber:a,Complex:i}=e;return t(dle,{number:X8,Complex:function e(t){if(0===t.im)return X8(t.re);if(t.re<.5){var n=new i(1-t.re,-t.im),r=new i(Math.PI*t.re,Math.PI*t.im);return new i(Math.PI).div(r.sin()).div(e(n))}t=new i(t.re-1,t.im);for(var o=new i(Z8[0],0),a=1;a<Z8.length;++a){var l=new i(Z8[a],0);o=o.add(l.div(t.add(a)))}var s=new i(t.re+J8+.5,t.im),c=Math.sqrt(2*Math.PI),u=s.pow(t.add(.5)),d=s.neg().exp();return o.mul(c).mul(u).mul(d)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new a(1/0):l(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function l(e){if(e<8)return new a([1,1,2,6,24,120,720,5040][e]);var t=n.precision+(0|Math.log(e.toNumber())),r=a.clone({precision:t});if(e%2==1)return e.times(l(new a(e-1)));for(var o=e,i=new r(e),s=e.toNumber();o>2;)s+=o-=2,i=i.times(s);return new a(i.toPrecision(a.precision))}})),fle="lgamma",hle=k2(fle,["Complex","typed"],(e=>{var{Complex:t,typed:n}=e,r=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return n(fle,{number:t5,Complex:function e(n){if(n.isNaN())return new t(NaN,NaN);if(0===n.im)return new t(t5(n.re),0);if(n.re>=7||Math.abs(n.im)>=7)return o(n);if(n.re<=.1){var r=(s=6.283185307179586,(!0^((c=n.im)>0||!(c<0)&&1/c==1/0)?-6.283185307179586:s)*Math.floor(.5*n.re+.25)),i=n.mul(Math.PI).sin().log(),l=e(new t(1-n.re,-n.im));return new t(1.1447298858494002,r).sub(i).sub(l)}return n.im>=0?a(n):a(n.conjugate()).conjugate();var s,c},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(e){for(var n=e.sub(.5).mul(e.log()).sub(e).add(Q8),o=new t(1,0).div(e),a=o.div(e),i=r[0],l=r[1],s=2*a.re,c=a.re*a.re+a.im*a.im,u=2;u<8;u++){var d=l;l=-c*i+r[u],i=s*i+d}var p=o.mul(a.mul(i).add(l));return n.add(p)}function a(e){var n=0,r=0,a=e;for(e=e.add(1);e.re<=7;){var i=(a=a.mul(e)).im<0?1:0;0!==i&&0===r&&n++,r=i,e=e.add(1)}return o(e).sub(a.log()).sub(new t(0,2*n*Math.PI*1))}})),mle="factorial",vle=k2(mle,["typed","gamma"],(e=>{var{typed:t,gamma:n}=e;return t(mle,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return n(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return n(e.plus(1))},"Array | Matrix":t.referToSelf((e=>t=>a8(t,e)))})})),gle="kldivergence",yle=k2(gle,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],(e=>{var{typed:t,matrix:n,divide:r,sum:o,multiply:a,map:i,dotDivide:l,log:s,isNumeric:c}=e;return t(gle,{"Array, Array":function(e,t){return u(n(e),n(t))},"Matrix, Array":function(e,t){return u(e,n(t))},"Array, Matrix":function(e,t){return u(n(e),t)},"Matrix, Matrix":function(e,t){return u(e,t)}});function u(e,t){var n=t.size().length,u=e.size().length;if(n>1)throw new Error("first object must be one dimensional");if(u>1)throw new Error("second object must be one dimensional");if(n!==u)throw new Error("Length of two vectors must be equal");if(0===o(e))throw new Error("Sum of elements in first object must be non zero");if(0===o(t))throw new Error("Sum of elements in second object must be non zero");var d=r(e,o(e)),p=r(t,o(t)),f=o(a(d,i(l(d,p),(e=>s(e)))));return c(f)?f:Number.NaN}})),ble="multinomial",wle=k2(ble,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(e=>{var{typed:t,add:n,divide:r,multiply:o,factorial:a,isInteger:i,isPositive:l}=e;return t(ble,{"Array | Matrix":function(e){var t=0,s=1;return o8(e,(function(e){if(!i(e)||!l(e))throw new TypeError("Positive integer value expected in function multinomial");t=n(t,e),s=o(s,a(e))})),r(a(t),s)}})})),xle="permutations",Cle=k2(xle,["typed","factorial"],(e=>{var{typed:t,factorial:n}=e;return t(xle,{"number | BigNumber":n,"number, number":function(e,t){if(!N2(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!N2(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return z8(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var n,r;if(!_le(e)||!_le(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(n=e.mul(0).add(1),r=e.minus(t).plus(1);r.lte(e);r=r.plus(1))n=n.times(r);return n}})}));function _le(e){return e.isInteger()&&e.gte(0)}var Ele={exports:{}};!function(e,t){function n(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function r(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function o(e,t){var o=new n(e),a=t&&t.state,i=o.next;return i.int32=function(){return 4294967296*o.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.alea=o}(0,Ele);var Sle=Ele.exports,kle={exports:{}};!function(e,t){function n(e){var t=this,n="";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:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xor128=o}(0,kle);var Tle=kle.exports,Nle={exports:{}};!function(e,t){function n(e){var t=this,n="";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:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function r(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 o(e,t){var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xorwow=o}(0,Nle);var Dle=Nle.exports,Ale={exports:{}};!function(e,t){function n(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&(a.x&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xorshift7=o}(0,Ale);var Ile=Ale.exports,Rle={exports:{}};!function(e,t){function n(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,a=t.i;return t.w=r=r+1640531527|0,n=o[a+34&127],e=o[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,o,a,i,l=[],s=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,s=Math.max(s,t.length)),o=0,a=-32;a<s;++a)t&&(r^=t.charCodeAt((a+32)%t.length)),0===a&&(i=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,o=0==(n=l[127&a]^=r+i)?o+1:0);for(o>=128&&(l[127&(t&&t.length||0)]=-1),o=127,a=512;a>0;--a)r=l[o+34&127],n=l[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,l[o]=r^n;e.w=i,e.X=l,e.i=o}(t,e)}function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&(a.X&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.xor4096=o}(0,Rle);var Mle=Rle.exports,Ole={exports:{}};!function(e,t){function n(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var o=new n(e),a=t&&t.state,i=function(){return(o.next()>>>0)/4294967296};return i.double=function(){do{var e=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=o.next,i.quick=i,a&&("object"==typeof a&&r(a,o),i.state=function(){return r(o,{})}),i}t&&t.exports?t.exports=o:this.tychei=o}(0,Ole);var Ble=Ole.exports,Vle={exports:{}};!function(e){!function(t,n,r){var o,a=256,i="random",l=r.pow(a,6),s=r.pow(2,52),c=2*s,u=255;function d(e,u,d){var g=[],y=m(h((u=1==u?{entropy:!0}:u||{}).entropy?[e,v(n)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(a):(e=new Uint8Array(a),(t.crypto||t.msCrypto).getRandomValues(e)),v(e)}catch(HT){var r=t.navigator,i=r&&r.plugins;return[+new Date,t,i,t.screen,v(n)]}}():e,3),g),b=new p(g),w=function(){for(var e=b.g(6),t=l,n=0;e<s;)e=(e+n)*a,t*=a,n=b.g(1);for(;e>=c;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|b.g(4)},w.quick=function(){return b.g(4)/4294967296},w.double=w,m(v(b.S),n),(u.pass||d||function(e,t,n,o){return o&&(o.S&&f(o,b),e.state=function(){return f(b,{})}),n?(r[i]=e,t):e})(w,y,"global"in u?u.global:this==r,u.state)}function p(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,l=r.S=[];for(n||(e=[n++]);o<a;)l[o]=o++;for(o=0;o<a;o++)l[o]=l[i=u&i+e[o%n]+(t=l[o])],l[i]=t;(r.g=function(e){for(var t,n=0,o=r.i,i=r.j,l=r.S;e--;)t=l[o=u&o+1],n=n*a+l[u&(l[o]=l[i=u&i+t])+(l[i]=t)];return r.i=o,r.j=i,n})(a)}function f(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function h(e,t){var n,r=[],o=typeof e;if(t&&"object"==o)for(n in e)try{r.push(h(e[n],t-1))}catch(HT){}return r.length?r:"string"==o?e:e+"\0"}function m(e,t){for(var n,r=e+"",o=0;o<r.length;)t[u&o]=u&(n^=19*t[u&o])+r.charCodeAt(o++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(m(r.random(),n),e.exports){e.exports=d;try{o=Tq}catch(g){}}else r["seed"+i]=d}("undefined"!=typeof self?self:V,[],Math)}(Vle);var Ple=Sle,Lle=Tle,Fle=Dle,zle=Ile,jle=Mle,$le=Ble,Ule=Vle.exports;Ule.alea=Ple,Ule.xor128=Lle,Ule.xorwow=Fle,Ule.xorshift7=zle,Ule.xor4096=jle,Ule.tychei=$le;const Hle=P(Ule);var qle=Hle(Date.now());function Wle(e){var t,n;return t=null===(n=e)?qle:Hle(String(n)),function(){return t()}}var Gle="pickRandom",Yle=k2(Gle,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,o=Wle(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=Wle(e.randomSeed))})),t(Gle,{"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,n){return a(e,{number:n,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,n){return a(e,{number:t,weights:n})}});function a(e,t){var{number:n,weights:r,elementWise:a=!0}=t,i=void 0===n;i&&(n=1);var l=B1(e)?e.create:B1(r)?r.create:null;e=e.valueOf(),r&&(r=r.valueOf()),!0===a&&(e=P6(e),r=P6(r));var s=0;if(void 0!==r){if(r.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var c=0,u=r.length;c<u;c++){if(!T1(r[c])||r[c]<0)throw new Error("Weights must be an array of positive numbers");s+=r[c]}}for(var d,p=e.length,f=[];f.length<n;){if(void 0===r)d=e[Math.floor(o()*p)];else for(var h=o()*s,m=0,v=e.length;m<v;m++)if((h-=r[m])<0){d=e[m];break}f.push(d)}return i?f[0]:l?l(f):f}}));function Kle(e,t){var n=[];if((e=e.slice(0)).length>1)for(var r=0,o=e.shift();r<o;r++)n.push(Kle(e,t));else for(var a=0,i=e.shift();a<i;a++)n.push(t());return n}var Xle="random",Jle=k2(Xle,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,o=Wle(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=Wle(e.randomSeed))})),t(Xle,{"":()=>i(0,1),number:e=>i(0,e),"number, number":(e,t)=>i(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=Kle(e.valueOf(),(()=>i(t,n)));return B1(e)?e.create(r,"number"):r}function i(e,t){return e+o()*(t-e)}})),Zle="randomInt",Qle=k2(Zle,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,o=Wle(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=Wle(e.randomSeed))})),t(Zle,{"":()=>i(0,1),number:e=>i(0,e),"number, number":(e,t)=>i(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=Kle(e.valueOf(),(()=>i(t,n)));return B1(e)?e.create(r,"number"):r}function i(e,t){return Math.floor(e+o()*(t-e))}})),ese="stirlingS2",tse=k2(ese,["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],(e=>{var{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:o,divideScalar:a,pow:i,factorial:l,combinations:s,isNegative:c,isInteger:u,number:d,bignumber:p,larger:f}=e,h=[],m=[];return t(ese,{"number | BigNumber, number | BigNumber":function(e,t){if(!u(e)||c(e)||!u(t)||c(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(f(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");var r=!(T1(e)&&T1(t)),a=r?m:h,i=r?p:d,l=d(e),s=d(t);if(a[l]&&a[l].length>s)return a[l][s];for(var v=0;v<=l;++v)if(a[v]||(a[v]=[i(0===v?1:0)]),0!==v)for(var g=a[v],y=a[v-1],b=g.length;b<=v&&b<=s;++b)g[b]=b===v?1:n(o(i(b),y[b]),y[b-1]);return a[l][s]}})})),nse="bellNumbers",rse=k2(nse,["typed","addScalar","isNegative","isInteger","stirlingS2"],(e=>{var{typed:t,addScalar:n,isNegative:r,isInteger:o,stirlingS2:a}=e;return t(nse,{"number | BigNumber":function(e){if(!o(e)||r(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,i=0;i<=e;i++)t=n(t,a(e,i));return t}})})),ose="catalan",ase=k2(ose,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(e=>{var{typed:t,addScalar:n,divideScalar:r,multiplyScalar:o,combinations:a,isNegative:i,isInteger:l}=e;return t(ose,{"number | BigNumber":function(e){if(!l(e)||i(e))throw new TypeError("Non-negative integer value expected in function catalan");return r(a(o(e,2),e),n(e,1))}})})),ise="composition",lse=k2(ise,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(e=>{var{typed:t,addScalar:n,combinations:r,isPositive:o,isNegative:a,isInteger:i,larger:l}=e;return t(ise,{"number | BigNumber, number | BigNumber":function(e,t){if(!(i(e)&&o(e)&&i(t)&&o(t)))throw new TypeError("Positive integer value expected in function composition");if(l(t,e))throw new TypeError("k must be less than or equal to n in function composition");return r(n(e,-1),n(t,-1))}})})),sse="leafCount",cse=k2(sse,["parse","typed"],(e=>{var{parse:t,typed:n}=e;function r(e){var t=0;return e.forEach((e=>{t+=r(e)})),t||1}return n(sse,{Node:function(e){return r(e)}})}));function use(e){return n2(e)||c2(e)&&e.isUnary()&&n2(e.args[0])}function dse(e){return!!n2(e)||(!(!a2(e)&&!c2(e)||!e.args.every(dse))||!(!u2(e)||!dse(e.content)))}function pse(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fse(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pse(Object(n),!0).forEach((function(t){ste(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pse(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hse=k2("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(e=>{var{FunctionNode:t,OperatorNode:n,SymbolNode:r}=e,o=!0,a=!1,i="defaultF",l={add:{trivial:o,total:o,commutative:o,associative:o},unaryPlus:{trivial:o,total:o,commutative:o,associative:o},subtract:{trivial:a,total:o,commutative:a,associative:a},multiply:{trivial:o,total:o,commutative:o,associative:o},divide:{trivial:a,total:o,commutative:a,associative:a},paren:{trivial:o,total:o,commutative:o,associative:a},defaultF:{trivial:a,total:o,commutative:a,associative:a}};function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,r=i;if("string"==typeof e?r=e:c2(e)?r=e.fn.toString():a2(e)?r=e.name:u2(e)&&(r="paren"),b2(n,r)){var o=n[r];if(b2(o,t))return o[t];if(b2(l,r))return l[r][t]}if(b2(n,i)){var a=n[i];return b2(a,t)?a[t]:l[i][t]}if(b2(l,r)){var s=l[r];if(b2(s,t))return s[t]}return l[i][t]}function c(e){return s(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:l)}function u(e,t){var n,r=[],o=function(e){for(var t=0;t<e.args.length;t++){var a=e.args[t];c2(a)&&n===a.op?o(a):r.push(a)}};return c(e,t)?(n=e.op,o(e),r):e.args}function d(e){return c2(e)?function(t){try{return new n(e.op,e.fn,t,e.implicit)}catch(r){return console.error(r),[]}}:function(n){return new t(new r(e.name),n)}}return{createMakeNodeFunction:d,hasProperty:s,isCommutative:function(e){return s(e,"commutative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:l)},isAssociative:c,mergeContext:function(e,t){var n=fse({},e);for(var r in t)b2(e,r)?n[r]=fse(fse({},t[r]),e[r]):n[r]=t[r];return n},flatten:function e(t,n){if(!t.args||0===t.args.length)return t;t.args=u(t,n);for(var r=0;r<t.args.length;r++)e(t.args[r],n)},allChildren:u,unflattenr:function e(t,n){if(t.args&&0!==t.args.length){for(var r=d(t),o=t.args.length,a=0;a<o;a++)e(t.args[a],n);if(o>2&&c(t,n)){for(var i=t.args.pop();t.args.length>0;)i=r([t.args.pop(),i]);t.args=i.args}}},unflattenl:function e(t,n){if(t.args&&0!==t.args.length){for(var r=d(t),o=t.args.length,a=0;a<o;a++)e(t.args[a],n);if(o>2&&c(t,n)){for(var i=t.args.shift();t.args.length>0;)i=r([i,t.args.shift()]);t.args=i.args}}},defaultContext:l,realContext:{divide:{total:a},log:{total:a}},positiveContext:{subtract:{total:a},abs:{trivial:o},log:{total:o}}}})),mse=k2("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{config:t,typed:n,parse:r,add:o,subtract:a,multiply:i,divide:l,pow:s,isZero:c,equal:u,resolve:d,simplifyConstant:p,simplifyCore:f,fraction:h,bignumber:m,mathWithTransform:v,matrix:g,AccessorNode:y,ArrayNode:b,ConstantNode:w,FunctionNode:x,IndexNode:C,ObjectNode:_,OperatorNode:E,ParenthesisNode:S,SymbolNode:k}=e,{hasProperty:T,isCommutative:N,isAssociative:D,mergeContext:A,flatten:I,unflattenr:R,unflattenl:M,createMakeNodeFunction:O,defaultContext:B,realContext:V,positiveContext:P}=hse({FunctionNode:x,OperatorNode:E,SymbolNode:k});n.addConversion({from:"Object",to:"Map",convert:k1});var L=n("simplify",{Node:H,"Node, Map":(e,t)=>H(e,!1,t),"Node, Map, Object":(e,t,n)=>H(e,!1,t,n),"Node, Array":H,"Node, Array, Map":H,"Node, Array, Map, Object":H});function F(e){return e.transform((function(e,t,n){return u2(e)?F(e.content):e}))}n.removeConversion({from:"Object",to:"Map",convert:k1}),L.defaultContext=B,L.realContext=V,L.positiveContext=P;var z={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};function j(e,t){var n={};if(e.s){var o=e.s.split("->");if(2!==o.length)throw SyntaxError("Could not parse rule: "+e.s);n.l=o[0],n.r=o[1]}else n.l=e.l,n.r=e.r;for(var a of(n.l=F(r(n.l)),n.r=F(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 i,l=!N(n.l,t);l&&(i=U());var s=O(n.l),c=U();n.expanded={},n.expanded.l=s([n.l,c]),I(n.expanded.l,t),R(n.expanded.l,t),n.expanded.r=s([n.r,c]),l&&(n.expandedNC1={},n.expandedNC1.l=s([i,n.l]),n.expandedNC1.r=s([i,n.r]),n.expandedNC2={},n.expandedNC2.l=s([i,n.expanded.l]),n.expandedNC2.r=s([i,n.expanded.r]))}return n}L.rules=[f,{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}}},p,{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}}},p,{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 U(){return new k("_p"+$++)}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S1(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.consoleDebug;t=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r],a=void 0,i=typeof o;switch(i){case"string":o={s:o};case"object":a=j(o,t);break;case"function":a=o;break;default:throw TypeError("Unsupported type of rule: "+i)}n.push(a)}return n}(t||L.rules,r.context);for(var a=d(e,n),i={},l=(a=F(a)).toString({parenthesis:"all"});!i[l];){i[l]=!0,$=0;for(var s=l,c=0;c<t.length;c++){if("function"==typeof t[c]?(a=t[c](a,r),o&&t[c].name):(I(a,r.context),a=W(a,t[c],r.context),o&&"".concat(t[c].l.toString()," -> ").concat(t[c].r.toString())),o){var u=a.toString({parenthesis:"all"});u!==s&&(s=u)}M(a,r.context)}l=a.toString({parenthesis:"all"})}return a}function q(e,t,n){var r=e;if(e)for(var o=0;o<e.length;++o){var a=W(e[o],t,n);a!==e[o]&&(r===e&&(r=e.slice()),r[o]=a)}return r}function W(e,t,n){if(t.assuming)for(var r in t.assuming)for(var o in t.assuming[r])if(T(r,o,n)!==t.assuming[r][o])return e;var a=A(t.imposeContext,n),i=e;if(i instanceof E||i instanceof x){var l=q(i.args,t,n);l!==i.args&&((i=i.clone()).args=l)}else if(i instanceof S){if(i.content){var s=W(i.content,t,n);s!==i.content&&(i=new S(s))}}else if(i instanceof b){var c=q(i.items,t,n);c!==i.items&&(i=new b(c))}else if(i instanceof y){var u=i.object;i.object&&(u=W(i.object,t,n));var d=i.index;i.index&&(d=W(i.index,t,n)),u===i.object&&d===i.index||(i=new y(u,d))}else if(i instanceof C){var p=q(i.dimensions,t,n);p!==i.dimensions&&(i=new C(p))}else if(i instanceof _){var f=!1,h={};for(var m in i.properties)h[m]=W(i.properties[m],t,n),h[m]!==i.properties[m]&&(f=!0);f&&(i=new _(h))}var v=t.r,g=K(t.l,i,a)[0];if(!g&&t.expanded&&(v=t.expanded.r,g=K(t.expanded.l,i,a)[0]),!g&&t.expandedNC1&&(v=t.expandedNC1.r,(g=K(t.expandedNC1.l,i,a)[0])||(v=t.expandedNC2.r,g=K(t.expandedNC2.l,i,a)[0])),g){var w=i.implicit;i=v.clone(),w&&"implicit"in v&&(i.implicit=!0),i=i.transform((function(e){return e.isSymbolNode&&b2(g.placeholders,e.name)?g.placeholders[e.name].clone():e}))}return t.repeat&&i!==e&&(i=W(i,t,n)),i}function G(e,t){var n={placeholders:{}};if(!e.placeholders&&!t.placeholders)return n;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var r in e.placeholders)if(b2(e.placeholders,r)&&(n.placeholders[r]=e.placeholders[r],b2(t.placeholders,r)&&!X(e.placeholders[r],t.placeholders[r])))return null;for(var o in t.placeholders)b2(t.placeholders,o)&&(n.placeholders[o]=t.placeholders[o]);return n}function Y(e,t){var n,r=[];if(0===e.length||0===t.length)return r;for(var o=0;o<e.length;o++)for(var a=0;a<t.length;a++)(n=G(e[o],t[a]))&&r.push(n);return r}function K(e,t,n,r){var o=[{placeholders:{}}];if(e instanceof E&&t instanceof E||e instanceof x&&t instanceof x){if(e instanceof E){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof x&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!D(t,n)&&t.args.length===e.args.length||r)){if(t.args.length>=2&&2===e.args.length){for(var a=function(e,t){var n,r,o=[],a=O(e);if(N(e,t))for(var i=0;i<e.args.length;i++)(r=e.args.slice(0)).splice(i,1),n=1===r.length?r[0]:a(r),o.push(a([e.args[i],n]));else for(var l=1;l<e.args.length;l++){var s=e.args[0];l>1&&(s=a(e.args.slice(0,l))),n=1===(r=e.args.slice(l)).length?r[0]:a(r),o.push(a([s,n]))}return o}(t,n),i=[],l=0;l<a.length;l++){var s=K(e,a[l],n,!0);i=i.concat(s)}return i}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var c=[],d=0;d<e.args.length;d++){var p=K(e.args[d],t.args[d],n);if(0===p.length)break;c.push(p)}if(c.length!==e.args.length){if(!N(t,n)||1===e.args.length)return[];if(e.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var f=K(e.args[0],t.args[1],n);if(0===f.length)return[];var h=K(e.args[1],t.args[0],n);if(0===h.length)return[];c=[f,h]}o=function(e){if(0===e.length)return e;for(var t=e.reduce(Y),n=[],r={},o=0;o<t.length;o++){var a=JSON.stringify(t[o]);r[a]||(r[a]=!0,n.push(t[o]))}return n}(c)}else if(e instanceof k){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(z[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":o[0].placeholders[e.name]=t;break;case"c":case"cl":if(!n2(t))return[];o[0].placeholders[e.name]=t;break;case"v":if(n2(t))return[];o[0].placeholders[e.name]=t;break;case"vl":if(!f2(t))return[];o[0].placeholders[e.name]=t;break;case"cd":if(!use(t))return[];o[0].placeholders[e.name]=t;break;case"vd":if(use(t))return[];o[0].placeholders[e.name]=t;break;case"ce":if(!dse(t))return[];o[0].placeholders[e.name]=t;break;case"ve":if(dse(t))return[];o[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof w))return[];if(!u(e.value,t.value))return[]}return o}function X(e,t){if(e instanceof w&&t instanceof w){if(!u(e.value,t.value))return!1}else if(e instanceof k&&t instanceof k){if(e.name!==t.name)return!1}else{if(!(e instanceof E&&t instanceof E||e instanceof x&&t instanceof x))return!1;if(e instanceof E){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof x&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var n=0;n<e.args.length;n++)if(!X(e.args[n],t.args[n]))return!1}return!0}return L})),vse=k2("simplifyConstant",["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],(e=>{var{typed:t,config:n,mathWithTransform:r,matrix:o,fraction:a,bignumber:i,AccessorNode:l,ArrayNode:s,ConstantNode:c,FunctionNode:u,IndexNode:d,ObjectNode:p,OperatorNode:f,SymbolNode:h}=e,{isCommutative:m,isAssociative:v,allChildren:g,createMakeNodeFunction:y}=hse({FunctionNode:u,OperatorNode:f,SymbolNode:h}),b=t("simplifyConstant",{Node:e=>_(N(e,{})),"Node, Object":function(e,t){return _(N(e,t))}});function w(e){return I1(e)?e.valueOf():e instanceof Array?e.map(w):B1(e)?o(w(e.valueOf())):e}function x(e,t,n){try{return r[e].apply(null,t)}catch(o){return t=t.map(w),S(r[e].apply(null,t),n)}}var C=t({Fraction:function(e){var t,n=e.s*e.n;t=n<0?new f("-","unaryMinus",[new c(-n)]):new c(n);if(1===e.d)return t;return new f("/","divide",[t,new c(e.d)])},number:function(e){return e<0?k(new c(-e)):new c(e)},BigNumber:function(e){return e<0?k(new c(-e)):new c(e)},bigint:function(e){return e<0n?k(new c(-e)):new c(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new c(e)},Matrix:function(e){return new s(e.valueOf().map((e=>C(e))))}});function _(e){return l2(e)?e:C(e)}function E(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&a){var n=a(e),r=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(n.valueOf()===e&&n.n<r&&n.d<r)return n}return e}var S=t({"string, Object":function(e,t){var r=D2(e,n);return"BigNumber"===r?(void 0===i&&Nee(),i(e)):"bigint"===r?BigInt(e):"Fraction"===r?(void 0===a&&Dee(),a(e)):E(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return E(e,t)},"bigint, Object":function(e,t){return e},"Complex, Object":function(e,t){return 0!==e.im?e:E(e.re,t)},"Matrix, Object":function(e,t){return o(E(e.valueOf()))},"Array, Object":function(e,t){return e.map(E)}});function k(e){return new f("-","unaryMinus",[e])}function T(e,t,n,r){var o=t.shift(),a=t.reduce(((t,o)=>{if(!l2(o)){var a=t.pop();if(l2(a))return[a,o];try{return t.push(x(e,[a,o],r)),t}catch(l){t.push(a)}}t.push(_(t.pop()));var i=1===t.length?t[0]:n(t);return[n([i,_(o)])]}),[o]);return 1===a.length?a[0]:n([a[0],C(a[1])])}function N(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":case"bigint":return S(e.value,t);case"string":return e.value;default:if(!isNaN(e.value))return S(e.value,t)}return e;case"FunctionNode":if(r[e.name]&&r[e.name].rawArgs)return e;if(!["add","multiply"].includes(e.name)){var n=e.args.map((e=>N(e,t)));if(!n.some(l2))try{return x(e.name,n,t)}catch(M){}if("size"===e.name&&1===n.length&&Z1(n[0])){for(var a=[],i=n[0];Z1(i);)a.push(i.items.length),i=i.items[0];return o(a)}return new u(e.name,n.map(_))}case"OperatorNode":var f,h,w=e.fn.toString(),C=y(e);if(c2(e)&&e.isUnary())h=l2((f=[N(e.args[0],t)])[0])?C(f):x(w,f,t);else if(v(e,t.context))if(f=(f=g(e,t.context)).map((e=>N(e,t))),m(w,t.context)){for(var E=[],k=[],D=0;D<f.length;D++)l2(f[D])?k.push(f[D]):E.push(f[D]);E.length>1?(h=T(w,E,C,t),k.unshift(h),h=T(w,k,C,t)):h=T(w,f,C,t)}else h=T(w,f,C,t);else h=T(w,f=e.args.map((e=>N(e,t))),C,t);return h;case"ParenthesisNode":return N(e.content,t);case"AccessorNode":return function(e,t,n){if(!i2(t))return new l(_(e),_(t));if(Z1(e)||B1(e)){for(var r=Array.from(t.dimensions);r.length>0;)if(n2(r[0])&&"string"!=typeof r[0].value){var a=S(r.shift().value,n);Z1(e)?e=e.items[a-1]:(e=e.valueOf()[a-1])instanceof Array&&(e=o(e))}else{if(!(r.length>1&&n2(r[1])&&"string"!=typeof r[1].value))break;var i=S(r[1].value,n),u=[],p=Z1(e)?e.items:e.valueOf();for(var f of p)if(Z1(f))u.push(f.items[i-1]);else{if(!B1(e))break;u.push(f[i-1])}if(u.length!==p.length)break;e=Z1(e)?new s(u):o(u),r.splice(1,1)}return r.length===t.dimensions.length?new l(_(e),t):r.length>0?(t=new d(r),new l(_(e),t)):e}if(s2(e)&&1===t.dimensions.length&&n2(t.dimensions[0])){var h=t.dimensions[0].value;return h in e.properties?e.properties[h]:new c}return new l(_(e),t)}(N(e.object,t),N(e.index,t),t);case"ArrayNode":var A=e.items.map((e=>N(e,t)));return A.some(l2)?new s(A.map(_)):o(A);case"IndexNode":return new d(e.dimensions.map((e=>b(e,t))));case"ObjectNode":var I={};for(var R in e.properties)I[R]=b(e.properties[R],t);return new p(I);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return b})),gse="simplifyCore",yse=k2(gse,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{typed:t,parse:n,equal:r,isZero:o,add:a,subtract:i,multiply:l,divide:s,pow:c,AccessorNode:u,ArrayNode:d,ConstantNode:p,FunctionNode:f,IndexNode:h,ObjectNode:m,OperatorNode:v,ParenthesisNode:g,SymbolNode:y}=e,b=new p(0),w=new p(1),x=new p(!0),C=new p(!1);function _(e){return c2(e)&&["and","not","or"].includes(e.op)}var{hasProperty:E,isCommutative:S}=hse({FunctionNode:f,OperatorNode:v,SymbolNode:y});function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?t.context:void 0;if(E(e,"trivial",n)){if(a2(e)&&1===e.args.length)return k(e.args[0],t);var a=!1,i=0;if(e.forEach((e=>{1===++i&&(a=k(e,t))})),1===i)return a}var l=e;if(a2(l)){var s=function(e){var t="OperatorNode:"+e;for(var n of Woe)if(t in n)return n[t].op;return null}(l.name);if(!s)return new f(k(l.fn),l.args.map((e=>k(e,t))));if(l.args.length>2&&E(l,"associative",n))for(;l.args.length>2;){var c=l.args.pop(),p=l.args.pop();l.args.push(new v(s,l.name,[c,p]))}l=new v(s,l.name,l.args)}if(c2(l)&&l.isUnary()){var g=k(l.args[0],t);if("~"===l.op&&c2(g)&&g.isUnary()&&"~"===g.op)return g.args[0];if("not"===l.op&&c2(g)&&g.isUnary()&&"not"===g.op&&_(g.args[0]))return g.args[0];var y=!0;if("-"===l.op&&c2(g)&&(g.isBinary()&&"subtract"===g.fn&&(l=new v("-","subtract",[g.args[1],g.args[0]]),y=!1),g.isUnary()&&"-"===g.op))return g.args[0];if(y)return new v(l.op,l.fn,[g])}if(c2(l)&&l.isBinary()){var T=k(l.args[0],t),N=k(l.args[1],t);if("+"===l.op){if(n2(T)&&o(T.value))return N;if(n2(N)&&o(N.value))return T;c2(N)&&N.isUnary()&&"-"===N.op&&(N=N.args[0],l=new v("-","subtract",[T,N]))}if("-"===l.op)return c2(N)&&N.isUnary()&&"-"===N.op?k(new v("+","add",[T,N.args[0]]),t):n2(T)&&o(T.value)?k(new v("-","unaryMinus",[N])):n2(N)&&o(N.value)?T:new v(l.op,l.fn,[T,N]);if("*"===l.op){if(n2(T)){if(o(T.value))return b;if(r(T.value,1))return N}if(n2(N)){if(o(N.value))return b;if(r(N.value,1))return T;if(S(l,n))return new v(l.op,l.fn,[N,T],l.implicit)}return new v(l.op,l.fn,[T,N],l.implicit)}if("/"===l.op)return n2(T)&&o(T.value)?b:n2(N)&&r(N.value,1)?T:new v(l.op,l.fn,[T,N]);if("^"===l.op&&n2(N)){if(o(N.value))return w;if(r(N.value,1))return T}if("and"===l.op){if(n2(T)){if(!T.value)return C;if(_(N))return N;if(n2(N))return N.value?x:C}if(n2(N)){if(!N.value)return C;if(_(T))return T}}if("or"===l.op){if(n2(T)){if(T.value)return x;if(_(N))return N}if(n2(N)){if(N.value)return x;if(_(T))return T}}return new v(l.op,l.fn,[T,N])}if(c2(l))return new v(l.op,l.fn,l.args.map((e=>k(e,t))));if(Z1(l))return new d(l.items.map((e=>k(e,t))));if(J1(l))return new u(k(l.object,t),k(l.index,t));if(i2(l))return new h(l.dimensions.map((e=>k(e,t))));if(s2(l)){var D={};for(var A in l.properties)D[A]=k(l.properties[A],t);return new m(D)}return l}return t(gse,{Node:k,"Node,Object":k})})),bse=k2("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],(e=>{var{typed:t,parse:n,ConstantNode:r,FunctionNode:o,OperatorNode:a,ParenthesisNode:i}=e;function l(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if(f2(e)){if(s.has(e.name)){var c=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(c,"}"))}var u=t.get(e.name);if(l2(u)){var d=new Set(s);return d.add(e.name),l(u,t,d)}return"number"==typeof u?n(String(u)):void 0!==u?new r(u):e}if(c2(e)){var p=e.args.map((function(e){return l(e,t,s)}));return new a(e.op,e.fn,p,e.implicit)}if(u2(e))return new i(l(e.content,t,s));if(a2(e)){var f=e.args.map((function(e){return l(e,t,s)}));return new o(e.name,f)}return e.map((e=>l(e,t,s)))}return t("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(e,t)=>l(e,k1(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,n)=>e(t,k1(n)))),"Matrix, Object":t.referTo("Matrix,Map",(e=>(t,n)=>e(t,k1(n)))),"Array | Matrix, Map":t.referToSelf((e=>(t,n)=>t.map((t=>e(t,n)))))})})),wse="symbolicEqual",xse=k2(wse,["parse","simplify","typed","OperatorNode"],(e=>{var{parse:t,simplify:n,typed:r,OperatorNode:o}=e;function a(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new o("-","subtract",[e,t]),i=n(a,{},r);return n2(i)&&!i.value}return r(wse,{"Node, Node":a,"Node, Node, Object":a})})),Cse="derivative",_se=k2(Cse,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{typed:t,config:n,parse:r,simplify:o,equal:a,isZero:i,numeric:l,ConstantNode:s,FunctionNode:c,OperatorNode:u,ParenthesisNode:d,SymbolNode:p}=e;function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0},r={};v(r,e,t.name);var a=g(e,r);return n.simplify?o(a):a}t.addConversion({from:"identifier",to:"SymbolNode",convert:r});var h=t(Cse,{"Node, SymbolNode":f,"Node, SymbolNode, Object":f});t.removeConversion({from:"identifier",to:"SymbolNode",convert:r}),h._simplify=!0,h.toTex=function(e){return m.apply(null,e.args)};var m=t("_derivTex",{"Node, SymbolNode":function(e,t){return n2(e)&&"string"===m2(e.value)?m(r(e.value).toString(),t.toString(),1):m(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===m2(t.value))return m(e,r(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,n){return m(e.toString(),t.name,n.value)},"string, string, number":function(e,t,n){return(1===n?"{d\\over d"+t+"}":"{d^{"+n+"}\\over d"+t+"^{"+n+"}}")+"\\left[".concat(e,"\\right]")}}),v=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,n){return t.name!==n&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,n){return v(e,t.content,n)},"Object, FunctionAssignmentNode, string":function(e,t,n){return t.params.includes(n)?v(e,t.expr,n):(e[t]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(e,t,n){if(t.args.length>0){for(var r=v(e,t.args[0],n),o=1;o<t.args.length;++o)r=v(e,t.args[o],n)&&r;if(r)return e[t]=!0,!0}return!1}}),g=t("_derivative",{"ConstantNode, Object":function(e){return y(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?y(0):y(1)},"ParenthesisNode, Object":function(e,t){return new d(g(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?y(0):g(e.expr,t)},"FunctionNode, Object":function(e,t){if(void 0!==t[e])return y(0);var n,r,o,a,i=e.args[0],l=!1,s=!1;switch(e.name){case"cbrt":l=!0,r=new u("*","multiply",[y(3),new u("^","pow",[i,new u("/","divide",[y(2),y(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)l=!0,r=new u("*","multiply",[y(2),new c("sqrt",[i])]);else if(2===e.args.length)return t[n=new u("/","divide",[y(1),e.args[1]])]=t[e.args[1]],g(new u("^","pow",[i,n]),t);break;case"log10":n=y(10);case"log":if(n||1!==e.args.length){if(1===e.args.length&&n||2===e.args.length&&void 0!==t[e.args[1]])r=new u("*","multiply",[i.clone(),new c("log",[n||e.args[1]])]),l=!0;else if(2===e.args.length)return g(new u("/","divide",[new c("log",[i]),new c("log",[e.args[1]])]),t)}else r=i.clone(),l=!0;break;case"pow":if(2===e.args.length)return t[n]=t[e.args[1]],g(new u("^","pow",[i,e.args[1]]),t);break;case"exp":r=new c("exp",[i.clone()]);break;case"sin":r=new c("cos",[i.clone()]);break;case"cos":r=new u("-","unaryMinus",[new c("sin",[i.clone()])]);break;case"tan":r=new u("^","pow",[new c("sec",[i.clone()]),y(2)]);break;case"sec":r=new u("*","multiply",[e,new c("tan",[i.clone()])]);break;case"csc":s=!0,r=new u("*","multiply",[e,new c("cot",[i.clone()])]);break;case"cot":s=!0,r=new u("^","pow",[new c("csc",[i.clone()]),y(2)]);break;case"asin":l=!0,r=new c("sqrt",[new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])])]);break;case"acos":l=!0,s=!0,r=new c("sqrt",[new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])])]);break;case"atan":l=!0,r=new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)]);break;case"asec":l=!0,r=new u("*","multiply",[new c("abs",[i.clone()]),new c("sqrt",[new u("-","subtract",[new u("^","pow",[i.clone(),y(2)]),y(1)])])]);break;case"acsc":l=!0,s=!0,r=new u("*","multiply",[new c("abs",[i.clone()]),new c("sqrt",[new u("-","subtract",[new u("^","pow",[i.clone(),y(2)]),y(1)])])]);break;case"acot":l=!0,s=!0,r=new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)]);break;case"sinh":r=new c("cosh",[i.clone()]);break;case"cosh":r=new c("sinh",[i.clone()]);break;case"tanh":r=new u("^","pow",[new c("sech",[i.clone()]),y(2)]);break;case"sech":s=!0,r=new u("*","multiply",[e,new c("tanh",[i.clone()])]);break;case"csch":s=!0,r=new u("*","multiply",[e,new c("coth",[i.clone()])]);break;case"coth":s=!0,r=new u("^","pow",[new c("csch",[i.clone()]),y(2)]);break;case"asinh":l=!0,r=new c("sqrt",[new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)])]);break;case"acosh":l=!0,r=new c("sqrt",[new u("-","subtract",[new u("^","pow",[i.clone(),y(2)]),y(1)])]);break;case"atanh":l=!0,r=new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])]);break;case"asech":l=!0,s=!0,r=new u("*","multiply",[i.clone(),new c("sqrt",[new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])])])]);break;case"acsch":l=!0,s=!0,r=new u("*","multiply",[new c("abs",[i.clone()]),new c("sqrt",[new u("+","add",[new u("^","pow",[i.clone(),y(2)]),y(1)])])]);break;case"acoth":l=!0,s=!0,r=new u("-","subtract",[y(1),new u("^","pow",[i.clone(),y(2)])]);break;case"abs":r=new u("/","divide",[new c(new p("abs"),[i.clone()]),i.clone()]);break;default:throw new 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')}l?(o="/",a="divide"):(o="*",a="multiply");var d=g(i,t);return s&&(d=new u("-","unaryMinus",[d])),new u(o,a,[d,r])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return y(0);if("+"===e.op)return new u(e.op,e.fn,e.args.map((function(e){return g(e,t)})));if("-"===e.op){if(e.isUnary())return new u(e.op,e.fn,[g(e.args[0],t)]);if(e.isBinary())return new u(e.op,e.fn,[g(e.args[0],t),g(e.args[1],t)])}if("*"===e.op){var n=e.args.filter((function(e){return void 0!==t[e]}));if(n.length>0){var r=e.args.filter((function(e){return void 0===t[e]})),o=1===r.length?r[0]:new u("*","multiply",r),l=n.concat(g(o,t));return new u("*","multiply",l)}return new u("+","add",e.args.map((function(n){return new u("*","multiply",e.args.map((function(e){return e===n?g(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var s=e.args[0],d=e.args[1];return void 0!==t[d]?new u("/","divide",[g(s,t),d]):void 0!==t[s]?new u("*","multiply",[new u("-","unaryMinus",[s]),new u("/","divide",[g(d,t),new u("^","pow",[d.clone(),y(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[g(s,t),d.clone()]),new u("*","multiply",[s.clone(),g(d,t)])]),new u("^","pow",[d.clone(),y(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],f=e.args[1];if(void 0!==t[p])return n2(p)&&(i(p.value)||a(p.value,1))?y(0):new u("*","multiply",[e,new u("*","multiply",[new c("log",[p.clone()]),g(f.clone(),t)])]);if(void 0!==t[f]){if(n2(f)){if(i(f.value))return y(0);if(a(f.value,1))return g(p,t)}var h=new u("^","pow",[p.clone(),new u("-","subtract",[f,y(1)])]);return new u("*","multiply",[f.clone(),new u("*","multiply",[g(p,t),h])])}return new u("*","multiply",[new u("^","pow",[p.clone(),f.clone()]),new u("+","add",[new u("*","multiply",[g(p,t),new u("/","divide",[f.clone(),p.clone()])]),new u("*","multiply",[g(f,t),new c("log",[p.clone()])])])])}throw new 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 y(e,t){return new s(l(e,D2(String(e),n)))}return h})),Ese="rationalize",Sse=k2(Ese,["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:n,equal:r,isZero:o,add:a,subtract:i,multiply:l,divide:s,pow:c,parse:u,simplifyConstant:d,simplifyCore:p,simplify:f,fraction:h,bignumber:m,mathWithTransform:v,matrix:g,AccessorNode:y,ArrayNode:b,ConstantNode:w,FunctionNode:x,IndexNode:C,ObjectNode:_,OperatorNode:E,SymbolNode:S,ParenthesisNode:k}=e;function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=function(){var e=[p,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},d,{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"}],t=[{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)"}],n=[{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)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],o={};return o.firstRules=e.concat(t,r),o.distrDivRules=n,o.sucDivRules=r,o.firstRulesAgain=e.concat(t),o.finalRules=[p,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},d,{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))"}],o}(),o=function(e,t,n,r){var o=[],a=f(e,r,t,{exactFractions:!1}),i="+-*"+((n=!!n)?"/":"");s(a);var l={};return l.expression=a,l.variables=o,l;function s(e){var t=e.type;if("FunctionNode"===t)throw new Error("There is an unsolved function call");if("OperatorNode"===t)if("^"===e.op){if("ConstantNode"!==e.args[1].type||!N2(parseFloat(e.args[1].value)))throw new Error("There is a non-integer exponent");s(e.args[0])}else{if(!i.includes(e.op))throw new Error("Operator "+e.op+" invalid in polynomial expression");for(var n=0;n<e.args.length;n++)s(e.args[n])}else if("SymbolNode"===t){var r=e.name;-1===o.indexOf(r)&&o.push(r)}else if("ParenthesisNode"===t)s(e.content);else if("ConstantNode"!==t)throw new Error("type "+t+" is not allowed in polynomial expression")}}(e,t,!0,r.firstRules),a=o.variables.length,i={exactFractions:!1},l={exactFractions:!0};if(e=o.expression,a>=1){var s,c;e=N(e);var u,h=!0,m=!1;for(e=f(e,r.firstRules,{},i);c=h?r.distrDivRules:r.sucDivRules,h=!h,(u=(e=f(e,c,{},l)).toString())!==s;)m=!0,s=u;m&&(e=f(e,r.firstRulesAgain,{},i)),e=f(e,r.finalRules,{},i)}var v=[],g={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===a&&(e.args[0]=D(e.args[0],v),e.args[1]=D(e.args[1])),n&&(g.numerator=e.args[0],g.denominator=e.args[1])):(1===a&&(e=D(e,v)),n&&(g.numerator=e,g.denominator=null)),n?(g.coefficients=v,g.variables=o.variables,g.expression=e,g):e}return n(Ese,{Node:T,"Node, boolean":(e,t)=>T(e,{},t),"Node, Object":T,"Node, Object, boolean":T});function N(e,t,n){var r=e.type,o=arguments.length>1;if("OperatorNode"===r&&e.isBinary()){var a,i=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(i=(a=parseFloat(e.args[1].value))>=2&&N2(a))),i){if(a>2){var l=e.args[0],s=new E("^","pow",[e.args[0].cloneDeep(),new w(a-1)]);e=new E("*","multiply",[l,s])}else e=new E("*","multiply",[e.args[0],e.args[0].cloneDeep()]);o&&("content"===n?t.content=e:t.args[n]=e)}}if("ParenthesisNode"===r)N(e.content,e,"content");else if("ConstantNode"!==r&&"SymbolNode"!==r)for(var c=0;c<e.args.length;c++)N(e.args[c],e,c);if(!o)return e}function D(e,t){void 0===t&&(t=[]),t[0]=0;var n={cte:1,oper:"+",fire:""},r=0,o="";!function e(n,a,i){var l=n.type;if("FunctionNode"===l)throw new Error("There is an unsolved function call");if("OperatorNode"===l){if(!"+-*^".includes(n.op))throw new Error("Operator "+n.op+" invalid");if(null!==a){if(("unaryMinus"===n.fn||"pow"===n.fn)&&"add"!==a.fn&&"subtract"!==a.fn&&"multiply"!==a.fn)throw new Error("Invalid "+n.op+" placing");if(("subtract"===n.fn||"add"===n.fn||"multiply"===n.fn)&&"add"!==a.fn&&"subtract"!==a.fn)throw new Error("Invalid "+n.op+" placing");if(("subtract"===n.fn||"add"===n.fn||"unaryMinus"===n.fn)&&0!==i.noFil)throw new Error("Invalid "+n.op+" placing")}"^"!==n.op&&"*"!==n.op||(i.fire=n.op);for(var s=0;s<n.args.length;s++)"unaryMinus"===n.fn&&(i.oper="-"),"+"!==n.op&&"subtract"!==n.fn||(i.fire="",i.cte=1,i.oper=0===s?"+":n.op),i.noFil=s,e(n.args[s],n,i)}else if("SymbolNode"===l){if(n.name!==o&&""!==o)throw new Error("There is more than one variable");if(o=n.name,null===a)return void(t[1]=1);if("^"===a.op&&0!==i.noFil)throw new Error("In power the variable should be the first parameter");if("*"===a.op&&1!==i.noFil)throw new Error("In multiply the variable should be the second parameter");""!==i.fire&&"*"!==i.fire||(r<1&&(t[1]=0),t[1]+=i.cte*("+"===i.oper?1:-1),r=Math.max(1,r))}else{if("ConstantNode"!==l)throw new Error("Type "+l+" is not allowed");var c=parseFloat(n.value);if(null===a)return void(t[0]=c);if("^"===a.op){if(1!==i.noFil)throw new Error("Constant cannot be powered");if(!N2(c)||c<=0)throw new Error("Non-integer exponent is not allowed");for(var u=r+1;u<c;u++)t[u]=0;return c>r&&(t[c]=0),t[c]+=i.cte*("+"===i.oper?1:-1),void(r=Math.max(c,r))}i.cte=c,""===i.fire&&(t[0]+=i.cte*("+"===i.oper?1:-1))}}(e,null,n);for(var a,i=!0,l=r=t.length-1;l>=0;l--)if(0!==t[l]){var s=new w(i?t[l]:Math.abs(t[l])),c=t[l]<0?"-":"+";if(l>0){var u=new S(o);if(l>1){var d=new w(l);u=new E("^","pow",[u,d])}s=-1===t[l]&&i?new E("-","unaryMinus",[u]):1===Math.abs(t[l])?u:new E("*","multiply",[s,u])}a=i?s:"+"===c?new E("+","add",[a,s]):new E("-","subtract",[a,s]),i=!1}return i?new w(0):a}})),kse="zpk2tf",Tse=k2(kse,["typed","add","multiply","Complex","number"],(e=>{var{typed:t,add:n,multiply:r,Complex:o,number:a}=e;return t(kse,{"Array,Array,number":function(e,t,n){return i(e,t,n)},"Array,Array":function(e,t){return i(e,t,1)},"Matrix,Matrix,number":function(e,t,n){return i(e.valueOf(),t.valueOf(),n)},"Matrix,Matrix":function(e,t){return i(e.valueOf(),t.valueOf(),1)}});function i(e,t,n){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 i=[o(1,0)],s=[o(1,0)],c=0;c<e.length;c++){var u=e[c];"number"==typeof u&&(u=o(u,0)),i=l(i,[o(1,0),o(-u.re,-u.im)])}for(var d=0;d<t.length;d++){var p=t[d];"number"==typeof p&&(p=o(p,0)),s=l(s,[o(1,0),o(-p.re,-p.im)])}for(var f=0;f<i.length;f++)i[f]=r(i[f],n);return[i,s]}function l(e,t){for(var a=[],i=0;i<e.length+t.length-1;i++){a[i]=o(0,0);for(var l=0;l<e.length;l++)i-l>=0&&i-l<t.length&&(a[i]=n(a[i],r(e[l],t[i-l])))}return a}})),Nse="freqz",Dse=k2(Nse,["typed","add","multiply","Complex","divide","matrix"],(e=>{var{typed:t,add:n,multiply:r,Complex:o,divide:a,matrix:i}=e;return t(Nse,{"Array, Array":function(e,t){return l(e,t,s(512))},"Array, Array, Array":function(e,t,n){return l(e,t,n)},"Array, Array, number":function(e,t,n){if(n<0)throw new Error("w must be a positive number");return l(e,t,s(n))},"Matrix, Matrix":function(e,t){var n=s(512),{w:r,h:o}=l(e.valueOf(),t.valueOf(),n);return{w:i(r),h:i(o)}},"Matrix, Matrix, Matrix":function(e,t,n){var{h:r}=l(e.valueOf(),t.valueOf(),n.valueOf());return{h:i(r),w:i(n)}},"Matrix, Matrix, number":function(e,t,n){if(n<0)throw new Error("w must be a positive number");var r=s(n),{h:o}=l(e.valueOf(),t.valueOf(),r);return{h:i(o),w:i(r)}}});function l(e,t,i){for(var l=[],s=[],c=0;c<i.length;c++){for(var u=o(0,0),d=o(0,0),p=0;p<e.length;p++)u=n(u,r(e[p],o(Math.cos(-p*i[c]),Math.sin(-p*i[c]))));for(var f=0;f<t.length;f++)d=n(d,r(t[f],o(Math.cos(-f*i[c]),Math.sin(-f*i[c]))));l.push(u),s.push(d)}for(var h=[],m=0;m<l.length;m++)h.push(a(l[m],s[m]));return{h:h,w:i}}function s(e){for(var t=[],n=0;n<e;n++)t.push(n/e*Math.PI);return t}})),Ase=k2("reviver",["classes"],(e=>{var{classes:t}=e;return function(e,n){var r=t[n&&n.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(n):n}})),Ise=k2("replacer",[],(()=>function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?"bigint"==typeof t?{mathjs:"bigint",value:String(t)}:t:{mathjs:"number",value:String(t)}})),Rse=k2("true",[],(()=>!0)),Mse=k2("false",[],(()=>!1)),Ose=k2("null",[],(()=>null)),Bse=Kse("Infinity",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1/0):1/0})),Vse=Kse("NaN",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(NaN):NaN})),Pse=Kse("pi",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?cre(n):$8})),Lse=Kse("tau",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?ure(n):U8})),Fse=Kse("e",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?lre(n):H8})),zse=Kse("phi",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?sre(n):1.618033988749895})),jse=Kse("LN2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).ln():Math.LN2})),$se=Kse("LN10",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(10).ln():Math.LN10})),Use=Kse("LOG2E",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(2).ln()):Math.LOG2E})),Hse=Kse("LOG10E",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(10).ln()):Math.LOG10E})),qse=Kse("SQRT1_2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n("0.5").sqrt():Math.SQRT1_2})),Wse=Kse("SQRT2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).sqrt():Math.SQRT2})),Gse=Kse("i",["Complex"],(e=>{var{Complex:t}=e;return t.I})),Yse=k2("version",[],(()=>"13.1.1"));function Kse(e,t,n){return k2(e,t,n,{recreateOnConfigChange:!0})}var Xse=Wce("speedOfLight","299792458","m s^-1"),Jse=Wce("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Zse=Wce("planckConstant","6.62607015e-34","J s"),Qse=Wce("reducedPlanckConstant","1.0545718176461565e-34","J s"),ece=Wce("magneticConstant","1.25663706212e-6","N A^-2"),tce=Wce("electricConstant","8.8541878128e-12","F m^-1"),nce=Wce("vacuumImpedance","376.730313667","ohm"),rce=Wce("coulomb","8.987551792261171e9","N m^2 C^-2"),oce=Wce("elementaryCharge","1.602176634e-19","C"),ace=Wce("bohrMagneton","9.2740100783e-24","J T^-1"),ice=Wce("conductanceQuantum","7.748091729863649e-5","S"),lce=Wce("inverseConductanceQuantum","12906.403729652257","ohm"),sce=Wce("magneticFluxQuantum","2.0678338484619295e-15","Wb"),cce=Wce("nuclearMagneton","5.0507837461e-27","J T^-1"),uce=Wce("klitzing","25812.807459304513","ohm"),dce=Wce("bohrRadius","5.29177210903e-11","m"),pce=Wce("classicalElectronRadius","2.8179403262e-15","m"),fce=Wce("electronMass","9.1093837015e-31","kg"),hce=Wce("fermiCoupling","1.1663787e-5","GeV^-2"),mce=Gce("fineStructure",.0072973525693),vce=Wce("hartreeEnergy","4.3597447222071e-18","J"),gce=Wce("protonMass","1.67262192369e-27","kg"),yce=Wce("deuteronMass","3.3435830926e-27","kg"),bce=Wce("neutronMass","1.6749271613e-27","kg"),wce=Wce("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),xce=Wce("rydberg","10973731.568160","m^-1"),Cce=Wce("thomsonCrossSection","6.6524587321e-29","m^2"),_ce=Gce("weakMixingAngle",.2229),Ece=Gce("efimovFactor",22.7),Sce=Wce("atomicMass","1.66053906660e-27","kg"),kce=Wce("avogadro","6.02214076e23","mol^-1"),Tce=Wce("boltzmann","1.380649e-23","J K^-1"),Nce=Wce("faraday","96485.33212331001","C mol^-1"),Dce=Wce("firstRadiation","3.7417718521927573e-16","W m^2"),Ace=Wce("loschmidt","2.686780111798444e25","m^-3"),Ice=Wce("gasConstant","8.31446261815324","J K^-1 mol^-1"),Rce=Wce("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Mce=Wce("molarVolume","0.022413969545014137","m^3 mol^-1"),Oce=Gce("sackurTetrode",-1.16487052358),Bce=Wce("secondRadiation","0.014387768775039337","m K"),Vce=Wce("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Pce=Wce("wienDisplacement","2.897771955e-3","m K"),Lce=Wce("molarMass","0.99999999965e-3","kg mol^-1"),Fce=Wce("molarMassC12","11.9999999958e-3","kg mol^-1"),zce=Wce("gravity","9.80665","m s^-2"),jce=Wce("planckLength","1.616255e-35","m"),$ce=Wce("planckMass","2.176435e-8","kg"),Uce=Wce("planckTime","5.391245e-44","s"),Hce=Wce("planckCharge","1.87554603778e-18","C"),qce=Wce("planckTemperature","1.416785e+32","K");function Wce(e,t,n){return k2(e,["config","Unit","BigNumber"],(e=>{var{config:r,Unit:o,BigNumber:a}=e,i=new o("BigNumber"===r.number?new a(t):parseFloat(t),n);return i.fixPrefix=!0,i}))}function Gce(e,t){return k2(e,["config","BigNumber"],(e=>{var{config:n,BigNumber:r}=e;return"BigNumber"===n.number?new r(t):t}))}var Yce=k2("apply",["typed","isInteger"],(e=>{var{typed:t,isInteger:n}=e,r=f9({typed:t,isInteger:n});return t("apply",{"...any":function(e){var t=e[1];T1(t)?e[1]=t-1:N1(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(n){throw zoe(n)}}})}),{isTransformFunction:!0}),Kce=k2("column",["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:o}=e,a=nee({typed:t,Index:n,matrix:r,range:o});return t("column",{"...any":function(e){var t=e.length-1,n=e[t];T1(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(r){throw zoe(r)}}})}),{isTransformFunction:!0});function Xce(e,t,n){var r=e.filter((function(e){return f2(e)&&!(e.name in t)&&!n.has(e.name)}))[0];if(!r)throw new Error('No undefined variable found in inline expression "'+e+'"');var o=r.name,a=new Map,i=new _1(n,a,new Set([o])),l=e.compile();return function(e){return a.set(o,e),l.evaluate(i)}}var Jce=k2("filter",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var o,a;return e[0]&&(o=e[0].compile().evaluate(n)),e[1]&&(a=f2(e[1])||o2(e[1])?e[1].compile().evaluate(n):Xce(e[1],t,n)),r(o,a)}n.rawArgs=!0;var r=t("filter",{"Array, function":Zce,"Matrix, function":function(e,t){return e.create(Zce(e.toArray(),t),e.datatype())},"Array, RegExp":j6,"Matrix, RegExp":function(e,t){return e.create(j6(e.toArray(),t),e.datatype())}});return n}),{isTransformFunction:!0});function Zce(e,t){return z6(e,(function(e,n,r){return Z6(t,e,[n+1],r,"filter")}))}var Qce=k2("forEach",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var o,a;return e[0]&&(o=e[0].compile().evaluate(n)),e[1]&&(a=f2(e[1])||o2(e[1])?e[1].compile().evaluate(n):Xce(e[1],t,n)),r(o,a)}n.rawArgs=!0;var r=t("forEach",{"Array | Matrix, function":function(e,t){var n=function(r,o){if(!Array.isArray(r))return Z6(t,r,o,e,"forEach");F6(r,(function(e,t){n(e,o.concat(t+1))}))};n(e.valueOf(),[])}});return n}),{isTransformFunction:!0}),eue=k2("index",["Index","getMatrixDataType"],(e=>{var{Index:t,getMatrixDataType:n}=e;return function(){for(var e=[],r=0,o=arguments.length;r<o;r++){var a=arguments[r];if(F1(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(O1(a)||B1(a))"boolean"!==n(a)&&(a=a.map((function(e){return e-1})));else if(T1(a))a--;else if(N1(a))a=a.toNumber()-1;else if("string"!=typeof a)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[r]=a}var i=new t;return t.apply(i,e),i}}),{isTransformFunction:!0}),tue=k2("map",["typed"],(e=>{var{typed:t}=e,n=Cee({typed:t});function r(e,r,a){if(0===e.length)return n();if(1===e.length)return n(e[0]);var i,l,s=e.length-1;return l=e[s],i=(i=e.slice(0,s)).map((e=>c(e,a))),l&&(l=f2(l)||o2(l)?c(l,a):Xce(l,r,a)),n(...i,function(e,n){return t.isTypedFunction(e)?o(e,n):nue(e,e.length,n)}(l,s));function c(e,t){return e.compile().evaluate(t)}}return r.rawArgs=!0,r;function o(e,n){var r=Object.fromEntries(Object.entries(e.signatures).map((e=>{var[r,a]=e,i=r.split(",").length;return t.isTypedFunction(a)?[r,o(a,n)]:[r,nue(a,i,n)]})));return"string"==typeof e.name?t(e.name,r):t(r)}}),{isTransformFunction:!0});function nue(e,t,n){return t===n?e:t===n+1?function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=r.slice(0,n),i=rue(r[n]);return e(...a,i)}:t>n+1?function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=r.slice(0,n),i=rue(r[n]),l=r.slice(n+1);return e(...a,i,...l)}:e}function rue(e){return e.map((e=>e.isBigNumber?e.plus(1):e+1))}function oue(e){if(2===e.length&&V1(e[0])){var t=(e=e.slice())[1];(T1(n=t)||N1(n))&&(e[1]=function(e){return T1(e)?e-1:N1(e)?e.minus(1):e}(t))}var n;return e}var aue=["typed","config","numeric","larger"],iue=k2("max",aue,(e=>{var{typed:t,config:n,numeric:r,larger:o}=e,a=Zne({typed:t,config:n,numeric:r,larger:o});return t("max",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),lue=["typed","add","divide"],sue=k2("mean",lue,(e=>{var{typed:t,add:n,divide:r}=e,o=Gie({typed:t,add:n,divide:r});return t("mean",{"...any":function(e){e=oue(e);try{return o.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),cue=["typed","config","numeric","smaller"],uue=k2("min",cue,(e=>{var{typed:t,config:n,numeric:r,smaller:o}=e,a=Qne({typed:t,config:n,numeric:r,smaller:o});return t("min",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),due=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],pue=k2("range",due,(e=>{var{typed:t,config:n,matrix:r,bignumber:o,smaller:a,smallerEq:i,larger:l,largerEq:s,add:c,isPositive:u}=e,d=Ree({typed:t,config:n,matrix:r,bignumber:o,smaller:a,smallerEq:i,larger:l,largerEq:s,add:c,isPositive:u});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),d.apply(null,e)}})}),{isTransformFunction:!0}),fue=["typed","Index","matrix","range"],hue=k2("row",fue,(e=>{var{typed:t,Index:n,matrix:r,range:o}=e,a=zee({typed:t,Index:n,matrix:r,range:o});return t("row",{"...any":function(e){var t=e.length-1,n=e[t];T1(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(r){throw zoe(r)}}})}),{isTransformFunction:!0}),mue=["typed","matrix","zeros","add"],vue=k2("subset",mue,(e=>{var{typed:t,matrix:n,zeros:r,add:o}=e,a=Wee({typed:t,matrix:n,zeros:r,add:o});return t("subset",{"...any":function(e){try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),gue=["typed","matrix","isInteger"],yue=k2("concat",gue,(e=>{var{typed:t,matrix:n,isInteger:r}=e,o=eee({typed:t,matrix:n,isInteger:r});return t("concat",{"...any":function(e){var t=e.length-1,n=e[t];T1(n)?e[t]=n-1:N1(n)&&(e[t]=n.minus(1));try{return o.apply(null,e)}catch(r){throw zoe(r)}}})}),{isTransformFunction:!0}),bue="diff",wue=["typed","matrix","subtract","number","bignumber"],xue=k2(bue,wue,(e=>{var{typed:t,matrix:n,subtract:r,number:o,bignumber:a}=e,i=kee({typed:t,matrix:n,subtract:r,number:o,bignumber:a});return t(bue,{"...any":function(e){e=oue(e);try{return i.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),Cue=["typed","map","sqrt","variance"],_ue=k2("std",Cue,(e=>{var{typed:t,map:n,sqrt:r,variance:o}=e,a=nle({typed:t,map:n,sqrt:r,variance:o});return t("std",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),Eue=["typed","config","add","numeric"],Sue=k2("sum",Eue,(e=>{var{typed:t,config:n,add:r,numeric:o}=e,a=Uie({typed:t,config:n,add:r,numeric:o});return t("sum",{"...any":function(e){e=oue(e);try{return a.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),kue=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Tue=k2("quantileSeq",kue,(e=>{var{typed:t,bignumber:n,add:r,subtract:o,divide:a,multiply:i,partitionSelect:l,compare:s,isInteger:c,smaller:u,smallerEq:d,larger:p}=e,f=tle({typed:t,bignumber:n,add:r,subtract:o,divide:a,multiply:i,partitionSelect:l,compare:s,isInteger:c,smaller:u,smallerEq:d,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":f,"Array | Matrix, number | BigNumber, number":(e,t,n)=>f(e,t,h(n)),"Array | Matrix, number | BigNumber, boolean":f,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>f(e,t,n,h(r)),"Array | Matrix, Array | Matrix":f,"Array | Matrix, Array | Matrix, number":(e,t,n)=>f(e,t,h(n)),"Array | Matrix, Array | Matrix, boolean":f,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>f(e,t,n,h(r))});function h(e){return oue([[],e])[1]}}),{isTransformFunction:!0}),Nue="cumsum",Due=["typed","add","unaryPlus"],Aue=k2(Nue,Due,(e=>{var{typed:t,add:n,unaryPlus:r}=e,o=qie({typed:t,add:n,unaryPlus:r});return t(Nue,{"...any":function(e){if(2===e.length&&V1(e[0])){var t=e[1];T1(t)?e[1]=t-1:N1(t)&&(e[1]=t.minus(1))}try{return o.apply(null,e)}catch(n){throw zoe(n)}}})}),{isTransformFunction:!0}),Iue="variance",Rue=["typed","add","subtract","multiply","divide","apply","isNaN"],Mue=k2(Iue,Rue,(e=>{var{typed:t,add:n,subtract:r,multiply:o,divide:a,apply:i,isNaN:l}=e,s=Qie({typed:t,add:n,subtract:r,multiply:o,divide:a,apply:i,isNaN:l});return t(Iue,{"...any":function(e){e=oue(e);try{return s.apply(null,e)}catch(t){throw zoe(t)}}})}),{isTransformFunction:!0}),Oue="print",Bue=["typed","matrix","zeros","add"],Vue=k2(Oue,Bue,(e=>{var{typed:t,matrix:n,zeros:r,add:o}=e,a=Ite({typed:t,matrix:n,zeros:r,add:o});return t(Oue,{"string, Object | Array":function(e,t){return a(i(e),t)},"string, Object | Array, number | Object":function(e,t,n){return a(i(e),t,n)}});function i(e){return e.replace(Dte,(e=>"$"+e.slice(1).split(".").map((function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e})).join(".")))}}),{isTransformFunction:!0}),Pue=["typed","matrix","zeros","add","equalScalar","not","concat"],Lue=k2("and",Pue,(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i}=e,l=mne({typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i});function s(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)&&!l(r,!0))return!1;var o=e[1].compile().evaluate(n);return l(r,o)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Fue=["typed","matrix","equalScalar","DenseMatrix","concat"],zue=k2("or",Fue,(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=J7({typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a});function l(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)&&i(r,!1))return!0;var o=e[1].compile().evaluate(n);return i(r,o)}return l.rawArgs=!0,l}),{isTransformFunction:!0}),jue=["typed","matrix","zeros","add","equalScalar","not","concat"],$ue=k2("bitAnd",jue,(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i}=e,l=P7({typed:t,matrix:n,equalScalar:r,zeros:o,not:a,concat:i});function s(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)){if(isNaN(r))return NaN;if(0===r||!1===r)return 0}var o=e[1].compile().evaluate(n);return l(r,o)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Uue=["typed","matrix","equalScalar","DenseMatrix","concat"],Hue=k2("bitOr",Uue,(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a}=e,i=j7({typed:t,matrix:n,equalScalar:r,DenseMatrix:o,concat:a});function l(e,t,n){var r=e[0].compile().evaluate(n);if(!V1(r)){if(isNaN(r))return NaN;if(-1===r)return-1;if(!0===r)return 1}var o=e[1].compile().evaluate(n);return i(r,o)}return l.rawArgs=!0,l}),{isTransformFunction:!0}),que=z3({config:w2}),Wue=K3({}),Gue=Fse({BigNumber:que,config:w2}),Yue=Mse({}),Kue=mce({BigNumber:que,config:w2}),Xue=i6({}),Jue=Gse({Complex:Wue}),Zue=Bse({BigNumber:que,config:w2}),Que=$se({BigNumber:que,config:w2}),ede=Hse({BigNumber:que,config:w2}),tde=s6({}),nde=Vse({BigNumber:que,config:w2}),rde=Ose({}),ode=zse({BigNumber:que,config:w2}),ade=l6({}),ide=i4({}),lde=qse({BigNumber:que,config:w2}),sde=Oce({BigNumber:que,config:w2}),cde=Lse({BigNumber:que,config:w2}),ude=Rse({}),dde=Yse({}),pde=Q6({Matrix:tde}),fde=Ece({BigNumber:que,config:w2}),hde=jse({BigNumber:que,config:w2}),mde=Pse({BigNumber:que,config:w2}),vde=Ise({}),gde=Wse({BigNumber:que,config:w2}),yde=e4({BigNumber:que,Complex:Wue,DenseMatrix:pde,Fraction:Xue}),bde=_ce({BigNumber:que,config:w2}),wde=d9({typed:yde}),xde=Cre({Complex:Wue,config:w2,typed:yde}),Cde=kre({BigNumber:que,typed:yde}),_de=Are({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Ede=v9({typed:yde}),Sde=q7({typed:yde}),kde=Vre({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Tde=Fre({typed:yde}),Nde=zre({typed:yde}),Dde=Hre({Complex:Wue,config:w2,typed:yde}),Ade=U5({typed:yde}),Ide=F7({typed:yde}),Rde=G5({typed:yde}),Mde=t8({typed:yde}),Ode=ile({typed:yde}),Bde=K5({Complex:Wue,typed:yde}),Vde=G7({typed:yde}),Pde=Wre({typed:yde}),Lde=Kre({BigNumber:que,typed:yde}),Fde=Zre({BigNumber:que,typed:yde}),zde=D9({typed:yde}),jde=z5({config:w2,typed:yde}),$de=dte({typed:yde}),Ude=A9({typed:yde}),Hde=R9({Complex:Wue,typed:yde}),qde=cee({typed:yde}),Wde=pee({typed:yde}),Gde=hee({typed:yde}),Yde=Ste({typed:yde}),Kde=gee({typed:yde}),Xde=Nte({format:Yde,typed:yde}),Jde=Y7({typed:yde}),Zde=u8({typed:yde}),Qde=S5({config:w2,typed:yde}),epe=I5({config:w2,typed:yde}),tpe=M5({equalScalar:jde,typed:yde}),npe=Use({BigNumber:que,config:w2}),rpe=hle({Complex:Wue,typed:yde}),ope=i7({Complex:Wue,config:w2,typed:yde}),ape=s7({Complex:Wue,config:w2,typed:yde}),ipe=Cee({typed:yde}),lpe=c7({typed:yde}),spe=X7({typed:yde}),cpe=$5({typed:yde}),upe=Tte({format:Yde,typed:yde}),dpe=Yle({config:w2,typed:yde}),ppe=Ite({typed:yde}),fpe=Jle({config:w2,typed:yde}),hpe=K7({typed:yde}),mpe=toe({BigNumber:que,typed:yde}),vpe=m7({BigNumber:que,Fraction:Xue,complex:Bde,typed:yde}),gpe=ooe({typed:yde}),ype=j5({Matrix:tde,equalScalar:jde,typed:yde}),bpe=i9({typed:yde}),wpe=y7({typed:yde}),xpe=q5({typed:yde}),Cpe=y9({typed:yde}),_pe=loe({typed:yde}),Epe=P5({typed:yde}),Spe=Ere({Complex:Wue,config:w2,typed:yde}),kpe=Rre({BigNumber:que,typed:yde}),Tpe=f9({isInteger:Zde,typed:yde}),Npe=Ore({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Dpe=Y5({BigNumber:que,typed:yde}),Ape=cle({typed:yde}),Ipe=Yre({typed:yde}),Rpe=eoe({BigNumber:que,typed:yde}),Mpe=B5({typed:yde}),Ope=Bte({typed:yde}),Bpe=Qle({config:w2,typed:yde}),Vpe=roe({BigNumber:que,typed:yde}),Ppe=ioe({typed:yde}),Lpe=yre({SparseMatrix:ype,typed:yde}),Fpe=v7({Complex:Wue,config:w2,typed:yde}),zpe=Hee({typed:yde}),jpe=soe({typed:yde}),$pe=s9({typed:yde}),Upe=Nre({BigNumber:que,Complex:Wue,config:w2,typed:yde}),Hpe=kte({format:Yde,typed:yde}),qpe=Jre({BigNumber:que,typed:yde}),Wpe=X5({Fraction:Xue,typed:yde}),Gpe=T5({typed:yde}),Ype=Z5({DenseMatrix:pde,Matrix:tde,SparseMatrix:ype,typed:yde}),Kpe=e9({isZero:tpe,matrix:Ype,typed:yde}),Xpe=wte({isNaN:Mpe,isNumeric:Gpe,typed:yde}),Jpe=Vte({bignumber:Dpe,fraction:Wpe,number:cpe}),Zpe=_te({config:w2,multiplyScalar:lpe,numeric:Jpe,typed:yde}),Qpe=Oee({isInteger:Zde,matrix:Ype,typed:yde}),efe=$ee({matrix:Ype,config:w2,typed:yde}),tfe=Zee({matrix:Ype,typed:yde}),nfe=C7({BigNumber:que,config:w2,matrix:Ype,typed:yde}),rfe=nte({BigNumber:que,config:w2,matrix:Ype,typed:yde}),ofe=Lre({Complex:Wue,config:w2,typed:yde}),afe=w9({BigNumber:que,Complex:Wue,Fraction:Xue,config:w2,isNegative:Qde,matrix:Ype,typed:yde,unaryMinus:$pe}),ife=eee({isInteger:Zde,matrix:Ype,typed:yde}),lfe=oee({prod:Zpe,size:efe,typed:yde}),sfe=ete({conj:Vde,transpose:tfe,typed:yde}),cfe=see({DenseMatrix:pde,SparseMatrix:ype,matrix:Ype,typed:yde}),ufe=Lte({numeric:Jpe,typed:yde}),dfe=Jte({DenseMatrix:pde,concat:ife,divideScalar:ufe,equalScalar:jde,matrix:Ype,typed:yde}),pfe=Tne({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),ffe=D5({isNumeric:Gpe,typed:yde}),hfe=bee({BigNumber:que,DenseMatrix:pde,SparseMatrix:ype,config:w2,matrix:Ype,typed:yde}),mfe=xee({matrix:Ype,multiplyScalar:lpe,typed:yde}),vfe=jne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),gfe=une({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),yfe=ene({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),bfe=o9({flatten:Wde,matrix:Ype,size:efe,typed:yde}),wfe=f7({BigNumber:que,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),xfe=Tee({BigNumber:que,config:w2,matrix:Ype,typed:yde}),Cfe=Hae({addScalar:Ede,complex:Bde,conj:Vde,divideScalar:ufe,equal:pfe,identity:hfe,isZero:tpe,matrix:Ype,multiplyScalar:lpe,sign:vpe,sqrt:Fpe,subtractScalar:Cpe,typed:yde,unaryMinus:$pe,zeros:rfe}),_fe=Bee({config:w2,matrix:Ype}),Efe=pne({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),Sfe=$te({BigNumber:que,DenseMatrix:pde,config:w2,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),kfe=Rne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),Tfe=w7({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,subtractScalar:Cpe,typed:yde,unaryMinus:$pe}),Nfe=Mte({concat:ife,matrix:Ype,typed:yde}),Dfe=u9({config:w2,numeric:Jpe,typed:yde}),Afe=nne({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),Ife=Z7({DenseMatrix:pde,concat:ife,matrix:Ype,typed:yde}),Rfe=Doe({DenseMatrix:pde,SparseMatrix:ype,addScalar:Ede,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Mfe=$re({BigNumber:que,DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Ofe=P7({concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Bfe=j7({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),Vfe=H7({DenseMatrix:pde,concat:ife,matrix:Ype,typed:yde}),Pfe=ase({addScalar:Ede,combinations:Ode,divideScalar:ufe,isInteger:Zde,isNegative:Qde,multiplyScalar:lpe,typed:yde}),Lfe=gne({BigNumber:que,DenseMatrix:pde,Fraction:Xue,concat:ife,config:w2,equalScalar:jde,matrix:Ype,typed:yde}),Ffe=Sne({concat:ife,matrix:Ype,typed:yde}),zfe=qie({add:Rfe,typed:yde,unaryPlus:Dfe}),jfe=Hne({equal:pfe,typed:yde}),$fe=kee({matrix:Ype,number:cpe,subtract:Tfe,typed:yde}),Ufe=jie({abs:wde,addScalar:Ede,deepEqual:jfe,divideScalar:ufe,multiplyScalar:lpe,sqrt:Fpe,subtractScalar:Cpe,typed:yde}),Hfe=Ooe({addScalar:Ede,conj:Vde,multiplyScalar:lpe,size:efe,typed:yde}),qfe=Ane({compareText:Ffe,isZero:tpe,typed:yde}),Wfe=z9({DenseMatrix:pde,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),Gfe=n7({BigNumber:que,DenseMatrix:pde,concat:ife,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),Yfe=Ioe({abs:wde,addScalar:Ede,divideScalar:ufe,isPositive:epe,multiplyScalar:lpe,smaller:kfe,sqrt:Fpe,typed:yde}),Kfe=ere({DenseMatrix:pde,smaller:kfe}),Xfe=tre({ImmutableDenseMatrix:Kfe,getMatrixDataType:Kde}),Jfe=Lne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),Zfe=Ute({Complex:Wue,config:w2,divideScalar:ufe,typed:yde}),Qfe=one({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),ehe=n9({flatten:Wde,matrix:Ype,size:efe,typed:yde}),the=Qne({config:w2,numeric:Jpe,smaller:kfe,typed:yde}),nhe=G9({DenseMatrix:pde,concat:ife,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),rhe=d7({addScalar:Ede,dot:Hfe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,typed:yde}),ohe=Gte({Complex:Wue,config:w2,divideScalar:ufe,typed:yde}),ahe=J7({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),ihe=Kne({compare:Lfe,isNaN:Mpe,isNumeric:Gpe,typed:yde}),lhe=hne({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde,zeros:rfe}),she=rie({SparseMatrix:ype,abs:wde,add:Rfe,divideScalar:ufe,larger:Jfe,largerEq:vfe,multiply:rhe,subtract:Tfe,transpose:tfe,typed:yde}),che=Wee({add:Rfe,matrix:Ype,typed:yde,zeros:rfe}),uhe=Uie({add:Rfe,config:w2,numeric:Jpe,typed:yde}),dhe=Boe({add:Rfe,matrix:Ype,typed:yde}),phe=ine({DenseMatrix:pde,divideScalar:ufe,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde}),fhe=Tse({Complex:Wue,add:Rfe,multiply:rhe,number:cpe,typed:yde}),hhe=T9({DenseMatrix:pde,config:w2,equalScalar:jde,matrix:Ype,round:Sfe,typed:yde,zeros:rfe}),mhe=Cne({compare:Lfe,typed:yde}),vhe=lse({addScalar:Ede,combinations:Ode,isInteger:Zde,isNegative:Qde,isPositive:epe,larger:Jfe,typed:yde}),ghe=iee({matrix:Ype,multiply:rhe,subtract:Tfe,typed:yde}),yhe=Cie({divideScalar:ufe,isZero:tpe,matrix:Ype,multiply:rhe,subtractScalar:Cpe,typed:yde,unaryMinus:$pe}),bhe=T7({concat:ife,equalScalar:jde,matrix:Ype,multiplyScalar:lpe,typed:yde}),whe=rre({larger:Jfe,smaller:kfe}),xhe=V9({Complex:Wue,DenseMatrix:pde,ceil:hhe,equalScalar:jde,floor:Wfe,matrix:Ype,typed:yde,zeros:rfe}),Che=Poe({Index:Xfe,typed:yde}),_he=$ie({abs:wde,add:Rfe,addScalar:Ede,config:w2,divideScalar:ufe,equalScalar:jde,flatten:Wde,isNumeric:Gpe,isZero:tpe,matrix:Ype,multiply:rhe,multiplyScalar:lpe,smaller:kfe,subtract:Tfe,typed:yde}),Ehe=E7({BigNumber:que,add:Rfe,config:w2,equal:pfe,isInteger:Zde,mod:nhe,smaller:kfe,typed:yde,xgcd:nfe}),She=o7({concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),khe=qte({Complex:Wue,config:w2,divideScalar:ufe,log:Zfe,typed:yde}),The=Zne({config:w2,larger:Jfe,numeric:Jpe,typed:yde}),Nhe=uoe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Dhe=hoe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Ahe=yoe({Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Ihe=Coe({Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Rhe=Bne({DenseMatrix:pde,concat:ife,config:w2,matrix:Ype,typed:yde}),Mhe=Jne({compare:Lfe,compareNatural:mhe,matrix:Ype,typed:yde}),Ohe=Wne({DenseMatrix:pde,concat:ife,config:w2,equalScalar:jde,matrix:Ype,typed:yde}),Bhe=mne({concat:ife,equalScalar:jde,matrix:Ype,not:spe,typed:yde,zeros:rfe}),Vhe=Ree({bignumber:Dpe,matrix:Ype,add:Rfe,config:w2,isPositive:epe,larger:Jfe,largerEq:vfe,smaller:kfe,smallerEq:Rhe,typed:yde}),Phe=zee({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),Lhe=poe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Fhe=woe({Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),zhe=koe({Index:Xfe,concat:ife,setDifference:Lhe,size:efe,subset:che,typed:yde}),jhe=ore({FibonacciHeap:whe,addScalar:Ede,equalScalar:jde}),$he=nee({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),Uhe=_ie({abs:wde,addScalar:Ede,det:yhe,divideScalar:ufe,identity:hfe,matrix:Ype,multiply:rhe,typed:yde,unaryMinus:$pe}),Hhe=Uae({DenseMatrix:pde,Spa:jhe,SparseMatrix:ype,abs:wde,addScalar:Ede,divideScalar:ufe,equalScalar:jde,larger:Jfe,matrix:Ype,multiplyScalar:lpe,subtractScalar:Cpe,typed:yde,unaryMinus:$pe}),qhe=Sie({Complex:Wue,add:Rfe,ctranspose:sfe,deepEqual:jfe,divideScalar:ufe,dot:Hfe,dotDivide:dfe,equal:pfe,inv:Uhe,matrix:Ype,multiply:rhe,typed:yde}),Whe=Fte({Complex:Wue,config:w2,fraction:Wpe,identity:hfe,inv:Uhe,matrix:Ype,multiply:rhe,number:cpe,typed:yde}),Ghe=voe({DenseMatrix:pde,Index:Xfe,compareNatural:mhe,size:efe,subset:che,typed:yde}),Yhe=Noe({Index:Xfe,concat:ife,setIntersect:Ghe,setSymDifference:zhe,size:efe,subset:che,typed:yde}),Khe=Rie({abs:wde,add:Rfe,identity:hfe,inv:Uhe,map:ipe,max:The,multiply:rhe,size:efe,sqrt:Fpe,subtract:Tfe,typed:yde}),Xhe=hre({BigNumber:que,Complex:Wue,Fraction:Xue,abs:wde,addScalar:Ede,config:w2,divideScalar:ufe,equal:pfe,fix:xhe,format:Yde,isNumeric:Gpe,multiplyScalar:lpe,number:cpe,pow:Whe,round:Sfe,subtractScalar:Cpe}),Jhe=nce({BigNumber:que,Unit:Xhe,config:w2}),Zhe=Pce({BigNumber:que,Unit:Xhe,config:w2}),Qhe=Sce({BigNumber:que,Unit:Xhe,config:w2}),eme=ace({BigNumber:que,Unit:Xhe,config:w2}),tme=Tce({BigNumber:que,Unit:Xhe,config:w2}),nme=ice({BigNumber:que,Unit:Xhe,config:w2}),rme=rce({BigNumber:que,Unit:Xhe,config:w2}),ome=yce({BigNumber:que,Unit:Xhe,config:w2}),ame=Kte({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,pow:Whe,typed:yde}),ime=tce({BigNumber:que,Unit:Xhe,config:w2}),lme=oce({BigNumber:que,Unit:Xhe,config:w2}),sme=Aie({abs:wde,add:Rfe,identity:hfe,inv:Uhe,multiply:rhe,typed:yde}),cme=Nce({BigNumber:que,Unit:Xhe,config:w2}),ume=rte({addScalar:Ede,ceil:hhe,conj:Vde,divideScalar:ufe,dotDivide:dfe,exp:Ude,i:Jue,log2:ape,matrix:Ype,multiplyScalar:lpe,pow:Whe,tau:cde,typed:yde}),dme=ple({BigNumber:que,Complex:Wue,config:w2,multiplyScalar:lpe,pow:Whe,typed:yde}),pme=Jse({BigNumber:que,Unit:Xhe,config:w2}),fme=vce({BigNumber:que,Unit:Xhe,config:w2}),hme=ate({conj:Vde,dotDivide:dfe,fft:ume,typed:yde}),mme=uce({BigNumber:que,Unit:Xhe,config:w2}),vme=Ace({BigNumber:que,Unit:Xhe,config:w2}),gme=ece({BigNumber:que,Unit:Xhe,config:w2}),yme=Lce({BigNumber:que,Unit:Xhe,config:w2}),bme=Rce({BigNumber:que,Unit:Xhe,config:w2}),wme=bce({BigNumber:que,Unit:Xhe,config:w2}),xme=cce({BigNumber:que,Unit:Xhe,config:w2}),Cme=Hce({BigNumber:que,Unit:Xhe,config:w2}),_me=jce({BigNumber:que,Unit:Xhe,config:w2}),Eme=qce({BigNumber:que,Unit:Xhe,config:w2}),Sme=gce({BigNumber:que,Unit:Xhe,config:w2}),kme=wce({BigNumber:que,Unit:Xhe,config:w2}),Tme=Qse({BigNumber:que,Unit:Xhe,config:w2}),Nme=xce({BigNumber:que,Unit:Xhe,config:w2}),Dme=Bce({BigNumber:que,Unit:Xhe,config:w2}),Ame=Xse({BigNumber:que,Unit:Xhe,config:w2}),Ime=Vce({BigNumber:que,Unit:Xhe,config:w2}),Rme=Cce({BigNumber:que,Unit:Xhe,config:w2}),Mme=kce({BigNumber:que,Unit:Xhe,config:w2}),Ome=dce({BigNumber:que,Unit:Xhe,config:w2}),Bme=wre({Unit:Xhe,typed:yde}),Vme=Fie({divideScalar:ufe,equalScalar:jde,inv:Uhe,matrix:Ype,multiply:rhe,typed:yde}),Pme=fce({BigNumber:que,Unit:Xhe,config:w2}),Lme=vle({gamma:dme,typed:yde}),Fme=Dce({BigNumber:que,Unit:Xhe,config:w2}),zme=zce({BigNumber:que,Unit:Xhe,config:w2}),jme=lce({BigNumber:que,Unit:Xhe,config:w2}),$me=lie({DenseMatrix:pde,lsolve:yfe,lup:Hhe,matrix:Ype,slu:she,typed:yde,usolve:Afe}),Ume=sce({BigNumber:que,Unit:Xhe,config:w2}),Hme=Fce({BigNumber:que,Unit:Xhe,config:w2}),qme=wle({add:Rfe,divide:Vme,factorial:Lme,isInteger:Zde,isPositive:epe,multiply:rhe,typed:yde}),Wme=Cle({factorial:Lme,typed:yde}),Gme=$ce({BigNumber:que,Unit:Xhe,config:w2}),Yme=uie({add:Rfe,cbrt:afe,divide:Vme,equalScalar:jde,im:Jde,isZero:tpe,multiply:rhe,re:hpe,sqrt:Fpe,subtract:Tfe,typeOf:Epe,typed:yde,unaryMinus:$pe}),Kme=Eoe({compareNatural:mhe,typed:yde}),Xme=ute({abs:wde,add:Rfe,bignumber:Dpe,divide:Vme,isNegative:Qde,isPositive:epe,larger:Jfe,map:ipe,matrix:Ype,max:The,multiply:rhe,smaller:kfe,subtract:Tfe,typed:yde,unaryMinus:$pe}),Jme=tse({bignumber:Dpe,addScalar:Ede,combinations:Ode,divideScalar:ufe,factorial:Lme,isInteger:Zde,isNegative:Qde,larger:Jfe,multiplyScalar:lpe,number:cpe,pow:Whe,subtractScalar:Cpe,typed:yde}),Zme=vre({Unit:Xhe,typed:yde}),Qme=rse({addScalar:Ede,isInteger:Zde,isNegative:Qde,stirlingS2:Jme,typed:yde}),eve=Nie({abs:wde,add:Rfe,addScalar:Ede,atan:Nde,bignumber:Dpe,column:$he,complex:Bde,config:w2,cos:Pde,diag:cfe,divideScalar:ufe,dot:Hfe,equal:pfe,flatten:Wde,im:Jde,inv:Uhe,larger:Jfe,matrix:Ype,matrixFromColumns:bfe,multiply:rhe,multiplyScalar:lpe,number:cpe,qr:Cfe,re:hpe,reshape:Qpe,sin:gpe,size:efe,smaller:kfe,sqrt:Fpe,subtract:Tfe,typed:yde,usolve:Afe,usolveAll:phe}),tve=hce({BigNumber:que,Unit:Xhe,config:w2}),nve=Ice({BigNumber:que,Unit:Xhe,config:w2}),rve=yle({divide:Vme,dotDivide:dfe,isNumeric:Gpe,log:Zfe,map:ipe,matrix:Ype,multiply:rhe,sum:uhe,typed:yde}),ove=Gie({add:Rfe,divide:Vme,typed:yde}),ave=Mce({BigNumber:que,Unit:Xhe,config:w2}),ive=Zse({BigNumber:que,Unit:Xhe,config:w2}),lve=tle({bignumber:Dpe,add:Rfe,compare:Lfe,divide:Vme,isInteger:Zde,larger:Jfe,multiply:rhe,partitionSelect:ihe,smaller:kfe,smallerEq:Rhe,subtract:Tfe,typed:yde}),sve=Qie({add:Rfe,apply:Tpe,divide:Vme,isNaN:Mpe,multiply:rhe,subtract:Tfe,typed:yde}),cve=pce({BigNumber:que,Unit:Xhe,config:w2}),uve=Kie({add:Rfe,compare:Lfe,divide:Vme,partitionSelect:ihe,typed:yde}),dve=ole({add:Rfe,divide:Vme,matrix:Ype,mean:ove,multiply:rhe,pow:Whe,sqrt:Fpe,subtract:Tfe,sum:uhe,typed:yde}),pve=Dse({Complex:Wue,add:Rfe,divide:Vme,matrix:Ype,multiply:rhe,typed:yde}),fve=Xie({abs:wde,map:ipe,median:uve,subtract:Tfe,typed:yde}),hve=nle({map:ipe,sqrt:Fpe,typed:yde,variance:sve}),mve=yte({BigNumber:que,Complex:Wue,add:Rfe,config:w2,divide:Vme,equal:pfe,factorial:Lme,gamma:dme,isNegative:Qde,multiply:rhe,pi:mde,pow:Whe,sin:gpe,smallerEq:Rhe,subtract:Tfe,typed:yde}),vve=Moe({abs:wde,add:Rfe,conj:Vde,ctranspose:sfe,eigs:eve,equalScalar:jde,larger:Jfe,matrix:Ype,multiply:rhe,pow:Whe,smaller:kfe,sqrt:Fpe,typed:yde}),gve=Fee({BigNumber:que,DenseMatrix:pde,SparseMatrix:ype,addScalar:Ede,config:w2,cos:Pde,matrix:Ype,multiplyScalar:lpe,norm:vve,sin:gpe,typed:yde,unaryMinus:$pe}),yve=Uce({BigNumber:que,Unit:Xhe,config:w2}),bve=Vie({identity:hfe,matrix:Ype,multiply:rhe,norm:vve,qr:Cfe,subtract:Tfe,typed:yde}),wve=Pee({multiply:rhe,rotationMatrix:gve,typed:yde}),xve=Oie({abs:wde,add:Rfe,concat:ife,identity:hfe,index:Che,lusolve:$me,matrix:Ype,matrixFromColumns:bfe,multiply:rhe,range:Vhe,schur:bve,subset:che,subtract:Tfe,transpose:tfe,typed:yde}),Cve=Lie({matrix:Ype,multiply:rhe,sylvester:xve,transpose:tfe,typed:yde}),_ve={},Eve={},Sve={},kve=Foe({mathWithTransform:Eve}),Tve=xae({Node:kve}),Nve=Eae({Node:kve}),Dve=kae({Node:kve}),Ave=Aae({Node:kve}),Ive=qoe({Node:kve}),Rve=eae({Node:kve,ResultSet:ide}),Mve=nae({Node:kve}),Ove=mae({Node:kve}),Bve=Nae({Node:kve}),Vve=Ase({classes:Sve}),Pve=hie({math:_ve,typed:yde}),Lve=gae({Node:kve,typed:yde}),Fve=xie({Chain:Pve,typed:yde}),zve=bae({Node:kve,size:efe}),jve=Uoe({Node:kve,subset:che}),$ve=Zoe({matrix:Ype,Node:kve,subset:che}),Uve=Iae({Unit:Xhe,Node:kve,math:_ve}),Hve=Mae({Node:kve,SymbolNode:Uve,math:_ve}),qve=Bae({AccessorNode:jve,ArrayNode:Ive,AssignmentNode:$ve,BlockNode:Rve,ConditionalNode:Mve,ConstantNode:Ove,FunctionAssignmentNode:Lve,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,RangeNode:Bve,RelationalNode:Ave,SymbolNode:Uve,config:w2,numeric:Jpe,typed:yde}),Wve=bse({ConstantNode:Ove,FunctionNode:Hve,OperatorNode:Nve,ParenthesisNode:Dve,parse:qve,typed:yde}),Gve=vse({bignumber:Dpe,fraction:Wpe,AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,SymbolNode:Uve,config:w2,mathWithTransform:Eve,matrix:Ype,typed:yde}),Yve=Pae({parse:qve,typed:yde}),Kve=yse({AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,add:Rfe,divide:Vme,equal:pfe,isZero:tpe,multiply:rhe,parse:qve,pow:Whe,subtract:Tfe,typed:yde}),Xve=Fae({parse:qve,typed:yde}),Jve=pie({evaluate:Xve}),Zve=zae({evaluate:Xve}),Qve=mse({bignumber:Dpe,fraction:Wpe,AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,add:Rfe,config:w2,divide:Vme,equal:pfe,isZero:tpe,mathWithTransform:Eve,matrix:Ype,multiply:rhe,parse:qve,pow:Whe,resolve:Wve,simplifyConstant:Gve,simplifyCore:Kve,subtract:Tfe,typed:yde}),ege=xse({OperatorNode:Nve,parse:qve,simplify:Qve,typed:yde}),tge=cse({parse:qve,typed:yde}),nge=$ae({Parser:Zve,typed:yde}),rge=Sse({bignumber:Dpe,fraction:Wpe,AccessorNode:jve,ArrayNode:Ive,ConstantNode:Ove,FunctionNode:Hve,IndexNode:zve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,add:Rfe,config:w2,divide:Vme,equal:pfe,isZero:tpe,mathWithTransform:Eve,matrix:Ype,multiply:rhe,parse:qve,pow:Whe,simplify:Qve,simplifyConstant:Gve,simplifyCore:Kve,subtract:Tfe,typed:yde}),oge=_se({ConstantNode:Ove,FunctionNode:Hve,OperatorNode:Nve,ParenthesisNode:Dve,SymbolNode:Uve,config:w2,equal:pfe,isZero:tpe,numeric:Jpe,parse:qve,simplify:Qve,typed:yde}),age=bie({Help:Jve,mathWithTransform:Eve,typed:yde});h1(_ve,{e:Gue,false:Yue,fineStructure:Kue,i:Jue,Infinity:Zue,LN10:Que,LOG10E:ede,NaN:nde,null:rde,phi:ode,SQRT1_2:lde,sackurTetrode:sde,tau:cde,true:ude,E:Gue,version:dde,efimovFactor:fde,LN2:hde,pi:mde,replacer:vde,reviver:Vve,SQRT2:gde,typed:yde,PI:mde,weakMixingAngle:bde,abs:wde,acos:xde,acot:Cde,acsc:_de,addScalar:Ede,arg:Sde,asech:kde,asinh:Tde,atan:Nde,atanh:Dde,bigint:Ade,bitNot:Ide,boolean:Rde,clone:Mde,combinations:Ode,complex:Bde,conj:Vde,cos:Pde,cot:Lde,csc:Fde,cube:zde,equalScalar:jde,erf:$de,exp:Ude,expm1:Hde,filter:qde,flatten:Wde,forEach:Gde,format:Yde,getMatrixDataType:Kde,hex:Xde,im:Jde,isInteger:Zde,isNegative:Qde,isPositive:epe,isZero:tpe,LOG2E:npe,lgamma:rpe,log10:ope,log2:ape,map:ipe,multiplyScalar:lpe,not:spe,number:cpe,oct:upe,pickRandom:dpe,print:ppe,random:fpe,re:hpe,sec:mpe,sign:vpe,sin:gpe,splitUnit:bpe,square:wpe,string:xpe,subtractScalar:Cpe,tan:_pe,typeOf:Epe,acosh:Spe,acsch:kpe,apply:Tpe,asec:Npe,bignumber:Dpe,chain:Fve,combinationsWithRep:Ape,cosh:Ipe,csch:Rpe,isNaN:Mpe,isPrime:Ope,randomInt:Bpe,sech:Vpe,sinh:Ppe,sparse:Lpe,sqrt:Fpe,squeeze:zpe,tanh:jpe,unaryMinus:$pe,acoth:Upe,bin:Hpe,coth:qpe,fraction:Wpe,isNumeric:Gpe,matrix:Ype,matrixFromFunction:Kpe,mode:Xpe,numeric:Jpe,prod:Zpe,reshape:Qpe,size:efe,transpose:tfe,xgcd:nfe,zeros:rfe,asin:ofe,cbrt:afe,concat:ife,count:lfe,ctranspose:sfe,diag:cfe,divideScalar:ufe,dotDivide:dfe,equal:pfe,hasNumericValue:ffe,identity:hfe,kron:mfe,largerEq:vfe,leftShift:gfe,lsolve:yfe,matrixFromColumns:bfe,nthRoot:wfe,ones:xfe,qr:Cfe,resize:_fe,rightArithShift:Efe,round:Sfe,smaller:kfe,subtract:Tfe,to:Nfe,unaryPlus:Dfe,usolve:Afe,xor:Ife,add:Rfe,atan2:Mfe,bitAnd:Ofe,bitOr:Bfe,bitXor:Vfe,catalan:Pfe,compare:Lfe,compareText:Ffe,cumsum:zfe,deepEqual:jfe,diff:$fe,distance:Ufe,dot:Hfe,equalText:qfe,floor:Wfe,gcd:Gfe,hypot:Yfe,larger:Jfe,log:Zfe,lsolveAll:Qfe,matrixFromRows:ehe,min:the,mod:nhe,multiply:rhe,nthRoots:ohe,or:ahe,partitionSelect:ihe,rightLogShift:lhe,slu:she,subset:che,sum:uhe,trace:dhe,usolveAll:phe,zpk2tf:fhe,ceil:hhe,compareNatural:mhe,composition:vhe,cross:ghe,det:yhe,dotMultiply:bhe,fix:xhe,index:Che,intersect:_he,invmod:Ehe,lcm:She,log1p:khe,max:The,setCartesian:Nhe,setDistinct:Dhe,setIsSubset:Ahe,setPowerset:Ihe,smallerEq:Rhe,sort:Mhe,unequal:Ohe,and:Bhe,range:Vhe,row:Phe,setDifference:Lhe,setMultiplicity:Fhe,setSymDifference:zhe,column:$he,inv:Uhe,lup:Hhe,pinv:qhe,pow:Whe,setIntersect:Ghe,setUnion:Yhe,sqrtm:Khe,vacuumImpedance:Jhe,wienDisplacement:Zhe,atomicMass:Qhe,bohrMagneton:eme,boltzmann:tme,conductanceQuantum:nme,coulomb:rme,deuteronMass:ome,dotPow:ame,electricConstant:ime,elementaryCharge:lme,expm:sme,faraday:cme,fft:ume,gamma:dme,gravitationConstant:pme,hartreeEnergy:fme,ifft:hme,klitzing:mme,loschmidt:vme,magneticConstant:gme,molarMass:yme,molarPlanckConstant:bme,neutronMass:wme,nuclearMagneton:xme,planckCharge:Cme,planckLength:_me,planckTemperature:Eme,protonMass:Sme,quantumOfCirculation:kme,reducedPlanckConstant:Tme,rydberg:Nme,secondRadiation:Dme,speedOfLight:Ame,stefanBoltzmann:Ime,thomsonCrossSection:Rme,avogadro:Mme,bohrRadius:Ome,createUnit:Bme,divide:Vme,electronMass:Pme,factorial:Lme,firstRadiation:Fme,gravity:zme,inverseConductanceQuantum:jme,lusolve:$me,magneticFluxQuantum:Ume,molarMassC12:Hme,multinomial:qme,parse:qve,permutations:Wme,planckMass:Gme,polynomialRoot:Yme,resolve:Wve,setSize:Kme,simplifyConstant:Gve,solveODE:Xme,stirlingS2:Jme,unit:Zme,bellNumbers:Qme,compile:Yve,eigs:eve,fermiCoupling:tve,gasConstant:nve,kldivergence:rve,mean:ove,molarVolume:ave,planckConstant:ive,quantileSeq:lve,simplifyCore:Kve,variance:sve,classicalElectronRadius:cve,evaluate:Xve,median:uve,simplify:Qve,symbolicEqual:ege,corr:dve,freqz:pve,leafCount:tge,mad:fve,parser:nge,rationalize:rge,std:hve,zeta:mve,derivative:oge,norm:vve,rotationMatrix:gve,help:age,planckTime:yve,schur:bve,rotate:wve,sylvester:xve,lyap:Cve,config:w2}),h1(Eve,_ve,{filter:Jce({typed:yde}),forEach:Qce({typed:yde}),map:tue({typed:yde}),apply:Yce({isInteger:Zde,typed:yde}),or:zue({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),and:Lue({add:Rfe,concat:ife,equalScalar:jde,matrix:Ype,not:spe,typed:yde,zeros:rfe}),concat:yue({isInteger:Zde,matrix:Ype,typed:yde}),max:iue({config:w2,larger:Jfe,numeric:Jpe,typed:yde}),print:Vue({add:Rfe,matrix:Ype,typed:yde,zeros:rfe}),bitAnd:$ue({add:Rfe,concat:ife,equalScalar:jde,matrix:Ype,not:spe,typed:yde,zeros:rfe}),diff:xue({bignumber:Dpe,matrix:Ype,number:cpe,subtract:Tfe,typed:yde}),min:uue({config:w2,numeric:Jpe,smaller:kfe,typed:yde}),subset:vue({add:Rfe,matrix:Ype,typed:yde,zeros:rfe}),bitOr:Hue({DenseMatrix:pde,concat:ife,equalScalar:jde,matrix:Ype,typed:yde}),cumsum:Aue({add:Rfe,typed:yde,unaryPlus:Dfe}),index:eue({Index:Xfe,getMatrixDataType:Kde}),sum:Sue({add:Rfe,config:w2,numeric:Jpe,typed:yde}),range:pue({bignumber:Dpe,matrix:Ype,add:Rfe,config:w2,isPositive:epe,larger:Jfe,largerEq:vfe,smaller:kfe,smallerEq:Rhe,typed:yde}),row:hue({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),column:Kce({Index:Xfe,matrix:Ype,range:Vhe,typed:yde}),mean:sue({add:Rfe,divide:Vme,typed:yde}),quantileSeq:Tue({add:Rfe,bignumber:Dpe,compare:Lfe,divide:Vme,isInteger:Zde,larger:Jfe,multiply:rhe,partitionSelect:ihe,smaller:kfe,smallerEq:Rhe,subtract:Tfe,typed:yde}),variance:Mue({add:Rfe,apply:Tpe,divide:Vme,isNaN:Mpe,multiply:rhe,subtract:Tfe,typed:yde}),std:_ue({map:ipe,sqrt:Fpe,typed:yde,variance:sve})}),h1(Sve,{BigNumber:que,Complex:Wue,Fraction:Xue,Matrix:tde,Node:kve,ObjectNode:Tve,OperatorNode:Nve,ParenthesisNode:Dve,Range:ade,RelationalNode:Ave,ResultSet:ide,ArrayNode:Ive,BlockNode:Rve,ConditionalNode:Mve,ConstantNode:Ove,DenseMatrix:pde,RangeNode:Bve,Chain:Pve,FunctionAssignmentNode:Lve,SparseMatrix:ype,IndexNode:zve,ImmutableDenseMatrix:Kfe,Index:Xfe,AccessorNode:jve,AssignmentNode:$ve,FibonacciHeap:whe,Spa:jhe,Unit:Xhe,SymbolNode:Uve,FunctionNode:Hve,Help:Jve,Parser:Zve}),Pve.createProxy(_ve);const ige=n.ref(2);function lge(e,t){const n=t.filter(pge);let r=Dpe(n[0]);for(let o=1;o<n.length;o++){const t=n[o];r=r[e](t)}return Number.parseFloat(String(r)).toFixed(ige.value??0)}function sge(e,t){const n=t.filter(pge);let r=Dpe(n[0]);for(let o=1;o<n.length;o++){const t=n[o];r=r[e](t)}return Number.parseFloat(String(r))}function cge(e,t=-1,n=14){const r=-1==t?ige.value:t;let o=e||0;"number"!=typeof o&&(o=Xve(o)),o=Yde(o,{precision:n});let a=o?Number(o):0,i=JSON.stringify(a);const l=i.indexOf(".");if(l>=0){i=i.substring(l+1);const e=i.length;if(e>8){a+=Number("0."+new Array(e-1).join("0")+"1")}if(e>t){if("5"===i.slice(t,t+1)){a+=Number("0."+new Array(t+1).join("0")+"1")}}}return Number.parseFloat(String(o)).toFixed(r)}function uge(e){return e.filter((e=>dge(e)))}function dge(e){return"number"==typeof e&&![NaN,1/0,-1/0].includes(e)}function pge(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function fge(e){let t,n,r,o=new Array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖"),a=new Array("","拾","佰","仟"),i=new Array("","万","亿","兆"),l=new Array("角","分","毫","厘"),s="";if(""===e||null===e)return"";if("string"==typeof e&&(e=parseFloat(e)),e>=1e15)return"";if(0==e)return s=o[0]+"元整",s;if(-1==(e=e.toString()).indexOf(".")?(t=e,n=""):(r=e.split("."),t=r[0],n=r[1].substr(0,4)),parseInt(t,10)>0){let e=0,n=t.length;for(let r=0;r<n;r++){let l=t.substr(r,1),c=n-r-1,u=c/4,d=c%4;"0"==l?e++:(e>0&&(s+=o[0]),e=0,s+=o[parseInt(l)]+a[d]),0==d&&e<4&&(s+=i[u])}s+="元"}if(""!=n){let e=n.length;for(let t=0;t<e;t++){let e=n.substr(t,1);"0"!=e&&(s+=o[Number(e)]+l[t])}}return""==s?s+=o[0]+"元整":""==n&&(s+="整"),s}function hge(e){const t=new URLSearchParams(e||location.search.substring(1));return[...t.keys()].reduce(((e,n)=>{if(""==n)return e;let r=t.get(n);return/^\d+$/.test(r)&&r.length<17&&(r=Number(r)),"true"!=r&&"false"!=r||(r="true"==r),e[n]=r,e}),{})}function mge(e,t={}){if(U.isEmpty(t))return e;const[n,r=""]=e.split("?"),o=new URLSearchParams(r);return Object.keys(t).forEach((e=>{o.set(e,t[e])})),`${n}?${o.toString()}`}let vge=n.ref(),gge=n.ref(),yge=n.ref(),bge=n.ref();const wge="configkey",xge=e=>{if(!e)return e;if(1==gge.value)return U.cloneDeep(e);try{return pG.AES.encrypt(JSON.stringify(e),wge).toString()}catch(HT){return e}},Cge=e=>{if(!e)return e;if(1==gge.value)return e;try{const t=pG.AES.decrypt(e,wge);return JSON.parse(t.toString(pG.enc.Utf8))}catch(HT){return e}},_ge={encrypt:xge,decrypt:Cge},Ege={setKey:e=>`${vge.value?vge.value:"hs-admin-ui"}:${e}`,set(e,t){window.localStorage.setItem(Ege.setKey(e),JSON.stringify(t))},get(e){let t=window.localStorage.getItem(Ege.setKey(e));return t?JSON.parse(t):null},remove(e){window.localStorage.removeItem(Ege.setKey(e))},clear(){window.localStorage.clear()}},Sge={set(e,t){if("token"===e)return xq.set(e,t);window.sessionStorage.setItem(Ege.setKey(e),JSON.stringify(t))},get(e){if("token"===e)return xq.get(e);let t=window.sessionStorage.getItem(Ege.setKey(e));return t?JSON.parse(t):null},remove(e){if("token"===e)return xq.remove(e);window.sessionStorage.removeItem(Ege.setKey(e))},clear(){xq.remove("token"),window.sessionStorage.clear()}};const kge=new class{constructor(){t(this,"store"),this.store=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:"systemConfig_00000_001",storeName:"systemConfig",version:1,description:"系统信息"})}setKey(e){return`${vge.value?vge.value:"hs-admin-ui"}:${e}`}set(e,t){return this.store.setItem(this.setKey(e),xge(t))}get(e){return this.store.getItem(this.setKey(e)).then((e=>Cge(e)))}async getToken(){return this.getUserByProject().then((e=>null==e?void 0:e.access_token))}getUserByProject(e){var t;const n=vge.value?vge.value:"hs-admin-ui",r=e||(null==(t=hge())?void 0:t.project),o=r?`hs-${r}-web`:n;return this.store.getItem(`${o}:userInfo`).then((e=>Cge(e)))}remove(e){return this.store.removeItem(this.setKey(e))}clear(){return this.store.clear()}drop(e){return this.store.dropInstance({name:e})}};function Tge({mid:e,id:t,uid:n},r=""){const o=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((async a=>{const i=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${n||a.id}_${e}`,version:1,description:"配置系统"}),l=r?`${o}:${r}`:`${o}:${t}`,s=await i.getItem(l);return s?Cge(s):null}))}function Nge({mid:e,id:t,uid:n},r,o=""){const a=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((i=>{const l=`${n||i.id}_${e}`,s=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:l,version:1,description:"配置系统"}),c=o?`${a}:${o}`:`${a}:${t}`;return s.setItem(c,xge(r))}))}function Dge(e,t){return kge.get("userInfo").then((n=>Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||n.id}_${e}`,version:1,description:"配置系统"}).clear()))}function Age({table_id:e,uid:t}){const n=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((async r=>{const o=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||r.id}`,version:1,description:"配置系统列宽属性"}),a=`${n}:${e}`,i=await o.getItem(a);return i?Cge(i):null}))}function Ige({table_id:e,uid:t},n){const r=vge.value?vge.value:"hs-admin-ui";return kge.get("userInfo").then((o=>{const a=`${t||o.id}`,i=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:a,version:1,description:"配置系统列宽属性"}),l=`${r}:${e}`;return i.setItem(l,xge(n))}))}function Rge(e=["systemConfig_00000_001","emscripten_filesystem"]){return indexedDB.databases().then((function(t){return Promise.all(t.filter((t=>!e.includes(t.name))).map((e=>kge.drop(e.name)))).then((()=>{zj.success("清除缓存成功!")}))}))}async function Mge(e){const t=await kge.get("system_params")||{},n=e.find((e=>"sys_input_8"===e.param_code));n&&(ige.value=Number(n.param_value),t.decimal_digits=Number(n.param_value));const r=e.find((e=>"sys_input_10"===e.param_code));r&&(t._sys_pageSize=Number(r.param_value),t._sys_pageSize_s=JSON.parse(r.json_data||"[]").map((e=>Number(e.value)))),await kge.set("system_params",t)}function Oge(e,t){const n=e||hge().mid;return n?kge.get("userInfo").then((async e=>{const r=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||e.id}_${n}`,version:1,description:"配置系统"}),o=vge.value?vge.value:"hs-admin-ui",a=await r.getItem(`${o}:auth`);if(!a)return{};return Cge(a).dict_functions.map((e=>{const t=JSON.parse(e.json_data||"[]").filter((e=>["true",!0].includes(e.show))).map((e=>({...e,name:e.dict_child_name,code:e.dict_child_code}))).sort(((e,t)=>e.sort-t.sort));return{code:e.code,json_data:t}})).reduce(((e,t)=>(e[t.code]=t.json_data,e)),{})})):(console.error("未获取到mid,请检查url中是否存在mid参数"),Promise.resolve({}))}function Bge(e,t){const n=e||hge().mid;return n?kge.get("userInfo").then((async e=>{const r=Eq.createInstance({driver:[Eq.INDEXEDDB,Eq.WEBSQL,Eq.LOCALSTORAGE],name:`${t||e.id}_${n}`,version:1,description:"配置系统"}),o=vge.value?vge.value:"hs-admin-ui",a=await r.getItem(`${o}:auth`);if(!a)return{};return Cge(a).field_functions})):(console.error("未获取到mid,请检查url中是否存在mid参数"),Promise.resolve({}))}const Vge=r.createPinia(),Pge=r.defineStore("requestOldRoutes",{state:()=>({requestOldRoutes:[]}),actions:{async setRequestOldRoutes(e){this.requestOldRoutes=e}}}),Lge={start:()=>{const e=document.body,t=document.createElement("div");t.setAttribute("class","loading-next");t.innerHTML='\n\t\t\t<div class="loading-next-box">\n\t\t\t\t<div class="loading-next-box-warp">\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t\t<div class="loading-next-box-item"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t',e.insertBefore(t,e.childNodes[0]),window.nextLoading=!0},done:(e=0)=>{n.nextTick((()=>{setTimeout((()=>{var e;window.nextLoading=!1;const t=document.querySelector(".loading-next");null==(e=null==t?void 0:t.parentNode)||e.removeChild(t)}),e)}))}},Fge=[{path:"/",name:"/",component:()=>Promise.resolve().then((()=>require("./index-CGLfN47i.js"))),redirect:"/home",meta:{isKeepAlive:!0},children:[]}],zge=[{path:"/:path(.*)*",name:"notFound",component:()=>Promise.resolve().then((()=>require("./404-BktDbggf.js"))),meta:{title:"找不到此页面",isHide:!0}},{path:"/401",name:"noPower",component:()=>Promise.resolve().then((()=>require("./401--ngJ_50u.js"))),meta:{title:"没有权限",isHide:!0}}],jge=[{path:"/login",name:"login",component:()=>Promise.resolve().then((()=>require("./index-Dzp_gx2r.js"))),meta:{title:"登录"}}];var $ge={exports:{}};
68
68
  /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
69
- * @license MIT */$ge.exports=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function o(e,t,n){return e<t?t:e>n?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){s(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0===--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),l=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&f(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n}();const Uge=P($ge.exports),Hge=r.defineStore("keepALiveNames",{state:()=>({keepAliveNames:[],cachedViews:[]}),actions:{async setCacheKeepAlive(e){this.keepAliveNames=e},async addCachedView(e){var t;e.meta.isKeepAlive&&(null==(t=this.cachedViews)||t.push(e.name)),this.cachedViews=[...new Set(this.cachedViews)]},async delCachedView(e){const t=this.cachedViews.indexOf(e.name);t>-1&&this.cachedViews.splice(t,1)},async delOthersCachedViews(e){e.meta.isKeepAlive?this.cachedViews=[e.name]:this.cachedViews=[]},async delAllCachedViews(){this.cachedViews=[]}}}),qge=r.defineStore("routesList",{state:()=>({routesList:[],isColumnsMenuHover:!1,isColumnsNavHover:!1}),actions:{async setRoutesList(e){this.routesList=e},async setColumnsMenuHover(e){this.isColumnsMenuHover=e},async setColumnsNavHover(e){this.isColumnsNavHover=e}}}),Wge=r.defineStore("themeConfig",{state:()=>({themeConfig:{isDrawer:!1,primary:"#409eff",isIsDark:!1,topBar:"#ffffff",topBarColor:"#606266",isTopBarColorGradual:!1,menuBar:"#545c64",menuBarColor:"#eaeaea",menuBarActiveColor:"rgba(0, 0, 0, 0.2)",isMenuBarColorGradual:!1,columnsMenuBar:"#545c64",columnsMenuBarColor:"#e6e6e6",isColumnsMenuBarColorGradual:!1,isColumnsMenuHoverPreload:!1,isCollapse:!1,isUniqueOpened:!0,isFixedHeader:!0,isFixedHeaderChange:!1,isClassicSplitMenu:!1,isLockScreen:!1,lockScreenTime:30,isShowLogo:!0,isShowLogoChange:!1,isBreadcrumb:!0,isTagsview:!0,isBreadcrumbIcon:!1,isTagsviewIcon:!1,isCacheTagsView:!1,isSortableTagsView:!0,isShareTagsView:!0,isFooter:!1,isWartermark:!1,wartermarkText:"",tagsStyle:"tags-style-five",animation:"slide-right",columnsAsideStyle:"columns-round",columnsAsideLayout:"columns-vertical",layout:"defaults",isRequestRoutes:!0,globalTitle:"华速前端框架",globalViceTitle:"vue3 + typescript5 + vite5 的框架",globalViceTitleMsg:"hs-admin",globalI18n:"zh-cn",globalComponentSize:"default"}}),actions:{setThemeConfig(e){const{globalTitle:t,globalViceTitle:n,globalViceTitleMsg:r}=this.themeConfig;this.themeConfig={...e.themeConfig,globalTitle:t,globalViceTitle:n,globalViceTitleMsg:r}}}}),Gge=r.defineStore("tagsViewRoutes",{state:()=>({tagsViewRoutes:[],isTagsViewCurrenFull:!1}),actions:{async setTagsViewRoutes(e){this.tagsViewRoutes=e},setCurrenFullscreen(e){Sge.set("isTagsViewCurrenFull",e),this.isTagsViewCurrenFull=e}}});function Yge(e,t){const n=[];return e.forEach((e=>{const r={...e};(function(e,t){return!t.meta||!t.meta.roles||e.some((e=>t.meta.roles.includes(e)))})(t,r)&&(r.children&&(r.children=Yge(r.children,t)),n.push(r))})),n}function Kge(e){const t=Sye(Vge),{userInfos:n}=r.storeToRefs(t);let o=[];return e.forEach((e=>{e.meta.roles&&e.meta.roles.forEach((t=>{n.value.roles.forEach((n=>{t===n&&o.push({...e})}))}))})),o}async function Xge(){await function(){let e=oye(rye(Fge));return e[0].children=[...Kge(e[0].children),...zge],e}().forEach((e=>{console.debug("后端路由信息:",e),nye.addRoute(e)}))}function Jge(){const e=Sye(Vge),t=qge(Vge),{userInfos:n}=r.storeToRefs(e);t.setRoutesList(Yge(Fge[0].children,n.value.roles)),function(){const e=Sye(Vge),t=Gge(Vge),{userInfos:n}=r.storeToRefs(e);let o=Yge(Fge,n.value.roles);t.setTagsViewRoutes(oye(rye(o))[0].children)}()}const Zge=Wge(Vge),Qge=Hge(Vge),{themeConfig:eye}=r.storeToRefs(Zge),{isRequestRoutes:tye}=eye.value,nye=o.createRouter({history:o.createWebHistory("/"),routes:[...zge,...jge]});function rye(e){if(e.length<=0)return!1;for(let t=0;t<e.length;t++)e[t].children&&(e=e.slice(0,t+1).concat(e[t].children,e.slice(t+1)));return e}function oye(e){if(e.length<=0)return!1;const t=[],n=[];return e.forEach((e=>{"/"===e.path?t.push({component:e.component,name:e.name,path:e.path,redirect:e.redirect,meta:e.meta,children:[]}):(e.path.indexOf("/:")>-1&&(e.meta.isDynamic=!0,e.meta.isDynamicPath=e.path),t[0].children.push({...e}),t[0].meta.isKeepAlive&&e.meta.isKeepAlive&&n.push(e.name))})),Qge.setCacheKeepAlive(n),t}nye.beforeEach((async(e,t,n)=>{Uge.configure({showSpinner:!1}),e.meta.title&&Uge.start();const o=Sye(),a=await o.isLogin();if(await Qge.addCachedView(e),"/login"!==e.path||a)if(a)if(a&&"/login"===e.path)n("/"),Uge.done();else{const t=qge(Vge),{routesList:o}=r.storeToRefs(t);0===o.value.length?tye?(await wye(),n({path:e.path,query:e.query})):(await async function(){void 0===window.nextLoading&&Lge.start();const e=Sye();if(!(await e.isLogin()))return!1;await Xge(),Jge()}(),n({path:e.path,query:e.query})):n()}else n(`/login?redirect=${e.path}&params=${JSON.stringify(e.query?e.query:e.params)}`),Uge.done();else n(),Uge.done()})),nye.afterEach((()=>{Uge.done()}));const aye=(e,t)=>Object.assign(e,{other_log_info:{title:t}}),iye=(e={})=>(e=aye(e,"新增菜单"),p1({url:"/scmp-web/pri/menu/add_menu",method:"post",data:e})),lye=(e={})=>(e=aye(e,"根据id,删除菜单"),p1({url:"/scmp-web/pri/menu/del_menu_info",method:"post",data:e})),sye=(e={})=>(e=aye(e,"获取所有菜单id集合"),p1({url:"/scmp-web/pri/menu/get_all_menu_id_list",method:"get",params:e})),cye=(e={})=>(e=aye(e,"获取所有菜单列表"),p1({url:"/scmp-web/pri/menu/get_all_menu_list",method:"get",params:e})),uye=(e={})=>(e=aye(e,"获取当前用户菜单列表(树形)"),p1({url:"/scmp-web/pri/menu/get_menu_list",method:"get",params:e})),dye=(e={})=>(e=aye(e,"获取一级菜单信息"),p1({url:"/scmp-web/pri/menu/get_menu_list_one",method:"get",params:e})),pye=(e={})=>(e=aye(e,"设置菜单页面配置项,按钮和字典数据"),p1({url:"/scmp-web/pri/menu/set_menu_config",method:"post",data:e})),fye=(e={})=>(e=aye(e,"更新菜单"),p1({url:"/scmp-web/pri/menu/update_menu",method:"post",data:e})),hye=(e={})=>(e=aye(e,"根据菜单id,互换两个菜单的排序"),p1({url:"/scmp-web/pri/menu/update_menu_sort",method:"post",data:e}));function mye(){return{postAddMenu:iye,postDelMenuInfo:lye,getAllMenuIdList:sye,getAllMenuList:cye,getMenuList:uye,getMenuListOne:dye,postSetMenuConfig:pye,postUpdateMenu:fye,postUpdateMenuSort:hye}}const vye=mye(),gye=Object.assign({"../layout/routerView/iframes.vue":()=>Promise.resolve().then((()=>require("./iframes-DnAW1ZV2.js"))),"../layout/routerView/link.vue":()=>Promise.resolve().then((()=>require("./link-DRSQkB95.js"))),"../layout/routerView/parent.vue":()=>Promise.resolve().then((()=>require("./parent-D9OF0cw6.js")))}),yye=Object.assign({"../views/config/buttonManagement/btnIndex.vue":()=>Promise.resolve().then((()=>require("./btnIndex-gHoEFTpO.js"))),"../views/config/buttonManagement/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-BTlXhs91.js"))),"../views/config/buttonManagement/index.vue":()=>Promise.resolve().then((()=>require("./index-CIrgey8q.js"))),"../views/config/dataAuth/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-Co56VSQ0.js"))),"../views/config/dataAuth/index.vue":()=>Promise.resolve().then((()=>require("./index-B1OyiNKv.js"))),"../views/config/dataDict/components/dict/dictDialog.vue":()=>Promise.resolve().then((()=>require("./dictDialog-CiN_ca7Q.js"))),"../views/config/dataDict/components/dictItem/dictItemDialog.vue":()=>Promise.resolve().then((()=>require("./dictItemDialog-CJ-ILs97.js"))),"../views/config/dataDict/index.vue":()=>Promise.resolve().then((()=>require("./index-Cwf_EX9w.js"))),"../views/config/fieldPool/components/dialog/index.vue":()=>Promise.resolve().then((()=>require("./index-CfbuW5QS.js"))),"../views/config/fieldPool/components/formAttr/index.vue":()=>Promise.resolve().then((()=>require("./index-Cb-Fe_1h.js"))),"../views/config/fieldPool/components/searchFormAttr/index.vue":()=>Promise.resolve().then((()=>require("./index-rLuVoqX7.js"))),"../views/config/fieldPool/components/tableAttr/index.vue":()=>Promise.resolve().then((()=>require("./index-DahfL4JO.js"))),"../views/config/fieldPool/index.vue":()=>Promise.resolve().then((()=>require("./index-B0F8IKcg.js"))),"../views/config/formSetting/components/hsBtn/src/hsAttrBtn.vue":()=>Promise.resolve().then((()=>require("./hsAttrBtn-CMaSrkZ0.js"))),"../views/config/formSetting/components/hsBtn/src/hsBtnConfigList.vue":()=>Promise.resolve().then((()=>require("./hsBtnConfigList-CIT00il7.js"))),"../views/config/formSetting/components/hsBtn/src/hsBtnItemConfig.vue":()=>Promise.resolve().then((()=>require("./hsBtnItemConfig-B5G3jYsU.js"))),"../views/config/formSetting/components/hsBtn/src/hsBtnPanel.vue":()=>Promise.resolve().then((()=>require("./hsBtnPanel-BrXPGYFF.js"))),"../views/config/formSetting/components/hsExpand/src/hsExpand.vue":()=>Promise.resolve().then((()=>require("./hsExpand-DYCVn1VX.js"))),"../views/config/formSetting/components/hsForm/src/contextmenu.vue":()=>Promise.resolve().then((()=>require("./contextmenu-IHw5xEmo.js"))),"../views/config/formSetting/components/hsForm/src/hsAttrForm.vue":()=>Promise.resolve().then((()=>require("./hsAttrForm-DM38Da51.js"))),"../views/config/formSetting/components/hsForm/src/hsCheckbox.vue":()=>Promise.resolve().then((()=>require("./hsCheckbox-BKa_El3s.js"))),"../views/config/formSetting/components/hsForm/src/hsFormConfig.vue":()=>Promise.resolve().then((()=>require("./hsFormConfig-Pv78QMfT.js"))),"../views/config/formSetting/components/hsForm/src/hsFormConfigList.vue":()=>Promise.resolve().then((()=>require("./hsFormConfigList-D9tcRHNw.js"))),"../views/config/formSetting/components/hsForm/src/hsFormPanel.vue":()=>Promise.resolve().then((()=>require("./hsFormPanel-Cfa3pP0-.js"))),"../views/config/formSetting/components/hsForm/src/hsFormParse.vue":()=>Promise.resolve().then((()=>require("./hsFormParse-D-Q3l3fm.js"))),"../views/config/formSetting/components/hsSaveForm/src/cloneConfigDialog.vue":()=>Promise.resolve().then((()=>require("./cloneConfigDialog-BdXVqg1W.js"))).then((e=>e.cloneConfigDialog)),"../views/config/formSetting/components/hsSaveForm/src/saveForm.vue":()=>Promise.resolve().then((()=>require("./saveForm-u1F0yEE2.js"))),"../views/config/formSetting/components/selectConfig/selectConfig.vue":()=>Promise.resolve().then((()=>require("./selectConfig-DqS0Xegt.js"))),"../views/config/formSetting/formConfig.vue":()=>Promise.resolve().then((()=>require("./formConfig-CKr3xMFQ.js"))),"../views/config/formSetting/index.vue":()=>Promise.resolve().then((()=>require("./index-CBpCTPIe.js"))),"../views/config/index.vue":()=>Promise.resolve().then((()=>require("./index-2tILke6U.js"))),"../views/config/pageElement/components/hsPanelItem/hsPanelItem.vue":()=>Promise.resolve().then((()=>require("./hsPanelItem-VHlIkruS.js"))),"../views/config/pageElement/index.vue":()=>Promise.resolve().then((()=>require("./index-CPNym4PK.js"))),"../views/config/parseAPI/index.vue":()=>Promise.resolve().then((()=>require("./index-boVE6Ad1.js"))),"../views/config/system2/component/addOrEditSystem/index.vue":()=>Promise.resolve().then((()=>require("./index-BTHLvnDM.js"))),"../views/config/system2/component/copySystem/copySystem.vue":()=>Promise.resolve().then((()=>require("./copySystem-uu32iiUK.js"))),"../views/config/system2/index.vue":()=>Promise.resolve().then((()=>require("./index-BzKxtQGz.js"))),"../views/config/table/index.vue":()=>Promise.resolve().then((()=>require("./index-XnjtFEnD.js"))),"../views/error/401.vue":()=>Promise.resolve().then((()=>require("./401-BJUEr3zO.js"))),"../views/error/404.vue":()=>Promise.resolve().then((()=>require("./404-BcDKlaGx.js"))),"../views/home/index.vue":()=>Promise.resolve().then((()=>require("./index-ZN1lfv8J.js"))),"../views/login/component/account.vue":()=>Promise.resolve().then((()=>require("./account-B2-uWJeI.js"))),"../views/login/component/mobile.vue":()=>Promise.resolve().then((()=>require("./mobile-NssmNsTv.js"))),"../views/login/component/scan.vue":()=>Promise.resolve().then((()=>require("./scan-BrB6Irjb.js"))),"../views/login/index.vue":()=>Promise.resolve().then((()=>require("./index-D8ri1xcm.js"))),"../views/system/dept/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-TFJ52Qpk.js"))),"../views/system/dept/index.vue":()=>Promise.resolve().then((()=>require("./index-DvF2RH6S.js"))),"../views/system/dic/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-DxBOYlwo.js"))),"../views/system/dic/index.vue":()=>Promise.resolve().then((()=>require("./index-DRQqujwQ.js"))),"../views/system/menu/copyMenuConfig.vue":()=>Promise.resolve().then((()=>require("./copyMenuConfig-DKzRhCbi.js"))),"../views/system/menu/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-BTgJq6e7.js"))),"../views/system/menu/index.vue":()=>Promise.resolve().then((()=>require("./index-Dbatv4cZ.js"))),"../views/system/role/component/roleItem.vue":()=>Promise.resolve().then((()=>require("./roleItem-1_ZEkknn.js"))),"../views/system/role/component/userSelect.vue":()=>Promise.resolve().then((()=>require("./userSelect-DU5Ntks6.js"))),"../views/system/role/index.vue":()=>Promise.resolve().then((()=>require("./index-Bb8qLImc.js"))),"../views/system/user/compoent/popup/popup.vue":()=>Promise.resolve().then((()=>require("./popup-BGGgNpP2.js"))),"../views/system/user/index.vue":()=>Promise.resolve().then((()=>require("./index-XyeM8FMs.js"))),"../views/test/form/index.vue":()=>Promise.resolve().then((()=>require("./index-XO93KRFu.js"))),"../views/test/rtc/index.vue":()=>Promise.resolve().then((()=>require("./index-GscAHVlz.js"))),"../views/test/table/index.vue":()=>Promise.resolve().then((()=>require("./index-By636CoZ.js"))),"../views/test/test2/auth_test.vue":()=>Promise.resolve().then((()=>require("./auth_test-CmiMmny2.js"))),"../views/test/test2/bc-scan-code-upload/index.vue":()=>Promise.resolve().then((()=>require("./index-CSeVpPfN.js"))),"../views/test/test2/bc-signature/index.vue":()=>Promise.resolve().then((()=>require("./index-DS1t4Gm4.js"))),"../views/test/test2/index copy.vue":()=>Promise.resolve().then((()=>require("./index copy-CTVbzQdm.js"))),"../views/test/test2/index.vue":()=>Promise.resolve().then((()=>require("./index-Dsgu_XO6.js"))),"../views/test/test2/uploadAvatar.vue":()=>Promise.resolve().then((()=>require("./uploadAvatar-T3d2Ra0Y.js"))),"../views/test/visual/index copy.vue":()=>Promise.resolve().then((()=>require("./index copy-CpCrOoBA.js"))),"../views/test/visual/index.vue":()=>Promise.resolve().then((()=>require("./index-CbCppT2z.js")))}),bye=Object.assign({},{...gye},{...yye});async function wye(){void 0===window.nextLoading&&Lge.start();const e=Sye();if(!(await e.isLogin()))return!1;const t=await _ye();if(t.data.length<=0)return Promise.resolve(!0);Pge().setRequestOldRoutes(JSON.parse(JSON.stringify(t.data))),Fge[0].children=await Eye(t.data),await Cye(),xye()}async function xye(){qge(Vge).setRoutesList(Fge[0].children),Gge(Vge).setTagsViewRoutes(oye(rye(Fge))[0].children)}async function Cye(){await function(){let e=oye(rye(Fge));return e[0].children=[...e[0].children,...zge],e}().forEach((e=>{nye.addRoute(e)}))}async function _ye(){let e=await vye.getMenuList();return console.debug("menu:",e),e}function Eye(e){if(e)return e.map((e=>(e.component&&(e.component=function(e,t){const n=Object.keys(e).filter((e=>{const n=e.replace(/..\/views|../,"");return n.startsWith(`${t}`)||n.startsWith(`/${t}`)}));if(1===(null==n?void 0:n.length)){return e[n[0]]}if((null==n?void 0:n.length)>1)return!1}(bye,e.component)),e.children&&Eye(e.children),e)))}const Sye=r.defineStore("userInfo",{state:()=>({userInfos:{userName:"",photo:"",time:0,roles:[],authBtnList:[]}}),actions:{async isLogin(){const e=await kge.get("userInfo");return this.userInfos=e,!!(null==e?void 0:e.id)},async setUserInfo(e){this.userInfos=e,await kge.set("userInfo",e);const t=(vge.value||"hs-admin-ui")+":sid";xq.set(t,e.sid,{expires:new Date(+new Date+864e5)}),await wye()},async logout(){await this.clear(),window.location.reload()},async clear(){this.userInfos={userName:"",photo:"",time:0,roles:[],authBtnList:[]};const e=(vge.value||"hs-admin-ui")+":sid";xq.remove(e),await kge.clear()}}});var kye,Tye={exports:{}};
69
+ * @license MIT */$ge.exports=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function o(e,t,n){return e<t?t:e>n?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){s(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0===--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),l=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&f(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n}();const Uge=P($ge.exports),Hge=r.defineStore("keepALiveNames",{state:()=>({keepAliveNames:[],cachedViews:[]}),actions:{async setCacheKeepAlive(e){this.keepAliveNames=e},async addCachedView(e){var t;e.meta.isKeepAlive&&(null==(t=this.cachedViews)||t.push(e.name)),this.cachedViews=[...new Set(this.cachedViews)]},async delCachedView(e){const t=this.cachedViews.indexOf(e.name);t>-1&&this.cachedViews.splice(t,1)},async delOthersCachedViews(e){e.meta.isKeepAlive?this.cachedViews=[e.name]:this.cachedViews=[]},async delAllCachedViews(){this.cachedViews=[]}}}),qge=r.defineStore("routesList",{state:()=>({routesList:[],isColumnsMenuHover:!1,isColumnsNavHover:!1}),actions:{async setRoutesList(e){this.routesList=e},async setColumnsMenuHover(e){this.isColumnsMenuHover=e},async setColumnsNavHover(e){this.isColumnsNavHover=e}}}),Wge=r.defineStore("themeConfig",{state:()=>({themeConfig:{isDrawer:!1,primary:"#409eff",isIsDark:!1,topBar:"#ffffff",topBarColor:"#606266",isTopBarColorGradual:!1,menuBar:"#545c64",menuBarColor:"#eaeaea",menuBarActiveColor:"rgba(0, 0, 0, 0.2)",isMenuBarColorGradual:!1,columnsMenuBar:"#545c64",columnsMenuBarColor:"#e6e6e6",isColumnsMenuBarColorGradual:!1,isColumnsMenuHoverPreload:!1,isCollapse:!1,isUniqueOpened:!0,isFixedHeader:!0,isFixedHeaderChange:!1,isClassicSplitMenu:!1,isLockScreen:!1,lockScreenTime:30,isShowLogo:!0,isShowLogoChange:!1,isBreadcrumb:!0,isTagsview:!0,isBreadcrumbIcon:!1,isTagsviewIcon:!1,isCacheTagsView:!1,isSortableTagsView:!0,isShareTagsView:!0,isFooter:!1,isWartermark:!1,wartermarkText:"",tagsStyle:"tags-style-five",animation:"slide-right",columnsAsideStyle:"columns-round",columnsAsideLayout:"columns-vertical",layout:"defaults",isRequestRoutes:!0,globalTitle:"华速前端框架",globalViceTitle:"vue3 + typescript5 + vite5 的框架",globalViceTitleMsg:"hs-admin",globalI18n:"zh-cn",globalComponentSize:"default"}}),actions:{setThemeConfig(e){const{globalTitle:t,globalViceTitle:n,globalViceTitleMsg:r}=this.themeConfig;this.themeConfig={...e.themeConfig,globalTitle:t,globalViceTitle:n,globalViceTitleMsg:r}}}}),Gge=r.defineStore("tagsViewRoutes",{state:()=>({tagsViewRoutes:[],isTagsViewCurrenFull:!1}),actions:{async setTagsViewRoutes(e){this.tagsViewRoutes=e},setCurrenFullscreen(e){Sge.set("isTagsViewCurrenFull",e),this.isTagsViewCurrenFull=e}}});function Yge(e,t){const n=[];return e.forEach((e=>{const r={...e};(function(e,t){return!t.meta||!t.meta.roles||e.some((e=>t.meta.roles.includes(e)))})(t,r)&&(r.children&&(r.children=Yge(r.children,t)),n.push(r))})),n}function Kge(e){const t=Sye(Vge),{userInfos:n}=r.storeToRefs(t);let o=[];return e.forEach((e=>{e.meta.roles&&e.meta.roles.forEach((t=>{n.value.roles.forEach((n=>{t===n&&o.push({...e})}))}))})),o}async function Xge(){await function(){let e=oye(rye(Fge));return e[0].children=[...Kge(e[0].children),...zge],e}().forEach((e=>{console.debug("后端路由信息:",e),nye.addRoute(e)}))}function Jge(){const e=Sye(Vge),t=qge(Vge),{userInfos:n}=r.storeToRefs(e);t.setRoutesList(Yge(Fge[0].children,n.value.roles)),function(){const e=Sye(Vge),t=Gge(Vge),{userInfos:n}=r.storeToRefs(e);let o=Yge(Fge,n.value.roles);t.setTagsViewRoutes(oye(rye(o))[0].children)}()}const Zge=Wge(Vge),Qge=Hge(Vge),{themeConfig:eye}=r.storeToRefs(Zge),{isRequestRoutes:tye}=eye.value,nye=o.createRouter({history:o.createWebHistory("/"),routes:[...zge,...jge]});function rye(e){if(e.length<=0)return!1;for(let t=0;t<e.length;t++)e[t].children&&(e=e.slice(0,t+1).concat(e[t].children,e.slice(t+1)));return e}function oye(e){if(e.length<=0)return!1;const t=[],n=[];return e.forEach((e=>{"/"===e.path?t.push({component:e.component,name:e.name,path:e.path,redirect:e.redirect,meta:e.meta,children:[]}):(e.path.indexOf("/:")>-1&&(e.meta.isDynamic=!0,e.meta.isDynamicPath=e.path),t[0].children.push({...e}),t[0].meta.isKeepAlive&&e.meta.isKeepAlive&&n.push(e.name))})),Qge.setCacheKeepAlive(n),t}nye.beforeEach((async(e,t,n)=>{Uge.configure({showSpinner:!1}),e.meta.title&&Uge.start();const o=Sye(),a=await o.isLogin();if(await Qge.addCachedView(e),"/login"!==e.path||a)if(a)if(a&&"/login"===e.path)n("/"),Uge.done();else{const t=qge(Vge),{routesList:o}=r.storeToRefs(t);0===o.value.length?tye?(await wye(),n({path:e.path,query:e.query})):(await async function(){void 0===window.nextLoading&&Lge.start();const e=Sye();if(!(await e.isLogin()))return!1;await Xge(),Jge()}(),n({path:e.path,query:e.query})):n()}else n(`/login?redirect=${e.path}&params=${JSON.stringify(e.query?e.query:e.params)}`),Uge.done();else n(),Uge.done()})),nye.afterEach((()=>{Uge.done()}));const aye=(e,t)=>Object.assign(e,{other_log_info:{title:t}}),iye=(e={})=>(e=aye(e,"新增菜单"),p1({url:"/scmp-web/pri/menu/add_menu",method:"post",data:e})),lye=(e={})=>(e=aye(e,"根据id,删除菜单"),p1({url:"/scmp-web/pri/menu/del_menu_info",method:"post",data:e})),sye=(e={})=>(e=aye(e,"获取所有菜单id集合"),p1({url:"/scmp-web/pri/menu/get_all_menu_id_list",method:"get",params:e})),cye=(e={})=>(e=aye(e,"获取所有菜单列表"),p1({url:"/scmp-web/pri/menu/get_all_menu_list",method:"get",params:e})),uye=(e={})=>(e=aye(e,"获取当前用户菜单列表(树形)"),p1({url:"/scmp-web/pri/menu/get_menu_list",method:"get",params:e})),dye=(e={})=>(e=aye(e,"获取一级菜单信息"),p1({url:"/scmp-web/pri/menu/get_menu_list_one",method:"get",params:e})),pye=(e={})=>(e=aye(e,"设置菜单页面配置项,按钮和字典数据"),p1({url:"/scmp-web/pri/menu/set_menu_config",method:"post",data:e})),fye=(e={})=>(e=aye(e,"更新菜单"),p1({url:"/scmp-web/pri/menu/update_menu",method:"post",data:e})),hye=(e={})=>(e=aye(e,"根据菜单id,互换两个菜单的排序"),p1({url:"/scmp-web/pri/menu/update_menu_sort",method:"post",data:e}));function mye(){return{postAddMenu:iye,postDelMenuInfo:lye,getAllMenuIdList:sye,getAllMenuList:cye,getMenuList:uye,getMenuListOne:dye,postSetMenuConfig:pye,postUpdateMenu:fye,postUpdateMenuSort:hye}}const vye=mye(),gye=Object.assign({"../layout/routerView/iframes.vue":()=>Promise.resolve().then((()=>require("./iframes-DnAW1ZV2.js"))),"../layout/routerView/link.vue":()=>Promise.resolve().then((()=>require("./link-BrFzFsZF.js"))),"../layout/routerView/parent.vue":()=>Promise.resolve().then((()=>require("./parent-CPbhWpmo.js")))}),yye=Object.assign({"../views/config/buttonManagement/btnIndex.vue":()=>Promise.resolve().then((()=>require("./btnIndex--H75NnPc.js"))),"../views/config/buttonManagement/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-MpsgSlrh.js"))),"../views/config/buttonManagement/index.vue":()=>Promise.resolve().then((()=>require("./index-CIrgey8q.js"))),"../views/config/dataAuth/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-oR4R2bkJ.js"))),"../views/config/dataAuth/index.vue":()=>Promise.resolve().then((()=>require("./index-DE6ps8-P.js"))),"../views/config/dataDict/components/dict/dictDialog.vue":()=>Promise.resolve().then((()=>require("./dictDialog-BW0mFcH5.js"))),"../views/config/dataDict/components/dictItem/dictItemDialog.vue":()=>Promise.resolve().then((()=>require("./dictItemDialog-F2yvuOWh.js"))),"../views/config/dataDict/index.vue":()=>Promise.resolve().then((()=>require("./index-C2yXed4j.js"))),"../views/config/fieldPool/components/dialog/index.vue":()=>Promise.resolve().then((()=>require("./index-DXaT7Bpw.js"))),"../views/config/fieldPool/components/formAttr/index.vue":()=>Promise.resolve().then((()=>require("./index-C0EviSXr.js"))),"../views/config/fieldPool/components/searchFormAttr/index.vue":()=>Promise.resolve().then((()=>require("./index-Dkc23mFY.js"))),"../views/config/fieldPool/components/tableAttr/index.vue":()=>Promise.resolve().then((()=>require("./index-Ch9mzlaS.js"))),"../views/config/fieldPool/index.vue":()=>Promise.resolve().then((()=>require("./index-BM7au2Mx.js"))),"../views/config/formSetting/components/hsBtn/src/hsAttrBtn.vue":()=>Promise.resolve().then((()=>require("./hsAttrBtn-BzvIUFxK.js"))),"../views/config/formSetting/components/hsBtn/src/hsBtnConfigList.vue":()=>Promise.resolve().then((()=>require("./hsBtnConfigList-CuXQzFre.js"))),"../views/config/formSetting/components/hsBtn/src/hsBtnItemConfig.vue":()=>Promise.resolve().then((()=>require("./hsBtnItemConfig-B_SAnsco.js"))),"../views/config/formSetting/components/hsBtn/src/hsBtnPanel.vue":()=>Promise.resolve().then((()=>require("./hsBtnPanel-B3HreNs8.js"))),"../views/config/formSetting/components/hsExpand/src/hsExpand.vue":()=>Promise.resolve().then((()=>require("./hsExpand-Caz700ii.js"))),"../views/config/formSetting/components/hsForm/src/contextmenu.vue":()=>Promise.resolve().then((()=>require("./contextmenu-DwEvTut2.js"))),"../views/config/formSetting/components/hsForm/src/hsAttrForm.vue":()=>Promise.resolve().then((()=>require("./hsAttrForm-B7yESywK.js"))),"../views/config/formSetting/components/hsForm/src/hsCheckbox.vue":()=>Promise.resolve().then((()=>require("./hsCheckbox-BKa_El3s.js"))),"../views/config/formSetting/components/hsForm/src/hsFormConfig.vue":()=>Promise.resolve().then((()=>require("./hsFormConfig-ByeJg2Qr.js"))),"../views/config/formSetting/components/hsForm/src/hsFormConfigList.vue":()=>Promise.resolve().then((()=>require("./hsFormConfigList-BPkuJfAB.js"))),"../views/config/formSetting/components/hsForm/src/hsFormPanel.vue":()=>Promise.resolve().then((()=>require("./hsFormPanel-7KRX-JNw.js"))),"../views/config/formSetting/components/hsForm/src/hsFormParse.vue":()=>Promise.resolve().then((()=>require("./hsFormParse-OyV8UrGS.js"))),"../views/config/formSetting/components/hsSaveForm/src/cloneConfigDialog.vue":()=>Promise.resolve().then((()=>require("./cloneConfigDialog-CqIkrY-S.js"))).then((e=>e.cloneConfigDialog)),"../views/config/formSetting/components/hsSaveForm/src/saveForm.vue":()=>Promise.resolve().then((()=>require("./saveForm-C4fcV3By.js"))),"../views/config/formSetting/components/selectConfig/selectConfig.vue":()=>Promise.resolve().then((()=>require("./selectConfig-B9UbTiiU.js"))),"../views/config/formSetting/formConfig.vue":()=>Promise.resolve().then((()=>require("./formConfig-DaXuMFFU.js"))),"../views/config/formSetting/index.vue":()=>Promise.resolve().then((()=>require("./index-D3y4nc65.js"))),"../views/config/index.vue":()=>Promise.resolve().then((()=>require("./index-CVEyV3oH.js"))),"../views/config/pageElement/components/hsPanelItem/hsPanelItem.vue":()=>Promise.resolve().then((()=>require("./hsPanelItem-BgLUf7Iz.js"))),"../views/config/pageElement/index.vue":()=>Promise.resolve().then((()=>require("./index-C1cQDv9A.js"))),"../views/config/parseAPI/index.vue":()=>Promise.resolve().then((()=>require("./index-K8q_W8GL.js"))),"../views/config/system2/component/addOrEditSystem/index.vue":()=>Promise.resolve().then((()=>require("./index-tRuuFe1Y.js"))),"../views/config/system2/component/copySystem/copySystem.vue":()=>Promise.resolve().then((()=>require("./copySystem-CMrSR8-J.js"))),"../views/config/system2/index.vue":()=>Promise.resolve().then((()=>require("./index-BozmXv9E.js"))),"../views/config/table/index.vue":()=>Promise.resolve().then((()=>require("./index-Da19FKfM.js"))),"../views/error/401.vue":()=>Promise.resolve().then((()=>require("./401--ngJ_50u.js"))),"../views/error/404.vue":()=>Promise.resolve().then((()=>require("./404-BktDbggf.js"))),"../views/home/index.vue":()=>Promise.resolve().then((()=>require("./index-mJFY2tIL.js"))),"../views/login/component/account.vue":()=>Promise.resolve().then((()=>require("./account-R0I5gVjg.js"))),"../views/login/component/mobile.vue":()=>Promise.resolve().then((()=>require("./mobile-4IvgFmHN.js"))),"../views/login/component/scan.vue":()=>Promise.resolve().then((()=>require("./scan-Cd_herHl.js"))),"../views/login/index.vue":()=>Promise.resolve().then((()=>require("./index-Dzp_gx2r.js"))),"../views/system/dept/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-TFJ52Qpk.js"))),"../views/system/dept/index.vue":()=>Promise.resolve().then((()=>require("./index-EbByaRmt.js"))),"../views/system/dic/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-DxBOYlwo.js"))),"../views/system/dic/index.vue":()=>Promise.resolve().then((()=>require("./index-BRl3XF5Q.js"))),"../views/system/menu/copyMenuConfig.vue":()=>Promise.resolve().then((()=>require("./copyMenuConfig-BxrIFgyr.js"))),"../views/system/menu/dialog.vue":()=>Promise.resolve().then((()=>require("./dialog-DMCoapek.js"))),"../views/system/menu/index.vue":()=>Promise.resolve().then((()=>require("./index-VtXQ2397.js"))),"../views/system/role/component/roleItem.vue":()=>Promise.resolve().then((()=>require("./roleItem-Coyp2NC2.js"))),"../views/system/role/component/userSelect.vue":()=>Promise.resolve().then((()=>require("./userSelect-Be6H4OMY.js"))),"../views/system/role/index.vue":()=>Promise.resolve().then((()=>require("./index-CaLz_yWZ.js"))),"../views/system/user/compoent/popup/popup.vue":()=>Promise.resolve().then((()=>require("./popup-BrUrrwGO.js"))),"../views/system/user/index.vue":()=>Promise.resolve().then((()=>require("./index-Ca0KFCUy.js"))),"../views/test/form/index.vue":()=>Promise.resolve().then((()=>require("./index-XO93KRFu.js"))),"../views/test/rtc/index.vue":()=>Promise.resolve().then((()=>require("./index-DePKCEIy.js"))),"../views/test/table/index.vue":()=>Promise.resolve().then((()=>require("./index-cjrMHYB1.js"))),"../views/test/test2/auth_test.vue":()=>Promise.resolve().then((()=>require("./auth_test-C8YufYV9.js"))),"../views/test/test2/bc-scan-code-upload/index.vue":()=>Promise.resolve().then((()=>require("./index-f-3maudb.js"))),"../views/test/test2/bc-signature/index.vue":()=>Promise.resolve().then((()=>require("./index-BgOvNdpd.js"))),"../views/test/test2/index copy.vue":()=>Promise.resolve().then((()=>require("./index copy-C_bPft-R.js"))),"../views/test/test2/index.vue":()=>Promise.resolve().then((()=>require("./index-Dsgu_XO6.js"))),"../views/test/test2/uploadAvatar.vue":()=>Promise.resolve().then((()=>require("./uploadAvatar-D710MQXR.js"))),"../views/test/visual/index copy.vue":()=>Promise.resolve().then((()=>require("./index copy-C-0fZXYu.js"))),"../views/test/visual/index.vue":()=>Promise.resolve().then((()=>require("./index-CbCppT2z.js")))}),bye=Object.assign({},{...gye},{...yye});async function wye(){void 0===window.nextLoading&&Lge.start();const e=Sye();if(!(await e.isLogin()))return!1;const t=await _ye();if(t.data.length<=0)return Promise.resolve(!0);Pge().setRequestOldRoutes(JSON.parse(JSON.stringify(t.data))),Fge[0].children=await Eye(t.data),await Cye(),xye()}async function xye(){qge(Vge).setRoutesList(Fge[0].children),Gge(Vge).setTagsViewRoutes(oye(rye(Fge))[0].children)}async function Cye(){await function(){let e=oye(rye(Fge));return e[0].children=[...e[0].children,...zge],e}().forEach((e=>{nye.addRoute(e)}))}async function _ye(){let e=await vye.getMenuList();return console.debug("menu:",e),e}function Eye(e){if(e)return e.map((e=>(e.component&&(e.component=function(e,t){const n=Object.keys(e).filter((e=>{const n=e.replace(/..\/views|../,"");return n.startsWith(`${t}`)||n.startsWith(`/${t}`)}));if(1===(null==n?void 0:n.length)){return e[n[0]]}if((null==n?void 0:n.length)>1)return!1}(bye,e.component)),e.children&&Eye(e.children),e)))}const Sye=r.defineStore("userInfo",{state:()=>({userInfos:{userName:"",photo:"",time:0,roles:[],authBtnList:[]}}),actions:{async isLogin(){const e=await kge.get("userInfo");return this.userInfos=e,!!(null==e?void 0:e.id)},async setUserInfo(e){this.userInfos=e,await kge.set("userInfo",e);const t=(vge.value||"hs-admin-ui")+":sid";xq.set(t,e.sid,{expires:new Date(+new Date+864e5)}),await wye()},async logout(){await this.clear(),window.location.reload()},async clear(){this.userInfos={userName:"",photo:"",time:0,roles:[],authBtnList:[]};const e=(vge.value||"hs-admin-ui")+":sid";xq.remove(e),await kge.clear()}}});var kye,Tye={exports:{}};
70
70
  /*!
71
71
  * clipboard.js v2.0.11
72
72
  * https://clipboardjs.com/