@sheetxl/mcp 0.8.0-beta.18 → 0.8.0-beta.19
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/assets/{BhHneZZ7gq4dRaEJ.js → -iaCg5U9jrEDEl_O.js} +1 -1
- package/assets/{BRQd_GNkeaBTl3Zr.js → 0hHP9xpWzhkDrCTL.js} +1 -1
- package/assets/{MfkAFluI0ZyU0UDV.js → 1bm0Yqgfehw1Z2QU.js} +9 -9
- package/assets/{DSDlxGN059KmkCxT.js → 2nx2Wljhbuct4aKx.js} +1 -1
- package/assets/{pg7E7B7ouG2qdZve.js → 7MIo82Ay8jEFMBH-.js} +1 -1
- package/assets/{CnLLwj7OCz4U71wa.js → ArL5bPq60ZcPcwU9.js} +1 -1
- package/assets/{DCHjwIx59QhiV2Zx.js → B6A2URH-mIs7J54h.js} +2 -2
- package/assets/{CDqOifqA400y7KQY.js → B7vRFm79CUJ1VvFw.js} +1 -1
- package/assets/{BQzUK7KiJeJpu-rK.js → B8Z4-80QEORmYOJ9.js} +1 -1
- package/assets/{BFGVZsstQm2MWi7Y.js → BGLlbVFS6J3lt9Lw.js} +1 -1
- package/assets/{D5wI7O_L6QVNXj5I.js → BHsQeg6najGesUM4.js} +1 -1
- package/assets/{CkO0JR629W2kcDMd.js → BPctZbHQFoqJNYzC.js} +2 -2
- package/assets/{Dhg0yeTmVfmRV5rK.js → BQkQNqRh5xxYhBy4.js} +1 -1
- package/assets/{Rpi4k7hMH8wPAIcB.js → BSNegq0YcivZJmkf.js} +1658 -1658
- package/assets/{DafqFM-FGeZJ_fzg.js → BTnTQBSbzYU7cwra.js} +1 -1
- package/assets/{CoQFpWEh4CUgcdwe.js → BUHEmX1fseJVV65_.js} +1 -1
- package/assets/{hLMlKg3lU36xZ6G6.js → Bbky1A_gIgE8i0Oy.js} +1 -1
- package/assets/{CL4BYdfIXgFQA8nY.js → BbvOmnXrmBNjeWjQ.js} +1 -1
- package/assets/{CT6kRDlkfvKq8XGZ.js → Bbxkz6vmyZJftTd-.js} +1 -1
- package/assets/{Ct8BhGWuqN5yOpUF.js → BcYdUKmFOf5rn2VZ.js} +1 -1
- package/assets/{BSvHkSY0R0EU0gC4.js → BfIJP4H3I51jnIVR.js} +1 -1
- package/assets/{BQsLqKWy17wy3znE.js → BgUHR-HVjZDY4SaH.js} +2 -2
- package/assets/{hvCnPO_Fu7Nqz0rs.js → BgVW1icycJewsx77.js} +1 -1
- package/assets/{BgGFX6QJ30T3seyX.js → Bgi6ubwGkGYsILci.js} +94 -94
- package/assets/{DbwDQlhCuGoasVUz.js → BiOrM24CFYL1JGFE.js} +2 -2
- package/assets/{DY1x1ZN7ZyE4OR1-.js → Bj1WHx6LIEq6RVGw.js} +8 -8
- package/assets/{CMXukie7sxP12H2E.js → Bk6A5eONxLTBIA_p.js} +4 -4
- package/assets/{BV11qLZKVWxFwVGV.js → Bk6SeqUJkn7ft1y1.js} +1 -1
- package/assets/{DN4zv4AjDxTsLFsA.js → BkhdNc3LdmcyAjwk.js} +9136 -9130
- package/assets/{DP-FzazhSKAvylUa.js → Bl77DvFa09DuVVuj.js} +137 -137
- package/assets/{Cv8UXBL7O7h1uMR8.js → Bpf9jHj5AFY9543y.js} +21 -21
- package/assets/{ARPN5UhoadZC1yqE.js → Bq6ocyztkvzKxMMC.js} +1 -1
- package/assets/{CLsD7YwSKAsliRZy.js → Bw2Nxye4Qj10uA3o.js} +1 -1
- package/assets/{CYUerpa6WB0Hc3fs.js → Bz1lp0mtNAoPuPve.js} +1 -1
- package/assets/{o9G5KuG1VkSazTvI.js → BzkTa7l_e7R--ejo.js} +402 -402
- package/assets/{BM-ax5N1GzF9KkI4.js → C06iKc7jZ6affk2m.js} +1 -1
- package/assets/{BatIfPAYElNTXVzb.js → C17Wflhw5IFSgFFY.js} +1 -1
- package/assets/{BMc-Hsrp_iifxzG_.js → C53f6C0pAU7_9FI-.js} +1 -1
- package/assets/{CmlxzZYM5hOAAcx5.js → C7Q4V5mU0wsErspO.js} +3 -3
- package/assets/{DjoFujVwGRAxviCF.js → CA_22AL82sRhLAko.js} +2 -2
- package/assets/{CzoexWLhnn08u05j.js → CBSSZrizrucIG_9i.js} +754 -757
- package/assets/{CLBxNjtPjuGX1KnU.js → CE4VYOniMmY8sXQ_.js} +1 -1
- package/assets/{DI_SAQ7hesioI9TW.js → CIOlYUuBZat8FhHa.js} +1 -1
- package/assets/{Dh2iae-q0IngEeyH.js → CIxf9Y_JsuEEO7Nu.js} +1 -1
- package/assets/{BQeb2zXfAs5lRoGt.js → CKvP54bJ4GkUqcZi.js} +3 -3
- package/assets/{Del35nO_1HyjItI0.js → CNPUPTd9h7hwijpZ.js} +69 -69
- package/assets/{D1pD8u8nRprUvn-u.js → CQZq4cA5kbES6htE.js} +1 -1
- package/assets/{BhJ1mH7pUONJScU7.js → CQiv3YkDRDxTjy0r.js} +31 -31
- package/assets/{BQ76ntZm9YFicjXj.js → CWHuM2GYuKmi0rZx.js} +1 -1
- package/assets/{DL3ms6Hf2uEGaMgH.js → CYTPpV3lqNGOwme7.js} +2 -2
- package/assets/{D2IMjoGcj5oz1Kr7.js → C_v4hb9WXIt639Cm.js} +1 -1
- package/assets/{Du9_Ajy9KvnwHApK.js → CcGrcjoI12MaDmwV.js} +2 -2
- package/assets/{CGGpkGg85FZsnYHc.js → Cgf5GQVN-D8SlQ7A.js} +15 -15
- package/assets/{CPkGFumcwSKh5zea.js → CiJq0zSDKpaKhL3y.js} +2 -2
- package/assets/{EDEUvF-L72a6fMCK.js → Cj4MYfqHewu8IOOL.js} +1 -1
- package/assets/{D0-I0aLr6w8IvxFD.js → CjoRkjB9NzS4LaFy.js} +1 -1
- package/assets/{B2C5njsdPylyQOCM.js → CjrzyKFdie6KYfsG.js} +3 -3
- package/assets/{Bi4pI6e3AwTjn-lQ.js → CkMXAUkUuJ2LJUBE.js} +1 -1
- package/assets/{VcmpHRbBIrw6av3U.js → CoXgI3MEnvkXeshj.js} +120 -120
- package/assets/{yBFl0kPv-nwFtG4Z.js → CqOzqRIQFCnEegoB.js} +1 -1
- package/assets/{XDQBri0_cS5paHej.js → CqvcgwQ0UcKndrhO.js} +2 -2
- package/assets/{C3PZVWI_SEXYrzVk.js → CrjUfkCuRaXUC8X8.js} +3 -3
- package/assets/{vXZw1AmMzswOZMiP.js → CubwsTFIaEVf039H.js} +1 -1
- package/assets/{nPoObUd0MvWI-j0F.js → Cur_-XiBPijLpwxX.js} +1 -1
- package/assets/{B7GE-6NROw0onnLD.js → Curuj_knAdRpMy1L.js} +157 -157
- package/assets/{8hZAYFV_v2KmJ_NL.js → Cz7tKgNBbnr4DZCb.js} +4 -4
- package/assets/{wZ-GQhOhikv-_3iQ.js → D-LrOz3Yvp17bUT8.js} +2 -2
- package/assets/{DWK-OKV0MErx-IrU.js → D005GbIBowRGfwed.js} +6 -6
- package/assets/{CPa4og3WQ7BgHrsO.js → D06A3fKIe3WCTFru.js} +28 -28
- package/assets/{C_UAskmm-u2Iw9Nl.js → D1ZekPxeTGzhFy2L.js} +1 -1
- package/assets/{BCeSyFXflYgNP_ES.js → D1kI9nJRL1RUF3-E.js} +1 -1
- package/assets/{Bz5ioWvl-Xl3xspC.js → D1nQ_BminCM0cyH0.js} +1 -1
- package/assets/{CiKd3BnRjhac2Hik.js → D4p9Pv82ECKCOlua.js} +1 -1
- package/assets/{Iv_Zbm3pMLOK2uxf.js → D5OYqo56iGB-5gFG.js} +1 -1
- package/assets/{10d0ZbYF23zeF8_1.js → D6fQheA4qCS5CxYQ.js} +1 -1
- package/assets/{DzEJwSC-_aavYiFd.js → D990KjcBrCaAEz5k.js} +1 -1
- package/assets/{CJoWPN_DsFbaGAiE.js → DAnSdO8615XsOPNe.js} +1 -1
- package/assets/{CNE-erNKNIT7bUb1.js → DFlL4pAqxaQ_hVe1.js} +30 -30
- package/assets/{DlWRvc1pLGPCRMwi.js → DHL-ZmN5GzB4pIrM.js} +1 -1
- package/assets/{CnCtLKkz0bdXIxn2.js → DIPDNtbm8FAru-FQ.js} +79 -79
- package/assets/{BEtUOCupmeICfGE1.js → DLJH6ppG9VHjHe_z.js} +3 -3
- package/assets/{F0HGXXl9AizCAcFy.js → DNtWf9lfGjzoB9Hy.js} +1 -1
- package/assets/{CQBFUsemb94zMBo6.js → DOg_zvSkhsKmw4q1.js} +3 -3
- package/assets/{BFcxaubQp1WMeknL.js → DS9HD6_BPxzdun0X.js} +4 -4
- package/assets/{BxizypreLEtLqpIc.js → DSNaHPvgqymqpsko.js} +1 -1
- package/assets/{BwQM6Q6HHQTXznpy.js → DT_kCIZ600UsFy4t.js} +2 -2
- package/assets/{DmCRCUmmkoRNCS9J.js → DXORLAVmseFlsxkG.js} +2 -2
- package/assets/{DcjJ_zTfdh6RqmVZ.js → DXe8SG12UJoGbbWR.js} +1 -1
- package/assets/{CWuPUrDsnBxboJ02.js → D_6TeeMN5zmoQPTm.js} +108 -108
- package/assets/{CvkibaXI8SOD22pw.js → Di_C31GTbBJ_xVOK.js} +1 -1
- package/assets/{DH7Rur7rNOYzv35r.js → DnMDfty7pU96BIEJ.js} +1 -1
- package/assets/{D5nleqRNvTcmN5_9.js → DngcuWO2cSuMCMu1.js} +1 -1
- package/assets/{DMGq2icilGiyfBTM.js → DppU35gFSUPaiCQH.js} +1 -1
- package/assets/{CcB4xmoUFWBbSISF.js → DrkfG324qZRPckuC.js} +1 -1
- package/assets/{SCOKwiDu6SYiQrQ0.js → Ds6LQkRDwXsJ-CFR.js} +1 -1
- package/assets/{CYcb-DojX92VNGzd.js → DtD0J-7IetHv5o6E.js} +3 -3
- package/assets/{DmUCKxOYIBM6DX64.js → DwWcXC4pUR3U2WXU.js} +1 -1
- package/assets/{rIReGgfQ90pzLAbU.js → DwcKSqV5YEBBA8hY.js} +1 -1
- package/assets/{B74Ls4nlmyBxWanf.js → DxKZjKyewqvj46S2.js} +2 -2
- package/assets/{B-6CmVJvxPNZB9bE.js → DxTzG7VM8v4WJ6cI.js} +1 -1
- package/assets/{Bi8ct8GYvMDKHCE3.js → EkavVNuGWG95UggH.js} +5 -5
- package/assets/{DKnwIboAj_Sg9aVP.js → GZJ4AFFt8qKRADOa.js} +2 -2
- package/assets/{VL-vwx7Pyw1zqIx9.js → Gd_0grQd-3D1VPXW.js} +1 -1
- package/assets/{BOdkvYo03yZ96iZt.js → HVm22OJ1gEeY8kii.js} +1 -1
- package/assets/{DMnhlFBJ2AlVx2_t.js → LV6tvjnxRzrWaFb8.js} +1 -1
- package/assets/{Bqq5Sl5E9ytcPJ3J.js → Ln7XTzksutZHFpml.js} +1 -1
- package/assets/{gAg9rL3U8fWUDeEb.js → Se9JmvmEtu4MfXJh.js} +38 -38
- package/assets/{9rJMq-cyOmajlBEQ.js → b6GPrIkdzfTW4f2j.js} +1 -1
- package/assets/{r9WSFw3a-_a5hlPm.js → bJ-XKvDf7IkAafUI.js} +3 -7
- package/assets/{D2sRTakzE5POMnhF.js → exNO4fmccU8Aq8cE.js} +65 -65
- package/assets/gCkru9Vv-Ban4DCD.js +14 -0
- package/assets/{BDNqot_JWBuVW_pC.js → ht0UxaAlRnuYUvpx.js} +1 -1
- package/assets/{BsYVa-oRhTLH6wnH.js → iP-shs7tsDGMVvQh.js} +1 -1
- package/assets/{Byd5zSRU6LWfL2No.js → jPim6WG_KS-ZDker.js} +1 -1
- package/assets/{NZeFs1MV5h-uMZqJ.js → mrif6ZBbTbZKYaLJ.js} +1 -1
- package/assets/{BrwNVveK5LvYkoGk.js → rT5f4v0Q_61nHkff.js} +1 -1
- package/assets/{BedBCvJP064ZYuO8.js → udbHvSLquJ5xGK3R.js} +2 -2
- package/assets/{D49iRcrfnODORRNC.js → vb-L2Q2jyjjgDvJy.js} +6 -6
- package/assets/{nnqtgWxMIc_Nc-IP.js → zEyWjY3NhC8w_spQ.js} +454 -454
- package/assets/{DwOPJ5TXttTx69oF.js → zkoJXSxpRzqfbG8k.js} +134 -134
- package/index.js +204 -204
- package/lib.js +1 -1
- package/licenses/dependencies.txt +59 -59
- package/package.json +2 -2
- package/screenshot-page/assets/{Di8Yn8O-rD9idC2h.js → 1yHlU53ypZZelMPx.js} +1 -1
- package/screenshot-page/assets/{C3QIYFX-vF_1DVmi.js → A_-Jwzwmm3lkcm2f.js} +11 -11
- package/screenshot-page/assets/{Btgo0VFTT0JxuaP3.js → B-8IMo2f1yGNXOyz.js} +86 -90
- package/screenshot-page/assets/{Cfs_rQCXBMVhJgat.js → BF6igzahAW9pl35p.js} +1 -1
- package/screenshot-page/assets/{C1lrvl0Ad1-NjWKG.js → BU5vg917ZnXC04e-.js} +2 -2
- package/screenshot-page/assets/{CaiPDssAQqXac5AG.js → BWDqL5_mwspr6CjI.js} +1 -1
- package/screenshot-page/assets/BX9VkTqZoroo08EG.js +13 -0
- package/screenshot-page/assets/BdDouZl3VrM4yBP5.js +2 -0
- package/screenshot-page/assets/{D1TqM0Bt65K6svMS.js → BqlVqRKpsFGl-elI.js} +23 -23
- package/screenshot-page/assets/{DNoZea7QMO9zB6D5.js → BuzI4z8RJGOw8BZD.js} +1 -1
- package/screenshot-page/assets/{DqXO_Zw1Cp7rAQ04.js → C7mXat-6esc1AmRD.js} +2 -2
- package/screenshot-page/assets/{D6WTzLygjgK85siu.js → CFl15-2FAF9f3V7L.js} +2 -2
- package/screenshot-page/assets/{C0F9BL11dkgzjp7Y.js → CJmdRzGWq0FZMrp5.js} +1 -1
- package/screenshot-page/assets/{CNFMt4XhKy4tlsUn.js → CLcTX_nmvaVPsxDl.js} +1 -1
- package/screenshot-page/assets/{BMf827t1Ul65MHd5.js → CQukCzhuewMuFOlO.js} +1 -1
- package/screenshot-page/assets/CZq2dMHs2MHHyyBl.js +1 -0
- package/screenshot-page/assets/CaTGa2NvuuE3qJAV.js +1 -0
- package/screenshot-page/assets/{F6yLCIlSWZ1lAUEp.js → Cb8ORg9ENgscK6yl.js} +2 -2
- package/screenshot-page/assets/{CM9cBiCjJIY64PWg.js → Chq6rvtA5qZAwYG4.js} +1 -1
- package/screenshot-page/assets/ClWDZixRy4DFZdI5.js +1 -0
- package/screenshot-page/assets/CmNlzN3DCl87wNU2.js +1 -0
- package/screenshot-page/assets/CoPUxkU9zZy0dXti.js +2 -0
- package/screenshot-page/assets/{Csjis_Fk8q4mSqdp.js → Cpwg3bWAqBBcgBmv.js} +2 -2
- package/screenshot-page/assets/{BwF-LAYFu91KqvJ8.js → CqogMOf7MzkOk7as.js} +2 -2
- package/screenshot-page/assets/{CpZHZoz3xpJMDWI0.js → CrUIo7hXByCWY7in.js} +1 -1
- package/screenshot-page/assets/Cv-YUArreXqhafcU.js +2 -0
- package/screenshot-page/assets/{DgtqX4DiBgkepVZZ.js → Cx1kZ2u_8JFV2Q8D.js} +1 -1
- package/screenshot-page/assets/{NDzpWLUA0pbyI-Rd.js → Cx9lvo3Q1xOwYkRK.js} +4 -4
- package/screenshot-page/assets/D0nZlczIH0ULuSyL.js +3 -0
- package/screenshot-page/assets/D1ZZiOS7_HFjpZCA.js +1 -0
- package/screenshot-page/assets/D23_69pojBfIh4nV.js +5 -0
- package/screenshot-page/assets/D24UBy2L73pOCPPw.js +1 -0
- package/screenshot-page/assets/D2q4M3I5Jmxm85P2.js +1 -0
- package/screenshot-page/assets/{D5kEl0N4l6MzdmTG.js → D6LmZnV2h3Kg7G3e.js} +1 -1
- package/screenshot-page/assets/{BYQZ8o8k3-MDoNat.js → D6Yv5cc1JE7DGd6j.js} +1 -1
- package/screenshot-page/assets/DAkSmFRVds51vhiy.js +1 -0
- package/screenshot-page/assets/DMhOGCTy8V0N14gY.js +1 -0
- package/screenshot-page/assets/{Bw4kRw8JKyNRlLE2.js → DUFPgv-3CtD_sCVO.js} +1 -1
- package/screenshot-page/assets/{B7u12-Sf0HF7g4wI.js → DeGMS3crYErjsRrw.js} +1 -1
- package/screenshot-page/assets/{Bwk0ScujWaYYqx5G.js → DegZKTNqt1LRnSxY.js} +1 -1
- package/screenshot-page/assets/{5TxlmdZxlCDkawVW.js → DjVxI3p3ssmCtYky.js} +1 -1
- package/screenshot-page/assets/Dt1A-DUBfvyouz_T.js +1 -0
- package/screenshot-page/assets/{iAWaCU0XkY0ktnNk.js → DwNHMH9f_lQyn50d.js} +1 -1
- package/screenshot-page/assets/{tPEJNcr51GaPfk3O.js → DwuLl9Ua1k8m9KcK.js} +1 -1
- package/screenshot-page/assets/EY31tFQrw7iYFrr6.js +4 -0
- package/screenshot-page/assets/{C3KvRJ_eXd6xnmlO.js → MzJpKWgPrxR1UN-Y.js} +1 -1
- package/screenshot-page/assets/{DGB9wBuDWt0bzTNE.js → RutPv2GFWmeBiWvn.js} +1 -1
- package/screenshot-page/assets/{DeyRZ5rprDbRbuf4.js → Tj3B5At0OAN3tDza.js} +1 -1
- package/screenshot-page/assets/fQ13z3k3bntY-jfw.js +1 -0
- package/screenshot-page/assets/oO6aFwepb3DDkGYF.js +39 -0
- package/screenshot-page/assets/{t4FRkJl27a0itCt6.js → pH9rKZYDE8xrhkC4.js} +1 -1
- package/screenshot-page/assets/qFyplGXRu7IepHio.js +1 -0
- package/screenshot-page/assets/w7IQEh1FiqZA6o5y.js +42 -0
- package/screenshot-page/assets/{DtihumgXQ7ETaN0A.js → zvxBjll3jnL0-vNn.js} +2 -2
- package/screenshot-page/index.html +11 -11
- package/types/scripting-api.json +7038 -7039
- package/types/scripting.d.ts +8 -15
- package/assets/LLdkCOYvtc1-vOsy.js +0 -14
- package/screenshot-page/assets/2XWoSsrRz2kognCK.js +0 -1
- package/screenshot-page/assets/BCOjWc-VhkuVoCVf.js +0 -1
- package/screenshot-page/assets/BqQ2A9WL6mcRxbSt.js +0 -2
- package/screenshot-page/assets/ByehV0cOs5aIySS-.js +0 -13
- package/screenshot-page/assets/C6vseMcEu3To1U6k.js +0 -4
- package/screenshot-page/assets/CafJ2T5GCjkumgLh.js +0 -1
- package/screenshot-page/assets/CijzqW2bsxOQdDxl.js +0 -2
- package/screenshot-page/assets/D6CzedWHXTesD55R.js +0 -1
- package/screenshot-page/assets/D7e00cCBTtcIRmjV.js +0 -1
- package/screenshot-page/assets/DTrnAtpccj55fGg5.js +0 -1
- package/screenshot-page/assets/DZ2zDgzt-mnhg3Kd.js +0 -1
- package/screenshot-page/assets/DaVBDkeZxbXnuyGz.js +0 -42
- package/screenshot-page/assets/DgNbqKuVd-Q170VZ.js +0 -2
- package/screenshot-page/assets/DjtXY9uxB3QP6hU3.js +0 -1
- package/screenshot-page/assets/Dv-4mfeFKIoD5jaY.js +0 -3
- package/screenshot-page/assets/HZAIE0lHXXFqlb2v.js +0 -1
- package/screenshot-page/assets/Lr2MYBmoCKMLBl_6.js +0 -5
- package/screenshot-page/assets/O-S3tcMip6iXUjQF.js +0 -1
- package/screenshot-page/assets/eV_6j-vFozPgfcjz.js +0 -1
- package/screenshot-page/assets/it1wnIFQtbJ4Dm8N.js +0 -1
- package/screenshot-page/assets/mCyh2440vZi8s1uY.js +0 -39
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.19
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { Q as t, St as e, Z as n, ht as r, ot as o, r as s, u as l } from "./
|
|
8
|
-
import { a as i, r as a } from "./
|
|
9
|
-
import { B as c, M as d, _ as h, f as u, ht as _, sn as f, st as g } from "./
|
|
10
|
-
import { a as p,
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { c as
|
|
7
|
+
import { Q as t, St as e, Z as n, ht as r, ot as o, r as s, u as l } from "./B7vRFm79CUJ1VvFw.js";
|
|
8
|
+
import { a as i, r as a } from "./BPctZbHQFoqJNYzC.js";
|
|
9
|
+
import { B as c, M as d, _ as h, f as u, ht as _, sn as f, st as g } from "./Cgf5GQVN-D8SlQ7A.js";
|
|
10
|
+
import { a as p, f as m, l as S, m as w, p as E, u as I } from "./bJ-XKvDf7IkAafUI.js";
|
|
11
|
+
import { $n as y, $r as v, Aa as x, Ai as C, At as b, Bt as R, C as A, Cn as k, D as N, Dr as M, E as F, Ea as D, Ei as T, F as G, Fn as B, G as V, Ha as O, Hn as P, Hr as z, Ht as L, Ii as $, It as H, Ji as j, Jt as K, Ka as q, Ki as U, Kt as X, La as W, Ln as J, Lt as Q, M as Y, Ma as Z, Mi as tt, Mt as et, N as nt, Oi as rt, Ot as ot, Pn as st, Pr as lt, Pt as it, Qa as at, Qr as ct, Qt as dt, R as ht, Si as ut, Ti as _t, Ua as ft, Ur as gt, V as pt, Va as mt, Vr as St, Vt as wt, Xa as Et, Xn as It, Xr as yt, Y as vt, Ya as xt, Yr as Ct, Z as bt, Zn as Rt, _n as At, _t as kt, a as Nt, aa as Mt, ai as Ft, an as Dt, ar as Tt, b as Gt, br as Bt, c as Vt, ca as Ot, ci as Pt, dt as zt, et as Lt, fa as $t, fo as Ht, fr as jt, g as Kt, ga as qt, hr as Ut, ht as Xt, i as Wt, it as Jt, ja as Qt, jn as Yt, kr as Zt, la as te, li as ee, ln as ne, lo as re, lr as oe, lt as se, m as le, mo as ie, mr as ae, na as ce, nn as de, no as he, nr as ue, nt as _e, oi as fe, oo as ge, or as pe, qi as me, r as Se, si as we, so as Ee, sr as Ie, ta as ye, to as ve, tr as xe, ui as Ce, ur as be, ut as Re, va as Ae, vi as ke, wt as Ne, x as Me, xi as Fe, xn as De, xr as Te, yi as Ge, yr as Be, zi as Ve } from "./BkhdNc3LdmcyAjwk.js";
|
|
12
|
+
import { c as Oe, i as Pe, n as ze, o as Le, s as $e, t as He } from "./CjrzyKFdie6KYfsG.js";
|
|
13
|
+
import { C as je, E as Ke, O as qe, d as Ue, f as Xe, h as We, r as Je, u as Qe, v as Ye, x as Ze } from "./BzkTa7l_e7R--ejo.js";
|
|
14
|
+
import { r as tn } from "./CNPUPTd9h7hwijpZ.js";
|
|
15
|
+
import { _ as en, a as nn, c as rn, d as on, f as sn, g as ln, h as an, i as cn, l as dn, m as hn, n as un, o as _n, p as fn, r as gn, s as pn, u as mn } from "./Se9JmvmEtu4MfXJh.js";
|
|
16
16
|
var Sn = class e {
|
|
17
17
|
constructor(e, n) {
|
|
18
18
|
this._grid = null, this._value = e, this._axis = n?.axis ?? t.Row, this._maxCoords = n?.maxCoords;
|
|
@@ -20,7 +20,7 @@ var Sn = class e {
|
|
|
20
20
|
_materialize() {
|
|
21
21
|
let t = this._grid;
|
|
22
22
|
if (!t) {
|
|
23
|
-
t = new
|
|
23
|
+
t = new F({
|
|
24
24
|
axis: this._axis,
|
|
25
25
|
maxCoords: this._maxCoords
|
|
26
26
|
});
|
|
@@ -76,18 +76,18 @@ var Sn = class e {
|
|
|
76
76
|
if (n) return n.entries(e);
|
|
77
77
|
if (e?.processRowSkip || e?.processColumnSkip) return this._materialize().entries(e);
|
|
78
78
|
const r = this._value;
|
|
79
|
-
if (null == r) return
|
|
79
|
+
if (null == r) return P;
|
|
80
80
|
const o = e?.bounds;
|
|
81
|
-
if (o && ((o.colStart ?? 0) > 0 || (o.rowStart ?? 0) > 0 || (o.colEnd ?? 0) < 0 || (o.rowEnd ?? 0) < 0)) return
|
|
81
|
+
if (o && ((o.colStart ?? 0) > 0 || (o.rowStart ?? 0) > 0 || (o.colEnd ?? 0) < 0 || (o.rowEnd ?? 0) < 0)) return P;
|
|
82
82
|
const s = e?.axis ? e.axis === t.Column : this._axis === t.Column, l = e ? Be(e.reuseResult) : void 0, i = this;
|
|
83
83
|
let a = !1, c = null;
|
|
84
84
|
return {
|
|
85
|
-
next: (t) => c ? c.next(t) : t ? (c = i._materialize().entries(e), c.next(t)) : a ?
|
|
85
|
+
next: (t) => c ? c.next(t) : t ? (c = i._materialize().entries(e), c.next(t)) : a ? Jt : (a = !0, Wt(0, 0, r, s, l)),
|
|
86
86
|
[Symbol.iterator]() {
|
|
87
87
|
return this;
|
|
88
88
|
},
|
|
89
|
-
return: (t) =>
|
|
90
|
-
throw: (t) =>
|
|
89
|
+
return: (t) => Jt,
|
|
90
|
+
throw: (t) => Jt
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
keys(t) {
|
|
@@ -243,7 +243,7 @@ var Sn = class e {
|
|
|
243
243
|
_getOrCreate2D(t) {
|
|
244
244
|
if (!t) throw new Error(In);
|
|
245
245
|
let e = this._mapScopeTo2Ds.get(t);
|
|
246
|
-
return e || (e = new
|
|
246
|
+
return e || (e = new rt(this._options2D), this._mapScopeTo2Ds.set(t, e), this._last2DKey = t, this._last2DMap = e), e;
|
|
247
247
|
}
|
|
248
248
|
_cleanupEmpty2D(t, e) {
|
|
249
249
|
e?.isEmpty() && (this._mapScopeTo2Ds.delete(t), this._last2DKey === t && (this._last2DKey = void 0, this._last2DMap = void 0));
|
|
@@ -263,7 +263,7 @@ var Sn = class e {
|
|
|
263
263
|
return n.isLambdaCallable = !0, n.checkArity = (n) => n >= e && n <= t.length, n.paramCount = t.length, n;
|
|
264
264
|
}
|
|
265
265
|
_function() {
|
|
266
|
-
return this._asFunction ??=
|
|
266
|
+
return this._asFunction ??= Z(this);
|
|
267
267
|
}
|
|
268
268
|
execute(...t) {
|
|
269
269
|
return this._function().execute(...t);
|
|
@@ -301,8 +301,8 @@ var Sn = class e {
|
|
|
301
301
|
try {
|
|
302
302
|
return t.execute(...e);
|
|
303
303
|
} catch (t) {
|
|
304
|
-
if (
|
|
305
|
-
return
|
|
304
|
+
if (W(t)) throw t;
|
|
305
|
+
return I.isError(t) ? t : new I.Value(t?.message, { cause: t });
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
308
|
return e.isLambdaCallable = !0, e.checkArity = () => !0, e.paramCount = -1, e;
|
|
@@ -341,18 +341,18 @@ var Sn = class e {
|
|
|
341
341
|
getTextAt(t, e, n = !1, r, o) {
|
|
342
342
|
const s = "display" === o, l = this._compiled;
|
|
343
343
|
if (l.error && !l.ast) return l.error.input;
|
|
344
|
-
let i = void 0 !== r ?
|
|
345
|
-
i =
|
|
344
|
+
let i = void 0 !== r ? Ze(l.ast, r) : l.getTokens();
|
|
345
|
+
i = Mt(i, l.symbols, !s, s, s ? {
|
|
346
346
|
scope: this._gridId,
|
|
347
347
|
rowIndex: t,
|
|
348
348
|
colIndex: e
|
|
349
349
|
} : null);
|
|
350
|
-
const a = s ? this._displayLocale() :
|
|
350
|
+
const a = s ? this._displayLocale() : De;
|
|
351
351
|
return n ? Et(i, this._getEntireCoords?.(), a) : Te(i, this._getEntireCoords?.(), t, e, a);
|
|
352
352
|
}
|
|
353
353
|
_displayLocale() {
|
|
354
354
|
const t = this._context.getRuntime().getLocaleProfile();
|
|
355
|
-
return
|
|
355
|
+
return q(At(t.decimal));
|
|
356
356
|
}
|
|
357
357
|
getRecord() {
|
|
358
358
|
const t = this._record;
|
|
@@ -365,7 +365,7 @@ var Sn = class e {
|
|
|
365
365
|
input: n.input,
|
|
366
366
|
message: String(t?.message ?? ""),
|
|
367
367
|
unparsed: !e.ast,
|
|
368
|
-
details: t instanceof
|
|
368
|
+
details: t instanceof I.Parse ? t.getDetails() : void 0
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
371
|
const o = {
|
|
@@ -396,19 +396,19 @@ var Sn = class e {
|
|
|
396
396
|
$rowEnd: e.$rowEnd,
|
|
397
397
|
scope: t.scope
|
|
398
398
|
};
|
|
399
|
-
} else n.node.type ===
|
|
399
|
+
} else n.node.type === k.Cell ? i = { ...o[n.value] } : n.op === k.Named ? i = { nameId: n.node.value.nameId } : n.op === k.TableReference && (i = { table: { ...n.node.value } });
|
|
400
400
|
s[t] = i;
|
|
401
401
|
}
|
|
402
402
|
return s;
|
|
403
403
|
}
|
|
404
404
|
getNode() {
|
|
405
405
|
const t = this._compiled;
|
|
406
|
-
return t.ast ?
|
|
406
|
+
return t.ast ? tn(t.ast, t.symbols) : null;
|
|
407
407
|
}
|
|
408
408
|
getTokensAt(t, e, n) {
|
|
409
409
|
const r = this._compiled;
|
|
410
|
-
let o = void 0 !== n ?
|
|
411
|
-
return o =
|
|
410
|
+
let o = void 0 !== n ? Ze(r.ast, n) : r.getTokens();
|
|
411
|
+
return o = Mt(o, r.symbols, !1, !0), le(o, t, e);
|
|
412
412
|
}
|
|
413
413
|
getError() {
|
|
414
414
|
return this._compiled.error ?? null;
|
|
@@ -437,17 +437,17 @@ var Sn = class e {
|
|
|
437
437
|
}
|
|
438
438
|
demandFirstCell() {
|
|
439
439
|
const t = this._compiled;
|
|
440
|
-
t?.ast &&
|
|
440
|
+
t?.ast && Ue(t.ast, t.getFunction);
|
|
441
441
|
}
|
|
442
442
|
getPositionVariants() {
|
|
443
443
|
let e = this._positionVariants;
|
|
444
444
|
if (void 0 !== e) return e;
|
|
445
445
|
e = null;
|
|
446
|
-
const n = this._compiled, r = n && !n.error && n.ast ?
|
|
446
|
+
const n = this._compiled, r = n && !n.error && n.ast ? Je(n.ast, n.getFunction) : null;
|
|
447
447
|
if (r) {
|
|
448
448
|
const o = void 0 !== n.ast.firstCell;
|
|
449
449
|
e = r.map((e) => {
|
|
450
|
-
const r = new t(
|
|
450
|
+
const r = new t(Ke(n.runtime, n.symbols, e, !1, null, n.getFunction), this._context, this._calcScope, this._gridId, this._getEntireCoords, this._resolvers);
|
|
451
451
|
return o && r.demandFirstCell(), r;
|
|
452
452
|
});
|
|
453
453
|
}
|
|
@@ -467,7 +467,7 @@ var Sn = class e {
|
|
|
467
467
|
getReferences(t, e) {
|
|
468
468
|
const n = this._compiled, o = n.referenceIndices, s = o.length;
|
|
469
469
|
if (0 === s) return r.EmptyArray;
|
|
470
|
-
const l = n.referencesExecute, i = n.referencesRelative, a =
|
|
470
|
+
const l = n.referencesExecute, i = n.referencesRelative, a = it(s);
|
|
471
471
|
for (let n = 0; n < s; n++) {
|
|
472
472
|
const r = l[o[n]], s = r.inputs;
|
|
473
473
|
if (s && 2 === s.length) {
|
|
@@ -483,26 +483,26 @@ var Sn = class e {
|
|
|
483
483
|
$rowEnd: e.$rowEnd,
|
|
484
484
|
scope: t.scope
|
|
485
485
|
};
|
|
486
|
-
} else if (r.node.type ===
|
|
486
|
+
} else if (r.node.type === k.Cell) {
|
|
487
487
|
const t = i[r.value];
|
|
488
488
|
a[n] = { ...t };
|
|
489
|
-
} else if (r.op ===
|
|
490
|
-
const t = r.node.value.nameId, e = this._compiled.symbols?.resolve(
|
|
489
|
+
} else if (r.op === k.Named) {
|
|
490
|
+
const t = r.node.value.nameId, e = this._compiled.symbols?.resolve(de.NamedFormula, t)?.toString() ?? t;
|
|
491
491
|
a[n] = { nameId: e };
|
|
492
|
-
} else if (r.op ===
|
|
492
|
+
} else if (r.op === k.TableReference) {
|
|
493
493
|
const o = r.node.value;
|
|
494
494
|
let s = this._resolveStructuredRef(o, t, e);
|
|
495
|
-
!s ||
|
|
495
|
+
!s || I.isError(s) ? a[n] = null : a[n] = {
|
|
496
496
|
...s,
|
|
497
497
|
tableId: o.tableId
|
|
498
498
|
};
|
|
499
|
-
} else r.op ===
|
|
499
|
+
} else r.op === k.Error && (a[n] = null);
|
|
500
500
|
}
|
|
501
501
|
return a;
|
|
502
502
|
}
|
|
503
503
|
getReferencesAt(t, e) {
|
|
504
504
|
const n = this.getReferences(t, e);
|
|
505
|
-
return 0 === n.length ? r.EmptyArray :
|
|
505
|
+
return 0 === n.length ? r.EmptyArray : v(n, t, e);
|
|
506
506
|
}
|
|
507
507
|
getFormatReferences() {
|
|
508
508
|
const t = this._formatReferences;
|
|
@@ -532,37 +532,37 @@ var Sn = class e {
|
|
|
532
532
|
e < 0 && (e = i.length + e);
|
|
533
533
|
const c = i[e];
|
|
534
534
|
if (void 0 === c) throw new Error(`Invalid reference index: ${e}`);
|
|
535
|
-
const d = a[c], h = d.node, u = h.inputs ?? r.EmptyArray, _ = d.op ===
|
|
536
|
-
let g, p,
|
|
537
|
-
n &&
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
const t =
|
|
535
|
+
const d = a[c], h = d.node, u = h.inputs ?? r.EmptyArray, _ = d.op === k.Named, f = 2 === u.length;
|
|
536
|
+
let g, p, m = !1;
|
|
537
|
+
n && I.isError(n) && (n = null), n && "nameId" in n && !_ && (n = null);
|
|
538
|
+
const S = n && "nameId" in n ? null : n, w = !!S && void 0 !== S.colIndex;
|
|
539
|
+
if (S) if (w) {
|
|
540
|
+
const t = S;
|
|
541
541
|
g = {
|
|
542
542
|
colIndex: t.colIndex,
|
|
543
543
|
rowIndex: t.rowIndex,
|
|
544
544
|
$colIndex: t.$colIndex ?? !1,
|
|
545
545
|
$rowIndex: t.$rowIndex ?? !1
|
|
546
|
-
}, t.scope && (g.scope = t.scope),
|
|
546
|
+
}, t.scope && (g.scope = t.scope), m = !1;
|
|
547
547
|
} else {
|
|
548
|
-
const t =
|
|
548
|
+
const t = S;
|
|
549
549
|
g = {
|
|
550
550
|
colIndex: t.colStart,
|
|
551
551
|
rowIndex: t.rowStart,
|
|
552
552
|
$colIndex: t.$colStart ?? !1,
|
|
553
553
|
$rowIndex: t.$rowStart ?? !1
|
|
554
|
-
}, t.scope && (g.scope = t.scope),
|
|
554
|
+
}, t.scope && (g.scope = t.scope), m = f || !o.isSingleCell(t), m && (p = {
|
|
555
555
|
colIndex: t.colEnd,
|
|
556
556
|
rowIndex: t.rowEnd,
|
|
557
557
|
$colIndex: t.$colEnd ?? !1,
|
|
558
558
|
$rowIndex: t.$rowEnd ?? !1
|
|
559
559
|
}, t.colEnd === Number.MAX_SAFE_INTEGER && (p.colIndex = Number.MIN_SAFE_INTEGER), t.rowEnd === Number.MAX_SAFE_INTEGER && (p.rowIndex = Number.MIN_SAFE_INTEGER));
|
|
560
560
|
}
|
|
561
|
-
const
|
|
561
|
+
const E = w && f;
|
|
562
562
|
let y = -1, v = -1, x = -1, C = -1;
|
|
563
563
|
if (f) y = u[0].evalIndex, v = u[1].evalIndex;
|
|
564
564
|
else if ("cell" === h.type) y = h.evalIndex;
|
|
565
|
-
else if (d.op ===
|
|
565
|
+
else if (d.op === k.TableReference) x = h.evalIndex;
|
|
566
566
|
else {
|
|
567
567
|
if (!_) throw new Error(`Invalidate reference index: ${e}`);
|
|
568
568
|
C = h.evalIndex;
|
|
@@ -572,55 +572,55 @@ var Sn = class e {
|
|
|
572
572
|
const e = this._compiled.symbols;
|
|
573
573
|
for (let n = 0; n < t.length; n++) {
|
|
574
574
|
const r = (t[n]?.value)?.scope;
|
|
575
|
-
if (r) return e && !e.resolve(
|
|
575
|
+
if (r) return e && !e.resolve(de.Sheet, r) ? null : r;
|
|
576
576
|
}
|
|
577
577
|
return null;
|
|
578
|
-
},
|
|
578
|
+
}, R = h, A = this._compiled.ast, N = we(A, (t) => {
|
|
579
579
|
if (!t || !t.isReference) return;
|
|
580
|
-
if (
|
|
580
|
+
if (E && t === R) return ve(g);
|
|
581
581
|
const e = t.type;
|
|
582
|
-
if (-1 !== C && t.evalIndex === C && e ===
|
|
583
|
-
if (!n) return
|
|
582
|
+
if (-1 !== C && t.evalIndex === C && e === k.Named) {
|
|
583
|
+
if (!n) return Zt();
|
|
584
584
|
if (n && "nameId" in n) {
|
|
585
|
-
const e = n, r = this._compiled.symbols?.bind(
|
|
585
|
+
const e = n, r = this._compiled.symbols?.bind(de.NamedFormula, e.nameId) ?? e.nameId, o = { ...t };
|
|
586
586
|
return o.value = {
|
|
587
587
|
...t.value,
|
|
588
588
|
...e,
|
|
589
589
|
nameId: r
|
|
590
590
|
}, o;
|
|
591
591
|
}
|
|
592
|
-
return
|
|
592
|
+
return m ? pe(":", ve(g), ve(p), !0) : ve(g);
|
|
593
593
|
}
|
|
594
|
-
if (-1 !== x && t.evalIndex === x && e ===
|
|
595
|
-
if (!n &&
|
|
594
|
+
if (-1 !== x && t.evalIndex === x && e === k.TableReference) return n ? m ? pe(":", ve(g), ve(p), !0) : ve(g) : Zt();
|
|
595
|
+
if (!n && Qe.includes(t.value)) {
|
|
596
596
|
const e = t.inputs ?? r.EmptyArray, n = e[0], o = e[1];
|
|
597
597
|
let s = n.evalIndex === y, l = o.evalIndex === v;
|
|
598
598
|
if (s || l) {
|
|
599
|
-
const e =
|
|
599
|
+
const e = Zt(void 0, void 0, b(n, o));
|
|
600
600
|
return e.evalIndex = t.evalIndex, e;
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
if ("cell" !== e && "error" !== e) return;
|
|
604
604
|
const o = t.evalIndex;
|
|
605
605
|
let s, l = o === y;
|
|
606
|
-
if ((l || o === v) && !
|
|
607
|
-
if (n) if (f ===
|
|
606
|
+
if ((l || o === v) && !E) {
|
|
607
|
+
if (n) if (f === m) {
|
|
608
608
|
let e = l ? g : p;
|
|
609
609
|
s = { ...t }, s.value = e, s.image = null;
|
|
610
|
-
} else s =
|
|
611
|
-
else s =
|
|
610
|
+
} else s = pe(":", ve(g), ve(p), !0);
|
|
611
|
+
else s = Zt(void 0, void 0, b(t)), s.evalIndex = t.evalIndex;
|
|
612
612
|
return s;
|
|
613
613
|
}
|
|
614
614
|
});
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
return new t(
|
|
615
|
+
if (N === A) return this;
|
|
616
|
+
const M = Ke(l.runtime, l.symbols, N, !1, l.error, l.getFunction);
|
|
617
|
+
return new t(M, this._context, this._calcScope, this._gridId, this._getEntireCoords, this._resolvers);
|
|
618
618
|
}
|
|
619
619
|
reanchorReferences(e, n) {
|
|
620
|
-
const r = this._compiled, o = this._gridId, s = this._compiled.symbols.bind(
|
|
620
|
+
const r = this._compiled, o = this._gridId, s = this._compiled.symbols.bind(de.Sheet, e), l = r.transform((t, e) => {
|
|
621
621
|
if (!t || !t.isReference) return;
|
|
622
|
-
if (t.type !==
|
|
623
|
-
if (
|
|
622
|
+
if (t.type !== k.Cell) return;
|
|
623
|
+
if (je(e) && e.inputs?.[0] !== t) return;
|
|
624
624
|
let r;
|
|
625
625
|
const l = t.value.scope;
|
|
626
626
|
return (!l || n && l === o) && (r = { ...t }, r.value = { ...r.value }, r.value.scope = s), r;
|
|
@@ -631,8 +631,8 @@ var Sn = class e {
|
|
|
631
631
|
if (e === n) return this;
|
|
632
632
|
const r = this._compiled, o = r.transform((t, r) => {
|
|
633
633
|
if (!t || !t.isReference) return;
|
|
634
|
-
if (t.type !==
|
|
635
|
-
if (
|
|
634
|
+
if (t.type !== k.Cell) return;
|
|
635
|
+
if (je(r) && r.inputs?.[0] !== t) return;
|
|
636
636
|
if (t.value.scope !== e) return;
|
|
637
637
|
const o = { ...t };
|
|
638
638
|
return o.value = { ...o.value }, o.value.scope = n, o;
|
|
@@ -641,7 +641,7 @@ var Sn = class e {
|
|
|
641
641
|
}
|
|
642
642
|
replaceTableReferences(e, n) {
|
|
643
643
|
const r = this._compiled, o = r.transform((t) => {
|
|
644
|
-
if (t?.type !==
|
|
644
|
+
if (t?.type !== k.TableReference) return;
|
|
645
645
|
const r = t.value;
|
|
646
646
|
if ("object" != typeof r || r?.tableId !== e) return;
|
|
647
647
|
const o = n(r);
|
|
@@ -651,11 +651,11 @@ var Sn = class e {
|
|
|
651
651
|
}
|
|
652
652
|
_evaluateNamed(t, e, n) {
|
|
653
653
|
const r = t.nameId, o = this._calcScope;
|
|
654
|
-
if (o.activeNames.has(r)) return
|
|
654
|
+
if (o.activeNames.has(r)) return I.BuiltIn.Ref;
|
|
655
655
|
const s = this._resolvers?.getNamedFormulaBlock?.(r);
|
|
656
656
|
if (!s) {
|
|
657
|
-
const t = this._compiled, e = t.symbols?.resolve(
|
|
658
|
-
return o ? new vn(o) :
|
|
657
|
+
const t = this._compiled, e = t.symbols?.resolve(de.NamedFormula, r), n = e ? e.toString() : r, o = t.getFunction?.(n) ?? null;
|
|
658
|
+
return o ? new vn(o) : I.BuiltIn.Name;
|
|
659
659
|
}
|
|
660
660
|
const l = o.gridId, i = o.rowIndex, a = o.colIndex;
|
|
661
661
|
o.activeNames.add(r), o.depth++;
|
|
@@ -669,7 +669,7 @@ var Sn = class e {
|
|
|
669
669
|
const o = t.nameId, s = this._calcScope;
|
|
670
670
|
if (s.activeNames.has(o)) return r.EmptyArray;
|
|
671
671
|
const l = this._resolvers?.getNamedFormulaBlock?.(o);
|
|
672
|
-
if (!l) return
|
|
672
|
+
if (!l) return I.BuiltIn.Name;
|
|
673
673
|
s.activeNames.add(o);
|
|
674
674
|
try {
|
|
675
675
|
return l.resolvedPrecedentsAt(e, n);
|
|
@@ -679,7 +679,7 @@ var Sn = class e {
|
|
|
679
679
|
}
|
|
680
680
|
_resolveStructuredRef(t, e, n, r) {
|
|
681
681
|
const o = this._resolvers?.getStructureReferenceCoords;
|
|
682
|
-
return o ? o(t, e, n, this._gridId) :
|
|
682
|
+
return o ? o(t, e, n, this._gridId) : I.BuiltIn.Name;
|
|
683
683
|
}
|
|
684
684
|
resolvedPrecedentsAt(t, e, n = !1, o, s) {
|
|
685
685
|
const l = this._compiled, i = l.referencesRoot, a = i.length;
|
|
@@ -694,53 +694,53 @@ var Sn = class e {
|
|
|
694
694
|
f[r.index] = t;
|
|
695
695
|
continue;
|
|
696
696
|
}
|
|
697
|
-
if (o ===
|
|
697
|
+
if (o === k.Named) {
|
|
698
698
|
f[r.index] = this._resolveNamedPrecedents(r.node.value, t, e);
|
|
699
699
|
continue;
|
|
700
700
|
}
|
|
701
|
-
if (o ===
|
|
702
|
-
f[r.index] =
|
|
701
|
+
if (o === k.Error) {
|
|
702
|
+
f[r.index] = Vt(r.node.value);
|
|
703
703
|
continue;
|
|
704
704
|
}
|
|
705
|
-
if (o ===
|
|
705
|
+
if (o === k.TableReference) {
|
|
706
706
|
const n = r.node.value;
|
|
707
707
|
let o;
|
|
708
|
-
n && (o = this._resolveStructuredRef(n, t, e)), o || (o =
|
|
708
|
+
n && (o = this._resolveStructuredRef(n, t, e)), o || (o = I.BuiltIn.Ref), f[r.index] = o;
|
|
709
709
|
continue;
|
|
710
710
|
}
|
|
711
711
|
if ("@" === o || "#" === o) {
|
|
712
712
|
const t = f[r.inputs[0]];
|
|
713
|
-
f[r.index] = void 0 === t ?
|
|
713
|
+
f[r.index] = void 0 === t ? I.BuiltIn.Value : t;
|
|
714
714
|
continue;
|
|
715
715
|
}
|
|
716
716
|
const s = r.inputs;
|
|
717
717
|
if (!s) continue;
|
|
718
718
|
let l = f[s[0]];
|
|
719
719
|
if (void 0 === l) {
|
|
720
|
-
f[r.index] =
|
|
720
|
+
f[r.index] = I.BuiltIn.Value;
|
|
721
721
|
continue;
|
|
722
722
|
}
|
|
723
|
-
if (
|
|
723
|
+
if (I.isError(l)) {
|
|
724
724
|
f[r.index] = l;
|
|
725
725
|
continue;
|
|
726
726
|
}
|
|
727
727
|
let i, a = f[s[1]];
|
|
728
|
-
if (void 0 !== a) if (
|
|
728
|
+
if (void 0 !== a) if (I.isError(a)) f[r.index] = a;
|
|
729
729
|
else {
|
|
730
730
|
if (" " === o) {
|
|
731
731
|
const t = l.scope ? a.scope ? null : l.scope : a.scope;
|
|
732
|
-
i = t && this._gridId && t !== this._gridId ?
|
|
733
|
-
} else if (":" === o || ".:." === o || ":." === o || ".:" === o) i =
|
|
732
|
+
i = t && this._gridId && t !== this._gridId ? I.BuiltIn.Value : qt(l, a);
|
|
733
|
+
} else if (":" === o || ".:." === o || ":." === o || ".:" === o) i = It(l, a);
|
|
734
734
|
else if ("," === o) {
|
|
735
735
|
const t = s.length;
|
|
736
736
|
for (let e = 0; e < t; e++) {
|
|
737
737
|
const t = f[s[e]];
|
|
738
|
-
void 0 === t || Array.isArray(t) ||
|
|
738
|
+
void 0 === t || Array.isArray(t) || I.isError(t) || (i = i ? It(i, t) : t);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
f[r.index] = i ??
|
|
741
|
+
f[r.index] = i ?? I.BuiltIn.Null;
|
|
742
742
|
}
|
|
743
|
-
else f[r.index] =
|
|
743
|
+
else f[r.index] = I.BuiltIn.Value;
|
|
744
744
|
}
|
|
745
745
|
const g = [];
|
|
746
746
|
let p = 0;
|
|
@@ -762,7 +762,7 @@ var Sn = class e {
|
|
|
762
762
|
const s = e.op;
|
|
763
763
|
let h, u = null;
|
|
764
764
|
if (s) {
|
|
765
|
-
if (s ===
|
|
765
|
+
if (s === k.Error) h = Vt(e.node.value);
|
|
766
766
|
else if (":" === s || ".:." === s || ":." === s || ".:" === s) {
|
|
767
767
|
const t = e.inputs;
|
|
768
768
|
if (t && 2 === t.length) {
|
|
@@ -791,7 +791,7 @@ var Sn = class e {
|
|
|
791
791
|
let s = this._compiled;
|
|
792
792
|
if (void 0 !== n) {
|
|
793
793
|
let r;
|
|
794
|
-
if (
|
|
794
|
+
if (we(s.ast, (t) => {
|
|
795
795
|
t.evalIndex === n && (r = t);
|
|
796
796
|
}), !r) throw new Error(`Invalid evalIndex: ${n}`);
|
|
797
797
|
if (s.bindings.length > 0 && !s.error) {
|
|
@@ -799,25 +799,25 @@ var Sn = class e {
|
|
|
799
799
|
const o = s.evaluations;
|
|
800
800
|
return (() => o[n] ?? (!0 === r.inLazy ? this._valueOfLazy(r, o, null, t, e) : void 0))();
|
|
801
801
|
}
|
|
802
|
-
s =
|
|
802
|
+
s = Ke(o.getRuntime(), s.symbols, Tn(r), !1);
|
|
803
803
|
}
|
|
804
804
|
if (s.error) return s.error.cause;
|
|
805
|
-
s.hasVolatile && r.node && o.
|
|
805
|
+
s.hasVolatile && r.node && o._markVolatile();
|
|
806
806
|
const l = s.evaluations, i = s.executions;
|
|
807
807
|
s.bindings;
|
|
808
808
|
const a = s.referencesExecute, c = s.referencesRelative, d = s.referencesAbsolute, h = a.length;
|
|
809
809
|
for (let n = 0; n < h; n++) {
|
|
810
810
|
const r = a[n], s = r.op, i = r.node;
|
|
811
|
-
if (s) if (s ===
|
|
811
|
+
if (s) if (s === k.Named) if (r.node.deferredResolve) l[r.node.evalIndex] = null;
|
|
812
812
|
else {
|
|
813
813
|
const n = r.node.value;
|
|
814
814
|
l[r.node.evalIndex] = this._evaluateNamed(n, t, e);
|
|
815
815
|
}
|
|
816
|
-
else if (s ===
|
|
817
|
-
else if (s ===
|
|
816
|
+
else if (s === k.Error) l[i.evalIndex] = Vt(r.node.value);
|
|
817
|
+
else if (s === k.TableReference) {
|
|
818
818
|
const n = r.node.value;
|
|
819
819
|
let s;
|
|
820
|
-
s = n ? this._resolveStructuredRef(n, t, e) :
|
|
820
|
+
s = n ? this._resolveStructuredRef(n, t, e) : I.BuiltIn.Ref, I.isError(s) || void 0 === s?.colStart ? l[i.evalIndex] = s ?? I.BuiltIn.Ref : l[i.evalIndex] = o.getReference(s);
|
|
821
821
|
} else "structured" === s && (l[i.evalIndex] = null);
|
|
822
822
|
else {
|
|
823
823
|
const n = kn(c[r.value], t, e, d[r.value]);
|
|
@@ -830,41 +830,41 @@ var Sn = class e {
|
|
|
830
830
|
const o = this._compiled, s = o.ast;
|
|
831
831
|
if (!s || !s.isReference) return this;
|
|
832
832
|
if ("cell" === s.type) return this;
|
|
833
|
-
if (s.type ===
|
|
833
|
+
if (s.type === k.Error) return this;
|
|
834
834
|
if ("@" === s.value) return this;
|
|
835
835
|
if (!r) return this;
|
|
836
|
-
const l =
|
|
836
|
+
const l = Ee(n) + _t(e);
|
|
837
837
|
if (r.has(l)) return this;
|
|
838
|
-
const i =
|
|
838
|
+
const i = Ut("@", s, !0), a = Ke(o.runtime, o.symbols, i, !1, o.error, o.getFunction);
|
|
839
839
|
return new t(a, this._context, this._calcScope, this._gridId, this._getEntireCoords, this._resolvers);
|
|
840
840
|
}
|
|
841
841
|
_executeNode(t, e, n, r, o = null) {
|
|
842
842
|
const s = this._context, l = t.inputs, i = l ? l.length : 0, a = t.type;
|
|
843
843
|
let c;
|
|
844
844
|
switch (a) {
|
|
845
|
-
case
|
|
845
|
+
case k.Infix: {
|
|
846
846
|
const n = t.value;
|
|
847
847
|
let r = e[l[0].evalIndex], o = e[l[1].evalIndex];
|
|
848
|
-
if (!0 === t.firstCell && !t.isReference && this._demandsFirstCell() && (r =
|
|
848
|
+
if (!0 === t.firstCell && !t.isReference && this._demandsFirstCell() && (r = An(r), o = An(o)), ("+" === n || "-" === n) && (r = Rn(s, r), "number" == typeof r && (o = Rn(s, o), "number" == typeof o))) {
|
|
849
849
|
const e = "+" === n ? r + o : r - o;
|
|
850
|
-
return
|
|
850
|
+
return zt(!0 === t.snapsCancellation ? Y(e, r) : e, null);
|
|
851
851
|
}
|
|
852
852
|
if (!t.isReference) {
|
|
853
|
-
if (r &&
|
|
854
|
-
if (o &&
|
|
853
|
+
if (r && I.isError(r)) return r;
|
|
854
|
+
if (o && I.isError(o)) return o;
|
|
855
855
|
}
|
|
856
|
-
const i = t.fn ?? (t.fn = !0 === t.snapsCancellation ?
|
|
857
|
-
return c = i ? i(s, r, o) :
|
|
856
|
+
const i = t.fn ?? (t.fn = !0 === t.snapsCancellation ? qe[t.value] : Xe[t.value]);
|
|
857
|
+
return c = i ? i(s, r, o) : I.BuiltIn.Value, c = zt(c, null), c;
|
|
858
858
|
}
|
|
859
|
-
case
|
|
859
|
+
case k.Function: {
|
|
860
860
|
const s = t.binder;
|
|
861
861
|
if (void 0 !== s) return "let" === s.kind ? e[l[i - 1].evalIndex] : this._createLambdaValue(t, e, o, n, r);
|
|
862
862
|
if (!0 === t.hasLazyArgs) {
|
|
863
|
-
const s =
|
|
863
|
+
const s = me.enter();
|
|
864
864
|
try {
|
|
865
|
-
this._fillLazyArgs(l, i, e, o, n, r, s), !0 === t.passOmitted && Dn(l, i), c = this._callFunction(t, Fn, i), c instanceof
|
|
865
|
+
this._fillLazyArgs(l, i, e, o, n, r, s), !0 === t.passOmitted && Dn(l, i), c = this._callFunction(t, Fn, i), c instanceof me && (c = c._force());
|
|
866
866
|
} finally {
|
|
867
|
-
|
|
867
|
+
me.leave(s);
|
|
868
868
|
}
|
|
869
869
|
} else {
|
|
870
870
|
for (let t = 0; t < i; t++) Fn[t] = e[l[t].evalIndex];
|
|
@@ -872,22 +872,22 @@ var Sn = class e {
|
|
|
872
872
|
}
|
|
873
873
|
return c;
|
|
874
874
|
}
|
|
875
|
-
case
|
|
876
|
-
case
|
|
875
|
+
case k.Prefix:
|
|
876
|
+
case k.Postfix: {
|
|
877
877
|
let n = e[l[0].evalIndex];
|
|
878
|
-
if (!0 === t.firstCell && !t.isReference && "@" !== t.value && this._demandsFirstCell() && (n =
|
|
879
|
-
const r = t.fn ?? (t.fn = a ===
|
|
880
|
-
return c = r ? r(s, n) :
|
|
878
|
+
if (!0 === t.firstCell && !t.isReference && "@" !== t.value && this._demandsFirstCell() && (n = An(n)), n && I.isError(n)) return n;
|
|
879
|
+
const r = t.fn ?? (t.fn = a === k.Prefix ? We[t.value] : Ye[t.value]);
|
|
880
|
+
return c = r ? r(s, n) : I.BuiltIn.Value, c;
|
|
881
881
|
}
|
|
882
|
-
case
|
|
883
|
-
case
|
|
882
|
+
case k.List:
|
|
883
|
+
case k.Paren: {
|
|
884
884
|
if (1 === i) return e[l[0].evalIndex];
|
|
885
885
|
for (let t = 0; t < i; t++) {
|
|
886
886
|
const n = e[l[t].evalIndex];
|
|
887
|
-
if (null !== n && "object" == typeof n &&
|
|
887
|
+
if (null !== n && "object" == typeof n && tt(n.scope)) return I.BuiltIn.Name;
|
|
888
888
|
}
|
|
889
889
|
let t = !1;
|
|
890
|
-
for (let n = 0; n < i; n++) if (
|
|
890
|
+
for (let n = 0; n < i; n++) if (X(e[l[n].evalIndex])) {
|
|
891
891
|
t = !0;
|
|
892
892
|
break;
|
|
893
893
|
}
|
|
@@ -895,17 +895,17 @@ var Sn = class e {
|
|
|
895
895
|
const t = [];
|
|
896
896
|
for (let n = 0; n < i; n++) {
|
|
897
897
|
const r = e[l[n].evalIndex];
|
|
898
|
-
|
|
898
|
+
X(r) ? t.push(...r) : t.push(r);
|
|
899
899
|
}
|
|
900
|
-
const n =
|
|
900
|
+
const n = it(t.length);
|
|
901
901
|
for (let e = 0; e < t.length; e++) n[e] = t[e];
|
|
902
902
|
return n;
|
|
903
903
|
}
|
|
904
|
-
const n =
|
|
904
|
+
const n = it(i);
|
|
905
905
|
for (let t = 0; t < i; t++) n[t] = e[l[t].evalIndex];
|
|
906
906
|
return n;
|
|
907
907
|
}
|
|
908
|
-
case
|
|
908
|
+
case k.Named: {
|
|
909
909
|
const s = t.binding;
|
|
910
910
|
if (void 0 !== s) {
|
|
911
911
|
const n = this._compiled.bindings[s.slot];
|
|
@@ -917,16 +917,16 @@ var Sn = class e {
|
|
|
917
917
|
const e = o.get(s.slot);
|
|
918
918
|
return !0 === t.rawFrameRead ? e : (d = e) === xn ? null : d;
|
|
919
919
|
}
|
|
920
|
-
return
|
|
920
|
+
return I.BuiltIn.Calc;
|
|
921
921
|
}
|
|
922
922
|
return !0 === t.deferredResolve ? this._evaluateNamed(t.value, n, r) : e[t.evalIndex] ?? null;
|
|
923
923
|
}
|
|
924
|
-
case
|
|
925
|
-
case
|
|
924
|
+
case k.TableReference: return e[t.evalIndex] ?? null;
|
|
925
|
+
case k.Call: {
|
|
926
926
|
const n = e[l[0].evalIndex];
|
|
927
|
-
return n &&
|
|
927
|
+
return n && I.isError(n) ? n : (c = this._applyCallee(n, t, e), c);
|
|
928
928
|
}
|
|
929
|
-
case
|
|
929
|
+
case k.Empty: return;
|
|
930
930
|
}
|
|
931
931
|
var d;
|
|
932
932
|
}
|
|
@@ -936,7 +936,7 @@ var Sn = class e {
|
|
|
936
936
|
const e = t[r];
|
|
937
937
|
if (!0 === e?.lazyArg) continue;
|
|
938
938
|
const o = n[e.evalIndex];
|
|
939
|
-
!a && (!0 === o?.isIRange ? o.size > 1 :
|
|
939
|
+
!a && (!0 === o?.isIRange ? o.size > 1 : X(o)) && (a = !0);
|
|
940
940
|
}
|
|
941
941
|
if (a) {
|
|
942
942
|
i = [];
|
|
@@ -947,7 +947,7 @@ var Sn = class e {
|
|
|
947
947
|
}
|
|
948
948
|
for (let a = 0; a < e; a++) {
|
|
949
949
|
const e = t[a];
|
|
950
|
-
Fn[a] = !0 === e?.lazyArg ? i ? i[a] :
|
|
950
|
+
Fn[a] = !0 === e?.lazyArg ? i ? i[a] : me.deferred(l, a, this, e, n, r, o, s) : n[e.evalIndex];
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
_createLambdaValue(t, e, n, r, o) {
|
|
@@ -963,43 +963,43 @@ var Sn = class e {
|
|
|
963
963
|
return new yn(l, s[s.length - 1], this, this._compiled, e.slice(), n, r, o);
|
|
964
964
|
}
|
|
965
965
|
_applyCallee(t, e, n) {
|
|
966
|
-
if (t?.isIRange && !t.isIReferenceRange && 1 === t.size && (t = t.getValueAt(0, 0)) &&
|
|
966
|
+
if (t?.isIRange && !t.isIReferenceRange && 1 === t.size && (t = t.getValueAt(0, 0)) && I.isError(t)) return t;
|
|
967
967
|
const r = e.inputs, o = r.length - 1;
|
|
968
968
|
if (t instanceof yn) {
|
|
969
969
|
const e = t.params;
|
|
970
970
|
let s = e.length;
|
|
971
971
|
for (; s > 0 && e[s - 1].optional;) s--;
|
|
972
|
-
if (o > e.length || o < s) return
|
|
972
|
+
if (o > e.length || o < s) return I.BuiltIn.Value;
|
|
973
973
|
const l = new Map(t.frame ?? void 0);
|
|
974
974
|
for (let t = 0; t < e.length; t++) {
|
|
975
|
-
const s = e[t], i = t >= o || r[t + 1]?.type ===
|
|
975
|
+
const s = e[t], i = t >= o || r[t + 1]?.type === k.Empty;
|
|
976
976
|
l.set(s.slot, i ? xn : n[r[t + 1].evalIndex]);
|
|
977
977
|
}
|
|
978
978
|
return t.owner._evaluateBody(t, l);
|
|
979
979
|
}
|
|
980
980
|
if (t instanceof vn) {
|
|
981
981
|
const e = [];
|
|
982
|
-
for (let t = 1; t < r.length; t++) e.push(r[t]?.type ===
|
|
982
|
+
for (let t = 1; t < r.length; t++) e.push(r[t]?.type === k.Empty ? void 0 : n[r[t].evalIndex]);
|
|
983
983
|
return this._dispatchFunction(t.fn, e, e.length);
|
|
984
984
|
}
|
|
985
|
-
return t && (t.isIRange || void 0 !== t.colStart) ?
|
|
985
|
+
return t && (t.isIRange || void 0 !== t.colStart) ? I.BuiltIn.Ref : I.BuiltIn.Value;
|
|
986
986
|
}
|
|
987
987
|
_applyValues(t, e) {
|
|
988
988
|
const n = t.params;
|
|
989
989
|
let r = n.length;
|
|
990
990
|
for (; r > 0 && n[r - 1].optional;) r--;
|
|
991
|
-
if (e.length > n.length || e.length < r) return
|
|
991
|
+
if (e.length > n.length || e.length < r) return I.BuiltIn.Value;
|
|
992
992
|
const o = new Map(t.frame ?? void 0);
|
|
993
993
|
for (let t = 0; t < n.length; t++) {
|
|
994
994
|
const r = t < e.length ? e[t] : void 0;
|
|
995
995
|
o.set(n[t].slot, void 0 === r ? xn : r);
|
|
996
996
|
}
|
|
997
997
|
const s = this._evaluateBody(t, o);
|
|
998
|
-
return
|
|
998
|
+
return zt(s, this._context);
|
|
999
999
|
}
|
|
1000
1000
|
_evaluateBody(t, e) {
|
|
1001
1001
|
const n = this._calcScope;
|
|
1002
|
-
if (n.depth >= 512) return
|
|
1002
|
+
if (n.depth >= 512) return I.BuiltIn.Num;
|
|
1003
1003
|
n.depth++;
|
|
1004
1004
|
const r = 0 === t.active ? t.regs : t.regs.slice();
|
|
1005
1005
|
t.active++;
|
|
@@ -1018,9 +1018,9 @@ var Sn = class e {
|
|
|
1018
1018
|
const s = t.deferred ?? this._listWithin(t);
|
|
1019
1019
|
return this._runList(s, e, r, o, n), e[t.evalIndex];
|
|
1020
1020
|
} catch (t) {
|
|
1021
|
-
if (
|
|
1022
|
-
if (
|
|
1023
|
-
return t instanceof RangeError ?
|
|
1021
|
+
if (I.isError(t)) return t;
|
|
1022
|
+
if (W(t)) throw t;
|
|
1023
|
+
return t instanceof RangeError ? I.BuiltIn.Num : new I.Value(t?.message, { cause: t });
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
_runList(t, e, n, r, o) {
|
|
@@ -1032,7 +1032,7 @@ var Sn = class e {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
_listWithin(t) {
|
|
1034
1034
|
let e;
|
|
1035
|
-
|
|
1035
|
+
we(this._compiled.ast, (n, r, o) => {
|
|
1036
1036
|
if (n === t) {
|
|
1037
1037
|
for (let t = o.length - 1; t >= 0; t--) if (void 0 !== o[t].deferred) {
|
|
1038
1038
|
e = o[t];
|
|
@@ -1041,7 +1041,7 @@ var Sn = class e {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
});
|
|
1043
1043
|
const n = /* @__PURE__ */ new Set();
|
|
1044
|
-
|
|
1044
|
+
we(t, (t) => {
|
|
1045
1045
|
n.add(t);
|
|
1046
1046
|
});
|
|
1047
1047
|
const r = e?.deferred?.filter((t) => n.has(t)) ?? [];
|
|
@@ -1059,7 +1059,7 @@ var Sn = class e {
|
|
|
1059
1059
|
t.cacheFnStamp !== e && (o = null);
|
|
1060
1060
|
}
|
|
1061
1061
|
if (!o) {
|
|
1062
|
-
if (o = r.getFunction(t.value), !o) return
|
|
1062
|
+
if (o = r.getFunction(t.value), !o) return I.BuiltIn.Name;
|
|
1063
1063
|
t.cacheFn = o, t.cacheFnStamp = o.isBuiltIn() ? void 0 : r._getFunctionStamp();
|
|
1064
1064
|
}
|
|
1065
1065
|
const s = this._calcScope, l = s.implicitIntersect, i = s.firstCell;
|
|
@@ -1081,7 +1081,7 @@ var Sn = class e {
|
|
|
1081
1081
|
try {
|
|
1082
1082
|
r = t.execute();
|
|
1083
1083
|
} catch (t) {
|
|
1084
|
-
if (
|
|
1084
|
+
if (W(t)) throw t;
|
|
1085
1085
|
r = Gn(t);
|
|
1086
1086
|
}
|
|
1087
1087
|
s.argsValues = null, s.argsLength = 0;
|
|
@@ -1111,7 +1111,7 @@ var Sn = class e {
|
|
|
1111
1111
|
r = t.execute(...o);
|
|
1112
1112
|
}
|
|
1113
1113
|
} catch (t) {
|
|
1114
|
-
if (
|
|
1114
|
+
if (W(t)) throw t;
|
|
1115
1115
|
r = Gn(t);
|
|
1116
1116
|
}
|
|
1117
1117
|
const l = this._calcScope;
|
|
@@ -1119,26 +1119,26 @@ var Sn = class e {
|
|
|
1119
1119
|
const t = l.deferServed;
|
|
1120
1120
|
return l.deferServed = null, null !== t && void 0 !== t.latest && l.deferCount === o + 1 ? t.latest : void 0 === r ? null : r;
|
|
1121
1121
|
}
|
|
1122
|
-
return void 0 === r ? new
|
|
1122
|
+
return void 0 === r ? new I.Parse() : r;
|
|
1123
1123
|
}
|
|
1124
1124
|
finalizeValue(t) {
|
|
1125
1125
|
const e = this._context;
|
|
1126
|
-
if (
|
|
1127
|
-
if (p(t)) return
|
|
1126
|
+
if (yt(t)) return I.BuiltIn.Calc;
|
|
1127
|
+
if (p(t)) return I.BuiltIn.Calc;
|
|
1128
1128
|
if (t && void 0 !== t.colStart) try {
|
|
1129
1129
|
if (t.scope) {
|
|
1130
1130
|
const n = e.getReference(t);
|
|
1131
|
-
if (
|
|
1131
|
+
if (I.isError(n)) return n;
|
|
1132
1132
|
}
|
|
1133
1133
|
t = e.getValueAt(t.rowStart, t.colStart, t.scope);
|
|
1134
1134
|
} catch (t) {
|
|
1135
|
-
if (
|
|
1136
|
-
return
|
|
1135
|
+
if (W(t)) throw t;
|
|
1136
|
+
return I.isError(t) ? t : new I.Value(t?.message, { cause: t });
|
|
1137
1137
|
}
|
|
1138
|
-
if (Array.isArray(t) && t.isSheetSpan) return
|
|
1138
|
+
if (Array.isArray(t) && t.isSheetSpan) return I.BuiltIn.Ref;
|
|
1139
1139
|
if (Array.isArray(t)) {
|
|
1140
|
-
if (
|
|
1141
|
-
const e =
|
|
1140
|
+
if (X(t)) {
|
|
1141
|
+
const e = it(t.length);
|
|
1142
1142
|
for (let n = 0; n < t.length; n++) e[n] = this.finalizeValue(t[n]);
|
|
1143
1143
|
return e;
|
|
1144
1144
|
}
|
|
@@ -1146,15 +1146,15 @@ var Sn = class e {
|
|
|
1146
1146
|
else try {
|
|
1147
1147
|
t = e.getRange(t);
|
|
1148
1148
|
} catch (e) {
|
|
1149
|
-
t =
|
|
1149
|
+
t = I.BuiltIn.Value;
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
var n;
|
|
1153
|
-
return t?.isIRange ? t.size <= 1 ? (t = 0 === t.size ? null : t.getValueAt(0, 0, Mn), null === (t =
|
|
1153
|
+
return t?.isIRange ? t.size <= 1 ? (t = 0 === t.size ? null : t.getValueAt(0, 0, Mn), null === (t = zt(t, e)) && (t = 0)) : (n = t, Cn.has(n) || (t = t.fillEmpty(0))) : null === (t = zt(t, e)) && (t = 0), t;
|
|
1154
1154
|
}
|
|
1155
1155
|
finalizeValueForCell(t) {
|
|
1156
1156
|
const e = this.finalizeValue(t);
|
|
1157
|
-
return Array.isArray(e) ?
|
|
1157
|
+
return Array.isArray(e) ? I.BuiltIn.Value : e;
|
|
1158
1158
|
}
|
|
1159
1159
|
toString() {
|
|
1160
1160
|
const t = this._compiled;
|
|
@@ -1165,7 +1165,7 @@ var Sn = class e {
|
|
|
1165
1165
|
get [Symbol.toStringTag]() {
|
|
1166
1166
|
return "[FormulaBlock]";
|
|
1167
1167
|
}
|
|
1168
|
-
},
|
|
1168
|
+
}, Rn = (t, e) => null !== e && "object" == typeof e && void 0 !== e.colStart && e.rowStart === e.rowEnd && e.colStart === e.colEnd ? t.getValueAt(e.rowStart, e.colStart, e.scope) : e, An = (t) => null !== t && "object" == typeof t && !0 === t.isIRange ? t.getValueAt(0, 0) ?? null : t;
|
|
1169
1169
|
function kn(t, e, n, r) {
|
|
1170
1170
|
let o = t.colStart, s = t.rowStart, l = t.colEnd, i = t.rowEnd;
|
|
1171
1171
|
const a = t.$colStart ?? !1, c = t.$rowStart ?? !1, d = t.$colEnd ?? !1, h = t.$rowEnd ?? !1;
|
|
@@ -1187,7 +1187,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1187
1187
|
for (let i = 0; i < t; i++) o = Nn(a[i], e, n, r, o, s, l);
|
|
1188
1188
|
return o;
|
|
1189
1189
|
}
|
|
1190
|
-
const c = void 0 === i ?
|
|
1190
|
+
const c = void 0 === i ? I.BuiltIn.Value : n[t] ?? I.BuiltIn.Value;
|
|
1191
1191
|
if (Array.isArray(c)) {
|
|
1192
1192
|
const t = c.length;
|
|
1193
1193
|
for (let e = 0; e < t; e++) {
|
|
@@ -1203,15 +1203,15 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1203
1203
|
} else r[o] = c;
|
|
1204
1204
|
return s && (s[o] = d), l && (l[o] = h), o + 1;
|
|
1205
1205
|
}, Mn = Object.freeze({ type: null }), Fn = new Array(255), Dn = (t, e) => {
|
|
1206
|
-
for (let n = 0; n < e; n++) t[n]?.type ===
|
|
1206
|
+
for (let n = 0; n < e; n++) t[n]?.type === k.Empty && (Fn[n] = xn);
|
|
1207
1207
|
}, Tn = (t) => {
|
|
1208
1208
|
const e = { ...t };
|
|
1209
1209
|
return delete e.inLazy, delete e.lazyArg, delete e.hasLazyArgs, delete e.deferred, t.inputs && (e.inputs = t.inputs.map((t) => t ? Tn(t) : t)), e;
|
|
1210
|
-
}, Gn = (t) =>
|
|
1210
|
+
}, Gn = (t) => I.isError(t) ? t : t instanceof RangeError ? I.BuiltIn.Num : new I.Value(t?.message, { cause: t }), Bn = ue(4096), Vn = 0, On = () => Bn, Pn = (t, e) => {
|
|
1211
1211
|
if (0 === e) return void (t.inputsAt = -1);
|
|
1212
1212
|
const n = Vn, r = n + e;
|
|
1213
1213
|
if (r > Bn.length) {
|
|
1214
|
-
const t =
|
|
1214
|
+
const t = ue(Math.max(r, 2 * Bn.length));
|
|
1215
1215
|
for (let e = 0; e < n; e++) t[e] = Bn[e];
|
|
1216
1216
|
Bn = t;
|
|
1217
1217
|
}
|
|
@@ -1226,7 +1226,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1226
1226
|
if (n < 0) return;
|
|
1227
1227
|
const r = Bn;
|
|
1228
1228
|
for (let t = 0; t < e; t++) r[n + t] = void 0;
|
|
1229
|
-
}, $n = 32, Hn = 64, jn = 128, Kn = 768, qn = 3072, Un = 12288,
|
|
1229
|
+
}, $n = 32, Hn = 64, jn = 128, Kn = 768, qn = 3072, Un = 12288, Xn = 16384, Wn = 32768, Jn = 65536, Qn = 1 << 17, Yn = 1 << 18, Zn = 1 << 19, tr = 1 << 20, er = 1 << 21, nr = 1 << 22, rr = 495520, or = 256, sr = 512, lr = 1024, ir = 2048, ar = (t, e, n) => {
|
|
1230
1230
|
if (void 0 === e) return () => !1;
|
|
1231
1231
|
const r = dr(e);
|
|
1232
1232
|
return (o) => r(o) && n(t.compare(o, e));
|
|
@@ -1241,7 +1241,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1241
1241
|
case "string": return (t) => "string" == typeof t;
|
|
1242
1242
|
case "number": return (t) => "number" == typeof t;
|
|
1243
1243
|
case "boolean": return (t) => "boolean" == typeof t;
|
|
1244
|
-
default: return (t) =>
|
|
1244
|
+
default: return (t) => I.isError(t);
|
|
1245
1245
|
}
|
|
1246
1246
|
}, hr = (t, e, n = !1) => {
|
|
1247
1247
|
const r = typeof e;
|
|
@@ -1265,9 +1265,9 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1265
1265
|
if (void 0 === r) {
|
|
1266
1266
|
const o = t.parseAsLiteral(n);
|
|
1267
1267
|
if (void 0 !== o) r = o;
|
|
1268
|
-
else if (r = n, ("=" === e || "<>" === e) &&
|
|
1268
|
+
else if (r = n, ("=" === e || "<>" === e) && S.isWildCard(r)) return {
|
|
1269
1269
|
op: "wc",
|
|
1270
|
-
value:
|
|
1270
|
+
value: S.toRegex(r, "i", !0),
|
|
1271
1271
|
match: "=" === e
|
|
1272
1272
|
};
|
|
1273
1273
|
}
|
|
@@ -1283,16 +1283,16 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1283
1283
|
value: e
|
|
1284
1284
|
};
|
|
1285
1285
|
} catch (t) {}
|
|
1286
|
-
return
|
|
1286
|
+
return S.isWildCard(r) ? {
|
|
1287
1287
|
op: "wc",
|
|
1288
|
-
value:
|
|
1288
|
+
value: S.toRegex(r, "i", !n || "start"),
|
|
1289
1289
|
match: !0
|
|
1290
1290
|
} : {
|
|
1291
1291
|
op: n ? "prefix" : "=",
|
|
1292
1292
|
value: e
|
|
1293
1293
|
};
|
|
1294
1294
|
}
|
|
1295
|
-
return "boolean" === r || "number" === r ||
|
|
1295
|
+
return "boolean" === r || "number" === r || I.isError(e) ? {
|
|
1296
1296
|
op: "=",
|
|
1297
1297
|
value: e
|
|
1298
1298
|
} : null == e ? {
|
|
@@ -1300,7 +1300,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1300
1300
|
value: 0
|
|
1301
1301
|
} : {
|
|
1302
1302
|
op: "err",
|
|
1303
|
-
value: new
|
|
1303
|
+
value: new I.Value(`Criteria.parse: type ${typeof e} not support`)
|
|
1304
1304
|
};
|
|
1305
1305
|
}, ur = class {
|
|
1306
1306
|
constructor(t, e, n, r, o) {
|
|
@@ -1375,10 +1375,10 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1375
1375
|
return new ur(t, r, o, s, l);
|
|
1376
1376
|
}, pr = class t {
|
|
1377
1377
|
static create(e, n, r, o) {
|
|
1378
|
-
const s =
|
|
1378
|
+
const s = _e.peek();
|
|
1379
1379
|
if (!s) throw new Error("The sdk WebAssembly is not loaded.");
|
|
1380
1380
|
const l = (e ?? n)?.getRowCount() ?? 0;
|
|
1381
|
-
if ((e?.getColumnCount() ?? 0) > 32 || (n?.getColumnCount() ?? 0) > 32) throw
|
|
1381
|
+
if ((e?.getColumnCount() ?? 0) > 32 || (n?.getColumnCount() ?? 0) > 32) throw I.BuiltIn.Value;
|
|
1382
1382
|
const i = new s.PivotRequest(l), a = t._addFields(i, e, !0), c = t._addFields(i, n, !1), d = o?.filter ? i.add_filter() : -1, h = s.wasm_memory().buffer;
|
|
1383
1383
|
if (t._fillFields(h, e, a, l), t._fillFields(h, n, c, l), -1 !== d) {
|
|
1384
1384
|
const t = new Uint32Array(h, d, 2 * Math.ceil(l / 64));
|
|
@@ -1391,7 +1391,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1391
1391
|
try {
|
|
1392
1392
|
u = i.compute(0, !1);
|
|
1393
1393
|
} catch {
|
|
1394
|
-
throw i.free(),
|
|
1394
|
+
throw i.free(), I.BuiltIn.Value;
|
|
1395
1395
|
}
|
|
1396
1396
|
return new t(s, i, u, l, e, n, r);
|
|
1397
1397
|
}
|
|
@@ -1406,11 +1406,11 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1406
1406
|
colStart: o,
|
|
1407
1407
|
colEnd: o
|
|
1408
1408
|
});
|
|
1409
|
-
new
|
|
1409
|
+
new Le().fill(s, new Uint32Array(t, n[o], r));
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
1412
|
constructor(t, e, n, r, o, s, l) {
|
|
1413
|
-
this._cellsByColumn = /* @__PURE__ */ new Map(), this._errors = new
|
|
1413
|
+
this._cellsByColumn = /* @__PURE__ */ new Map(), this._errors = new ze(), this._values = /* @__PURE__ */ new Map(), this._leafCount = 0, this._withRecords = null, this._wasm = t, this._request = e, this._result = n, this._n = r, this._createColumn = l;
|
|
1414
1414
|
const i = n.row_nodes();
|
|
1415
1415
|
this._rows = gr(o, i), this._columns = gr(s, n.column_nodes()), this._recordCount = i.length > 0 ? i[4] : 0;
|
|
1416
1416
|
}
|
|
@@ -1437,7 +1437,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
getAggregate(t, e, n, r) {
|
|
1439
1439
|
if (!e.isBuiltIn()) return;
|
|
1440
|
-
const o =
|
|
1440
|
+
const o = $e[e.getName().toUpperCase()];
|
|
1441
1441
|
if (void 0 === o) return;
|
|
1442
1442
|
let s = this._values.get(t);
|
|
1443
1443
|
if (void 0 === s && (s = this._addValues(t), this._values.set(t, s)), null === s || o >= 7 && !s.numeric) return;
|
|
@@ -1458,7 +1458,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1458
1458
|
doubles: new Float64Array(o, n, e),
|
|
1459
1459
|
ints: new Int32Array(o, n, 2 * e),
|
|
1460
1460
|
types: new Uint8Array(o, n + 8 * e, e)
|
|
1461
|
-
}, { ok: l, numeric: i } =
|
|
1461
|
+
}, { ok: l, numeric: i } = Oe(t, s, this._errors);
|
|
1462
1462
|
return l ? {
|
|
1463
1463
|
leaf: r,
|
|
1464
1464
|
numeric: i,
|
|
@@ -1468,7 +1468,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1468
1468
|
_run(t, e) {
|
|
1469
1469
|
const n = this._request;
|
|
1470
1470
|
n.clear_measures(), n.add_measure(t, e);
|
|
1471
|
-
const r = n.compute(0, !1), o = r.values(0), s =
|
|
1471
|
+
const r = n.compute(0, !1), o = r.values(0), s = Pe(this._buffer(), o, this._errors), l = r.cell_count(), i = new Array(l);
|
|
1472
1472
|
for (let t = 0; t < l; t++) i[t] = s(t);
|
|
1473
1473
|
return o.free(), r.free(), i;
|
|
1474
1474
|
}
|
|
@@ -1492,7 +1492,7 @@ var Nn = (t, e, n, r, o, s, l) => {
|
|
|
1492
1492
|
rowStart: 0,
|
|
1493
1493
|
colEnd: 0,
|
|
1494
1494
|
rowEnd: 0
|
|
1495
|
-
}, vr = [], xr = [], Cr = [], br = [],
|
|
1495
|
+
}, vr = [], xr = [], Cr = [], br = [], Rr = [], Ar = [], kr = (t, e) => !0 === e || t === Number.MIN_SAFE_INTEGER, Nr = (t, e) => !0 === e || t === Number.MAX_SAFE_INTEGER, Mr = (t, e, n, r, o, s, l) => {
|
|
1496
1496
|
if (n === o) {
|
|
1497
1497
|
if (e > r) {
|
|
1498
1498
|
const t = e;
|
|
@@ -1521,7 +1521,7 @@ function Vr(t, e, n) {
|
|
|
1521
1521
|
const o = mr, s = Sr, l = t.relative, i = t.second, a = l.length;
|
|
1522
1522
|
for (let t = 0; t < a; t++) {
|
|
1523
1523
|
const r = l[t];
|
|
1524
|
-
if (
|
|
1524
|
+
if (I.isError(r)) continue;
|
|
1525
1525
|
const a = i[t], c = a ?? r, d = r.scope ?? null, h = null !== a ? a.scope ?? null : null;
|
|
1526
1526
|
if (null !== d && null !== h && d !== h) return Br(e);
|
|
1527
1527
|
const u = d ?? h;
|
|
@@ -1537,18 +1537,18 @@ function Vr(t, e, n) {
|
|
|
1537
1537
|
const n = g[t];
|
|
1538
1538
|
Tr(Math.max(n.colStart, f.colStart), Math.max(n.rowStart, f.rowStart), Math.min(n.colEnd, f.colEnd), Math.min(n.rowEnd, f.rowEnd), e);
|
|
1539
1539
|
}
|
|
1540
|
-
const
|
|
1541
|
-
if (!
|
|
1542
|
-
if (!Fr(o,
|
|
1543
|
-
const
|
|
1544
|
-
if (!Fr(s,
|
|
1540
|
+
const m = _.values, S = m.getCoords();
|
|
1541
|
+
if (!S) continue;
|
|
1542
|
+
if (!Fr(o, S.rowStart, S.rowEnd, e.rowStart, e.rowEnd)) continue;
|
|
1543
|
+
const w = wr, y = Er;
|
|
1544
|
+
if (!Fr(s, S.colStart, S.colEnd, e.colStart, e.colEnd)) continue;
|
|
1545
1545
|
const v = wr, x = Er, C = yr;
|
|
1546
|
-
if (Dr(o,
|
|
1547
|
-
const b = (
|
|
1548
|
-
let
|
|
1549
|
-
for (; !
|
|
1550
|
-
const [t, n, r] =
|
|
1551
|
-
|
|
1546
|
+
if (Dr(o, w, y), C.rowStart = Math.max(wr, S.rowStart), C.rowEnd = Math.min(Er, S.rowEnd), Dr(s, v, x), C.colStart = Math.max(wr, S.colStart), C.colEnd = Math.min(Er, S.colEnd), C.colStart > C.colEnd || C.rowStart > C.rowEnd) continue;
|
|
1547
|
+
const b = (m.getAxis?.() ?? E.Axis.Row) === E.Axis.Column, R = m.getRuns({ bounds: C });
|
|
1548
|
+
let A = R.next();
|
|
1549
|
+
for (; !A.done;) {
|
|
1550
|
+
const [t, n, r] = A.value;
|
|
1551
|
+
A = R.next();
|
|
1552
1552
|
const o = n + r.length - 1;
|
|
1553
1553
|
b ? Tr(t, n, t, o, e) : Tr(n, t, o, t, e);
|
|
1554
1554
|
}
|
|
@@ -1572,7 +1572,7 @@ function Vr(t, e, n) {
|
|
|
1572
1572
|
o.length = s;
|
|
1573
1573
|
const l = [], i = [], a = br;
|
|
1574
1574
|
a.length = 0;
|
|
1575
|
-
let c = 0, d =
|
|
1575
|
+
let c = 0, d = Rr, h = Ar, u = !1, _ = 0, f = 0;
|
|
1576
1576
|
const g = s - 1;
|
|
1577
1577
|
for (let s = 0; s < g; s++) {
|
|
1578
1578
|
const g = o[s], p = o[s + 1] - 1;
|
|
@@ -1614,7 +1614,7 @@ function Vr(t, e, n) {
|
|
|
1614
1614
|
const w = h;
|
|
1615
1615
|
h = d, d = w, u = !0;
|
|
1616
1616
|
}
|
|
1617
|
-
return
|
|
1617
|
+
return Rr = d, Ar = h, {
|
|
1618
1618
|
touched: l,
|
|
1619
1619
|
blank: i
|
|
1620
1620
|
};
|
|
@@ -1674,7 +1674,7 @@ function jr(t, e, n = 0, r = 0) {
|
|
|
1674
1674
|
const i = t.rowIndex + r, a = t.colIndex + n;
|
|
1675
1675
|
if (i < o.rowStart || i > o.rowEnd || a < o.colStart || a > o.colEnd) return;
|
|
1676
1676
|
const c = e.nodeAt(i, a);
|
|
1677
|
-
|
|
1677
|
+
sn(c).fixedRef = 0 === n && 0 === r ? l : {
|
|
1678
1678
|
colStart: l.colStart + n,
|
|
1679
1679
|
rowStart: l.rowStart + r,
|
|
1680
1680
|
colEnd: l.colEnd + n,
|
|
@@ -1696,7 +1696,7 @@ var Kr = {
|
|
|
1696
1696
|
}, Ur = {
|
|
1697
1697
|
bounds: qr,
|
|
1698
1698
|
reuseResult: !0
|
|
1699
|
-
},
|
|
1699
|
+
}, Xr = (t, e) => t.colIndex === e.colIndex ? t.rowIndex - e.rowIndex : t.colIndex - e.colIndex, Wr = (t, e, n) => null === t || 0 === e && 0 === n ? t : {
|
|
1700
1700
|
colStart: t.colStart + n,
|
|
1701
1701
|
rowStart: t.rowStart + e,
|
|
1702
1702
|
colEnd: t.colEnd + n,
|
|
@@ -1784,7 +1784,7 @@ var Kr = {
|
|
|
1784
1784
|
return void 0 === o && (o = this._newNode(t, e, this.gridId, null), r.setValueAt(t, e, o)), o;
|
|
1785
1785
|
}
|
|
1786
1786
|
_newSparseStore() {
|
|
1787
|
-
const t = new
|
|
1787
|
+
const t = new F({ axis: E.Axis.Column }), e = this._anchor;
|
|
1788
1788
|
return null !== e && t.setValueAt(e.rowIndex, e.colIndex, e), this._nodes = t, t;
|
|
1789
1789
|
}
|
|
1790
1790
|
_mintDense() {
|
|
@@ -1846,7 +1846,7 @@ var Kr = {
|
|
|
1846
1846
|
if (l > i || a > c) return;
|
|
1847
1847
|
const d = this.gridId;
|
|
1848
1848
|
let h = null;
|
|
1849
|
-
for (let t = a; t <= c; t++) for (let e = l; e <= i; e++) void 0 === o.getValueAt(e, t) && (null === h && (h = new
|
|
1849
|
+
for (let t = a; t <= c; t++) for (let e = l; e <= i; e++) void 0 === o.getValueAt(e, t) && (null === h && (h = new j.Builder()), h.pushAt(t, e, this._newNode(e, t, d, null)));
|
|
1850
1850
|
if (null !== h) {
|
|
1851
1851
|
const t = h.build();
|
|
1852
1852
|
t && o.setValues(t.tuples);
|
|
@@ -1879,7 +1879,7 @@ var Kr = {
|
|
|
1879
1879
|
const s = n.relative, l = n.second, i = s.length;
|
|
1880
1880
|
for (let n = 0; n < i; n++) {
|
|
1881
1881
|
const i = s[n];
|
|
1882
|
-
if (
|
|
1882
|
+
if (I.isError(i)) {
|
|
1883
1883
|
o[n] = i;
|
|
1884
1884
|
continue;
|
|
1885
1885
|
}
|
|
@@ -1889,8 +1889,8 @@ var Kr = {
|
|
|
1889
1889
|
continue;
|
|
1890
1890
|
}
|
|
1891
1891
|
kn(i, t, e, Kr), kn(c, t, e, Jr);
|
|
1892
|
-
const d =
|
|
1893
|
-
o[n] = d ??
|
|
1892
|
+
const d = It(Kr, Jr, a);
|
|
1893
|
+
o[n] = d ?? I.BuiltIn.Null;
|
|
1894
1894
|
}
|
|
1895
1895
|
return this._scratchRow = t, this._scratchCol = e, o;
|
|
1896
1896
|
}
|
|
@@ -1980,8 +1980,8 @@ var Kr = {
|
|
|
1980
1980
|
densify() {
|
|
1981
1981
|
if (!this._sparse) return;
|
|
1982
1982
|
if (this._sparse = !1, null === this._nodes) return;
|
|
1983
|
-
const t = this.ref, e = t.rowStart, n = t.colStart, r = t.rowEnd - e + 1, o = t.colEnd - n + 1, s =
|
|
1984
|
-
for (let t = 0; t < r; t++) s[t] =
|
|
1983
|
+
const t = this.ref, e = t.rowStart, n = t.colStart, r = t.rowEnd - e + 1, o = t.colEnd - n + 1, s = it(r);
|
|
1984
|
+
for (let t = 0; t < r; t++) s[t] = it(o);
|
|
1985
1985
|
this.forEachNode((t) => {
|
|
1986
1986
|
s[t.rowIndex - e][t.colIndex - n] = t;
|
|
1987
1987
|
});
|
|
@@ -1997,9 +1997,9 @@ var Kr = {
|
|
|
1997
1997
|
if (!t) return [[this._newNode(s, o, e, r.EmptyArray)]];
|
|
1998
1998
|
const l = this._template, i = null !== l, a = i ? null : t.resolvedPrecedentsAt(s, o), c = i ? l.relative.length : a?.length ?? 0;
|
|
1999
1999
|
this.paramLength = c;
|
|
2000
|
-
const d =
|
|
2000
|
+
const d = it(n.rowEnd - s + 1), h = n.colEnd - o + 1, u = d.length;
|
|
2001
2001
|
for (let n = 0; n < u; n++) {
|
|
2002
|
-
const l =
|
|
2002
|
+
const l = it(h), u = l.length;
|
|
2003
2003
|
for (let d = 0; d < u; d++) {
|
|
2004
2004
|
const h = n + s, u = d + o, _ = i ? null : 0 === c ? r.EmptyArray : 0 === n && 0 === d ? a : t.resolvedPrecedentsAt(h, u);
|
|
2005
2005
|
l[d] = this._newNode(h, u, e, _);
|
|
@@ -2050,7 +2050,7 @@ var Kr = {
|
|
|
2050
2050
|
}
|
|
2051
2051
|
_adoptNode(t, e, n, o) {
|
|
2052
2052
|
const s = t.ext;
|
|
2053
|
-
return null !== s && (s.spillDependents = r.EmptyArray, s.spillRowEnd = -1, s.spillColEnd = -1, s.fixedRef =
|
|
2053
|
+
return null !== s && (s.spillDependents = r.EmptyArray, s.spillRowEnd = -1, s.spillColEnd = -1, s.fixedRef = Wr(s.fixedRef, e - t.rowIndex, n - t.colIndex)), t.block = this, t.gridId = this.gridId, t.rowIndex = e, t.colIndex = n, t.inputsAt = -1, t.precedents = o, t.orderIndex = -1, t.planId = 0, t.planEpoch = 0, t.dependentsEpoch = 0, t.dependents = r.EmptyArray, t;
|
|
2054
2054
|
}
|
|
2055
2055
|
_copyNode(t, e, n) {
|
|
2056
2056
|
const o = { ...t };
|
|
@@ -2062,7 +2062,7 @@ var Kr = {
|
|
|
2062
2062
|
spillColStart: -1,
|
|
2063
2063
|
spillRowEnd: -1,
|
|
2064
2064
|
spillColEnd: -1,
|
|
2065
|
-
fixedRef:
|
|
2065
|
+
fixedRef: Wr(s.fixedRef, e - t.rowIndex, n - t.colIndex),
|
|
2066
2066
|
demandValue: s.demandValue,
|
|
2067
2067
|
cycleGroup: s.cycleGroup,
|
|
2068
2068
|
cycleNext: s.cycleNext,
|
|
@@ -2087,7 +2087,7 @@ var Kr = {
|
|
|
2087
2087
|
const t = e.originRow, o = e.originCol;
|
|
2088
2088
|
if (0 === o && n.colEnd - n.colStart + 1 === a) c = 0 === t && r.length === i ? r : r.slice(t, t + i);
|
|
2089
2089
|
else {
|
|
2090
|
-
c =
|
|
2090
|
+
c = it(i);
|
|
2091
2091
|
for (let e = 0; e < i; e++) c[e] = r[e + t].slice(o, o + a);
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
@@ -2102,9 +2102,9 @@ var Kr = {
|
|
|
2102
2102
|
}
|
|
2103
2103
|
return c;
|
|
2104
2104
|
}
|
|
2105
|
-
const d = this.gridId, h =
|
|
2105
|
+
const d = this.gridId, h = it(i);
|
|
2106
2106
|
for (let e = 0; e < i; e++) {
|
|
2107
|
-
const n =
|
|
2107
|
+
const n = it(a);
|
|
2108
2108
|
h[e] = n;
|
|
2109
2109
|
const s = e + r;
|
|
2110
2110
|
for (let r = 0; r < a; r++) {
|
|
@@ -2121,7 +2121,7 @@ var Kr = {
|
|
|
2121
2121
|
if (null !== a && 0 === l.originRow && 0 === l.originCol && i.rowStart === n && i.colStart === r && i.rowEnd === e.rowEnd && i.colEnd === e.colEnd) return t._nodes = null, this._nodes = a, void this.forEachNode((t) => {
|
|
2122
2122
|
this._adoptNode(t, t.rowIndex, t.colIndex, null);
|
|
2123
2123
|
});
|
|
2124
|
-
const c = i.rowStart + l.originRow, d = i.colStart + l.originCol, h = n - c, u = r - d, _ = new
|
|
2124
|
+
const c = i.rowStart + l.originRow, d = i.colStart + l.originCol, h = n - c, u = r - d, _ = new j.Builder();
|
|
2125
2125
|
t.forEachNodeIn(c, c + o - 1, d, d + s - 1, (t) => {
|
|
2126
2126
|
const e = t.rowIndex + h, n = t.colIndex + u;
|
|
2127
2127
|
this._adoptNode(t, e, n, null), _.pushAt(n, e, t);
|
|
@@ -2139,8 +2139,8 @@ var Kr = {
|
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
2141
|
if (0 === i.length) return;
|
|
2142
|
-
i.sort(
|
|
2143
|
-
const a = new
|
|
2142
|
+
i.sort(Xr);
|
|
2143
|
+
const a = new j.Builder();
|
|
2144
2144
|
for (let t = 0; t < i.length; t++) {
|
|
2145
2145
|
const e = i[t];
|
|
2146
2146
|
t > 0 && i[t - 1].rowIndex === e.rowIndex && i[t - 1].colIndex === e.colIndex || a.pushAt(e.colIndex, e.rowIndex, e);
|
|
@@ -2150,31 +2150,31 @@ var Kr = {
|
|
|
2150
2150
|
}
|
|
2151
2151
|
toJSON(t = !1, e = this.ref) {
|
|
2152
2152
|
const n = e;
|
|
2153
|
-
return [
|
|
2153
|
+
return [ie(n), this.formula.getTextAt(n.rowStart, n.colStart, t)];
|
|
2154
2154
|
}
|
|
2155
2155
|
getCoords() {
|
|
2156
2156
|
return this.ref;
|
|
2157
2157
|
}
|
|
2158
2158
|
getShifted(e) {
|
|
2159
2159
|
if (!e.after) return null;
|
|
2160
|
-
const n = o.sanitizeRange(e.after), r = e.axis !==
|
|
2160
|
+
const n = o.sanitizeRange(e.after), r = e.axis !== E.Axis.Row, s = e.amount, l = e.intersect, i = l.colStart, a = l.rowStart, c = l.colEnd, d = l.rowEnd, h = r ? s : 0, u = r ? 0 : s, _ = this.ref, f = n, g = this._container.getGrid(this.gridId)?.getEntireCoords();
|
|
2161
2161
|
let p = this.formula;
|
|
2162
|
-
const
|
|
2163
|
-
for (let t = 0; t <
|
|
2164
|
-
const e =
|
|
2162
|
+
const m = p.getReferences(_.rowStart, _.colStart);
|
|
2163
|
+
for (let t = 0; t < m.length; t++) {
|
|
2164
|
+
const e = m[t];
|
|
2165
2165
|
if (null === e) continue;
|
|
2166
2166
|
if ("nameId" in e) continue;
|
|
2167
2167
|
if ("tableId" in e) continue;
|
|
2168
|
-
if (
|
|
2169
|
-
const n = e, o = null != n.scope && n.scope !== this.gridId, l = n.colStart === Number.MIN_SAFE_INTEGER,
|
|
2170
|
-
let
|
|
2171
|
-
if (!o &&
|
|
2168
|
+
if (I.isError(e)) continue;
|
|
2169
|
+
const n = e, o = null != n.scope && n.scope !== this.gridId, l = n.colStart === Number.MIN_SAFE_INTEGER, S = n.rowStart === Number.MIN_SAFE_INTEGER;
|
|
2170
|
+
let w = n, E = n.$colStart ? n.colStart : _.colStart + n.colStart, y = n.$rowStart ? n.rowStart : _.rowStart + n.rowStart;
|
|
2171
|
+
if (!o && E > c && !n.$colStart && !n.$colEnd) continue;
|
|
2172
2172
|
let v = n.$colEnd ? n.colEnd : _.colStart + n.colEnd, x = n.$rowEnd ? n.rowEnd : _.rowStart + n.rowEnd;
|
|
2173
|
-
if (o) 0 === h || l || (n.$colStart || (
|
|
2173
|
+
if (o) 0 === h || l || (n.$colStart || (w = { ...n }, w.colStart = E - f.colStart), n.$colEnd || (w = w === n ? { ...n } : w, w.colEnd = v - f.colStart)), 0 === u || S || (n.$rowStart || (w = w === n ? { ...n } : w, w.rowStart = y - f.rowStart), n.$rowEnd || (w = w === n ? { ...n } : w, w.rowEnd = x - f.rowStart)), w !== n && (p = p.setReferenceAt(t, w));
|
|
2174
2174
|
else {
|
|
2175
2175
|
if (s < 0) {
|
|
2176
2176
|
if (r) {
|
|
2177
|
-
if (
|
|
2177
|
+
if (E >= i && v <= c) {
|
|
2178
2178
|
p = p.setReferenceAt(t, null);
|
|
2179
2179
|
continue;
|
|
2180
2180
|
}
|
|
@@ -2183,13 +2183,13 @@ var Kr = {
|
|
|
2183
2183
|
continue;
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
2186
|
-
0 === h || l || (n.$colStart ?
|
|
2186
|
+
0 === h || l || (n.$colStart ? E >= i && (w = w === n ? { ...n } : w, w.colStart += h, E = w.colStart) : E < i ? (w = w === n ? { ...n } : w, w.colStart = E - f.colStart, E = f.colStart + w.colStart) : h < 0 && E <= c && (w = w === n ? { ...n } : w, E = Math.max(i, E + h), w.colStart = E - f.colStart, E = f.colStart + w.colStart), n.$colEnd ? v >= i && (w = w === n ? { ...n } : w, w.colEnd += h, v = w.colEnd) : v < i ? (w = w === n ? { ...n } : w, w.colEnd = v - f.colStart, v = f.colStart + w.colEnd) : h < 0 && v <= c && (w = w === n ? { ...n } : w, v = Math.max(i - 1, v + h), w.colEnd = v - f.colStart, v = f.colStart + w.colEnd)), 0 === u || S || (n.$rowStart ? y >= a && (w = w === n ? { ...n } : w, w.rowStart += u, y = w.rowStart) : y < a ? (w = w === n ? { ...n } : w, w.rowStart = y - f.rowStart, y = f.rowStart + w.rowStart) : u < 0 && y <= d && (w = w === n ? { ...n } : w, y = Math.max(a, y + u), w.rowStart = y - f.rowStart, y = f.rowStart + w.rowStart), n.$rowEnd ? x >= a && (w = w === n ? { ...n } : w, w.rowEnd += u, x = w.rowEnd) : x < a ? (w = w === n ? { ...n } : w, w.rowEnd = x - f.rowStart, x = f.rowStart + w.rowEnd) : u < 0 && x <= d && (w = w === n ? { ...n } : w, x = Math.max(a - 1, x + u), w.rowEnd = x - f.rowStart, x = f.rowStart + w.rowEnd)), w !== n && ((v < E || x < y || g && (!l && (E < g.colStart || v > g.colEnd) || !S && (y < g.rowStart || x > g.rowEnd))) && (w = I.BuiltIn.Ref), p = p.setReferenceAt(t, w));
|
|
2187
2187
|
}
|
|
2188
2188
|
}
|
|
2189
|
-
const
|
|
2189
|
+
const S = new t(n, this.gridId, p, this._container, this.unanchored, this.getNodeSource());
|
|
2190
2190
|
return {
|
|
2191
2191
|
...e.after,
|
|
2192
|
-
value:
|
|
2192
|
+
value: S
|
|
2193
2193
|
};
|
|
2194
2194
|
}
|
|
2195
2195
|
getMerged(e, n, r) {
|
|
@@ -2199,7 +2199,7 @@ var Kr = {
|
|
|
2199
2199
|
block: this,
|
|
2200
2200
|
originRow: 0,
|
|
2201
2201
|
originCol: 0
|
|
2202
|
-
}, r ===
|
|
2202
|
+
}, r === E.Axis.Row ? {
|
|
2203
2203
|
block: e,
|
|
2204
2204
|
originRow: -(l.rowEnd - l.rowStart + 1),
|
|
2205
2205
|
originCol: 0
|
|
@@ -2211,7 +2211,7 @@ var Kr = {
|
|
|
2211
2211
|
return new t(n, this.gridId, o, this._container, this.unanchored, i);
|
|
2212
2212
|
}
|
|
2213
2213
|
getSplit(e, n, r) {
|
|
2214
|
-
const o = this.formula, s = n ===
|
|
2214
|
+
const o = this.formula, s = n === E.Axis.Column, l = new t(e[0], this.gridId, o, this._container, this.unanchored), i = new t(e[1], this.gridId, o, this._container, this.unanchored);
|
|
2215
2215
|
return l._adopt([{
|
|
2216
2216
|
block: this,
|
|
2217
2217
|
originRow: 0,
|
|
@@ -2230,7 +2230,7 @@ var Kr = {
|
|
|
2230
2230
|
for (let e = 0; e < l.length; e++) {
|
|
2231
2231
|
const i = l ? l[e] : null;
|
|
2232
2232
|
if (!i || "nameId" in i) continue;
|
|
2233
|
-
if (
|
|
2233
|
+
if (I.isError(i)) continue;
|
|
2234
2234
|
const a = i;
|
|
2235
2235
|
let c;
|
|
2236
2236
|
const d = a.$colStart ? a.colStart : t.colStart + a.colStart, h = a.$rowStart ? a.rowStart : t.rowStart + a.rowStart, u = a.$colEnd ? a.colEnd : t.colEnd + a.colEnd, _ = a.$rowEnd ? a.rowEnd : t.rowEnd + a.rowEnd, f = null != a.scope && a.scope !== this.gridId, g = !f && h >= o.rowStart && _ <= o.rowEnd, p = !f && d >= o.colStart && u <= o.colEnd;
|
|
@@ -2254,7 +2254,7 @@ var Kr = {
|
|
|
2254
2254
|
t.value.release();
|
|
2255
2255
|
}
|
|
2256
2256
|
evaluateAt(t, e, n) {
|
|
2257
|
-
return this.formula?.evaluateAt(t, e, n) ??
|
|
2257
|
+
return this.formula?.evaluateAt(t, e, n) ?? I.BuiltIn.NA;
|
|
2258
2258
|
}
|
|
2259
2259
|
finalizeValue(t) {
|
|
2260
2260
|
return this.formula?.finalizeValue(t) ?? t;
|
|
@@ -2291,7 +2291,7 @@ var Kr = {
|
|
|
2291
2291
|
}
|
|
2292
2292
|
setReferenceAt(e, n, r) {
|
|
2293
2293
|
const o = this.ref;
|
|
2294
|
-
if (n && !
|
|
2294
|
+
if (n && !I.isError(n) && !("nameId" in n)) {
|
|
2295
2295
|
const t = n, e = o.colStart, r = o.rowStart, s = t.$colStart ? t.colStart : e + t.colStart, l = t.$rowStart ? t.rowStart : r + t.rowStart, i = t.$colEnd ? t.colEnd : e + t.colEnd, a = t.$rowEnd ? t.rowEnd : r + t.rowEnd;
|
|
2296
2296
|
if (i < s || a < l) n = null;
|
|
2297
2297
|
else {
|
|
@@ -2415,7 +2415,7 @@ var Kr = {
|
|
|
2415
2415
|
}
|
|
2416
2416
|
_openSweep(t, e, n) {
|
|
2417
2417
|
const r = this._resolveBounds(t);
|
|
2418
|
-
return null === r ? null : this._onRead(this._gridId, r.rowStart, r.colStart, r.rowEnd, r.colEnd, !0) ? new ro(this._onRead, this._gridId, r.rowStart, r.colStart, r.rowEnd, r.colEnd, (e ?? this._inner.getAxis?.()) ===
|
|
2418
|
+
return null === r ? null : this._onRead(this._gridId, r.rowStart, r.colStart, r.rowEnd, r.colEnd, !0) ? new ro(this._onRead, this._gridId, r.rowStart, r.colStart, r.rowEnd, r.colEnd, (e ?? this._inner.getAxis?.()) === E.Axis.Column, !0 === n) : null;
|
|
2419
2419
|
}
|
|
2420
2420
|
getValueAt(t, e) {
|
|
2421
2421
|
return this._onRead(this._gridId, t, e, t, e), this._inner.getValueAt(t, e);
|
|
@@ -2423,7 +2423,7 @@ var Kr = {
|
|
|
2423
2423
|
getRuns(t) {
|
|
2424
2424
|
const e = this._openSweep(t?.bounds, void 0, !1), n = this._inner.getRuns(t);
|
|
2425
2425
|
if (null === e) return n;
|
|
2426
|
-
const r = this._inner.getAxis?.() ===
|
|
2426
|
+
const r = this._inner.getAxis?.() === E.Axis.Column, o = {
|
|
2427
2427
|
[Symbol.iterator]: () => o,
|
|
2428
2428
|
next: () => {
|
|
2429
2429
|
const t = n.next();
|
|
@@ -2539,13 +2539,13 @@ var Kr = {
|
|
|
2539
2539
|
return "[ReadObservedGrid]";
|
|
2540
2540
|
}
|
|
2541
2541
|
}, so = Math.pow(2, 53), lo = (t, e) => !0 === t?.isPendingOverlay || !0 === t?.isWhatIfLayer ? t : e ?? null, io = class t {
|
|
2542
|
-
constructor(t, e =
|
|
2542
|
+
constructor(t, e = E.Axis.Column, n) {
|
|
2543
2543
|
this._passSeed = 0, this._passCycleId = -1, this._gridKey = 0, this._gridKeyId = null, this._onRead = null, this._dynamicRead = null, this._createSparseColumn = (t, e, n, r) => {
|
|
2544
2544
|
if (0 === t) return this.createRange();
|
|
2545
2545
|
const o = this._container.getGrid(this._calcScope.gridId)?.getEntireCoords(), s = o && t > o.rowEnd + 1 ? {
|
|
2546
2546
|
...o,
|
|
2547
2547
|
rowEnd: t - 1
|
|
2548
|
-
} : o, l = new
|
|
2548
|
+
} : o, l = new F({
|
|
2549
2549
|
axis: this._axis,
|
|
2550
2550
|
maxCoords: s
|
|
2551
2551
|
});
|
|
@@ -2583,15 +2583,15 @@ var Kr = {
|
|
|
2583
2583
|
return this._calcScope.node ? this._container.evaluateWhatIf(t) : null;
|
|
2584
2584
|
}
|
|
2585
2585
|
async _initialize(t) {
|
|
2586
|
-
const e = await
|
|
2587
|
-
this._runtime = new
|
|
2586
|
+
const e = await gt.assertUsable("calcs", 0), n = this._container, r = n.getRuntime();
|
|
2587
|
+
this._runtime = new te("Calculation Runtime", {
|
|
2588
2588
|
isDate1904: () => r.isDate1904(),
|
|
2589
2589
|
isR1C1: () => r.isR1C1(),
|
|
2590
2590
|
getNow: () => n.getNow(),
|
|
2591
2591
|
getRandom: () => r.getRandom(),
|
|
2592
2592
|
getLocale: () => r.getLocale()
|
|
2593
|
-
}, e), this._calcScope = n.getScope(), this._coerceToNumber =
|
|
2594
|
-
const { initializeFunctions: o } = await import("./
|
|
2593
|
+
}, e), this._calcScope = n.getScope(), this._coerceToNumber = ge(this._runtime, m.Number, Ge);
|
|
2594
|
+
const { initializeFunctions: o } = await import("./BSNegq0YcivZJmkf.js"), s = this, l = Object.freeze(o(() => s, this._functionProviders)), a = new fe({
|
|
2595
2595
|
transactions: t ?? new i({ transient: !0 }),
|
|
2596
2596
|
context: this,
|
|
2597
2597
|
readonlyFunctions: l,
|
|
@@ -2600,7 +2600,7 @@ var Kr = {
|
|
|
2600
2600
|
return this._functions = a, { functions: a };
|
|
2601
2601
|
}
|
|
2602
2602
|
_createScoped(e) {
|
|
2603
|
-
const n = this._container, r = n.getSymbols().bind(
|
|
2603
|
+
const n = this._container, r = n.getSymbols().bind(de.Sheet, e);
|
|
2604
2604
|
if (!r || !n.getGrid(r)) return null;
|
|
2605
2605
|
const o = new t(n, this._axis, this._functionProviders);
|
|
2606
2606
|
return o._runtime = this._runtime, o._functions = this._functions, o._coerceToNumber = this._coerceToNumber, o._instanceScope = this._instanceScope, o._calcScope = {
|
|
@@ -2642,7 +2642,7 @@ var Kr = {
|
|
|
2642
2642
|
}, t;
|
|
2643
2643
|
}
|
|
2644
2644
|
getFunction(t) {
|
|
2645
|
-
const e =
|
|
2645
|
+
const e = Me(t);
|
|
2646
2646
|
if (void 0 !== e) {
|
|
2647
2647
|
const t = this._functions.getByName(e);
|
|
2648
2648
|
if (t && !t.isLambda()) return t;
|
|
@@ -2665,42 +2665,42 @@ var Kr = {
|
|
|
2665
2665
|
getFormulaAt(t, e, n) {
|
|
2666
2666
|
const r = this._container;
|
|
2667
2667
|
let o;
|
|
2668
|
-
if (this._calcScope.perCellRead = !0, o = n ? r.getSymbols().bind(
|
|
2668
|
+
if (this._calcScope.perCellRead = !0, o = n ? r.getSymbols().bind(de.Sheet, n) : this._calcScope.gridId, !o) return null;
|
|
2669
2669
|
const s = r.getFormulas();
|
|
2670
2670
|
if (!s) return null;
|
|
2671
2671
|
ho.colStart = e, ho.rowStart = t, ho.colEnd = e, ho.rowEnd = t, ho.scope = o;
|
|
2672
2672
|
const l = s.search(ho);
|
|
2673
2673
|
return 0 === l.length ? null : l[0].value.formula.getTextAt(t, e, !1, void 0, void 0, "display") ?? null;
|
|
2674
2674
|
}
|
|
2675
|
-
|
|
2675
|
+
_markVolatile() {
|
|
2676
2676
|
const t = this._container.getVolatiles();
|
|
2677
2677
|
if (!t) return;
|
|
2678
2678
|
const e = this._calcScope.node;
|
|
2679
2679
|
t.add(e), e.state |= Hn;
|
|
2680
2680
|
}
|
|
2681
2681
|
defer(t, e) {
|
|
2682
|
-
if ("function" != typeof t) throw new
|
|
2682
|
+
if ("function" != typeof t) throw new I.Value("defer needs an executor function");
|
|
2683
2683
|
const n = this._container.getDeferred?.();
|
|
2684
|
-
if (n) return
|
|
2685
|
-
|
|
2684
|
+
if (n) return N(n.defer(t, e, ft(), Ce())), n.previous;
|
|
2685
|
+
N(null);
|
|
2686
2686
|
}
|
|
2687
2687
|
formatResults(t) {
|
|
2688
2688
|
const e = this._calcScope.node;
|
|
2689
2689
|
e && (e.numFmt = t);
|
|
2690
2690
|
}
|
|
2691
2691
|
filterHidden(t, e) {
|
|
2692
|
-
if (!(t?.isIReferenceRange && t instanceof
|
|
2692
|
+
if (!(t?.isIReferenceRange && t instanceof mt)) return t;
|
|
2693
2693
|
const n = t.getCoords(), r = this._gridIdOf(n), o = r ? this._container.getGrid(r) : null;
|
|
2694
2694
|
if (!o) return t;
|
|
2695
2695
|
if (e?.onlyWhileFiltered && !o.isFiltered()) return t;
|
|
2696
|
-
const s = e?.axes, l = s !==
|
|
2696
|
+
const s = e?.axes, l = s !== E.AxisSelection.Column ? o.getHiddenSkip(E.Axis.Row, n.rowStart, n.rowEnd) : null, i = s === E.AxisSelection.Column || s === E.AxisSelection.Both ? o.getHiddenSkip(E.Axis.Column, n.colStart, n.colEnd) : null;
|
|
2697
2697
|
return l || i ? t.clone({
|
|
2698
2698
|
processRowSkip: l ?? void 0,
|
|
2699
2699
|
processColumnSkip: i ?? void 0
|
|
2700
2700
|
}) : t;
|
|
2701
2701
|
}
|
|
2702
2702
|
_gridIdOf(t) {
|
|
2703
|
-
return t.scope ? this._container.getSymbols().bind(
|
|
2703
|
+
return t.scope ? this._container.getSymbols().bind(de.Sheet, t.scope) : this._calcScope.gridId;
|
|
2704
2704
|
}
|
|
2705
2705
|
filterTotals(t) {
|
|
2706
2706
|
const e = t;
|
|
@@ -2744,7 +2744,7 @@ var Kr = {
|
|
|
2744
2744
|
const n = t?.getCoords()?.scope;
|
|
2745
2745
|
if (n) e = n;
|
|
2746
2746
|
else {
|
|
2747
|
-
const t = this._container.getSymbols().resolve(
|
|
2747
|
+
const t = this._container.getSymbols().resolve(de.Sheet, this._calcScope.gridId);
|
|
2748
2748
|
e = t ? t.getName ? t.getName() ?? void 0 : t.toString() : void 0;
|
|
2749
2749
|
}
|
|
2750
2750
|
}
|
|
@@ -2765,7 +2765,7 @@ var Kr = {
|
|
|
2765
2765
|
}
|
|
2766
2766
|
getDateParts(t, e) {
|
|
2767
2767
|
const n = u(t, this.getRuntime().isDate1904(), e);
|
|
2768
|
-
if (null === n) throw
|
|
2768
|
+
if (null === n) throw I.BuiltIn.Num;
|
|
2769
2769
|
return n;
|
|
2770
2770
|
}
|
|
2771
2771
|
getSerialDate(t, e, n, r = 0, o = 0, s = 0, l = 0) {
|
|
@@ -2794,18 +2794,18 @@ var Kr = {
|
|
|
2794
2794
|
const r = t.gridId;
|
|
2795
2795
|
if (r !== this._gridKeyId) {
|
|
2796
2796
|
this._gridKeyId = r;
|
|
2797
|
-
const t = null === r ? null : this._container.getSymbols().resolve(
|
|
2797
|
+
const t = null === r ? null : this._container.getSymbols().resolve(de.Sheet, r), n = t?.getName ? t.getName() : null;
|
|
2798
2798
|
this._gridKey = n ? e(n) : 0;
|
|
2799
2799
|
}
|
|
2800
2800
|
}
|
|
2801
2801
|
return s(this._passSeed, this._gridKey, t.rowIndex, t.colIndex, n);
|
|
2802
2802
|
}
|
|
2803
2803
|
compare(t, e, n) {
|
|
2804
|
-
return
|
|
2804
|
+
return Nt.compare(t, e, this.getRuntime().getLocaleProfile(), n);
|
|
2805
2805
|
}
|
|
2806
2806
|
_fromTuples(t, e = null, n = !1, r = !1) {
|
|
2807
2807
|
if (!t) return null;
|
|
2808
|
-
const o =
|
|
2808
|
+
const o = oe(t.bounds, !0), s = this._container.getGrid(this._calcScope.gridId)?.getEntireCoords(), l = new F({
|
|
2809
2809
|
axis: this._axis,
|
|
2810
2810
|
maxCoords: s
|
|
2811
2811
|
});
|
|
@@ -2817,14 +2817,14 @@ var Kr = {
|
|
|
2817
2817
|
const s = this._container, l = this._calcScope;
|
|
2818
2818
|
let i, a;
|
|
2819
2819
|
if (n) {
|
|
2820
|
-
if (i = s.getSymbols().bind(
|
|
2820
|
+
if (i = s.getSymbols().bind(de.Sheet, n), tt(i)) return I.BuiltIn.Ref;
|
|
2821
2821
|
} else i = l.gridId;
|
|
2822
|
-
if (!i) return
|
|
2823
|
-
const c = l.node, d = c ?
|
|
2822
|
+
if (!i) return I.BuiltIn.Ref;
|
|
2823
|
+
const c = l.node, d = c ? an(c) : r.EmptyArray, h = d.length;
|
|
2824
2824
|
for (let n = 0; n < h; n++) {
|
|
2825
2825
|
const r = d[n];
|
|
2826
2826
|
if (!r) continue;
|
|
2827
|
-
if (
|
|
2827
|
+
if (I.isError(r)) continue;
|
|
2828
2828
|
const s = r;
|
|
2829
2829
|
if (t < s.rowStart || t > s.rowEnd) continue;
|
|
2830
2830
|
if (e < s.colStart || e > s.colEnd) continue;
|
|
@@ -2836,12 +2836,12 @@ var Kr = {
|
|
|
2836
2836
|
} else a = l;
|
|
2837
2837
|
break;
|
|
2838
2838
|
}
|
|
2839
|
-
return void 0 === a && (this._onRead?.(i, t, e, t, e), a = s.getGridValues(i)?.getValueAt(t, e) ?? null, s.getDeferred?.()?.hasHolders() && (a =
|
|
2839
|
+
return void 0 === a && (this._onRead?.(i, t, e, t, e), a = s.getGridValues(i)?.getValueAt(t, e) ?? null, s.getDeferred?.()?.hasHolders() && (a = ct(a))), o && o.type, a;
|
|
2840
2840
|
}
|
|
2841
2841
|
getSpillAt(t, e, n) {
|
|
2842
2842
|
const r = this._container, o = this._calcScope;
|
|
2843
2843
|
let s;
|
|
2844
|
-
s = n ? r.getSymbols().bind(
|
|
2844
|
+
s = n ? r.getSymbols().bind(de.Sheet, n) : o.gridId;
|
|
2845
2845
|
const l = s === o.gridId ? null : s, i = r.getIncrementalUpdates(s)?.spillSpatial ?? r.getGrid(s)?.getSpills();
|
|
2846
2846
|
if (i) {
|
|
2847
2847
|
uo.rowStart = t, uo.colStart = e, uo.rowEnd = t, uo.colEnd = e, uo.scope = s;
|
|
@@ -2871,7 +2871,7 @@ var Kr = {
|
|
|
2871
2871
|
...r,
|
|
2872
2872
|
rowEnd: Math.max(r.rowEnd, t - 1),
|
|
2873
2873
|
colEnd: Math.max(r.colEnd, e - 1)
|
|
2874
|
-
} : r, s = new
|
|
2874
|
+
} : r, s = new F({
|
|
2875
2875
|
axis: this._axis,
|
|
2876
2876
|
maxCoords: o
|
|
2877
2877
|
});
|
|
@@ -2917,12 +2917,12 @@ var Kr = {
|
|
|
2917
2917
|
}
|
|
2918
2918
|
if (Array.isArray(t[0])) r = t;
|
|
2919
2919
|
else {
|
|
2920
|
-
if (t[0]?.isIRange) throw
|
|
2920
|
+
if (t[0]?.isIRange) throw I.BuiltIn.Value;
|
|
2921
2921
|
r = [t];
|
|
2922
2922
|
}
|
|
2923
|
-
const l = this._axis, i = l ===
|
|
2923
|
+
const l = this._axis, i = l === E.Axis.Column, a = this._fromTuples($(r, i, Fe(0, 0, void 0, void 0, i), !0), e, n, !s);
|
|
2924
2924
|
if (a) return a;
|
|
2925
|
-
const c = this._container.getGrid(this._calcScope.gridId)?.getEntireCoords(), d = new
|
|
2925
|
+
const c = this._container.getGrid(this._calcScope.gridId)?.getEntireCoords(), d = new F({
|
|
2926
2926
|
axis: l,
|
|
2927
2927
|
maxCoords: c
|
|
2928
2928
|
}), h = e ? { type: e } : void 0;
|
|
@@ -2945,7 +2945,7 @@ var Kr = {
|
|
|
2945
2945
|
return t.firstCell = !1, e;
|
|
2946
2946
|
}
|
|
2947
2947
|
getReference(t, e) {
|
|
2948
|
-
if (!t) throw
|
|
2948
|
+
if (!t) throw I.BuiltIn.Ref;
|
|
2949
2949
|
const n = this._calcScope, r = this._container;
|
|
2950
2950
|
let o = n.gridId, s = r.getGrid(o);
|
|
2951
2951
|
const l = s?.getShadowOf();
|
|
@@ -2958,13 +2958,13 @@ var Kr = {
|
|
|
2958
2958
|
const r = i?.();
|
|
2959
2959
|
let o;
|
|
2960
2960
|
try {
|
|
2961
|
-
let n =
|
|
2962
|
-
throw
|
|
2961
|
+
let n = Pt(t, r, x, () => {
|
|
2962
|
+
throw I.BuiltIn.Ref;
|
|
2963
2963
|
}, e);
|
|
2964
|
-
if (n.length > 1) throw
|
|
2964
|
+
if (n.length > 1) throw I.BuiltIn.Ref;
|
|
2965
2965
|
o = n[0];
|
|
2966
2966
|
} catch (t) {
|
|
2967
|
-
throw
|
|
2967
|
+
throw I.BuiltIn.Ref;
|
|
2968
2968
|
}
|
|
2969
2969
|
if (e) {
|
|
2970
2970
|
const t = n.rowIndex, e = n.colIndex;
|
|
@@ -2974,7 +2974,7 @@ var Kr = {
|
|
|
2974
2974
|
colStart: o.$colStart ? o.colStart : o.colStart + e,
|
|
2975
2975
|
colEnd: o.$colEnd ? o.colEnd : o.colEnd + e,
|
|
2976
2976
|
scope: o.scope
|
|
2977
|
-
}, o.rowStart < 0 || o.colStart < 0 || o.rowEnd < 0 || o.colEnd < 0 || r && (o.rowEnd > r.rowEnd || o.colEnd > r.colEnd)) throw
|
|
2977
|
+
}, o.rowStart < 0 || o.colStart < 0 || o.rowEnd < 0 || o.colEnd < 0 || r && (o.rowEnd > r.rowEnd || o.colEnd > r.colEnd)) throw I.BuiltIn.Ref;
|
|
2978
2978
|
}
|
|
2979
2979
|
o.rowStart > o.rowEnd && (o = {
|
|
2980
2980
|
...o,
|
|
@@ -2991,13 +2991,13 @@ var Kr = {
|
|
|
2991
2991
|
colEnd: n.colIndex,
|
|
2992
2992
|
rowEnd: n.rowIndex
|
|
2993
2993
|
});
|
|
2994
|
-
if (!t) throw
|
|
2994
|
+
if (!t) throw I.BuiltIn.Ref;
|
|
2995
2995
|
let a = t.scope;
|
|
2996
2996
|
if (a) {
|
|
2997
|
-
if (a = r.getSymbols().bind(
|
|
2997
|
+
if (a = r.getSymbols().bind(de.Sheet, t.scope), !a) return I.BuiltIn.Ref;
|
|
2998
2998
|
const e = r.getSheetSpanIds?.(a) ?? null;
|
|
2999
2999
|
if (e) {
|
|
3000
|
-
if (r.isGridless?.(e[0]) || r.isGridless?.(e[e.length - 1])) return
|
|
3000
|
+
if (r.isGridless?.(e[0]) || r.isGridless?.(e[e.length - 1])) return I.BuiltIn.Name;
|
|
3001
3001
|
const n = [];
|
|
3002
3002
|
for (let r = 0; r < e.length; r++) n.push(this.getReference(ao(t, e[r])));
|
|
3003
3003
|
return n.isSheetSpan = !0, n;
|
|
@@ -3011,13 +3011,13 @@ var Kr = {
|
|
|
3011
3011
|
scope: a
|
|
3012
3012
|
};
|
|
3013
3013
|
if (r.isGridless?.(a)) {
|
|
3014
|
-
const t = new
|
|
3014
|
+
const t = new F({ axis: this._axis });
|
|
3015
3015
|
return this._toReference(t, e, void 0, a, !1, null);
|
|
3016
3016
|
}
|
|
3017
3017
|
t = e;
|
|
3018
3018
|
}
|
|
3019
3019
|
if (a !== o) {
|
|
3020
|
-
if (o = a, s = r.getGrid(o), !s) return
|
|
3020
|
+
if (o = a, s = r.getGrid(o), !s) return I.BuiltIn.Ref;
|
|
3021
3021
|
i = s?.getEntireCoords.bind(s);
|
|
3022
3022
|
}
|
|
3023
3023
|
}
|
|
@@ -3025,19 +3025,19 @@ var Kr = {
|
|
|
3025
3025
|
let d;
|
|
3026
3026
|
const h = n.node;
|
|
3027
3027
|
let u = -1;
|
|
3028
|
-
if (h && (u = co(
|
|
3028
|
+
if (h && (u = co(an(h), t)), -1 !== u) {
|
|
3029
3029
|
const e = zn(h, u);
|
|
3030
3030
|
if (null != e && e.isIReferenceRange) d = e;
|
|
3031
3031
|
else if (void 0 === e || c.isPendingOverlay) d = this._toReference(c, t, i, o, !1, lo(c, s));
|
|
3032
3032
|
else {
|
|
3033
3033
|
let n = e;
|
|
3034
3034
|
null !== n && n.isIRange && (n = n.getValueAt(0, 0));
|
|
3035
|
-
const r = new
|
|
3035
|
+
const r = new F({
|
|
3036
3036
|
axis: this._axis,
|
|
3037
3037
|
maxCoords: i?.()
|
|
3038
3038
|
});
|
|
3039
3039
|
if (null !== n) {
|
|
3040
|
-
const e = this._axis ===
|
|
3040
|
+
const e = this._axis === E.Axis.Column, o = e ? t.colStart : t.rowStart, s = e ? t.rowStart : t.colStart;
|
|
3041
3041
|
r.setValues([[o, [[s, [n]]]]]);
|
|
3042
3042
|
}
|
|
3043
3043
|
d = this._toReference(r, t, i, o, !1, null);
|
|
@@ -3054,7 +3054,7 @@ var Kr = {
|
|
|
3054
3054
|
_expandSheetSpan(t) {
|
|
3055
3055
|
if (null === t || "object" != typeof t || !0 === t.isIRange) return null;
|
|
3056
3056
|
const e = t;
|
|
3057
|
-
if (void 0 === e.colStart || !
|
|
3057
|
+
if (void 0 === e.colStart || !tt(e.scope)) return null;
|
|
3058
3058
|
const n = this._container, r = n.getSheetSpanIds?.(e.scope) ?? null;
|
|
3059
3059
|
if (!r) return null;
|
|
3060
3060
|
if (n.isGridless?.(r[0]) || n.isGridless?.(r[r.length - 1])) return null;
|
|
@@ -3076,43 +3076,43 @@ var Kr = {
|
|
|
3076
3076
|
const i = this._onRead ?? (s ? this._dynamicRead : null);
|
|
3077
3077
|
i && (t = new oo(t, o, i));
|
|
3078
3078
|
try {
|
|
3079
|
-
const n = new
|
|
3079
|
+
const n = new mt(this._runtime, t, e, void 0, r, this._container.resolveScope);
|
|
3080
3080
|
return n._setCoordsReadHook(this._positionRead), null !== l && n._setErrorIndex(null === i ? l : { hasErrorIn: (t) => (i(o, t.rowStart, t.colStart, t.rowEnd, t.colEnd), l.hasErrorIn(t)) }), n;
|
|
3081
3081
|
} catch (t) {
|
|
3082
|
-
if (t instanceof n) throw
|
|
3082
|
+
if (t instanceof n) throw I.BuiltIn.Ref;
|
|
3083
3083
|
throw t;
|
|
3084
3084
|
}
|
|
3085
3085
|
}
|
|
3086
3086
|
getAddress(t, e = !1) {
|
|
3087
3087
|
t || (this._calcScope.positionRead = !0, _o.rowIndex = this._calcScope.rowIndex, _o.colIndex = this._calcScope.colIndex, _o.scope = null, t = _o);
|
|
3088
3088
|
const n = this.getEntireCoords().scope;
|
|
3089
|
-
return void 0 !== t.colIndex ?
|
|
3089
|
+
return void 0 !== t.colIndex ? Se(t, n, e) : Ie(t, n, e);
|
|
3090
3090
|
}
|
|
3091
3091
|
parseAsSerialDate(t, e) {
|
|
3092
3092
|
if (void 0 === t) return;
|
|
3093
3093
|
if ("number" == typeof t) return t;
|
|
3094
|
-
if (
|
|
3095
|
-
if ("string" != typeof t) throw
|
|
3094
|
+
if (I.isError(t)) throw t;
|
|
3095
|
+
if ("string" != typeof t) throw I.BuiltIn.Value;
|
|
3096
3096
|
const n = g(this._runtime, t, e);
|
|
3097
|
-
if (null === n) throw
|
|
3097
|
+
if (null === n) throw I.BuiltIn.Value;
|
|
3098
3098
|
return n;
|
|
3099
3099
|
}
|
|
3100
3100
|
parseAsDate(t, e) {
|
|
3101
3101
|
if (void 0 !== t) {
|
|
3102
|
-
if (
|
|
3102
|
+
if (I.isError(t)) throw t;
|
|
3103
3103
|
if ("number" == typeof t) return this.fromSerialDate(t);
|
|
3104
3104
|
if ("string" == typeof t) return this.fromSerialDate(this.parseAsSerialDate(t, e));
|
|
3105
3105
|
if (t instanceof Date) return t;
|
|
3106
|
-
throw
|
|
3106
|
+
throw I.BuiltIn.Value;
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
3109
|
parseAsNumber(t, e) {
|
|
3110
3110
|
if (void 0 === t) return;
|
|
3111
3111
|
if ("number" == typeof t) return t;
|
|
3112
|
-
if (
|
|
3113
|
-
if ("string" != typeof t) throw
|
|
3114
|
-
const n = this._coerceToNumber(t,
|
|
3115
|
-
if ("number" != typeof n) throw
|
|
3112
|
+
if (I.isError(t)) throw t;
|
|
3113
|
+
if ("string" != typeof t) throw I.BuiltIn.Value;
|
|
3114
|
+
const n = this._coerceToNumber(t, m.String, e);
|
|
3115
|
+
if ("number" != typeof n) throw I.BuiltIn.Value;
|
|
3116
3116
|
return n;
|
|
3117
3117
|
}
|
|
3118
3118
|
createCriteria(t, e) {
|
|
@@ -3129,8 +3129,8 @@ var Kr = {
|
|
|
3129
3129
|
const t = o, e = r.match;
|
|
3130
3130
|
return (n) => "string" == typeof n ? e === t.test(n) : !e;
|
|
3131
3131
|
}
|
|
3132
|
-
case "=": return void 0 === o ? (t) => null == t : "" === o ? (t) => null == t || "" === t : "string" == typeof o ? (e) => "string" == typeof e && 0 === t.compare(e, o) :
|
|
3133
|
-
case "<>": return void 0 === o ? (t) => null != t : "string" == typeof o ? (e) => "string" != typeof e || 0 !== t.compare(e, o) :
|
|
3132
|
+
case "=": return void 0 === o ? (t) => null == t : "" === o ? (t) => null == t || "" === t : "string" == typeof o ? (e) => "string" == typeof e && 0 === t.compare(e, o) : I.isError(o) ? (t) => !!I.isError(t) && t.equals(o) : "number" == typeof o ? (e) => "number" == typeof e ? 0 === t.compare(e, o) : "string" == typeof e && cr(t, e, o) : (t) => t === o;
|
|
3133
|
+
case "<>": return void 0 === o ? (t) => null != t : "string" == typeof o ? (e) => "string" != typeof e || 0 !== t.compare(e, o) : I.isError(o) ? (t) => !I.isError(t) || !t.equals(o) : "number" == typeof o ? (e) => !("number" == typeof e && 0 === t.compare(e, o)) : (t) => t !== o;
|
|
3134
3134
|
case ">": return ar(t, o, (t) => t > 0);
|
|
3135
3135
|
case ">=": return ar(t, o, (t) => t >= 0);
|
|
3136
3136
|
case "<": return ar(t, o, (t) => t < 0);
|
|
@@ -3143,36 +3143,36 @@ var Kr = {
|
|
|
3143
3143
|
return pr.create(t, e, this._createSparseColumn, n);
|
|
3144
3144
|
}
|
|
3145
3145
|
getPivotAt(t) {
|
|
3146
|
-
if (!(t instanceof
|
|
3146
|
+
if (!(t instanceof mt)) return null;
|
|
3147
3147
|
const e = t.getCoords(), n = this._gridIdOf(e), r = (n ? this._container.getGrid(n) : null)?.getPivots();
|
|
3148
3148
|
if (!r) return null;
|
|
3149
3149
|
for (let t = 0; t < r.length; t++) {
|
|
3150
3150
|
const n = r[t], o = n.range;
|
|
3151
3151
|
if (e.rowStart > o.rowEnd || e.rowEnd < o.rowStart || e.colStart > o.colEnd || e.colEnd < o.colStart) continue;
|
|
3152
3152
|
const s = n.block?.anchor;
|
|
3153
|
-
if (!s || !n.block.blocked) return
|
|
3153
|
+
if (!s || !n.block.blocked) return He(n);
|
|
3154
3154
|
const l = e.rowStart <= s.row && e.rowEnd >= s.row && e.colStart <= s.column && e.colEnd >= s.column;
|
|
3155
|
-
return
|
|
3155
|
+
return He(n, l ? "blocked" : "wanted");
|
|
3156
3156
|
}
|
|
3157
3157
|
return null;
|
|
3158
3158
|
}
|
|
3159
3159
|
parseAsLiteral(t) {
|
|
3160
|
-
return
|
|
3160
|
+
return K(t) ?? st(t);
|
|
3161
3161
|
}
|
|
3162
3162
|
toText(t) {
|
|
3163
|
-
return
|
|
3163
|
+
return nt(t, this._runtime);
|
|
3164
3164
|
}
|
|
3165
3165
|
getRuntime() {
|
|
3166
3166
|
return this._runtime;
|
|
3167
3167
|
}
|
|
3168
3168
|
createRichData(t, e) {
|
|
3169
|
-
return
|
|
3169
|
+
return J.fromJSON({
|
|
3170
3170
|
type: t,
|
|
3171
3171
|
data: e
|
|
3172
3172
|
}, this._container.getRichDataContext?.());
|
|
3173
3173
|
}
|
|
3174
3174
|
getArgs() {
|
|
3175
|
-
return
|
|
3175
|
+
return w.getArgs();
|
|
3176
3176
|
}
|
|
3177
3177
|
get [Symbol.toStringTag]() {
|
|
3178
3178
|
return "[CalculationContext]";
|
|
@@ -3194,7 +3194,7 @@ var Kr = {
|
|
|
3194
3194
|
const r = e.colStart, o = e.rowStart, s = e.colEnd, l = e.rowEnd, i = e.scope;
|
|
3195
3195
|
for (let e = 0; e < n; e++) {
|
|
3196
3196
|
const n = t[e];
|
|
3197
|
-
if (null != n && !(
|
|
3197
|
+
if (null != n && !(I.isError(n) || n.colStart !== r || n.rowStart !== o || n.colEnd !== s || n.rowEnd !== l || i && n.scope !== i)) return e;
|
|
3198
3198
|
}
|
|
3199
3199
|
return -1;
|
|
3200
3200
|
}, ho = {
|
|
@@ -3255,9 +3255,6 @@ var Kr = {
|
|
|
3255
3255
|
formatResults(t) {
|
|
3256
3256
|
throw this._noCell("formatResults");
|
|
3257
3257
|
}
|
|
3258
|
-
markVolatile() {
|
|
3259
|
-
throw this._noCell("markVolatile");
|
|
3260
|
-
}
|
|
3261
3258
|
getRandom() {
|
|
3262
3259
|
throw this._noCell("getRandom");
|
|
3263
3260
|
}
|
|
@@ -3283,7 +3280,7 @@ function mo(t, e, n, r, o, s, l, i) {
|
|
|
3283
3280
|
}
|
|
3284
3281
|
function So(t, e, n) {
|
|
3285
3282
|
const r = t.ref, o = t.formula, s = o ? o.getReferences(r.rowStart, r.colStart)[e] : null;
|
|
3286
|
-
if (!s || "nameId" in s || "tableId" in s ||
|
|
3283
|
+
if (!s || "nameId" in s || "tableId" in s || I.isError(s)) return r;
|
|
3287
3284
|
const l = s, i = mo(r.rowStart, r.rowEnd, l.rowStart, l.rowEnd, !0 === l.$rowStart, !0 === l.$rowEnd, n.rowStart, n.rowEnd);
|
|
3288
3285
|
if (null === i) return null;
|
|
3289
3286
|
const a = mo(r.colStart, r.colEnd, l.colStart, l.colEnd, !0 === l.$colStart, !0 === l.$colEnd, n.colStart, n.colEnd);
|
|
@@ -3294,7 +3291,7 @@ function So(t, e, n) {
|
|
|
3294
3291
|
colEnd: a[1]
|
|
3295
3292
|
};
|
|
3296
3293
|
}
|
|
3297
|
-
var wo = class extends
|
|
3294
|
+
var wo = class extends dt {
|
|
3298
3295
|
constructor(t) {
|
|
3299
3296
|
const e = (t = { ...t }).container;
|
|
3300
3297
|
super({
|
|
@@ -3306,11 +3303,11 @@ var wo = class extends ct {
|
|
|
3306
3303
|
if (this._getEntireCoords = o, this._unanchored = !0 === t.unanchored, this._shadowOf = t.shadowOf ?? null, this._arrayFirstCell = !0 === t.arrayFirstCell, this._paged = !0 === t.paged, !this._context || !this._container) throw new Error("Invalid Options");
|
|
3307
3304
|
const s = t?.onCalculated;
|
|
3308
3305
|
this._onCalculated = s ? (t) => {
|
|
3309
|
-
s(
|
|
3310
|
-
} : () => {}, this._values = new
|
|
3311
|
-
axis:
|
|
3312
|
-
createRun:
|
|
3313
|
-
}), this._iterationId = 0, this._contentfulSpatial = new
|
|
3306
|
+
s(he(Lt.results(t, "onCalculated"), this._container.getImager(this._gridId)));
|
|
3307
|
+
} : () => {}, this._values = new F({
|
|
3308
|
+
axis: E.Axis.Column,
|
|
3309
|
+
createRun: rn
|
|
3310
|
+
}), this._iterationId = 0, this._contentfulSpatial = new rt({ updateEntryOptions: {
|
|
3314
3311
|
isSplitOnExpand: !0,
|
|
3315
3312
|
isMergeOnShift: !0
|
|
3316
3313
|
} });
|
|
@@ -3318,7 +3315,7 @@ var wo = class extends ct {
|
|
|
3318
3315
|
isSplitOnExpand: !0,
|
|
3319
3316
|
isMergeOnShift: !1
|
|
3320
3317
|
} };
|
|
3321
|
-
this._spillSpatial = new
|
|
3318
|
+
this._spillSpatial = new rt(l), this._errorSpatial = new rt(l), this._calcStatusSpatial = new rt(l), this._circularSpatial = new rt(l), this._notifyValues = new rt(), this._notifyBlank = null, this._notifySpillsInsert = [], this._notifySpillsRemove = [], this._notifyFormats = new rt(), this._notifyCalcStatus = new rt(), this._notifyCircular = new rt(), this._touchedFormulas = [], this._container.registerGrid(this), this._publishMaps();
|
|
3322
3319
|
}
|
|
3323
3320
|
_land(t, e) {
|
|
3324
3321
|
return this._container.landRequest(t, () => (void 0 !== t && this._versionMaps(t), e()));
|
|
@@ -3444,7 +3441,7 @@ var wo = class extends ct {
|
|
|
3444
3441
|
cycleId: this._container.getCycleId(),
|
|
3445
3442
|
commitId: t.commitId
|
|
3446
3443
|
};
|
|
3447
|
-
const r =
|
|
3444
|
+
const r = M(t.destination, t.coords, t.fitDestination, t.transpose);
|
|
3448
3445
|
return r.scope = this._gridId, this._land(e, () => {
|
|
3449
3446
|
t.isCut ? this._moveTo(n, t.coords, r) : this._copyTo(n, t.coords, r);
|
|
3450
3447
|
const e = this._mutationResults(t.commitId);
|
|
@@ -3483,7 +3480,7 @@ var wo = class extends ct {
|
|
|
3483
3480
|
const o = this._container.getHeldCloneKey?.() ?? t.options?.cloneKey ?? null;
|
|
3484
3481
|
return this._land(e, () => this._setPivotsNow(r, o)), this._notifyCalculated(this._container.getCycleId(), !1, n ? null : t.options?.commitId);
|
|
3485
3482
|
}
|
|
3486
|
-
case "setReference": return this._setReferenceNow(t.row, t.column, t.index, "#REF!" === t.precedent ?
|
|
3483
|
+
case "setReference": return this._setReferenceNow(t.row, t.column, t.index, "#REF!" === t.precedent ? I.BuiltIn.Ref : t.precedent);
|
|
3487
3484
|
case "setReferenceMode": return this._setReferenceModeNow(t.row, t.column, t.index, t.side, t.mode);
|
|
3488
3485
|
case "toJSON": return {
|
|
3489
3486
|
cycleId: this._container.getCycleId(),
|
|
@@ -3569,8 +3566,8 @@ var wo = class extends ct {
|
|
|
3569
3566
|
_shiftNow(t) {
|
|
3570
3567
|
const e = this, n = this.getId(), r = { ...t };
|
|
3571
3568
|
r.range = { ...r.range }, r.range.scope = n, delete r.onShift;
|
|
3572
|
-
const o = e._values, s = r.range, l = r.direction, i = l ===
|
|
3573
|
-
|
|
3569
|
+
const o = e._values, s = r.range, l = r.direction, i = l === E.Direction.Left || l === E.Direction.Right, a = l === E.Direction.Down || l === E.Direction.Right, c = a ? 1 : -1, d = e._spillSpatial, h = e._contentfulSpatial;
|
|
3570
|
+
at(d, s, i, a);
|
|
3574
3571
|
const u = [], _ = this._container.getPrecedents().search(s), f = Kt(s, d, o, h, void 0, !1, !1, void 0, (t, e, r, o) => {
|
|
3575
3572
|
u.push({
|
|
3576
3573
|
colStart: t,
|
|
@@ -3583,13 +3580,13 @@ var wo = class extends ct {
|
|
|
3583
3580
|
o.shift(r.range, r.direction), r.onUpdates = (t, n) => {
|
|
3584
3581
|
e._notifySpillsRemove.push(...n), e._notifySpillsInsert.push(...t);
|
|
3585
3582
|
}, e._spillSpatial = d.shift(r), delete r.onUpdates, e._contentfulSpatial = h.shift(r), e._errorSpatial = e._errorSpatial.shift(r), e._calcStatusSpatial = e._calcStatusSpatial.shift(r);
|
|
3586
|
-
const g = e._container, p = g.getFormulas().clone(), m = g.getPrecedents().clone(), S = this.getEntireCoords(),
|
|
3583
|
+
const g = e._container, p = g.getFormulas().clone(), m = g.getPrecedents().clone(), S = this.getEntireCoords(), w = {
|
|
3587
3584
|
colStart: s.colStart,
|
|
3588
3585
|
rowStart: s.rowStart,
|
|
3589
3586
|
colEnd: i && 1 === c ? S.colEnd : s.colEnd,
|
|
3590
3587
|
rowEnd: i || 1 !== c ? s.rowEnd : S.rowEnd,
|
|
3591
3588
|
scope: n
|
|
3592
|
-
}, I = a ? St(m,
|
|
3589
|
+
}, I = a ? St(m, w) : O(m, s);
|
|
3593
3590
|
I && (Po(p, m, I.formulas.inserts, I.formulas.removes), e._touchFormulas(I.formulas.removes), e._touchFormulas(I.formulas.inserts));
|
|
3594
3591
|
const y = i ? s.colEnd - s.colStart + 1 : s.rowEnd - s.rowStart + 1, v = y * c, x = {
|
|
3595
3592
|
colStart: s.colStart,
|
|
@@ -3599,7 +3596,7 @@ var wo = class extends ct {
|
|
|
3599
3596
|
scope: n
|
|
3600
3597
|
};
|
|
3601
3598
|
let C;
|
|
3602
|
-
const b =
|
|
3599
|
+
const b = Ot(() => m, () => {
|
|
3603
3600
|
const t = g.getDynamics();
|
|
3604
3601
|
return C = new Map(t), C;
|
|
3605
3602
|
}, x, {
|
|
@@ -3607,10 +3604,10 @@ var wo = class extends ct {
|
|
|
3607
3604
|
rowIndex: i ? 0 : v,
|
|
3608
3605
|
scope: n
|
|
3609
3606
|
}, a ? void 0 : s);
|
|
3610
|
-
let
|
|
3607
|
+
let R, A;
|
|
3611
3608
|
b && (Po(p, m, b.formulas.inserts, b.formulas.removes), e._touchFormulas(b.formulas.removes), e._touchFormulas(b.formulas.inserts)), r.onUpdates = (t, e) => {
|
|
3612
|
-
|
|
3613
|
-
}, p.shift(r), (
|
|
3609
|
+
R = t, A = e;
|
|
3610
|
+
}, p.shift(r), (R || A) && (Lo(m, R, A), e._touchFormulas(A), e._touchFormulas(R)), g.setFormulas(p), g.setPrecedents(m), C && g.setDynamics(C), g.bumpCalcEpochs(!0), f?.(a, i ? 0 : v, i ? v : 0);
|
|
3614
3611
|
const k = i ? s.colStart : s.rowStart, N = i ? s.colEnd : s.rowEnd, M = (t, e = t.ref) => {
|
|
3615
3612
|
const r = t.gridId;
|
|
3616
3613
|
r && g.getGrid(r) && (t.unanchored ? g.invalidateNamed(r) : ((t, e) => {
|
|
@@ -3645,8 +3642,8 @@ var wo = class extends ct {
|
|
|
3645
3642
|
const e = D[t];
|
|
3646
3643
|
e.scope !== n && M(e.value);
|
|
3647
3644
|
}
|
|
3648
|
-
for (let t = 0; t < (
|
|
3649
|
-
const e =
|
|
3645
|
+
for (let t = 0; t < (R?.length ?? 0); t++) {
|
|
3646
|
+
const e = R[t];
|
|
3650
3647
|
e.value.positionRead && u.push({
|
|
3651
3648
|
colStart: e.colStart,
|
|
3652
3649
|
rowStart: e.rowStart,
|
|
@@ -3691,9 +3688,9 @@ var wo = class extends ct {
|
|
|
3691
3688
|
let h = c;
|
|
3692
3689
|
for (let r = 0; r < d.length; r++) {
|
|
3693
3690
|
const o = d[r];
|
|
3694
|
-
if (!
|
|
3691
|
+
if (!Ae(o)) continue;
|
|
3695
3692
|
let s = l.get(o);
|
|
3696
|
-
void 0 === s && (s =
|
|
3693
|
+
void 0 === s && (s = D(o, t, e, n) ?? null, l.set(o, s)), null !== s && (h = h.replaceScopeIds(o, s));
|
|
3697
3694
|
}
|
|
3698
3695
|
h !== c && (i.push(o), a.push({
|
|
3699
3696
|
...o,
|
|
@@ -3788,7 +3785,7 @@ var wo = class extends ct {
|
|
|
3788
3785
|
this._container.markDirty(n);
|
|
3789
3786
|
}
|
|
3790
3787
|
getHiddenRuns(t) {
|
|
3791
|
-
return t ===
|
|
3788
|
+
return t === E.Axis.Column ? this._hiddenColumns : this._hiddenRows;
|
|
3792
3789
|
}
|
|
3793
3790
|
isFiltered() {
|
|
3794
3791
|
return this._filtered;
|
|
@@ -3809,14 +3806,14 @@ var wo = class extends ct {
|
|
|
3809
3806
|
l || (l = /* @__PURE__ */ new Map(), Eo.set(r, l));
|
|
3810
3807
|
let i = l.get(e);
|
|
3811
3808
|
if (!i) {
|
|
3812
|
-
const t =
|
|
3809
|
+
const t = B(r);
|
|
3813
3810
|
i = 0 === e ? t : (n, r) => t(n + e, r) - e, l.set(e, i);
|
|
3814
3811
|
}
|
|
3815
3812
|
return i;
|
|
3816
3813
|
}
|
|
3817
3814
|
_setHiddenNow(t, e) {
|
|
3818
3815
|
const n = e.length > 0 ? e : null;
|
|
3819
|
-
t ===
|
|
3816
|
+
t === E.Axis.Column ? this._hiddenColumns = n : this._hiddenRows = n, this._publishMaps(), this._markTotals();
|
|
3820
3817
|
}
|
|
3821
3818
|
_setFilteredNow(t) {
|
|
3822
3819
|
this._filtered = t, this._publishMaps(), this._markTotals();
|
|
@@ -3840,7 +3837,7 @@ var wo = class extends ct {
|
|
|
3840
3837
|
columns: e.anchor.column - n.colStart
|
|
3841
3838
|
}, i = {
|
|
3842
3839
|
...n,
|
|
3843
|
-
value: new
|
|
3840
|
+
value: new Yt(n, l, "pivot", s)
|
|
3844
3841
|
};
|
|
3845
3842
|
o.insert(i), this._notifySpillsInsert.push(i);
|
|
3846
3843
|
}
|
|
@@ -3965,7 +3962,7 @@ var wo = class extends ct {
|
|
|
3965
3962
|
}
|
|
3966
3963
|
this._pushWithSpills(h, w);
|
|
3967
3964
|
}
|
|
3968
|
-
return h =
|
|
3965
|
+
return h = ne(h, 2, t.Row), h.sort(o.rowFirstRangeComparator), h;
|
|
3969
3966
|
}
|
|
3970
3967
|
_pushWithSpills(t, e) {
|
|
3971
3968
|
t.push(e);
|
|
@@ -4022,7 +4019,7 @@ var wo = class extends ct {
|
|
|
4022
4019
|
for (let t = 0; t < a.length; t++) {
|
|
4023
4020
|
const e = a[t];
|
|
4024
4021
|
if (void 0 === e?.colStart) continue;
|
|
4025
|
-
const n = e.scope, o = _(n), s =
|
|
4022
|
+
const n = e.scope, o = _(n), s = xt(e, r.rowStart + I, r.colStart + y), l = xt(e, r.rowStart + v, r.colStart + x), i = {
|
|
4026
4023
|
colStart: Math.max(Math.min(s.colStart, l.colStart), o.colStart),
|
|
4027
4024
|
rowStart: Math.max(Math.min(s.rowStart, l.rowStart), o.rowStart),
|
|
4028
4025
|
colEnd: Math.min(Math.max(s.colEnd, l.colEnd), o.colEnd),
|
|
@@ -4033,7 +4030,7 @@ var wo = class extends ct {
|
|
|
4033
4030
|
}
|
|
4034
4031
|
f.push(...C);
|
|
4035
4032
|
}
|
|
4036
|
-
return f =
|
|
4033
|
+
return f = ne(f, 2, t.Row), f.sort(o.rowFirstRangeComparator), f;
|
|
4037
4034
|
}
|
|
4038
4035
|
_directAcrossGrids(t, e) {
|
|
4039
4036
|
const n = this._gridId, o = t.scope, s = o && o !== n ? this._container.getGrid(o) ?? null : this;
|
|
@@ -4054,11 +4051,11 @@ var wo = class extends ct {
|
|
|
4054
4051
|
return i;
|
|
4055
4052
|
}
|
|
4056
4053
|
getDependentsAt(t) {
|
|
4057
|
-
const e =
|
|
4054
|
+
const e = Rt(t, (t) => this._directAcrossGrids(t, !0));
|
|
4058
4055
|
return e.sort(o.rowFirstRangeComparator), e;
|
|
4059
4056
|
}
|
|
4060
4057
|
getPrecedentsAt(t) {
|
|
4061
|
-
const e =
|
|
4058
|
+
const e = Rt(t, (t) => this._directAcrossGrids(t, !1));
|
|
4062
4059
|
return e.sort(o.rowFirstRangeComparator), e;
|
|
4063
4060
|
}
|
|
4064
4061
|
_graphNeighborsNow(t, e, n) {
|
|
@@ -4169,16 +4166,16 @@ var wo = class extends ct {
|
|
|
4169
4166
|
if ("scalar" === o) {
|
|
4170
4167
|
let o = t.evaluateAt(e, n, r);
|
|
4171
4168
|
if (o && void 0 !== o.colStart) o = t.finalizeValue(o);
|
|
4172
|
-
else if (
|
|
4173
|
-
const s =
|
|
4169
|
+
else if (X(o)) return t.finalizeValue(o);
|
|
4170
|
+
const s = zt(o, this._context);
|
|
4174
4171
|
return null === s ? 0 : s;
|
|
4175
4172
|
}
|
|
4176
|
-
return
|
|
4173
|
+
return ln(t.finalizeValue(t.evaluateAt(e, n, r)));
|
|
4177
4174
|
}
|
|
4178
4175
|
_setReferenceNow(t, e, n, r) {
|
|
4179
4176
|
const o = this._formulaAt(t, e);
|
|
4180
4177
|
let s = r;
|
|
4181
|
-
r && void 0 !== r.colStart ? s =
|
|
4178
|
+
r && void 0 !== r.colStart ? s = G(s, t, e) : r && void 0 !== r.colIndex && (s = T(s, t, e));
|
|
4182
4179
|
const l = o.value.formula.setReferenceAt(n, s).getTextAt(t, e);
|
|
4183
4180
|
return this._land(void 0, () => {
|
|
4184
4181
|
l ? this._setInputsNow(null, [{
|
|
@@ -4210,8 +4207,8 @@ var wo = class extends ct {
|
|
|
4210
4207
|
return null !== o && 0 !== (o.state & Hn);
|
|
4211
4208
|
}
|
|
4212
4209
|
_formulaAt(t, e) {
|
|
4213
|
-
|
|
4214
|
-
const n = this._container.getFormulas().search(
|
|
4210
|
+
Ao.colStart = e, Ao.rowStart = t, Ao.colEnd = e, Ao.rowEnd = t, Ao.scope = this._gridId, Fo.length = 0;
|
|
4211
|
+
const n = this._container.getFormulas().search(Ao, !1, !1, Fo);
|
|
4215
4212
|
return 0 === n.length ? null : n[0];
|
|
4216
4213
|
}
|
|
4217
4214
|
_createCopySpillEntries(t, e, n, r, o) {
|
|
@@ -4234,7 +4231,7 @@ var wo = class extends ct {
|
|
|
4234
4231
|
rowStart: u,
|
|
4235
4232
|
colEnd: o,
|
|
4236
4233
|
rowEnd: f,
|
|
4237
|
-
value: new
|
|
4234
|
+
value: new Yt(g, 0, e.value.getKind())
|
|
4238
4235
|
});
|
|
4239
4236
|
}
|
|
4240
4237
|
return {
|
|
@@ -4247,7 +4244,7 @@ var wo = class extends ct {
|
|
|
4247
4244
|
if (0 === o) return;
|
|
4248
4245
|
const s = this._container, l = n ?? this._gridId, i = null != n ? l : e ?? l, a = s.getScope();
|
|
4249
4246
|
a.gridId = i;
|
|
4250
|
-
const c = e ? s.getSymbols().resolve(
|
|
4247
|
+
const c = e ? s.getSymbols().resolve(de.Sheet, e)?.toString() : void 0, d = this._context;
|
|
4251
4248
|
for (let n = 0; n < o; n++) {
|
|
4252
4249
|
const o = t[n], h = o.value, u = h.ref, _ = h.formula.getTextAt(u.rowStart, u.colStart);
|
|
4253
4250
|
a.colIndex = u.colStart, a.rowIndex = u.rowStart;
|
|
@@ -4307,7 +4304,7 @@ var wo = class extends ct {
|
|
|
4307
4304
|
this._removeNow(n);
|
|
4308
4305
|
const a = this._container, c = a.getPrecedents().clone(), d = a.getFormulas().clone();
|
|
4309
4306
|
a.setPrecedents(c), a.setFormulas(d);
|
|
4310
|
-
const h =
|
|
4307
|
+
const h = ee(c, e, n);
|
|
4311
4308
|
h && (Po(d, c, h.formulas.inserts, h.formulas.removes), this._touchFormulas(h.formulas.removes), this._touchFormulas(h.formulas.inserts));
|
|
4312
4309
|
const u = { cutFrom: e }, _ = i.createCopiedEntries(e, n, u).inserts, f = _.length, g = this._gridId;
|
|
4313
4310
|
if (g !== l) {
|
|
@@ -4318,7 +4315,7 @@ var wo = class extends ct {
|
|
|
4318
4315
|
const f = h ? h.length : 0;
|
|
4319
4316
|
for (let n = 0; n < f; n++) {
|
|
4320
4317
|
const s = h[n];
|
|
4321
|
-
if (
|
|
4318
|
+
if (I.isError(s)) {
|
|
4322
4319
|
u = !1;
|
|
4323
4320
|
break;
|
|
4324
4321
|
}
|
|
@@ -4355,13 +4352,13 @@ var wo = class extends ct {
|
|
|
4355
4352
|
}
|
|
4356
4353
|
let p;
|
|
4357
4354
|
Po(d, c, _), this._touchFormulas(_);
|
|
4358
|
-
const
|
|
4355
|
+
const m = Ve(c, () => {
|
|
4359
4356
|
const t = a.getDynamics();
|
|
4360
4357
|
return p = new Map(t), p;
|
|
4361
4358
|
}, e, n);
|
|
4362
|
-
if (p && a.setDynamics(p),
|
|
4363
|
-
const t =
|
|
4364
|
-
if (e.scope !== n.scope && o.length > 0 && this._reanchorFormulas(o, n.scope, e.scope, !0), Po(d, c,
|
|
4359
|
+
if (p && a.setDynamics(p), m) {
|
|
4360
|
+
const t = m.edged ?? r.EmptyArray, o = t.length > 0 ? m.formulas.inserts.filter((e) => !t.includes(e)) : m.formulas.inserts;
|
|
4361
|
+
if (e.scope !== n.scope && o.length > 0 && this._reanchorFormulas(o, n.scope, e.scope, !0), Po(d, c, m.formulas.inserts, m.formulas.removes), this._touchFormulas(m.formulas.removes), this._touchFormulas(m.formulas.inserts), t.length > 0) {
|
|
4365
4362
|
const e = [];
|
|
4366
4363
|
for (let n = 0; n < t.length; n++) {
|
|
4367
4364
|
const r = t[n].value;
|
|
@@ -4373,16 +4370,16 @@ var wo = class extends ct {
|
|
|
4373
4370
|
a.markDirty(e);
|
|
4374
4371
|
}
|
|
4375
4372
|
}
|
|
4376
|
-
const
|
|
4377
|
-
t.values.copyTo(
|
|
4373
|
+
const S = this._values;
|
|
4374
|
+
t.values.copyTo(S, {
|
|
4378
4375
|
colIndex: n.colStart,
|
|
4379
4376
|
rowIndex: n.rowStart
|
|
4380
|
-
}, e),
|
|
4381
|
-
const
|
|
4377
|
+
}, e), be(this._errorSpatial, S, n);
|
|
4378
|
+
const w = t.spillSpatial;
|
|
4382
4379
|
let y = [], v = [];
|
|
4383
4380
|
for (let t = 0; t < f; t++) {
|
|
4384
4381
|
const n = _[t];
|
|
4385
|
-
this._createCopySpillEntries(
|
|
4382
|
+
this._createCopySpillEntries(w, e, n, y, v);
|
|
4386
4383
|
}
|
|
4387
4384
|
const x = [];
|
|
4388
4385
|
if (y.length > 0) {
|
|
@@ -4390,7 +4387,7 @@ var wo = class extends ct {
|
|
|
4390
4387
|
const t = (t, e) => {
|
|
4391
4388
|
t && this._notifySpillsInsert.push(t), e && this._notifySpillsRemove.push(e);
|
|
4392
4389
|
};
|
|
4393
|
-
|
|
4390
|
+
Ct(a.getCycleId(), v, r.EmptyArray, s._contentfulSpatial, s._spillSpatial, s._values, (t, e, n, r) => {
|
|
4394
4391
|
x.push({
|
|
4395
4392
|
colStart: t,
|
|
4396
4393
|
rowStart: e,
|
|
@@ -4398,7 +4395,7 @@ var wo = class extends ct {
|
|
|
4398
4395
|
rowEnd: r,
|
|
4399
4396
|
scope: g
|
|
4400
4397
|
});
|
|
4401
|
-
}, s._notifyValues, t, s._notifyCalcStatus, s._errorSpatial, s._values.getAxis() !==
|
|
4398
|
+
}, s._notifyValues, t, s._notifyCalcStatus, s._errorSpatial, s._values.getAxis() !== E.Axis.Row, !1, s._circularSpatial);
|
|
4402
4399
|
}
|
|
4403
4400
|
const C = this.getEntireCoords();
|
|
4404
4401
|
a.markDirty([{
|
|
@@ -4436,9 +4433,9 @@ var wo = class extends ct {
|
|
|
4436
4433
|
}
|
|
4437
4434
|
}
|
|
4438
4435
|
e && (t = i.concat(e)), t.sort(o.columnFirstRangeComparator);
|
|
4439
|
-
const n = new
|
|
4436
|
+
const n = new j.Builder((t, e) => new L.ArrayList(t.slice(0, e)));
|
|
4440
4437
|
let r;
|
|
4441
|
-
const s = !0 === this._container.getDeferred?.()?.hasHolders(), a = this._values, c = a.getAxis() ===
|
|
4438
|
+
const s = !0 === this._container.getDeferred?.()?.hasHolders(), a = this._values, c = a.getAxis() === E.Axis.Column, d = t.length;
|
|
4442
4439
|
for (let e = 0; e < d; e++) {
|
|
4443
4440
|
const l = t[e];
|
|
4444
4441
|
f = o.unionRanges(f, l, xo);
|
|
@@ -4523,19 +4520,19 @@ var wo = class extends ct {
|
|
|
4523
4520
|
}
|
|
4524
4521
|
p && (_.spillRemoves = p, f = o.unionRangesArrays(p, f ?? void 0, xo));
|
|
4525
4522
|
}
|
|
4526
|
-
const
|
|
4527
|
-
if (
|
|
4523
|
+
const w = d.length;
|
|
4524
|
+
if (w > 0) {
|
|
4528
4525
|
const e = this._spillSpatial;
|
|
4529
4526
|
let n;
|
|
4530
|
-
for (let r =
|
|
4527
|
+
for (let r = w - 1; r >= 0; r--) {
|
|
4531
4528
|
const o = d[r], l = o.value;
|
|
4532
4529
|
if (!s && l.getCycleId() !== t) continue;
|
|
4533
4530
|
const i = e.search(o), a = i.length;
|
|
4534
4531
|
for (let e = 0; e < a; e++) {
|
|
4535
4532
|
let r = i[e];
|
|
4536
|
-
if (
|
|
4533
|
+
if (et(o.rowStart, o.colStart, r) && (s || r.value.getCycleId() === t)) {
|
|
4537
4534
|
m || (m = [], n = /* @__PURE__ */ new Set());
|
|
4538
|
-
const t =
|
|
4535
|
+
const t = Ee(r.colStart) + _t(r.rowStart);
|
|
4539
4536
|
if (n.has(t)) continue;
|
|
4540
4537
|
n.add(t);
|
|
4541
4538
|
const e = r.value.getBlockedCoords() ?? o;
|
|
@@ -4565,19 +4562,19 @@ var wo = class extends ct {
|
|
|
4565
4562
|
_setInputsNow(t, e, n, s) {
|
|
4566
4563
|
const l = this._gridId, i = this._container, a = this._context, c = i.getFormulas(), d = c.getSpatialAt(l);
|
|
4567
4564
|
let h = !!d && !d.isEmpty();
|
|
4568
|
-
const u = e ? e.length : 0, _ = this._values, f = _.getAxis() !==
|
|
4565
|
+
const u = e ? e.length : 0, _ = this._values, f = _.getAxis() !== E.Axis.Row, g = this._spillSpatial, p = this._errorSpatial, m = this._notifyCalcStatus.size(), S = this._contentfulSpatial, w = [];
|
|
4569
4566
|
let I, y, v, x = h ? [] : null;
|
|
4570
4567
|
if (t && t.tuples) {
|
|
4571
4568
|
I = t.tuples;
|
|
4572
4569
|
let e = t.bounds;
|
|
4573
|
-
if (e ? (y =
|
|
4570
|
+
if (e ? (y = oe(e, f), y.scope = l) : y = {
|
|
4574
4571
|
colStart: Number.MIN_SAFE_INTEGER,
|
|
4575
4572
|
rowStart: Number.MIN_SAFE_INTEGER,
|
|
4576
4573
|
colEnd: Number.MAX_SAFE_INTEGER,
|
|
4577
4574
|
rowEnd: Number.MAX_SAFE_INTEGER,
|
|
4578
4575
|
scope: l
|
|
4579
4576
|
}, x) {
|
|
4580
|
-
h &&
|
|
4577
|
+
h && w.push(y);
|
|
4581
4578
|
const t = {
|
|
4582
4579
|
majorStart: 0,
|
|
4583
4580
|
minorStart: 0,
|
|
@@ -4593,12 +4590,12 @@ var wo = class extends ct {
|
|
|
4593
4590
|
t.minorStart = n[0];
|
|
4594
4591
|
const r = n[1];
|
|
4595
4592
|
t.minorEnd = t.minorStart + r.length - 1;
|
|
4596
|
-
const s =
|
|
4593
|
+
const s = oe(t, f);
|
|
4597
4594
|
s.scope = l, x && c.search(s).length > 0 && x.push(s);
|
|
4598
4595
|
}
|
|
4599
4596
|
}
|
|
4600
4597
|
}
|
|
4601
|
-
v =
|
|
4598
|
+
v = se(t.tuples, f, l);
|
|
4602
4599
|
}
|
|
4603
4600
|
const C = (t, e) => {
|
|
4604
4601
|
t && this._notifySpillsInsert.push(t), e && this._notifySpillsRemove.push(e);
|
|
@@ -4606,30 +4603,30 @@ var wo = class extends ct {
|
|
|
4606
4603
|
if (n || I) {
|
|
4607
4604
|
let t;
|
|
4608
4605
|
n && (t = Kt(n, g, _, S, C, !1, !0, this._notifyValues, (t, e, n, r) => {
|
|
4609
|
-
|
|
4606
|
+
w.push({
|
|
4610
4607
|
colStart: t,
|
|
4611
4608
|
rowStart: e,
|
|
4612
4609
|
colEnd: n,
|
|
4613
4610
|
rowEnd: r,
|
|
4614
4611
|
scope: l
|
|
4615
4612
|
});
|
|
4616
|
-
})),
|
|
4617
|
-
|
|
4613
|
+
})), Ct(-1, n ? [n] : r.EmptyArray, v, S, g, _, (t, e, n, r) => {
|
|
4614
|
+
w.push({
|
|
4618
4615
|
colStart: t,
|
|
4619
4616
|
rowStart: e,
|
|
4620
4617
|
colEnd: n,
|
|
4621
4618
|
rowEnd: r,
|
|
4622
4619
|
scope: l
|
|
4623
4620
|
});
|
|
4624
|
-
}, this._notifyValues, C, this._notifyCalcStatus, p, f, !1, this._circularSpatial, this._calcStatusSpatial), n && (_.delete(n), Ht(p, n)), t?.(), I && (_.setValues(I),
|
|
4621
|
+
}, this._notifyValues, C, this._notifyCalcStatus, p, f, !1, this._circularSpatial, this._calcStatusSpatial), n && (_.delete(n), Ht(p, n)), t?.(), I && (_.setValues(I), xe(p, I, f));
|
|
4625
4622
|
}
|
|
4626
4623
|
const b = i.getScope();
|
|
4627
|
-
let
|
|
4624
|
+
let R, A, k, N, M;
|
|
4628
4625
|
const F = (t, e) => {
|
|
4629
4626
|
const n = t.rowStart, r = t.colStart;
|
|
4630
4627
|
b && (b.rowIndex = n, b.colIndex = r);
|
|
4631
4628
|
const o = i.createFormulaBlock(l, a, e, n, r), c = new no(t, l, o, i, this._unanchored), d = s?.arrayFixed;
|
|
4632
|
-
d && d.colStart === r && d.rowStart === n && (
|
|
4629
|
+
d && d.colStart === r && d.rowStart === n && (sn(c.getAnchorNode()).fixedRef = {
|
|
4633
4630
|
colStart: d.colStart,
|
|
4634
4631
|
rowStart: d.rowStart,
|
|
4635
4632
|
colEnd: d.colEnd,
|
|
@@ -4640,7 +4637,7 @@ var wo = class extends ct {
|
|
|
4640
4637
|
scope: l,
|
|
4641
4638
|
value: c
|
|
4642
4639
|
};
|
|
4643
|
-
|
|
4640
|
+
R || (R = []), R.push(h);
|
|
4644
4641
|
}, D = (t) => {
|
|
4645
4642
|
const e = {
|
|
4646
4643
|
...t,
|
|
@@ -4650,10 +4647,10 @@ var wo = class extends ct {
|
|
|
4650
4647
|
k.insertNonOverlapping(e, {
|
|
4651
4648
|
noMerge: !0,
|
|
4652
4649
|
onUpdates(t, e, n) {
|
|
4653
|
-
|
|
4650
|
+
A || (A = []);
|
|
4654
4651
|
for (let t = 0; t < e.length; t++) {
|
|
4655
4652
|
const n = e[t];
|
|
4656
|
-
if (
|
|
4653
|
+
if (A.push(n), M) for (let t = M.length - 1; t >= 0; t--) M[t].value === n.value && M.splice(t, 1);
|
|
4657
4654
|
}
|
|
4658
4655
|
const r = t ? t.length : 0;
|
|
4659
4656
|
for (let e = 0; e < r; e++) {
|
|
@@ -4665,7 +4662,7 @@ var wo = class extends ct {
|
|
|
4665
4662
|
}, T = x ? x.length : 0;
|
|
4666
4663
|
let G;
|
|
4667
4664
|
if (u > 0) {
|
|
4668
|
-
G =
|
|
4665
|
+
G = it(u);
|
|
4669
4666
|
for (let t = 0; t < u; t++) {
|
|
4670
4667
|
const n = e[t], r = n.value, s = o.sanitizeRange(n);
|
|
4671
4668
|
G[t] = s, null !== r && F(s, r);
|
|
@@ -4675,21 +4672,21 @@ var wo = class extends ct {
|
|
|
4675
4672
|
(T > 0 || u > 0) && (k = i.getFormulas().clone(B));
|
|
4676
4673
|
for (let t = 0; t < T; t++) D(x[t]);
|
|
4677
4674
|
for (let t = 0; t < u; t++) D(G[t]);
|
|
4678
|
-
const V =
|
|
4675
|
+
const V = A ? A.length : 0;
|
|
4679
4676
|
if (V > 0) {
|
|
4680
4677
|
const t = i.getDynamics();
|
|
4681
4678
|
let e = null;
|
|
4682
4679
|
for (let n = 0; n < V; n++) {
|
|
4683
|
-
const r =
|
|
4680
|
+
const r = A[n].value, o = t.get(r);
|
|
4684
4681
|
o && (N || (N = i.getPrecedents().clone(B)), N.removeAll(o, Go), e || (e = new Map(t)), e.delete(r));
|
|
4685
4682
|
}
|
|
4686
4683
|
e && i.setDynamics(e);
|
|
4687
4684
|
}
|
|
4688
4685
|
let O = [];
|
|
4689
|
-
if (
|
|
4690
|
-
N || (N = i.getPrecedents().clone(B)), Po(k, N,
|
|
4691
|
-
const t =
|
|
4692
|
-
|
|
4686
|
+
if (R || A) {
|
|
4687
|
+
N || (N = i.getPrecedents().clone(B)), Po(k, N, R, A), M && Lo(N, M, null);
|
|
4688
|
+
const t = R ? this._joinInserted(k, N, R, (t) => {
|
|
4689
|
+
w.push({
|
|
4693
4690
|
colStart: t.colStart,
|
|
4694
4691
|
rowStart: t.rowStart,
|
|
4695
4692
|
colEnd: t.colEnd,
|
|
@@ -4697,7 +4694,7 @@ var wo = class extends ct {
|
|
|
4697
4694
|
scope: l
|
|
4698
4695
|
});
|
|
4699
4696
|
}) : null;
|
|
4700
|
-
this._touchFormulas(
|
|
4697
|
+
this._touchFormulas(A), this._touchFormulas(R), this._touchFormulas(M), this._touchFormulas(t);
|
|
4701
4698
|
const e = M ? function(t, ...e) {
|
|
4702
4699
|
const n = [];
|
|
4703
4700
|
if (!t) return n;
|
|
@@ -4715,9 +4712,9 @@ var wo = class extends ct {
|
|
|
4715
4712
|
}
|
|
4716
4713
|
}
|
|
4717
4714
|
return n;
|
|
4718
|
-
}(
|
|
4719
|
-
|
|
4720
|
-
|
|
4715
|
+
}(A, x, G) : A;
|
|
4716
|
+
Ct(-1, e, R, S, g, _, (t, e, n, r) => {
|
|
4717
|
+
w.push({
|
|
4721
4718
|
colStart: t,
|
|
4722
4719
|
rowStart: e,
|
|
4723
4720
|
colEnd: n,
|
|
@@ -4726,8 +4723,8 @@ var wo = class extends ct {
|
|
|
4726
4723
|
});
|
|
4727
4724
|
}, this._notifyValues, C, this._notifyCalcStatus, p, f, !0, this._circularSpatial, this._calcStatusSpatial);
|
|
4728
4725
|
}
|
|
4729
|
-
if (N && i.setPrecedents(N), k && (
|
|
4730
|
-
const e =
|
|
4726
|
+
if (N && i.setPrecedents(N), k && (R || A || M) && i.setFormulas(k), R) for (let t = 0; t < R.length; t++) {
|
|
4727
|
+
const e = R[t];
|
|
4731
4728
|
O.push({
|
|
4732
4729
|
colStart: e.colStart,
|
|
4733
4730
|
rowStart: e.rowStart,
|
|
@@ -4736,8 +4733,8 @@ var wo = class extends ct {
|
|
|
4736
4733
|
scope: l
|
|
4737
4734
|
});
|
|
4738
4735
|
}
|
|
4739
|
-
if (
|
|
4740
|
-
const e =
|
|
4736
|
+
if (A) for (let t = 0; t < A.length; t++) {
|
|
4737
|
+
const e = A[t];
|
|
4741
4738
|
O.push({
|
|
4742
4739
|
colStart: e.colStart,
|
|
4743
4740
|
rowStart: e.rowStart,
|
|
@@ -4746,7 +4743,7 @@ var wo = class extends ct {
|
|
|
4746
4743
|
scope: l
|
|
4747
4744
|
});
|
|
4748
4745
|
}
|
|
4749
|
-
return this._notifyCalcStatus.size() !== m && (i.getDeferred?.()?.noteRepaint(l), i.requestCalculateGrid(l)),
|
|
4746
|
+
return this._notifyCalcStatus.size() !== m && (i.getDeferred?.()?.noteRepaint(l), i.requestCalculateGrid(l)), w.length > 0 && i.markDirty(w), O;
|
|
4750
4747
|
}
|
|
4751
4748
|
_rederivePrecedentsNow(t) {
|
|
4752
4749
|
const e = this._container, n = e.getPrecedents().clone();
|
|
@@ -4784,7 +4781,7 @@ var wo = class extends ct {
|
|
|
4784
4781
|
const s = n[o];
|
|
4785
4782
|
if (!a(s) || !d(s)) continue;
|
|
4786
4783
|
h = !1;
|
|
4787
|
-
const l =
|
|
4784
|
+
const l = Q(c, s, (t, e, n, r) => {
|
|
4788
4785
|
if (!a(t) || !a(e)) return;
|
|
4789
4786
|
const o = {
|
|
4790
4787
|
colStart: n.colStart,
|
|
@@ -4834,9 +4831,9 @@ var wo = class extends ct {
|
|
|
4834
4831
|
if (t.data) {
|
|
4835
4832
|
const e = t.data;
|
|
4836
4833
|
this._values.setValues(e);
|
|
4837
|
-
const n = this._values.getAxis() ===
|
|
4838
|
-
|
|
4839
|
-
const r =
|
|
4834
|
+
const n = this._values.getAxis() === E.Axis.Column;
|
|
4835
|
+
xe(this._errorSpatial, e, n);
|
|
4836
|
+
const r = se(e, n, this._gridId);
|
|
4840
4837
|
this._contentfulSpatial.load(r);
|
|
4841
4838
|
}
|
|
4842
4839
|
const e = this._gridId, n = this._container, r = n.getPrecedents(), o = n.getFormulas(), s = {
|
|
@@ -4848,31 +4845,31 @@ var wo = class extends ct {
|
|
|
4848
4845
|
if (c) {
|
|
4849
4846
|
const t = c.length;
|
|
4850
4847
|
for (let e = 0; e < t; e++) {
|
|
4851
|
-
const t = c[e], n = t[0], r =
|
|
4848
|
+
const t = c[e], n = t[0], r = Tt(n, s).split(":")[0];
|
|
4852
4849
|
d.add(r);
|
|
4853
|
-
const o =
|
|
4850
|
+
const o = vt(t, s);
|
|
4854
4851
|
o && h.add(`${o.rowStart},${o.colStart}`);
|
|
4855
4852
|
}
|
|
4856
4853
|
}
|
|
4857
|
-
const u = l.length, _ = new Array(u), f = [], g = n.getRuntime(), p = this._context,
|
|
4858
|
-
|
|
4859
|
-
const
|
|
4854
|
+
const u = l.length, _ = new Array(u), f = [], g = n.getRuntime(), p = this._context, m = n.getScope();
|
|
4855
|
+
m.colIndex = 0, m.rowIndex = 0, m.gridId = e;
|
|
4856
|
+
const S = n.isLegacyIntersect();
|
|
4860
4857
|
for (let t = 0; t < u; t++) {
|
|
4861
|
-
const r =
|
|
4858
|
+
const r = vt(l[t], s);
|
|
4862
4859
|
r.scope = e;
|
|
4863
4860
|
const o = r.value, i = r.rowStart, a = r.colStart;
|
|
4864
|
-
|
|
4865
|
-
const c =
|
|
4861
|
+
m.colIndex = a, m.rowIndex = i;
|
|
4862
|
+
const c = S && !(h.size > 0 && h.has(`${i},${a}`));
|
|
4866
4863
|
let u = n.createFormulaBlock(e, p, o, i, a, void 0, c);
|
|
4867
|
-
const g = u.resolvedPrecedentsAt(i, a, !0, Co, bo),
|
|
4868
|
-
1 ===
|
|
4869
|
-
const
|
|
4870
|
-
|
|
4864
|
+
const g = u.resolvedPrecedentsAt(i, a, !0, Co, bo), w = g.length;
|
|
4865
|
+
1 === w && (u = u.wrapImplicit(i, a, d));
|
|
4866
|
+
const E = new no(r, e, u, n, this._unanchored);
|
|
4867
|
+
E.fromLoad = !0, r.value = E, _[t] = r;
|
|
4871
4868
|
const y = r.rowEnd, v = r.colEnd - a, x = y - i, C = [], b = u.getReferences(i, a);
|
|
4872
|
-
for (let t = 0; t <
|
|
4869
|
+
for (let t = 0; t < w; t++) {
|
|
4873
4870
|
const n = g[t];
|
|
4874
|
-
if (
|
|
4875
|
-
const o =
|
|
4871
|
+
if (I.isError(n)) continue;
|
|
4872
|
+
const o = ye(b[t], bo[t], Co[t]), s = o.$absColEnd, l = o.$absRowEnd, i = {
|
|
4876
4873
|
colStart: n.colStart,
|
|
4877
4874
|
rowStart: n.rowStart,
|
|
4878
4875
|
colEnd: n.colEnd + (s ? 0 : v),
|
|
@@ -4895,31 +4892,31 @@ var wo = class extends ct {
|
|
|
4895
4892
|
if (o.load(_), r.load(f), n.bumpCalcEpochs(!0), i.formulaInserts = this._formulaRecords(_), c) {
|
|
4896
4893
|
const t = [], l = [], a = /* @__PURE__ */ new Map(), d = this._values, h = c.length;
|
|
4897
4894
|
for (let n = 0; n < h; n++) {
|
|
4898
|
-
const r =
|
|
4899
|
-
|
|
4900
|
-
const f = o.search(
|
|
4895
|
+
const r = vt(c[n], s), i = r.value ?? "dynamic", h = "error" === i, u = r.colStart, _ = r.rowStart;
|
|
4896
|
+
Ro.colStart = u, Ro.rowStart = _, Ro.colEnd = u, Ro.rowEnd = _, Ro.scope = e;
|
|
4897
|
+
const f = o.search(Ro);
|
|
4901
4898
|
if (1 !== f.length) continue;
|
|
4902
|
-
const p = f[0].value,
|
|
4899
|
+
const p = f[0].value, m = p.nodeAt(_, u), S = r.colEnd, w = r.rowEnd, E = {
|
|
4903
4900
|
colStart: u,
|
|
4904
4901
|
rowStart: _,
|
|
4905
|
-
colEnd:
|
|
4906
|
-
rowEnd:
|
|
4902
|
+
colEnd: S,
|
|
4903
|
+
rowEnd: w
|
|
4907
4904
|
};
|
|
4908
|
-
"fixed" === i && (
|
|
4905
|
+
"fixed" === i && (sn(m).fixedRef = E, p.densify()), m.cachedValue = h ? I.BuiltIn.Spill : new Re(g, d, E);
|
|
4909
4906
|
const y = {
|
|
4910
4907
|
colStart: u,
|
|
4911
4908
|
rowStart: _,
|
|
4912
|
-
colEnd:
|
|
4913
|
-
rowEnd:
|
|
4914
|
-
value: new
|
|
4909
|
+
colEnd: S,
|
|
4910
|
+
rowEnd: w,
|
|
4911
|
+
value: new Yt(E, 0, i)
|
|
4915
4912
|
};
|
|
4916
4913
|
l.push(y), t.push({
|
|
4917
4914
|
colStart: u,
|
|
4918
4915
|
rowStart: _,
|
|
4919
|
-
colEnd:
|
|
4920
|
-
rowEnd:
|
|
4916
|
+
colEnd: S,
|
|
4917
|
+
rowEnd: w,
|
|
4921
4918
|
value: i
|
|
4922
|
-
}),
|
|
4919
|
+
}), U(a, m, E, -2);
|
|
4923
4920
|
}
|
|
4924
4921
|
if (this._spillSpatial.load(l), a.size > 0) {
|
|
4925
4922
|
r.load(Array.from(a.values()).flat()), n.bumpCalcEpochs(!1);
|
|
@@ -4929,26 +4926,26 @@ var wo = class extends ct {
|
|
|
4929
4926
|
}
|
|
4930
4927
|
t.length > 0 && (i.spillInserts = t);
|
|
4931
4928
|
}
|
|
4932
|
-
let
|
|
4933
|
-
const
|
|
4929
|
+
let w = !1;
|
|
4930
|
+
const E = t.volatile, y = E ? E.length : 0;
|
|
4934
4931
|
if (y > 0) {
|
|
4935
4932
|
const t = n.getVolatiles(), e = (e) => {
|
|
4936
4933
|
t.add(e), e.state |= Hn, e.block.calcOnLoad = !0;
|
|
4937
4934
|
}, r = new Array(y);
|
|
4938
4935
|
for (let t = 0; t < y; t++) {
|
|
4939
|
-
const n =
|
|
4936
|
+
const n = E[t], l = H(n, s);
|
|
4940
4937
|
r[t] = { ...l };
|
|
4941
4938
|
const i = o.search(l), a = i.length;
|
|
4942
4939
|
for (let t = 0; t < a; t++) {
|
|
4943
4940
|
const n = i[t];
|
|
4944
|
-
|
|
4941
|
+
pt(n, l, e);
|
|
4945
4942
|
}
|
|
4946
4943
|
}
|
|
4947
|
-
this._markDirtyRegionsNow(r),
|
|
4944
|
+
this._markDirtyRegionsNow(r), w = !0;
|
|
4948
4945
|
}
|
|
4949
|
-
const v = this._contentfulSpatial,
|
|
4950
|
-
let
|
|
4951
|
-
const
|
|
4946
|
+
const v = this._contentfulSpatial, x = !v.isEmpty();
|
|
4947
|
+
let C = null;
|
|
4948
|
+
const b = {
|
|
4952
4949
|
rowStart: 0,
|
|
4953
4950
|
colStart: 0,
|
|
4954
4951
|
rowEnd: 0,
|
|
@@ -4960,23 +4957,23 @@ var wo = class extends ct {
|
|
|
4960
4957
|
if (!e) continue;
|
|
4961
4958
|
const n = (e.rowEnd - e.rowStart + 1) * (e.colEnd - e.colStart + 1);
|
|
4962
4959
|
let r = 0;
|
|
4963
|
-
if (
|
|
4964
|
-
|
|
4965
|
-
const t = v.search(
|
|
4960
|
+
if (x) {
|
|
4961
|
+
b.rowStart = e.rowStart, b.colStart = e.colStart, b.rowEnd = e.rowEnd, b.colEnd = e.colEnd;
|
|
4962
|
+
const t = v.search(b);
|
|
4966
4963
|
for (let n = 0; n < t.length; n++) {
|
|
4967
4964
|
const o = t[n];
|
|
4968
4965
|
r += (Math.min(o.rowEnd, e.rowEnd) - Math.max(o.rowStart, e.rowStart) + 1) * (Math.min(o.colEnd, e.colEnd) - Math.max(o.colStart, e.colStart) + 1);
|
|
4969
4966
|
}
|
|
4970
4967
|
}
|
|
4971
4968
|
const o = r < n && !this._isSavedSpill(e);
|
|
4972
|
-
o && (e.value.uncalculated = !0), (o || e.value?.getError()) && (
|
|
4969
|
+
o && (e.value.uncalculated = !0), (o || e.value?.getError()) && (C ??= []).push({
|
|
4973
4970
|
rowStart: e.rowStart,
|
|
4974
4971
|
colStart: e.colStart,
|
|
4975
4972
|
rowEnd: e.rowEnd,
|
|
4976
4973
|
colEnd: e.colEnd
|
|
4977
4974
|
});
|
|
4978
4975
|
}
|
|
4979
|
-
if (
|
|
4976
|
+
if (C && (this._markDirtyRegionsNow(C), w = !0), a && u > 0) {
|
|
4980
4977
|
const t = new Array(u);
|
|
4981
4978
|
for (let e = 0; e < u; e++) {
|
|
4982
4979
|
const n = _[e];
|
|
@@ -4987,9 +4984,9 @@ var wo = class extends ct {
|
|
|
4987
4984
|
colEnd: n.colEnd
|
|
4988
4985
|
};
|
|
4989
4986
|
}
|
|
4990
|
-
this._markDirtyRegionsNow(t),
|
|
4987
|
+
this._markDirtyRegionsNow(t), w = !0;
|
|
4991
4988
|
}
|
|
4992
|
-
|
|
4989
|
+
w && (n.isLoading() ? n.requestCalculateGrid(e) : this.calculate());
|
|
4993
4990
|
}
|
|
4994
4991
|
} catch (t) {
|
|
4995
4992
|
throw t;
|
|
@@ -5019,7 +5016,7 @@ var wo = class extends ct {
|
|
|
5019
5016
|
}
|
|
5020
5017
|
_toJSONNow(e) {
|
|
5021
5018
|
let n = this._container.getFormulas().getSpatialAt(this._gridId)?.all(), r = n ? n.length : 0;
|
|
5022
|
-
r > 0 && (n =
|
|
5019
|
+
r > 0 && (n = ot(n, t.Column, 2, Bo), n.sort(o.rowFirstRangeComparator)), r = n ? n.length : 0;
|
|
5023
5020
|
const s = this._hiddenRows, l = this._hiddenColumns, i = this._filtered;
|
|
5024
5021
|
if (0 === r && !s && !l && !i) return null;
|
|
5025
5022
|
const a = {};
|
|
@@ -5036,7 +5033,7 @@ var wo = class extends ct {
|
|
|
5036
5033
|
if (d > 0) {
|
|
5037
5034
|
const t = this.getEntireCoords(), e = new Array(d);
|
|
5038
5035
|
for (let n = 0; n < d; n++) {
|
|
5039
|
-
const r = c[n], o =
|
|
5036
|
+
const r = c[n], o = ie(r, t);
|
|
5040
5037
|
e[n] = [o, r.value.getKind()];
|
|
5041
5038
|
}
|
|
5042
5039
|
a.formulaArray = e;
|
|
@@ -5046,7 +5043,7 @@ var wo = class extends ct {
|
|
|
5046
5043
|
if (h.size > 0) {
|
|
5047
5044
|
const t = h.values();
|
|
5048
5045
|
let e = t.next();
|
|
5049
|
-
const n = this._values.getAxis() ===
|
|
5046
|
+
const n = this._values.getAxis() === E.Axis.Column, r = z(!0);
|
|
5050
5047
|
for (; !e.done;) {
|
|
5051
5048
|
const o = e.value;
|
|
5052
5049
|
if (e = t.next(), o.gridId !== u) continue;
|
|
@@ -5070,14 +5067,14 @@ var wo = class extends ct {
|
|
|
5070
5067
|
}
|
|
5071
5068
|
};
|
|
5072
5069
|
f.isEmpty() || n(f.all());
|
|
5073
|
-
const r = g.isEmpty() ? [] : g.all().filter((t) => t.value ===
|
|
5074
|
-
r.length > 0 && n(r), p.length > 0 && n(p), _ =
|
|
5070
|
+
const r = g.isEmpty() ? [] : g.all().filter((t) => t.value === re.CalcStatus.Working);
|
|
5071
|
+
r.length > 0 && n(r), p.length > 0 && n(p), _ = ot(e, t.Column, 2);
|
|
5075
5072
|
}
|
|
5076
5073
|
const m = _ ? _.length : 0;
|
|
5077
5074
|
if (m > 0) {
|
|
5078
5075
|
const t = new Array(m);
|
|
5079
5076
|
for (let e = 0; e < m; e++) {
|
|
5080
|
-
const n = _[e], r =
|
|
5077
|
+
const n = _[e], r = ie(n, this.getEntireCoords());
|
|
5081
5078
|
t[e] = r;
|
|
5082
5079
|
}
|
|
5083
5080
|
a.volatile = t;
|
|
@@ -5097,13 +5094,13 @@ var wo = class extends ct {
|
|
|
5097
5094
|
colStart: 0,
|
|
5098
5095
|
rowEnd: 0,
|
|
5099
5096
|
colEnd: 0
|
|
5100
|
-
}, Co = [], bo = [],
|
|
5097
|
+
}, Co = [], bo = [], Ro = {
|
|
5101
5098
|
colStart: 0,
|
|
5102
5099
|
rowStart: 0,
|
|
5103
5100
|
colEnd: 0,
|
|
5104
5101
|
rowEnd: 0,
|
|
5105
5102
|
scope: null
|
|
5106
|
-
},
|
|
5103
|
+
}, Ao = {
|
|
5107
5104
|
colStart: 0,
|
|
5108
5105
|
rowStart: 0,
|
|
5109
5106
|
colEnd: 0,
|
|
@@ -5177,7 +5174,7 @@ function Lo(t, e, n) {
|
|
|
5177
5174
|
for (let e = 0; e < d; e++) {
|
|
5178
5175
|
const n = c[e];
|
|
5179
5176
|
if (null === n) continue;
|
|
5180
|
-
if (
|
|
5177
|
+
if (I.isError(n)) continue;
|
|
5181
5178
|
ko.rowStart = n.rowStart, ko.colStart = n.colStart, ko.rowEnd = n.rowEnd, ko.colEnd = n.colEnd, ko.scope = n.scope ?? r.scope, To.length = 0;
|
|
5182
5179
|
const o = t.search(ko, !1, !1, To), s = o.length;
|
|
5183
5180
|
for (let e = 0; e < s; e++) {
|
|
@@ -5191,25 +5188,25 @@ function Lo(t, e, n) {
|
|
|
5191
5188
|
const s = [];
|
|
5192
5189
|
for (let t = 0; t < o; t++) {
|
|
5193
5190
|
const n = e[t], r = [], o = s.length;
|
|
5194
|
-
|
|
5191
|
+
Qt(n, s, r), s.length > o && (n.value.registeredPrecedents = s.slice(o));
|
|
5195
5192
|
}
|
|
5196
5193
|
t.load(s);
|
|
5197
5194
|
}
|
|
5198
5195
|
To.fill(null, 0, 10);
|
|
5199
5196
|
var $o = (t) => {
|
|
5200
5197
|
let e = !1;
|
|
5201
|
-
if (
|
|
5202
|
-
if (e || t instanceof
|
|
5198
|
+
if (b.forEachLeaf(t, (t, n, r, o) => {
|
|
5199
|
+
if (e || t instanceof lt) return;
|
|
5203
5200
|
let s = n + o - r;
|
|
5204
5201
|
!0 === t.isIRepeatingList && (s = Math.min(s, n + t.getPeriod() - 1));
|
|
5205
|
-
for (let r = n; !e && r <= s; r++) e =
|
|
5202
|
+
for (let r = n; !e && r <= s; r++) e = kt(t.at(r));
|
|
5206
5203
|
}), !e) return t;
|
|
5207
5204
|
const n = t.length, r = new Array(n);
|
|
5208
|
-
for (let e = 0; e < n; e++) r[e] =
|
|
5209
|
-
return new
|
|
5205
|
+
for (let e = 0; e < n; e++) r[e] = ct(t.at(e));
|
|
5206
|
+
return new L.ArrayList(r);
|
|
5210
5207
|
}, Ho = (t, e, n) => {
|
|
5211
5208
|
const r = n?.fetchedFrom;
|
|
5212
|
-
if (!t) return new
|
|
5209
|
+
if (!t) return new R({
|
|
5213
5210
|
source: { buffer: e },
|
|
5214
5211
|
fetchedFrom: r
|
|
5215
5212
|
});
|
|
@@ -5228,7 +5225,7 @@ var $o = (t) => {
|
|
|
5228
5225
|
this.isOpen() && (this.latest = void 0 === t ? null : this._normalize(t, e), this.state = 1, this._moved(), this._final());
|
|
5229
5226
|
}
|
|
5230
5227
|
reject(t) {
|
|
5231
|
-
this.isOpen() && (this.latest =
|
|
5228
|
+
this.isOpen() && (this.latest = I.isError(t) ? t : new I.Value("The call failed", { cause: t }), this.state = 2, this._moved(), this._final());
|
|
5232
5229
|
}
|
|
5233
5230
|
onCancel(t) {
|
|
5234
5231
|
(this._onCancel ??= []).push(t);
|
|
@@ -5250,18 +5247,18 @@ var $o = (t) => {
|
|
|
5250
5247
|
}
|
|
5251
5248
|
}
|
|
5252
5249
|
_moved() {
|
|
5253
|
-
|
|
5250
|
+
Ft(), this._onMoved?.(this);
|
|
5254
5251
|
}
|
|
5255
5252
|
_final() {
|
|
5256
5253
|
const t = this._onFinal;
|
|
5257
5254
|
this._onFinal = null, t?.(this);
|
|
5258
5255
|
}
|
|
5259
|
-
}, Ko = (t) => t, qo = (t, e) =>
|
|
5256
|
+
}, Ko = (t) => t, qo = (t, e) => J.fromJSON({
|
|
5260
5257
|
type: t,
|
|
5261
5258
|
data: e
|
|
5262
|
-
}), Uo = (t, e) => globalThis.fetch(t, e),
|
|
5259
|
+
}), Uo = (t, e) => globalThis.fetch(t, e), Xo = () => {
|
|
5263
5260
|
throw new Error("getFormulaContext() needs a workbook being calculated");
|
|
5264
|
-
},
|
|
5261
|
+
}, Wo = () => Promise.reject(/* @__PURE__ */ new Error("parseText() needs a workbook being calculated")), Jo = (t, e) => Ho(null, t, e), Qo = class {
|
|
5265
5262
|
constructor(t, e, n, r = null, o = 100, s = Ko, l, i = null) {
|
|
5266
5263
|
this._nextId = 1, this._calls = /* @__PURE__ */ new Map(), this._holders = !1, this._current = [], this._made = [], this._batch = /* @__PURE__ */ new Map(), this._states = /* @__PURE__ */ new Map(), this._moved = /* @__PURE__ */ new Set(), this._settleTimer = null, this._settledAt = 0, this._repaintGrids = /* @__PURE__ */ new Set(), this._settleDirty = [], this._serving = !1, this._external = !1, this.previous = void 0, this._waiters = /* @__PURE__ */ new Set(), this._scope = t, this._onCountsChange = i, this._heldAt = e, this._getRandom = n, this._onSettle = r, this._settleWindow = o, this._normalize = s;
|
|
5267
5264
|
const a = this._moved;
|
|
@@ -5282,8 +5279,8 @@ var $o = (t) => {
|
|
|
5282
5279
|
createRichData: l?.createRichData ?? qo,
|
|
5283
5280
|
addResource: l?.addResource ?? Jo,
|
|
5284
5281
|
fetch: l?.fetch ?? Uo,
|
|
5285
|
-
getFormulaContext: l?.getFormulaContext ??
|
|
5286
|
-
parseText: l?.parseText ??
|
|
5282
|
+
getFormulaContext: l?.getFormulaContext ?? Xo,
|
|
5283
|
+
parseText: l?.parseText ?? Wo
|
|
5287
5284
|
};
|
|
5288
5285
|
const h = this._deferContext.fetch;
|
|
5289
5286
|
this._reloadContext = {
|
|
@@ -5372,7 +5369,7 @@ var $o = (t) => {
|
|
|
5372
5369
|
}, t);
|
|
5373
5370
|
}
|
|
5374
5371
|
newHolder(t, e) {
|
|
5375
|
-
return this._holders = !0, new
|
|
5372
|
+
return this._holders = !0, new Gt(t, e.calls, e.direct);
|
|
5376
5373
|
}
|
|
5377
5374
|
defer(t, e, n = null, r = !1) {
|
|
5378
5375
|
const o = this._scope, s = o.deferOrdinal++;
|
|
@@ -5448,7 +5445,7 @@ var $o = (t) => {
|
|
|
5448
5445
|
const e = this._scope, n = e.node;
|
|
5449
5446
|
if (!n || !this._holders || !e.gridId) return;
|
|
5450
5447
|
let r = this._heldAt(e.gridId, e.rowIndex, e.colIndex);
|
|
5451
|
-
return null === r &&
|
|
5448
|
+
return null === r && kt(n.cachedValue) && (r = n.cachedValue), null !== r ? r.calls[t] : void 0;
|
|
5452
5449
|
}
|
|
5453
5450
|
}, Yo = (t, e) => {
|
|
5454
5451
|
for (const n of t) n.isOpen() && n.reject(e);
|
|
@@ -5534,7 +5531,7 @@ var $o = (t) => {
|
|
|
5534
5531
|
hasErrorIn(t, e, n, r) {
|
|
5535
5532
|
for (let o = 0; o < this.size; o++) {
|
|
5536
5533
|
const s = this._order[o];
|
|
5537
|
-
if (!
|
|
5534
|
+
if (!I.isError(this._values[s])) continue;
|
|
5538
5535
|
const l = this._keys[s], i = Math.floor(l / ns), a = l - i * ns;
|
|
5539
5536
|
if (i >= t && i <= n && a >= e && a <= r) return !0;
|
|
5540
5537
|
}
|
|
@@ -5542,7 +5539,7 @@ var $o = (t) => {
|
|
|
5542
5539
|
}
|
|
5543
5540
|
_grow() {
|
|
5544
5541
|
const t = this._keys, e = this._values, n = this._order, r = this.size, o = Math.max(64, 2 * (this._mask + 1));
|
|
5545
|
-
this._keys = new Float64Array(o).fill(-1), this._values =
|
|
5542
|
+
this._keys = new Float64Array(o).fill(-1), this._values = ue(o), this._order = new Int32Array(o), this._mask = o - 1;
|
|
5546
5543
|
for (let o = 0; o < r; o++) {
|
|
5547
5544
|
const r = t[n[o]], s = Math.floor(r / ns), l = this._slotOf(s, r - s * ns, r);
|
|
5548
5545
|
this._keys[l] = r, this._values[l] = e[n[o]], this._order[o] = l;
|
|
@@ -5550,7 +5547,7 @@ var $o = (t) => {
|
|
|
5550
5547
|
}
|
|
5551
5548
|
}, ss = class {
|
|
5552
5549
|
constructor(t, e, n) {
|
|
5553
|
-
this._pending = new os(), this._unobserved = 0, this.observed = !1, this._errors = 0, this._uncovered = !1, this._coverChecked = 0, this._substitutedFrom = 0, this._rowStart = Number.MAX_SAFE_INTEGER, this._rowEnd = -1, this._colStart = Number.MAX_SAFE_INTEGER, this._colEnd = -1, this._demand = /* @__PURE__ */ new Map(), this._demandErrors = 0, this._demandRowStart = Number.MAX_SAFE_INTEGER, this._demandRowEnd = -1, this._demandColStart = Number.MAX_SAFE_INTEGER, this._demandColEnd = -1, this._anyRowStart = Number.MAX_SAFE_INTEGER, this._anyRowEnd = -1, this._anyColStart = Number.MAX_SAFE_INTEGER, this._anyColEnd = -1, this._inner = t, this._committed = e, this._flush = n, this._isColumn = t.getAxis() ===
|
|
5550
|
+
this._pending = new os(), this._unobserved = 0, this.observed = !1, this._errors = 0, this._uncovered = !1, this._coverChecked = 0, this._substitutedFrom = 0, this._rowStart = Number.MAX_SAFE_INTEGER, this._rowEnd = -1, this._colStart = Number.MAX_SAFE_INTEGER, this._colEnd = -1, this._demand = /* @__PURE__ */ new Map(), this._demandErrors = 0, this._demandRowStart = Number.MAX_SAFE_INTEGER, this._demandRowEnd = -1, this._demandColStart = Number.MAX_SAFE_INTEGER, this._demandColEnd = -1, this._anyRowStart = Number.MAX_SAFE_INTEGER, this._anyRowEnd = -1, this._anyColStart = Number.MAX_SAFE_INTEGER, this._anyColEnd = -1, this._inner = t, this._committed = e, this._flush = n, this._isColumn = t.getAxis() === E.Axis.Column;
|
|
5554
5551
|
}
|
|
5555
5552
|
get isPendingOverlay() {
|
|
5556
5553
|
return !0;
|
|
@@ -5567,20 +5564,20 @@ var $o = (t) => {
|
|
|
5567
5564
|
push(t, e, n) {
|
|
5568
5565
|
if (this.observed) {
|
|
5569
5566
|
const r = this._pending.set(t, e, n ?? null);
|
|
5570
|
-
void 0 !== r &&
|
|
5567
|
+
void 0 !== r && I.isError(r) && this._errors--, I.isError(n) && this._errors++;
|
|
5571
5568
|
} else this._unobserved++;
|
|
5572
5569
|
t < this._rowStart && (this._rowStart = t), t > this._rowEnd && (this._rowEnd = t), e < this._colStart && (this._colStart = e), e > this._colEnd && (this._colEnd = e), this._growAny(t, e);
|
|
5573
5570
|
}
|
|
5574
5571
|
pushDemand(t, e, n) {
|
|
5575
5572
|
n = n ?? null;
|
|
5576
5573
|
const r = rs(t, e), o = this._demand, s = o.get(r);
|
|
5577
|
-
void 0 !== s &&
|
|
5574
|
+
void 0 !== s && I.isError(s) && this._demandErrors--, I.isError(n) && this._demandErrors++, o.set(r, n), void 0 === this._inner.getValueAt(t, e) && this._inner.setValueAt(t, e, n), t < this._demandRowStart && (this._demandRowStart = t), t > this._demandRowEnd && (this._demandRowEnd = t), e < this._demandColStart && (this._demandColStart = e), e > this._demandColEnd && (this._demandColEnd = e), this._growAny(t, e);
|
|
5578
5575
|
}
|
|
5579
5576
|
takeDemand(t, e) {
|
|
5580
5577
|
const n = this._demand;
|
|
5581
5578
|
if (0 === n.size) return;
|
|
5582
5579
|
const r = rs(t, e), o = n.get(r);
|
|
5583
|
-
void 0 !== o && (
|
|
5580
|
+
void 0 !== o && (I.isError(o) && this._demandErrors--, n.delete(r), 0 === n.size && this._resetDemand());
|
|
5584
5581
|
}
|
|
5585
5582
|
commitDemand() {
|
|
5586
5583
|
0 !== this._demand.size && (this._writeDemandIn(null), this._demand.clear(), this._resetDemand());
|
|
@@ -5610,7 +5607,7 @@ var $o = (t) => {
|
|
|
5610
5607
|
const e = t.rowStart, n = t.colStart, r = t.rowEnd, o = t.colEnd;
|
|
5611
5608
|
return this._unobserved > 0 && this._pendingIntersects(e, n, r, o) && this.observe(), this._committed.hasErrorIn(t) ? !this.intersects(e, n, r, o) || ls(this, t) : !!(this._errors > 0 && this._pendingIntersects(e, n, r, o) && this._pending.hasErrorIn(e, n, r, o)) || this._demandErrors > 0 && e <= this._demandRowEnd && r >= this._demandRowStart && n <= this._demandColEnd && o >= this._demandColStart && function(t, e, n, r, o) {
|
|
5612
5609
|
for (const [s, l] of t) {
|
|
5613
|
-
if (!
|
|
5610
|
+
if (!I.isError(l)) continue;
|
|
5614
5611
|
const t = Math.floor(s / ns), i = s - t * ns;
|
|
5615
5612
|
if (t >= e && t <= r && i >= n && i <= o) return !0;
|
|
5616
5613
|
}
|
|
@@ -5785,7 +5782,7 @@ var $o = (t) => {
|
|
|
5785
5782
|
};
|
|
5786
5783
|
function ls(t, e) {
|
|
5787
5784
|
const n = t.values({ bounds: e });
|
|
5788
|
-
for (let t = n.next(); !t.done; t = n.next()) if (
|
|
5785
|
+
for (let t = n.next(); !t.done; t = n.next()) if (I.isError(t.value)) return !0;
|
|
5789
5786
|
return !1;
|
|
5790
5787
|
}
|
|
5791
5788
|
var is = {
|
|
@@ -5809,7 +5806,7 @@ var is = {
|
|
|
5809
5806
|
}
|
|
5810
5807
|
}, fs = (t, e, n) => n === t.nodes[0].gridId && e.rowStart <= t.rowMax && e.rowEnd >= t.rowMin && e.colStart <= t.colMax && e.colEnd >= t.colMin, gs = 32768, ps = (t, e) => t * gs + e, ms = class {
|
|
5811
5808
|
constructor(t, e) {
|
|
5812
|
-
this._map = /* @__PURE__ */ new Map(), this._errors = 0, this._rowStart = Number.MAX_SAFE_INTEGER, this._rowEnd = -1, this._colStart = Number.MAX_SAFE_INTEGER, this._colEnd = -1, this._inner = t, this._committed = e, this._isColumn = t.getAxis() ===
|
|
5809
|
+
this._map = /* @__PURE__ */ new Map(), this._errors = 0, this._rowStart = Number.MAX_SAFE_INTEGER, this._rowEnd = -1, this._colStart = Number.MAX_SAFE_INTEGER, this._colEnd = -1, this._inner = t, this._committed = e, this._isColumn = t.getAxis() === E.Axis.Column;
|
|
5813
5810
|
}
|
|
5814
5811
|
get isWhatIfLayer() {
|
|
5815
5812
|
return !0;
|
|
@@ -5822,7 +5819,7 @@ var is = {
|
|
|
5822
5819
|
}
|
|
5823
5820
|
set(t, e, n) {
|
|
5824
5821
|
const r = ps(t, e), o = this._map, s = o.get(r);
|
|
5825
|
-
void 0 !== s &&
|
|
5822
|
+
void 0 !== s && I.isError(s) && this._errors--, I.isError(n) && this._errors++, o.set(r, n ?? null), t < this._rowStart && (this._rowStart = t), t > this._rowEnd && (this._rowEnd = t), e < this._colStart && (this._colStart = e), e > this._colEnd && (this._colEnd = e);
|
|
5826
5823
|
}
|
|
5827
5824
|
clear() {
|
|
5828
5825
|
0 !== this._map.size && (this._map.clear(), this._errors = 0, this._rowStart = Number.MAX_SAFE_INTEGER, this._rowEnd = -1, this._colStart = Number.MAX_SAFE_INTEGER, this._colEnd = -1);
|
|
@@ -5837,7 +5834,7 @@ var is = {
|
|
|
5837
5834
|
}
|
|
5838
5835
|
if (0 === this._errors || !this.intersects(t.rowStart, t.colStart, t.rowEnd, t.colEnd)) return !1;
|
|
5839
5836
|
for (const [e, n] of this._map) {
|
|
5840
|
-
if (!
|
|
5837
|
+
if (!I.isError(n)) continue;
|
|
5841
5838
|
const r = Math.floor(e / gs), o = e - r * gs;
|
|
5842
5839
|
if (r >= t.rowStart && r <= t.rowEnd && o >= t.colStart && o <= t.colEnd) return !0;
|
|
5843
5840
|
}
|
|
@@ -5936,7 +5933,7 @@ var is = {
|
|
|
5936
5933
|
const e = this.getRuns(t ? { bounds: t } : void 0);
|
|
5937
5934
|
let n = e.next();
|
|
5938
5935
|
if (n.done) return null;
|
|
5939
|
-
const r = new
|
|
5936
|
+
const r = new j.Builder();
|
|
5940
5937
|
for (; !n.done;) r.pushMultipleAt(n.value[0], n.value[1], n.value[2]), n = e.next();
|
|
5941
5938
|
return r.build();
|
|
5942
5939
|
}
|
|
@@ -6228,7 +6225,7 @@ var Es = class {
|
|
|
6228
6225
|
}, this._passHook = (t, e, n, r, o, s) => this._onPassRead(t, e, n, r, o, !0 === s), this._taintDownstream = (t) => {
|
|
6229
6226
|
if (0 !== (t.state & qn)) return;
|
|
6230
6227
|
t.state = t.state & ~Kn | $n | sr | ir;
|
|
6231
|
-
const e =
|
|
6228
|
+
const e = sn(t);
|
|
6232
6229
|
e.cycleGroup = this._taintGroup, e.demandValue = Ys(t), this._addCircular(t);
|
|
6233
6230
|
};
|
|
6234
6231
|
}
|
|
@@ -6284,15 +6281,15 @@ var Es = class {
|
|
|
6284
6281
|
};
|
|
6285
6282
|
const b = /* @__PURE__ */ new Map();
|
|
6286
6283
|
this._addDynamicPrecedent = (t, e, n) => {
|
|
6287
|
-
t?.block && (u.getScope().perCellRead = !0, -1 === n && (t.state |= Hn),
|
|
6284
|
+
t?.block && (u.getScope().perCellRead = !0, -1 === n && (t.state |= Hn), U(b, t, e, n));
|
|
6288
6285
|
};
|
|
6289
|
-
const
|
|
6286
|
+
const R = /* @__PURE__ */ new Map(), A = (t, e) => {
|
|
6290
6287
|
(function(t, e, n, r) {
|
|
6291
6288
|
if (0 === e) return;
|
|
6292
|
-
let o, s, l, i =
|
|
6289
|
+
let o, s, l, i = Rs, a = [];
|
|
6293
6290
|
const c = /* @__PURE__ */ new Set(), d = () => {
|
|
6294
6291
|
const t = o.build();
|
|
6295
|
-
t && t.tuples && (l.values.setValues(t.tuples),
|
|
6292
|
+
t && t.tuples && (l.values.setValues(t.tuples), xe(l.errorSpatial, t.tuples, r));
|
|
6296
6293
|
const e = s.done(!0);
|
|
6297
6294
|
for (let t = 0; t < e.length; t++) {
|
|
6298
6295
|
const n = e[t];
|
|
@@ -6318,7 +6315,7 @@ var Es = class {
|
|
|
6318
6315
|
t.length = e, t.sort(Ns);
|
|
6319
6316
|
for (let h = 0; h < e; h++) {
|
|
6320
6317
|
const e = t[h], u = e.colIndex, _ = e.rowIndex, f = e.gridId;
|
|
6321
|
-
f || console.log("nodeGridId is null", e), f !== i && (i !==
|
|
6318
|
+
f || console.log("nodeGridId is null", e), f !== i && (i !== Rs && d(), o = new j.Builder(Is), s = z(r), i = f, l = n(f));
|
|
6322
6319
|
const g = u, p = _, m = e.cachedValue;
|
|
6323
6320
|
m?.isIRange || (o.pushAt(g, p, m), s.append(g, p));
|
|
6324
6321
|
const S = e.block, w = e.numFmt;
|
|
@@ -6339,7 +6336,7 @@ var Es = class {
|
|
|
6339
6336
|
}
|
|
6340
6337
|
});
|
|
6341
6338
|
}
|
|
6342
|
-
} else null !== w && (l.formatsConflating || (l.formatsConflating =
|
|
6339
|
+
} else null !== w && (l.formatsConflating || (l.formatsConflating = z(r)), l.formatsConflating.append(g, p, w));
|
|
6343
6340
|
}
|
|
6344
6341
|
d();
|
|
6345
6342
|
})(t, e, _, !0);
|
|
@@ -6347,7 +6344,7 @@ var Es = class {
|
|
|
6347
6344
|
const e = t[n];
|
|
6348
6345
|
e.state = e.state & ~Kn | sr;
|
|
6349
6346
|
}
|
|
6350
|
-
for (const [t, e] of S)
|
|
6347
|
+
for (const [t, e] of S) R.set(t, e);
|
|
6351
6348
|
S.clear();
|
|
6352
6349
|
};
|
|
6353
6350
|
let k = r, N = Ul;
|
|
@@ -6355,8 +6352,8 @@ var Es = class {
|
|
|
6355
6352
|
let M = 0, F = !1;
|
|
6356
6353
|
do {
|
|
6357
6354
|
++y, I(), this.doMarkAndPlan(t, y, v, N);
|
|
6358
|
-
const e = this.doEvaluate(t, _,
|
|
6359
|
-
F = void 0 !== e, F && (k = !1, ++y, v.length = 0, this.doCollectDirtyCalcs(t, y, e.all(), v, c, g, w), M > 200 && (++y, I(), this.doMarkAndPlan(t, y, v, N, !0), this.doEvaluate(t, _,
|
|
6355
|
+
const e = this.doEvaluate(t, _, A, k, N);
|
|
6356
|
+
F = void 0 !== e, F && (k = !1, ++y, v.length = 0, this.doCollectDirtyCalcs(t, y, e.all(), v, c, g, w), M > 200 && (++y, I(), this.doMarkAndPlan(t, y, v, N, !0), this.doEvaluate(t, _, A, !1, N), this._hasCycle() || console.error("Too many iterations, possible cycle or leak"), F = !1)), M++;
|
|
6360
6357
|
} while (F);
|
|
6361
6358
|
for (const t of E) {
|
|
6362
6359
|
if (b.has(t)) continue;
|
|
@@ -6396,7 +6393,7 @@ var Es = class {
|
|
|
6396
6393
|
return this._gridUpdates = null, this._addDynamicPrecedent = null, this._context._setDynamicReadHook(null), this._passActive = !1, u.getDeferred?.()?.flush(), {
|
|
6397
6394
|
precedentSpatial: g,
|
|
6398
6395
|
dynamicByBlock: m,
|
|
6399
|
-
lastUpdates:
|
|
6396
|
+
lastUpdates: R,
|
|
6400
6397
|
skippedTables: this._takeSkippedTables()
|
|
6401
6398
|
};
|
|
6402
6399
|
}
|
|
@@ -6417,7 +6414,7 @@ var Es = class {
|
|
|
6417
6414
|
});
|
|
6418
6415
|
}
|
|
6419
6416
|
const o = n.getValues().getValueAt(t.rowIndex, t.colIndex);
|
|
6420
|
-
return null == o ||
|
|
6417
|
+
return null == o || I.isError(o, I.Code.Busy) || I.isError(o, I.Code.Spill) ? void 0 : o;
|
|
6421
6418
|
}
|
|
6422
6419
|
_takeDeferred(t, e) {
|
|
6423
6420
|
const n = this._container.getDeferred?.();
|
|
@@ -6458,7 +6455,7 @@ var Es = class {
|
|
|
6458
6455
|
if (768 !== e || g || (this._flush?.(), g = !0, e = t.state & Kn), e !== or) 0 === e || 768 === e ? cl[_++] = t : 0 !== (t.state & qn) && (s ? p = !0 : d && this._demandActive ? this._onMemberRead(t) : d || this._demandActive ? this._markDownstream(t) : f = t);
|
|
6459
6456
|
else if (s) p = !0;
|
|
6460
6457
|
else {
|
|
6461
|
-
if (u || (t.state &= ~Jn), !d || !this._demandActive) throw new
|
|
6458
|
+
if (u || (t.state &= ~Jn), !d || !this._demandActive) throw new nn(t);
|
|
6462
6459
|
0 === (t.state & jn) && (t.state |= jn, _l[this._iterHitsLength++] = t);
|
|
6463
6460
|
}
|
|
6464
6461
|
};
|
|
@@ -6477,27 +6474,27 @@ var Es = class {
|
|
|
6477
6474
|
}
|
|
6478
6475
|
c.forEachNodeIn(d, h, u, _, m);
|
|
6479
6476
|
}
|
|
6480
|
-
if (_ > 0) throw new
|
|
6481
|
-
if (f) throw new
|
|
6477
|
+
if (_ > 0) throw new on(cl, _);
|
|
6478
|
+
if (f) throw new cn(f);
|
|
6482
6479
|
return p;
|
|
6483
6480
|
}
|
|
6484
6481
|
_markDownstream(t) {
|
|
6485
6482
|
const e = this._container.getScope().node;
|
|
6486
|
-
e && 0 === (e.state & qn) && (e.state = e.state & ~qn | ir,
|
|
6483
|
+
e && 0 === (e.state & qn) && (e.state = e.state & ~qn | ir, sn(e).cycleGroup = this._resolveGroup(Qs(t)), this._addCircular(e), this._iterate && (pl[this._iterDownstreamLength++] = e));
|
|
6487
6484
|
}
|
|
6488
6485
|
_onMemberRead(t) {
|
|
6489
6486
|
const e = t.state;
|
|
6490
6487
|
if ((e & qn) === lr) {
|
|
6491
6488
|
if (this._openGroups.has(this._resolveGroup(t.ext.cycleGroup))) return void (0 === (e & jn) && (t.state |= jn, _l[this._iterHitsLength++] = t));
|
|
6492
|
-
} else if (this._sweeping && 0 === (e &
|
|
6489
|
+
} else if (this._sweeping && 0 === (e & Wn) && void 0 !== t.ext.demandValue) {
|
|
6493
6490
|
const e = this._container.getScope().node;
|
|
6494
|
-
if (e && ((e.state & qn) === lr || 0 !== (e.state &
|
|
6491
|
+
if (e && ((e.state & qn) === lr || 0 !== (e.state & Wn))) return void this._sweepAlong(t, e);
|
|
6495
6492
|
}
|
|
6496
6493
|
this._markDownstream(t);
|
|
6497
6494
|
}
|
|
6498
6495
|
_sweepAlong(t, e) {
|
|
6499
6496
|
const n = t.ext, r = e.ext, o = this._resolveGroup(r.cycleGroup);
|
|
6500
|
-
(e.state & qn) === lr && this._resolveGroup(n.cycleGroup) === o ? (t.state = t.state & ~qn | lr, n.cycleGroup = o, null === r.cycleNext && (r.cycleNext = t)) : t.state |=
|
|
6497
|
+
(e.state & qn) === lr && this._resolveGroup(n.cycleGroup) === o ? (t.state = t.state & ~qn | lr, n.cycleGroup = o, null === r.cycleNext && (r.cycleNext = t)) : t.state |= Wn, this._addIterMember(t, n.demandValue);
|
|
6501
6498
|
}
|
|
6502
6499
|
_addIterMember(t, e) {
|
|
6503
6500
|
let n = this._iterMembersLength++;
|
|
@@ -6580,7 +6577,7 @@ var Es = class {
|
|
|
6580
6577
|
};
|
|
6581
6578
|
this._whatIf = c;
|
|
6582
6579
|
try {
|
|
6583
|
-
const n =
|
|
6580
|
+
const n = fn(e, t), r = un({
|
|
6584
6581
|
container: e,
|
|
6585
6582
|
evaluate: (t) => this._evaluateWhatIf(t),
|
|
6586
6583
|
layerFor: d
|
|
@@ -6603,12 +6600,12 @@ var Es = class {
|
|
|
6603
6600
|
if (!n) return t.cachedValue ?? null;
|
|
6604
6601
|
const r = this._container.getScope();
|
|
6605
6602
|
let o;
|
|
6606
|
-
Ln(t,
|
|
6603
|
+
Ln(t, mn(t)), r.gridId = t.gridId, r.node = t, r.rowIndex = t.rowIndex, r.colIndex = t.colIndex, r.drawIndex = 0;
|
|
6607
6604
|
try {
|
|
6608
6605
|
const e = r.deferCount;
|
|
6609
6606
|
o = n.finalizeValueForCell(n.evaluateAt(t.rowIndex, t.colIndex)), r.deferCount !== e && (o = this._takeDeferred(t, o));
|
|
6610
6607
|
} catch (e) {
|
|
6611
|
-
if (!(e instanceof
|
|
6608
|
+
if (!(e instanceof Bt)) throw e;
|
|
6612
6609
|
o = t.cachedValue ?? null;
|
|
6613
6610
|
}
|
|
6614
6611
|
return this._fitCell(e, o);
|
|
@@ -6646,11 +6643,11 @@ var Es = class {
|
|
|
6646
6643
|
o.blankValue = e, o.blankCycleId = s, o.blankMarkId = l;
|
|
6647
6644
|
const _ = o.getTouchedCached().blank, f = t.gridId, g = n.values, p = n.errorSpatial, m = this._container.getGrid(f);
|
|
6648
6645
|
if (null !== m && null !== m.getShadowOf()) return void vs(_, n, f);
|
|
6649
|
-
const S = g.getAxis() ===
|
|
6646
|
+
const S = g.getAxis() === E.Axis.Column, w = S ? E.Axis.Column : E.Axis.Row, I = qs, y = Us;
|
|
6650
6647
|
for (let t = 0; t < _.length; t++) {
|
|
6651
|
-
const n = _[t], r = S ? n.colStart : n.rowStart, o = S ? n.colEnd : n.rowEnd, s = S ? n.rowStart : n.colStart, l = S ? n.rowEnd - n.rowStart + 1 : n.colEnd - n.colStart + 1, i = new
|
|
6648
|
+
const n = _[t], r = S ? n.colStart : n.rowStart, o = S ? n.colEnd : n.rowEnd, s = S ? n.rowStart : n.colStart, l = S ? n.rowEnd - n.rowStart + 1 : n.colEnd - n.colStart + 1, i = new ce([e], l), a = new Array(o - r + 1);
|
|
6652
6649
|
for (let t = r; t <= o; t++) a[t - r] = [t, [[s, i]]];
|
|
6653
|
-
g.setValues(a), Ht(p, n),
|
|
6650
|
+
g.setValues(a), Ht(p, n), xe(p, a, S);
|
|
6654
6651
|
const c = {
|
|
6655
6652
|
colStart: n.colStart,
|
|
6656
6653
|
rowStart: n.rowStart,
|
|
@@ -6660,19 +6657,19 @@ var Es = class {
|
|
|
6660
6657
|
};
|
|
6661
6658
|
I.push({
|
|
6662
6659
|
...c,
|
|
6663
|
-
value: new
|
|
6660
|
+
value: new Dt(c, w)
|
|
6664
6661
|
}), y.push(c);
|
|
6665
6662
|
}
|
|
6666
6663
|
n.contentfulSpatial.insertAllNonOverlapping(I), n.notifyValues.insertAllNonOverlapping(y), I.length = 0, y.length = 0, o.setBlankShared(_), this._dirtyBlankReaders(f, _, u === e ? h : null);
|
|
6667
6664
|
}
|
|
6668
6665
|
_dirtyBlankReaders(t, e, n) {
|
|
6669
6666
|
if (null !== n && $r(e, n)) return;
|
|
6670
|
-
const r = this._container.getPrecedents(), o =
|
|
6667
|
+
const r = this._container.getPrecedents(), o = Ws, s = Js;
|
|
6671
6668
|
s.scope = t;
|
|
6672
6669
|
for (let t = 0; t < e.length; t++) null === n ? o.push(e[t]) : Hr(e[t], n, o);
|
|
6673
6670
|
for (let e = 0; e < o.length; e++) {
|
|
6674
6671
|
const n = o[e];
|
|
6675
|
-
s.colStart = n.colStart, s.rowStart = n.rowStart, s.colEnd = n.colEnd, s.rowEnd = n.rowEnd, 0 !== r.search(s).length && (this._fallbackDirty ?? (this._fallbackDirty = new
|
|
6672
|
+
s.colStart = n.colStart, s.rowStart = n.rowStart, s.colEnd = n.colEnd, s.rowEnd = n.rowEnd, 0 !== r.search(s).length && (this._fallbackDirty ?? (this._fallbackDirty = new rt())).insertNonOverlapping({
|
|
6676
6673
|
colStart: n.colStart,
|
|
6677
6674
|
rowStart: n.rowStart,
|
|
6678
6675
|
colEnd: n.colEnd,
|
|
@@ -6689,7 +6686,7 @@ var Es = class {
|
|
|
6689
6686
|
xs(t, n.blank, e);
|
|
6690
6687
|
const r = t.getDemandedBlank();
|
|
6691
6688
|
if (0 === r.length) return;
|
|
6692
|
-
const o = this._fallbackDirty ?? (this._fallbackDirty = new
|
|
6689
|
+
const o = this._fallbackDirty ?? (this._fallbackDirty = new rt()), s = t.gridId, l = Xs;
|
|
6693
6690
|
for (let t = 0; t < r.length; t++) {
|
|
6694
6691
|
const e = r[t];
|
|
6695
6692
|
l.push({
|
|
@@ -6708,7 +6705,7 @@ var Es = class {
|
|
|
6708
6705
|
if (null === n) return;
|
|
6709
6706
|
const r = n.blank;
|
|
6710
6707
|
if (0 === r.length) return;
|
|
6711
|
-
const o = this._fallbackDirty ?? (this._fallbackDirty = new
|
|
6708
|
+
const o = this._fallbackDirty ?? (this._fallbackDirty = new rt()), s = t.gridId, l = Xs;
|
|
6712
6709
|
for (let t = 0; t < r.length; t++) {
|
|
6713
6710
|
const e = r[t];
|
|
6714
6711
|
l.push({
|
|
@@ -6756,12 +6753,12 @@ var Es = class {
|
|
|
6756
6753
|
let r;
|
|
6757
6754
|
0 === n && (e.state = -131841 & e.state | or | $n, this._addCircular(e));
|
|
6758
6755
|
let d = null, h = !1;
|
|
6759
|
-
Ln(e,
|
|
6756
|
+
Ln(e, mn(e)), e.state &= -65, s.node = e, s.gridId = e.gridId, s.rowIndex = e.rowIndex, s.colIndex = e.colIndex, s.drawIndex = 0, l.evaluations++, h = e.block.representative === e && e.block.isBlankAware(this._passCycleId), s.perCellRead = !1, s.positionRead = !1, o._setReadHook(this._passHook);
|
|
6760
6757
|
try {
|
|
6761
6758
|
const t = e.block.formula, n = s.deferCount;
|
|
6762
6759
|
r = t.evaluateAt(e.rowIndex, e.colIndex), r = this._fitCell(e.block, t.finalizeValueForCell(r)), s.deferCount !== n && (r = this._takeDeferred(e, r)), r?.isIRange && r.getValueAt(0, 0);
|
|
6763
6760
|
} catch (t) {
|
|
6764
|
-
if (!(t instanceof
|
|
6761
|
+
if (!(t instanceof on || t instanceof nn || t instanceof cn)) throw t;
|
|
6765
6762
|
d = t;
|
|
6766
6763
|
} finally {
|
|
6767
6764
|
o._setReadHook(null);
|
|
@@ -6782,17 +6779,17 @@ var Es = class {
|
|
|
6782
6779
|
}
|
|
6783
6780
|
this._iterHitsLength = 0;
|
|
6784
6781
|
}
|
|
6785
|
-
if (d instanceof
|
|
6782
|
+
if (d instanceof on) {
|
|
6786
6783
|
if (0 !== (e.state & Jn)) {
|
|
6787
6784
|
this._unstartPrefetched(e), a = this._unwindSpeculative(i, a - 1);
|
|
6788
6785
|
continue;
|
|
6789
6786
|
}
|
|
6790
6787
|
l.retries++;
|
|
6791
6788
|
let t = 0;
|
|
6792
|
-
const n =
|
|
6789
|
+
const n = an(e), r = n.length;
|
|
6793
6790
|
for (let o = 0; o < r; o++) {
|
|
6794
6791
|
const r = n[o];
|
|
6795
|
-
if (
|
|
6792
|
+
if (I.isError(r)) continue;
|
|
6796
6793
|
const s = r;
|
|
6797
6794
|
s.scope ? t = this._collectUnevaluated(s, c, t) : (js.rowStart = s.rowStart, js.colStart = s.colStart, js.rowEnd = s.rowEnd, js.colEnd = s.colEnd, js.scope = e.gridId, t = this._collectUnevaluated(js, c, t));
|
|
6798
6795
|
}
|
|
@@ -6807,7 +6804,7 @@ var Es = class {
|
|
|
6807
6804
|
}
|
|
6808
6805
|
continue;
|
|
6809
6806
|
}
|
|
6810
|
-
if (d instanceof
|
|
6807
|
+
if (d instanceof nn) {
|
|
6811
6808
|
if (0 !== (e.state & Jn)) {
|
|
6812
6809
|
this._unstartPrefetched(e), a = this._unwindSpeculative(i, a - 1);
|
|
6813
6810
|
continue;
|
|
@@ -6822,23 +6819,23 @@ var Es = class {
|
|
|
6822
6819
|
}
|
|
6823
6820
|
t.state = -66305 & t.state | sr;
|
|
6824
6821
|
const n = Ys(t);
|
|
6825
|
-
|
|
6822
|
+
sn(t).demandValue = n, this._pushDemand(t, n);
|
|
6826
6823
|
const r = t.block;
|
|
6827
6824
|
r.representative === t && r.isBlankAware(this._passCycleId) && this._fallbackBlank(r, !1);
|
|
6828
6825
|
}
|
|
6829
6826
|
a = t;
|
|
6830
6827
|
continue;
|
|
6831
6828
|
}
|
|
6832
|
-
if (d instanceof
|
|
6829
|
+
if (d instanceof cn) {
|
|
6833
6830
|
e.state = -69377 & e.state | sr | ir;
|
|
6834
|
-
const t = Ys(e), n =
|
|
6831
|
+
const t = Ys(e), n = sn(e);
|
|
6835
6832
|
n.cycleGroup = Qs(d.node), n.demandValue = t, this._pushDemand(e, t), h && this._fallbackBlank(e.block, !1), a--;
|
|
6836
6833
|
continue;
|
|
6837
6834
|
}
|
|
6838
|
-
if (this._iterate || (e.state & qn) !== ir)
|
|
6835
|
+
if (this._iterate || (e.state & qn) !== ir) sn(e).demandValue = r, this._pushDemand(e, r), h && this._finalizeRepresentative(e, r, t(e.gridId), !1);
|
|
6839
6836
|
else {
|
|
6840
6837
|
const t = Ys(e);
|
|
6841
|
-
|
|
6838
|
+
sn(e).demandValue = t, this._pushDemand(e, t), h && this._fallbackBlank(e.block, !1);
|
|
6842
6839
|
}
|
|
6843
6840
|
if (e.state = -66305 & e.state | sr, a--, this._openGroups.size > 0 && (e.state & qn) === lr) {
|
|
6844
6841
|
const t = this._resolveGroup(e.ext.cycleGroup);
|
|
@@ -6870,7 +6867,7 @@ var Es = class {
|
|
|
6870
6867
|
if ((r & Kn) !== or) continue;
|
|
6871
6868
|
if (0 !== (r & Jn)) continue;
|
|
6872
6869
|
l && (r & qn) !== lr && this._addIterMember(e, this._valueOnGrid(e)), e.state = r & ~qn | lr;
|
|
6873
|
-
const o =
|
|
6870
|
+
const o = sn(e);
|
|
6874
6871
|
if (l && (r & qn) === lr) {
|
|
6875
6872
|
const t = this._resolveGroup(o.cycleGroup);
|
|
6876
6873
|
if (t !== s) {
|
|
@@ -6878,9 +6875,9 @@ var Es = class {
|
|
|
6878
6875
|
void 0 !== e && (e < i && (i = e), this._openGroups.delete(t)), this._groupAlias.set(t, s);
|
|
6879
6876
|
}
|
|
6880
6877
|
}
|
|
6881
|
-
o.cycleGroup = s, c ?
|
|
6878
|
+
o.cycleGroup = s, c ? sn(c).cycleNext = e : a = e, c = e;
|
|
6882
6879
|
}
|
|
6883
|
-
return c && (
|
|
6880
|
+
return c && (sn(c).cycleNext = r ?? a), l && this._openGroups.set(s, i), o;
|
|
6884
6881
|
}
|
|
6885
6882
|
_demandSweep(t) {
|
|
6886
6883
|
const e = this._iterate, n = fl, r = e.maxIteration, o = e.maxChange;
|
|
@@ -6948,7 +6945,7 @@ var Es = class {
|
|
|
6948
6945
|
this._iterHitsLength = 0;
|
|
6949
6946
|
}
|
|
6950
6947
|
_demandEvaluateOne(t, e) {
|
|
6951
|
-
const n = this._context, r = this._container.getScope(), o = e.block.formula, s =
|
|
6948
|
+
const n = this._context, r = this._container.getScope(), o = e.block.formula, s = mn(e);
|
|
6952
6949
|
for (;;) {
|
|
6953
6950
|
Ln(e, s), e.state &= -65, r.node = e, r.gridId = e.gridId, r.rowIndex = e.rowIndex, r.colIndex = e.colIndex, r.drawIndex = 0, this._demandStats.evaluations++;
|
|
6954
6951
|
let l, i = null;
|
|
@@ -6957,7 +6954,7 @@ var Es = class {
|
|
|
6957
6954
|
const t = r.deferCount;
|
|
6958
6955
|
l = this._fitCell(e.block, o.finalizeValueForCell(o.evaluateAt(e.rowIndex, e.colIndex))), r.deferCount !== t && (l = this._takeDeferred(e, l)), l?.isIRange && l.getValueAt(0, 0);
|
|
6959
6956
|
} catch (t) {
|
|
6960
|
-
if (!(t instanceof
|
|
6957
|
+
if (!(t instanceof on)) throw t;
|
|
6961
6958
|
i = t;
|
|
6962
6959
|
} finally {
|
|
6963
6960
|
n._setReadHook(null);
|
|
@@ -6986,15 +6983,15 @@ var Es = class {
|
|
|
6986
6983
|
return !1;
|
|
6987
6984
|
}
|
|
6988
6985
|
_addCircular(t) {
|
|
6989
|
-
0 === (t.state &
|
|
6986
|
+
0 === (t.state & Xn) && (t.state |= Xn, dl[this._circularNodesLength++] = t);
|
|
6990
6987
|
}
|
|
6991
6988
|
_resetCircular() {
|
|
6992
6989
|
const t = this._circularNodesLength;
|
|
6993
|
-
for (let e = 0; e < t; e++) dl[e].state &= ~
|
|
6990
|
+
for (let e = 0; e < t; e++) dl[e].state &= ~Xn;
|
|
6994
6991
|
this._circularNodesLength = 0;
|
|
6995
6992
|
}
|
|
6996
6993
|
_trackCircular(t, e, n, r, o) {
|
|
6997
|
-
const s =
|
|
6994
|
+
const s = sn(t), l = t.state & qn, i = 0 === l ? 0 : s.cycleGroup;
|
|
6998
6995
|
if (s.shownGroup === i && (t.state & Un) === l << 2) return;
|
|
6999
6996
|
if (this._cycleEpoch++, 0 !== s.shownGroup) {
|
|
7000
6997
|
const e = this._cycles.get(s.shownGroup);
|
|
@@ -7005,7 +7002,7 @@ var Es = class {
|
|
|
7005
7002
|
const e = this._cycleOf(i), n = l === lr;
|
|
7006
7003
|
(n ? e.members : e.downstream).add(t), a = e.getEntry(n);
|
|
7007
7004
|
}
|
|
7008
|
-
s.shownGroup = i, t.state = t.state & ~Un | l << 2, e.circularConflating || (e.circularConflating =
|
|
7005
|
+
s.shownGroup = i, t.state = t.state & ~Un | l << 2, e.circularConflating || (e.circularConflating = z(o)), e.circularConflating.append(n, r, a);
|
|
7009
7006
|
}
|
|
7010
7007
|
_cycleOf(t) {
|
|
7011
7008
|
let e = this._cycles.get(t);
|
|
@@ -7045,37 +7042,37 @@ var Es = class {
|
|
|
7045
7042
|
this._passCycleId = t, this._passMarkId = e;
|
|
7046
7043
|
const c = this._container, d = c.getPrecedents(), h = c.getFormulas(), u = this.planCacheMode, { staticEpoch: _, precedentEpoch: f } = c.getCalcEpochs(), g = this._lastPlanId, p = this._planStats;
|
|
7047
7044
|
p.passes++;
|
|
7048
|
-
const
|
|
7049
|
-
let
|
|
7050
|
-
const
|
|
7051
|
-
if (null !==
|
|
7052
|
-
const n =
|
|
7045
|
+
const m = Ds();
|
|
7046
|
+
let S = "off" !== u && !o && 0 !== g;
|
|
7047
|
+
const w = S ? this._matchPlanMemo(l, t, e - 1, f) : null;
|
|
7048
|
+
if (null !== w && p.closureEligible++, Vn = 0, null !== w && "on" === u) {
|
|
7049
|
+
const n = w.plan, o = w.planLength, s = w.demandStart;
|
|
7053
7050
|
for (let r = 0; r < o; r++) {
|
|
7054
7051
|
const o = n[r];
|
|
7055
|
-
o.markId = e, o.cycleId = t, o.inDegree = 0, o.state &= ~rr, null !== o.ext && (o.ext.cycleGroup = 0), Pn(o,
|
|
7052
|
+
o.markId = e, o.cycleId = t, o.inDegree = 0, o.state &= ~rr, null !== o.ext && (o.ext.cycleGroup = 0), Pn(o, mn(o)), i[r] = o;
|
|
7056
7053
|
}
|
|
7057
|
-
return r.length = o, s < o && this._flagDemandAppendix(i, s, o), p.closureHits++, p.discoveryMs += Ds() -
|
|
7054
|
+
return r.length = o, s < o && this._flagDemandAppendix(i, s, o), p.closureHits++, p.discoveryMs += Ds() - m, s === o;
|
|
7058
7055
|
}
|
|
7059
|
-
let
|
|
7056
|
+
let E = 0, y = 0, v = 0, x = 0, C = 0, b = 0, R = 0, A = 0;
|
|
7060
7057
|
for (let n = 0; n < l; n++) {
|
|
7061
7058
|
const r = s[n];
|
|
7062
7059
|
if (r.cycleId === t && r.markId === e) continue;
|
|
7063
7060
|
r.markId = e, r.cycleId = t, r.inDegree = 0, r.state &= ~rr;
|
|
7064
7061
|
const o = r.ext;
|
|
7065
|
-
null !== o && (o.cycleGroup = 0), (r.planEpoch !== _ || r.planId !== g || null !== o && 0 !== o.shownGroup) && (
|
|
7062
|
+
null !== o && (o.cycleGroup = 0), (r.planEpoch !== _ || r.planId !== g || null !== o && 0 !== o.shownGroup) && (S = !1), Pn(r, mn(r)), nl[E++] = r, ol[A++] = r;
|
|
7066
7063
|
}
|
|
7067
7064
|
const k = (n) => {
|
|
7068
7065
|
if (n.cycleId === t && n.markId === e) return;
|
|
7069
7066
|
n.markId = e, n.cycleId = t, n.inDegree = 0, n.state &= ~rr;
|
|
7070
7067
|
const r = n.ext;
|
|
7071
|
-
null !== r && (r.cycleGroup = 0), (n.planEpoch !== _ || n.planId !== g || null !== r && 0 !== r.shownGroup) && (
|
|
7068
|
+
null !== r && (r.cycleGroup = 0), (n.planEpoch !== _ || n.planId !== g || null !== r && 0 !== r.shownGroup) && (S = !1), Pn(n, mn(n)), nl[E++] = n, ol[A++] = n;
|
|
7072
7069
|
}, N = (n, r, o, s, l, i) => {
|
|
7073
7070
|
if (n.unanchored) return;
|
|
7074
7071
|
const a = n.ref;
|
|
7075
7072
|
r <= a.rowStart && o >= a.rowEnd && s <= a.colStart && l >= a.colEnd && n.isBlankAware(t) ? n.forEachTouchedNode(t, e, i) : n.mintNodesIn(r, o, s, l, i);
|
|
7076
7073
|
}, M = /* @__PURE__ */ new Map();
|
|
7077
|
-
for (;
|
|
7078
|
-
const t = ol[
|
|
7074
|
+
for (; R < A;) {
|
|
7075
|
+
const t = ol[R++], e = t.colIndex, n = t.rowIndex, r = t.gridId;
|
|
7079
7076
|
let o;
|
|
7080
7077
|
const s = "off" !== u && t.dependentsEpoch === f;
|
|
7081
7078
|
s && "on" === u ? (p.dependentsCacheHits++, o = t.dependents) : (Ls.colStart = e, Ls.rowStart = n, Ls.colEnd = e, Ls.rowEnd = n, Ls.scope = r, o = d.search(Ls), s ? (p.dependentsCacheHits++, Os(t.dependents, o) || (p.dependentsAssertFailures++, console.error("CalcExecutor: stale dependents cache at", r, n, e))) : (p.dependentsCacheMisses++, "off" !== u && (t.dependentsEpoch = f))), t.dependents = o;
|
|
@@ -7085,28 +7082,28 @@ var Es = class {
|
|
|
7085
7082
|
$s.colStart = s, $s.rowStart = o, $s.colEnd = i, $s.rowEnd = l, $s.scope = r;
|
|
7086
7083
|
const a = d.search($s), c = a.length;
|
|
7087
7084
|
if (c > 0) {
|
|
7088
|
-
const r =
|
|
7085
|
+
const r = sn(t);
|
|
7089
7086
|
r.spillDependents = a, r.spillRowStart = o, r.spillColStart = s, r.spillRowEnd = l, r.spillColEnd = i, rl[y++] = t;
|
|
7090
|
-
for (let t = 0; t < c; t++)
|
|
7087
|
+
for (let t = 0; t < c; t++) en(a[t], n, e, o, s, l, i, k, N);
|
|
7091
7088
|
}
|
|
7092
7089
|
}
|
|
7093
7090
|
const i = o.length;
|
|
7094
7091
|
if (0 !== i) for (let t = 0; t < i; t++) {
|
|
7095
7092
|
const r = o[t];
|
|
7096
|
-
|
|
7093
|
+
pn(r, n, e, k, N, M);
|
|
7097
7094
|
}
|
|
7098
7095
|
}
|
|
7099
7096
|
const F = Ds();
|
|
7100
|
-
if (p.discoveryMs += F -
|
|
7101
|
-
const n =
|
|
7102
|
-
let r =
|
|
7103
|
-
for (let o = 0; r && o <
|
|
7097
|
+
if (p.discoveryMs += F - m, S && p.fastEligible++, null !== w) {
|
|
7098
|
+
const n = w.plan;
|
|
7099
|
+
let r = w.planLength === E;
|
|
7100
|
+
for (let o = 0; r && o < E; o++) {
|
|
7104
7101
|
const s = n[o];
|
|
7105
7102
|
r = s.cycleId === t && s.markId === e;
|
|
7106
7103
|
}
|
|
7107
7104
|
r || (p.closureAssertFailures++, console.error("CalcExecutor: whole-closure reuse would have planned a different affected set"));
|
|
7108
7105
|
}
|
|
7109
|
-
if (
|
|
7106
|
+
if (S && "on" === u) {
|
|
7110
7107
|
(function(t, e, n, r) {
|
|
7111
7108
|
if (8 * e < r) {
|
|
7112
7109
|
const r = Bs;
|
|
@@ -7131,13 +7128,13 @@ var Es = class {
|
|
|
7131
7128
|
const e = o[t];
|
|
7132
7129
|
null !== e && (o[t] = null, n[i++] = e);
|
|
7133
7130
|
}
|
|
7134
|
-
})(nl,
|
|
7135
|
-
let t =
|
|
7131
|
+
})(nl, E, i, this._lastStampedLength), r.length = E;
|
|
7132
|
+
let t = E;
|
|
7136
7133
|
const e = this._lastStampedOrderedLength;
|
|
7137
7134
|
for (; t > 0 && i[t - 1].orderIndex >= e;) t--;
|
|
7138
|
-
return t <
|
|
7135
|
+
return t < E && this._flagDemandAppendix(i, t, E), this._rememberPlan(s, l, i, E, f, t), p.fastHits++, p.kahnMs += Ds() - F, t === E;
|
|
7139
7136
|
}
|
|
7140
|
-
if ("on" === u && !o && M.size > 0 && 0 === y &&
|
|
7137
|
+
if ("on" === u && !o && M.size > 0 && 0 === y && E >= kl && 0 === this._cycles.size && function(t, e, n, r) {
|
|
7141
7138
|
const o = /* @__PURE__ */ new Map();
|
|
7142
7139
|
let s = null;
|
|
7143
7140
|
for (let n = 0; n < e; n++) {
|
|
@@ -7163,7 +7160,7 @@ var Es = class {
|
|
|
7163
7160
|
const i = s[l].precedents;
|
|
7164
7161
|
if (null !== i) for (let r = 0; r < i.length; r++) {
|
|
7165
7162
|
const a = i[r];
|
|
7166
|
-
if (
|
|
7163
|
+
if (I.isError(a)) continue;
|
|
7167
7164
|
const c = a.scope ?? e;
|
|
7168
7165
|
fs(t, a, c) && (0 === hs(a, s[l].rowIndex, s[l].colIndex) && (t.rowFirst = !1), 0 === us(a, s[l].rowIndex, s[l].colIndex) && (t.colFirst = !1)), _s(t, a.rowStart, a.rowEnd, a.colStart, a.colEnd, c, o, n);
|
|
7169
7166
|
}
|
|
@@ -7173,10 +7170,10 @@ var Es = class {
|
|
|
7173
7170
|
const { block: l, rowMin: i, rowMax: a, colMin: c, colMax: d } = t, h = l.paramLength;
|
|
7174
7171
|
for (let r = 0; r < h; r++) {
|
|
7175
7172
|
const s = l.getPrecedentsAt(i, c)[r];
|
|
7176
|
-
if (
|
|
7173
|
+
if (I.isError(s)) continue;
|
|
7177
7174
|
as.rowStart = s.rowStart, as.rowEnd = s.rowEnd, as.colStart = s.colStart, as.colEnd = s.colEnd;
|
|
7178
7175
|
const h = l.getPrecedentsAt(a, d)[r];
|
|
7179
|
-
if (
|
|
7176
|
+
if (I.isError(h)) return !1;
|
|
7180
7177
|
const u = Math.min(as.rowStart, h.rowStart), _ = Math.max(as.rowEnd, h.rowEnd), f = Math.min(as.colStart, h.colStart), g = Math.max(as.colEnd, h.colEnd), p = h.scope ?? e;
|
|
7181
7178
|
if (u <= a && _ >= i && f <= d && g >= c && p === e) {
|
|
7182
7179
|
const e = hs(as, i, c);
|
|
@@ -7201,11 +7198,11 @@ var Es = class {
|
|
|
7201
7198
|
for (let t = 0; t < o.length; t++) 0 === --o[t].waitingOn && l.push(o[t]);
|
|
7202
7199
|
}
|
|
7203
7200
|
return l.length === o.size;
|
|
7204
|
-
}(nl,
|
|
7201
|
+
}(nl, E, h, i)) return r.length = E, this._stampPlan(i, E, E, _), this._rememberPlan(s, l, i, E, f), p.blockOrdered++, p.kahnMs += Ds() - F, !0;
|
|
7205
7202
|
const D = (t) => {
|
|
7206
|
-
p.planAssertFailures++, console.error("CalcExecutor: order-stamp fast path would invert a static edge at", t.gridId, t.rowIndex, t.colIndex),
|
|
7203
|
+
p.planAssertFailures++, console.error("CalcExecutor: order-stamp fast path would invert a static edge at", t.gridId, t.rowIndex, t.colIndex), S = !1;
|
|
7207
7204
|
}, T = (n) => {
|
|
7208
|
-
n.cycleId === t && n.markId === e ? (bl++,
|
|
7205
|
+
n.cycleId === t && n.markId === e ? (bl++, S && n.orderIndex >= Cl.orderIndex && D(Cl)) : this._iterate || 0 === (n.state & Un) || (this._taintGroup = n.ext.shownGroup, this._taintDownstream(Cl));
|
|
7209
7206
|
};
|
|
7210
7207
|
let G = null;
|
|
7211
7208
|
const B = (n) => {
|
|
@@ -7223,7 +7220,7 @@ var Es = class {
|
|
|
7223
7220
|
if (s.rowFrom === e && s.rowTo === n && s.colFrom === r && s.colTo === o) return s;
|
|
7224
7221
|
}
|
|
7225
7222
|
let i;
|
|
7226
|
-
return Gl = 0, Bl = -1, Vl = null, t.forEachNodeIn(e, n, r, o, B), l.length <
|
|
7223
|
+
return Gl = 0, Bl = -1, Vl = null, t.forEachNodeIn(e, n, r, o, B), l.length < Al ? (i = {
|
|
7227
7224
|
rowFrom: e,
|
|
7228
7225
|
rowTo: n,
|
|
7229
7226
|
colFrom: r,
|
|
@@ -7231,14 +7228,14 @@ var Es = class {
|
|
|
7231
7228
|
count: 0,
|
|
7232
7229
|
maxOrder: -1,
|
|
7233
7230
|
shownGroup: null
|
|
7234
|
-
}, l.push(i)) : (i = l[s.next], s.next = (s.next + 1) %
|
|
7231
|
+
}, l.push(i)) : (i = l[s.next], s.next = (s.next + 1) % Al, i.rowFrom = e, i.rowTo = n, i.colFrom = r, i.colTo = o), i.count = Gl, i.maxOrder = Bl, i.shownGroup = Vl, i;
|
|
7235
7232
|
};
|
|
7236
|
-
for (let t = 0; t <
|
|
7237
|
-
const e = nl[t], n =
|
|
7233
|
+
for (let t = 0; t < E; t++) {
|
|
7234
|
+
const e = nl[t], n = an(e), r = n.length;
|
|
7238
7235
|
let o = 0;
|
|
7239
7236
|
for (let t = 0; t < r; t++) {
|
|
7240
7237
|
const r = n[t];
|
|
7241
|
-
if (
|
|
7238
|
+
if (I.isError(r)) continue;
|
|
7242
7239
|
const s = r.colStart, l = r.rowStart, i = r.colEnd, a = r.rowEnd, c = r.scope ?? e.gridId;
|
|
7243
7240
|
let d;
|
|
7244
7241
|
const u = t & Nl, _ = Ml[u];
|
|
@@ -7259,9 +7256,9 @@ var Es = class {
|
|
|
7259
7256
|
const f = d.length;
|
|
7260
7257
|
for (let t = 0; t < f; t++) {
|
|
7261
7258
|
const n = d[t], r = n.colStart, c = n.rowStart, h = n.colEnd, u = n.rowEnd, _ = Math.max(r, s), f = Math.max(c, l), g = Math.min(h, i), p = Math.min(u, a);
|
|
7262
|
-
if ((p - f + 1) * (g - _ + 1) >=
|
|
7259
|
+
if ((p - f + 1) * (g - _ + 1) >= Rl) {
|
|
7263
7260
|
const t = V(n.value, f, p, _, g);
|
|
7264
|
-
o += t.count,
|
|
7261
|
+
o += t.count, S && t.maxOrder >= e.orderIndex && D(e), null !== t.shownGroup && (this._taintGroup = t.shownGroup, this._taintDownstream(e));
|
|
7265
7262
|
continue;
|
|
7266
7263
|
}
|
|
7267
7264
|
Cl = e, bl = o, n.value.forEachNodeIn(f, p, _, g, T), o = bl;
|
|
@@ -7272,15 +7269,15 @@ var Es = class {
|
|
|
7272
7269
|
if (Ml.fill(null), Dl.fill(null), y > 0) {
|
|
7273
7270
|
let n = rl[0];
|
|
7274
7271
|
const r = (r) => {
|
|
7275
|
-
r.cycleId === t && r.markId === e && (r.inDegree++,
|
|
7272
|
+
r.cycleId === t && r.markId === e && (r.inDegree++, S && n.orderIndex >= r.orderIndex && (p.planAssertFailures++, console.error("CalcExecutor: order-stamp fast path would invert a spill body edge at", r.gridId, r.rowIndex, r.colIndex), S = !1));
|
|
7276
7273
|
};
|
|
7277
7274
|
for (let t = 0; t < y; t++) {
|
|
7278
7275
|
const e = rl[t];
|
|
7279
7276
|
n = e;
|
|
7280
7277
|
const o = e.ext, s = o.spillDependents, l = s.length;
|
|
7281
|
-
for (let t = 0; t < l; t++)
|
|
7278
|
+
for (let t = 0; t < l; t++) en(s[t], e.rowIndex, e.colIndex, o.spillRowStart, o.spillColStart, o.spillRowEnd, o.spillColEnd, r);
|
|
7282
7279
|
}
|
|
7283
|
-
for (let t = 0; t <
|
|
7280
|
+
for (let t = 0; t < E; t++) {
|
|
7284
7281
|
const e = nl[t];
|
|
7285
7282
|
0 === e.inDegree && (sl[x++] = e);
|
|
7286
7283
|
}
|
|
@@ -7297,20 +7294,20 @@ var Es = class {
|
|
|
7297
7294
|
const e = t.colIndex, n = t.rowIndex, r = t.ext;
|
|
7298
7295
|
if (null !== r) {
|
|
7299
7296
|
const t = r.spillDependents, o = t.length;
|
|
7300
|
-
for (let s = 0; s < o; s++)
|
|
7297
|
+
for (let s = 0; s < o; s++) en(t[s], n, e, r.spillRowStart, r.spillColStart, r.spillRowEnd, r.spillColEnd, P);
|
|
7301
7298
|
}
|
|
7302
7299
|
let o;
|
|
7303
7300
|
o = t.dependents;
|
|
7304
7301
|
const s = o.length;
|
|
7305
7302
|
if (0 !== s) for (let t = 0; t < s; t++) {
|
|
7306
7303
|
const r = o[t];
|
|
7307
|
-
|
|
7304
|
+
_n(r, n, e, P);
|
|
7308
7305
|
}
|
|
7309
7306
|
}
|
|
7310
|
-
if (p.kahnMs += Ds() - O, o || a <
|
|
7311
|
-
if (
|
|
7307
|
+
if (p.kahnMs += Ds() - O, o || a < E) {
|
|
7308
|
+
if (S) {
|
|
7312
7309
|
const t = this._lastStampedOrderedLength;
|
|
7313
|
-
for (let e = 0; e <
|
|
7310
|
+
for (let e = 0; e < E; e++) {
|
|
7314
7311
|
const n = nl[e];
|
|
7315
7312
|
if (n.inDegree > 0 && n.orderIndex < t) {
|
|
7316
7313
|
p.planAssertFailures++, console.error("CalcExecutor: order-stamp fast path would have missed an unorderable subset");
|
|
@@ -7320,9 +7317,9 @@ var Es = class {
|
|
|
7320
7317
|
}
|
|
7321
7318
|
const t = this._demandBatch;
|
|
7322
7319
|
t.length = 0, o && (a = 0);
|
|
7323
|
-
for (let e = 0; e <
|
|
7320
|
+
for (let e = 0; e < E; e++) {
|
|
7324
7321
|
const n = nl[e];
|
|
7325
|
-
(o || n.inDegree > 0) && (n.state |= $n,
|
|
7322
|
+
(o || n.inDegree > 0) && (n.state |= $n, sn(n).demandValue = void 0, t.push(n));
|
|
7326
7323
|
}
|
|
7327
7324
|
t.sort(Fs);
|
|
7328
7325
|
const e = t.length, n = a;
|
|
@@ -7330,9 +7327,9 @@ var Es = class {
|
|
|
7330
7327
|
const e = t[n];
|
|
7331
7328
|
i[a++] = e, this._addCircular(e);
|
|
7332
7329
|
}
|
|
7333
|
-
return r.length = a, o ? (this._planMemos[0].epoch = -1, this._planMemos[1].epoch = -1) : "off" !== u && (
|
|
7330
|
+
return r.length = a, o ? (this._planMemos[0].epoch = -1, this._planMemos[1].epoch = -1) : "off" !== u && (S || this._stampPlan(i, a, n, _), this._rememberPlan(s, l, i, a, f, n)), !1;
|
|
7334
7331
|
}
|
|
7335
|
-
return r.length = a, "off" === u ||
|
|
7332
|
+
return r.length = a, "off" === u || S || this._stampPlan(i, a, a, _), "off" !== u && this._rememberPlan(s, l, i, a, f), !0;
|
|
7336
7333
|
}
|
|
7337
7334
|
_stampPlan(t, e, n, r) {
|
|
7338
7335
|
const o = ++this._planIdNext;
|
|
@@ -7348,7 +7345,7 @@ var Es = class {
|
|
|
7348
7345
|
r.length = 0;
|
|
7349
7346
|
for (let o = e; o < n; o++) {
|
|
7350
7347
|
const e = t[o];
|
|
7351
|
-
e.state |= $n,
|
|
7348
|
+
e.state |= $n, sn(e).demandValue = void 0, r.push(e), this._addCircular(e);
|
|
7352
7349
|
}
|
|
7353
7350
|
}
|
|
7354
7351
|
_invalidatePlans() {
|
|
@@ -7382,156 +7379,156 @@ var Es = class {
|
|
|
7382
7379
|
const l = Ds(), i = this._container, a = this._context, c = i.getScope(), d = a.getRuntime(), h = i.getDeferred?.() ?? null, u = s.values, _ = s.length;
|
|
7383
7380
|
zl = this._passCycleId, Ll = this._passMarkId;
|
|
7384
7381
|
const f = el;
|
|
7385
|
-
let g, p,
|
|
7386
|
-
const
|
|
7387
|
-
this._overlays =
|
|
7388
|
-
const
|
|
7389
|
-
R = i.getGrid(t),
|
|
7390
|
-
},
|
|
7391
|
-
if (
|
|
7392
|
-
n(f,
|
|
7393
|
-
for (const t of
|
|
7394
|
-
void 0 !==
|
|
7382
|
+
let g, p, m, S, w, y, v, x, C, b, R, A, k, N = 0;
|
|
7383
|
+
const M = /* @__PURE__ */ new Map();
|
|
7384
|
+
this._overlays = M;
|
|
7385
|
+
const F = (t) => this._overlayFor(t), D = (t) => {
|
|
7386
|
+
R = i.getGrid(t), b = R.getEntireCoords.bind(R), p = e(t), m = p.gridId, k = F(t), S = p.values, A = p.errorSpatial, w = p.contentfulSpatial, y = p.spillSpatial, v = p.notifyValues, x = p.notifySpillsInsert, C = p.notifySpillsRemove, p.notifyFormats, p.notifyCalcStatus, c.gridId = m;
|
|
7387
|
+
}, T = E.Axis.Column, G = T === E.Axis.Column, B = () => {
|
|
7388
|
+
if (N > 0) {
|
|
7389
|
+
n(f, N), N = 0;
|
|
7390
|
+
for (const t of M.values()) t.reset();
|
|
7391
|
+
void 0 !== m && (p = e(m));
|
|
7395
7392
|
}
|
|
7396
7393
|
};
|
|
7397
|
-
this._flush =
|
|
7398
|
-
const
|
|
7399
|
-
if (
|
|
7394
|
+
this._flush = B;
|
|
7395
|
+
const V = this._exceptTables;
|
|
7396
|
+
if (V) for (let t = 0; t < _; t++) {
|
|
7400
7397
|
const e = u[t];
|
|
7401
7398
|
e.block.hasDataTable() && (e.state = e.state & ~Kn | sr, this._skippedTables.add(e));
|
|
7402
7399
|
}
|
|
7403
|
-
let
|
|
7404
|
-
for (;
|
|
7405
|
-
for (;
|
|
7406
|
-
const n = u[
|
|
7400
|
+
let O = 0;
|
|
7401
|
+
for (; O < _;) try {
|
|
7402
|
+
for (; O < _; O++) {
|
|
7403
|
+
const n = u[O], s = n.colIndex, l = n.rowIndex;
|
|
7407
7404
|
if (1 & n.state && t === n.cycleId) {
|
|
7408
7405
|
n.state &= -2;
|
|
7409
7406
|
continue;
|
|
7410
7407
|
}
|
|
7411
|
-
if (
|
|
7408
|
+
if (V && n.block.hasDataTable()) continue;
|
|
7412
7409
|
const a = n.gridId;
|
|
7413
|
-
a !==
|
|
7414
|
-
const _ = n.block,
|
|
7415
|
-
let L,
|
|
7416
|
-
"object" == typeof
|
|
7417
|
-
const
|
|
7418
|
-
|
|
7419
|
-
const
|
|
7420
|
-
if (
|
|
7421
|
-
const t = On(), e =
|
|
7410
|
+
a !== m && D(a);
|
|
7411
|
+
const _ = n.block, E = _.representative === n && _.isBlankAware(t), M = n.cachedValue;
|
|
7412
|
+
let P, L, $ = !1;
|
|
7413
|
+
"object" == typeof M && null !== M && (M.isIRange ? P = M : I.isError(M, I.Code.Spill) && (L = M, $ = !0));
|
|
7414
|
+
const H = 0 !== (n.state & $n);
|
|
7415
|
+
H && (n.state & Kn) !== sr && (B(), this.doDemandEvaluate(t, e, this._demandBatch, B), c.gridId = a);
|
|
7416
|
+
const j = H ? null : an(n), K = n.inputsAt;
|
|
7417
|
+
if (j && K >= 0) {
|
|
7418
|
+
const t = On(), e = j.length;
|
|
7422
7419
|
for (let n = 0; n < e; n++) {
|
|
7423
|
-
const e =
|
|
7424
|
-
if (
|
|
7425
|
-
t[
|
|
7420
|
+
const e = j[n];
|
|
7421
|
+
if (I.isError(e)) {
|
|
7422
|
+
t[K + n] = e;
|
|
7426
7423
|
continue;
|
|
7427
7424
|
}
|
|
7428
7425
|
const r = e.colStart, o = e.rowStart, s = e.colEnd, l = e.rowEnd;
|
|
7429
7426
|
if (l !== o || r !== s) {
|
|
7430
|
-
let a = e.scope, c =
|
|
7431
|
-
a && a !==
|
|
7427
|
+
let a = e.scope, c = S, h = b, u = k, _ = R;
|
|
7428
|
+
a && a !== m && (_ = i.getGrid(a), _ && (c = _.getValues(), u = F(a), h = _.getEntireCoords.bind(_)));
|
|
7432
7429
|
let f = _;
|
|
7433
7430
|
u.intersects(o, r, l, s) && (c = u, f = u);
|
|
7434
|
-
const g = new
|
|
7435
|
-
g._setErrorIndex(f), t[
|
|
7431
|
+
const g = new mt(d, c, { ...e }, null, h, i.resolveScope);
|
|
7432
|
+
g._setErrorIndex(f), t[K + n] = g;
|
|
7436
7433
|
}
|
|
7437
7434
|
}
|
|
7438
7435
|
}
|
|
7439
|
-
|
|
7440
|
-
const
|
|
7436
|
+
j && null !== h && 0 !== h.getOpenCount() && 0 === (n.state & Yn) && jl(j, m, i) && (n.state |= Yn);
|
|
7437
|
+
const q = G ? s : l, U = G ? l : s;
|
|
7441
7438
|
c.node = n, c.colIndex = s, c.rowIndex = l, c.drawIndex = 0;
|
|
7442
7439
|
const X = _.formula;
|
|
7443
|
-
let
|
|
7444
|
-
const
|
|
7445
|
-
let
|
|
7446
|
-
const
|
|
7447
|
-
if (
|
|
7440
|
+
let W, J = null, Q = !1;
|
|
7441
|
+
const Y = 4 & n.state ? 0 !== (n.state & nr) ? re.CalcStatus.Working : re.CalcStatus.Waiting : 0;
|
|
7442
|
+
let Z = Y;
|
|
7443
|
+
const tt = r ? 0 : Y, et = n.ext;
|
|
7444
|
+
if (H && !this._iterate && 0 !== (n.state & qn)) null !== et && (et.demandValue = void 0), W = Ys(n), Z = 0;
|
|
7448
7445
|
else {
|
|
7449
|
-
if (
|
|
7450
|
-
const t = null !==
|
|
7451
|
-
null !==
|
|
7446
|
+
if (H) {
|
|
7447
|
+
const t = null !== et ? et.demandValue : void 0;
|
|
7448
|
+
null !== et && (et.demandValue = void 0), W = void 0 === t ? 0 : t;
|
|
7452
7449
|
} else {
|
|
7453
7450
|
if (n.state = n.state & ~Kn | or, c.perCellRead = !1, c.positionRead = !1, 0 !== (n.state & tr)) {
|
|
7454
7451
|
n.state &= ~tr;
|
|
7455
|
-
const t = this._settlePass ? bs(
|
|
7452
|
+
const t = this._settlePass ? bs(S, y, l, s) : null;
|
|
7456
7453
|
if (null !== t && t.direct) {
|
|
7457
|
-
|
|
7458
|
-
const e =
|
|
7459
|
-
e?.isIRange ? (
|
|
7454
|
+
Q = !0, n.state &= -2621441;
|
|
7455
|
+
const e = ct(t);
|
|
7456
|
+
e?.isIRange ? (W = X.finalizeValueForCell(e), J = t) : W = t;
|
|
7460
7457
|
}
|
|
7461
7458
|
}
|
|
7462
|
-
if (!
|
|
7459
|
+
if (!Q) {
|
|
7463
7460
|
this._planStats.evaluated++, n.state &= -2621505;
|
|
7464
7461
|
const t = c.deferCount;
|
|
7465
|
-
|
|
7462
|
+
W = X.evaluateAt(l, s), W = X.finalizeValueForCell(W), (c.perCellRead || c.positionRead) && (n.block.positionRead = !0), c.deferCount !== t && (W = this._takeDeferred(n, W), J = this._spillHolder, this._spillHolder = null);
|
|
7466
7463
|
}
|
|
7467
7464
|
}
|
|
7468
|
-
|
|
7465
|
+
Z = 0 !== (n.state & er) ? re.CalcStatus.Working : 0 !== (n.state & (Yn | Zn)) ? re.CalcStatus.Waiting : 0, 0 !== Z && (n.state |= Zn);
|
|
7469
7466
|
}
|
|
7470
|
-
let
|
|
7471
|
-
(n.state & Kn) !== sr && (n.state = n.state & ~Kn | 768),
|
|
7472
|
-
const
|
|
7473
|
-
if (
|
|
7467
|
+
let nt;
|
|
7468
|
+
(n.state & Kn) !== sr && (n.state = n.state & ~Kn | 768), Z !== tt && (0 === Z ? n.state &= ~(4 | nr) : Z === re.CalcStatus.Working ? n.state |= 4 | nr : n.state = (4 | n.state) & ~nr, p.calcStatusConflating || (p.calcStatusConflating = z(G)), p.calcStatusConflating.append(q, U, 0 !== Z && Z)), H && k.takeDemand(l, s);
|
|
7469
|
+
const ot = n.ext, st = null !== ot ? ot.fixedRef : null;
|
|
7470
|
+
if (P || L || st) {
|
|
7474
7471
|
Zs.colStart = s, Zs.rowStart = l, Zs.colEnd = s, Zs.rowEnd = l;
|
|
7475
7472
|
const t = y.search(Zs);
|
|
7476
|
-
for (let e = 0; !
|
|
7473
|
+
for (let e = 0; !nt && e < t.length; e++) {
|
|
7477
7474
|
const n = t[e];
|
|
7478
|
-
n.value.isAnchor(l, s) && "pivot" !== n.value.getKind() && (
|
|
7475
|
+
n.value.isAnchor(l, s) && "pivot" !== n.value.getKind() && (nt = n);
|
|
7479
7476
|
}
|
|
7480
|
-
if (
|
|
7477
|
+
if (nt && (y.remove(nt, Go), !nt || !nt.value.getError())) {
|
|
7481
7478
|
const t = {
|
|
7482
|
-
...o.sanitizeRange(
|
|
7483
|
-
scope:
|
|
7479
|
+
...o.sanitizeRange(nt),
|
|
7480
|
+
scope: nt.scope,
|
|
7484
7481
|
value: null
|
|
7485
7482
|
};
|
|
7486
|
-
|
|
7483
|
+
w.insertNonOverlapping(t), S.delete(t), Ht(A, t);
|
|
7487
7484
|
}
|
|
7488
7485
|
}
|
|
7489
|
-
|
|
7490
|
-
let
|
|
7491
|
-
const
|
|
7492
|
-
let ut, _t = dt &&
|
|
7493
|
-
if (
|
|
7494
|
-
|
|
7486
|
+
W = this._fitCell(_, W);
|
|
7487
|
+
let lt = 1, it = 1;
|
|
7488
|
+
const at = W, dt = "object" == typeof W && null !== W, ht = dt && at.isIRange;
|
|
7489
|
+
let ut, _t = dt && I.isError(W, I.Code.Spill);
|
|
7490
|
+
if (st) {
|
|
7491
|
+
lt = st.colEnd - st.colStart + 1, it = st.rowEnd - st.rowStart + 1;
|
|
7495
7492
|
const e = {
|
|
7496
|
-
colStart:
|
|
7497
|
-
rowStart:
|
|
7498
|
-
colEnd:
|
|
7499
|
-
rowEnd:
|
|
7493
|
+
colStart: st.colStart,
|
|
7494
|
+
rowStart: st.rowStart,
|
|
7495
|
+
colEnd: st.colEnd,
|
|
7496
|
+
rowEnd: st.rowEnd,
|
|
7500
7497
|
scope: a
|
|
7501
|
-
}, r =
|
|
7502
|
-
|
|
7498
|
+
}, r = dn(W, e, G)?.tuples;
|
|
7499
|
+
S.delete(e), r && S.setValues(r), Ht(A, e), xe(A, r, G), ut = {
|
|
7503
7500
|
...e,
|
|
7504
|
-
value: new
|
|
7505
|
-
}, y.insert(ut), i.addDynamicPrecedent(n, e, -2),
|
|
7501
|
+
value: new Yt(e, t, "fixed", null, J)
|
|
7502
|
+
}, y.insert(ut), i.addDynamicPrecedent(n, e, -2), w.insertNonOverlapping({
|
|
7506
7503
|
...e,
|
|
7507
|
-
value: new
|
|
7504
|
+
value: new Dt(e, T)
|
|
7508
7505
|
});
|
|
7509
|
-
} else if (ht &&
|
|
7510
|
-
|
|
7506
|
+
} else if (ht && at.size > 1) {
|
|
7507
|
+
lt = at.getColumnCount(), it = at.getRowCount();
|
|
7511
7508
|
const e = vl(n), r = null !== e ? l - e.rows : l, c = null !== e ? s - e.columns : s, d = {
|
|
7512
7509
|
colStart: c,
|
|
7513
7510
|
rowStart: r,
|
|
7514
|
-
colEnd: c +
|
|
7515
|
-
rowEnd: r +
|
|
7511
|
+
colEnd: c + lt - 1,
|
|
7512
|
+
rowEnd: r + it - 1,
|
|
7516
7513
|
scope: a
|
|
7517
|
-
}, h =
|
|
7514
|
+
}, h = b(), u = !o.isRangeWithinRange(d, h);
|
|
7518
7515
|
if (u && (d.colEnd = Math.min(d.colEnd, h.colEnd), d.rowEnd = Math.min(d.rowEnd, h.rowEnd)), _t = u, !_t) {
|
|
7519
|
-
const t =
|
|
7516
|
+
const t = w.search(d);
|
|
7520
7517
|
if (_t = t.length > 1, !_t && 1 === t.length) {
|
|
7521
7518
|
const e = t[0], n = o.intersectRanges(d, e, Ps);
|
|
7522
7519
|
!n || n.rowEnd === n.rowStart && n.colStart === n.colEnd && n.colStart === s && n.rowStart === l || (_t = !0);
|
|
7523
7520
|
}
|
|
7524
7521
|
}
|
|
7525
7522
|
let _, f;
|
|
7526
|
-
if (_t)
|
|
7523
|
+
if (_t) W = I.BuiltIn.Spill, lt = 1, it = 1, _ = [[q, [[U, [W]]]]], S.setValues(_), xe(A, _, G), f = {
|
|
7527
7524
|
colStart: s,
|
|
7528
7525
|
rowStart: l,
|
|
7529
7526
|
colEnd: s,
|
|
7530
7527
|
rowEnd: l
|
|
7531
7528
|
};
|
|
7532
7529
|
else {
|
|
7533
|
-
const t =
|
|
7534
|
-
t && (_ = t.tuples),
|
|
7530
|
+
const t = hn(at, G ? c : r, G ? r : c);
|
|
7531
|
+
t && (_ = t.tuples), S.delete(d), _ && S.setValues(_), Ht(A, d), xe(A, _, G), f = d;
|
|
7535
7532
|
}
|
|
7536
7533
|
const g = _t ? {
|
|
7537
7534
|
colStart: s,
|
|
@@ -7542,67 +7539,67 @@ var Es = class {
|
|
|
7542
7539
|
} : d;
|
|
7543
7540
|
ut = {
|
|
7544
7541
|
...g,
|
|
7545
|
-
value: new
|
|
7546
|
-
}, y.insert(ut), i.addDynamicPrecedent(n, d, -2),
|
|
7542
|
+
value: new Yt(g, t, _t ? "error" : "dynamic", _t || null === e ? null : e, J, _t ? d : null)
|
|
7543
|
+
}, y.insert(ut), i.addDynamicPrecedent(n, d, -2), w.insertNonOverlapping({
|
|
7547
7544
|
...f,
|
|
7548
|
-
value: new
|
|
7545
|
+
value: new Dt(f, T)
|
|
7549
7546
|
});
|
|
7550
7547
|
}
|
|
7551
|
-
!
|
|
7548
|
+
!E || _.blankCycleId === t && _.blankMarkId === this._passMarkId || this._finalizeRepresentative(n, W, p, 0 !== Z || H || !0 === ht || _t || null !== st || Q);
|
|
7552
7549
|
let ft = !1;
|
|
7553
|
-
if ((
|
|
7554
|
-
const t =
|
|
7550
|
+
if ((nt || ut || _t || L) && (ft = o.isEqualRanges(nt, ut), nt && C.push(nt), ut && x.push(ut)), ut || nt) {
|
|
7551
|
+
const t = nt ?? ut, e = ut ?? nt, r = {
|
|
7555
7552
|
colStart: Math.min(s, t.colStart, e.colStart),
|
|
7556
7553
|
rowStart: Math.min(l, t.rowStart, e.rowStart),
|
|
7557
7554
|
colEnd: Math.max(s, t.colEnd, e.colEnd),
|
|
7558
7555
|
rowEnd: Math.max(l, t.rowEnd, e.rowEnd),
|
|
7559
7556
|
scope: a
|
|
7560
7557
|
};
|
|
7561
|
-
v.insertNonOverlapping(r), ft && _t ===
|
|
7558
|
+
v.insertNonOverlapping(r), ft && _t === $ || (this._invalidatePlans(), i.getPrecedents().search(r).length > 0 && (n.state |= 1, g || (g = new rt()), g.insertNonOverlapping(r)));
|
|
7562
7559
|
}
|
|
7563
|
-
n.cachedValue =
|
|
7564
|
-
const gt = null !== h && h.hasHolders() ?
|
|
7565
|
-
ht ||
|
|
7566
|
-
const
|
|
7560
|
+
n.cachedValue = W, f[N++] = n;
|
|
7561
|
+
const gt = null !== h && h.hasHolders() ? ct(W) : W;
|
|
7562
|
+
ht || st || k.push(l, s, gt), N >= (k.observed ? As : ks) && B(), (0 !== (n.state & qn) || null !== n.ext && 0 !== n.ext.shownGroup) && this._trackCircular(n, p, q, U, G);
|
|
7563
|
+
const pt = n.dependents, St = pt.length;
|
|
7567
7564
|
if (St > 0) {
|
|
7568
7565
|
const t = !!(4 & n.state), e = !this._iterate && 0 !== (n.state & qn);
|
|
7569
7566
|
e && (this._taintGroup = n.ext.cycleGroup);
|
|
7570
7567
|
for (let n = 0; n < St; n++) {
|
|
7571
|
-
const r =
|
|
7572
|
-
e &&
|
|
7568
|
+
const r = pt[n];
|
|
7569
|
+
e && _n(r, l, s, this._taintDownstream);
|
|
7573
7570
|
const o = r.value.index;
|
|
7574
|
-
o < 0 || (
|
|
7571
|
+
o < 0 || (gn(r) && (Ol = o, Pl = gt, _n(r, l, s, $l)), t && _n(r, l, s, Hl));
|
|
7575
7572
|
}
|
|
7576
7573
|
}
|
|
7577
7574
|
}
|
|
7578
7575
|
} catch (n) {
|
|
7579
|
-
const r = u[
|
|
7580
|
-
if (n instanceof
|
|
7576
|
+
const r = u[O];
|
|
7577
|
+
if (n instanceof on || n instanceof nn && this._iterate) {
|
|
7581
7578
|
const o = Ks;
|
|
7582
|
-
if (o.length = 0, n instanceof
|
|
7583
|
-
o.push(r),
|
|
7579
|
+
if (o.length = 0, n instanceof on) for (let t = 0; t < n.count; t++) o.push(n.nodes[t]);
|
|
7580
|
+
o.push(r), B(), r.state &= ~Kn, this.doDemandEvaluate(t, e, o, B);
|
|
7584
7581
|
} else {
|
|
7585
|
-
if (!(n instanceof
|
|
7582
|
+
if (!(n instanceof nn || n instanceof cn)) throw n;
|
|
7586
7583
|
{
|
|
7587
|
-
const t = n instanceof
|
|
7584
|
+
const t = n instanceof nn;
|
|
7588
7585
|
r.state = -3841 & r.state | $n | sr | (t ? lr : ir);
|
|
7589
|
-
const e =
|
|
7586
|
+
const e = sn(r);
|
|
7590
7587
|
e.demandValue = Ys(r), e.cycleGroup = t ? ++this._cycleGroupNext : Qs(n.node), t && (e.cycleNext = r), this._addCircular(r);
|
|
7591
7588
|
}
|
|
7592
7589
|
}
|
|
7593
7590
|
c.gridId = r.gridId;
|
|
7594
7591
|
}
|
|
7595
|
-
c.node = null, c.colIndex = Number.MAX_SAFE_INTEGER, c.rowIndex = Number.MAX_SAFE_INTEGER,
|
|
7596
|
-
for (const t of
|
|
7592
|
+
c.node = null, c.colIndex = Number.MAX_SAFE_INTEGER, c.rowIndex = Number.MAX_SAFE_INTEGER, B();
|
|
7593
|
+
for (const t of M.values()) t.commitDemand();
|
|
7597
7594
|
this._flush = null, this._overlays = null;
|
|
7598
|
-
const
|
|
7599
|
-
return null !==
|
|
7595
|
+
const P = this._fallbackDirty;
|
|
7596
|
+
return null !== P && (this._fallbackDirty = null, g ? g.insertAllNonOverlapping(P.all()) : g = P), (() => {
|
|
7600
7597
|
const t = Bn, e = Vn;
|
|
7601
7598
|
for (let n = 0; n < e; n++) t[n] = void 0;
|
|
7602
7599
|
Vn = 0;
|
|
7603
7600
|
})(), this._planStats.evaluateMs += Ds() - l, g;
|
|
7604
7601
|
}
|
|
7605
|
-
}, Is = (t, e) => new
|
|
7602
|
+
}, Is = (t, e) => new L.ArrayList(t.slice(0, e));
|
|
7606
7603
|
function ys(t, e, n, r, o, s) {
|
|
7607
7604
|
const l = e.rowStart + n, i = e.rowStart + r, a = e.colStart + o, c = e.colStart + s;
|
|
7608
7605
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -7644,8 +7641,8 @@ function Cs(t, e, n) {
|
|
|
7644
7641
|
}
|
|
7645
7642
|
var bs = (t, e, n, r) => {
|
|
7646
7643
|
const o = t.getValueAt(n, r);
|
|
7647
|
-
return
|
|
7648
|
-
},
|
|
7644
|
+
return kt(o) ? o : Ne(e, n, r);
|
|
7645
|
+
}, Rs = Symbol("unsetGridId"), As = 1024, ks = 65536;
|
|
7649
7646
|
function Ns(t, e) {
|
|
7650
7647
|
return t.scope !== e.scope ? null === t.scope ? -1 : null === e.scope ? 1 : t.scope.localeCompare(e.scope) : t.colIndex === e.colIndex ? t.rowIndex - e.rowIndex : t.colIndex - e.colIndex;
|
|
7651
7648
|
}
|
|
@@ -7711,7 +7708,7 @@ var Ps = {
|
|
|
7711
7708
|
rowEnd: 0,
|
|
7712
7709
|
colEnd: 0,
|
|
7713
7710
|
scope: null
|
|
7714
|
-
}, Ks = [null], qs = [], Us = [],
|
|
7711
|
+
}, Ks = [null], qs = [], Us = [], Xs = [], Ws = [], Js = {
|
|
7715
7712
|
rowStart: 0,
|
|
7716
7713
|
colStart: 0,
|
|
7717
7714
|
rowEnd: 0,
|
|
@@ -7720,12 +7717,12 @@ var Ps = {
|
|
|
7720
7717
|
}, Qs = (t) => {
|
|
7721
7718
|
const e = t.ext;
|
|
7722
7719
|
return null === e ? 0 : 0 !== (t.state & qn) ? e.cycleGroup : e.shownGroup;
|
|
7723
|
-
}, Ys = (t) =>
|
|
7720
|
+
}, Ys = (t) => ct(t.cachedValue) ?? 0, Zs = {
|
|
7724
7721
|
rowStart: 0,
|
|
7725
7722
|
colStart: 0,
|
|
7726
7723
|
rowEnd: 0,
|
|
7727
7724
|
colEnd: 0
|
|
7728
|
-
}, tl = 1e4, el =
|
|
7725
|
+
}, tl = 1e4, el = it(tl), nl = it(tl), rl = it(tl), ol = it(tl), sl = it(tl), ll = it(tl), il = it(tl), al = it(tl), cl = it(tl), dl = it(tl), hl = it(tl), ul = it(tl), _l = it(tl), fl = it(tl), gl = it(tl), pl = it(tl), ml = [null], Sl = [], wl = -1, El = -1, Il = -1, yl = -1;
|
|
7729
7726
|
function vl(t) {
|
|
7730
7727
|
const e = t.block.formula;
|
|
7731
7728
|
return null !== e && void 0 !== e.getSpillOrigin ? e.getSpillOrigin() : null;
|
|
@@ -7738,7 +7735,7 @@ function xl(t) {
|
|
|
7738
7735
|
const o = vl(t);
|
|
7739
7736
|
return Il = null !== o ? t.rowIndex - o.rows : t.rowIndex, yl = null !== o ? t.colIndex - o.columns : t.colIndex, wl = Il + r.getRowCount() - 1, El = yl + r.getColumnCount() - 1, wl > Il || El > yl;
|
|
7740
7737
|
}
|
|
7741
|
-
var Cl = null, bl = 0,
|
|
7738
|
+
var Cl = null, bl = 0, Rl = 64, Al = 4, kl = 1024, Nl = 7, Ml = it(8), Fl = it(8), Dl = it(8), Tl = Array.from({ length: 8 }, () => ({
|
|
7742
7739
|
colStart: 0,
|
|
7743
7740
|
colEnd: 0,
|
|
7744
7741
|
rowStart: 0,
|
|
@@ -7753,7 +7750,7 @@ var Cl = null, bl = 0, Al = 64, Rl = 4, kl = 1024, Nl = 7, Ml = st(8), Fl = st(8
|
|
|
7753
7750
|
}, jl = (t, e, n) => {
|
|
7754
7751
|
for (let r = 0; r < t.length; r++) {
|
|
7755
7752
|
const o = t[r];
|
|
7756
|
-
if (!o ||
|
|
7753
|
+
if (!o || I.isError(o)) continue;
|
|
7757
7754
|
const s = n.getGrid(o.scope ?? e)?._calcStatusSpatial;
|
|
7758
7755
|
if (!s) continue;
|
|
7759
7756
|
const l = s.search(o);
|
|
@@ -7770,12 +7767,12 @@ function Kl(t, e) {
|
|
|
7770
7767
|
return n === r ? 0 : 1 / 0;
|
|
7771
7768
|
}
|
|
7772
7769
|
var ql = {
|
|
7773
|
-
values:
|
|
7770
|
+
values: it(tl),
|
|
7774
7771
|
length: 0
|
|
7775
7772
|
}, Ul = {
|
|
7776
|
-
values:
|
|
7773
|
+
values: it(tl),
|
|
7777
7774
|
length: 0
|
|
7778
|
-
},
|
|
7775
|
+
}, Xl = class {
|
|
7779
7776
|
constructor(t) {
|
|
7780
7777
|
this._namesByKey = /* @__PURE__ */ new Map(), this._namesById = /* @__PURE__ */ new Map(), this._hostsById = /* @__PURE__ */ new Map(), this._loadedData = /* @__PURE__ */ new Map(), this._options = t;
|
|
7781
7778
|
}
|
|
@@ -7784,14 +7781,14 @@ var ql = {
|
|
|
7784
7781
|
for (let e = 0; e < a.length; e++) {
|
|
7785
7782
|
const c = a[e], d = c.getId(), h = c.getSheetNames();
|
|
7786
7783
|
for (let t = 0; t < h.length; t++) {
|
|
7787
|
-
const e =
|
|
7784
|
+
const e = ut(d, t);
|
|
7788
7785
|
s.add(e), o && (n(e) ? this._loadedData.get(e) !== (c.getSheetData(t)?.data ?? null) && (r(e), this._registerSheet(c, t, e), i.add(d)) : (this._registerSheet(c, t, e), i.add(d)));
|
|
7789
7786
|
}
|
|
7790
7787
|
const u = c.getDefinedNames();
|
|
7791
7788
|
for (let e = 0; e < u.length; e++) {
|
|
7792
7789
|
const n = u[e];
|
|
7793
7790
|
if (!n.name) continue;
|
|
7794
|
-
const r = n.sheetIndex, o =
|
|
7791
|
+
const r = n.sheetIndex, o = ut(d, void 0 !== r && r >= 0 && r < h.length ? r : -1), s = Wl(o, n.name);
|
|
7795
7792
|
l.add(s);
|
|
7796
7793
|
const a = this._namesByKey.get(s);
|
|
7797
7794
|
if (a) {
|
|
@@ -7803,17 +7800,17 @@ var ql = {
|
|
|
7803
7800
|
} else this._registerName(c, o, n, t), i.add(d);
|
|
7804
7801
|
}
|
|
7805
7802
|
}
|
|
7806
|
-
for (const t of this._registeredSheetGrids()) s.has(t) || (r(t), this._loadedData.delete(t), i.add(
|
|
7803
|
+
for (const t of this._registeredSheetGrids()) s.has(t) || (r(t), this._loadedData.delete(t), i.add(ae(t).bookId));
|
|
7807
7804
|
for (const [t, e] of this._namesByKey) {
|
|
7808
7805
|
if (l.has(t)) continue;
|
|
7809
7806
|
this._namesByKey.delete(t), this._namesById.delete(e.getId());
|
|
7810
7807
|
const n = this._hostsById.get(e.getId());
|
|
7811
|
-
this._hostsById.delete(e.getId()), n?.setPlaceholder(
|
|
7808
|
+
this._hostsById.delete(e.getId()), n?.setPlaceholder(I.BuiltIn.Name.toString()), i.add(ae(e.getScope()).bookId);
|
|
7812
7809
|
}
|
|
7813
7810
|
return i;
|
|
7814
7811
|
}
|
|
7815
7812
|
getNameByScope(t, e) {
|
|
7816
|
-
return this._namesByKey.get(
|
|
7813
|
+
return this._namesByKey.get(Wl(e, t)) ?? null;
|
|
7817
7814
|
}
|
|
7818
7815
|
getNameById(t) {
|
|
7819
7816
|
return this._namesById.get(t) ?? null;
|
|
@@ -7821,7 +7818,7 @@ var ql = {
|
|
|
7821
7818
|
_registeredSheetGrids() {
|
|
7822
7819
|
const t = [];
|
|
7823
7820
|
for (const e of this._options.gridIds()) {
|
|
7824
|
-
const n =
|
|
7821
|
+
const n = ae(e);
|
|
7825
7822
|
n && n.sheetIndex >= 0 && t.push(e);
|
|
7826
7823
|
}
|
|
7827
7824
|
return t;
|
|
@@ -7848,7 +7845,7 @@ var ql = {
|
|
|
7848
7845
|
}
|
|
7849
7846
|
if (0 === e.length) return null;
|
|
7850
7847
|
e.sort((t, e) => t.col - e.col || t.row - e.row);
|
|
7851
|
-
const n = new
|
|
7848
|
+
const n = new j.Builder();
|
|
7852
7849
|
for (let t = 0; t < e.length; t++) n.pushAt(e[t].col, e[t].row, e[t].value);
|
|
7853
7850
|
return n.build()?.tuples ?? null;
|
|
7854
7851
|
}(o);
|
|
@@ -7861,15 +7858,15 @@ var ql = {
|
|
|
7861
7858
|
getScope: () => e,
|
|
7862
7859
|
refersTo: n.refersTo ?? ""
|
|
7863
7860
|
};
|
|
7864
|
-
this._namesByKey.set(
|
|
7861
|
+
this._namesByKey.set(Wl(e, n.name), i), this._namesById.set(l, i);
|
|
7865
7862
|
const a = s(l);
|
|
7866
7863
|
this._hostsById.set(l, a), this._queueBody(l, a, t, e, i.refersTo, r);
|
|
7867
7864
|
}
|
|
7868
7865
|
_queueBody(t, e, n, r, o, s) {
|
|
7869
7866
|
const { queue: l, recompileNamed: i } = this._options;
|
|
7870
7867
|
let a = o.trim();
|
|
7871
|
-
a.startsWith("=") && (a = a.substring(1)), a || (a =
|
|
7872
|
-
const c =
|
|
7868
|
+
a.startsWith("=") && (a = a.substring(1)), a || (a = I.BuiltIn.Ref.toString());
|
|
7869
|
+
const c = ae(r), d = c.sheetIndex >= 0 ? c.sheetIndex : n.getSheetNames().length > 0 ? 0 : -1, h = ut(c.bookId, d);
|
|
7873
7870
|
l(async () => {
|
|
7874
7871
|
this._hostsById.get(t) === e && e.setBody({
|
|
7875
7872
|
coords: Jl,
|
|
@@ -7879,7 +7876,7 @@ var ql = {
|
|
|
7879
7876
|
}) && (s || i(t));
|
|
7880
7877
|
});
|
|
7881
7878
|
}
|
|
7882
|
-
},
|
|
7879
|
+
}, Wl = (t, e) => t + "::" + e.toLowerCase(), Jl = Object.freeze({
|
|
7883
7880
|
colStart: 0,
|
|
7884
7881
|
rowStart: 0,
|
|
7885
7882
|
colEnd: 0,
|
|
@@ -7905,7 +7902,7 @@ var ql = {
|
|
|
7905
7902
|
deferOrdinal: 0,
|
|
7906
7903
|
deferRoot: !1,
|
|
7907
7904
|
deferServed: null
|
|
7908
|
-
}, this._cycleId = 0, this._staticEpoch = 1, this._precedentEpoch = 1, this._epochSeenFormulas = null, this._epochSeenPrecedents = null, this._epochSeenDynamics = null, this._volatiles = /* @__PURE__ */ new Set(), this._calculatedCommitId = null, this._calculatedEngineId = null, this._holdsGrids = !1, this._engineIds = /* @__PURE__ */ new Map(), this._landingOf = /* @__PURE__ */ new Map(), this._mirroredId = null, this._lastRevert = null, this._symbolIndex = null, this._symbolIndexOf = null, this._sheetsDerived = null, this._tablesDerived = null, this._namesDerived = null, this._collecting = null, this._recompileNamedPending = null, this._recompileLoadedPending = null, this._invalidateNamedPending = null, this.resolveScope = (t) => this._symbols.resolve(
|
|
7905
|
+
}, this._cycleId = 0, this._staticEpoch = 1, this._precedentEpoch = 1, this._epochSeenFormulas = null, this._epochSeenPrecedents = null, this._epochSeenDynamics = null, this._volatiles = /* @__PURE__ */ new Set(), this._calculatedCommitId = null, this._calculatedEngineId = null, this._holdsGrids = !1, this._engineIds = /* @__PURE__ */ new Map(), this._landingOf = /* @__PURE__ */ new Map(), this._mirroredId = null, this._lastRevert = null, this._symbolIndex = null, this._symbolIndexOf = null, this._sheetsDerived = null, this._tablesDerived = null, this._namesDerived = null, this._collecting = null, this._recompileNamedPending = null, this._recompileLoadedPending = null, this._invalidateNamedPending = null, this.resolveScope = (t) => this._symbols.resolve(de.Sheet, t)?.toString(), this._heldCloneKey = null, this._callbacks = t.callbacks, this._runtime = t.runtime, this._richData = t.richData ?? C.DetachedContext, this._symbols = t.symbols, this._resolvers = t.resolvers, this._getSheetIndex = t.getSheetIndex ?? null, this._legacyIntersect = !0 === t.legacyIntersect, this._gridOptions = t.gridOptions ?? {}, this._calculation = t.calculation;
|
|
7909
7906
|
const e = t.replica;
|
|
7910
7907
|
this._updateState({
|
|
7911
7908
|
gridsAll: /* @__PURE__ */ new Map(),
|
|
@@ -7924,8 +7921,8 @@ var ql = {
|
|
|
7924
7921
|
} }),
|
|
7925
7922
|
dynamicByBlock: /* @__PURE__ */ new Map(),
|
|
7926
7923
|
dirtySpatial: new wn()
|
|
7927
|
-
}), t.modelCommitId && this.mirror(t.modelCommitId), this._context = new io(this,
|
|
7928
|
-
createRichData: (t, e) =>
|
|
7924
|
+
}), t.modelCommitId && this.mirror(t.modelCommitId), this._context = new io(this, E.Axis.Column, t.functions), this._deferred = new Qo(this._calcScope, (t, e, n) => this._holderAt(t, e, n), () => this._runtime.getRandom(), () => this._settle(), void 0, (t, e) => this._normalizeResult(t, e), {
|
|
7925
|
+
createRichData: (t, e) => J.fromJSON({
|
|
7929
7926
|
type: t,
|
|
7930
7927
|
data: e
|
|
7931
7928
|
}, this._richData),
|
|
@@ -7935,7 +7932,7 @@ var ql = {
|
|
|
7935
7932
|
parseText: t.parseText
|
|
7936
7933
|
}, () => this._callbacks.onPendingChange());
|
|
7937
7934
|
const n = this._callbacks;
|
|
7938
|
-
this._calcExecutor = new Es(this, this._context), t.planCacheMode && (this._calcExecutor.planCacheMode = t.planCacheMode), this._externalBindings = new
|
|
7935
|
+
this._calcExecutor = new Es(this, this._context), t.planCacheMode && (this._calcExecutor.planCacheMode = t.planCacheMode), this._externalBindings = new Xl({
|
|
7939
7936
|
books: t.books,
|
|
7940
7937
|
createGrid: (t) => this.createBackendGrid({ uuid: t }),
|
|
7941
7938
|
unregisterGrid: (t) => {
|
|
@@ -7984,7 +7981,7 @@ var ql = {
|
|
|
7984
7981
|
let a = r.get(l);
|
|
7985
7982
|
if (!a) {
|
|
7986
7983
|
const t = this.getGrid(l);
|
|
7987
|
-
a = new ti(!t || t.getValues().getAxis() ===
|
|
7984
|
+
a = new ti(!t || t.getValues().getAxis() === E.Axis.Column), r.set(l, a);
|
|
7988
7985
|
}
|
|
7989
7986
|
a.add(s.rowIndex, s.colIndex);
|
|
7990
7987
|
}
|
|
@@ -8003,7 +8000,7 @@ var ql = {
|
|
|
8003
8000
|
if (Array.isArray(n)) try {
|
|
8004
8001
|
n = this._context.getRange(n);
|
|
8005
8002
|
} catch (t) {
|
|
8006
|
-
return new
|
|
8003
|
+
return new I.Value("The result is not a rectangular array", { cause: t });
|
|
8007
8004
|
}
|
|
8008
8005
|
return n?.isIRange && n.size <= 1 ? 0 === n.size ? null : n.getValueAt(0, 0) : (e?.keepBlanks && n?.isIRange && ((t) => {
|
|
8009
8006
|
Cn.add(t);
|
|
@@ -8013,7 +8010,7 @@ var ql = {
|
|
|
8013
8010
|
const r = this.getGrid(t);
|
|
8014
8011
|
if (!r) return null;
|
|
8015
8012
|
const o = r.getValues().getValueAt(e, n);
|
|
8016
|
-
return
|
|
8013
|
+
return kt(o) ? o : Ne(r.getSpills(), e, n);
|
|
8017
8014
|
}
|
|
8018
8015
|
_settleNow() {
|
|
8019
8016
|
const t = this._deferred, e = t.takeMoved();
|
|
@@ -8022,7 +8019,7 @@ var ql = {
|
|
|
8022
8019
|
let r = t.get(e);
|
|
8023
8020
|
if (!r) {
|
|
8024
8021
|
const o = n.gridsAll.get(e);
|
|
8025
|
-
r = new ti(!o || o.getValues().getAxis() ===
|
|
8022
|
+
r = new ti(!o || o.getValues().getAxis() === E.Axis.Column), t.set(e, r);
|
|
8026
8023
|
}
|
|
8027
8024
|
return r;
|
|
8028
8025
|
}, a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), d = [], h = (t) => {
|
|
@@ -8033,13 +8030,13 @@ var ql = {
|
|
|
8033
8030
|
if (null === _ || !o.isLiveNode(_)) continue;
|
|
8034
8031
|
const f = _.gridId, g = n.gridsAll.get(f);
|
|
8035
8032
|
if (!g) continue;
|
|
8036
|
-
const p = _.rowIndex,
|
|
8037
|
-
if (null ===
|
|
8038
|
-
if (!
|
|
8039
|
-
c.add(_), i(s, f).add(p,
|
|
8033
|
+
const p = _.rowIndex, m = _.colIndex, S = g.getValues().getValueAt(p, m), w = kt(S), E = w ? S : Ne(g.getSpills(), p, m);
|
|
8034
|
+
if (null === E || E.calls.indexOf(u) < 0) continue;
|
|
8035
|
+
if (!E.direct) {
|
|
8036
|
+
c.add(_), i(s, f).add(p, m);
|
|
8040
8037
|
continue;
|
|
8041
8038
|
}
|
|
8042
|
-
if (!
|
|
8039
|
+
if (!w || u.latest?.isIRange) {
|
|
8043
8040
|
d.push(_);
|
|
8044
8041
|
continue;
|
|
8045
8042
|
}
|
|
@@ -8048,18 +8045,18 @@ var ql = {
|
|
|
8048
8045
|
grid: g,
|
|
8049
8046
|
runs: i(/* @__PURE__ */ new Map(), f),
|
|
8050
8047
|
errors: /* @__PURE__ */ new Map()
|
|
8051
|
-
}), y.runs.add(p,
|
|
8048
|
+
}), y.runs.add(p, m);
|
|
8052
8049
|
const v = u.latest;
|
|
8053
|
-
if (
|
|
8050
|
+
if (I.isError(v)) {
|
|
8054
8051
|
const t = v.getLabel(), e = {
|
|
8055
|
-
colStart:
|
|
8052
|
+
colStart: m,
|
|
8056
8053
|
rowStart: p,
|
|
8057
|
-
colEnd:
|
|
8054
|
+
colEnd: m,
|
|
8058
8055
|
rowEnd: p
|
|
8059
8056
|
}, n = y.errors.get(t);
|
|
8060
8057
|
n ? n.push(e) : y.errors.set(t, [e]);
|
|
8061
8058
|
}
|
|
8062
|
-
_.state &= -6815749, Zl.colStart =
|
|
8059
|
+
_.state &= -6815749, Zl.colStart = m, Zl.colEnd = m, Zl.rowStart = p, Zl.rowEnd = p, Zl.scope = f;
|
|
8063
8060
|
const x = r.search(Zl);
|
|
8064
8061
|
for (let t = 0; t < x.length; t++) {
|
|
8065
8062
|
const e = x[t], n = e.value;
|
|
@@ -8071,7 +8068,7 @@ var ql = {
|
|
|
8071
8068
|
});
|
|
8072
8069
|
continue;
|
|
8073
8070
|
}
|
|
8074
|
-
|
|
8071
|
+
_n(e, p, m, h);
|
|
8075
8072
|
}
|
|
8076
8073
|
}
|
|
8077
8074
|
for (const [e, n] of a) {
|
|
@@ -8112,8 +8109,8 @@ var ql = {
|
|
|
8112
8109
|
createFormulaBlock(t, e, n, r, o, s, l) {
|
|
8113
8110
|
const i = this._callbacks.getCompiler(s);
|
|
8114
8111
|
if (!i) throw new Error("The calculation engine has not started; nothing can compile yet.");
|
|
8115
|
-
const a =
|
|
8116
|
-
return new bn(i.compile(e.getRuntime(), r, o, n, this._symbols, (t) => e.getFunction(t), a ?? c ?
|
|
8112
|
+
const a = ae(t)?.bookId ?? null, c = a ? null : ae(this._externalBindings.getNameById(t)?.getScope() ?? "")?.bookId ?? null;
|
|
8113
|
+
return new bn(i.compile(e.getRuntime(), r, o, n, this._symbols, (t) => e.getFunction(t), a ?? c ? ut(a ?? c, -1) : this.getSheetName(t), l, a ? { book: a } : void 0), e, this._calcScope, t, () => this.getGrid(t)?.getEntireCoords() ?? null, this._resolvers);
|
|
8117
8114
|
}
|
|
8118
8115
|
getSymbols() {
|
|
8119
8116
|
return this._symbols;
|
|
@@ -8130,15 +8127,15 @@ var ql = {
|
|
|
8130
8127
|
return this._sheetsCache().ids;
|
|
8131
8128
|
}
|
|
8132
8129
|
getSheetSpanIds(t) {
|
|
8133
|
-
const e =
|
|
8130
|
+
const e = Ae(t);
|
|
8134
8131
|
if (e) {
|
|
8135
8132
|
const t = this.getSheetIds(), n = t.indexOf(e[0]), r = t.indexOf(e[1]);
|
|
8136
8133
|
return -1 === n || -1 === r ? null : t.slice(Math.min(n, r), Math.max(n, r) + 1);
|
|
8137
8134
|
}
|
|
8138
|
-
const n =
|
|
8135
|
+
const n = ae(t);
|
|
8139
8136
|
if (!n || n.sheetEnd === n.sheetIndex) return null;
|
|
8140
8137
|
const r = [];
|
|
8141
|
-
for (let t = n.sheetIndex; t <= n.sheetEnd; t++) r.push(
|
|
8138
|
+
for (let t = n.sheetIndex; t <= n.sheetEnd; t++) r.push(ut(n.bookId, t));
|
|
8142
8139
|
return r;
|
|
8143
8140
|
}
|
|
8144
8141
|
getFormulas() {
|
|
@@ -8247,7 +8244,7 @@ var ql = {
|
|
|
8247
8244
|
}
|
|
8248
8245
|
markDirty(t) {
|
|
8249
8246
|
const e = this._getState(), n = e.dirtySpatial.clone(this._heldCloneKey), r = e.precedentSpatial, o = e.formulaSpatial;
|
|
8250
|
-
let s = !1, l =
|
|
8247
|
+
let s = !1, l = ot(t, E.Axis.Column, 2);
|
|
8251
8248
|
for (let t = 0; t < l.length; t++) {
|
|
8252
8249
|
const e = l[t];
|
|
8253
8250
|
(r?.has(e) || o?.has(e)) && (s = !0, n.insertNonOverlapping(e));
|
|
@@ -8497,15 +8494,15 @@ var ql = {
|
|
|
8497
8494
|
switch (n.type) {
|
|
8498
8495
|
case "sheets": return this.applySheets(n.sheets), {
|
|
8499
8496
|
cycleId: this._cycleId,
|
|
8500
|
-
commitId:
|
|
8497
|
+
commitId: V(n)
|
|
8501
8498
|
};
|
|
8502
8499
|
case "tables": return this.applyTables(n.changes), {
|
|
8503
8500
|
cycleId: this._cycleId,
|
|
8504
|
-
commitId:
|
|
8501
|
+
commitId: V(n)
|
|
8505
8502
|
};
|
|
8506
8503
|
case "names": return this.applyNames(n.changes), {
|
|
8507
8504
|
cycleId: this._cycleId,
|
|
8508
|
-
commitId:
|
|
8505
|
+
commitId: V(n)
|
|
8509
8506
|
};
|
|
8510
8507
|
case "nameGraph": return {
|
|
8511
8508
|
cycleId: this._cycleId,
|
|
@@ -8518,7 +8515,7 @@ var ql = {
|
|
|
8518
8515
|
const o = this.getGrid(t);
|
|
8519
8516
|
return o ? r ? o._apply(n, this.getCurrentCommitId(), !0) : o._apply(n, e) : {
|
|
8520
8517
|
cycleId: this._cycleId,
|
|
8521
|
-
commitId:
|
|
8518
|
+
commitId: V(n)
|
|
8522
8519
|
};
|
|
8523
8520
|
}
|
|
8524
8521
|
applyHeld(t, e) {
|
|
@@ -8583,7 +8580,7 @@ var ql = {
|
|
|
8583
8580
|
return l;
|
|
8584
8581
|
}
|
|
8585
8582
|
followRestore(t, e) {
|
|
8586
|
-
return e ===
|
|
8583
|
+
return e === ht.Status.Off || e === ht.Status.Error ? (this.retarget(t), !1) : e !== ht.Status.Running ? (null !== this.restoreTo(t) || this.holdsModelCommit(t) || this.retarget(t), !1) : this.holdsModelCommit(t) ? (this.restoreTo(t), !1) : (this.retarget(t), !0);
|
|
8587
8584
|
}
|
|
8588
8585
|
rebuild(t) {
|
|
8589
8586
|
this.drop(), this.setReplica(t), this.open();
|
|
@@ -8615,13 +8612,13 @@ var ql = {
|
|
|
8615
8612
|
if (u.deferCount !== l) {
|
|
8616
8613
|
const t = this._deferred, e = t.endEvaluation();
|
|
8617
8614
|
o.cachedValue = e.calls.length > 0 ? t.newHolder(a, e) : void 0, t.flush();
|
|
8618
|
-
} else
|
|
8619
|
-
let c =
|
|
8615
|
+
} else kt(o.cachedValue) && (o.cachedValue = void 0);
|
|
8616
|
+
let c = ln(t.finalizeValue(a));
|
|
8620
8617
|
return null === c && (c = 0), !r || c?.isIRange || Array.isArray(c) ? c : i.createRange(1, 1, c);
|
|
8621
8618
|
},
|
|
8622
8619
|
getCalls: () => {
|
|
8623
8620
|
const t = f.getAnchorNode().cachedValue;
|
|
8624
|
-
return
|
|
8621
|
+
return kt(t) ? t.calls : r.EmptyArray;
|
|
8625
8622
|
}
|
|
8626
8623
|
};
|
|
8627
8624
|
}
|
|
@@ -8638,7 +8635,7 @@ var ql = {
|
|
|
8638
8635
|
for (let t = 0; t < n.length; t++) {
|
|
8639
8636
|
const r = n[t].value;
|
|
8640
8637
|
if (null == r.gridId) continue;
|
|
8641
|
-
if (
|
|
8638
|
+
if (y(r.gridId) || this._externalBindings.getNameById(r.gridId)) continue;
|
|
8642
8639
|
const o = r.getReferencedSymbolIds();
|
|
8643
8640
|
if (0 === o.length) continue;
|
|
8644
8641
|
const s = r.ref, l = {
|
|
@@ -8701,10 +8698,10 @@ var ql = {
|
|
|
8701
8698
|
e ? e.push(l[t]) : s.set(u, [l[t]]);
|
|
8702
8699
|
continue;
|
|
8703
8700
|
}
|
|
8704
|
-
const _ = null != u && !n.isDefinedName(u) && !
|
|
8701
|
+
const _ = null != u && !n.isDefinedName(u) && !y(u) && !this._externalBindings.getNameById(u);
|
|
8705
8702
|
if (h && _) for (let t = 0; t < o.length; t++) {
|
|
8706
8703
|
const [e, n] = o[t];
|
|
8707
|
-
a.includes(e) && (h = h.replaceTableReferences(e, (t) => jt(t, n) ?
|
|
8704
|
+
a.includes(e) && (h = h.replaceTableReferences(e, (t) => jt(t, n) ? Zt() : null));
|
|
8708
8705
|
}
|
|
8709
8706
|
const f = h && h !== i.formula ? h.getTextAt(d.rowStart, d.colStart) : i.getTextAt(d.rowStart, d.colStart);
|
|
8710
8707
|
this._writeBlockText(i, f);
|
|
@@ -8712,7 +8709,7 @@ var ql = {
|
|
|
8712
8709
|
if (s) for (const [t, e] of s) this.getGrid(t)?._rederivePrecedentsNow(e);
|
|
8713
8710
|
}
|
|
8714
8711
|
refitTableRows(t, e, n, r, s) {
|
|
8715
|
-
const l = this._symbols.bind(
|
|
8712
|
+
const l = this._symbols.bind(de.Sheet, t);
|
|
8716
8713
|
if (!l) return;
|
|
8717
8714
|
const i = this._getState().precedentSpatial.search({
|
|
8718
8715
|
colStart: e.colStart,
|
|
@@ -8726,7 +8723,7 @@ var ql = {
|
|
|
8726
8723
|
const e = i[t].value;
|
|
8727
8724
|
if (e.index < 0) continue;
|
|
8728
8725
|
const n = e.formulaEntry.value, r = n.gridId;
|
|
8729
|
-
if (null == r ||
|
|
8726
|
+
if (null == r || y(r) || this._externalBindings.getNameById(r)) continue;
|
|
8730
8727
|
const o = (a ??= /* @__PURE__ */ new Map()).get(n);
|
|
8731
8728
|
o ? o.includes(e.index) || o.push(e.index) : a.set(n, [e.index]);
|
|
8732
8729
|
}
|
|
@@ -8792,11 +8789,11 @@ var ql = {
|
|
|
8792
8789
|
}
|
|
8793
8790
|
}
|
|
8794
8791
|
rewriteTableReferences(t, e) {
|
|
8795
|
-
const n = (t) => e ?
|
|
8792
|
+
const n = (t) => e ? ke(t, e) : Zt(), r = this._callbacks, o = this._getState().formulaSpatial.all3D();
|
|
8796
8793
|
for (let e = 0; e < o.length; e++) {
|
|
8797
8794
|
const s = o[e].value, l = s.gridId;
|
|
8798
8795
|
if (null == l || !s.getReferencedSymbolIds().includes(t)) continue;
|
|
8799
|
-
if (r.isDefinedName(l) ||
|
|
8796
|
+
if (r.isDefinedName(l) || y(l) || this._externalBindings.getNameById(l)) continue;
|
|
8800
8797
|
const i = s.formula, a = i?.replaceTableReferences(t, n);
|
|
8801
8798
|
if (!a || a === i) continue;
|
|
8802
8799
|
const c = s.ref;
|
|
@@ -9177,7 +9174,7 @@ var ql = {
|
|
|
9177
9174
|
scope: void 0
|
|
9178
9175
|
}, ti = class {
|
|
9179
9176
|
constructor(t) {
|
|
9180
|
-
this._unordered = null, this._lastMajor = -1, this._lastMinor = -1, this._isColumn = t, this._conflating =
|
|
9177
|
+
this._unordered = null, this._lastMajor = -1, this._lastMinor = -1, this._isColumn = t, this._conflating = z(t);
|
|
9181
9178
|
}
|
|
9182
9179
|
add(t, e) {
|
|
9183
9180
|
const n = this._unordered;
|
|
@@ -9206,7 +9203,7 @@ var ql = {
|
|
|
9206
9203
|
colEnd: t.colEnd,
|
|
9207
9204
|
rowEnd: t.rowEnd
|
|
9208
9205
|
}), ni = (t) => {
|
|
9209
|
-
const e =
|
|
9206
|
+
const e = ot(t, E.Axis.Column, 2), n = new Array(e.length);
|
|
9210
9207
|
for (let t = 0; t < e.length; t++) {
|
|
9211
9208
|
const r = e[t];
|
|
9212
9209
|
n[t] = {
|