@jayjiang/open-cc 0.2.1
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.
- package/LICENSE +8 -0
- package/README.md +107 -0
- package/dist/chunk-00dxqxqj.js +227 -0
- package/dist/chunk-01p8hhsp.js +154 -0
- package/dist/chunk-02wy0m47.js +152 -0
- package/dist/chunk-0465tnzh.js +110 -0
- package/dist/chunk-054mjk62.js +678 -0
- package/dist/chunk-06saje2v.js +39 -0
- package/dist/chunk-0731m51q.js +8 -0
- package/dist/chunk-09y0jvtm.js +165 -0
- package/dist/chunk-0fkqze0v.js +113 -0
- package/dist/chunk-0hn525br.js +1920 -0
- package/dist/chunk-0hneh9ha.js +123 -0
- package/dist/chunk-0paqc2yw.js +15 -0
- package/dist/chunk-0rkbrabt.js +32 -0
- package/dist/chunk-0scs4rpx.js +96 -0
- package/dist/chunk-0vkfrmqm.js +690 -0
- package/dist/chunk-0w2byc95.js +38 -0
- package/dist/chunk-0xjaqda8.js +1124 -0
- package/dist/chunk-0y3vcsv4.js +92 -0
- package/dist/chunk-0yb4dz9c.js +26840 -0
- package/dist/chunk-10fdxge0.js +121 -0
- package/dist/chunk-1141xmr4.js +8 -0
- package/dist/chunk-14vffdmg.js +38 -0
- package/dist/chunk-178ykx7k.js +1493 -0
- package/dist/chunk-1bhva2z9.js +128 -0
- package/dist/chunk-1c8z1b5v.js +16 -0
- package/dist/chunk-1cbn5kxf.js +7 -0
- package/dist/chunk-1che51a5.js +1585 -0
- package/dist/chunk-1h2famwb.js +49 -0
- package/dist/chunk-1jrkpnbn.js +71 -0
- package/dist/chunk-1k4j1xcf.js +154 -0
- package/dist/chunk-1mm9d8p4.js +70 -0
- package/dist/chunk-1n3gnn2t.js +41 -0
- package/dist/chunk-1nqaq1rs.js +654 -0
- package/dist/chunk-1p2j9g3w.js +998 -0
- package/dist/chunk-1p7jfcee.js +533 -0
- package/dist/chunk-1pg8s12r.js +338 -0
- package/dist/chunk-1qjb22fx.js +109 -0
- package/dist/chunk-1yzc16qa.js +39 -0
- package/dist/chunk-20gm89wf.js +208 -0
- package/dist/chunk-238g70xa.js +36 -0
- package/dist/chunk-26k0324b.js +751 -0
- package/dist/chunk-27xc1csx.js +104 -0
- package/dist/chunk-2a42s11t.js +412 -0
- package/dist/chunk-2bhq4emw.js +10476 -0
- package/dist/chunk-2eykm0j0.js +20 -0
- package/dist/chunk-2gzv8nrw.js +205 -0
- package/dist/chunk-2k995y2x.js +880 -0
- package/dist/chunk-2kpzaa7w.js +401 -0
- package/dist/chunk-2nayx6q1.js +63 -0
- package/dist/chunk-2qhs9n36.js +151 -0
- package/dist/chunk-2s5f2nnw.js +603 -0
- package/dist/chunk-2y54j9ew.js +174394 -0
- package/dist/chunk-2zcaw1jd.js +2343 -0
- package/dist/chunk-30chpfyc.js +15275 -0
- package/dist/chunk-30k39xd2.js +28 -0
- package/dist/chunk-30rst83v.js +168 -0
- package/dist/chunk-36z5enc4.js +160 -0
- package/dist/chunk-3c25bcsw.js +17 -0
- package/dist/chunk-3c4qja3e.js +63 -0
- package/dist/chunk-3ccx8k84.js +102 -0
- package/dist/chunk-3envnthj.js +157 -0
- package/dist/chunk-3h8a89gy.js +46 -0
- package/dist/chunk-3kadbep2.js +6956 -0
- package/dist/chunk-3kd79cnk.js +15 -0
- package/dist/chunk-3m45xtza.js +1188 -0
- package/dist/chunk-3q50xe1j.js +17 -0
- package/dist/chunk-3w6s9m5w.js +16 -0
- package/dist/chunk-3x0408tc.js +42 -0
- package/dist/chunk-3z7ae04g.js +372 -0
- package/dist/chunk-40tedt0y.js +275 -0
- package/dist/chunk-44q8kegv.js +811 -0
- package/dist/chunk-47gy6qkp.js +328 -0
- package/dist/chunk-495d85x1.js +8066 -0
- package/dist/chunk-4axcksrv.js +129 -0
- package/dist/chunk-4e1271a8.js +106 -0
- package/dist/chunk-4g3v8y12.js +23 -0
- package/dist/chunk-4g5mrzm0.js +220 -0
- package/dist/chunk-4jm600zv.js +13 -0
- package/dist/chunk-4n989n6h.js +153 -0
- package/dist/chunk-4qedx22a.js +44 -0
- package/dist/chunk-4rze71rx.js +116 -0
- package/dist/chunk-4wbhvcag.js +91 -0
- package/dist/chunk-4zfkzkt6.js +37 -0
- package/dist/chunk-55wgxwa9.js +13877 -0
- package/dist/chunk-56ta4h0b.js +154 -0
- package/dist/chunk-58a0x39g.js +89 -0
- package/dist/chunk-5dbk24zg.js +890 -0
- package/dist/chunk-5gzg4q1k.js +99 -0
- package/dist/chunk-5k2gdxnr.js +336 -0
- package/dist/chunk-5kp252z6.js +202 -0
- package/dist/chunk-5p2ssw3d.js +825 -0
- package/dist/chunk-5w33j8gy.js +1580 -0
- package/dist/chunk-5ywjzvm8.js +61 -0
- package/dist/chunk-5ztxx8gd.js +80 -0
- package/dist/chunk-62vwr0y5.js +117 -0
- package/dist/chunk-6b8ksqmf.js +1153 -0
- package/dist/chunk-6bd8brc4.js +48 -0
- package/dist/chunk-6cpqmd4r.js +132 -0
- package/dist/chunk-6dj5t602.js +341 -0
- package/dist/chunk-6g62sjpf.js +328 -0
- package/dist/chunk-6gr3c3w9.js +378 -0
- package/dist/chunk-6h9n8qbr.js +1170 -0
- package/dist/chunk-6kpbgc5w.js +23 -0
- package/dist/chunk-6n2qgm9v.js +8 -0
- package/dist/chunk-6n6jfmce.js +2833 -0
- package/dist/chunk-6q2x8zeg.js +802 -0
- package/dist/chunk-6tnekwtp.js +849 -0
- package/dist/chunk-6tq2v3rk.js +186 -0
- package/dist/chunk-6vphqqd1.js +27 -0
- package/dist/chunk-6wkdqk81.js +444 -0
- package/dist/chunk-7226mgjt.js +195 -0
- package/dist/chunk-72fey14y.js +565 -0
- package/dist/chunk-73fgm72g.js +698 -0
- package/dist/chunk-73fhat5j.js +212 -0
- package/dist/chunk-73rpbt04.js +1947 -0
- package/dist/chunk-743znc5c.js +56 -0
- package/dist/chunk-760252na.js +101 -0
- package/dist/chunk-76t2h5v2.js +495 -0
- package/dist/chunk-7739pg2c.js +4261 -0
- package/dist/chunk-789khc7a.js +96 -0
- package/dist/chunk-78mma1s7.js +88 -0
- package/dist/chunk-7aw745vx.js +40175 -0
- package/dist/chunk-7azp8c8y.js +584 -0
- package/dist/chunk-7m2nd8da.js +110 -0
- package/dist/chunk-7pemewz2.js +726 -0
- package/dist/chunk-7rjyn5d3.js +125 -0
- package/dist/chunk-7v0wq9nk.js +93 -0
- package/dist/chunk-7wm5s02e.js +216 -0
- package/dist/chunk-83hfzbx3.js +10 -0
- package/dist/chunk-84k64e4a.js +1646 -0
- package/dist/chunk-87jfpcm7.js +438 -0
- package/dist/chunk-8btm871b.js +42 -0
- package/dist/chunk-8hbbzet5.js +34 -0
- package/dist/chunk-8hq5kk3y.js +44 -0
- package/dist/chunk-8j6vs75t.js +256 -0
- package/dist/chunk-8ngxagxq.js +18 -0
- package/dist/chunk-8nsem424.js +110 -0
- package/dist/chunk-8pf73pc8.js +169 -0
- package/dist/chunk-8tnsngw2.js +31 -0
- package/dist/chunk-8y12jxg8.js +10 -0
- package/dist/chunk-8ymf4e6z.js +48 -0
- package/dist/chunk-90wp6wez.js +10510 -0
- package/dist/chunk-95dt8mpg.js +603 -0
- package/dist/chunk-95rj8m4e.js +130 -0
- package/dist/chunk-9ebygqen.js +89 -0
- package/dist/chunk-9gbamk79.js +93 -0
- package/dist/chunk-9tkq3g56.js +642 -0
- package/dist/chunk-a05hje2h.js +105 -0
- package/dist/chunk-a2krhf3c.js +90 -0
- package/dist/chunk-a6q9rehn.js +182 -0
- package/dist/chunk-a78b3pvt.js +71 -0
- package/dist/chunk-a8ejc632.js +3094 -0
- package/dist/chunk-a9vdeb6y.js +258 -0
- package/dist/chunk-a9zh40sj.js +48 -0
- package/dist/chunk-ab59azrr.js +480 -0
- package/dist/chunk-accxhkm6.js +88 -0
- package/dist/chunk-adzd8pzb.js +1095 -0
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-aftppv3p.js +691 -0
- package/dist/chunk-agmw1vmf.js +725 -0
- package/dist/chunk-an5cb1vx.js +16 -0
- package/dist/chunk-b1s11z4y.js +63 -0
- package/dist/chunk-b2rkh01x.js +443 -0
- package/dist/chunk-b4w4argn.js +1551 -0
- package/dist/chunk-b4wg70y1.js +54 -0
- package/dist/chunk-b5b7h81y.js +7189 -0
- package/dist/chunk-b9k5cs09.js +50 -0
- package/dist/chunk-bapy5rc8.js +40 -0
- package/dist/chunk-bda3gxxz.js +246 -0
- package/dist/chunk-bhdt6k7w.js +15 -0
- package/dist/chunk-bm1qb16p.js +17 -0
- package/dist/chunk-bp0dnrwg.js +281 -0
- package/dist/chunk-bqfnp99q.js +477 -0
- package/dist/chunk-bs6keys0.js +158 -0
- package/dist/chunk-bsbmmfyt.js +17 -0
- package/dist/chunk-btkettbr.js +166 -0
- package/dist/chunk-bwgde7nf.js +37 -0
- package/dist/chunk-c1zc58pw.js +280 -0
- package/dist/chunk-c2g96ga2.js +184 -0
- package/dist/chunk-c3z7ptb2.js +21933 -0
- package/dist/chunk-c8vn3ynx.js +349 -0
- package/dist/chunk-cdm0k2n0.js +115 -0
- package/dist/chunk-cdz5yb0r.js +57 -0
- package/dist/chunk-cfv996bs.js +22 -0
- package/dist/chunk-cg788ab0.js +100 -0
- package/dist/chunk-cgfdkzhb.js +12 -0
- package/dist/chunk-cp76dsdp.js +386 -0
- package/dist/chunk-cr6t6rth.js +306 -0
- package/dist/chunk-cvp5vayb.js +31 -0
- package/dist/chunk-cwehsmj5.js +114 -0
- package/dist/chunk-cy2hswr1.js +15 -0
- package/dist/chunk-d2rzy2p0.js +42 -0
- package/dist/chunk-d3v2fbay.js +106 -0
- package/dist/chunk-dc4eha8a.js +243 -0
- package/dist/chunk-dcz167d6.js +73 -0
- package/dist/chunk-de55jjre.js +106 -0
- package/dist/chunk-dfx733j3.js +650 -0
- package/dist/chunk-dgqrcy74.js +48 -0
- package/dist/chunk-dj6dk19k.js +55 -0
- package/dist/chunk-dn2xcmc4.js +173 -0
- package/dist/chunk-dndehvfr.js +57 -0
- package/dist/chunk-dnh7jtpb.js +37 -0
- package/dist/chunk-dnwzz9f7.js +88 -0
- package/dist/chunk-dv1wfr85.js +6373 -0
- package/dist/chunk-dwq5rs3q.js +62 -0
- package/dist/chunk-dz8exe78.js +91 -0
- package/dist/chunk-e4rzw1sd.js +606 -0
- package/dist/chunk-e6rrwzv0.js +463 -0
- package/dist/chunk-e6t9kpzq.js +145 -0
- package/dist/chunk-e7c8ypwc.js +287 -0
- package/dist/chunk-e9nkfs4e.js +738 -0
- package/dist/chunk-eaf7c8ck.js +537 -0
- package/dist/chunk-ebyr6p77.js +115 -0
- package/dist/chunk-edfv7pme.js +104 -0
- package/dist/chunk-eh474zhj.js +59 -0
- package/dist/chunk-er8ckwzt.js +140 -0
- package/dist/chunk-ev5p07yh.js +144 -0
- package/dist/chunk-ewadzrm8.js +103 -0
- package/dist/chunk-f2mhrmww.js +62 -0
- package/dist/chunk-f2zhqnb6.js +69 -0
- package/dist/chunk-f5ma3nh5.js +3436 -0
- package/dist/chunk-f63q7vx7.js +756 -0
- package/dist/chunk-fbv4apne.js +51 -0
- package/dist/chunk-fcna95wg.js +113 -0
- package/dist/chunk-fdvcpaz3.js +163 -0
- package/dist/chunk-fgc0q2b2.js +3354 -0
- package/dist/chunk-fm2jvsk7.js +87 -0
- package/dist/chunk-ft7fs35e.js +282 -0
- package/dist/chunk-fyc5fepv.js +10 -0
- package/dist/chunk-g0j0t6qk.js +26 -0
- package/dist/chunk-g0nbec9m.js +32 -0
- package/dist/chunk-g1fdv1kb.js +86 -0
- package/dist/chunk-g338npwr.js +1061 -0
- package/dist/chunk-g3t0act8.js +8 -0
- package/dist/chunk-g6qddbvf.js +1391 -0
- package/dist/chunk-ga5faygf.js +61 -0
- package/dist/chunk-gac6nzhc.js +90 -0
- package/dist/chunk-gck2cswd.js +862 -0
- package/dist/chunk-gntr3b25.js +40683 -0
- package/dist/chunk-gq5bbtme.js +456 -0
- package/dist/chunk-gyj242zr.js +20 -0
- package/dist/chunk-h0qngp9w.js +157 -0
- package/dist/chunk-h1xnvnye.js +524 -0
- package/dist/chunk-h3mhfamg.js +60 -0
- package/dist/chunk-h6s1tx0e.js +250 -0
- package/dist/chunk-h7qb4hyj.js +70 -0
- package/dist/chunk-h8qd1gw2.js +106 -0
- package/dist/chunk-hakdhagh.js +16606 -0
- package/dist/chunk-hcdt34n4.js +143 -0
- package/dist/chunk-hh7cmy4k.js +20 -0
- package/dist/chunk-hk9xz7gk.js +118 -0
- package/dist/chunk-hqmz36b3.js +552 -0
- package/dist/chunk-hs8ph4p8.js +8 -0
- package/dist/chunk-hsq4vtjy.js +92 -0
- package/dist/chunk-hzhd0p1y.js +104 -0
- package/dist/chunk-hzhe8ygc.js +547 -0
- package/dist/chunk-j0tqbsh7.js +176 -0
- package/dist/chunk-j1s1jvad.js +346 -0
- package/dist/chunk-j2k4p94p.js +55 -0
- package/dist/chunk-j3a4p81y.js +184 -0
- package/dist/chunk-j595yd4h.js +439 -0
- package/dist/chunk-j64ga6ta.js +8035 -0
- package/dist/chunk-j7qwxra8.js +2335 -0
- package/dist/chunk-j98f65zv.js +789 -0
- package/dist/chunk-jd32zbps.js +15 -0
- package/dist/chunk-jdgeec04.js +4249 -0
- package/dist/chunk-jdt5s5k7.js +62 -0
- package/dist/chunk-jeaek018.js +97 -0
- package/dist/chunk-jkhvm8yk.js +104 -0
- package/dist/chunk-jmxaze30.js +780 -0
- package/dist/chunk-jne71s1f.js +104 -0
- package/dist/chunk-jnhkref0.js +30 -0
- package/dist/chunk-jpgr7zfs.js +95 -0
- package/dist/chunk-jqp0q5nk.js +339 -0
- package/dist/chunk-jtqgnyaq.js +1317 -0
- package/dist/chunk-jx817w05.js +11 -0
- package/dist/chunk-jynzr5w9.js +71 -0
- package/dist/chunk-jzmz18nn.js +65 -0
- package/dist/chunk-k0p9w03v.js +4957 -0
- package/dist/chunk-k1jnpyj9.js +155 -0
- package/dist/chunk-k445en8h.js +102 -0
- package/dist/chunk-k62k13ya.js +81 -0
- package/dist/chunk-kf8kjmfv.js +821 -0
- package/dist/chunk-kgn1nfg9.js +468 -0
- package/dist/chunk-khmz14d4.js +38 -0
- package/dist/chunk-kjhmt6ba.js +100 -0
- package/dist/chunk-kkrz2zw2.js +122 -0
- package/dist/chunk-kv1ryvtm.js +176 -0
- package/dist/chunk-kwekc97v.js +18 -0
- package/dist/chunk-kyvwf342.js +65 -0
- package/dist/chunk-m0g3xv72.js +266 -0
- package/dist/chunk-m26twd8m.js +277 -0
- package/dist/chunk-m4bc15mz.js +229 -0
- package/dist/chunk-m9t8j37k.js +253 -0
- package/dist/chunk-mb2gpwwf.js +432 -0
- package/dist/chunk-mezwt1bt.js +306 -0
- package/dist/chunk-mfm83xn5.js +84 -0
- package/dist/chunk-mn7870fh.js +4389 -0
- package/dist/chunk-mr9df5v8.js +722 -0
- package/dist/chunk-mt25echc.js +6157 -0
- package/dist/chunk-mwrr6zbb.js +55 -0
- package/dist/chunk-mywpbwad.js +198 -0
- package/dist/chunk-mzdtkccs.js +125 -0
- package/dist/chunk-mzn0z9d3.js +691 -0
- package/dist/chunk-n0qaeaa5.js +256 -0
- package/dist/chunk-n128bzxs.js +2739 -0
- package/dist/chunk-n1erf6kh.js +22820 -0
- package/dist/chunk-n4nbgkvd.js +520 -0
- package/dist/chunk-n5gkdn9v.js +120 -0
- package/dist/chunk-n7ttdtk0.js +641 -0
- package/dist/chunk-n8b1njwb.js +208 -0
- package/dist/chunk-nek12gtk.js +94 -0
- package/dist/chunk-nerv0jvx.js +74 -0
- package/dist/chunk-nka1g8f4.js +773 -0
- package/dist/chunk-nm2cncrq.js +336 -0
- package/dist/chunk-nq0fxyxh.js +752 -0
- package/dist/chunk-nrnkshv2.js +192 -0
- package/dist/chunk-nsqma629.js +128 -0
- package/dist/chunk-nt837qt9.js +21 -0
- package/dist/chunk-nttf3k0r.js +2643 -0
- package/dist/chunk-nx638j6h.js +268 -0
- package/dist/chunk-nx7s0zn5.js +375 -0
- package/dist/chunk-p0hff8zy.js +8871 -0
- package/dist/chunk-p2816w9z.js +1486 -0
- package/dist/chunk-p2d5nh3g.js +342 -0
- package/dist/chunk-p57bz7nv.js +55 -0
- package/dist/chunk-p5z8t6r3.js +130 -0
- package/dist/chunk-pd6653na.js +5394 -0
- package/dist/chunk-pjnzf3cg.js +61 -0
- package/dist/chunk-ps49ymvj.js +43 -0
- package/dist/chunk-pthzapbx.js +348 -0
- package/dist/chunk-pwwa7s62.js +11 -0
- package/dist/chunk-pyx135a5.js +20 -0
- package/dist/chunk-q132dkwr.js +195 -0
- package/dist/chunk-q16y18s1.js +120 -0
- package/dist/chunk-q25bjaev.js +15 -0
- package/dist/chunk-q3jxs36m.js +716 -0
- package/dist/chunk-q5by3da6.js +8 -0
- package/dist/chunk-q663msp4.js +908 -0
- package/dist/chunk-qezgfppb.js +4521 -0
- package/dist/chunk-qgjgqmy5.js +5796 -0
- package/dist/chunk-qj7h3xc3.js +40 -0
- package/dist/chunk-qjcxkbv6.js +644 -0
- package/dist/chunk-qnfx3qtx.js +617 -0
- package/dist/chunk-qnmyzsam.js +84 -0
- package/dist/chunk-qp2qdcda.js +100 -0
- package/dist/chunk-qvrq1sby.js +6107 -0
- package/dist/chunk-qz2x630m.js +49145 -0
- package/dist/chunk-qz3fe4fj.js +469 -0
- package/dist/chunk-r0af6bw0.js +173 -0
- package/dist/chunk-r1v8d6da.js +1299 -0
- package/dist/chunk-r6b58y3x.js +17 -0
- package/dist/chunk-r6e45bzh.js +118 -0
- package/dist/chunk-r843jezp.js +28 -0
- package/dist/chunk-rbgjkg3v.js +90 -0
- package/dist/chunk-rc5bbzx4.js +655 -0
- package/dist/chunk-rca5xtnd.js +267 -0
- package/dist/chunk-rfdbzyjh.js +1865 -0
- package/dist/chunk-rh7q28df.js +93 -0
- package/dist/chunk-rn0v1hk8.js +34 -0
- package/dist/chunk-rvxs7x7j.js +542 -0
- package/dist/chunk-rw6fwk2s.js +98 -0
- package/dist/chunk-rwagvxh5.js +1711 -0
- package/dist/chunk-s10vyjz4.js +224 -0
- package/dist/chunk-s274nv8k.js +8 -0
- package/dist/chunk-s3pzvdss.js +50 -0
- package/dist/chunk-s4w01jsb.js +969 -0
- package/dist/chunk-s56j2d6g.js +500 -0
- package/dist/chunk-sbs1r0h4.js +317 -0
- package/dist/chunk-sd36yzx8.js +954 -0
- package/dist/chunk-sd6env07.js +19 -0
- package/dist/chunk-sdj9b9wh.js +782 -0
- package/dist/chunk-sfht9xvd.js +24 -0
- package/dist/chunk-sk3gpkdt.js +89 -0
- package/dist/chunk-sp5cjcjh.js +526 -0
- package/dist/chunk-sq847dr5.js +1528 -0
- package/dist/chunk-sskngwam.js +89 -0
- package/dist/chunk-svar8pp2.js +276 -0
- package/dist/chunk-szj5wvdy.js +28 -0
- package/dist/chunk-t175chdd.js +714 -0
- package/dist/chunk-t4k75hqs.js +4987 -0
- package/dist/chunk-t7z7vg91.js +225 -0
- package/dist/chunk-tanfpxm1.js +419 -0
- package/dist/chunk-tf9h0cyj.js +3037 -0
- package/dist/chunk-tm1wwvm1.js +99 -0
- package/dist/chunk-trtgjd28.js +9300 -0
- package/dist/chunk-ts2p6bv1.js +224 -0
- package/dist/chunk-ttk5dzz8.js +25 -0
- package/dist/chunk-tvg352rv.js +391 -0
- package/dist/chunk-tww14j0s.js +86 -0
- package/dist/chunk-tz03j2da.js +66 -0
- package/dist/chunk-v1kzp02e.js +785 -0
- package/dist/chunk-v2sm9w6h.js +220 -0
- package/dist/chunk-v3gm2day.js +8 -0
- package/dist/chunk-v4qn3g0d.js +286 -0
- package/dist/chunk-v66tbnn6.js +476 -0
- package/dist/chunk-v78fj8by.js +145 -0
- package/dist/chunk-v9smspw2.js +4301 -0
- package/dist/chunk-v9ybze94.js +713 -0
- package/dist/chunk-vest0y6x.js +3830 -0
- package/dist/chunk-vf5sd1nq.js +12 -0
- package/dist/chunk-vht4mzgb.js +298 -0
- package/dist/chunk-vjwgf4qh.js +41 -0
- package/dist/chunk-vkrhafhf.js +248 -0
- package/dist/chunk-vn56q87z.js +2058 -0
- package/dist/chunk-vscz82fv.js +27 -0
- package/dist/chunk-vvn4gkak.js +642 -0
- package/dist/chunk-vxj5rbg5.js +84 -0
- package/dist/chunk-vyjeh50y.js +2149 -0
- package/dist/chunk-w44nvpvt.js +22 -0
- package/dist/chunk-waambva2.js +2430 -0
- package/dist/chunk-wbhsqc2a.js +275 -0
- package/dist/chunk-wbsnpxzh.js +471 -0
- package/dist/chunk-wfz0qffj.js +3939 -0
- package/dist/chunk-wpqbrv0f.js +83 -0
- package/dist/chunk-wzpdet3m.js +843 -0
- package/dist/chunk-x6tb96y2.js +264 -0
- package/dist/chunk-x8b7vft8.js +132 -0
- package/dist/chunk-x8eg216f.js +99 -0
- package/dist/chunk-xc9khn0r.js +490 -0
- package/dist/chunk-xch406a3.js +673 -0
- package/dist/chunk-xdw5dv00.js +8 -0
- package/dist/chunk-xe0bpcbr.js +3444 -0
- package/dist/chunk-xm3ed3zn.js +300 -0
- package/dist/chunk-xpm4ebhz.js +87 -0
- package/dist/chunk-xr6yfttj.js +43 -0
- package/dist/chunk-xsq9ae7x.js +90 -0
- package/dist/chunk-xszk7n10.js +14358 -0
- package/dist/chunk-xzmkekfb.js +259 -0
- package/dist/chunk-y1784krc.js +19 -0
- package/dist/chunk-y3py9g5d.js +213 -0
- package/dist/chunk-y9nnmev5.js +687 -0
- package/dist/chunk-ya6jq0hf.js +29 -0
- package/dist/chunk-ycc3xnx0.js +374 -0
- package/dist/chunk-yfa54ssn.js +87 -0
- package/dist/chunk-ymy4xrr8.js +101 -0
- package/dist/chunk-yqfz2k9z.js +48 -0
- package/dist/chunk-ywxd4qw4.js +22 -0
- package/dist/chunk-yxmz5k16.js +122 -0
- package/dist/chunk-yxvy4jt4.js +1014 -0
- package/dist/chunk-z2dp53wn.js +17 -0
- package/dist/chunk-z2xxx2sz.js +294 -0
- package/dist/chunk-z31an09g.js +67 -0
- package/dist/chunk-z95xqvr0.js +75 -0
- package/dist/chunk-zbmxxxz8.js +161 -0
- package/dist/chunk-zk2wsm7d.js +15 -0
- package/dist/chunk-zmg1pcp3.js +71 -0
- package/dist/chunk-znrwmznk.js +272 -0
- package/dist/chunk-zq9r43cb.js +26 -0
- package/dist/chunk-zsfxha74.js +17655 -0
- package/dist/chunk-ztpr96av.js +229 -0
- package/dist/chunk-zv7qrz04.js +58 -0
- package/dist/chunk-zxa7st21.js +32 -0
- package/dist/chunk-zxhezavg.js +216 -0
- package/dist/chunk-zz0qcq2n.js +434 -0
- package/dist/cli.js +194 -0
- package/package.json +164 -0
|
@@ -0,0 +1,1947 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
__commonJS
|
|
4
|
+
} from "./chunk-qp2qdcda.js";
|
|
5
|
+
|
|
6
|
+
// node_modules/.bun/bignumber.js@9.3.1/node_modules/bignumber.js/bignumber.js
|
|
7
|
+
var require_bignumber = __commonJS((exports, module) => {
|
|
8
|
+
(function(globalObject) {
|
|
9
|
+
var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 100000000000000, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1000, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 10000000000, 100000000000, 1000000000000, 10000000000000], SQRT_BASE = 1e7, MAX = 1e9;
|
|
10
|
+
function clone(configObject) {
|
|
11
|
+
var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
12
|
+
prefix: "",
|
|
13
|
+
groupSize: 3,
|
|
14
|
+
secondaryGroupSize: 0,
|
|
15
|
+
groupSeparator: ",",
|
|
16
|
+
decimalSeparator: ".",
|
|
17
|
+
fractionGroupSize: 0,
|
|
18
|
+
fractionGroupSeparator: "\xA0",
|
|
19
|
+
suffix: ""
|
|
20
|
+
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
21
|
+
function BigNumber2(v, b) {
|
|
22
|
+
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
23
|
+
if (!(x instanceof BigNumber2))
|
|
24
|
+
return new BigNumber2(v, b);
|
|
25
|
+
if (b == null) {
|
|
26
|
+
if (v && v._isBigNumber === true) {
|
|
27
|
+
x.s = v.s;
|
|
28
|
+
if (!v.c || v.e > MAX_EXP) {
|
|
29
|
+
x.c = x.e = null;
|
|
30
|
+
} else if (v.e < MIN_EXP) {
|
|
31
|
+
x.c = [x.e = 0];
|
|
32
|
+
} else {
|
|
33
|
+
x.e = v.e;
|
|
34
|
+
x.c = v.c.slice();
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
39
|
+
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
40
|
+
if (v === ~~v) {
|
|
41
|
+
for (e = 0, i = v;i >= 10; i /= 10, e++)
|
|
42
|
+
;
|
|
43
|
+
if (e > MAX_EXP) {
|
|
44
|
+
x.c = x.e = null;
|
|
45
|
+
} else {
|
|
46
|
+
x.e = e;
|
|
47
|
+
x.c = [v];
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
str = String(v);
|
|
52
|
+
} else {
|
|
53
|
+
if (!isNumeric.test(str = String(v)))
|
|
54
|
+
return parseNumeric(x, str, isNum);
|
|
55
|
+
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
56
|
+
}
|
|
57
|
+
if ((e = str.indexOf(".")) > -1)
|
|
58
|
+
str = str.replace(".", "");
|
|
59
|
+
if ((i = str.search(/e/i)) > 0) {
|
|
60
|
+
if (e < 0)
|
|
61
|
+
e = i;
|
|
62
|
+
e += +str.slice(i + 1);
|
|
63
|
+
str = str.substring(0, i);
|
|
64
|
+
} else if (e < 0) {
|
|
65
|
+
e = str.length;
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
69
|
+
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
70
|
+
x = new BigNumber2(v);
|
|
71
|
+
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
72
|
+
}
|
|
73
|
+
str = String(v);
|
|
74
|
+
if (isNum = typeof v == "number") {
|
|
75
|
+
if (v * 0 != 0)
|
|
76
|
+
return parseNumeric(x, str, isNum, b);
|
|
77
|
+
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
78
|
+
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
79
|
+
throw Error(tooManyDigits + v);
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
83
|
+
}
|
|
84
|
+
alphabet = ALPHABET.slice(0, b);
|
|
85
|
+
e = i = 0;
|
|
86
|
+
for (len = str.length;i < len; i++) {
|
|
87
|
+
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
88
|
+
if (c == ".") {
|
|
89
|
+
if (i > e) {
|
|
90
|
+
e = len;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
} else if (!caseChanged) {
|
|
94
|
+
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
95
|
+
caseChanged = true;
|
|
96
|
+
i = -1;
|
|
97
|
+
e = 0;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return parseNumeric(x, String(v), isNum, b);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
isNum = false;
|
|
105
|
+
str = convertBase(str, b, 10, x.s);
|
|
106
|
+
if ((e = str.indexOf(".")) > -1)
|
|
107
|
+
str = str.replace(".", "");
|
|
108
|
+
else
|
|
109
|
+
e = str.length;
|
|
110
|
+
}
|
|
111
|
+
for (i = 0;str.charCodeAt(i) === 48; i++)
|
|
112
|
+
;
|
|
113
|
+
for (len = str.length;str.charCodeAt(--len) === 48; )
|
|
114
|
+
;
|
|
115
|
+
if (str = str.slice(i, ++len)) {
|
|
116
|
+
len -= i;
|
|
117
|
+
if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
118
|
+
throw Error(tooManyDigits + x.s * v);
|
|
119
|
+
}
|
|
120
|
+
if ((e = e - i - 1) > MAX_EXP) {
|
|
121
|
+
x.c = x.e = null;
|
|
122
|
+
} else if (e < MIN_EXP) {
|
|
123
|
+
x.c = [x.e = 0];
|
|
124
|
+
} else {
|
|
125
|
+
x.e = e;
|
|
126
|
+
x.c = [];
|
|
127
|
+
i = (e + 1) % LOG_BASE;
|
|
128
|
+
if (e < 0)
|
|
129
|
+
i += LOG_BASE;
|
|
130
|
+
if (i < len) {
|
|
131
|
+
if (i)
|
|
132
|
+
x.c.push(+str.slice(0, i));
|
|
133
|
+
for (len -= LOG_BASE;i < len; ) {
|
|
134
|
+
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
135
|
+
}
|
|
136
|
+
i = LOG_BASE - (str = str.slice(i)).length;
|
|
137
|
+
} else {
|
|
138
|
+
i -= len;
|
|
139
|
+
}
|
|
140
|
+
for (;i--; str += "0")
|
|
141
|
+
;
|
|
142
|
+
x.c.push(+str);
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
x.c = [x.e = 0];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
BigNumber2.clone = clone;
|
|
149
|
+
BigNumber2.ROUND_UP = 0;
|
|
150
|
+
BigNumber2.ROUND_DOWN = 1;
|
|
151
|
+
BigNumber2.ROUND_CEIL = 2;
|
|
152
|
+
BigNumber2.ROUND_FLOOR = 3;
|
|
153
|
+
BigNumber2.ROUND_HALF_UP = 4;
|
|
154
|
+
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
155
|
+
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
156
|
+
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
157
|
+
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
158
|
+
BigNumber2.EUCLID = 9;
|
|
159
|
+
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
160
|
+
var p, v;
|
|
161
|
+
if (obj != null) {
|
|
162
|
+
if (typeof obj == "object") {
|
|
163
|
+
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
164
|
+
v = obj[p];
|
|
165
|
+
intCheck(v, 0, MAX, p);
|
|
166
|
+
DECIMAL_PLACES = v;
|
|
167
|
+
}
|
|
168
|
+
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
169
|
+
v = obj[p];
|
|
170
|
+
intCheck(v, 0, 8, p);
|
|
171
|
+
ROUNDING_MODE = v;
|
|
172
|
+
}
|
|
173
|
+
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
174
|
+
v = obj[p];
|
|
175
|
+
if (v && v.pop) {
|
|
176
|
+
intCheck(v[0], -MAX, 0, p);
|
|
177
|
+
intCheck(v[1], 0, MAX, p);
|
|
178
|
+
TO_EXP_NEG = v[0];
|
|
179
|
+
TO_EXP_POS = v[1];
|
|
180
|
+
} else {
|
|
181
|
+
intCheck(v, -MAX, MAX, p);
|
|
182
|
+
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
186
|
+
v = obj[p];
|
|
187
|
+
if (v && v.pop) {
|
|
188
|
+
intCheck(v[0], -MAX, -1, p);
|
|
189
|
+
intCheck(v[1], 1, MAX, p);
|
|
190
|
+
MIN_EXP = v[0];
|
|
191
|
+
MAX_EXP = v[1];
|
|
192
|
+
} else {
|
|
193
|
+
intCheck(v, -MAX, MAX, p);
|
|
194
|
+
if (v) {
|
|
195
|
+
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
196
|
+
} else {
|
|
197
|
+
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
202
|
+
v = obj[p];
|
|
203
|
+
if (v === !!v) {
|
|
204
|
+
if (v) {
|
|
205
|
+
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
206
|
+
CRYPTO = v;
|
|
207
|
+
} else {
|
|
208
|
+
CRYPTO = !v;
|
|
209
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
CRYPTO = v;
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
throw Error(bignumberError + p + " not true or false: " + v);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
219
|
+
v = obj[p];
|
|
220
|
+
intCheck(v, 0, 9, p);
|
|
221
|
+
MODULO_MODE = v;
|
|
222
|
+
}
|
|
223
|
+
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
224
|
+
v = obj[p];
|
|
225
|
+
intCheck(v, 0, MAX, p);
|
|
226
|
+
POW_PRECISION = v;
|
|
227
|
+
}
|
|
228
|
+
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
229
|
+
v = obj[p];
|
|
230
|
+
if (typeof v == "object")
|
|
231
|
+
FORMAT = v;
|
|
232
|
+
else
|
|
233
|
+
throw Error(bignumberError + p + " not an object: " + v);
|
|
234
|
+
}
|
|
235
|
+
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
236
|
+
v = obj[p];
|
|
237
|
+
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
238
|
+
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
239
|
+
ALPHABET = v;
|
|
240
|
+
} else {
|
|
241
|
+
throw Error(bignumberError + p + " invalid: " + v);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
throw Error(bignumberError + "Object expected: " + obj);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
DECIMAL_PLACES,
|
|
250
|
+
ROUNDING_MODE,
|
|
251
|
+
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
252
|
+
RANGE: [MIN_EXP, MAX_EXP],
|
|
253
|
+
CRYPTO,
|
|
254
|
+
MODULO_MODE,
|
|
255
|
+
POW_PRECISION,
|
|
256
|
+
FORMAT,
|
|
257
|
+
ALPHABET
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
BigNumber2.isBigNumber = function(v) {
|
|
261
|
+
if (!v || v._isBigNumber !== true)
|
|
262
|
+
return false;
|
|
263
|
+
if (!BigNumber2.DEBUG)
|
|
264
|
+
return true;
|
|
265
|
+
var i, n, c = v.c, e = v.e, s = v.s;
|
|
266
|
+
out:
|
|
267
|
+
if ({}.toString.call(c) == "[object Array]") {
|
|
268
|
+
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
269
|
+
if (c[0] === 0) {
|
|
270
|
+
if (e === 0 && c.length === 1)
|
|
271
|
+
return true;
|
|
272
|
+
break out;
|
|
273
|
+
}
|
|
274
|
+
i = (e + 1) % LOG_BASE;
|
|
275
|
+
if (i < 1)
|
|
276
|
+
i += LOG_BASE;
|
|
277
|
+
if (String(c[0]).length == i) {
|
|
278
|
+
for (i = 0;i < c.length; i++) {
|
|
279
|
+
n = c[i];
|
|
280
|
+
if (n < 0 || n >= BASE || n !== mathfloor(n))
|
|
281
|
+
break out;
|
|
282
|
+
}
|
|
283
|
+
if (n !== 0)
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
291
|
+
};
|
|
292
|
+
BigNumber2.maximum = BigNumber2.max = function() {
|
|
293
|
+
return maxOrMin(arguments, -1);
|
|
294
|
+
};
|
|
295
|
+
BigNumber2.minimum = BigNumber2.min = function() {
|
|
296
|
+
return maxOrMin(arguments, 1);
|
|
297
|
+
};
|
|
298
|
+
BigNumber2.random = function() {
|
|
299
|
+
var pow2_53 = 9007199254740992;
|
|
300
|
+
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
301
|
+
return mathfloor(Math.random() * pow2_53);
|
|
302
|
+
} : function() {
|
|
303
|
+
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
304
|
+
};
|
|
305
|
+
return function(dp) {
|
|
306
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
307
|
+
if (dp == null)
|
|
308
|
+
dp = DECIMAL_PLACES;
|
|
309
|
+
else
|
|
310
|
+
intCheck(dp, 0, MAX);
|
|
311
|
+
k = mathceil(dp / LOG_BASE);
|
|
312
|
+
if (CRYPTO) {
|
|
313
|
+
if (crypto.getRandomValues) {
|
|
314
|
+
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
315
|
+
for (;i < k; ) {
|
|
316
|
+
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
317
|
+
if (v >= 9000000000000000) {
|
|
318
|
+
b = crypto.getRandomValues(new Uint32Array(2));
|
|
319
|
+
a[i] = b[0];
|
|
320
|
+
a[i + 1] = b[1];
|
|
321
|
+
} else {
|
|
322
|
+
c.push(v % 100000000000000);
|
|
323
|
+
i += 2;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
i = k / 2;
|
|
327
|
+
} else if (crypto.randomBytes) {
|
|
328
|
+
a = crypto.randomBytes(k *= 7);
|
|
329
|
+
for (;i < k; ) {
|
|
330
|
+
v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
|
|
331
|
+
if (v >= 9000000000000000) {
|
|
332
|
+
crypto.randomBytes(7).copy(a, i);
|
|
333
|
+
} else {
|
|
334
|
+
c.push(v % 100000000000000);
|
|
335
|
+
i += 7;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
i = k / 7;
|
|
339
|
+
} else {
|
|
340
|
+
CRYPTO = false;
|
|
341
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (!CRYPTO) {
|
|
345
|
+
for (;i < k; ) {
|
|
346
|
+
v = random53bitInt();
|
|
347
|
+
if (v < 9000000000000000)
|
|
348
|
+
c[i++] = v % 100000000000000;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
k = c[--i];
|
|
352
|
+
dp %= LOG_BASE;
|
|
353
|
+
if (k && dp) {
|
|
354
|
+
v = POWS_TEN[LOG_BASE - dp];
|
|
355
|
+
c[i] = mathfloor(k / v) * v;
|
|
356
|
+
}
|
|
357
|
+
for (;c[i] === 0; c.pop(), i--)
|
|
358
|
+
;
|
|
359
|
+
if (i < 0) {
|
|
360
|
+
c = [e = 0];
|
|
361
|
+
} else {
|
|
362
|
+
for (e = -1;c[0] === 0; c.splice(0, 1), e -= LOG_BASE)
|
|
363
|
+
;
|
|
364
|
+
for (i = 1, v = c[0];v >= 10; v /= 10, i++)
|
|
365
|
+
;
|
|
366
|
+
if (i < LOG_BASE)
|
|
367
|
+
e -= LOG_BASE - i;
|
|
368
|
+
}
|
|
369
|
+
rand.e = e;
|
|
370
|
+
rand.c = c;
|
|
371
|
+
return rand;
|
|
372
|
+
};
|
|
373
|
+
}();
|
|
374
|
+
BigNumber2.sum = function() {
|
|
375
|
+
var i = 1, args = arguments, sum = new BigNumber2(args[0]);
|
|
376
|
+
for (;i < args.length; )
|
|
377
|
+
sum = sum.plus(args[i++]);
|
|
378
|
+
return sum;
|
|
379
|
+
};
|
|
380
|
+
convertBase = function() {
|
|
381
|
+
var decimal = "0123456789";
|
|
382
|
+
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
383
|
+
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
384
|
+
for (;i < len; ) {
|
|
385
|
+
for (arrL = arr.length;arrL--; arr[arrL] *= baseIn)
|
|
386
|
+
;
|
|
387
|
+
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
388
|
+
for (j = 0;j < arr.length; j++) {
|
|
389
|
+
if (arr[j] > baseOut - 1) {
|
|
390
|
+
if (arr[j + 1] == null)
|
|
391
|
+
arr[j + 1] = 0;
|
|
392
|
+
arr[j + 1] += arr[j] / baseOut | 0;
|
|
393
|
+
arr[j] %= baseOut;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return arr.reverse();
|
|
398
|
+
}
|
|
399
|
+
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
400
|
+
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
401
|
+
if (i >= 0) {
|
|
402
|
+
k = POW_PRECISION;
|
|
403
|
+
POW_PRECISION = 0;
|
|
404
|
+
str = str.replace(".", "");
|
|
405
|
+
y = new BigNumber2(baseIn);
|
|
406
|
+
x = y.pow(str.length - i);
|
|
407
|
+
POW_PRECISION = k;
|
|
408
|
+
y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, "0"), 10, baseOut, decimal);
|
|
409
|
+
y.e = y.c.length;
|
|
410
|
+
}
|
|
411
|
+
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
412
|
+
e = k = xc.length;
|
|
413
|
+
for (;xc[--k] == 0; xc.pop())
|
|
414
|
+
;
|
|
415
|
+
if (!xc[0])
|
|
416
|
+
return alphabet.charAt(0);
|
|
417
|
+
if (i < 0) {
|
|
418
|
+
--e;
|
|
419
|
+
} else {
|
|
420
|
+
x.c = xc;
|
|
421
|
+
x.e = e;
|
|
422
|
+
x.s = sign;
|
|
423
|
+
x = div(x, y, dp, rm, baseOut);
|
|
424
|
+
xc = x.c;
|
|
425
|
+
r = x.r;
|
|
426
|
+
e = x.e;
|
|
427
|
+
}
|
|
428
|
+
d = e + dp + 1;
|
|
429
|
+
i = xc[d];
|
|
430
|
+
k = baseOut / 2;
|
|
431
|
+
r = r || d < 0 || xc[d + 1] != null;
|
|
432
|
+
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
433
|
+
if (d < 1 || !xc[0]) {
|
|
434
|
+
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
435
|
+
} else {
|
|
436
|
+
xc.length = d;
|
|
437
|
+
if (r) {
|
|
438
|
+
for (--baseOut;++xc[--d] > baseOut; ) {
|
|
439
|
+
xc[d] = 0;
|
|
440
|
+
if (!d) {
|
|
441
|
+
++e;
|
|
442
|
+
xc = [1].concat(xc);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
for (k = xc.length;!xc[--k]; )
|
|
447
|
+
;
|
|
448
|
+
for (i = 0, str = "";i <= k; str += alphabet.charAt(xc[i++]))
|
|
449
|
+
;
|
|
450
|
+
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
451
|
+
}
|
|
452
|
+
return str;
|
|
453
|
+
};
|
|
454
|
+
}();
|
|
455
|
+
div = function() {
|
|
456
|
+
function multiply(x, k, base) {
|
|
457
|
+
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
458
|
+
for (x = x.slice();i--; ) {
|
|
459
|
+
xlo = x[i] % SQRT_BASE;
|
|
460
|
+
xhi = x[i] / SQRT_BASE | 0;
|
|
461
|
+
m = khi * xlo + xhi * klo;
|
|
462
|
+
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
463
|
+
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
464
|
+
x[i] = temp % base;
|
|
465
|
+
}
|
|
466
|
+
if (carry)
|
|
467
|
+
x = [carry].concat(x);
|
|
468
|
+
return x;
|
|
469
|
+
}
|
|
470
|
+
function compare2(a, b, aL, bL) {
|
|
471
|
+
var i, cmp;
|
|
472
|
+
if (aL != bL) {
|
|
473
|
+
cmp = aL > bL ? 1 : -1;
|
|
474
|
+
} else {
|
|
475
|
+
for (i = cmp = 0;i < aL; i++) {
|
|
476
|
+
if (a[i] != b[i]) {
|
|
477
|
+
cmp = a[i] > b[i] ? 1 : -1;
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return cmp;
|
|
483
|
+
}
|
|
484
|
+
function subtract(a, b, aL, base) {
|
|
485
|
+
var i = 0;
|
|
486
|
+
for (;aL--; ) {
|
|
487
|
+
a[aL] -= i;
|
|
488
|
+
i = a[aL] < b[aL] ? 1 : 0;
|
|
489
|
+
a[aL] = i * base + a[aL] - b[aL];
|
|
490
|
+
}
|
|
491
|
+
for (;!a[0] && a.length > 1; a.splice(0, 1))
|
|
492
|
+
;
|
|
493
|
+
}
|
|
494
|
+
return function(x, y, dp, rm, base) {
|
|
495
|
+
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
496
|
+
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
497
|
+
return new BigNumber2(!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : xc && xc[0] == 0 || !yc ? s * 0 : s / 0);
|
|
498
|
+
}
|
|
499
|
+
q = new BigNumber2(s);
|
|
500
|
+
qc = q.c = [];
|
|
501
|
+
e = x.e - y.e;
|
|
502
|
+
s = dp + e + 1;
|
|
503
|
+
if (!base) {
|
|
504
|
+
base = BASE;
|
|
505
|
+
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
506
|
+
s = s / LOG_BASE | 0;
|
|
507
|
+
}
|
|
508
|
+
for (i = 0;yc[i] == (xc[i] || 0); i++)
|
|
509
|
+
;
|
|
510
|
+
if (yc[i] > (xc[i] || 0))
|
|
511
|
+
e--;
|
|
512
|
+
if (s < 0) {
|
|
513
|
+
qc.push(1);
|
|
514
|
+
more = true;
|
|
515
|
+
} else {
|
|
516
|
+
xL = xc.length;
|
|
517
|
+
yL = yc.length;
|
|
518
|
+
i = 0;
|
|
519
|
+
s += 2;
|
|
520
|
+
n = mathfloor(base / (yc[0] + 1));
|
|
521
|
+
if (n > 1) {
|
|
522
|
+
yc = multiply(yc, n, base);
|
|
523
|
+
xc = multiply(xc, n, base);
|
|
524
|
+
yL = yc.length;
|
|
525
|
+
xL = xc.length;
|
|
526
|
+
}
|
|
527
|
+
xi = yL;
|
|
528
|
+
rem = xc.slice(0, yL);
|
|
529
|
+
remL = rem.length;
|
|
530
|
+
for (;remL < yL; rem[remL++] = 0)
|
|
531
|
+
;
|
|
532
|
+
yz = yc.slice();
|
|
533
|
+
yz = [0].concat(yz);
|
|
534
|
+
yc0 = yc[0];
|
|
535
|
+
if (yc[1] >= base / 2)
|
|
536
|
+
yc0++;
|
|
537
|
+
do {
|
|
538
|
+
n = 0;
|
|
539
|
+
cmp = compare2(yc, rem, yL, remL);
|
|
540
|
+
if (cmp < 0) {
|
|
541
|
+
rem0 = rem[0];
|
|
542
|
+
if (yL != remL)
|
|
543
|
+
rem0 = rem0 * base + (rem[1] || 0);
|
|
544
|
+
n = mathfloor(rem0 / yc0);
|
|
545
|
+
if (n > 1) {
|
|
546
|
+
if (n >= base)
|
|
547
|
+
n = base - 1;
|
|
548
|
+
prod = multiply(yc, n, base);
|
|
549
|
+
prodL = prod.length;
|
|
550
|
+
remL = rem.length;
|
|
551
|
+
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
552
|
+
n--;
|
|
553
|
+
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
554
|
+
prodL = prod.length;
|
|
555
|
+
cmp = 1;
|
|
556
|
+
}
|
|
557
|
+
} else {
|
|
558
|
+
if (n == 0) {
|
|
559
|
+
cmp = n = 1;
|
|
560
|
+
}
|
|
561
|
+
prod = yc.slice();
|
|
562
|
+
prodL = prod.length;
|
|
563
|
+
}
|
|
564
|
+
if (prodL < remL)
|
|
565
|
+
prod = [0].concat(prod);
|
|
566
|
+
subtract(rem, prod, remL, base);
|
|
567
|
+
remL = rem.length;
|
|
568
|
+
if (cmp == -1) {
|
|
569
|
+
while (compare2(yc, rem, yL, remL) < 1) {
|
|
570
|
+
n++;
|
|
571
|
+
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
572
|
+
remL = rem.length;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
} else if (cmp === 0) {
|
|
576
|
+
n++;
|
|
577
|
+
rem = [0];
|
|
578
|
+
}
|
|
579
|
+
qc[i++] = n;
|
|
580
|
+
if (rem[0]) {
|
|
581
|
+
rem[remL++] = xc[xi] || 0;
|
|
582
|
+
} else {
|
|
583
|
+
rem = [xc[xi]];
|
|
584
|
+
remL = 1;
|
|
585
|
+
}
|
|
586
|
+
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
587
|
+
more = rem[0] != null;
|
|
588
|
+
if (!qc[0])
|
|
589
|
+
qc.splice(0, 1);
|
|
590
|
+
}
|
|
591
|
+
if (base == BASE) {
|
|
592
|
+
for (i = 1, s = qc[0];s >= 10; s /= 10, i++)
|
|
593
|
+
;
|
|
594
|
+
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
595
|
+
} else {
|
|
596
|
+
q.e = e;
|
|
597
|
+
q.r = +more;
|
|
598
|
+
}
|
|
599
|
+
return q;
|
|
600
|
+
};
|
|
601
|
+
}();
|
|
602
|
+
function format(n, i, rm, id) {
|
|
603
|
+
var c0, e, ne, len, str;
|
|
604
|
+
if (rm == null)
|
|
605
|
+
rm = ROUNDING_MODE;
|
|
606
|
+
else
|
|
607
|
+
intCheck(rm, 0, 8);
|
|
608
|
+
if (!n.c)
|
|
609
|
+
return n.toString();
|
|
610
|
+
c0 = n.c[0];
|
|
611
|
+
ne = n.e;
|
|
612
|
+
if (i == null) {
|
|
613
|
+
str = coeffToString(n.c);
|
|
614
|
+
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
615
|
+
} else {
|
|
616
|
+
n = round(new BigNumber2(n), i, rm);
|
|
617
|
+
e = n.e;
|
|
618
|
+
str = coeffToString(n.c);
|
|
619
|
+
len = str.length;
|
|
620
|
+
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
621
|
+
for (;len < i; str += "0", len++)
|
|
622
|
+
;
|
|
623
|
+
str = toExponential(str, e);
|
|
624
|
+
} else {
|
|
625
|
+
i -= ne + (id === 2 && e > ne);
|
|
626
|
+
str = toFixedPoint(str, e, "0");
|
|
627
|
+
if (e + 1 > len) {
|
|
628
|
+
if (--i > 0)
|
|
629
|
+
for (str += ".";i--; str += "0")
|
|
630
|
+
;
|
|
631
|
+
} else {
|
|
632
|
+
i += e - len;
|
|
633
|
+
if (i > 0) {
|
|
634
|
+
if (e + 1 == len)
|
|
635
|
+
str += ".";
|
|
636
|
+
for (;i--; str += "0")
|
|
637
|
+
;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
return n.s < 0 && c0 ? "-" + str : str;
|
|
643
|
+
}
|
|
644
|
+
function maxOrMin(args, n) {
|
|
645
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
646
|
+
for (;i < args.length; i++) {
|
|
647
|
+
y = new BigNumber2(args[i]);
|
|
648
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
649
|
+
x = y;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return x;
|
|
653
|
+
}
|
|
654
|
+
function normalise(n, c, e) {
|
|
655
|
+
var i = 1, j = c.length;
|
|
656
|
+
for (;!c[--j]; c.pop())
|
|
657
|
+
;
|
|
658
|
+
for (j = c[0];j >= 10; j /= 10, i++)
|
|
659
|
+
;
|
|
660
|
+
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
661
|
+
n.c = n.e = null;
|
|
662
|
+
} else if (e < MIN_EXP) {
|
|
663
|
+
n.c = [n.e = 0];
|
|
664
|
+
} else {
|
|
665
|
+
n.e = e;
|
|
666
|
+
n.c = c;
|
|
667
|
+
}
|
|
668
|
+
return n;
|
|
669
|
+
}
|
|
670
|
+
parseNumeric = function() {
|
|
671
|
+
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
672
|
+
return function(x, str, isNum, b) {
|
|
673
|
+
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
674
|
+
if (isInfinityOrNaN.test(s)) {
|
|
675
|
+
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
676
|
+
} else {
|
|
677
|
+
if (!isNum) {
|
|
678
|
+
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
679
|
+
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
680
|
+
return !b || b == base ? p1 : m;
|
|
681
|
+
});
|
|
682
|
+
if (b) {
|
|
683
|
+
base = b;
|
|
684
|
+
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
685
|
+
}
|
|
686
|
+
if (str != s)
|
|
687
|
+
return new BigNumber2(s, base);
|
|
688
|
+
}
|
|
689
|
+
if (BigNumber2.DEBUG) {
|
|
690
|
+
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
691
|
+
}
|
|
692
|
+
x.s = null;
|
|
693
|
+
}
|
|
694
|
+
x.c = x.e = null;
|
|
695
|
+
};
|
|
696
|
+
}();
|
|
697
|
+
function round(x, sd, rm, r) {
|
|
698
|
+
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
699
|
+
if (xc) {
|
|
700
|
+
out: {
|
|
701
|
+
for (d = 1, k = xc[0];k >= 10; k /= 10, d++)
|
|
702
|
+
;
|
|
703
|
+
i = sd - d;
|
|
704
|
+
if (i < 0) {
|
|
705
|
+
i += LOG_BASE;
|
|
706
|
+
j = sd;
|
|
707
|
+
n = xc[ni = 0];
|
|
708
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
709
|
+
} else {
|
|
710
|
+
ni = mathceil((i + 1) / LOG_BASE);
|
|
711
|
+
if (ni >= xc.length) {
|
|
712
|
+
if (r) {
|
|
713
|
+
for (;xc.length <= ni; xc.push(0))
|
|
714
|
+
;
|
|
715
|
+
n = rd = 0;
|
|
716
|
+
d = 1;
|
|
717
|
+
i %= LOG_BASE;
|
|
718
|
+
j = i - LOG_BASE + 1;
|
|
719
|
+
} else {
|
|
720
|
+
break out;
|
|
721
|
+
}
|
|
722
|
+
} else {
|
|
723
|
+
n = k = xc[ni];
|
|
724
|
+
for (d = 1;k >= 10; k /= 10, d++)
|
|
725
|
+
;
|
|
726
|
+
i %= LOG_BASE;
|
|
727
|
+
j = i - LOG_BASE + d;
|
|
728
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
r = r || sd < 0 || xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
732
|
+
r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && (i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
733
|
+
if (sd < 1 || !xc[0]) {
|
|
734
|
+
xc.length = 0;
|
|
735
|
+
if (r) {
|
|
736
|
+
sd -= x.e + 1;
|
|
737
|
+
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
738
|
+
x.e = -sd || 0;
|
|
739
|
+
} else {
|
|
740
|
+
xc[0] = x.e = 0;
|
|
741
|
+
}
|
|
742
|
+
return x;
|
|
743
|
+
}
|
|
744
|
+
if (i == 0) {
|
|
745
|
+
xc.length = ni;
|
|
746
|
+
k = 1;
|
|
747
|
+
ni--;
|
|
748
|
+
} else {
|
|
749
|
+
xc.length = ni + 1;
|
|
750
|
+
k = pows10[LOG_BASE - i];
|
|
751
|
+
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
752
|
+
}
|
|
753
|
+
if (r) {
|
|
754
|
+
for (;; ) {
|
|
755
|
+
if (ni == 0) {
|
|
756
|
+
for (i = 1, j = xc[0];j >= 10; j /= 10, i++)
|
|
757
|
+
;
|
|
758
|
+
j = xc[0] += k;
|
|
759
|
+
for (k = 1;j >= 10; j /= 10, k++)
|
|
760
|
+
;
|
|
761
|
+
if (i != k) {
|
|
762
|
+
x.e++;
|
|
763
|
+
if (xc[0] == BASE)
|
|
764
|
+
xc[0] = 1;
|
|
765
|
+
}
|
|
766
|
+
break;
|
|
767
|
+
} else {
|
|
768
|
+
xc[ni] += k;
|
|
769
|
+
if (xc[ni] != BASE)
|
|
770
|
+
break;
|
|
771
|
+
xc[ni--] = 0;
|
|
772
|
+
k = 1;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
for (i = xc.length;xc[--i] === 0; xc.pop())
|
|
777
|
+
;
|
|
778
|
+
}
|
|
779
|
+
if (x.e > MAX_EXP) {
|
|
780
|
+
x.c = x.e = null;
|
|
781
|
+
} else if (x.e < MIN_EXP) {
|
|
782
|
+
x.c = [x.e = 0];
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return x;
|
|
786
|
+
}
|
|
787
|
+
function valueOf(n) {
|
|
788
|
+
var str, e = n.e;
|
|
789
|
+
if (e === null)
|
|
790
|
+
return n.toString();
|
|
791
|
+
str = coeffToString(n.c);
|
|
792
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
793
|
+
return n.s < 0 ? "-" + str : str;
|
|
794
|
+
}
|
|
795
|
+
P.absoluteValue = P.abs = function() {
|
|
796
|
+
var x = new BigNumber2(this);
|
|
797
|
+
if (x.s < 0)
|
|
798
|
+
x.s = 1;
|
|
799
|
+
return x;
|
|
800
|
+
};
|
|
801
|
+
P.comparedTo = function(y, b) {
|
|
802
|
+
return compare(this, new BigNumber2(y, b));
|
|
803
|
+
};
|
|
804
|
+
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
805
|
+
var c, n, v, x = this;
|
|
806
|
+
if (dp != null) {
|
|
807
|
+
intCheck(dp, 0, MAX);
|
|
808
|
+
if (rm == null)
|
|
809
|
+
rm = ROUNDING_MODE;
|
|
810
|
+
else
|
|
811
|
+
intCheck(rm, 0, 8);
|
|
812
|
+
return round(new BigNumber2(x), dp + x.e + 1, rm);
|
|
813
|
+
}
|
|
814
|
+
if (!(c = x.c))
|
|
815
|
+
return null;
|
|
816
|
+
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
817
|
+
if (v = c[v])
|
|
818
|
+
for (;v % 10 == 0; v /= 10, n--)
|
|
819
|
+
;
|
|
820
|
+
if (n < 0)
|
|
821
|
+
n = 0;
|
|
822
|
+
return n;
|
|
823
|
+
};
|
|
824
|
+
P.dividedBy = P.div = function(y, b) {
|
|
825
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
826
|
+
};
|
|
827
|
+
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
828
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
829
|
+
};
|
|
830
|
+
P.exponentiatedBy = P.pow = function(n, m) {
|
|
831
|
+
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
832
|
+
n = new BigNumber2(n);
|
|
833
|
+
if (n.c && !n.isInteger()) {
|
|
834
|
+
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
835
|
+
}
|
|
836
|
+
if (m != null)
|
|
837
|
+
m = new BigNumber2(m);
|
|
838
|
+
nIsBig = n.e > 14;
|
|
839
|
+
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
840
|
+
y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
841
|
+
return m ? y.mod(m) : y;
|
|
842
|
+
}
|
|
843
|
+
nIsNeg = n.s < 0;
|
|
844
|
+
if (m) {
|
|
845
|
+
if (m.c ? !m.c[0] : !m.s)
|
|
846
|
+
return new BigNumber2(NaN);
|
|
847
|
+
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
848
|
+
if (isModExp)
|
|
849
|
+
x = x.mod(m);
|
|
850
|
+
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 240000000 : x.c[0] < 80000000000000 || nIsBig && x.c[0] <= 99999750000000))) {
|
|
851
|
+
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
852
|
+
if (x.e > -1)
|
|
853
|
+
k = 1 / k;
|
|
854
|
+
return new BigNumber2(nIsNeg ? 1 / k : k);
|
|
855
|
+
} else if (POW_PRECISION) {
|
|
856
|
+
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
857
|
+
}
|
|
858
|
+
if (nIsBig) {
|
|
859
|
+
half = new BigNumber2(0.5);
|
|
860
|
+
if (nIsNeg)
|
|
861
|
+
n.s = 1;
|
|
862
|
+
nIsOdd = isOdd(n);
|
|
863
|
+
} else {
|
|
864
|
+
i = Math.abs(+valueOf(n));
|
|
865
|
+
nIsOdd = i % 2;
|
|
866
|
+
}
|
|
867
|
+
y = new BigNumber2(ONE);
|
|
868
|
+
for (;; ) {
|
|
869
|
+
if (nIsOdd) {
|
|
870
|
+
y = y.times(x);
|
|
871
|
+
if (!y.c)
|
|
872
|
+
break;
|
|
873
|
+
if (k) {
|
|
874
|
+
if (y.c.length > k)
|
|
875
|
+
y.c.length = k;
|
|
876
|
+
} else if (isModExp) {
|
|
877
|
+
y = y.mod(m);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
if (i) {
|
|
881
|
+
i = mathfloor(i / 2);
|
|
882
|
+
if (i === 0)
|
|
883
|
+
break;
|
|
884
|
+
nIsOdd = i % 2;
|
|
885
|
+
} else {
|
|
886
|
+
n = n.times(half);
|
|
887
|
+
round(n, n.e + 1, 1);
|
|
888
|
+
if (n.e > 14) {
|
|
889
|
+
nIsOdd = isOdd(n);
|
|
890
|
+
} else {
|
|
891
|
+
i = +valueOf(n);
|
|
892
|
+
if (i === 0)
|
|
893
|
+
break;
|
|
894
|
+
nIsOdd = i % 2;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
x = x.times(x);
|
|
898
|
+
if (k) {
|
|
899
|
+
if (x.c && x.c.length > k)
|
|
900
|
+
x.c.length = k;
|
|
901
|
+
} else if (isModExp) {
|
|
902
|
+
x = x.mod(m);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
if (isModExp)
|
|
906
|
+
return y;
|
|
907
|
+
if (nIsNeg)
|
|
908
|
+
y = ONE.div(y);
|
|
909
|
+
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
910
|
+
};
|
|
911
|
+
P.integerValue = function(rm) {
|
|
912
|
+
var n = new BigNumber2(this);
|
|
913
|
+
if (rm == null)
|
|
914
|
+
rm = ROUNDING_MODE;
|
|
915
|
+
else
|
|
916
|
+
intCheck(rm, 0, 8);
|
|
917
|
+
return round(n, n.e + 1, rm);
|
|
918
|
+
};
|
|
919
|
+
P.isEqualTo = P.eq = function(y, b) {
|
|
920
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
921
|
+
};
|
|
922
|
+
P.isFinite = function() {
|
|
923
|
+
return !!this.c;
|
|
924
|
+
};
|
|
925
|
+
P.isGreaterThan = P.gt = function(y, b) {
|
|
926
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
927
|
+
};
|
|
928
|
+
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
929
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
930
|
+
};
|
|
931
|
+
P.isInteger = function() {
|
|
932
|
+
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
933
|
+
};
|
|
934
|
+
P.isLessThan = P.lt = function(y, b) {
|
|
935
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
936
|
+
};
|
|
937
|
+
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
938
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
939
|
+
};
|
|
940
|
+
P.isNaN = function() {
|
|
941
|
+
return !this.s;
|
|
942
|
+
};
|
|
943
|
+
P.isNegative = function() {
|
|
944
|
+
return this.s < 0;
|
|
945
|
+
};
|
|
946
|
+
P.isPositive = function() {
|
|
947
|
+
return this.s > 0;
|
|
948
|
+
};
|
|
949
|
+
P.isZero = function() {
|
|
950
|
+
return !!this.c && this.c[0] == 0;
|
|
951
|
+
};
|
|
952
|
+
P.minus = function(y, b) {
|
|
953
|
+
var i, j, t, xLTy, x = this, a = x.s;
|
|
954
|
+
y = new BigNumber2(y, b);
|
|
955
|
+
b = y.s;
|
|
956
|
+
if (!a || !b)
|
|
957
|
+
return new BigNumber2(NaN);
|
|
958
|
+
if (a != b) {
|
|
959
|
+
y.s = -b;
|
|
960
|
+
return x.plus(y);
|
|
961
|
+
}
|
|
962
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
963
|
+
if (!xe || !ye) {
|
|
964
|
+
if (!xc || !yc)
|
|
965
|
+
return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
966
|
+
if (!xc[0] || !yc[0]) {
|
|
967
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : ROUNDING_MODE == 3 ? -0 : 0);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
xe = bitFloor(xe);
|
|
971
|
+
ye = bitFloor(ye);
|
|
972
|
+
xc = xc.slice();
|
|
973
|
+
if (a = xe - ye) {
|
|
974
|
+
if (xLTy = a < 0) {
|
|
975
|
+
a = -a;
|
|
976
|
+
t = xc;
|
|
977
|
+
} else {
|
|
978
|
+
ye = xe;
|
|
979
|
+
t = yc;
|
|
980
|
+
}
|
|
981
|
+
t.reverse();
|
|
982
|
+
for (b = a;b--; t.push(0))
|
|
983
|
+
;
|
|
984
|
+
t.reverse();
|
|
985
|
+
} else {
|
|
986
|
+
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
987
|
+
for (a = b = 0;b < j; b++) {
|
|
988
|
+
if (xc[b] != yc[b]) {
|
|
989
|
+
xLTy = xc[b] < yc[b];
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
if (xLTy) {
|
|
995
|
+
t = xc;
|
|
996
|
+
xc = yc;
|
|
997
|
+
yc = t;
|
|
998
|
+
y.s = -y.s;
|
|
999
|
+
}
|
|
1000
|
+
b = (j = yc.length) - (i = xc.length);
|
|
1001
|
+
if (b > 0)
|
|
1002
|
+
for (;b--; xc[i++] = 0)
|
|
1003
|
+
;
|
|
1004
|
+
b = BASE - 1;
|
|
1005
|
+
for (;j > a; ) {
|
|
1006
|
+
if (xc[--j] < yc[j]) {
|
|
1007
|
+
for (i = j;i && !xc[--i]; xc[i] = b)
|
|
1008
|
+
;
|
|
1009
|
+
--xc[i];
|
|
1010
|
+
xc[j] += BASE;
|
|
1011
|
+
}
|
|
1012
|
+
xc[j] -= yc[j];
|
|
1013
|
+
}
|
|
1014
|
+
for (;xc[0] == 0; xc.splice(0, 1), --ye)
|
|
1015
|
+
;
|
|
1016
|
+
if (!xc[0]) {
|
|
1017
|
+
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
1018
|
+
y.c = [y.e = 0];
|
|
1019
|
+
return y;
|
|
1020
|
+
}
|
|
1021
|
+
return normalise(y, xc, ye);
|
|
1022
|
+
};
|
|
1023
|
+
P.modulo = P.mod = function(y, b) {
|
|
1024
|
+
var q, s, x = this;
|
|
1025
|
+
y = new BigNumber2(y, b);
|
|
1026
|
+
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
1027
|
+
return new BigNumber2(NaN);
|
|
1028
|
+
} else if (!y.c || x.c && !x.c[0]) {
|
|
1029
|
+
return new BigNumber2(x);
|
|
1030
|
+
}
|
|
1031
|
+
if (MODULO_MODE == 9) {
|
|
1032
|
+
s = y.s;
|
|
1033
|
+
y.s = 1;
|
|
1034
|
+
q = div(x, y, 0, 3);
|
|
1035
|
+
y.s = s;
|
|
1036
|
+
q.s *= s;
|
|
1037
|
+
} else {
|
|
1038
|
+
q = div(x, y, 0, MODULO_MODE);
|
|
1039
|
+
}
|
|
1040
|
+
y = x.minus(q.times(y));
|
|
1041
|
+
if (!y.c[0] && MODULO_MODE == 1)
|
|
1042
|
+
y.s = x.s;
|
|
1043
|
+
return y;
|
|
1044
|
+
};
|
|
1045
|
+
P.multipliedBy = P.times = function(y, b) {
|
|
1046
|
+
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber2(y, b)).c;
|
|
1047
|
+
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
1048
|
+
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
1049
|
+
y.c = y.e = y.s = null;
|
|
1050
|
+
} else {
|
|
1051
|
+
y.s *= x.s;
|
|
1052
|
+
if (!xc || !yc) {
|
|
1053
|
+
y.c = y.e = null;
|
|
1054
|
+
} else {
|
|
1055
|
+
y.c = [0];
|
|
1056
|
+
y.e = 0;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
return y;
|
|
1060
|
+
}
|
|
1061
|
+
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
1062
|
+
y.s *= x.s;
|
|
1063
|
+
xcL = xc.length;
|
|
1064
|
+
ycL = yc.length;
|
|
1065
|
+
if (xcL < ycL) {
|
|
1066
|
+
zc = xc;
|
|
1067
|
+
xc = yc;
|
|
1068
|
+
yc = zc;
|
|
1069
|
+
i = xcL;
|
|
1070
|
+
xcL = ycL;
|
|
1071
|
+
ycL = i;
|
|
1072
|
+
}
|
|
1073
|
+
for (i = xcL + ycL, zc = [];i--; zc.push(0))
|
|
1074
|
+
;
|
|
1075
|
+
base = BASE;
|
|
1076
|
+
sqrtBase = SQRT_BASE;
|
|
1077
|
+
for (i = ycL;--i >= 0; ) {
|
|
1078
|
+
c = 0;
|
|
1079
|
+
ylo = yc[i] % sqrtBase;
|
|
1080
|
+
yhi = yc[i] / sqrtBase | 0;
|
|
1081
|
+
for (k = xcL, j = i + k;j > i; ) {
|
|
1082
|
+
xlo = xc[--k] % sqrtBase;
|
|
1083
|
+
xhi = xc[k] / sqrtBase | 0;
|
|
1084
|
+
m = yhi * xlo + xhi * ylo;
|
|
1085
|
+
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
1086
|
+
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
1087
|
+
zc[j--] = xlo % base;
|
|
1088
|
+
}
|
|
1089
|
+
zc[j] = c;
|
|
1090
|
+
}
|
|
1091
|
+
if (c) {
|
|
1092
|
+
++e;
|
|
1093
|
+
} else {
|
|
1094
|
+
zc.splice(0, 1);
|
|
1095
|
+
}
|
|
1096
|
+
return normalise(y, zc, e);
|
|
1097
|
+
};
|
|
1098
|
+
P.negated = function() {
|
|
1099
|
+
var x = new BigNumber2(this);
|
|
1100
|
+
x.s = -x.s || null;
|
|
1101
|
+
return x;
|
|
1102
|
+
};
|
|
1103
|
+
P.plus = function(y, b) {
|
|
1104
|
+
var t, x = this, a = x.s;
|
|
1105
|
+
y = new BigNumber2(y, b);
|
|
1106
|
+
b = y.s;
|
|
1107
|
+
if (!a || !b)
|
|
1108
|
+
return new BigNumber2(NaN);
|
|
1109
|
+
if (a != b) {
|
|
1110
|
+
y.s = -b;
|
|
1111
|
+
return x.minus(y);
|
|
1112
|
+
}
|
|
1113
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
1114
|
+
if (!xe || !ye) {
|
|
1115
|
+
if (!xc || !yc)
|
|
1116
|
+
return new BigNumber2(a / 0);
|
|
1117
|
+
if (!xc[0] || !yc[0])
|
|
1118
|
+
return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
1119
|
+
}
|
|
1120
|
+
xe = bitFloor(xe);
|
|
1121
|
+
ye = bitFloor(ye);
|
|
1122
|
+
xc = xc.slice();
|
|
1123
|
+
if (a = xe - ye) {
|
|
1124
|
+
if (a > 0) {
|
|
1125
|
+
ye = xe;
|
|
1126
|
+
t = yc;
|
|
1127
|
+
} else {
|
|
1128
|
+
a = -a;
|
|
1129
|
+
t = xc;
|
|
1130
|
+
}
|
|
1131
|
+
t.reverse();
|
|
1132
|
+
for (;a--; t.push(0))
|
|
1133
|
+
;
|
|
1134
|
+
t.reverse();
|
|
1135
|
+
}
|
|
1136
|
+
a = xc.length;
|
|
1137
|
+
b = yc.length;
|
|
1138
|
+
if (a - b < 0) {
|
|
1139
|
+
t = yc;
|
|
1140
|
+
yc = xc;
|
|
1141
|
+
xc = t;
|
|
1142
|
+
b = a;
|
|
1143
|
+
}
|
|
1144
|
+
for (a = 0;b; ) {
|
|
1145
|
+
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
1146
|
+
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
1147
|
+
}
|
|
1148
|
+
if (a) {
|
|
1149
|
+
xc = [a].concat(xc);
|
|
1150
|
+
++ye;
|
|
1151
|
+
}
|
|
1152
|
+
return normalise(y, xc, ye);
|
|
1153
|
+
};
|
|
1154
|
+
P.precision = P.sd = function(sd, rm) {
|
|
1155
|
+
var c, n, v, x = this;
|
|
1156
|
+
if (sd != null && sd !== !!sd) {
|
|
1157
|
+
intCheck(sd, 1, MAX);
|
|
1158
|
+
if (rm == null)
|
|
1159
|
+
rm = ROUNDING_MODE;
|
|
1160
|
+
else
|
|
1161
|
+
intCheck(rm, 0, 8);
|
|
1162
|
+
return round(new BigNumber2(x), sd, rm);
|
|
1163
|
+
}
|
|
1164
|
+
if (!(c = x.c))
|
|
1165
|
+
return null;
|
|
1166
|
+
v = c.length - 1;
|
|
1167
|
+
n = v * LOG_BASE + 1;
|
|
1168
|
+
if (v = c[v]) {
|
|
1169
|
+
for (;v % 10 == 0; v /= 10, n--)
|
|
1170
|
+
;
|
|
1171
|
+
for (v = c[0];v >= 10; v /= 10, n++)
|
|
1172
|
+
;
|
|
1173
|
+
}
|
|
1174
|
+
if (sd && x.e + 1 > n)
|
|
1175
|
+
n = x.e + 1;
|
|
1176
|
+
return n;
|
|
1177
|
+
};
|
|
1178
|
+
P.shiftedBy = function(k) {
|
|
1179
|
+
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
1180
|
+
return this.times("1e" + k);
|
|
1181
|
+
};
|
|
1182
|
+
P.squareRoot = P.sqrt = function() {
|
|
1183
|
+
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
|
|
1184
|
+
if (s !== 1 || !c || !c[0]) {
|
|
1185
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
1186
|
+
}
|
|
1187
|
+
s = Math.sqrt(+valueOf(x));
|
|
1188
|
+
if (s == 0 || s == 1 / 0) {
|
|
1189
|
+
n = coeffToString(c);
|
|
1190
|
+
if ((n.length + e) % 2 == 0)
|
|
1191
|
+
n += "0";
|
|
1192
|
+
s = Math.sqrt(+n);
|
|
1193
|
+
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
1194
|
+
if (s == 1 / 0) {
|
|
1195
|
+
n = "5e" + e;
|
|
1196
|
+
} else {
|
|
1197
|
+
n = s.toExponential();
|
|
1198
|
+
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
1199
|
+
}
|
|
1200
|
+
r = new BigNumber2(n);
|
|
1201
|
+
} else {
|
|
1202
|
+
r = new BigNumber2(s + "");
|
|
1203
|
+
}
|
|
1204
|
+
if (r.c[0]) {
|
|
1205
|
+
e = r.e;
|
|
1206
|
+
s = e + dp;
|
|
1207
|
+
if (s < 3)
|
|
1208
|
+
s = 0;
|
|
1209
|
+
for (;; ) {
|
|
1210
|
+
t = r;
|
|
1211
|
+
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
1212
|
+
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
1213
|
+
if (r.e < e)
|
|
1214
|
+
--s;
|
|
1215
|
+
n = n.slice(s - 3, s + 1);
|
|
1216
|
+
if (n == "9999" || !rep && n == "4999") {
|
|
1217
|
+
if (!rep) {
|
|
1218
|
+
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
1219
|
+
if (t.times(t).eq(x)) {
|
|
1220
|
+
r = t;
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
dp += 4;
|
|
1225
|
+
s += 4;
|
|
1226
|
+
rep = 1;
|
|
1227
|
+
} else {
|
|
1228
|
+
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
1229
|
+
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
1230
|
+
m = !r.times(r).eq(x);
|
|
1231
|
+
}
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
1238
|
+
};
|
|
1239
|
+
P.toExponential = function(dp, rm) {
|
|
1240
|
+
if (dp != null) {
|
|
1241
|
+
intCheck(dp, 0, MAX);
|
|
1242
|
+
dp++;
|
|
1243
|
+
}
|
|
1244
|
+
return format(this, dp, rm, 1);
|
|
1245
|
+
};
|
|
1246
|
+
P.toFixed = function(dp, rm) {
|
|
1247
|
+
if (dp != null) {
|
|
1248
|
+
intCheck(dp, 0, MAX);
|
|
1249
|
+
dp = dp + this.e + 1;
|
|
1250
|
+
}
|
|
1251
|
+
return format(this, dp, rm);
|
|
1252
|
+
};
|
|
1253
|
+
P.toFormat = function(dp, rm, format2) {
|
|
1254
|
+
var str, x = this;
|
|
1255
|
+
if (format2 == null) {
|
|
1256
|
+
if (dp != null && rm && typeof rm == "object") {
|
|
1257
|
+
format2 = rm;
|
|
1258
|
+
rm = null;
|
|
1259
|
+
} else if (dp && typeof dp == "object") {
|
|
1260
|
+
format2 = dp;
|
|
1261
|
+
dp = rm = null;
|
|
1262
|
+
} else {
|
|
1263
|
+
format2 = FORMAT;
|
|
1264
|
+
}
|
|
1265
|
+
} else if (typeof format2 != "object") {
|
|
1266
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
1267
|
+
}
|
|
1268
|
+
str = x.toFixed(dp, rm);
|
|
1269
|
+
if (x.c) {
|
|
1270
|
+
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
1271
|
+
if (g2) {
|
|
1272
|
+
i = g1;
|
|
1273
|
+
g1 = g2;
|
|
1274
|
+
g2 = i;
|
|
1275
|
+
len -= i;
|
|
1276
|
+
}
|
|
1277
|
+
if (g1 > 0 && len > 0) {
|
|
1278
|
+
i = len % g1 || g1;
|
|
1279
|
+
intPart = intDigits.substr(0, i);
|
|
1280
|
+
for (;i < len; i += g1)
|
|
1281
|
+
intPart += groupSeparator + intDigits.substr(i, g1);
|
|
1282
|
+
if (g2 > 0)
|
|
1283
|
+
intPart += groupSeparator + intDigits.slice(i);
|
|
1284
|
+
if (isNeg)
|
|
1285
|
+
intPart = "-" + intPart;
|
|
1286
|
+
}
|
|
1287
|
+
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(new RegExp("\\d{" + g2 + "}\\B", "g"), "$&" + (format2.fractionGroupSeparator || "")) : fractionPart) : intPart;
|
|
1288
|
+
}
|
|
1289
|
+
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
1290
|
+
};
|
|
1291
|
+
P.toFraction = function(md) {
|
|
1292
|
+
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
1293
|
+
if (md != null) {
|
|
1294
|
+
n = new BigNumber2(md);
|
|
1295
|
+
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
1296
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
if (!xc)
|
|
1300
|
+
return new BigNumber2(x);
|
|
1301
|
+
d = new BigNumber2(ONE);
|
|
1302
|
+
n1 = d0 = new BigNumber2(ONE);
|
|
1303
|
+
d1 = n0 = new BigNumber2(ONE);
|
|
1304
|
+
s = coeffToString(xc);
|
|
1305
|
+
e = d.e = s.length - x.e - 1;
|
|
1306
|
+
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
1307
|
+
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
1308
|
+
exp = MAX_EXP;
|
|
1309
|
+
MAX_EXP = 1 / 0;
|
|
1310
|
+
n = new BigNumber2(s);
|
|
1311
|
+
n0.c[0] = 0;
|
|
1312
|
+
for (;; ) {
|
|
1313
|
+
q = div(n, d, 0, 1);
|
|
1314
|
+
d2 = d0.plus(q.times(d1));
|
|
1315
|
+
if (d2.comparedTo(md) == 1)
|
|
1316
|
+
break;
|
|
1317
|
+
d0 = d1;
|
|
1318
|
+
d1 = d2;
|
|
1319
|
+
n1 = n0.plus(q.times(d2 = n1));
|
|
1320
|
+
n0 = d2;
|
|
1321
|
+
d = n.minus(q.times(d2 = d));
|
|
1322
|
+
n = d2;
|
|
1323
|
+
}
|
|
1324
|
+
d2 = div(md.minus(d0), d1, 0, 1);
|
|
1325
|
+
n0 = n0.plus(d2.times(n1));
|
|
1326
|
+
d0 = d0.plus(d2.times(d1));
|
|
1327
|
+
n0.s = n1.s = x.s;
|
|
1328
|
+
e = e * 2;
|
|
1329
|
+
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];
|
|
1330
|
+
MAX_EXP = exp;
|
|
1331
|
+
return r;
|
|
1332
|
+
};
|
|
1333
|
+
P.toNumber = function() {
|
|
1334
|
+
return +valueOf(this);
|
|
1335
|
+
};
|
|
1336
|
+
P.toPrecision = function(sd, rm) {
|
|
1337
|
+
if (sd != null)
|
|
1338
|
+
intCheck(sd, 1, MAX);
|
|
1339
|
+
return format(this, sd, rm, 2);
|
|
1340
|
+
};
|
|
1341
|
+
P.toString = function(b) {
|
|
1342
|
+
var str, n = this, s = n.s, e = n.e;
|
|
1343
|
+
if (e === null) {
|
|
1344
|
+
if (s) {
|
|
1345
|
+
str = "Infinity";
|
|
1346
|
+
if (s < 0)
|
|
1347
|
+
str = "-" + str;
|
|
1348
|
+
} else {
|
|
1349
|
+
str = "NaN";
|
|
1350
|
+
}
|
|
1351
|
+
} else {
|
|
1352
|
+
if (b == null) {
|
|
1353
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
1354
|
+
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
1355
|
+
n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
1356
|
+
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
1357
|
+
} else {
|
|
1358
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
1359
|
+
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
1360
|
+
}
|
|
1361
|
+
if (s < 0 && n.c[0])
|
|
1362
|
+
str = "-" + str;
|
|
1363
|
+
}
|
|
1364
|
+
return str;
|
|
1365
|
+
};
|
|
1366
|
+
P.valueOf = P.toJSON = function() {
|
|
1367
|
+
return valueOf(this);
|
|
1368
|
+
};
|
|
1369
|
+
P._isBigNumber = true;
|
|
1370
|
+
if (configObject != null)
|
|
1371
|
+
BigNumber2.set(configObject);
|
|
1372
|
+
return BigNumber2;
|
|
1373
|
+
}
|
|
1374
|
+
function bitFloor(n) {
|
|
1375
|
+
var i = n | 0;
|
|
1376
|
+
return n > 0 || n === i ? i : i - 1;
|
|
1377
|
+
}
|
|
1378
|
+
function coeffToString(a) {
|
|
1379
|
+
var s, z, i = 1, j = a.length, r = a[0] + "";
|
|
1380
|
+
for (;i < j; ) {
|
|
1381
|
+
s = a[i++] + "";
|
|
1382
|
+
z = LOG_BASE - s.length;
|
|
1383
|
+
for (;z--; s = "0" + s)
|
|
1384
|
+
;
|
|
1385
|
+
r += s;
|
|
1386
|
+
}
|
|
1387
|
+
for (j = r.length;r.charCodeAt(--j) === 48; )
|
|
1388
|
+
;
|
|
1389
|
+
return r.slice(0, j + 1 || 1);
|
|
1390
|
+
}
|
|
1391
|
+
function compare(x, y) {
|
|
1392
|
+
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
1393
|
+
if (!i || !j)
|
|
1394
|
+
return null;
|
|
1395
|
+
a = xc && !xc[0];
|
|
1396
|
+
b = yc && !yc[0];
|
|
1397
|
+
if (a || b)
|
|
1398
|
+
return a ? b ? 0 : -j : i;
|
|
1399
|
+
if (i != j)
|
|
1400
|
+
return i;
|
|
1401
|
+
a = i < 0;
|
|
1402
|
+
b = k == l;
|
|
1403
|
+
if (!xc || !yc)
|
|
1404
|
+
return b ? 0 : !xc ^ a ? 1 : -1;
|
|
1405
|
+
if (!b)
|
|
1406
|
+
return k > l ^ a ? 1 : -1;
|
|
1407
|
+
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
1408
|
+
for (i = 0;i < j; i++)
|
|
1409
|
+
if (xc[i] != yc[i])
|
|
1410
|
+
return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
1411
|
+
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
1412
|
+
}
|
|
1413
|
+
function intCheck(n, min, max, name) {
|
|
1414
|
+
if (n < min || n > max || n !== mathfloor(n)) {
|
|
1415
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
function isOdd(n) {
|
|
1419
|
+
var k = n.c.length - 1;
|
|
1420
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
1421
|
+
}
|
|
1422
|
+
function toExponential(str, e) {
|
|
1423
|
+
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
1424
|
+
}
|
|
1425
|
+
function toFixedPoint(str, e, z) {
|
|
1426
|
+
var len, zs;
|
|
1427
|
+
if (e < 0) {
|
|
1428
|
+
for (zs = z + ".";++e; zs += z)
|
|
1429
|
+
;
|
|
1430
|
+
str = zs + str;
|
|
1431
|
+
} else {
|
|
1432
|
+
len = str.length;
|
|
1433
|
+
if (++e > len) {
|
|
1434
|
+
for (zs = z, e -= len;--e; zs += z)
|
|
1435
|
+
;
|
|
1436
|
+
str += zs;
|
|
1437
|
+
} else if (e < len) {
|
|
1438
|
+
str = str.slice(0, e) + "." + str.slice(e);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
return str;
|
|
1442
|
+
}
|
|
1443
|
+
BigNumber = clone();
|
|
1444
|
+
BigNumber["default"] = BigNumber.BigNumber = BigNumber;
|
|
1445
|
+
if (typeof define == "function" && define.amd) {
|
|
1446
|
+
define(function() {
|
|
1447
|
+
return BigNumber;
|
|
1448
|
+
});
|
|
1449
|
+
} else if (typeof module != "undefined" && module.exports) {
|
|
1450
|
+
module.exports = BigNumber;
|
|
1451
|
+
} else {
|
|
1452
|
+
if (!globalObject) {
|
|
1453
|
+
globalObject = typeof self != "undefined" && self ? self : window;
|
|
1454
|
+
}
|
|
1455
|
+
globalObject.BigNumber = BigNumber;
|
|
1456
|
+
}
|
|
1457
|
+
})(exports);
|
|
1458
|
+
});
|
|
1459
|
+
|
|
1460
|
+
// node_modules/.bun/json-bigint@1.0.0/node_modules/json-bigint/lib/stringify.js
|
|
1461
|
+
var require_stringify = __commonJS((exports, module) => {
|
|
1462
|
+
var BigNumber = require_bignumber();
|
|
1463
|
+
var JSON = exports;
|
|
1464
|
+
(function() {
|
|
1465
|
+
function f(n) {
|
|
1466
|
+
return n < 10 ? "0" + n : n;
|
|
1467
|
+
}
|
|
1468
|
+
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
|
|
1469
|
+
"\b": "\\b",
|
|
1470
|
+
"\t": "\\t",
|
|
1471
|
+
"\n": "\\n",
|
|
1472
|
+
"\f": "\\f",
|
|
1473
|
+
"\r": "\\r",
|
|
1474
|
+
'"': "\\\"",
|
|
1475
|
+
"\\": "\\\\"
|
|
1476
|
+
}, rep;
|
|
1477
|
+
function quote(string) {
|
|
1478
|
+
escapable.lastIndex = 0;
|
|
1479
|
+
return escapable.test(string) ? '"' + string.replace(escapable, function(a) {
|
|
1480
|
+
var c = meta[a];
|
|
1481
|
+
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
1482
|
+
}) + '"' : '"' + string + '"';
|
|
1483
|
+
}
|
|
1484
|
+
function str(key, holder) {
|
|
1485
|
+
var i, k, v, length, mind = gap, partial, value = holder[key], isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));
|
|
1486
|
+
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
1487
|
+
value = value.toJSON(key);
|
|
1488
|
+
}
|
|
1489
|
+
if (typeof rep === "function") {
|
|
1490
|
+
value = rep.call(holder, key, value);
|
|
1491
|
+
}
|
|
1492
|
+
switch (typeof value) {
|
|
1493
|
+
case "string":
|
|
1494
|
+
if (isBigNumber) {
|
|
1495
|
+
return value;
|
|
1496
|
+
} else {
|
|
1497
|
+
return quote(value);
|
|
1498
|
+
}
|
|
1499
|
+
case "number":
|
|
1500
|
+
return isFinite(value) ? String(value) : "null";
|
|
1501
|
+
case "boolean":
|
|
1502
|
+
case "null":
|
|
1503
|
+
case "bigint":
|
|
1504
|
+
return String(value);
|
|
1505
|
+
case "object":
|
|
1506
|
+
if (!value) {
|
|
1507
|
+
return "null";
|
|
1508
|
+
}
|
|
1509
|
+
gap += indent;
|
|
1510
|
+
partial = [];
|
|
1511
|
+
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
1512
|
+
length = value.length;
|
|
1513
|
+
for (i = 0;i < length; i += 1) {
|
|
1514
|
+
partial[i] = str(i, value) || "null";
|
|
1515
|
+
}
|
|
1516
|
+
v = partial.length === 0 ? "[]" : gap ? `[
|
|
1517
|
+
` + gap + partial.join(`,
|
|
1518
|
+
` + gap) + `
|
|
1519
|
+
` + mind + "]" : "[" + partial.join(",") + "]";
|
|
1520
|
+
gap = mind;
|
|
1521
|
+
return v;
|
|
1522
|
+
}
|
|
1523
|
+
if (rep && typeof rep === "object") {
|
|
1524
|
+
length = rep.length;
|
|
1525
|
+
for (i = 0;i < length; i += 1) {
|
|
1526
|
+
if (typeof rep[i] === "string") {
|
|
1527
|
+
k = rep[i];
|
|
1528
|
+
v = str(k, value);
|
|
1529
|
+
if (v) {
|
|
1530
|
+
partial.push(quote(k) + (gap ? ": " : ":") + v);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
} else {
|
|
1535
|
+
Object.keys(value).forEach(function(k2) {
|
|
1536
|
+
var v2 = str(k2, value);
|
|
1537
|
+
if (v2) {
|
|
1538
|
+
partial.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
v = partial.length === 0 ? "{}" : gap ? `{
|
|
1543
|
+
` + gap + partial.join(`,
|
|
1544
|
+
` + gap) + `
|
|
1545
|
+
` + mind + "}" : "{" + partial.join(",") + "}";
|
|
1546
|
+
gap = mind;
|
|
1547
|
+
return v;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
if (typeof JSON.stringify !== "function") {
|
|
1551
|
+
JSON.stringify = function(value, replacer, space) {
|
|
1552
|
+
var i;
|
|
1553
|
+
gap = "";
|
|
1554
|
+
indent = "";
|
|
1555
|
+
if (typeof space === "number") {
|
|
1556
|
+
for (i = 0;i < space; i += 1) {
|
|
1557
|
+
indent += " ";
|
|
1558
|
+
}
|
|
1559
|
+
} else if (typeof space === "string") {
|
|
1560
|
+
indent = space;
|
|
1561
|
+
}
|
|
1562
|
+
rep = replacer;
|
|
1563
|
+
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
1564
|
+
throw new Error("JSON.stringify");
|
|
1565
|
+
}
|
|
1566
|
+
return str("", { "": value });
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
})();
|
|
1570
|
+
});
|
|
1571
|
+
|
|
1572
|
+
// node_modules/.bun/json-bigint@1.0.0/node_modules/json-bigint/lib/parse.js
|
|
1573
|
+
var require_parse = __commonJS((exports, module) => {
|
|
1574
|
+
var BigNumber = null;
|
|
1575
|
+
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
1576
|
+
var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
1577
|
+
var json_parse = function(options) {
|
|
1578
|
+
var _options = {
|
|
1579
|
+
strict: false,
|
|
1580
|
+
storeAsString: false,
|
|
1581
|
+
alwaysParseAsBig: false,
|
|
1582
|
+
useNativeBigInt: false,
|
|
1583
|
+
protoAction: "error",
|
|
1584
|
+
constructorAction: "error"
|
|
1585
|
+
};
|
|
1586
|
+
if (options !== undefined && options !== null) {
|
|
1587
|
+
if (options.strict === true) {
|
|
1588
|
+
_options.strict = true;
|
|
1589
|
+
}
|
|
1590
|
+
if (options.storeAsString === true) {
|
|
1591
|
+
_options.storeAsString = true;
|
|
1592
|
+
}
|
|
1593
|
+
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
1594
|
+
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
1595
|
+
if (typeof options.constructorAction !== "undefined") {
|
|
1596
|
+
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
1597
|
+
_options.constructorAction = options.constructorAction;
|
|
1598
|
+
} else {
|
|
1599
|
+
throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`);
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
if (typeof options.protoAction !== "undefined") {
|
|
1603
|
+
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
1604
|
+
_options.protoAction = options.protoAction;
|
|
1605
|
+
} else {
|
|
1606
|
+
throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
var at, ch, escapee = {
|
|
1611
|
+
'"': '"',
|
|
1612
|
+
"\\": "\\",
|
|
1613
|
+
"/": "/",
|
|
1614
|
+
b: "\b",
|
|
1615
|
+
f: "\f",
|
|
1616
|
+
n: `
|
|
1617
|
+
`,
|
|
1618
|
+
r: "\r",
|
|
1619
|
+
t: "\t"
|
|
1620
|
+
}, text, error = function(m) {
|
|
1621
|
+
throw {
|
|
1622
|
+
name: "SyntaxError",
|
|
1623
|
+
message: m,
|
|
1624
|
+
at,
|
|
1625
|
+
text
|
|
1626
|
+
};
|
|
1627
|
+
}, next = function(c) {
|
|
1628
|
+
if (c && c !== ch) {
|
|
1629
|
+
error("Expected '" + c + "' instead of '" + ch + "'");
|
|
1630
|
+
}
|
|
1631
|
+
ch = text.charAt(at);
|
|
1632
|
+
at += 1;
|
|
1633
|
+
return ch;
|
|
1634
|
+
}, number = function() {
|
|
1635
|
+
var number2, string2 = "";
|
|
1636
|
+
if (ch === "-") {
|
|
1637
|
+
string2 = "-";
|
|
1638
|
+
next("-");
|
|
1639
|
+
}
|
|
1640
|
+
while (ch >= "0" && ch <= "9") {
|
|
1641
|
+
string2 += ch;
|
|
1642
|
+
next();
|
|
1643
|
+
}
|
|
1644
|
+
if (ch === ".") {
|
|
1645
|
+
string2 += ".";
|
|
1646
|
+
while (next() && ch >= "0" && ch <= "9") {
|
|
1647
|
+
string2 += ch;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
if (ch === "e" || ch === "E") {
|
|
1651
|
+
string2 += ch;
|
|
1652
|
+
next();
|
|
1653
|
+
if (ch === "-" || ch === "+") {
|
|
1654
|
+
string2 += ch;
|
|
1655
|
+
next();
|
|
1656
|
+
}
|
|
1657
|
+
while (ch >= "0" && ch <= "9") {
|
|
1658
|
+
string2 += ch;
|
|
1659
|
+
next();
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
number2 = +string2;
|
|
1663
|
+
if (!isFinite(number2)) {
|
|
1664
|
+
error("Bad number");
|
|
1665
|
+
} else {
|
|
1666
|
+
if (BigNumber == null)
|
|
1667
|
+
BigNumber = require_bignumber();
|
|
1668
|
+
if (string2.length > 15)
|
|
1669
|
+
return _options.storeAsString ? string2 : _options.useNativeBigInt ? BigInt(string2) : new BigNumber(string2);
|
|
1670
|
+
else
|
|
1671
|
+
return !_options.alwaysParseAsBig ? number2 : _options.useNativeBigInt ? BigInt(number2) : new BigNumber(number2);
|
|
1672
|
+
}
|
|
1673
|
+
}, string = function() {
|
|
1674
|
+
var hex, i, string2 = "", uffff;
|
|
1675
|
+
if (ch === '"') {
|
|
1676
|
+
var startAt = at;
|
|
1677
|
+
while (next()) {
|
|
1678
|
+
if (ch === '"') {
|
|
1679
|
+
if (at - 1 > startAt)
|
|
1680
|
+
string2 += text.substring(startAt, at - 1);
|
|
1681
|
+
next();
|
|
1682
|
+
return string2;
|
|
1683
|
+
}
|
|
1684
|
+
if (ch === "\\") {
|
|
1685
|
+
if (at - 1 > startAt)
|
|
1686
|
+
string2 += text.substring(startAt, at - 1);
|
|
1687
|
+
next();
|
|
1688
|
+
if (ch === "u") {
|
|
1689
|
+
uffff = 0;
|
|
1690
|
+
for (i = 0;i < 4; i += 1) {
|
|
1691
|
+
hex = parseInt(next(), 16);
|
|
1692
|
+
if (!isFinite(hex)) {
|
|
1693
|
+
break;
|
|
1694
|
+
}
|
|
1695
|
+
uffff = uffff * 16 + hex;
|
|
1696
|
+
}
|
|
1697
|
+
string2 += String.fromCharCode(uffff);
|
|
1698
|
+
} else if (typeof escapee[ch] === "string") {
|
|
1699
|
+
string2 += escapee[ch];
|
|
1700
|
+
} else {
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
startAt = at;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
error("Bad string");
|
|
1708
|
+
}, white = function() {
|
|
1709
|
+
while (ch && ch <= " ") {
|
|
1710
|
+
next();
|
|
1711
|
+
}
|
|
1712
|
+
}, word = function() {
|
|
1713
|
+
switch (ch) {
|
|
1714
|
+
case "t":
|
|
1715
|
+
next("t");
|
|
1716
|
+
next("r");
|
|
1717
|
+
next("u");
|
|
1718
|
+
next("e");
|
|
1719
|
+
return true;
|
|
1720
|
+
case "f":
|
|
1721
|
+
next("f");
|
|
1722
|
+
next("a");
|
|
1723
|
+
next("l");
|
|
1724
|
+
next("s");
|
|
1725
|
+
next("e");
|
|
1726
|
+
return false;
|
|
1727
|
+
case "n":
|
|
1728
|
+
next("n");
|
|
1729
|
+
next("u");
|
|
1730
|
+
next("l");
|
|
1731
|
+
next("l");
|
|
1732
|
+
return null;
|
|
1733
|
+
}
|
|
1734
|
+
error("Unexpected '" + ch + "'");
|
|
1735
|
+
}, value, array = function() {
|
|
1736
|
+
var array2 = [];
|
|
1737
|
+
if (ch === "[") {
|
|
1738
|
+
next("[");
|
|
1739
|
+
white();
|
|
1740
|
+
if (ch === "]") {
|
|
1741
|
+
next("]");
|
|
1742
|
+
return array2;
|
|
1743
|
+
}
|
|
1744
|
+
while (ch) {
|
|
1745
|
+
array2.push(value());
|
|
1746
|
+
white();
|
|
1747
|
+
if (ch === "]") {
|
|
1748
|
+
next("]");
|
|
1749
|
+
return array2;
|
|
1750
|
+
}
|
|
1751
|
+
next(",");
|
|
1752
|
+
white();
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
error("Bad array");
|
|
1756
|
+
}, object = function() {
|
|
1757
|
+
var key, object2 = Object.create(null);
|
|
1758
|
+
if (ch === "{") {
|
|
1759
|
+
next("{");
|
|
1760
|
+
white();
|
|
1761
|
+
if (ch === "}") {
|
|
1762
|
+
next("}");
|
|
1763
|
+
return object2;
|
|
1764
|
+
}
|
|
1765
|
+
while (ch) {
|
|
1766
|
+
key = string();
|
|
1767
|
+
white();
|
|
1768
|
+
next(":");
|
|
1769
|
+
if (_options.strict === true && Object.hasOwnProperty.call(object2, key)) {
|
|
1770
|
+
error('Duplicate key "' + key + '"');
|
|
1771
|
+
}
|
|
1772
|
+
if (suspectProtoRx.test(key) === true) {
|
|
1773
|
+
if (_options.protoAction === "error") {
|
|
1774
|
+
error("Object contains forbidden prototype property");
|
|
1775
|
+
} else if (_options.protoAction === "ignore") {
|
|
1776
|
+
value();
|
|
1777
|
+
} else {
|
|
1778
|
+
object2[key] = value();
|
|
1779
|
+
}
|
|
1780
|
+
} else if (suspectConstructorRx.test(key) === true) {
|
|
1781
|
+
if (_options.constructorAction === "error") {
|
|
1782
|
+
error("Object contains forbidden constructor property");
|
|
1783
|
+
} else if (_options.constructorAction === "ignore") {
|
|
1784
|
+
value();
|
|
1785
|
+
} else {
|
|
1786
|
+
object2[key] = value();
|
|
1787
|
+
}
|
|
1788
|
+
} else {
|
|
1789
|
+
object2[key] = value();
|
|
1790
|
+
}
|
|
1791
|
+
white();
|
|
1792
|
+
if (ch === "}") {
|
|
1793
|
+
next("}");
|
|
1794
|
+
return object2;
|
|
1795
|
+
}
|
|
1796
|
+
next(",");
|
|
1797
|
+
white();
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
error("Bad object");
|
|
1801
|
+
};
|
|
1802
|
+
value = function() {
|
|
1803
|
+
white();
|
|
1804
|
+
switch (ch) {
|
|
1805
|
+
case "{":
|
|
1806
|
+
return object();
|
|
1807
|
+
case "[":
|
|
1808
|
+
return array();
|
|
1809
|
+
case '"':
|
|
1810
|
+
return string();
|
|
1811
|
+
case "-":
|
|
1812
|
+
return number();
|
|
1813
|
+
default:
|
|
1814
|
+
return ch >= "0" && ch <= "9" ? number() : word();
|
|
1815
|
+
}
|
|
1816
|
+
};
|
|
1817
|
+
return function(source, reviver) {
|
|
1818
|
+
var result;
|
|
1819
|
+
text = source + "";
|
|
1820
|
+
at = 0;
|
|
1821
|
+
ch = " ";
|
|
1822
|
+
result = value();
|
|
1823
|
+
white();
|
|
1824
|
+
if (ch) {
|
|
1825
|
+
error("Syntax error");
|
|
1826
|
+
}
|
|
1827
|
+
return typeof reviver === "function" ? function walk(holder, key) {
|
|
1828
|
+
var k, v, value2 = holder[key];
|
|
1829
|
+
if (value2 && typeof value2 === "object") {
|
|
1830
|
+
Object.keys(value2).forEach(function(k2) {
|
|
1831
|
+
v = walk(value2, k2);
|
|
1832
|
+
if (v !== undefined) {
|
|
1833
|
+
value2[k2] = v;
|
|
1834
|
+
} else {
|
|
1835
|
+
delete value2[k2];
|
|
1836
|
+
}
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
return reviver.call(holder, key, value2);
|
|
1840
|
+
}({ "": result }, "") : result;
|
|
1841
|
+
};
|
|
1842
|
+
};
|
|
1843
|
+
module.exports = json_parse;
|
|
1844
|
+
});
|
|
1845
|
+
|
|
1846
|
+
// node_modules/.bun/json-bigint@1.0.0/node_modules/json-bigint/index.js
|
|
1847
|
+
var require_json_bigint = __commonJS((exports, module) => {
|
|
1848
|
+
var json_stringify = require_stringify().stringify;
|
|
1849
|
+
var json_parse = require_parse();
|
|
1850
|
+
module.exports = function(options) {
|
|
1851
|
+
return {
|
|
1852
|
+
parse: json_parse(options),
|
|
1853
|
+
stringify: json_stringify
|
|
1854
|
+
};
|
|
1855
|
+
};
|
|
1856
|
+
module.exports.parse = json_parse();
|
|
1857
|
+
module.exports.stringify = json_stringify;
|
|
1858
|
+
});
|
|
1859
|
+
|
|
1860
|
+
// node_modules/.bun/extend@3.0.2/node_modules/extend/index.js
|
|
1861
|
+
var require_extend = __commonJS((exports, module) => {
|
|
1862
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
1863
|
+
var toStr = Object.prototype.toString;
|
|
1864
|
+
var defineProperty = Object.defineProperty;
|
|
1865
|
+
var gOPD = Object.getOwnPropertyDescriptor;
|
|
1866
|
+
var isArray = function isArray2(arr) {
|
|
1867
|
+
if (typeof Array.isArray === "function") {
|
|
1868
|
+
return Array.isArray(arr);
|
|
1869
|
+
}
|
|
1870
|
+
return toStr.call(arr) === "[object Array]";
|
|
1871
|
+
};
|
|
1872
|
+
var isPlainObject = function isPlainObject2(obj) {
|
|
1873
|
+
if (!obj || toStr.call(obj) !== "[object Object]") {
|
|
1874
|
+
return false;
|
|
1875
|
+
}
|
|
1876
|
+
var hasOwnConstructor = hasOwn.call(obj, "constructor");
|
|
1877
|
+
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
|
|
1878
|
+
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
|
|
1879
|
+
return false;
|
|
1880
|
+
}
|
|
1881
|
+
var key;
|
|
1882
|
+
for (key in obj) {}
|
|
1883
|
+
return typeof key === "undefined" || hasOwn.call(obj, key);
|
|
1884
|
+
};
|
|
1885
|
+
var setProperty = function setProperty2(target, options) {
|
|
1886
|
+
if (defineProperty && options.name === "__proto__") {
|
|
1887
|
+
defineProperty(target, options.name, {
|
|
1888
|
+
enumerable: true,
|
|
1889
|
+
configurable: true,
|
|
1890
|
+
value: options.newValue,
|
|
1891
|
+
writable: true
|
|
1892
|
+
});
|
|
1893
|
+
} else {
|
|
1894
|
+
target[options.name] = options.newValue;
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
var getProperty = function getProperty2(obj, name) {
|
|
1898
|
+
if (name === "__proto__") {
|
|
1899
|
+
if (!hasOwn.call(obj, name)) {
|
|
1900
|
+
return;
|
|
1901
|
+
} else if (gOPD) {
|
|
1902
|
+
return gOPD(obj, name).value;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
return obj[name];
|
|
1906
|
+
};
|
|
1907
|
+
module.exports = function extend() {
|
|
1908
|
+
var options, name, src, copy, copyIsArray, clone;
|
|
1909
|
+
var target = arguments[0];
|
|
1910
|
+
var i = 1;
|
|
1911
|
+
var length = arguments.length;
|
|
1912
|
+
var deep = false;
|
|
1913
|
+
if (typeof target === "boolean") {
|
|
1914
|
+
deep = target;
|
|
1915
|
+
target = arguments[1] || {};
|
|
1916
|
+
i = 2;
|
|
1917
|
+
}
|
|
1918
|
+
if (target == null || typeof target !== "object" && typeof target !== "function") {
|
|
1919
|
+
target = {};
|
|
1920
|
+
}
|
|
1921
|
+
for (;i < length; ++i) {
|
|
1922
|
+
options = arguments[i];
|
|
1923
|
+
if (options != null) {
|
|
1924
|
+
for (name in options) {
|
|
1925
|
+
src = getProperty(target, name);
|
|
1926
|
+
copy = getProperty(options, name);
|
|
1927
|
+
if (target !== copy) {
|
|
1928
|
+
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
|
|
1929
|
+
if (copyIsArray) {
|
|
1930
|
+
copyIsArray = false;
|
|
1931
|
+
clone = src && isArray(src) ? src : [];
|
|
1932
|
+
} else {
|
|
1933
|
+
clone = src && isPlainObject(src) ? src : {};
|
|
1934
|
+
}
|
|
1935
|
+
setProperty(target, { name, newValue: extend(deep, clone, copy) });
|
|
1936
|
+
} else if (typeof copy !== "undefined") {
|
|
1937
|
+
setProperty(target, { name, newValue: copy });
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
return target;
|
|
1944
|
+
};
|
|
1945
|
+
});
|
|
1946
|
+
|
|
1947
|
+
export { require_extend, require_json_bigint };
|