@sheetxl/mcp 0.8.0-beta.16 → 0.8.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/instructions.md +15 -4
- package/assets/{B_nQLUWaxp-Q1IfV.js → -cMvbaW1kvHslPKX.js} +2 -2
- package/assets/{D1g6IOzdvInVLV-x.js → 0kfwZuOHUkJmVjg6.js} +6 -6
- package/assets/{Gqh12ggLm5KlvN3v.js → 1feDuXw6tBXu2XFg.js} +1 -1
- package/assets/{DmLbqbAez7Dzwyl7.js → 4qMP71Fe1Ep8kbOX.js} +1 -1
- package/assets/{AjWB-QdIkr07kToW.js → 7TRx0dMYnL2i4tqL.js} +193 -193
- package/assets/{iqQWGoJaPha0_8lU.js → 8cVPexxAVrFJ9QLX.js} +1 -1
- package/assets/{C-AIgWmHugqMcl9J.js → APP8AzsNgQXHTalA.js} +2 -2
- package/assets/{Cl98sBOj9GM2XnFe.js → AnF1Kh3Vo2AniIYO.js} +2 -2
- package/assets/{B2YEEPHIkNcezk9T.js → B2BfjRdJGZs6afVL.js} +2 -2
- package/assets/{DEIkGoOZ_WeuY0Lj.js → B2UxLSteMiPlg8Uu.js} +1 -1
- package/assets/{BiGm1tKvxUh8oWbD.js → B3mh2tuvP-lMP6f_.js} +1 -1
- package/assets/{CG8zvnxueimOY7wm.js → B6NnxkSmEzCGZEZA.js} +1 -1
- package/assets/{DFAqI-o57Kd_Azlt.js → B7Nqa7V-v0cxGBux.js} +1 -1
- package/assets/{DTLbKr_XIJMwQJmk.js → B7OyFSpBb1eBvMVd.js} +13 -13
- package/assets/{CFdJvXLSbUrvNera.js → B8JX7a6VZlBNA_Bd.js} +8 -8
- package/assets/{Z01wJImjl6lBMpf4.js → B9J8nV-dh6jHpzZI.js} +1 -1
- package/assets/{C75i_5ip7OhGkuiF.js → B9M_sgHpoc-op6FF.js} +1 -1
- package/assets/{POdlv6cpSx6ftJxx.js → BBC_WF8BcAH-k_cQ.js} +1 -1
- package/assets/{DdrsYdX3bLixdb_9.js → BGZ_ltNFYvnAmbVR.js} +1 -1
- package/assets/{BNrpvJZtIL0Ex_wE.js → BJBoygm-gY68bLAP.js} +15 -15
- package/assets/{SaCo3me4_hw2b1L4.js → BJdWgj1hv57eGVl4.js} +389 -389
- package/assets/{Co_y6GfwJTYtOmlt.js → BKRLtOdVOUTrLjQN.js} +3 -3
- package/assets/{DNhfziNrJGdL8BYs.js → BKjovBsLpX2Fkhov.js} +6 -6
- package/assets/{pQUJKbHGetb7dcOr.js → BMJhHHX2LWgOJWGz.js} +1 -1
- package/assets/{D-irgQZ2WmkP9dnK.js → BOx4Ut_Rme7NH34X.js} +1 -1
- package/assets/{DfzLOnWTNL_2J90y.js → BQYpVYbvfWuUJgdx.js} +1 -1
- package/assets/{BtNRIFE92ka4hATo.js → BS4ZsfH5D6aemSpO.js} +1 -1
- package/assets/{CZepo1lDTQp1myg6.js → BSAdmOdx3brRE9LW.js} +1 -1
- package/assets/{DFn_thWGK0_EZI5k.js → BSY9Tbmz6VEY_F_x.js} +1 -1
- package/assets/{Dd8CHUZz7xuYTfp-.js → BT8AGlSg2t7V1QNj.js} +488 -488
- package/assets/{SB2aKOIVln0EkgXR.js → BUV7BlOZcuPgDZ__.js} +1 -1
- package/assets/{BbXlmp8W_cbr75FN.js → BX5xFncPLyeN7TqA.js} +5 -5
- package/assets/{3t-I20nDzFHBd5UJ.js → Bcak_hZpcIkB2gJD.js} +1 -1
- package/assets/{C0JSC9gVwR1QxopD.js → BdijGsy5W7yZ_I_n.js} +1 -1
- package/assets/{QVWayvB03YMyTKt3.js → BebXDUnlrDDRGW60.js} +2 -2
- package/assets/{D7iU4kaxzl_PojNt.js → BgldX21zhey2aR9D.js} +1 -1
- package/assets/{DQcus4X_kTKIIyX6.js → BhCbCEPpDzhg5nqL.js} +1 -1
- package/assets/{BZbxPclVVopktv3l.js → Bj4BFLBC9Tf6SGSt.js} +1 -1
- package/assets/{Di4ehJD7muvtcrN3.js → BjhAYfsKC8iEbtgn.js} +40 -40
- package/assets/{Ct5VTtdW77k-WcP_.js → BjnQVl1lb1KEbt2D.js} +51 -51
- package/assets/{CAEhAL7-0FG7jdzN.js → BlbxiLf1zD6_fWZs.js} +1 -1
- package/assets/{JC8UUcu6m23qqrr3.js → BmM-nHMAAuNatCcN.js} +1 -1
- package/assets/{BlWfQ5HPEehB_lPz.js → Bni-y4FJS4rkFYtn.js} +107 -107
- package/assets/{C2dG4GHThf9O-IJy.js → BodrfKIAhDFD-X3t.js} +1 -1
- package/assets/{C_0RM0w6Pw70Bx_Y.js → BvDcHHJvQMRHthm-.js} +1 -1
- package/assets/{4vS8pASPZSU7QcRZ.js → Bw_FtA-1886HMCLJ.js} +3 -3
- package/assets/{2GLqCzpAJP6jbaRx.js → Bxkx8QokmRNyXbOI.js} +5 -5
- package/assets/{B3MqN3t5naY3moOk.js → Bz1ImBvJwPwBrA5j.js} +1 -1
- package/assets/{BpgPKKZwxXklRyo7.js → C2NPIWe0pLs3PAZM.js} +2 -2
- package/assets/{DzkccbbE6iXMqQDO.js → C2ZX6ffXsMaEr2d2.js} +305 -305
- package/assets/{nmB0nnkFQf5NWo0i.js → C3Q-fjiZZ15waCq_.js} +2 -2
- package/assets/{CsjjeeOHE2624pGt.js → C46RpMrfF6FiEFI7.js} +1 -1
- package/assets/{LwFDS0HxPZKiiEnN.js → C4deMY87Q_haYyLF.js} +1 -1
- package/assets/{CW-ivE6pl3V7vKuT.js → C7iHn3y3HVBHflpA.js} +4 -4
- package/assets/{CVRc6jQcH155Z89u.js → CJF3P7U7yBQVF2Cg.js} +1 -1
- package/assets/{B16N6VSLY5HPgVkD.js → CLgvdaqeFlESLvbF.js} +1 -1
- package/assets/{BUAq-ENCmL0XGLIu.js → CLze192iF2o-aETZ.js} +1 -1
- package/assets/{CX-6eYkcr5y0VmQm.js → CMRLNLqYkiqCLMRa.js} +3 -3
- package/assets/{CAMrW5ypKhgn105y.js → COa691om4fLN4CUy.js} +1 -1
- package/assets/CSLLHl-zum7m1CJl.js +14 -0
- package/assets/{DJdRl2yX9DP_D8kh.js → CUbCBf24Ie4A2l4R.js} +2 -2
- package/assets/{CDqG64rXHp9-2tXr.js → CWLleOolFzyT0COW.js} +1 -1
- package/assets/{C3Wibs7QGFZ1FI7W.js → CaJ9j3l0cERnYqDS.js} +1 -1
- package/assets/{CrwtgrD7BbXyCkx0.js → CfA8o-FNret9-D6Y.js} +1 -1
- package/assets/{BbDKWV_FQAICqZjP.js → Cl7HHR6Vc9S4n3AP.js} +1 -1
- package/assets/{DKRa_Oc4XqB3DABB.js → CqjNsZ2OB4Kx6J3s.js} +8 -8
- package/assets/{soSlr334Fv1j5t2m.js → CqwEHSKivMYw7tRZ.js} +1 -1
- package/assets/{Dg4JXbd1yPGNZOtL.js → Cr6lm0oXZJaaoAmD.js} +1 -1
- package/assets/{Dp-dLoOaBndV2N5i.js → CshK6Ew7OQ7mngI3.js} +2 -2
- package/assets/{DBMZF6PRHCko9K9R.js → CsiIgnb_L2x2Go6g.js} +1 -1
- package/assets/{BYqyNLuwXl7GKuzh.js → CtmrBbpapaNwjwNB.js} +28 -28
- package/assets/{DvFwVzuc5YfagNnH.js → CwRhhoL5ynbe78dB.js} +1 -1
- package/assets/{C95HXhZkkhnUx_aE.js → CyI1eGGzJX8nJXaT.js} +2 -2
- package/assets/{DMhtIFfkX-DZT_e3.js → Cz4H3Qge2u8er3Ny.js} +3 -3
- package/assets/{BrtLeTsrulaU6osB.js → D0OQ6ka8so0BWPwL.js} +1 -1
- package/assets/{CJa8JVvKGVBz8Q7q.js → D336KioeSjd-T8n3.js} +2 -2
- package/assets/{DBANZf_eAzaCFdIj.js → D5L35C8cbX16BSCF.js} +227 -227
- package/assets/{DOZ40EyxD3m0gCos.js → D5VFuX1h50V2jLmZ.js} +305 -305
- package/assets/{5B_tapYOcjOv1wGO.js → D6ON3ZLcTAXV3fO6.js} +8353 -8352
- package/assets/{BsFWmVYPrLyh5Dre.js → DDhPOQPc-lpyZrUJ.js} +4 -4
- package/assets/{iULnLPcNKVpz00r7.js → DE4xC78p5UtS7wH6.js} +1 -1
- package/assets/{-PtBguqpLi7Nr4Df.js → DF7-oRscXc_vkMo8.js} +1 -1
- package/assets/{BIUUGUhypimIDg2a.js → DMuOMpgIhVgB3eG8.js} +1 -1
- package/assets/{TNQaiw20sEAEUiK5.js → DPKeRb9GKmh_WCPv.js} +1 -1
- package/assets/{9MXt8KXdWlbEJNc2.js → DSsH28SW8CMrSL-q.js} +1 -1
- package/assets/{D2YdqNWXwSHJMPbA.js → DV6WSFmSEKfb3d2s.js} +4 -4
- package/assets/{Bdt9nQs8gDIzu_IG.js → DYJcfrNUUJQtxXWX.js} +1 -1
- package/assets/{DLhlBqwsDnmscAuL.js → D_peM8fbRgGaWvpq.js} +1 -1
- package/assets/{D7ibkNIu_Pn4TeBD.js → DeEZvPW-VvlE28oE.js} +3 -3
- package/assets/{CL1-ziDI0aAaVbhJ.js → Dgi2xwb2DN2Gybj3.js} +2 -2
- package/assets/{BiE9M6RctwQ339_7.js → DidhZpf9qJAei29Y.js} +1 -1
- package/assets/{BlIrJwQGEASCgJdZ.js → Dkg-LQVsZlrHk7A8.js} +1 -1
- package/assets/{BBPjYcS8XKQREith.js → DnTfXqCnRCe-1QYI.js} +61 -61
- package/assets/{CVbRpT7QPHOMgwTx.js → DoBvgI3Ry8DlGzwQ.js} +1 -1
- package/assets/{BjDsx_FHl0mShqHX.js → DrHVew6gwOB6oxCn.js} +1 -1
- package/assets/{BRLA4pJWiYdpW-69.js → Dre79rTMoYYikNuB.js} +19 -19
- package/assets/{DaILIYfy-jPVTXjz.js → DsCNtBR5jCeqmLBS.js} +2 -2
- package/assets/{W2FU69Pfo4chpqtk.js → Dzz3yrKbECzg6caR.js} +1 -1
- package/assets/{nDmE2I07HvkpRdR0.js → FvxN6PPps-rNPDo8.js} +1 -1
- package/assets/{DfWWAHOjmhqvN3m_.js → G2Wjyx_ETCAcofwm.js} +130 -130
- package/assets/{YXC__Myl-BuIFW6s.js → IGAV8DdYH32cW8XU.js} +1 -1
- package/assets/{C-gN7uBg-MWHRo4g.js → Jd71-QCmFEcDcYSw.js} +1 -1
- package/assets/{CBPkPTmeaEokFPSI.js → Ljri8sTW3dWT4clD.js} +1 -1
- package/assets/{D3bxrF1Ys2GSVfQH.js → MW2nt7se27FlH9Yb.js} +1 -1
- package/assets/{8NrxfSWBHDaEJvhz.js → Mgs_OJP41a-Nfac3.js} +1 -1
- package/assets/{CvJkwRgwm80S2bcd.js → OHBzl-tZOi9Ni8YV.js} +1 -1
- package/assets/{BR66nPIzyzlOcP10.js → PbBzI4PlKpCgULLd.js} +1 -1
- package/assets/{DR9xHYH6v5G0lOqf.js → UH_biJmLrI9SvckA.js} +3 -3
- package/assets/{DFvs1LVzXKm1N5M2.js → Xe7sA_mEwDQpJjcF.js} +2 -2
- package/assets/{Dy67BUF2yd8VRPwL.js → YFiGplEq1G4XdCJ2.js} +1 -1
- package/assets/{BuhHuKVWppW4L8AV.js → YQtUMMGmb1_WFsh_.js} +1 -1
- package/assets/{BCSRsSAEPlwR59H5.js → dcvgOfBmWFTsXoT8.js} +4 -4
- package/assets/{Ci7-PIIhZwb2mVv5.js → iBgLe32XErisaUSr.js} +1 -1
- package/assets/{rfwqMukKbJBeJBuC.js → kpS1vY0DcE9p8JnI.js} +2 -2
- package/assets/{BdMebk9YSA0oxQ_d.js → lcIaYgz4tQGBlzlo.js} +67 -67
- package/assets/{CK9h6iDOreaI8GEt.js → nQbVdQrfdz3osBdi.js} +3 -3
- package/assets/{CoIjAX2gECGb3Wxl.js → oJNJQJEDQCsjHSmo.js} +1 -1
- package/assets/{3_NofB4A4Qhl-4YY.js → qgW-p2sFhMtuu5yw.js} +1 -1
- package/assets/{h6EQSu5n2vTsu2yd.js → z24-oIqP_fu2hsOt.js} +1 -1
- package/assets/{CIqJdIUKSLZkNwHy.js → z7nDK_gfX7G37XbZ.js} +34 -34
- package/index.js +205 -205
- package/lib.js +1 -1
- package/licenses/dependencies.txt +35 -35
- package/package.json +2 -2
- package/screenshot-page/assets/{D8s3sJnhFxbI3Dqn.js → 7Xk_eQAcM_HgWrOC.js} +1 -1
- package/screenshot-page/assets/{CQFj5AGXfIA9z9zI.js → B1W17rc9ilPFCh31.js} +1 -1
- package/screenshot-page/assets/B8UkvH0o9n_G5UO9.js +3 -0
- package/screenshot-page/assets/{CZa1rha3RnQUWyOk.js → BD96fN2dSVuoME09.js} +4 -4
- package/screenshot-page/assets/BE8ea8S0Q-qogeEs.js +2 -0
- package/screenshot-page/assets/{BU5S8KEzPmIA_Flm.js → BKwVcuWOKeH2xREA.js} +1 -1
- package/screenshot-page/assets/BNMBa8EZgWX2Eb3c.js +1 -0
- package/screenshot-page/assets/{Db6bZVJ-184DJIoe.js → BQCyH9YbEgnH78Ke.js} +2 -2
- package/screenshot-page/assets/BcDxaEii3arJqOym.js +1 -0
- package/screenshot-page/assets/Be-rukvcufhLamH5.js +1 -0
- package/screenshot-page/assets/{Dq7wGcTrNIshovlT.js → Bh33WyohJvbKZVQN.js} +2 -2
- package/screenshot-page/assets/C2ty_K_uix4ooip6.js +1 -0
- package/screenshot-page/assets/C9mUKjQ3yEzRu9j2.js +2 -0
- package/screenshot-page/assets/{DDkL9PZPXAggW2Yr.js → CB2mQ5rbaSw2W4ik.js} +23 -23
- package/screenshot-page/assets/{DLFFFQjTi5Ji1940.js → CCVAsuUimIJOkBnk.js} +1 -1
- package/screenshot-page/assets/{D7biuwkvm3zAwsBa.js → COoMVTzF50qBNFEu.js} +3 -3
- package/screenshot-page/assets/{Bir0SSOHX0w2yo8h.js → CSMEGhAHxl5-4FxB.js} +1 -1
- package/screenshot-page/assets/{rOzyaU7hqchMbhRL.js → CT7cY57t9j1sBhAy.js} +1 -1
- package/screenshot-page/assets/{BJ2r2WfEL3SgkBAX.js → CTjUtxDw6Z2I9OGc.js} +1 -1
- package/screenshot-page/assets/{BIrVK5hdDCUYmxGO.js → CUZobZ3mfNAdEisS.js} +1 -1
- package/screenshot-page/assets/{ClzJdxlUDDtBYjH8.js → C_OuKbe6z1it80cj.js} +1 -1
- package/screenshot-page/assets/Cbcv49b9jWyY4HKj.js +2 -0
- package/screenshot-page/assets/CtZFqwLoeJOvwFrl.js +42 -0
- package/screenshot-page/assets/Cz6KFmsp267l_VZS.js +1 -0
- package/screenshot-page/assets/{lgeNUp9cU20IAotv.js → D0koRjO2KnWQ1fNV.js} +1 -1
- package/screenshot-page/assets/{cTMKPkmZF8FWQaMn.js → DCP8JXEeiwAMiVD2.js} +1 -1
- package/screenshot-page/assets/DQAZPADvH5lhlMnK.js +1 -0
- package/screenshot-page/assets/DQBUH0j44Vtrykua.js +13 -0
- package/screenshot-page/assets/{DyiVrm8mEnEaoZHa.js → DSKOOgcJQeqIc9Us.js} +1 -1
- package/screenshot-page/assets/{CguXw0IcKNPbmAbj.js → DXaM3CulPA3aPGV1.js} +2 -2
- package/screenshot-page/assets/{CqyMYduWKFvmMs_Z.js → DcUOAH274IbYOuK1.js} +1 -1
- package/screenshot-page/assets/{CRsTnamLrPN5-Dsi.js → DdXSKhFUAsKUsQ1u.js} +1 -1
- package/screenshot-page/assets/Djl40tfWoPJSvqtv.js +1 -0
- package/screenshot-page/assets/TCImIYUUdVD4Z35I.js +1 -0
- package/screenshot-page/assets/dQsis-90Up-pIkSq.js +4 -0
- package/screenshot-page/assets/{Dn5PwRw7rrTKNnql.js → dXn1GWWjYmuLb1HF.js} +8 -8
- package/screenshot-page/index.html +5 -5
- package/assets/DsTi7zHk_Xl37bAD.js +0 -14
- package/screenshot-page/assets/B7eQ3rE-7Vayb_4O.js +0 -2
- package/screenshot-page/assets/B8i4Sr2kMQAXp0rb.js +0 -4
- package/screenshot-page/assets/BIHbD4jMsk3NetOd.js +0 -1
- package/screenshot-page/assets/BJviQwDXR5L6l1DA.js +0 -1
- package/screenshot-page/assets/BM78thqEW6HwXFAK.js +0 -13
- package/screenshot-page/assets/C2H2lX8eyKpxpP6M.js +0 -2
- package/screenshot-page/assets/CYfkL98Zu43S8-50.js +0 -42
- package/screenshot-page/assets/CzsoLbEIUVK5ia1C.js +0 -1
- package/screenshot-page/assets/D2IHCJ1QWDKwmhge.js +0 -1
- package/screenshot-page/assets/DMxrNtfw275en7pm.js +0 -1
- package/screenshot-page/assets/D_kJ3WunvjIINcHC.js +0 -1
- package/screenshot-page/assets/DhB6GjSJIeTmIODk.js +0 -1
- package/screenshot-page/assets/TilS2JSBGVkd1za3.js +0 -3
- package/screenshot-page/assets/UKFgEuwI1UMhPqKF.js +0 -2
- package/screenshot-page/assets/hlxJ87-H830aSZBQ.js +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BNMBa8EZgWX2Eb3c.js","./CCVAsuUimIJOkBnk.js","./CbXtAM7H-Jg_J0dk.js","./-cpi3yOZYn6GsYN4.js","./CXGgKVbVXjWzE0p6.js","./BEwl-ucV9Jfr0RoC.js","./CN8u05DjKwNHbUHN.js","./ChSvXfVMLxZsP9zG.js","./HclGiUj8dZXDFmoM.js","./B8qybUclSjEYP5FJ.js","./J73KTOmdZGNmnq-z.js","./Cbcv49b9jWyY4HKj.js","./C_OuKbe6z1it80cj.js","./DuYb_otrRZZDq6-f.js","./3Ls_kOvlQseMV8Q0.js","./nHThFXCAZFOM_npq.js","./BftXEPOuf5Uwxpud.js","./Bh33WyohJvbKZVQN.js","./DXaM3CulPA3aPGV1.js","./9w0ECZmzGUyk3F_O.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,n,r,t as i}from"./-cpi3yOZYn6GsYN4.js";import{n as a}from"./DKVB6ddRfDJatYid.js";import{n as o,t as s}from"./CXGgKVbVXjWzE0p6.js";import{n as c,t as l}from"./BEwl-ucV9Jfr0RoC.js";import{t as u}from"./CXUO3vYip3JPSJ7A.js";import{t as d}from"./HclGiUj8dZXDFmoM.js";import{C as f,E as p,F as m,I as h,K as g,L as _,M as v,O as y,V as b,Y as x,Z as S,_ as C,i as w,l as T,n as E,r as D,u as O,w as k,y as A}from"./ChSvXfVMLxZsP9zG.js";import{r as j,t as M}from"./B8qybUclSjEYP5FJ.js";import{$ as N,A as P,B as F,C as I,D as L,E as R,G as ee,H as z,I as B,J as V,K as H,L as U,M as W,N as te,O as G,P as ne,Q as re,R as ie,T as ae,U as oe,V as se,W as ce,X as K,Z as le,_ as ue,a as de,at as fe,b as pe,c as me,ct as he,d as ge,et as _e,f as ve,h as ye,i as be,it as xe,j as Se,k as Ce,l as we,lt as Te,nt as Ee,o as De,ot as Oe,p as ke,q as Ae,r as je,rt as Me,st as Ne,t as Pe,tt as Fe,u as Ie,v as Le,w as Re,x as ze,y as Be}from"./CN8u05DjKwNHbUHN.js";import{a as Ve,i as He,n as Ue,r as We}from"./LYyM_ig973jLdOU0.js";import{n as Ge,t as Ke}from"./J73KTOmdZGNmnq-z.js";import{$ as qe,A as Je,B as Ye,C as Xe,D as Ze,E as Qe,F as $e,G as et,H as tt,I as nt,J as rt,K as it,L as at,M as ot,N as st,O as ct,R as lt,S as ut,T as dt,U as ft,V as q,W as pt,X as mt,Y as ht,Z as gt,_ as _t,a as vt,b as yt,c as bt,d as xt,f as St,g as Ct,h as wt,i as Tt,j as Et,k as Dt,l as Ot,m as kt,n as At,o as jt,p as Mt,q as Nt,r as Pt,s as Ft,t as It,u as Lt,v as Rt,w as zt,x as Bt,y as Vt,z as Ht}from"./Cbcv49b9jWyY4HKj.js";import{a as Ut,c as Wt,d as Gt,f as Kt,i as qt,l as Jt,m as Yt,n as Xt,o as Zt,r as Qt,s as $t,t as en,u as tn}from"./BQCyH9YbEgnH78Ke.js";import{t as nn}from"./BTOQaSn9DDyJPUlX.js";import{t as rn}from"./zFbb8ESzwR_bE7IQ.js";import{n as an}from"./C71ZZMVLfHdPl441.js";import{t as on}from"./C9SC-cEIt6gdhZRw.js";import{n as sn,r as cn}from"./BowRIybLgENunTOT.js";import{C as ln,D as un,K as dn,Kt as fn,Ot as pn,W as mn,X as hn,Yt as gn,Z as _n,ht as J,kt as vn,lt as yn,t as bn,v as xn,wt as Sn}from"./DuYb_otrRZZDq6-f.js";import{c as Y,i as Cn,t as wn}from"./BMf827t1Ul65MHd5.js";import{Ai as Tn,Cn as En,F as Dn,Fr as On,Ht as kn,It as An,Oa as jn,Qt as Mn,Wr as Nn,_r as Pn,at as Fn,en as In,fr as Ln,gt as Rn,ji as zn,jn as Bn,lt as Vn,m as Hn,ma as Un,na as Wn,ni as Gn,pa as Kn,t as qn,tr as Jn,wr as Yn,zn as Xn}from"./dXn1GWWjYmuLb1HF.js";import{c as Zn,i as Qn,p as $n,r as er,t as tr,u as nr}from"./dQsis-90Up-pIkSq.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var rr=e(n(),1),X=e(t(),1),Z=i(),ir=e(r(),1);(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._header_vt581_7{background:var(--sxl-color-base-100,#f5f5f5);color:color-mix(in srgb, var(--sxl-color-base-content,#000) 87%, transparent);line-height:1.2;font-family:var(--sxl-doc-font-minor,"Calibri", sans-serif);align-items:end;display:flex;overflow:hidden}._header_vt581_7._hover_vt581_18{background:var(--sxl-color-base-hover,#ececec)}._header_vt581_7._filtered_vt581_25{color:var(--sxl-color-info,#3b82f6)}._header_vt581_7._selected_vt581_33{background:var(--sxl-color-base-selected,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 20%, transparent));color:var(--sxl-color-base-selected-content,var(--sxl-color-primary,#1976d2))}._header_vt581_7._selectedAll_vt581_42{background:var(--sxl-color-base-emphasis,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 75%, var(--sxl-color-base-100,#f5f5f5)));color:var(--sxl-color-base-emphasis-content,var(--sxl-color-primary-content,#fff))}._panel_14jxb_5{min-width:0;max-width:100%;color:var(--sxl-color-base-content,inherit);background:var(--sxl-color-base-100,transparent);flex-direction:column;display:flex}._search_14jxb_16{margin:4px 4px 2px}._values_14jxb_24{min-width:100%}._empty_14jxb_28{opacity:.6;white-space:nowrap;cursor:default;padding:4px 10px}._prompt_3wjdi_8{box-sizing:content-box;color:light-dark(#1f1f1f,#e8e8e8);cursor:default;user-select:none;background:light-dark(#fffbe6,#3d3a2a);border:1px solid light-dark(#c9c2a0,#6a6448);border-radius:3px;padding:4px 6px;box-shadow:0 2px 6px light-dark(#0000002e,#00000080)}._line_3wjdi_24{white-space:pre}._title_3wjdi_28+._message_3wjdi_28{margin-top:2px}._alert_3wjdi_34{box-sizing:border-box;max-width:320px;font-size:var(--sxl-font-size,13px);color:var(--sxl-color-base-content,#000000de);background:var(--sxl-color-elevated,#fff);border:1px solid var(--sxl-color-base-border,#00000042);box-shadow:0 4px 16px var(--sxl-color-shadow,#0003);white-space:pre-line;cursor:default;border-left-width:4px;border-radius:4px;padding:8px 12px;line-height:1.45}._alertRow_3wjdi_52{align-items:flex-start;gap:6px;display:flex}._alertIcon_3wjdi_58{margin-top:2px;display:inline-flex}._alertTitle_3wjdi_63{font-weight:600}._alertHint_3wjdi_67{opacity:.75;margin-top:4px}._preview_d64gw_2{grid-template-rows:0fr;grid-template-columns:minmax(0,1fr);display:grid}._previewShown_d64gw_8{grid-template-rows:1fr}._previewSlide_d64gw_12{animation:.18s ease-out _previewReveal_d64gw_1}._previewClip_d64gw_16{min-height:0;overflow:hidden}@keyframes _previewReveal_d64gw_1{0%{opacity:0;grid-template-rows:0fr}}@media (prefers-reduced-motion:reduce){._previewSlide_d64gw_12{animation:none}}._PivotFields_1e9c2_4{min-height:0;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--sxl-font-size,13px);color:var(--sxl-color-base-content,light-dark(#000000de,#ffffffde));flex-direction:column;flex:auto;gap:8px;display:flex}._Search_1e9c2_15{box-sizing:border-box;width:100%;padding:var(--sxl-input-padding,4px 6px);border:1px solid var(--sxl-color-input-border,light-dark(#0003,#fff3));border-radius:var(--sxl-input-radius,4px);background:var(--sxl-input-bg,transparent);color:inherit;font:inherit;&:focus{outline:2px solid var(--sxl-color-primary,#1a73e8);outline-offset:-1px}}._FieldList_1e9c2_30{border:1px solid var(--sxl-color-input-border,light-dark(#0003,#fff3));border-radius:var(--sxl-input-radius,4px);flex:120px;min-height:80px;margin:0;padding:2px 0;list-style:none;overflow:auto}._FieldRow_1e9c2_41{cursor:grab;user-select:none;align-items:center;gap:6px;padding:2px 6px;display:flex;&:hover{background:var(--sxl-color-base-hover,light-dark(#0000000a,#ffffff14))}& input{cursor:pointer;margin:0}}._FieldName_1e9c2_57{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}._TypeGlyph_1e9c2_65{opacity:.6;flex:none;justify-content:center;align-items:center;min-width:22px;display:inline-flex}._FilterMark_1e9c2_74{color:var(--sxl-color-primary,#1a73e8);flex:none;display:inline-flex}._Empty_1e9c2_80{opacity:.6;padding:4px 6px}._Areas_1e9c2_86{flex:none;grid-template-columns:1fr 1fr;gap:8px;display:grid}._Area_1e9c2_86{flex-direction:column;gap:2px;min-width:0;display:flex}._AreaLabel_1e9c2_100{opacity:.87;font-weight:600}._AreaList_1e9c2_105{border:1px solid var(--sxl-color-input-border,light-dark(#0003,#fff3));border-radius:var(--sxl-input-radius,4px);flex-direction:column;gap:2px;min-height:88px;max-height:160px;margin:0;padding:2px;list-style:none;display:flex;overflow:auto;&.over{border-color:var(--sxl-color-primary,#1a73e8);background:var(--sxl-color-base-hover,light-dark(#0000000a,#ffffff14))}}._AreaHint_1e9c2_123{opacity:.5;pointer-events:none;margin:auto;font-size:11px}._Chip_1e9c2_130{box-sizing:border-box;border:1px solid var(--sxl-color-base-border,light-dark(#00000042,#ffffff42));background:var(--sxl-color-elevated,light-dark(#fff,#2b2b2b));width:100%;min-height:24px;color:inherit;font:inherit;text-align:left;border-radius:4px;align-items:center;gap:4px;padding:0 2px 0 0;display:flex;&:has(._ChipCaption_1e9c2_144:focus-visible){outline:2px solid var(--sxl-color-primary,#1a73e8);outline-offset:-1px}&.dragging{opacity:.4}&.overlay{cursor:grabbing;box-shadow:0 2px 8px var(--sxl-color-shadow,#0003)}}._ChipCaption_1e9c2_144{text-overflow:ellipsis;white-space:nowrap;cursor:grab;touch-action:none;outline:none;flex:auto;align-self:stretch;align-items:center;min-width:0;padding:2px 0 2px 6px;display:flex;overflow:hidden}._ChipRename_1e9c2_172{border:1px solid var(--sxl-color-primary,#1a73e8);background:var(--sxl-input-bg,transparent);min-width:0;color:inherit;font:inherit;border-radius:3px;outline:none;flex:auto;margin:1px;padding:1px 4px}._ChipMenuButton_1e9c2_185{width:20px;height:20px;color:inherit;cursor:pointer;opacity:.7;background:0 0;border:none;border-radius:3px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex;&:hover,&[aria-expanded=true]{opacity:1;background:var(--sxl-color-base-hover,light-dark(#0000000f,#ffffff1a))}&:focus-visible{outline:2px solid var(--sxl-color-primary,#1a73e8);outline-offset:-2px}}._ChipMenu_1e9c2_185{min-width:160px;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--sxl-font-size,13px);flex-direction:column;padding:4px 0;display:flex}._ChipMenuItem_1e9c2_220{width:100%;color:inherit;font:inherit;text-align:left;white-space:nowrap;cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;padding:4px 12px 4px 6px;display:flex;&:hover:not(:disabled),&:focus-visible{background:var(--sxl-color-base-hover,light-dark(#0000000f,#ffffff1a));outline:none}&:disabled{opacity:.5;cursor:default}}._ChipMenuCheck_1e9c2_243{flex:none;width:16px;display:inline-flex}._ChipMenuDivider_1e9c2_249{background:var(--sxl-color-base-border,light-dark(#0000001f,#ffffff1f));height:1px;margin:4px 0}._Pane_1e9c2_255{background:var(--sxl-color-base-100,#fff);box-sizing:border-box;min-height:0;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--sxl-font-size,13px);color:var(--sxl-color-base-content,light-dark(#000000de,#ffffffde));flex-direction:column;flex:100%;gap:8px;padding:8px 16px;display:flex;overflow:auto}._PaneName_1e9c2_270{opacity:.87;font-weight:600}._PaneEmpty_1e9c2_276{text-align:center;flex:auto;justify-content:center;align-items:center;display:flex}._EmptyBox_1e9c2_285{pointer-events:none;color:var(--sxl-color-base-content,light-dark(#1f1f1f,#e6e6e6));overflow:hidden;container-type:size}._EmptyContent_1e9c2_292{box-sizing:border-box;flex-direction:column;align-items:center;gap:5cqh;height:100%;padding:7cqh 6cqw 4cqh;display:flex}._EmptyName_1e9c2_302{box-sizing:border-box;color:#8a8a8a;text-align:center;white-space:nowrap;text-overflow:ellipsis;border:1px solid #ababab;width:80%;padding:.15em .5em;font-size:6cqw;overflow:hidden}._EmptyHint_1e9c2_315{text-align:center;font-size:6cqw;line-height:1.35}._EmptyPicture_1e9c2_321{width:100%;color:var(--sxl-color-primary,#4472c4);margin-top:auto}._EmptyPicturePaper_1e9c2_327{fill:var(--sxl-color-base-100,#fff)}._movable-area_yq5rq_14 .movable-control{pointer-events:none;position:absolute;inset:0;container-type:size}._movable-area_yq5rq_14 .movable-control.dragging,._movable-area_yq5rq_14 .movable-rotate-handle.dragging,._movable-area_yq5rq_14 .movable-adornment:has(.movable-gesture){opacity:0}._movable-area_yq5rq_14 .movable-control-outline{border:1px solid var(--sxl-color-neutral,grey);pointer-events:none;position:absolute;inset:0}._movable-area_yq5rq_14 .movable-control-handle{--handle-width:var(--sxl-handle-size);--handle-height:var(--sxl-handle-size);width:var(--handle-width);height:var(--handle-height);box-sizing:border-box;border-radius:calc(var(--sxl-handle-size) / 2);background-color:var(--sxl-color-base-100,white);background-image:var(--sxl-image-background);border:var(--sxl-handle-ring) solid var(--sxl-handle-color);box-shadow:0 0 0 var(--sxl-handle-halo) var(--sxl-color-base-100,white);pointer-events:all;touch-action:none;position:absolute;transform:translate(-50%,-50%)}._movable-area_yq5rq_14 .movable-control-handle:is([data-direction=n],[data-direction=s]){--handle-width:calc(var(--sxl-handle-size) * 1.6);--handle-height:calc(var(--sxl-handle-size) * .65)}._movable-area_yq5rq_14 .movable-control-handle:is([data-direction=w],[data-direction=e]){--handle-width:calc(var(--sxl-handle-size) * .65);--handle-height:calc(var(--sxl-handle-size) * 1.6)}._movable-area_yq5rq_14 .movable-control-handle.connector-end{--handle-width:var(--sxl-handle-size);--handle-height:var(--sxl-handle-size);opacity:1;cursor:crosshair;border-radius:50%;display:block}._movable-area_yq5rq_14 .movable-control-handle.connector-end.glued{background-color:var(--sxl-handle-color);border-color:var(--sxl-color-base-100,white);box-shadow:0 0 0 var(--sxl-handle-halo) var(--sxl-handle-color);background-image:none}._movable-area_yq5rq_14 .movable-control.context .movable-control-outline{border-style:dotted}._movable-area_yq5rq_14 .movable-control.context .movable-control-handle{border-color:var(--sxl-color-neutral,grey)}._movable-area_yq5rq_14 .movable-control-handle:before{content:"";inset:min(0px, calc((var(--handle-height) - var(--sxl-handle-hit)) / 2)) min(0px, calc((var(--handle-width) - var(--sxl-handle-hit)) / 2));border-radius:calc(var(--sxl-handle-hit) / 2);position:absolute}._movable-area_yq5rq_14 .movable-rotate-handle:after{content:"";inset:calc((var(--sxl-handle-size) - var(--sxl-handle-hit)) / 2);border-radius:50%;position:absolute}._movable-area_yq5rq_14 .movable-rotate-handle{--rotate-size:calc(var(--sxl-handle-size) + 6px);--rotate-gap:calc(var(--sxl-handle-size) + 6px);left:50%;top:calc(-1 * (var(--rotate-gap) + var(--rotate-size) / 2));width:var(--rotate-size);height:var(--rotate-size);margin-left:calc(var(--rotate-size) / -2);margin-top:calc(var(--rotate-size) / -2);box-sizing:border-box;color:var(--sxl-handle-color);pointer-events:all;touch-action:none;position:absolute}._movable-area_yq5rq_14 .movable-rotate-handle:before{content:"";height:var(--rotate-gap);border-left:1px solid var(--sxl-color-neutral,grey);pointer-events:none;margin-left:-.5px;position:absolute;top:100%;left:50%}._movable-area_yq5rq_14 .movable-rotate-handle.below{top:calc(100% + var(--rotate-gap) + var(--rotate-size) / 2)}._movable-area_yq5rq_14 .movable-rotate-handle.below:before{top:auto;bottom:100%}._movable-area_yq5rq_14 .movable-rotate-handle svg,._movable-area_yq5rq_14 .movable-move-handle svg{pointer-events:none;width:100%;height:100%;filter:drop-shadow(0 0 1px var(--sxl-color-base-100,white));display:block;overflow:visible}._movable-area_yq5rq_14 .movable-rotate-handle path,._movable-area_yq5rq_14 .movable-move-handle path{fill:currentColor}._movable-area_yq5rq_14 .movable-move-handle{--move-size:calc(var(--sxl-handle-size) + 8px);left:50%;top:calc(100% + var(--sxl-handle-size) / 2);width:var(--move-size);height:var(--move-size);margin-left:calc(var(--move-size) / -2);box-sizing:border-box;color:var(--sxl-handle-color);cursor:move;pointer-events:all;touch-action:none;display:none;position:absolute}._movable-area_yq5rq_14 .movable-move-handle:after{content:"";inset:min(0px, calc((var(--move-size) - var(--sxl-handle-hit)) / 2));position:absolute}@container (width<=28px) and (height<=28px){._movable-area_yq5rq_14 .movable-control-handle,._movable-area_yq5rq_14 .movable-rotate-handle{opacity:0}._movable-area_yq5rq_14 .movable-move-handle{display:block}}@container (width<=30px){._movable-area_yq5rq_14 .movable-control-handle:is([data-direction=n],[data-direction=s]){display:none}}@container (height<=30px){._movable-area_yq5rq_14 .movable-control-handle:is([data-direction=w],[data-direction=e]){display:none}}@container (width<=108px){.touch-input ._movable-area_yq5rq_14 .movable-control-handle[data-direction=n],.touch-input ._movable-area_yq5rq_14 .movable-control-handle[data-direction=s]{display:none}}@container (height<=108px){.touch-input ._movable-area_yq5rq_14 .movable-control-handle[data-direction=w],.touch-input ._movable-area_yq5rq_14 .movable-control-handle[data-direction=e]{display:none}}._TaskPaneArea_4lp4n_5{flex-direction:row;width:100%;height:100%;display:flex;position:absolute}._TaskPaneTitle_4lp4n_13{box-sizing:border-box;border-bottom:1px solid #0003;flex-direction:row;flex:1 1 0;align-items:center;width:100%;height:100%;padding:8px 16px;font-size:1.25rem;display:flex;& .title{opacity:.87}&.focused{& .title{opacity:1}}}._TaskPaneFrame_4lp4n_36{box-sizing:border-box;border-radius:4px;outline:none;flex-direction:column;flex:1 1 0;justify-content:stretch;align-items:stretch;width:100%;min-height:0;margin-bottom:4px;display:flex;position:relative;overflow:hidden}._TaskPaneAreaFrames_4lp4n_55{flex:100%;min-width:0;min-height:0;display:flex;position:relative}._TaskPaneAreaFrameHost_4lp4n_63{flex:100%;min-width:0;min-height:0;display:flex}._TaskPaneAreaFrameHidden_4lp4n_71{display:none}._TaskPaneStrip_4lp4n_75{scrollbar-width:thin;flex-direction:column;gap:4px;min-height:0;margin-top:4px;margin-bottom:4px;margin-left:2px;display:flex;overflow:hidden auto}._TaskPaneStripItem_4lp4n_88{writing-mode:vertical-rl;text-orientation:mixed;cursor:pointer;user-select:none;opacity:.75;border:1px solid #0000;border-radius:4px;flex-direction:row;flex:none;align-items:center;min-width:0;padding:4px;transition:opacity .12s,background-color .12s;display:flex;&:hover{opacity:1;background-color:#8080801f}&.selected{opacity:1;border-color:gray;font-weight:700}}._TaskPaneStripItemIcon_4lp4n_117{transform-origin:50%;display:inline-block;transform:rotate(90deg)}._TaskPaneStripItemLabel_4lp4n_127{opacity:0;grid-template-columns:0fr;transition:grid-template-columns .2s,opacity .15s;display:grid}._TaskPaneStripItemLabelOpen_4lp4n_134{opacity:1;grid-template-columns:1fr}._TaskPaneStripItemLabelClip_4lp4n_139{white-space:nowrap;min-width:0;min-height:0;overflow:hidden}._TaskPaneStripItemLabelText_4lp4n_146{padding-top:4px;display:inline-block}._MovablePane_4lp4n_152{background:var(--sxl-color-base-100,#fff);box-sizing:border-box;min-height:0;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);flex-direction:column;flex:100%;gap:8px;padding:8px 16px;display:flex;overflow:auto}._MovablePaneKind_4lp4n_166{opacity:.87;font-weight:600}._MovablePaneEmpty_4lp4n_171{opacity:.6}._dropdown_1bnz9_13{box-sizing:border-box;cursor:pointer;user-select:none;color:light-dark(#444,#ccc);background:light-dark(#f4f4f4,#3a3a3a);border:1px solid light-dark(#b8b8b8,#5a5a5a);border-radius:2px;justify-content:center;align-items:center;transition:background-color .1s ease-out;display:flex}._dropdown_1bnz9_13:hover{background:light-dark(#e4e4e4,#4a4a4a)}._dropdown_1bnz9_13:active{background:light-dark(#d4d4d4,#565656)}@media (prefers-reduced-motion:reduce){._dropdown_1bnz9_13{transition:none}}:root{--sxl-cf-bar-fade:20%}._bar_6li90_16{box-sizing:border-box;pointer-events:none;position:absolute}._axis_6li90_23{pointer-events:none;width:1px;position:absolute}:root{--sxl-cf-icon-bad:#ec5753;--sxl-cf-icon-light-bad:#fc9f6e;--sxl-cf-icon-neutral:#f8cd3d;--sxl-cf-icon-good:#8cb354;--sxl-cf-icon-purple:#9b72cf;--sxl-cf-icon-gold:#ffc000;--sxl-cf-icon-gray:light-dark(#a6a6a6,#8a8a8a);--sxl-cf-icon-black:light-dark(#333,#d9d9d9)}._box_1qgal_41{pointer-events:auto;cursor:default;align-items:flex-end;position:absolute}._box_1qgal_41:hover{contain:none;z-index:1}._box_1qgal_41>svg{transform-origin:var(--sxl-cf-icon-origin,center bottom);transition:transform .12s ease-out,filter .12s ease-out}._box_1qgal_41:hover>svg{filter:drop-shadow(0 1px 2px #00000059);transform:scale(1.18)}@media (prefers-reduced-motion:reduce){._box_1qgal_41>svg{transition:none}._box_1qgal_41:hover>svg{transform:none}}._mark_p3uld_7{pointer-events:none;color:light-dark(#3a70b0,#80b8f0);position:absolute}._unresolved_p3uld_19{color:light-dark(#c82828,#ff6e6e)}._pending_ldaq4_9{pointer-events:none;background:color-mix(in srgb, var(--sxl-color-primary,#4d4d4d) 25%, transparent);opacity:0;animation:0s .5s forwards _fadeIn_ldaq4_1;position:absolute;overflow:hidden}._sweep_ldaq4_19{background:var(--sxl-color-primary,#4d4d4d);opacity:.9;width:30%;animation:3s infinite _sweep_ldaq4_19;position:absolute;top:0;bottom:0}@keyframes _fadeIn_ldaq4_1{to{opacity:1}}@keyframes _sweep_ldaq4_19{0%{animation-timing-function:ease;left:-150%}to{left:100%}}._insert_1qm8h_8{position:relative}._button_1qm8h_12{cursor:pointer;color:var(--sxl-color-primary,#1976d2);background:0 0;border:none;border-radius:50%;padding:0;display:block}._button_1qm8h_12 svg{fill:var(--sxl-color-base-100,#fff);stroke:currentColor;stroke-width:1.25px;stroke-linecap:round;display:block}._button_1qm8h_12:hover svg,._button_1qm8h_12:focus-visible svg{fill:currentColor;stroke:var(--sxl-color-base-100,#fff)}._line_1qm8h_37{pointer-events:none;background:var(--sxl-color-primary,#1976d2);position:absolute}._row_1qm8h_44{height:2px;top:-1px;left:0;right:0}._column_1qm8h_51{width:2px;top:0;bottom:0;left:-1px}._pressed_1qm8h_58{box-shadow:0 1px 4px #00000073}._sheet-scrollbar_104cg_1{align-items:center;margin-bottom:1px;margin-left:2px}._loading-panel_bjv3h_1{box-sizing:border-box;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._loading-spinner_bjv3h_10{border:3px solid color-mix(in srgb, var(--sxl-color-base-content) 44%, transparent);border-top-color:var(--sxl-color-primary,#1976d2);border-radius:50%;width:28px;height:28px;animation:.9s linear infinite _sxl-spin_bjv3h_1}@keyframes _sxl-spin_bjv3h_1{to{transform:rotate(360deg)}}._sheetxl-sheet_ap3es_5{& ._viewport-overlay_ap3es_6{pointer-events:none;& *{pointer-events:initial}}& .tile{& .text-box{position:absolute}& .text-line{text-rendering:optimizespeed;vertical-align:baseline;white-space:pre;position:absolute}& .column-button{flex-direction:row;justify-content:center;align-items:center;margin-bottom:4px;display:flex;position:absolute}& .text-debug-bounds{pointer-events:none;opacity:.2;background:green;position:absolute}& .fill{position:absolute}}}.icon[data-icon-pack=shape]{--icon-stroke-em:.04em}._themed_f2asj_9{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem));vertical-align:middle;width:var(--chart-icon-size);height:var(--chart-icon-size);fill:currentColor;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}._themed_f2asj_9>svg{width:var(--chart-icon-size);height:var(--chart-icon-size)}._small_f2asj_36{--chart-icon-size:calc(var(--icon-size-sm,.875rem) * .875)}._medium_f2asj_37{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem))}._large_f2asj_38{--chart-icon-size:calc(var(--icon-size-lg,1.25rem) * 1.5)}._themed_f2asj_9 .current_color{fill:currentColor}._themed_f2asj_9 .background{fill:var(--sxl-color-base-100,#fff)}._themed_f2asj_9 .high_contrast{fill:var(--sxl-color-primary,#595b5e)}._themed_f2asj_9 .info{fill:var(--sxl-color-info,#3b82f6)}._themed_f2asj_9 .info_tint{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 80%, white)}._themed_f2asj_9 .info_shade{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 70%, black)}._themed_f2asj_9 .accent_tint{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 80%, white)}._themed_f2asj_9 .accent_shade{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 70%, black)}._editable-input_1u3oj_6{width:100%;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;text-transform:inherit;background:0 0;border:none;outline:none;padding:0;line-height:1.2;position:absolute;top:50%;left:0;transform:translateY(-50%)}@keyframes _pop_10yib_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_10yib_29{0%{opacity:0}to{opacity:1}}._Wrapper_10yib_21{box-sizing:border-box;transform:translate3d(var(--translate-x,0), var(--translate-y,0), 0) scaleX(var(--scale-x,1)) scaleY(var(--scale-y,1));transform-origin:0 0;touch-action:manipulation;display:flex;&._dragOverlay_10yib_33{z-index:999}}._Item_10yib_43{box-sizing:border-box;transform-origin:50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale,1));outline:none;align-items:center;display:flex;position:relative;&:not(._withHandle_10yib_57){touch-action:manipulation}&._dragging_10yib_62:not(._dragOverlay_10yib_33){opacity:var(--dragging-opacity,0);z-index:999}&._dragOverlay_10yib_33{cursor:inherit;transform:scale(var(--scale));opacity:1;animation:.2s cubic-bezier(.18,.67,.6,1.22) _pop_10yib_1}}._Row_1kr10_1{box-sizing:border-box;display:flex}._TabStrip_3x0dp_1{&::-webkit-scrollbar{height:0;display:none}position:relative;overflow:hidden auto}._sheet-tab_1cbiv_2 input{color:var(--sxl-sheet-tab-input-color,inherit);text-align:center;font-weight:500}._ghost_1cbiv_18{border:1px solid #0000;transition:background-color .12s,border-color .12s}._sheet-tab_1cbiv_2:hover ._ghost_1cbiv_18{background-color:var(--sxl-tab-hover-bg);border-color:var(--sxl-tab-hover-border)}._root_1x3cd_6{box-sizing:border-box;min-width:0;min-height:0;color:var(--sxl-color-base-content,inherit);background:var(--sxl-color-base-100,transparent);border-radius:4px;flex-direction:column;gap:4px;padding:0;display:flex}._list_1x3cd_26{border:1px solid var(--sxl-color-base-300,light-dark(#0000001f,#ffffff29));border-radius:4px;flex:auto;min-height:0}._selectAll_1x3cd_38{background:var(--sxl-color-base-100,transparent);border-bottom:1px solid var(--sxl-color-base-300,light-dark(#0000001f,#ffffff29));border-radius:3px 3px 0 0}._root_1x3cd_6 input[type=checkbox]{accent-color:var(--sxl-color-primary,#0078d7);width:15px;height:15px}._options_1x3cd_54{flex:none;align-items:center;margin-left:3px;display:flex;position:relative}._optionsButton_1x3cd_62{height:20px;color:inherit;opacity:.6;cursor:pointer;background:0 0;border:none;border-radius:2px;align-items:center;padding:0 1px 0 3px;display:inline-flex}._optionsButton_1x3cd_62:hover,._optionsButton_1x3cd_62[aria-expanded=true]{opacity:1;background:light-dark(#0000000f,#ffffff1a)}._optionsGlyph_1x3cd_81{width:14px;height:14px}._optionsChevron_1x3cd_86{width:12px;height:12px;margin-left:-1px}._optionsMenu_1x3cd_92{z-index:1;white-space:nowrap;background:light-dark(#fff,#2b2b2b);border:1px solid light-dark(#c4c4c4,#5a5a5a);border-radius:4px;padding:4px 8px;font-size:12px;position:absolute;top:calc(100% + 4px);left:-4px;box-shadow:0 2px 6px light-dark(#00000026,#00000080)}._count_1x3cd_107{opacity:.75;white-space:nowrap;text-overflow:ellipsis;flex:auto;min-width:0;font-size:12px;overflow:hidden}._truncated_1x3cd_117{margin-left:4px}._value_1x3cd_122{text-overflow:ellipsis;display:block;overflow:hidden}._number_1x3cd_128{text-align:right;font-variant-numeric:tabular-nums}._blank_1x3cd_134{opacity:.75;font-style:italic}._toggle_1x3cd_140{white-space:nowrap;cursor:pointer;align-items:center;gap:4px;display:inline-flex}._toggle_1x3cd_140 input{accent-color:var(--sxl-color-primary);margin:0}._emptyList_1x3cd_154{flex-direction:column;display:flex;overflow:hidden}._emptyHeader_1x3cd_160{box-sizing:border-box;flex:none;align-items:center;padding:0 8px;display:flex}._empty_1x3cd_154{opacity:.6;white-space:nowrap;cursor:default;flex:auto;justify-content:center;align-items:center;padding:6px 10px;display:flex}._node_1x3cd_183{align-items:center;gap:4px;min-width:0;display:flex}._disclosure_1x3cd_192{cursor:pointer;width:14px;height:14px;color:var(--sxl-color-primary,#0078d7);flex:none;justify-content:center;align-items:center;display:inline-flex}._disclosureIcon_1x3cd_204{width:14px;height:14px;transition:transform .15s ease-out;transform:rotate(-90deg)}._disclosure_1x3cd_192._expanded_1x3cd_211 ._disclosureIcon_1x3cd_204{transform:rotate(0)}@media (prefers-reduced-motion:reduce){._disclosureIcon_1x3cd_204{transition:none}}._disclosure_1x3cd_192._leaf_1x3cd_221{cursor:default}._add_1x3cd_226{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:50%;font:inherit;color:inherit;border:1px solid var(--sxl-color-base-300,light-dark(#0003,#ffffff3d));cursor:pointer;background:0 0;border-radius:2px;flex:0 auto;padding:2px 8px;font-size:12px;overflow:hidden}._add_1x3cd_226:hover{border-color:var(--sxl-color-primary,#0078d7)}._add-button_1b4ig_1{cursor:pointer;color:color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent);background:0 0;border:none;justify-content:center;align-items:center;margin:0 2px;padding:0;display:flex}._add-button_1b4ig_1:hover:not(:disabled){color:var(--sxl-color-primary,#1976d2)}._add-button_1b4ig_1:disabled{cursor:default;opacity:.6}:root{--icon-size:1.25rem}@media (pointer:coarse){:root{--icon-size:1.75rem}}._sheetxl-workbook_7tom8_11{outline:none;flex-direction:column;flex:100%;width:100%;min-width:0;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}._sheetxl-workbook_7tom8_11 *{font-weight:400}._sheetxl-workbook_7tom8_11 .viewport-overlay{outline:none}._sheetxl-reset_7tom8_36{margin:0;padding:0;line-height:1;display:block}._sheetxl-reset_7tom8_36 table,._sheetxl-reset_7tom8_36 thead,._sheetxl-reset_7tom8_36 tbody,._sheetxl-reset_7tom8_36 tfoot,._sheetxl-reset_7tom8_36 tr,._sheetxl-reset_7tom8_36 th,._sheetxl-reset_7tom8_36 td{border-collapse:inherit;border-spacing:0;border:none;border-color:inherit;width:auto;height:auto;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0;margin:0;padding:0;display:block}._sheetxl-reset_7tom8_36 th,._sheetxl-reset_7tom8_36 td{display:inline}._viewport_7tom8_30>:first-child{position:relative}.shape-handle circle{r:calc((var(--sxl-handle-size) - 2px) / 2 / var(--shape-scale,1))}.shape-handle .shape-handle-hit{r:calc(max(var(--sxl-handle-hit), var(--sxl-handle-size)) / 2 / var(--shape-scale,1))}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var ar=(e,t,n,r)=>{let i=(0,X.useRef)(n);i.current=n;let a=(0,X.useRef)(r);a.current=r,(0,X.useEffect)(()=>{if(!e||!t)return;let n=e.getRange(t).addListener(e=>{i.current?.(e)},a.current);return()=>{n?.()}},[e,t])},or=(0,X.createContext)(null);function sr(e){let{workbook:t,children:n}=e;return s(t,[`onSelectedSheetChange`]),(0,Z.jsx)(or.Provider,{value:t,children:(0,Z.jsx)(c,{sheet:t?t.getSelectedWorksheet():null,children:n})})}function cr(){return(0,X.useContext)(or)}var lr=e=>{let{value:t,cell:n,bounds:r,children:i,style:a={},range:o,zoom:s=1,normalStyle:c,showFormulas:l,showZeros:u,allowTextOverflow:d=!0,docTheme:f,onLinkClick:p,...m}=e,g=r.height/s,_=r.width/s,v=t,y=v.getValue(),b=v.getType()===wn.RichData,x=b?Gn.toPrimitive(y)??Gn.toDisplayText(y)??y:y,S=b?Gn.layoutTypeOf(y):v.getType(),C=y instanceof In,w=t.getStyle(),T=null,E=null,D=Cn.isError(y)&&y instanceof Cn.Parse,O=l||D;if(O){if(v.isSpillOverflow())E=``;else{let e=v.getFormulaText({target:`display`});e?E=e:T=v.getNumberFormat(gn.Type.General)}}else T=v.getNumberFormat();let k=null;!O&&d&&(k=v.getTextOverflow());let A=k?k.colBounds.width+k.leftOffset+k.rightOffset:_,j=k?k.anchorBounds.x-k.leftOffset:0,M=k?k.anchorBounds.width:_,N=k?k.anchorBounds.x:0,P=v.getRenderHorizontalAlignment(),F=null;T&&(F=T?.formattedRuns,E=F?.runs[0]?.text??T.displayText);let I=null,L=0,R=0;if(!w.getBorders().isEmpty()){let e=w.getBorders().getRight();!e.isNone()&&(pn.BuiltInDefinitions.get(e.getStyle())?.width??0)>1&&(L=1);let t=w.getBorders().getBottom();!t.isNone()&&(pn.BuiltInDefinitions.get(t.getStyle())?.width??0)>1&&(R=1)}let ee=w.getFont(),z=ee.getUnderline()===un.UnderlineStyle.SingleAccounting||ee.getUnderline()===un.UnderlineStyle.DoubleAccounting,B=T?.conditionalColor??null,V=w.getAlignment(),H=V.getHorizontal()===J.HorizontalAlignment.Fill,U=V.getHorizontal()===J.HorizontalAlignment.CenterContinuous||H,W=!U&&!O&&V.getStacked(),te=U||O||W?0:V.getRotation(),G=v.getInsets(),ne=G.top+G.bottom,re=G.left,ie=G.right,ae=A-1-(re+ie),oe={...a,left:a.left-1,top:a.top-1,width:a.width+1+L,height:a.height+1+R},se=!dr&&!(p||C||i||(F?.runs.length??0)>1||k||te%360!=0||W||z),ce=U||!(!k||!(k.rightIndex>0||k.leftIndex>0||k.colSpan>1));if(!ce){let e=v.getSpans();(e.width>1||e.height>1)&&(ce=!0)}let K={...oe};if(!h.isEmpty(E)||!h.isEmpty(T?.errorPlaceholder)){let e=T?.canWrap??!1,t,n,r=[],i=0,o=!0;u||O||x!==0||(o=!1);let c=v.getTextFrame(O);if(o&&c&&(ae>0||te||W)){let o=ae,l=H||U||T&&(T.repeatChars.length>0||T.spacingChars.length>0),u=!(te||W||O||e||c.wrapped||k||l),d=v.getTextPlacement({width:_,height:g},O),f=d?.rotation??null,y=d?.stacked??null,b=!d||f||y?null:d.bounds.y;f?o=f.lineLength:y&&(o=2**53-1);let E=null;e&&!f&&(E={width:o});let I=null,L=T?.errorPlaceholder,R=d?.frame??c.layout(E??void 0);if(t=R.bounds,O?t={...t,width:0}:F&&(t={...t,width:T.errorPlaceholder||T.repeatChars.length>0?o:F.width}),!L&&S!==wn.String&&Math.floor(t.width)>o){if(w.getNumberFormat()===`General`&&S===wn.Number){let e=w.measureText(`0`),t=Math.floor(o/e.width),n=x,r=Math.abs(n),i=n<0,a=r>=1e5||n!==0&&r<=1e-5,s=h.splitNumber(n),c=e=>Math.floor(w.measureText(e).width)<=o,l=Math.min(10,t-(Math.max(1,s?.ipLength??0)+1)-+!!i);if(l>=-1){let e=`0${l>0?`.`:``}${`#`.repeat(Math.max(0,l))}`,t=v.getNumberFormat(e).displayText.replace(/\.$/,``),n=t===`0`&&i?`-0`:t;a&&!/[1-9]/.test(t)||!c(n)||(I=n)}if(!I&&a){let e=t-+!!i-5,n=t-+!!i-4,r=null;if(e>=2?r=`0.${`0`.repeat(e-1)}E+00`:n>=1&&(r=`0E+00`),r){let e=v.getNumberFormat(r).displayText;c(e)&&(I=e)}}}I||(L=`#`)}if(!L&&F&&F.lastRepeatIndex>=0&&F.width>o&&(L=`#`),L&&o>0){let e=w.measureText(L),t=Math.max(1,Math.floor((o||1)/(e?.width||1)));I=L.repeat(t),P=J.HorizontalAlignment.Center}if(O&&(P=J.HorizontalAlignment.Left),I){let e=w.measureText(I).width;e&&(t={...t,width:e})}n={...t,width:t.width+re+ie,height:t.height},f&&(n={...f.bounds});let oe=b!==null&&u&&!I&&!L;f||y||(oe?(n.x=d.bounds.x,n.y=b):(P===J.HorizontalAlignment.Center||P===J.HorizontalAlignment.CenterContinuous?n.x=(A-n.width)/2:P===J.HorizontalAlignment.Right?n.x=A-n.width-.5:n.x=.5,b===null?V.getVertical()===J.VerticalAlignment.Center?n.y=(g-n.height)/2:V.getVertical()===J.VerticalAlignment.Bottom?n.y=g-n.height-ne:n.y=ne:n.y=b));let K=se?{...m}:void 0,le={style:{left:a.left-1,top:a.top-1,width:a.width+1,height:a.height+1,transform:te&&!f?`rotate(${te}deg)`:void 0,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:ce?1:void 0},...p?Et:void 0,onClick:p,...K};D&&(le.style.textDecorationStyle=`wavy`,le.style.textDecorationColor=`light-dark(red, rgb(0, 255, 255))`,le.style.textDecorationLine=`underline`);let ue=ee.getSize(),de=ee.toCSS(`adaptive`,s,!0),fe=ee.getStrike(),pe=!!fe&&fe!==un.StrikeStyle.None;if(C){de.color||=`var(--sxl-doc-color-hlink, #467886)`;let e=ee.getUnderline();e&&e!==un.UnderlineStyle.None||(de.textDecoration=pe?`underline line-through`:`underline`)}z&&(de.textDecoration=pe?`line-through`:void 0);let me=(e,i,a,c,l,u,d,f=null)=>{let p,m=ue*s,h=a;if(d?.runs)p=d.runs;else{let t=w.measureText(e,m);p=[{type:gn.ParseRunType.Text,text:e,width:t.width,letterSpacing:(t.renderLetterSpacing??0)/s}]}d&&d?.width!==t.width&&(t={...t,width:d?.width});let g=oe?0:re;if(d&&d.lastRepeatIndex>=0&&o>d.width){let e=d.runs[d.lastRepeatIndex];if(e){let n=[...p],r=Math.max(0,o-1-d.width),i=0,a=``;if(r>0){let t=Math.floor(r/e.width);a=t>0?e.text.repeat(t):``,i=r}n[d.lastRepeatIndex]={type:gn.ParseRunType.Repeat,text:a,width:i},p=n,t={...t,width:d.width+i}}}let _=(e,t,n,i,a,o,c,d,f,p=null)=>{let _,v=h.width;l===J.HorizontalAlignment.Justify?(v=a,u||(_=`justify`)):l===J.HorizontalAlignment.Distributed&&(v=a,_=u||e.text.split(` `).length-1==0?`center`:`justify`);let{style:y,className:x,...S}=p??{},C=e.text;if(l===J.HorizontalAlignment.Fill&&T?.repeatChars.length===0){let e=Math.max(1,Math.floor((h?.width??0)/(c?.width??1)));C=C.repeat(e)}let w=h.height,E=ee.getBaseline(),D=E<0;(D||E>0)&&(m*=vn.SuperSubScale,w*=vn.SuperSubScale);let O={textAlign:_,textAlignLast:_,...y,...de,fontSize:m*un.getDeviceScale()};e.letterSpacing&&(O.letterSpacing=(ee.getLetterSpacing()+e.letterSpacing)*s+`px`),se||(O.background=ur?`pink`:void 0),B&&(O.color=B.toCSS(`adaptive`));let k=g+t,A=(b===null?G.top:0)+h.y+0;if(D&&(A+=f-m),o){let e=(c.x+k)*s+1,t=(c.y+A)*s+1;t<0?O.marginTop=t:O.paddingTop=t,e<0?(O.width=(y?.width??0)-e,O.left=(y?.left??0)+e):O.paddingLeft=e,O.paddingRight=Math.max(0,(y?.width??0)-v*s-e),O.paddingBottom=Math.max(0,(y?.height??0)-h.height*s-t),O.height=(y?.height??0)+(t<0?-t:0),(t<0||e<0)&&(O.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else O.left=(c.x+k)*s+1,O.top=(c.y+A)*s+1,O.width=c.width*s,O.height=c.height*s;O.lineHeight=w*s+`px`;let j=se?void 0:`text-line`;r.push((0,Z.jsx)(`div`,{className:x?`${x} ${j}`:j,style:O,...S,children:C},`text-${h.y}-${i}-${n}`))};if(V.getOverflow()===J.Overflow.Shrink&&o>0){let n=t?.width??0,r=0;for(;n>1&&n>o&&m>2&&r<100;)m*=o/n,n=w.measureText(e,m).width,r++;t={...t,width:n}}let v=h.x;l===J.HorizontalAlignment.Right?v+=t.width-h.width:l!==J.HorizontalAlignment.Center&&l!==J.HorizontalAlignment.CenterContinuous||(v+=(t.width-h.width)/2),d&&d.lastRepeatIndex>=0&&(v=h.x);let y=p.length;for(let e=0;e<y;e++){let r=p[e];(r.type===gn.ParseRunType.Text||r.type===gn.ParseRunType.Repeat)&&(r.type,gn.ParseRunType.Repeat,_(r,v,e,i,l===J.HorizontalAlignment.Justify||l===J.HorizontalAlignment.Distributed||d&&d.lastRepeatIndex>=0?o:h.width,se,{x:n.x+j,y:n.y,width:r.width,height:t.height},0,c,f)),v+=r.width}};if(y){let e=y.pitch,t=y;(I||L)&&(t=Hn.layoutColumns(Hn.toColumns(I??L??``,!1,2**53-1),e,d.content,P,V.getVertical()));let n={lineHeight:e*s+`px`,textAlign:`center`,...de,fontSize:ue*s*un.getDeviceScale()};B&&(n.color=B.toCSS(`adaptive`));let i=[];for(let e=0;e<t.columns.length;e++){let r=t.columns[e];r.glyphs.length!==0&&i.push((0,Z.jsx)(`div`,{className:`text-line`,style:{...n,left:r.bounds.x*s,top:r.bounds.y*s,width:r.bounds.width*s,height:r.bounds.height*s},children:r.glyphs.join(`
|
|
3
|
+
`)},`col-${e}`))}r.push((0,Z.jsx)(`div`,{style:{position:`absolute`,left:1,top:1,width:_*s,height:g*s,overflow:`hidden`,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:ce?1:void 0,background:ur?`pink`:void 0},...p?Et:void 0,onClick:le.onClick,children:i},`text-stacked`))}else if(f){let e=f.angle,n=d.lineHeight,i=ue*s,a=V.getVertical(),c=(t,a,o,c,l,u)=>{let d={left:a.x*s+1,top:a.y*s+1,width:o*s,height:n*s,lineHeight:n*s+`px`,transform:`rotate(${e}deg)`,transformOrigin:`0 0`,textAlign:l,textAlignLast:l,whiteSpace:l===`justify`?`normal`:void 0,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:ce?1:void 0,...de,fontSize:i*un.getDeviceScale()};u&&(d.letterSpacing=(ee.getLetterSpacing()+u)*s+`px`),ur&&(d.background=`pink`),B&&(d.color=B.toCSS(`adaptive`)),r.push((0,Z.jsx)(`div`,{className:`text-line`,style:d,...p?Et:void 0,onClick:le.onClick,children:c},`text-rot-${t}`))},l=(t,r)=>Mn.layoutLines([{width:t,height:n}],e,d.content,r,a);if(I||L){let e=I??L??``;c(`override`,l(t.width,P).lines[0].origin,t.width,e,void 0,(w.measureText(e,i).renderLetterSpacing??0)/s)}else if(F&&R.lines.length===1){let e=F.runs,t=F.width,n=P;if(F.lastRepeatIndex>=0&&o>F.width){let r=F.runs[F.lastRepeatIndex];if(r){let i=[...e],a=Math.max(0,o-F.width),s=``;if(a>0&&r.width>0){let e=Math.floor(a/r.width);s=e>0?r.text.repeat(e):``}i[F.lastRepeatIndex]={type:gn.ParseRunType.Repeat,text:s,width:a},e=i,t=F.width+a,n=J.HorizontalAlignment.Left}}let r=l(t,n),i=0,a=[];for(let t=0;t<e.length;t++){let n=e[t];n.type!==gn.ParseRunType.Text&&n.type!==gn.ParseRunType.Repeat||!n.text||a.push((0,Z.jsx)(`span`,{style:{position:`absolute`,left:i*s,top:0,whiteSpace:`pre`,letterSpacing:n.letterSpacing?(ee.getLetterSpacing()+n.letterSpacing)*s+`px`:void 0},children:n.text},`run-${t}`)),i+=n.width}c(`runs`,r.lines[0].origin,t,a)}else{let t=a===J.VerticalAlignment.Distributed&&e%90==0&&e%180!=0,n=f.lines.length;for(let e=0;e<n;e++){let r=f.lines[e],a=R.lines[e],o=a.runs[0].text.replace(/\s+$/,``),l=e===n-1,u,d=r.size.width;P!==J.HorizontalAlignment.Justify||l||a.runs[0].text.endsWith(`
|
|
4
|
+
`)?(P===J.HorizontalAlignment.Distributed||t)&&(d=f.lineLength,u=l||o.split(` `).length-1==0?`center`:`justify`):(d=f.lineLength,u=`justify`),c(`${e}`,r.origin,d,o,u,(w.measureText(o,i).renderLetterSpacing??0)/s)}}}else I||L?(i=t.y??0,me(I??L??``,0,{...t,x:t.x??0,y:t.y??0},R.lines[0].baseline,P,!0,null,le)):R.visitLines({visitTextLine:(e,n,r)=>{let a=e.runs[0].text.replace(/\s+$/,``),s=n===r-1,l=P===J.HorizontalAlignment.Justify&&(s||e.runs[0].text.endsWith(`
|
|
5
|
+
`))?J.HorizontalAlignment.Left:P,u=0;n>0&&(V.getVertical()===J.VerticalAlignment.Distributed||V.getVertical()===J.VerticalAlignment.Justify)&&(u=Math.max(0,(g-(ne+3)-e.bounds.height*r)/(r-1)*n)),V.getVertical()===J.VerticalAlignment.Distributed&&te&&te%90==0&&te%180!=0&&(l=J.HorizontalAlignment.Distributed),l!==J.HorizontalAlignment.Justify&&l!==J.HorizontalAlignment.Distributed&&l!==J.HorizontalAlignment.Fill||(t={...t,width:o});let d=H||T&&(T.repeatChars.length>0||T.spacingChars.length>0)?t.width:e.bounds.width,f={...e.bounds,y:e.bounds.y+u+0,width:d};i=f.y,me(a,n,f,c.lines[0].baseline,l,s,r===1?F:null,se&&n>0?{...le,style:{...le.style,background:void 0}}:le)}});if(z&&!f&&!y&&!O&&r.length>0){let e=w.measureText(``),t=Math.max(1,Math.round(ee.getSize()/10)),a=(e.baseline??e.lineHeight)+t,o=w.getInsets(),c=N+o.left,l=N+M-o.right;if(F&&!I&&!L){let e=F.runs,t=0;for(;t<e.length&&e[t].type===gn.ParseRunType.Spacing;)c+=e[t].width,t++;let n=e.length-1;for(;n>=t&&e[n].type===gn.ParseRunType.Spacing;)l-=e[n].width,n--}if(l>c){let e=n.y+(b===null?G.top:0)+i+a,o=ee.getUnderline()===un.UnderlineStyle.DoubleAccounting?[e,e+2*t]:[e],u=(B??ee.getColor()).toCSS(`adaptive`);for(let e=0;e<o.length;e++)r.push((0,Z.jsx)(`div`,{style:{position:`absolute`,left:c*s+1,top:o[e]*s+1,width:(l-c)*s,height:Math.max(1,t*s),background:u,zIndex:ce?1:void 0}},`accounting-underline-${e}`))}}}r.length>0&&(I=r),ur&&!se&&I&&(I=[I,(0,Z.jsx)(`div`,{style:{left:n.x*s,top:n.y*s,width:n.width*s,height:n.height*s}},`text-debug-bounds`)])}if(se)return I&&I.length>0?I:ae<=0?null:(0,Z.jsx)(`div`,{style:K,...m});let le=null;if(dr){let e=v.getTextPlacement({width:_,height:g},O);e&&(le=(0,Z.jsx)(`div`,{style:{position:`absolute`,left:e.bounds.x*s+1,top:e.bounds.y*s+1,width:e.bounds.width*s,height:e.bounds.height*s,outline:`1px solid rgba(0,120,255,0.8)`,background:`rgba(0,120,255,0.08)`,pointerEvents:`none`}},`placement-debug`))}let ue=[I,i,le];return(0,Z.jsx)(`div`,{style:{...oe,zIndex:ce?1:void 0},...m,children:ue})},ur=!1,dr=!1,fr=Object.freeze({top:0,right:0,bottom:0,left:0}),pr={text:`flex-start`,number:`flex-end`,boolean:`center`},mr=(e,t)=>e===J.HorizontalAlignment.General?pr[t]:e===J.HorizontalAlignment.Left?`flex-start`:e===J.HorizontalAlignment.Right?`flex-end`:`center`,hr=e=>{let{value:t,control:n,context:r,interactiveProps:i,Default:a,bounds:o,zoom:s=1,cell:c,range:l,style:u,alignAs:d=`boolean`,interactive:f,centerOnTextLine:p,inset:m=!0,children:h,...g}=e,_=t.getStyle(),v=_.getFont(),y=_.getAlignment(),b=m?t.getInsets():fr,x=(e=>e===J.VerticalAlignment.Top?`flex-start`:e===J.VerticalAlignment.Center?`center`:`flex-end`)(y.getVertical()),S=b.top*s,C=b.bottom*s,w=p&&o?t.getTextPlacement({width:o.width/s,height:o.height/s}):null;if(w){let e=(w.bounds.y+w.lineHeight/2-1)*s,t=Math.max(0,Math.min(e-S,o.height-C-e));S=e-t,C=o.height-e-t,x=`center`}return(0,Z.jsx)(`div`,{...g,...f?i:void 0,style:{...u,boxSizing:`border-box`,display:`flex`,justifyContent:mr(y.getHorizontal(),d),alignItems:x,padding:`${S}px ${b.right*s}px ${C}px ${b.left*s}px`,color:v.toCSS(`adaptive`,s,!0).color,fontSize:v.getSize()*(96/72)*s},children:h})};hr.displayName=`CellContent`;var gr=e=>{let t=e.value,n=e.zoom??1,r=!0===t.getValue(),i=t.getFormula()!==null,a=Math.max(8,Math.round(t.getStyle().getFont().getSize()*(96/72)))*n;return(0,Z.jsx)(hr,{...e,centerOnTextLine:!0,children:(0,Z.jsx)(`div`,{...i?void 0:e.interactiveProps,role:`checkbox`,"aria-checked":r,"aria-disabled":i||void 0,style:{width:a,height:a,maxWidth:`100%`,maxHeight:`100%`,boxSizing:`border-box`,border:`${Math.max(1,Math.round(n))}px solid currentColor`,borderRadius:2*n,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:i?.6:void 0,cursor:i?void 0:`pointer`},children:r?(0,Z.jsx)(j,{iconKey:`Check`,ariaHidden:!0,size:Math.round(.85*a)}):null})})},_r=e=>{let t=e.getControl();return!!t&&t.getType()===`checkbox`&&t.isAccepted(e.getValue())&&e.getFormula()===null},vr=Object.freeze([Xn.Feature.CellControl,Xn.Feature.Formula,Xn.Feature.Kind]),yr=Object.freeze({renderer:gr,onPress:(e,t)=>{t.setCellValue(e,!0!==e.getValue())},onKey:(e,t,n)=>e===` `&&((e,t)=>{let{selection:n,anchor:r}=e,i=n.getRanges(),a=i.getCount(),o=[];for(let e=0;e<a;e++)for(let t of i.at(e).getRegions(vr))_r(t.getCell())&&o.push(t.getRange());if(o.length===0)return!1;let s=!0!==(_r(r)?r:o[0].getCell()).getValue();return t.sheet.doBatch(()=>{for(let e of o)t.setRangeValue(e,s)}),!0})(t,n)}),br=new WeakMap,xr=new Map,Sr=new WeakMap,Cr=e=>{let t=e.getStyle().getAlignment(),n=t.getHorizontal(),r=t.getVertical();return`${n===J.HorizontalAlignment.Right?`right`:n===J.HorizontalAlignment.General||n===J.HorizontalAlignment.Left?`left`:`center`} ${r===J.VerticalAlignment.Top?`top`:r===J.VerticalAlignment.Center?`center`:`bottom`}`},wr=e=>{let{image:t,workbook:n,zoom:r,position:i}=e,[a,o]=(0,X.useState)(null),[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=!0;return((e,t)=>{let n=t.getResource();if(n&&!n.isClosed()){let e=Sr.get(n);return e||(e=(async()=>{let[e,r]=await Promise.all([n.toBuffer(),n.getType()]);if(!r?.mime.startsWith(`image/`))throw Error(`No picture at '${t.getSource()}'.`);return`data:${r.mime};base64,${m.arrayBufferToBase64(e)}`})(),Sr.set(n,e)),e}let r=t.getSource(),i=xr;e&&(i=br.get(e)??new Map,br.set(e,i));let a=i.get(r);return a||(a=(async()=>{let t=e?await e.fetch(r):await fetch(r),n=t.headers.get(`content-type`);if(!t.ok||!n?.startsWith(`image/`))throw Error(`No picture at '${r}'.`);return`data:${n};base64,${m.arrayBufferToBase64(await t.arrayBuffer())}`})(),i.set(r,a)),a})(n,t).then(n=>{e&&o({image:t,url:n})},()=>{e&&o({image:t,failed:!0})}),()=>{e=!1}},[t,n]);let d=!!a&&a.image===t&&`failed`in a;if(N(l!==t&&!d,n),!a||a.image!==t)return null;if(`failed`in a)return(0,Z.jsx)(`span`,{children:`#VALUE!`});let f=t.getSizing(),p={display:`block`,filter:`var(--sxl-image-filter)`,minWidth:0,minHeight:0};if(f===Un.Sizing.Fit||f===Un.Sizing.Fill)p.width=`100%`,p.height=`100%`,p.objectFit=f===Un.Sizing.Fit?`contain`:`fill`,p.objectPosition=i;else if(f===Un.Sizing.Custom){let e=t.getHeight(),n=t.getWidth();p.width=n===null?`auto`:n*r,p.height=e===null?`auto`:e*r,n!==null&&e!==null||(p.aspectRatio=`auto`)}else s&&(p.width=s.width*r,p.height=s.height*r);return(0,Z.jsx)(`img`,{src:a.url,alt:t.getAltText()??``,draggable:!1,style:p,onLoad:e=>{if(f===Un.Sizing.Original){let{naturalWidth:t,naturalHeight:n}=e.currentTarget;c(e=>e?.width===t&&e.height===n?e:{width:t,height:n})}u(t)},onError:()=>u(t)})},Tr=Object.freeze({renderer:e=>{let t=e.value.getValue();return(0,Z.jsx)(hr,{...e,alignAs:`text`,inset:!1,children:(0,Z.jsx)(wr,{image:t,workbook:e.context.sheet.getWorkbook(),zoom:e.zoom??1,position:Cr(e.value)})})},insertable:!1}),Er=new Map,Dr=new Map,Or=new Map,kr=new Map,Ar=new Set,jr=0,Mr=!1,Nr=()=>{Mr||(Mr=!0,Er.set(`checkbox`,yr),Or.set(`image`,Tr))};function Pr(e){return Nr(),kr.get(e)??Or.get(e)}function Fr(e){return Nr(),Dr.get(e)??Er.get(e)}function Ir(e){Nr();let t=e.getControl();if(t){let n=e.getValue();if(t.isAccepted(n)){let e=Fr(t.getType());if(e)return{entry:e,control:t}}}if(e.getType()===wn.RichData){let t=Pr(e.getValue().getKind().getName());if(t)return{entry:t,control:null}}return null}function Lr(e){return Ar.add(e),()=>{Ar.delete(e)}}function Rr(){return jr}function zr(e){let{sheet:t,notifier:n,notifyEditRejected:r}=e,i=(e,t)=>{t.isEditAllowed()?n.showError?.(e instanceof Error?e:String(e)):r(t.getCoords())};return{sheet:t,notifier:n,setCellValue(e,t){if(e.getFormula()!==null)return!1;if(!e.isEditAllowed())return r(e.getCoords()),!1;try{e.getRange().setValue(t)}catch(t){return i(t,e),!1}return!0},setRangeValue(e,n){let r=(e=>{if(e.getCounts(`formula`).formula===0)return[e];let t=[e];for(let n of e.getRegions(`formula`)){if(!n.getFeatures().includes(`formula`))continue;let e=n.getRange(),r=[];for(let n of t){if(!n.getIntersect(e)){r.push(n);continue}let t=n.getDifferences(e);if(!t)continue;let i=t.getCount();for(let e=0;e<i;e++)r.push(t.at(e))}t=r}return t})(e);if(r.length===0)return!1;try{t.doBatch(()=>{for(let e of r)e.setValue(n)})}catch(t){return i(t,e.getCell()),!1}return!0}}}function Br(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Br(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Q(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Br(e))&&(r&&(r+=` `),r+=t);return r}var Vr=(0,X.createContext)(null);Vr.displayName=`DocThemesContext`;var Hr=()=>{let e=(0,X.useContext)(Vr),[t]=(0,X.useState)(()=>new Kn);return(0,X.useMemo)(()=>e||t,[e])},Ur=`sxl-system-colors`,Wr=()=>{if(typeof document>`u`||document.getElementById(Ur))return;let e=fn.getSystemColorDefaults(),t=Object.keys(e).map(t=>`${Sn}${t}:${e[t]};`).join(``),n=document.createElement(`style`);n.id=Ur,n.textContent=`:root{${t}}`,document.head.appendChild(n)},Gr=()=>{(0,X.useMemo)(()=>{Wr()},[])},Kr=[[xn.Named.Window,`var(--sxl-color-base-100)`],[xn.Named.Menu,`var(--sxl-color-base-100)`],[xn.Named.BtnFace,`var(--sxl-color-base-100)`],[xn.Named.ScrollBar,`var(--sxl-color-base-100)`],[xn.Named.AppWorkspace,`var(--sxl-color-base-100)`],[xn.Named.Background,`var(--sxl-color-base-100)`],[xn.Named.InfoBk,`color-mix(in srgb, var(--sxl-color-base-100) 88%, #ffeb3b)`],[xn.Named.WindowText,`var(--sxl-color-base-content)`],[xn.Named.MenuText,`var(--sxl-color-base-content)`],[xn.Named.BtnText,`var(--sxl-color-base-content)`],[xn.Named.InfoText,`var(--sxl-color-base-content)`],[xn.Named.CaptionText,`var(--sxl-color-base-content)`],[xn.Named.GrayText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[xn.Named.InactiveCaptionText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[xn.Named.Highlight,`var(--sxl-color-primary)`],[xn.Named.ActiveCaption,`var(--sxl-color-primary)`],[xn.Named.HotLight,`var(--sxl-color-primary)`],[xn.Named.HighlightText,`var(--sxl-color-primary-content)`],[xn.Named.BtnHighlight,`var(--sxl-color-base-200)`],[xn.Named.Light3d,`var(--sxl-color-base-200)`],[xn.Named.InactiveCaption,`var(--sxl-color-base-200)`],[xn.Named.ActiveBorder,`var(--sxl-color-base-300)`],[xn.Named.InactiveBorder,`var(--sxl-color-base-300)`],[xn.Named.WindowFrame,`var(--sxl-color-base-300)`],[xn.Named.BtnShadow,`var(--sxl-color-neutral)`],[xn.Named.DkShadow3d,`var(--sxl-color-neutral)`]],qr={};for(let[e,t]of Kr)qr[`sys-color-${e.toLowerCase()}`]=t;var Jr={light:qr,dark:qr},Yr=(e=`sxl-defaults`,t)=>H({app:Jr,surfaces:{grid:Jr,header:Jr},layer:e,scope:t}),Xr=(e,t,n,r)=>{let i=e.getColorScheme(),a=e.getFontScheme();return{"doc-color-dk1":i.getDk1().toCSS(r),"doc-color-dk2":i.getDk2().toCSS(r),"doc-color-lt1":i.getLt1().toCSS(r),"doc-color-lt2":i.getLt2().toCSS(r),"doc-color-accent1":i.getAccent1().toCSS(r),"doc-color-accent2":i.getAccent2().toCSS(r),"doc-color-accent3":i.getAccent3().toCSS(r),"doc-color-accent4":i.getAccent4().toCSS(r),"doc-color-accent5":i.getAccent5().toCSS(r),"doc-color-accent6":i.getAccent6().toCSS(r),"doc-color-hlink":i.getHlink().toCSS(r),"doc-color-fol-hlink":i.getFolHlink().toCSS(r),"doc-font-major":un.toCSSFontFamily(a.getMajorFont(),a.getMajorFallbacks()),"doc-font-minor":un.toCSSFontFamily(a.getMinorFont(),a.getMinorFallbacks()),"doc-font-size":`${t}pt`,"doc-line-height":`${n}px`}},Zr=(e,t,n,r=`sxl-defaults`,i)=>H({app:{light:Xr(e,t,n,!1),dark:Xr(e,t,n,!0)},layer:r,scope:i}),Qr=e=>{let{length:t=0,width:n=1,dashArray:r=null,dashArrayAdditional:i=null,isDouble:a=!1,isAngled:o=!1,offsetX:s=0,offsetY:c=0,isVertical:l=!1,...u}=e,d=e=>{let t=null;if(e&&n>0){t=``;for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=`,`)}return t},f=d(r),p=f;i&&(p=d(i));let m=_e.getDevicePixelRatio(),h=(e,t,n,r)=>{let i=_e.snapLineCenter(e,r/m,m),a=_e.snapDeviceEdge(t,m),o=_e.snapDeviceEdge(n,m);return l?`M ${i} ${a} L ${i} ${o}`:`M ${a} ${i} L ${o} ${i}`},g=n,_=t,v=null;if(a){g=Math.floor(n/2);let e=l?c:s;v=(0,Z.jsx)(`path`,{strokeWidth:g/m,strokeDasharray:p??void 0,d:h((l?s:c)+(g+g/2+1)/m,e,e+_,g),...u})}if(o){g=n/2;let e=l?c:s;v=(0,Z.jsx)(`path`,{strokeWidth:g/m,strokeDasharray:p??void 0,strokeDashoffset:`1`,d:h((l?s:c)+(g+g/2)/m,e,e+_,g),...u})}let y=l?c:s;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{strokeWidth:g/m,strokeDasharray:f??void 0,d:h((l?s:c)+g/2/m,y,y+_,g),...u}),v]})},$r=(e,t)=>{if(!e||e.isNone())return null;let n=pn.BuiltInDefinitions.get(e.getStyle());return n?{color:e.getColor().toCSS(`adaptive`),width:n.width,dashArray:n.pattern,isDouble:n.style===pn.StrokeStyle.Double,edge:gi(t)}:null},ei=({getBorderAt:e,getMergeAt:t,rendererBorder:n=_i,getVisibleCells:r,forceThinBorder:i=!1,defaultColor:a=`black`,mode:o=`direct`,normalRows:s=null,normalColumns:c=null,cache:l})=>{let u=G(r,[r]),d=`sxl-borders-`+(0,X.useId)().replace(/[^a-zA-Z0-9_-]/g,``),f=(0,X.useRef)({});return{renderLayer:(0,X.useMemo)(()=>o===`normal`?n=>!s&&!c?null:oi(n,ri(l,n,u(n)??[],e,t,a),s,c,f.current,d):r=>{if(!e&&!s&&!c)return null;let o=r.toClipBounds(r.getBoundsFromRange(),-3);if(!o)return;let p=u(r)??[];if(p.length===0&&!s&&!c)return;let m=ri(l,r,p,e,t,a),{mergedRows:h,mergedColumns:g,diagonals:_,crossings:v}=m,y=ii(r,m,s,c,f.current,!0);if(g.length===0&&h.length===0&&_.length===0&&!y.dH&&!y.dV)return null;let b=_e.getDevicePixelRatio(),x=r.getMetrics(),S=(e,t,n)=>_e.edgeCenter(e,gi(n),t,b),C=h.length,w=g.length,T=new Float64Array(C),E=new Float64Array(C),D=new Float64Array(w),O=new Float64Array(w),k=v.length;for(let e=0;e<k;e+=2){let t=v[e],n=v[e+1],r=h[t],a=g[n],o=a.index===r.from||a.index===r.to+1,s=r.index===a.from||r.index===a.to+1,c=!i&&r.stroke.getStyle()===pn.StrokeStyle.Double,l=!i&&a.stroke.getStyle()===pn.StrokeStyle.Double,u=o&&c&&!l,d=s&&l&&!c;if(!(o&&s||u||d))continue;let f=pn.BuiltInDefinitions.get(a.stroke.getStyle())?.width??1,p=pn.BuiltInDefinitions.get(r.stroke.getStyle())?.width??1,m=f/2/b,_=p/2/b,y=x.getColOffset(a.index),C=S(y,f,a.edge);u?a.index===r.to+1?E[t]=Math.min(E[t],C-m-y):T[t]=Math.min(T[t],y-(C+m)):o&&s&&(a.index===r.to+1?E[t]=C+m-y:T[t]=y-(C-m));let w=x.getRowOffset(r.index),k=S(w,p,r.edge);d?r.index===a.to+1?O[n]=Math.min(O[n],k-_-w):D[n]=Math.min(D[n],w-(k+_)):o&&s&&(r.index===a.to+1?O[n]=k+_-w:D[n]=w-(k-_))}let A=(e,t,n,r)=>{let a=e=>t?x.getRowOffset(e):x.getColOffset(e),o=.5/b,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(!s.startMet){let r=a(s.from),l=S(r,1,t?pn.Edge.Top:pn.Edge.Left),u=e[c-1],d=u?.ordinal!==s.ordinal||a(u.to+1)!==r||hi(s.stroke,u.stroke,!0,i);n[c]=r-(d?l-o:l+o)}if(!s.endMet){let n=a(s.to+1),l=S(n,1,t?pn.Edge.Bottom:pn.Edge.Right),u=e[c+1],d=u?.ordinal!==s.ordinal||a(u.from)!==n||hi(s.stroke,u.stroke,!1,i);r[c]=(d?l+o:l-o)-n}}};A(h,!1,T,E),A(g,!0,D,O);let j=r.getMetrics(),M=e=>!i&&e.getStyle()===pn.StrokeStyle.Double,N=pn.BuiltInDefinitions.get(pn.StrokeStyle.Double).width,P=[],F=[],I=``,L=``,R=[],ee=(e,t,n)=>{if(!e||!t)return;let r=ai(e,t,b,n);t.isDouble&&!i?(F.push(r),I+=e,L+=e):R.push(r)};ee(y.dH,s,`normal-rows`),ee(y.dV,c,`normal-columns`);let z=(e,t,r,a)=>{let o=t?{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}:{rowStart:e.index,rowEnd:e.index,colStart:e.from,colEnd:e.to+1},s=j.getColOffset(o.colStart),c=j.getRowOffset(o.rowStart),l=t?s:j.getColOffset(o.colEnd),u=t?j.getRowOffset(o.rowEnd):c,d=n({key:`${t?`c`:`r`}Border:${e.index}:${e.from}:${e.to}:${e.edge}`,points:[s,c,l,u],stroke:e.stroke,forceThinBorder:i,range:o,edge:e.edge,intersections:e.intersections,startExtend:r,endExtend:a,metrics:j,isVertical:t});if(!M(e.stroke))return void P.push({stroke:e.stroke,node:d});F.push(d);let f=t?s:c,p=t?c:s,m=t?u:l;I+=ci(f,p,m,t,e.edge,b),L+=li(f,p-r,m+a,t,e.edge,b)};for(let e=0;e<w;e++)z(g[e],!0,D[e],O[e]);for(let e=0;e<C;e++)z(h[e],!1,T[e],E[e]);P.sort((e,t)=>pn.compareStrokes(e.stroke,t.stroke));let B=[],V=[],H=[],U=``,W=_.length;for(let e=0;e<W;e++){let{box:t,up:r,down:a}=_[e],o=j.getColOffset(t.colStart),l=j.getRowOffset(t.rowStart),u=j.getColOffset(t.colEnd+1),f=j.getRowOffset(t.rowEnd+1),p=i?null:si(m,t,s,c,{left:o,top:l,right:u,bottom:f},b),h=o+(p?.left??0),g=l+(p?.top??0),v=u-(p?.right??0),y=f-(p?.bottom??0),x=`${d}-clip-${e}`;H.push((0,Z.jsx)(`clipPath`,{id:x,children:(0,Z.jsx)(`rect`,{x:h,y:g,width:Math.max(0,v-h),height:Math.max(0,y-g)})},x));let S=(e,r,a)=>{let o=`dBorder:${t.rowStart}:${t.colStart}:${r}`,s=(0,Z.jsx)(`g`,{clipPath:`url(#${x})`,children:n({key:o,points:a,stroke:e,forceThinBorder:i,range:t,edge:r,metrics:j})},o);M(e)?(V.push(s),U+=`M ${a[0]} ${a[1]} L ${a[2]} ${a[3]} `):B.push(s)};a&&!a.isNone()&&S(a,pn.Edge.DiagonalDown,[h,g,v,y]),r&&!r.isNone()&&S(r,pn.Edge.DiagonalUp,[h,y,v,g])}let te=o.width,G=o.height,ne=`${d}-edges`,re=`${d}-plain`,ie=`${d}-diagonals`,ae=I||U||H.length>0;return(0,Z.jsxs)(`svg`,{width:`${te}`,height:`${G}`,viewBox:`0 0 ${te} ${G}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:`0px`,top:`0px`,width:`${te}px`,height:`${G}px`,pointerEvents:`none`,willChange:`left, top, width, height, stroke-dashoffset`,overflow:`visible`},children:[ae?(0,Z.jsxs)(`defs`,{children:[I?di(ne,I,1/b,te,G):null,L?di(re,L,N/b,te,G):null,U?di(ie,U,1/b,te,G):null,H]}):null,(0,Z.jsxs)(`g`,{mask:L?`url(#${re})`:void 0,children:[R,P.map(e=>e.node)]}),F.length>0?(0,Z.jsx)(`g`,{mask:`url(#${ne})`,children:F}):null,B,V.length>0?(0,Z.jsx)(`g`,{mask:`url(#${ie})`,children:V}):null]},`borders`)},[e,t,n,i,a,o,s,c,d])}},ti=(e,t,n,r,i)=>{let a=[],o=[],s=[],c=[],l=[],u=new Set,d=e.getVisibleColumns(),f=e.getVisibleRows(),p=d.map(e=>e.index),m=f.map(e=>e.index),h=new Map(p.map((e,t)=>[e,t])),g=new Map(m.map((e,t)=>[e,t])),_=[],v=[],y=[],b=[],x=(e,t,n)=>{let r=e[t];r||(r=new Map,e[t]=r),r.set(n,(r.get(n)??0)+1)},S=(e,t,n,r,i,a,o)=>{let s=e[t];s||(s=new Map,e[t]=s);let c=s.get(r);c&&pn.compareStrokes(c.stroke,i)>0||s.set(r,{index:r,stroke:i,visibleIndex:n,edge:a,length:o})},w=e.getVisibleRange(),T=t.length;for(let e=0;e<T;e++){let i=t[e],p=i.cell;if(!p)continue;let m=i.range??{rowStart:p.rowIndex,colStart:p.colIndex,rowEnd:p.rowIndex,colEnd:p.colIndex};if(!C.isRangesIntersect(m,w)&&!C.isRangeWithinRange(m,w))continue;let T=p.colIndex,E=p.rowIndex,D=h.get(T),O=g.get(E);if(m.rowEnd!==m.rowStart){s.push(m);let e=g.get(m.rowStart)??-1,t=g.get(m.rowEnd)??f.length;a.push({...m,rowStart:e,rowEnd:t})}if(m.colEnd!==m.colStart){c.push(m);let e=h.get(m.colStart)??-1,t=h.get(m.colEnd)??d.length;o.push({...m,colStart:e,colEnd:t})}if(!n)continue;let k=i.value,A=n(k,e),j=!A||A.isEmpty();if(D!==void 0&&O!==void 0&&((j||A.getLeft().isNone())&&x(y,D,E),(j||A.getRight().isNone())&&x(y,D+1,E),(j||A.getTop().isNone())&&x(b,O,T),(j||A.getBottom().isNone())&&x(b,O+1,T)),j)continue;let M=A.getDiagonalUp(),N=A.getDiagonalDown();if(!M.isNone()||!N.isNone()){let t=r?.(k,e)??{rowStart:E,colStart:T,rowEnd:E,colEnd:T},n=`${t.rowStart}:${t.colStart}`;u.has(n)||(u.add(n),l.push({box:t,up:M,down:N}))}let P=A.getLeft(),F=A.getTop(),I=A.getRight(),L=A.getBottom();if(D===void 0||O===void 0)continue;let R=D,ee=O;P.isNone()||S(_,R,ee,E,P,pn.Edge.Left,1),F.isNone()||S(v,ee,R,T,F,pn.Edge.Top,1),I.isNone()||S(_,R+1,ee,E,I,pn.Edge.Right,1),L.isNone()||S(v,ee+1,R,T,L,pn.Edge.Bottom,1)}let E=(e,t,n)=>{let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a],o=Math.max(0,(t?i.rowStart:i.colStart)+1),s=Math.min(n,t?i.rowEnd:i.colEnd),c=t?i.colStart:i.rowStart,l=t?i.colEnd:i.rowEnd;for(let e=o;e<=s;e++)(r[e]??=[]).push(c,l)}return r},D=(e,t,n)=>{let r=[],s=n?E(a,!0,f.length):E(o,!1,d.length);return e.forEach((e,n)=>{let a=null,o=s[n],c=Array.from(e.values()).sort((e,t)=>e.visibleIndex-t.visibleIndex),l=c.length;for(let e=0;e<l;e++){let s=c[e];if(!s?.stroke||t[n]===void 0&&t[n-1]===void 0)continue;if(o){let e=!1,t=o.length;for(let n=0;!e&&n<t;n+=2)o[n]<=s.index&&o[n+1]>=s.index&&(e=!0);if(e)continue}let l=s.stroke?.getColor(),u=l?l.toCSS(`adaptive`):i,d=s.stroke.getStyle()+`:`+u;(!a||d!==a.key||a.visibleIndex+1<s.visibleIndex)&&(a&&r.push(a),a={key:d,index:t[n]??t[n-1]+1,ordinal:n,visibleIndex:s.visibleIndex,edge:s.edge,stroke:s.stroke,from:s.index,to:s.index+s.length-1,intersections:[],startMet:!1,endMet:!1,length:1}),a.to=s.index+s.length-1,a.visibleIndex=s.visibleIndex}a&&r.push(a)}),r},O=D(_,p,!1),k=D(v,m,!0);return{mergedColumns:O,mergedRows:k,crossings:ni(k,O),diagonals:l,rangesH:s,rangesV:c,sigRangesH:mi(s),sigRangesV:mi(c),breaksRows:fi(k,null,m),breaksRowsNone:fi(k,b,m),breaksColumns:fi(O,null,p),breaksColumnsNone:fi(O,y,p),columns:_,rows:v,colOrdinal:h,rowOrdinal:g}},ni=(e,t)=>{let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i],a=h.findEqualOrGreater(t,r.from,e=>e.index);for(;a>0&&t[a-1].index>=r.from;)a--;let o=!1;for(;!o;){let e=a++,s=t[e];s&&s.index>=r.from&&s.index<=r.to+1&&s.from<=r.index&&s.to+1>=r.index&&(r.intersections.push({stroke:s.stroke,edge:s.edge,range:{rowStart:s.from,rowEnd:s.to+1,colStart:s.index,colEnd:s.index}}),s.intersections.push({stroke:r.stroke,edge:r.edge,range:{rowStart:r.index,rowEnd:r.index,colStart:r.from,colEnd:r.to+1}}),s.index===r.from&&(r.startMet=!0),s.index===r.to+1&&(r.endMet=!0),r.index===s.from&&(s.startMet=!0),r.index===s.to+1&&(s.endMet=!0),n.push(i,e)),o=!s||s.index>r.to+1}}return n},ri=(e,t,n,r,i,a)=>{if(!e)return ti(t,n,r,i,a);let o=e.entries,s=t.getVisibleRange(),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.visibleCells===n&&t.getBorderAt===r&&t.getMergeAt===i&&t.defaultColor===a&&C.isEqualRanges(t.visible,s))return t.collected}let l=ti(t,n,r,i,a);return o.push({visibleCells:n,getBorderAt:r,getMergeAt:i,defaultColor:a,visible:s,collected:l}),o.length>8&&o.shift(),l},ii=(e,t,n,r,i,a)=>{if(!n&&!r)return{dH:null,dV:null};let{rangesH:o,rangesV:s}=t,c=_e.getDevicePixelRatio(),{top:l,left:u}=e.getScrollTopLeft(),d=e.getPaneBounds(),f=e.getVisibleRange(),p=e.getColumnSize(f.colEnd),m=e.getRowSize(f.rowEnd),h=Math.min(d.width,p?p.offset+p.size:d.width),g=Math.min(d.height,m?m.offset+m.size:d.height);i.pane!==e&&(i.pane=e,i.sigH=i.sigV=void 0);let _=(n,r)=>{if(!n)return null;let d=r?a?t.breaksRowsNone:t.breaksRows:a?t.breaksColumnsNone:t.breaksColumns,f=d.sig,p=r?o:s,m=n.width??1,_=_e.edgeTrailingShift(n.edge??`leading`,m,c),v=r?`${l}|${h}`:`${u}|${g}`,y=p.length===0&&f===``?`${v}|${c}|${m}|${_}`:`${v}|${r?u:l}|${c}|${m}|${_}|${r?t.sigRangesH:t.sigRangesV}|${f}`;if(r?i.sigH===y:i.sigV===y)return(r?i.dH:i.dV)??null;let b=Lt(e,r,p,{width:m,shift:_,breaksAt:d.byTrail.size>0?t=>pi(e,d.byTrail.get(t),r):void 0});return r?(i.sigH=y,i.dH=b):(i.sigV=y,i.dV=b),b};return{dH:_(n,!0)||null,dV:_(r,!1)||null}},ai=(e,t,n,r)=>(0,Z.jsx)(`path`,{d:e,fill:`none`,stroke:t.color,strokeWidth:(t.width??1)/n,strokeDasharray:t.dashArray?t.dashArray.join(`,`):void 0,vectorEffect:`non-scaling-stroke`},r),oi=(e,t,n,r,i,a)=>{let{dH:o,dV:s}=ii(e,t,n,r,i,!1);if(!o&&!s)return null;let c=_e.getDevicePixelRatio(),l=o&&n?.isDouble?o:null,u=s&&r?.isDouble?s:null,d=(l??``)+(u??``),f=e.getPaneBounds(),p=Math.ceil(f.width),m=Math.ceil(f.height),h=`${a}-normal`;return(0,Z.jsxs)(`svg`,{width:`${p}`,height:`${m}`,viewBox:`0 0 ${p} ${m}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:0,top:0,overflow:`visible`,pointerEvents:`none`},children:[d?(0,Z.jsx)(`defs`,{children:di(h,d,1/c,p,m)}):null,d?(0,Z.jsxs)(`g`,{mask:`url(#${h})`,children:[l?ai(l,n,c):null,u?ai(u,r,c):null]}):null,o&&!l?ai(o,n,c):null,s&&!u?ai(s,r,c):null]})},si=(e,t,n,r,i,a)=>{let{rows:o,columns:s,rowOrdinal:c,colOrdinal:l}=e,u=(e,t,n,r,i)=>{let a=null;if((t===void 0?void 0:e[t])?.forEach(e=>{e.index<n||e.index>r||(!a||pn.compareStrokes(e.stroke,a.stroke)>0)&&(a=e)}),a){let e=a;return{width:pn.BuiltInDefinitions.get(e.stroke.getStyle())?.width??1,kind:gi(e.edge)}}return i?{width:i.width??1,kind:i.edge??`leading`}:null},d=e=>e===void 0?void 0:e+1,f=(e,t,n)=>{if(!t)return 0;let r=t.width/2/a,i=_e.edgeCenter(e,t.kind,t.width,a),o=Math.floor(e*a)/a;return Math.max(0,n?i+r-(o+1/a):o-(i-r))};return{left:f(i.left,u(s,l.get(t.colStart),t.rowStart,t.rowEnd,r),!0),right:f(i.right,u(s,d(l.get(t.colEnd)),t.rowStart,t.rowEnd,r),!1),top:f(i.top,u(o,c.get(t.rowStart),t.colStart,t.colEnd,n),!0),bottom:f(i.bottom,u(o,d(c.get(t.rowEnd)),t.colStart,t.colEnd,n),!1)}},ci=(e,t,n,r,i,a)=>{let o=ui(e,i,a),s=.5/a,c=_e.snapLineCenter(t,1/a,a)-s,l=_e.snapLineCenter(n,1/a,a)+s;return r?`M ${o} ${c} L ${o} ${l} `:`M ${c} ${o} L ${l} ${o} `},li=(e,t,n,r,i,a)=>{let o=ui(e,i,a),s=_e.snapDeviceEdge(t,a),c=_e.snapDeviceEdge(n,a);return r?`M ${o} ${s} L ${o} ${c} `:`M ${s} ${o} L ${c} ${o} `},ui=(e,t,n)=>{let r=pn.BuiltInDefinitions.get(pn.StrokeStyle.Double).width;return _e.snapLineCenter(e+_e.edgeTrailingShift(gi(t),r,n),r/n,n)},di=(e,t,n,r,i)=>(0,Z.jsxs)(`mask`,{id:e,maskUnits:`userSpaceOnUse`,x:-8,y:-8,width:r+16,height:i+16,children:[(0,Z.jsx)(`rect`,{x:-8,y:-8,width:r+16,height:i+16,fill:`white`}),(0,Z.jsx)(`path`,{d:t,fill:`none`,stroke:`black`,strokeWidth:n})]},e),fi=(e,t,n)=>{let r=new Map,i=``,a=(e,t,a)=>{if(e===0||t<0||a<0)return!1;let o=n[e-1];if(o===void 0)return!1;let s=r.get(o);return s||(s=[],r.set(o,s)),s.push(t,a),i+=`${o}:${t}:${a};`,!0},o=e.length;for(let t=0;t<o;t++){let n=e[t];a(n.ordinal,n.from,n.to)}let s=!1;return t?.forEach((e,t)=>{e.forEach((e,n)=>{e>=2&&a(t,n,n)&&(s=!0)})}),s&&r.forEach((e,t)=>{let n=[];for(let t=0;t<e.length;t+=2)n.push([e[t],e[t+1]]);n.sort((e,t)=>e[0]-t[0]),r.set(t,n.flat())}),{byTrail:r,sig:i}},pi=(e,t,n)=>{if(!t)return;let r=Array(t.length);for(let i=0;i<t.length;i+=2){let a=n?e.getColumnSize(t[i]):e.getRowSize(t[i]),o=n?e.getColumnSize(t[i+1]):e.getRowSize(t[i+1]);r[i]=a.offset,r[i+1]=o.offset+o.size}return r},mi=e=>{let t=``;for(let n=0;n<e.length;n++){let r=e[n];t+=`${r.rowStart},${r.colStart},${r.rowEnd},${r.colEnd};`}return t},hi=(e,t,n,r)=>{if(!r){let n=e.getStyle()===pn.StrokeStyle.Double;if(n!==(t.getStyle()===pn.StrokeStyle.Double))return!n}let i=pn.compareStrokes(e,t);return i===0?n:i>0},gi=e=>e===pn.Edge.Right||e===pn.Edge.Bottom?`trailing`:`leading`,_i=e=>{let{key:t,points:n,stroke:r,forceThinBorder:i=!1,isVertical:a=!1,edge:o,startExtend:s=0,endExtend:c=0}=e,l=pn.BuiltInDefinitions.get(i?pn.StrokeStyle.Thin:r.getStyle());if(!l)return null;let u=_e.getDevicePixelRatio(),d=n[0],f=n[1],p=n[2],m=n[3],h=r.getColor().toCSS(`adaptive`),g=l.description.toLowerCase().includes(`slant`);if(o===pn.Edge.DiagonalUp||o===pn.Edge.DiagonalDown)return(0,Z.jsx)(`path`,{d:`M ${d} ${f} L ${p} ${m}`,fill:`none`,stroke:h,strokeWidth:l.width/u,strokeDasharray:l.pattern?l.pattern.join(`,`):void 0},t);let _=s,v=(a?m-f:p-d)+c,y=_e.edgeTrailingShift(gi(o),l.width,u),b=a?-l.width/2/u+y:-_,x=a?-_:-l.width/2/u+y;return(0,Z.jsx)(Qr,{offsetX:d+b,offsetY:f+x,length:v+_,isVertical:a,stroke:h,width:l.width,dashArray:l.pattern,isAngled:g},t)},vi=g.Center,yi=Object.freeze({horizontal:!1,vertical:!1}),bi=E.EmptyTopLeft,xi=(e,t)=>C.EmptyCell,Si=(e,t)=>new Promise((e,t)=>{t(`StaticBorderRenderer does not support scrolling`)}),Ci=(0,X.memo)(e=>{let{getBorderAt:t,getMergeAt:n,width:r,height:i,style:a,rowCount:o=2,columnCount:s=2,forceThinBorder:c,mode:l,normalRows:d,normalColumns:f,children:p,...m}=e,h=(0,X.useRef)(null),[g,{width:_,height:v}]=be(),y=r??_,b=i??v,x=(0,X.useMemo)(()=>{let e=[];for(let t=0;t<o;t++)for(let n=0;n<s;n++){let r={colIndex:n,rowIndex:t};e.push({cell:r,value:r})}return e},[o,s]),{renderLayer:S}=ei({getVisibleCells:(0,X.useCallback)(e=>x,[x]),getBorderAt:t,getMergeAt:n,forceThinBorder:c,mode:l,normalRows:d,normalColumns:f}),w=Math.floor(y/s),T=Math.floor(b/o),D={getColOffset:e=>e*y/s+0,getRowOffset:e=>e*b/o+0,getColIndex:e=>Math.floor((e-0)/w)-1,getRowIndex:e=>Math.floor((e-0)/T)-1},O={rowStart:0,colStart:0,rowEnd:o,colEnd:s},k={x:0,y:0,width:Math.max(0,y)+0,height:Math.max(0,b)+0},A={left:0,top:0,right:0,bottom:0},j=e=>{if(e<0)return null;let t=D.getColOffset(e);return{index:e,offset:t,size:D.getColOffset(e+1)-t}},M=e=>{if(e<0)return null;let t=D.getRowOffset(e);return{index:e,offset:t,size:D.getRowOffset(e+1)-t}},N=u([h,g]);if(!S)return null;let P={width:y,height:b},F={width:y,height:b},I={addReactEventListener:()=>()=>{},getElement:()=>h.current,focus:e=>{h.current?.focus(e)},registerFocusTarget:()=>wi,getFocusTarget:()=>null,invalidate:wi,setPointerCapture(e){h.current?.setPointerCapture(e)},releasePointerCapture(e){h.current?.releasePointerCapture(e)},getTotalSize:()=>P,getSurfaceSize:()=>F,getMetrics:()=>D,getRangeFromCell:e=>C.cellToRange(e),getVisibleRange:()=>O,getVisibleRows:()=>{let e=[];for(let t=0;t<o;t++)e.push(M(t));return e},getPaneRange:()=>O,getTotalRange:()=>O,getPanePointFromPointer:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{let e=[];for(let t=0;t<s;t++)e.push(j(t));return e},toClipBounds:(e,t)=>k,toPaneBounds:e=>e,toAbsoluteBounds:e=>e,getPaneBounds:()=>k,getInsets:()=>A,getBoundsFromRange:(e,t)=>k,getColumnSize:j,getRowSize:M,getAllPanes:()=>({[vi]:I}),getAnchor:()=>vi,getZoom:()=>1,scrollTo:(e,t)=>Promise.resolve(E.EmptyTopLeft),scrollCellCoordsIntoView:Si,getCellFromPointer:xi,getPaneFromPointer:()=>I,getScrollOrientation:()=>yi,getScrollTopLeft:()=>bi,getFreezeTopLeft:()=>bi},L=S(I);return(0,Z.jsxs)(`div`,{style:{...a,position:`relative`,display:`flex`},...m,children:[(0,Z.jsx)(`div`,{ref:N,style:{flex:`1 1 100%`,display:`flex`,maxWidth:`100%`,maxHeight:`100%`},children:p}),L]})}),wi=()=>{},Ti=e=>{switch(e){case`right`:return`flex-end`;case`center`:return`center`;default:return`flex-start`}},Ei=e=>{switch(e){case J.VerticalAlignment.Top:return`flex-start`;case J.VerticalAlignment.Bottom:return`flex-end`;case J.VerticalAlignment.Center:return`center`;default:return`stretch`}},Di=(0,X.memo)(e=>{let{value:t,cellStyle:n,createCell:r,cell:i,propsBorder:a,disabled:o,className:s,style:c,ref:l,...u}=e,d=We(),f=d===`dark`,p=(0,X.useMemo)(()=>i||(r?.({value:t,style:n})??null),[i,t,n,r]),m=p?.getStyle(),h=(0,X.useMemo)(()=>m?.getFill().toCSS(f),[m,f]),g=(0,X.useMemo)(()=>m?.getFont().toCSS(f,1),[m,f]),_=(0,X.useMemo)(()=>m?.getInsets()??null,[m]),v=(0,X.useCallback)(()=>m?.getBorders()??null,[m]),y=m?.getAlignment(),b=y?.getRotation()??0,x=y?.getStacked()??!1,S=y?.getOverflow()===J.Overflow.Wrap,C=9*(y?.getIndent()??0),w=p?J.toCSSHorizontalTextAlign(p.getRenderHorizontalAlignment())??`left`:`left`,T=i?i.getNumberFormat().displayText??``:t??``,E=p?.getNumberFormat(),D=E?.formattedRuns?.runs,O=!E?.errorPlaceholder&&!!D&&D.some(e=>e.type!==gn.ParseRunType.Text),k=O?E.formattedRuns.lastRepeatIndex??-1:-1,A=O?D.map((e,t)=>{if(e.type===gn.ParseRunType.Spacing)return(0,Z.jsx)(`span`,{style:{visibility:`hidden`,whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t);if(e.type===gn.ParseRunType.Repeat&&t===k){let n=e.width>0?Math.ceil(1e3/e.width):1;return(0,Z.jsx)(`span`,{style:{flex:`1 1 0%`,minWidth:0,overflow:`hidden`,whiteSpace:`pre`},children:e.text.repeat(n)},t)}return(0,Z.jsx)(`span`,{style:{whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t)}):T;return(0,Z.jsx)(`div`,{ref:l,className:Q(`sxl-static-cell`,s),"data-sxl-theme-surface":`grid`,"data-sxl-theme-mode":d,style:{width:`100px`,height:`100%`,boxSizing:`border-box`,display:`flex`,alignItems:`stretch`,textOverflow:`ellipsis`,background:`var(--sxl-color-base-100)`,filter:o?`grayscale(0.4) opacity(0.8)`:`none`,...c},...u,children:(0,Z.jsx)(Ci,{getBorderAt:v,rowCount:1,columnCount:1,...a,style:{height:`100%`,width:`100%`,...a?.style},children:(0,Z.jsx)(`div`,{className:`fill`,style:{flex:`1 1 100%`,overflow:`hidden`,display:`flex`,alignItems:Ei(y?.getVertical()??J.VerticalAlignment.Bottom),paddingLeft:`4px`,paddingRight:`4px`,marginLeft:`-1px`,marginTop:`-1px`,marginRight:`-2px`,marginBottom:`-2px`,...h},children:(0,Z.jsx)(`div`,{className:`text`,style:{flex:`1 1 100%`,boxSizing:`border-box`,paddingTop:`${_?.top??0}px`,paddingRight:`${_?.right??0}px`,paddingBottom:`${_?.bottom??0}px`,paddingLeft:`${(_?.left??0)+C}px`,margin:`0px`,outline:`none`,overflow:`hidden`,textOverflow:`ellipsis`,maxHeight:`100%`,background:`transparent`,textAlign:w,whiteSpace:S?`pre-wrap`:`pre`,display:O?`flex`:void 0,alignItems:O?`baseline`:void 0,justifyContent:O&&k<0?Ti(w):void 0,transform:b?`rotate(${-b}deg)`:void 0,writingMode:x?`vertical-rl`:void 0,textOrientation:x?`upright`:void 0,...g},children:A})})})})});Di.displayName=`StaticCellRenderer`;var Oi=(e,t)=>{if(t<=0||t>e.length||!`/*^&<>=:,+-@( `.includes(e[t-1]))return!1;let n=t;for(;n<e.length&&e[n]===` `;)n++;return n>=e.length||`/*^&<>=:,)`.includes(e[n])},ki=e=>e.length>0&&`=+-`.includes(e[0]),Ai=e=>+(e[0]===`=`),ji=e=>e.referenceIndex===void 0?e.type===`error`?`var(--sxl-color-error, light-dark(#a31515, #ce9178))`:void 0:gt[e.referenceIndex%gt.length],Mi=(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++){let i=(e[n].text??``).length;if(t>=r&&t<=r+i)return n;r+=i}return-1},Ni=(e,t,n)=>{let r=n,i=-1,a=-1;for(let n of e){let e=(n.text??``).length;n.referenceIndex===t&&(i<0&&(i=r),a=r+e),r+=e}return i<0?null:{start:i,end:a}},Pi=(e,t)=>{for(let n of e)if(n.referenceIndex===t&&n.type===`tableReference`)return!0;return!1},Fi=async(e,t,n,r)=>{if(!ki(t))return null;try{let i=e.createFormula(t,r,{target:`display`}),a=-1,o=`self`,s=-1,c=Ai(t);for(let e of i.getTokens()){let t=(e.text??``).length;if(e.referenceIndex!==void 0&&e.refSide&&n>=c&&n<=c+t){a=e.referenceIndex,o=e.refSide,s=c+t;break}c+=t}if(a<0)return null;let l=await i.setReferenceModeAt(a,o),u=t.slice(0,Ai(t))+l.getExpression({target:`display`});return{value:u,caret:s+(u.length-t.length)}}catch{return null}},Ii=e=>{let{cell:t,tokens:n,zoom:r,size:i,style:a,...o}=e,s=t.getStyle(),c=s.getFont(),l=t.getInsets(),u=t.getTextPlacement(i,!0),d=s.getAlignment().getVertical(),f=u||d===J.VerticalAlignment.Top?`flex-start`:d===J.VerticalAlignment.Center?`center`:`flex-end`,p=`=`,m=[];for(let e=0;e<n.length;e++){let t=n[e];p+=t.text??``;let r=ji(t);m.push((0,Z.jsx)(`span`,r===void 0?{children:t.text??``}:{style:{color:r},children:t.text??``},e))}let h=s.measureText(p).renderLetterSpacing??0;return(0,Z.jsxs)(`div`,{...o,style:{position:`absolute`,inset:0,display:`flex`,alignItems:f,justifyContent:`flex-start`,overflow:`hidden`,whiteSpace:`pre`,pointerEvents:`none`,paddingLeft:(l.left+1)*r,paddingTop:(u?u.bounds.y:l.top)*r,paddingBottom:u?0:l.bottom*r,...c.toCSS(`adaptive`,r,!0),fontSize:c.getSize()*r*un.getDeviceScale(),...u?{lineHeight:u.lineHeight*r+`px`}:null,...h?{letterSpacing:(c.getLetterSpacing()+h)*r+`px`}:null,...a},children:[`=`,m]})};Ii.displayName=`CellFormulaRenderer`;var Li=(e,t,n)=>{s(e,[`onSelectionChange`]);let r=t?e.getSelection().getCoords().cell:null;return(0,X.useMemo)(()=>{if(!t||!r)return null;try{let t={rowIndex:r.rowIndex,colIndex:r.colIndex},n=e.getRange(t).getCell();if(n.isSpillOverflow())return null;let i=n.getFormulaText({target:`display`});if(i==null)return null;let a=e.getName(),o=e.getCalculation().createFormula(i,{...t,scope:a},{target:`display`}),s=o.getTokens();if(s.length===0)return null;let c=[];try{let e=o.getReferences();c=e?e.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[]}catch{}return{coords:t,cell:n,tokens:s,ranges:c}}catch{return null}},[e,t,r,n])},Ri=`M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673`,zi=`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`,Bi=e=>{let{bounds:t,zoom:n,disabled:r,path:i,onPress:a,style:o,...s}=e,[c,l]=(0,X.useState)(!1),u=xt(!0),d=Math.min(Math.min(18,t.height-8),t.width);return(0,Z.jsx)(`div`,{style:{width:`${d}px`,height:`${d}px`,right:`1px`,boxShadow:`0px 0px 0px 0.5px `+(c&&!r?`color-mix(in srgb, var(--sxl-color-primary) 80%, white)`:`var(--sxl-color-base-300, grey)`),backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,borderRadius:+(d>12)+`px`,marginRight:`2px`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:r?void 0:`pointer`,...o},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onPointerDown:e=>{u(e),a?.(e),e.stopPropagation(),e.preventDefault()},...s,children:(0,Z.jsx)(`svg`,{width:``+15*n,height:``+15*n,viewBox:`0 0 15 15`,style:{fill:c&&!r?`color-mix(in srgb, var(--sxl-color-primary) 70%, black)`:`var(--sxl-color-base-content, grey)`,opacity:r?.6:1},children:(0,Z.jsx)(`path`,{d:i})})})},Vi=e=>{let{column:t,onColumnButtonMouseDown:n,...r}=e;s(t.getTable(),[`onAnyChange`]);let i=Ri,a=t?t.getFilter():null,o=t?t.getSort():null,c=o?o.getCriteria():null,l=a&&a.getCondition(),u=c?c.reverse??!1:null;return i=!0===u?l?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z`:`m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:!1===u?l?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z`:`m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:l?zi:Ri,(0,Z.jsx)(Bi,{path:i,onPress:e=>n?.(e,t),...r})},Hi=`_header_vt581_7`,Ui=`_hover_vt581_18`,Wi=`_filtered_vt581_25`,Gi=`_selected_vt581_33`,Ki=`_selectedAll_vt581_42`,qi=(e,t,n)=>e===n||t.contains(e),Ji=()=>!1,Yi=(0,X.memo)(e=>{let{index:t,value:n,zoomScale:r=100,headerText:i=e=>`${e}`,verticalPadding:a=0,horizontalPadding:o=0,isSelected:s=Ji,isSelectedAll:c=Ji,isFiltered:l=Ji,cell:u,bounds:d,range:f,axis:p,zoom:m=1,onColumnButtonMouseDown:h,propsColumnButton:g,renderColumnButton:v=Vi,className:y,style:b={},...x}=e,S=zt(),C=n?.getColumn(),w=C&&!C.isHiddenButton(),T=(0,X.useRef)(null),[E,D]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=null,t=S.addReactEventListener(`pointermove`,t=>{let{clientX:n,clientY:r,target:i}=t;e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{if(!T.current)return;let e=T.current.getBoundingClientRect(),t=qi(i,T.current,S.getElement())&&n>=e.left&&n<=e.right&&r>=e.top&&r<=e.bottom;D(t)})}),n=S.addReactEventListener(`pointerleave`,()=>{e&&cancelAnimationFrame(e),D(!1)});return()=>{e&&cancelAnimationFrame(e),t?.(),n?.()}},[S]),(0,X.useEffect)(()=>{if(!E)return;let e=e=>{let t=T.current;if(!t)return;let n=t.getBoundingClientRect();(!qi(e.target,t,S.getElement())||e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&D(!1)};return document.addEventListener(`pointermove`,e,!0),()=>document.removeEventListener(`pointermove`,e,!0)},[E,S]);let O=r/100,k=s?.(t)||!1,A=c?.(t)||!1,j=p===_.Column,M=!j&&l(t),N=i(t),P=j?`center`:`end`,F=0,I=null;if(w){F=4,P=`start`;let e={x:d.x-1,y:-1,width:d.width+1-F,height:d.height+1};I=(0,Z.jsx)(`div`,{style:{...e,position:`absolute`,zIndex:2,display:`flex`,alignItems:`end`,justifyContent:`end`,flexDirection:`row`},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,Z.jsx)(xe,{render:v,props:{bounds:e,className:`column-button`,disabled:!1,zoom:m,column:C,onColumnButtonMouseDown:h,...g,style:{pointerEvents:`auto`,...g?.style,backgroundColor:`var(--sxl-color-base-100, white)`,marginBottom:`4px`,backgroundImage:void 0}}})},`columnButton`)}return(0,Z.jsxs)(`div`,{ref:T,className:Q(y,Hi,{[Ui]:E,[Wi]:M,[Gi]:k&&!A,[Ki]:A}),style:{fontSize:`calc(var(--sxl-doc-font-size, 11pt) * ${O})`,lineHeight:`calc(var(--sxl-doc-line-height, 1.2em) * ${O})`,justifyContent:P,paddingLeft:F,paddingBottom:0,paddingRight:j?void 0:`4px`,...b,left:b.left,top:b.top,width:b.width,height:b.height},...x,children:[j?N:(0,Z.jsx)(`span`,{style:{position:`relative`,top:`${O}px`},children:N}),I]})});Yi.displayName=`SheetHeaderRenderer`;var Xi=(e,t)=>Math.max(1,Math.floor(e-t)),Zi=(0,X.memo)(e=>{let{collapsed:t,size:n}=e,r=n/2,i=Math.max(2,Math.round(n/5));return(0,Z.jsx)(`svg`,{width:n,height:n,viewBox:`0 0 ${n} ${n}`,style:{display:`block`},children:(0,Z.jsx)(`path`,{d:`M${i},${r}H${n-i}`+(t?`M${r},${i}V${n-i}`:``),stroke:`currentColor`,strokeWidth:1,shapeRendering:`crispEdges`})})});Zi.displayName=`OutlineGlyph`;var Qi={width:`100%`,height:`100%`,boxSizing:`border-box`,border:`1px solid var(--sxl-color-base-border)`,color:`var(--sxl-color-base-content)`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`2px`,cursor:`pointer`,userSelect:`none`},$i={opacity:.5,cursor:`default`},ea={border:`1px solid var(--sxl-color-base-100)`,background:`var(--sxl-color-base-hover)`},ta=e=>({fontSize:Math.max(8,e-4),lineHeight:e-2+`px`,textAlign:`center`,fontVariantNumeric:`tabular-nums`}),na=(0,X.memo)(e=>{let{collapsed:t,size:n,title:r,onToggle:i,disabled:a}=e;return(0,Z.jsx)(`div`,{className:`outline-button`,title:r,"aria-disabled":a||void 0,style:a?{...Qi,...$i}:Qi,onClick:a?void 0:i,children:(0,Z.jsx)(Zi,{collapsed:t,size:n-2})})});na.displayName=`OutlineButton`;var ra=(0,X.memo)(e=>{let{level:t,shown:n,size:r,title:i,onShowLevel:a,disabled:o}=e;return(0,Z.jsx)(`div`,{className:`outline-level-button`,title:i,"aria-label":i,"aria-disabled":o||void 0,"data-shown":n||void 0,style:{...Qi,...ea,...ta(r),...o?$i:null},onClick:o?void 0:a,children:t})});ra.displayName=`OutlineLevelButton`;var ia=e=>(0,Z.jsx)(na,{...e}),aa=e=>(0,Z.jsx)(ra,{...e}),oa=e=>e.getCurrentPage()!==null||e.getItems().some(e=>!e.isVisible()),sa=e=>{let{fields:t,onPivotButtonMouseDown:n,...r}=e;return(0,Z.jsx)(Bi,{path:t.some(oa)?zi:Ri,onPress:e=>n?.(e,t),...r})},ca=e=>{let{expanded:t,size:n,disabled:r,title:i,onToggle:a,style:o}=e,s=xt(!0);return(0,Z.jsx)(`div`,{className:`pivot-toggle`,title:i,"aria-disabled":r||void 0,style:{width:n,height:n,boxSizing:`border-box`,border:`1px solid var(--sxl-color-base-border, grey)`,backgroundColor:`var(--sxl-color-base-100, white)`,color:`var(--sxl-color-base-content)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:r?`default`:`pointer`,opacity:r?.5:1,userSelect:`none`,pointerEvents:`auto`,...o},onPointerDown:e=>{s(e),e.stopPropagation(),e.preventDefault(),r||a()},children:(0,Z.jsx)(Zi,{collapsed:!t,size:n-2})})},la=(0,X.memo)(e=>{let{anchorLocation:t=g.TopLeft,cellWidth:n=0,cellHeight:r=0,size:i=7,inset:a=1,shape:o=`triangle`,fill:s,propsPath:c,style:l,...u}=e,d=i,f=a,p=`red`,m=[],h=[];return t===g.TopLeft?(p=`light-dark(green, rgb(255, 198, 246))`,m.push(f),h.push(f),m.push(f+d),h.push(f),m.push(f),h.push(f+d)):t===g.TopRight?(p=`light-dark(red, rgb(0, 255, 255))`,m.push(n-f),h.push(f),m.push(n-(f+d)),h.push(f),m.push(n-f),h.push(f+d)):t===g.BottomRight?(p=`light-dark(purple, rgb(236, 252, 211))`,m.push(n-f),h.push(r-f),m.push(n-(f+d)),h.push(r-f),m.push(n-f),h.push(r-(f+d))):t===g.BottomLeft&&(p=`light-dark(blue, rgb(255, 236, 183))`,m.push(f),h.push(r-f),m.push(f+d),h.push(r-f),m.push(f),h.push(r-(f+d))),(0,Z.jsx)(`svg`,{width:`${n}`,height:`${r}`,viewBox:`0 0 ${n} ${r}`,style:{position:`absolute`,width:`${n}px`,height:`${r}px`,pointerEvents:`none`,...l},...u,children:(0,Z.jsx)(`path`,{d:o===`bubble`&&t===g.TopRight?ua(n-f-d,f,d):`M ${m[0]} ${h[0]} L ${m[1]} ${h[1]} L ${m[2]} ${h[2]} L ${m[0]} ${h[0]} Z`,fill:s??p,...c})})}),ua=(e,t,n)=>`M ${e} ${t} H ${e+n} V ${t+n} L ${e+.45*n} ${t+.5*n} H ${e} Z`,da=(()=>{let e=null,t=new Set;return{getMode:()=>e,setMode:n=>{let r=typeof n==`function`?n(e):n;r!==e&&(e=r,t.forEach(e=>e()))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}})(),fa=()=>da.getMode(),pa=e=>da.setMode(e),ma=(0,X.createContext)(null),ha=()=>(0,X.useContext)(ma)??da,ga=()=>{let e=ha();return(0,X.useSyncExternalStore)(e.subscribe,e.getMode,e.getMode),e},_a=null,va=new Set,ya=e=>(va.add(e),()=>{va.delete(e)}),ba=e=>{_a!==e&&(_a=e,va.forEach(e=>e()))},xa=()=>_a,Sa=e=>(0,X.useSyncExternalStore)(ya,()=>_a?.sheet===e?_a:null,()=>null),Ca=e=>!e||e===`none`||e===`transparent`,wa=(e,t,n,r)=>{let i=e.getStyle().getFill()?.toCSS(n)?.background;return Ca(i)&&(i=t.getStyles().getNormal().getFill().toCSS(n)?.background),Ca(i)&&(i=r??`#ffffff`),i},Ta=(e,t,n)=>{if(typeof t!=`string`||t.charAt(0)!==`=`||t.length<2)return t;try{let r=e.getCalculation().createFormula(t,n,{target:`display`});r.isValid()||(r=r.autoCorrect()??r);let i=r.getExpression();return i?`=`+i:t}catch{return t}},Ea=(e,t,n)=>{if(!e||!t)return n;try{return e.getWorksheet(t)??n}catch{return n}},Da=(e,t=e.getWorkbook())=>n=>{if(t?.getProtection().isReadOnly())throw Error(`Cannot start an edit session on a write-protected (read-only) workbook.`);let r=Ea(t,n.scope,e),i={rowIndex:n.rowIndex,colIndex:n.colIndex},a=r.getRange(i),o=a.getCell();if(!o.isEditAllowed())return null;let s=o.getSpillKind()===`fixed`?o.getSpill()?.getCoords()??null:null,c=!!s&&s.colStart===i.colIndex&&s.rowStart===i.rowIndex;if(s&&!c&&!((e,t)=>{let n=e.getSelection().getRanges();if(n.getCount()!==1)return!1;let r=n.at(0).getCoords();return r.colStart===t.colStart&&r.rowStart===t.rowStart&&r.colEnd===t.colEnd&&r.rowEnd===t.rowEnd})(r,s))return null;let l={...i,scope:r.getName()};return{coords:l,clean:()=>{if(s)return r.getRange(s).getCell();let e=r.getRange(i).getCell();return e.isSpillOverflow()?e.createCell({value:null}):e},commit:(e,t)=>{let n=Ta(r,e,i),o=e.replace(/\s+/g,` `),c=o.length>20?`${o.slice(0,20)}…`:o,l=typeof n==`string`&&n.charAt(0)===`=`;if(s&&(!t?.arrayFixed||!l)){let e=r.getRange(s),t=A(`op.typeInto`,{text:c,range:e.toString()});l?e.setFormula(n,{arrayFixed:!0,description:t,autoFit:!0,autoFormat:!0,autoSelectRestore:!0}):e.setValue(n,{description:t,autoFit:!0,autoFormat:!0,autoSelectRestore:!0});return}if(t?.arrayFixed&&l){let e=r.getSelection().getRanges();if(e.getCount()!==1)throw new O(A(`error.sheet.arrayFixedMultipleRanges`));let t=e.at(0);t.setFormula(n,{arrayFixed:!0,description:A(`op.typeInto`,{text:c,range:t.toString()}),autoFit:!0,autoFormat:!0,autoSelectRestore:!0});return}let u=t?.broadcast?r.getSelection().getRanges():a;u.setValue(n,{description:A(`op.typeInto`,{text:c,range:u.toString()}),autoFit:!0,autoFormat:!0,autoSelectRestore:!0})},validate:e=>((e,t,n)=>{let r={rowIndex:t.rowIndex,colIndex:t.colIndex},i=e.getRange(C.cellToRange(r)).getDataValidations().filter(e=>!!e.getCondition()&&e.isShowAlertMessage());if(i.length===0)return!0;let a=Ta(e,n,r);return(async()=>{for(let o=0;o<i.length;o++){let s=i[o];if(await s.validateInputAt(a,r.rowIndex,r.colIndex))continue;let c=s.getAlertStyle(),l=xa();return c===Fn.AlertStyle.Warning&&l?.dataValidation===s&&l.dirty===n&&l.sheet===e&&C.isEqualCells(l.coords,t)?(ba(null),!0):(ba({sheet:e,coords:t,dirty:n,dataValidation:s,style:c}),c===Fn.AlertStyle.Information)}return ba(null),!0})()})(r,l,e)}},Oa=(e,t)=>{let n=e.getWorkbook(),r=t?.referenceMode??{getMode:fa,setMode:pa},i,{anchor:a,notifySessionChange:o}=((e,t,n)=>{let r=()=>{let r=n();return r?Ea(t,r.getCoords().scope,e):t?.getSelectedWorksheet()??e},i=null,a=null,o=null,s=()=>{let e=r();e!==i&&(a?.(),i=e,a=e.getSelection().addListeners({onChange:()=>o?.()}),o?.())};return{anchor:{getCoords:()=>{let e=r();return{...e.getSelection().getCoords().cell,scope:e.getName()}},subscribe:e=>{o=e,s();let n=t?.addListeners({onSelectedSheetChange:()=>s()})??null;return()=>{a?.(),n?.(),o=null}}},notifySessionChange:s}})(e,n,()=>i?.getSession()??null);return i=new jt(a,Da(e,n),{revertAnchor:t=>{Ea(n,t.scope,e).getSelection().clearAndModify({rowIndex:t.rowIndex,colIndex:t.colIndex})}}),i.subscribe(()=>o()),(e=>{let t=null,n=null,r=t=>{var n;le(t?{key:`edit`,description:(n=t.getState().mode,A(n===`edit`?`editMode.edit`:`editMode.enter`)),args:{editable:e},cancel:()=>{e.getSession()===t&&e.cancel()},done:()=>{e.getSession()===t&&e.commit()},onModeChange:n=>{n?.args?.editable!==e&&queueMicrotask(()=>{e.getSession()===t&&e.cancel()})}}:t=>t?.args?.editable===e?null:t)};e.subscribe(()=>{let i=e.getSession();t?.(),t=null,i&&(n=i.getState().mode,t=i.subscribe(()=>{let e=i.getState().mode;e!==n&&(n=e,r(i))})),r(i)})})(i),(e=>{let t=e.getSession(),n=null,r=e=>{let t=xa();t&&!e(t)&&ba(null)};e.subscribe(()=>{let i=e.getSession();if(i===t)return;let a=t;t=i,n?.(),n=null,i?(r(()=>!1),n=i.subscribe(()=>r(e=>e.dirty===i.getState().dirty))):a&&r(e=>e.style===Fn.AlertStyle.Information)})})(i),((e,t,n,r)=>{e.subscribe(()=>{let i=e.getSession(),a=r.getMode();if(i){if(!a){let a=Ea(n,i.getCoords().scope,t).getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});r.setMode({mode:`show`,selection:a,activeInput:null,allowMulti:!0,onDone:({reason:t})=>{t===`cancel`?e.cancel():e.commit()}})}}else if(a&&(r.setMode(null),a.mode===`point`&&n)){let e=a.selection.getWorksheet();e&&!e.isDeleted()&&n.getSelectedWorksheet()!==e&&e.getSelection().getRanges().select({scrollIntoView:!0,autoFocus:!0})}})})(i,e,n,r),((e,t,n)=>{t&&t.addListeners({onSelectedSheetChange:()=>{let r=e.getSession();if(!r)return;let i=t.getSelectedWorksheet();i&&i.getName()!==r.getCoords().scope&&n.getMode()?.mode!==`point`&&e.commit()}})})(i,n,r),i},ka={position:`fixed`,transform:`translate(-50%, -100%)`,pointerEvents:`none`,zIndex:12e3,maxWidth:`24rem`,padding:`2px 8px`,borderRadius:`4px`,border:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`,background:`var(--sxl-color-base-100, rgb(255,255,255))`,color:`var(--sxl-color-base-content, rgb(37,36,35))`,fontFamily:`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,fontSize:`0.85em`,lineHeight:1.4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,boxShadow:`0 2px 8px rgba(0,0,0,0.18)`},Aa=(e,t)=>{let n=(0,X.useRef)(!1),r=(0,X.useRef)(e);r.current=e;let i=(0,X.useRef)(t);i.current=t;let a=(0,X.useRef)(null),o=(0,X.useRef)(null);(0,X.useEffect)(()=>()=>{o.current?.()},[]);let s=Ie(),c=(0,X.useCallback)(e=>{if(e?.button!==void 0&&e.button!==0||(a.current=e?.clientX!==void 0&&e?.clientY!==void 0?{x:e.clientX,y:e.clientY}:null,n.current))return;n.current=!0,s.onPointerDown(e);let t=()=>{n.current=!1,o.current=null,window.removeEventListener(`pointerup`,t,!0),window.removeEventListener(`pointercancel`,t,!0),i.current?.()};o.current=t,window.addEventListener(`pointerup`,t,!0),window.addEventListener(`pointercancel`,t,!0),r.current?.()},[s]),l=(0,X.useCallback)(e=>{if(n.current)return!0;let t=a.current;return!!t&&(Math.abs(e.clientX-t.x)<=3&&Math.abs(e.clientY-t.y)<=3||(a.current=null,!1))},[]);return(0,X.useMemo)(()=>({isDragging:()=>n.current,blocksHover:l,begin:c,onDragStart:s.onDragStart}),[l,c,s])},ja=e=>!!e&&e.selectionStart!==null&&e.selectionEnd!==null&&e.selectionStart!==e.selectionEnd,Ma=(e,t)=>{let n=e[t]?.evalIndex;if(n===void 0)return null;let r=t,i=t;for(;r>0;){let t=e[r-1].evalIndex;if(t===void 0||t<n)break;r--}for(;i<e.length-1;){let t=e[i+1].evalIndex;if(t===void 0||t<n)break;i++}return{lo:r,hi:i,evalIndex:n}},Na=(e,t,n,r,i,a)=>{if(!e||e.length===0||r>=i)return null;let o=t,s=-1,c=-1,l=t,u=t;for(let t=0;t<e.length;t++){let n=(e[t].text??``).length,a=o;o+=n,n!==0&&e[t].type!==`whitespace`&&a<i&&o>r&&(s<0&&(s=t,l=a),c=t,u=o)}if(s<0)return null;let d=null,f=null;for(let t=s;t<=c;t++){let n=Ma(e,t);n&&((!f||n.evalIndex<f.evalIndex)&&(f=n),n.lo<=s&&n.hi>=c&&(!d||n.hi-n.lo<d.hi-d.lo)&&(d=n))}if(d&&d.lo===s&&d.hi===c)return{lo:s,hi:c,start:l,end:u,fragment:null,evalIndex:d.evalIndex};if(a&&l>=r&&u<=i){let e=n.slice(l,u);if(a(e))return{lo:s,hi:c,start:l,end:u,fragment:e,evalIndex:0}}let p=d??f;if(!p)return null;let m=Fa(e,t,p.lo,p.hi);return{lo:p.lo,hi:p.hi,start:m.start,end:m.end,fragment:null,evalIndex:p.evalIndex}},Pa=e=>{if(!e)return null;let t=e.length-1;for(;t>=0&&e[t].evalIndex===void 0;)t--;return t<0?null:{lo:0,hi:t,evalIndex:0}},Fa=(e,t,n,r)=>{let i=t,a=t;for(let t=0;t<e.length&&(t===n&&(a=i),i+=(e[t].text??``).length,t!==r);t++);return{start:a,end:i}},Ia=e=>e===`,`?{decimal:`,`,column:`;`,row:`|`}:{decimal:`.`,column:`,`,row:`;`},La=(e,t,n)=>{if(e==null)return`0`;if(Cn.isError(e))return String(e);let r=typeof e;if(r===`number`){if(!Number.isFinite(e))return null;let n=String(e);return t.decimal===`.`?n:n.replace(`.`,t.decimal)}return r===`boolean`?e?n.t:n.f:r===`string`?`"${e.replace(/"/g,`""`)}"`:null},Ra=(e,t,n={t:`TRUE`,f:`FALSE`})=>{if(Cn.isError(e,Cn.Code.Parse))return null;let r=e;if(e!=null&&typeof r?.getRowCount==`function`){let e=r.getRowCount(),i=r.getColumnCount(),a=e*i;if(a===0||a>1024)return null;if(a===1)return La(r.getValueAt(0,0),t,n);let o=[];for(let a=0;a<e;a++){let e=[];for(let o=0;o<i;o++){let i=La(r.getValueAt(a,o),t,n);if(i===null)return null;e.push(i)}o.push(e.join(t.column))}return`{${o.join(t.row)}}`}return La(e,t,n)},za=e=>e==null?``:(Cn.isError(e),String(e)),Ba=e=>{if(e==null)return`0`;if(Cn.isError(e,Cn.Code.Parse))return null;if(Cn.isError(e))return String(e);let t=typeof e;if(t===`number`||t===`boolean`||t===`string`)return String(e);let n=e;if(typeof n?.getRowCount==`function`){let e=n.getRowCount(),t=n.getColumnCount(),r=e*t;if(r<=1)return za(n.getValueAt?.(0,0));if(r>12)return`{${e}×${t}}`;let i=[];for(let r=0;r<e;r++){let e=[];for(let i=0;i<t;i++)e.push(za(n.getValueAt(r,i)));i.push(e.join(`, `))}return`{${i.join(`; `)}}`}return String(e)},Va=!1,Ha=()=>Va,Ua=(e,t,n)=>{if(e.nativeEvent.isComposing||t?.mode!==`point`)return!1;let r=t.selection;if(!r)return!1;let i=e.which===he.Left?w.Left:e.which===he.Right?w.Right:e.which===he.Up?w.Up:e.which===he.Down?w.Down:null,a=e.ctrlKey||e.metaKey,o=e.which===he.Space?a&&e.shiftKey?b.Both:a?b.Column:e.shiftKey?b.Row:null:null;if(i===null&&o===null)return!1;e.preventDefault(),e.stopPropagation();let s=r.getWorksheet().getName(),c=r.getCoords(),l=c.ranges??[],u=c.rangeIndex??-1;Va=!0;try{if(u<0){let e={rowStart:c.cell.rowIndex,colStart:c.cell.colIndex,rowEnd:c.cell.rowIndex,colEnd:c.cell.colIndex,scope:n};r.updateCoords({cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:n},ranges:[...l,e],rangeIndex:l.length})}else{let e=l[u];e&&(e.scope??s)!==n&&r.updateCoords({...c,ranges:l.map((e,t)=>t===u?{...e,scope:n}:e)})}}finally{Va=!1}return o===null?r.navigate(i,e.shiftKey,a):r.selectRegion({axis:o,contentOnly:!1}),!0},Wa=e=>{let t=(0,X.useRef)(e);t.current=e;let[n,r]=(0,X.useState)(e.initialText??``),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),c=(0,X.useRef)(n),l=(0,X.useRef)(n),u=(0,X.useRef)(n),d=(0,X.useRef)(!1),f=(0,X.useRef)(null),p=(0,X.useRef)(null),m=(0,X.useRef)(!1),h=(0,X.useRef)(!1),g=(0,X.useRef)(!0),_=(0,X.useRef)(null),v=e=>{c.current=e,r(e),m.current=!0;let n=e!==l.current;d.current=n,s(n),g.current&&t.current.onChangeText?.(e)},y=e=>{f.current=e,a(e)},b=G(e=>{let{parse:n,changeOn:r=`live`,onChange:i}=t.current,{value:a,error:o}=n(e);o?y(o):(y(null),a!==void 0&&(p.current=a,r!==`done`&&i?.(a)))},[]),x=e=>{l.current=e;let t=m.current;g.current=!1;try{v(e)}finally{g.current=!0}m.current=t,y(null)},S=G(e=>{let{onDone:n}=t.current,r=e.reason!==`cancel`;r&&f.current||(r||(_.current=null),n&&(n(p.current,e),r&&(l.current=c.current,d.current=!1,s(!1))),r&&(()=>{let e=_.current;_.current=null,e&&e.echoOf===c.current&&x(e.text)})())},[]),C=e=>{_.current=null,v(e),y(null),b(e)},w=G(()=>{C(l.current)},[]),T=G(()=>{C(u.current)},[]),E=G((e,n)=>{if(m.current&&t.current.session.isActive()){l.current=e,_.current={text:e,echoOf:c.current};let t=c.current!==e;return d.current=t,s(t),!1}return _.current=null,n!==void 0&&(p.current=n),x(e),!0},[]),D=G(()=>{u.current=c.current,m.current=!1,_.current=null},[]),O=G(()=>{h.current=!1},[]),k=G(()=>{let e=h.current;return h.current=!1,e},[]);return{text:n,error:i,dirty:o,textRef:c,committedTextRef:l,baselineTextRef:u,dirtyRef:d,errorRef:f,touchedRef:m,lastValidRef:p,setText:v,setError:y,liveChange:b,notifyDone:S,revertToCommitted:w,revertToBaseline:T,resetCommitted:E,beginSession:D,handleDoneKeys:G(e=>{let{changeOn:n=`live`,session:r}=t.current;return e.key===`Escape`?(r.isActive()&&m.current?(e.preventDefault(),e.stopPropagation(),r.end({reason:`cancel`,key:`Escape`})):!r.isActive()&&d.current&&(e.preventDefault(),e.stopPropagation(),w()),!0):e.key!==`Enter`||e.altKey||e.ctrlKey||e.metaKey?!(e.key!==`Tab`||e.altKey||e.ctrlKey||e.metaKey)&&(h.current=!0,f.current?r.isActive()?r.end({reason:`cancel`,key:`Tab`,shiftKey:e.shiftKey}):w():r.isActive()?r.end({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}):d.current&&S({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}),!0):f.current?(e.preventDefault(),e.stopPropagation(),!0):n===`done`?(e.preventDefault(),e.stopPropagation(),r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0):(h.current=!0,r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):d.current&&S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0)},[]),handleTextKeys:G(e=>!!fe.isCaretKey(e)&&(e.stopPropagation(),!0),[]),resetBlurGuard:O,consumeBlurGuard:k,commit:G(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`accept`}):S({reason:`accept`})},[]),cancel:G(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`cancel`}):(w(),S({reason:`cancel`}))},[])}},Ga=(e,t,n)=>{let r=e.getWorksheet(),i=r.getRange(t).toString();return n&&n!==r.getName()?Nn.sheetAndRangeToString(Nn.sheetNameToString(n),i):i},Ka=(e,t)=>{try{let n={rowStart:t.rowStart,rowEnd:t.rowEnd,colStart:t.colStart,colEnd:t.colEnd,scope:t.scope},r=e.getWorksheet(),i={...e.getCoords(),scope:r.getName()};return r.getNames().getByRanges([n],{includeParts:!0,home:i})[0]??null}catch{return null}},qa=(e,t)=>{let n=t.scope&&t.scope!==e.getName()?e.getWorkbook()?.getWorksheet(t.scope):e;if(!n)return null;let r=n.getCell({rowIndex:t.rowStart,colIndex:t.colStart}),i=r.getSpillKind();if(!i||i===`error`)return null;let a=r.getSpill()?.getCoords();return a&&a.rowStart===t.rowStart&&a.colStart===t.colStart?{coords:a,kind:i}:null},Ja=(e,t)=>{if(t.rowStart===t.rowEnd&&t.colStart===t.colEnd)return!1;try{let n=qa(e,t);return n?.kind===`dynamic`&&n.coords.rowEnd===t.rowEnd&&n.coords.colEnd===t.colEnd}catch{return!1}},Ya=(e,t,n)=>{try{return Ja(e.getWorksheet(),t)?Ga(e,{rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowStart,colEnd:t.colStart,$rowStart:n?.$rowStart,$colStart:n?.$colStart},t.scope)+`#`:null}catch{return null}},Xa=(e,t,n)=>{let r=null;for(let i of t){let t=i.referenceIndex;if(t===void 0||i.value!==`#`)continue;let a=n[t];if(a)try{let i=qa(e,a);if(!i)continue;r??=n.slice(),r[t]={...a,rowEnd:i.coords.rowEnd,colEnd:i.coords.colEnd}}catch{}}return r??n},Za=e=>e?e.getSelectedWorksheet()??e.getWorksheets().getItems({visibility:kn.Visibility.VeryHidden})[0]??null:null,Qa=e=>e.length>An.MAX_EXPRESSION_LENGTH,$a=e=>{let t=[],n=0,r=!1;for(let i=0;i<e.length;i++){let a=e[i];a===`'`?r=!r:a!==`,`||r||(t.push({text:e.slice(n,i),start:n,end:i}),n=i+1)}return t.push({text:e.slice(n),start:n,end:e.length}),t},eo=(e,t,n)=>{let r=t.trim();if(!r)return null;let i=e=>{if(!e||e.getCount()!==1)return null;let t=e.at(0),n=t.getCoords();return{rowStart:n.rowStart,colStart:n.colStart,rowEnd:n.rowEnd,colEnd:n.colEnd,scope:t.getWorksheet().getName()}};try{let t=n?.scope&&!r.includes(`!`)?e.getWorksheet(n.scope):null;return i(t?t.getRanges(r):e.getRanges(r))}catch{}try{let t=Za(e)?.getCalculation().createFormula(`=`+r,n,{target:`display`});return t&&t.isValid()&&t.isReferenceOnly()?i(t.getReferences()):null}catch{return null}},to=(e,t,n,r)=>{let i=t.trim();if(!i)return null;let a=!ki(i);if(a&&!r)return null;try{let r=Za(e);if(!r)return{tokens:[],ranges:[]};let i=r.getCalculation().createFormula(a?`=`+t:t,n,{target:`display`}),o=i.getTokens();if(o.length===0)return{tokens:[],ranges:[]};let s=[];try{let e=i.getReferences(),t=n?.scope??r.getName();s=e?e.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??t}:null):[],s=Xa(r,o,s)}catch{}return{tokens:o,ranges:s}}catch{return{tokens:[],ranges:[]}}},no=(e,t,n)=>{if(!n||!e)return t.toString();try{let r=t.getCoords(),i=t.getWorksheet?.()?.getName()??n;if(!r.every(e=>!e||(e.scope??i)===n))return t.toString();let a=e.getWorksheet(n);return a?a.getRanges(r).toString():t.toString()}catch{return t.toString()}},ro=(e,t)=>{let n=e.trim();if(!n)return e;let r=(ki(n)?n.slice(Ai(n)):n).trim();return r?t?r:`=`+r:e},io=(e,t,n,r,i)=>{if(e==null)return``;let a=r?.scope??null,o=t===`formula`,s=i===`bare`;if(typeof e==`string`)return i===`literal`?e:o?ro(e,s):e;try{if(e.isICellRanges){let t=no(n,e,a);return o?ro(t,s):t}if(!o){let t=e.getReferences();return t?no(n,t,a):``}let t=e.getExpression({target:`display`});return t?ro(t,s):``}catch{return``}},ao=(e,t=`formula`)=>{let{value:n,onChange:r,onChangeText:i,changeOn:a=`live`,allowMulti:o=!1,allowCrossSheet:s=!0,required:c=!1,disabled:l=!1,onDone:u,home:d,equals:f=`optional`,pickAs:p=`relative`,pickSpills:m=!1}=e,h=cr(),g=e.workbook===void 0?h:e.workbook,_=t===`formula`,v=f!==`required`&&f!==`literal`,y=ga(),[b,x]=(0,X.useState)(!1),[w,T]=(0,X.useState)(null),[E,D]=(0,X.useState)(!1),O=(0,X.useRef)(null),k=(0,X.useRef)(null),A=(0,X.useRef)(!1),j=(0,X.useRef)(!1),M=(0,X.useRef)(g??null);M.current=g??null;let N=(0,X.useRef)(d);N.current=d;let[P,F]=(0,X.useState)(0);(0,X.useEffect)(()=>{if(!g)return;let e=!0;return Promise.resolve(g.whenCalculationReady()).then(()=>{e&&F(e=>e+1)}).catch(()=>{}),()=>{e=!1}},[g]);let[I]=(0,X.useState)(()=>io(n,t,g??null,d,f)),L=Wa({initialText:I,parse:e=>ce(e),changeOn:a,onChange:r,onChangeText:i,onDone:u,session:{isActive:()=>j.current,end:e=>_e(e)}}),{text:R,error:ee,dirty:z,textRef:B,committedTextRef:V,baselineTextRef:H,dirtyRef:U,errorRef:W,lastValidRef:te,setText:ne,setError:re,liveChange:ie,notifyDone:ae}=L,oe=()=>N.current?.scope??M.current?.getSelectedWorksheet()?.getName()??null,se=e=>{let t=oe();if(!t)return!0;try{return(e.getReferences()?.getCoords()??[]).every(e=>!e||(e.scope??t)===t)}catch{return!0}},ce=e=>{let t=e.trim();if(!t)return c?{error:S(_?`formulaInput.required`:`referenceInput.required`)}:{value:null,error:null};let n=M.current;if(!n)return{error:null};let r=Za(n);if(!r)return{error:null};let i=r.getCalculation();if(!_){if(t.startsWith(`=`))return{error:S(`referenceInput.invalid`)};try{let e=i.createFormula(`=`+t,N.current,{target:`display`});if(e.isValid()&&e.isReferenceOnly()&&e.getReferences())return s||se(e)?{value:e,error:null}:{error:S(`referenceInput.crossSheet`)}}catch{}return{error:S(`referenceInput.invalid`)}}if(f===`required`&&!ki(t))return{error:S(`formulaInput.equalsRequired`)};if(f===`literal`&&!ki(t))return{error:null};let a=ki(t)?t:`=`+t;try{let e=i.createFormula(a,N.current,{target:`display`});if(!e.isValid()){let t=e.autoCorrect();if(!t)return{error:S(`formulaInput.invalid`)};e=t}return s||se(e)?{value:e,error:null}:{error:S(`referenceInput.crossSheet`)}}catch{return{error:S(`formulaInput.invalid`)}}};(0,X.useEffect)(()=>{if(P===0)return;let e=B.current;if(!e.trim())return;if(U.current)return void ie(e);let{value:t,error:n}=ce(e);re(n),t&&(te.current=t)},[P]);let K=Qa(R),le=K?(e=>{let t=e.slice(0,An.MAX_EXPRESSION_LENGTH),n=t.lastIndexOf(`,`);return`${n>0?t.slice(0,n):t}…`})(R):R,ue=(0,X.useMemo)(()=>_&&!K&&g?to(g,R,N.current,v):null,[_,K,g,R,P,v]),de=_?Ai(R):0,fe=(0,X.useMemo)(()=>ue&&ue.tokens.length!==0&&ue.tokens.map(e=>e.text??``).join(``)===R.slice(de)?ue.tokens:null,[ue,R,de]),pe=G(()=>{let e=k.current;if(!e||!g)return;let t=B.current;if(Qa(t))return;if(_){let n=to(g,t,N.current,v),r=n?.ranges??[],i=O.current?.selectionStart??t.length,a=-1;if(n){let e=Ai(t);for(let t of n.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&i>=e&&i<=e+n){a=t.referenceIndex;break}e+=n}a>=0&&(a>=r.length||!r[a])&&(a=-1)}let o=g.getSelectedWorksheet();if(!o)return;let s={...o.getSelection().getCoords().cell,scope:o.getName()},c=r.some(Boolean)?{cell:s,ranges:r,rangeIndex:a}:{cell:s,ranges:C.EmptyRanges,rangeIndex:-1};A.current=!0;try{e.updateCoords(c)}finally{A.current=!1}return}let n=t.trim()?$a(t):[],r=n.map(e=>eo(g,e.text,N.current)),i=-1;if(o){if(r.length){let e=O.current?.selectionStart??t.length,r=n.findIndex(t=>e>=t.start&&e<=t.end),a=r>=0&&!n[r].text.trim();i=r<0||a?-1:r}}else i=r.length?0:-1;i>=0&&!r[i]&&(i=-1);let a=g.getSelectedWorksheet();if(!a)return;let s={...a.getSelection().getCoords().cell,scope:a.getName()};A.current=!0;try{e.updateCoords({cell:s,ranges:r,rangeIndex:i})}finally{A.current=!1}},[g,o,_]),me=(e,t)=>{let n=M.current,r=e.scope??N.current?.scope??null,i=Za(n);if(m&&i&&r&&Ja(i,{...e,scope:r})){let n=he({...e,rowEnd:e.rowStart,colEnd:e.colStart},t);return n===null?null:n+`#`}return he(e,t)},he=(e,t)=>{let n=M.current;if(!n)return null;let r=t?((e,t,n)=>{let r=t.trim().replace(/^=\s*/,``).trim();if(!r)return null;try{let t=Za(e)?.getCalculation().createFormula(`=`+r,n,{target:`display`});if(!t||!t.isValid()||!t.isReferenceOnly()||Pi(t.getTokens(),0))return null;let i=t.getReferences()?.getCoords(),a=i?.length===1?i[0]:void 0;return a?{$rowStart:!!a.$rowStart,$colStart:!!a.$colStart,$rowEnd:!!a.$rowEnd,$colEnd:!!a.$colEnd}:null}catch{return null}})(n,t,N.current):null,i=p===`absolute`,a=N.current?.scope??null,o=e.scope??a;if(!o)return null;if(o!==a)return((e,t,n,r)=>{if(!t?.scope)return null;try{let i={rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowEnd,colEnd:t.colEnd,scope:t.scope};if(r)return e.getRanges([{...i,...r}]).toString();let a=e.getRanges([i]);return(n?a.getFixed(!0):a).toString()}catch{return null}})(n,{...e,scope:o},i,r);try{let t=n.getWorksheet(o);if(!t)return null;let a={rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd};if(r)return t.getRanges([{...a,...r}]).toString();let s=t.getRange(a);return(i?s.getFixed(!0):s).toString()}catch{return null}};(0,X.useEffect)(()=>{let e=w;if(e&&g)return e.addListeners({onChange:()=>{if(A.current||Ha())return;let t=e.getCoords(),n=t.rangeIndex??-1,r=n>=0?t.ranges?.[n]:null;if(_){let e=n>=0?t.ranges?.[n]:null;if(!e)return;let r=B.current,i=O.current,a=to(g,r,N.current,v),o=a?.ranges.length??0,s=a&&n<o?Ni(a.tokens,n,Ai(r)):null,c=me(e,s?r.slice(s.start,s.end):null);if(c==null)return;let l,u;if(a){if(n<o){if(!s)return;l=r.slice(0,s.start)+c+r.slice(s.end),u=s.start+c.length}else{let e=i?.selectionStart??r.length,t=i?.selectionEnd??r.length,n=(e>0&&!`/*^&<>=:,+-@( `.includes(r[e-1])?`,`:``)+c;l=r.slice(0,e)+n+r.slice(t),u=e+n.length}}else{if(r.trim())return;l=(f===`bare`?``:`=`)+c,u=l.length}ne(l),Ce(!0),ie(l),requestAnimationFrame(()=>{O.current?.setSelectionRange?.(u,u),pe()});return}if(!r)return;let i=B.current,a=i.trim()?$a(i):[],s=n>=0&&n<a.length&&a[n].text.trim()?a[n]:!o&&a.length===1&&a[0].text.trim()?a[0]:null,c=me(r,s?.text??null);if(!c)return;let l,u;if(n>=0&&n<a.length&&a[n].text.trim()){let e=a[n],t=e.text.match(/^\s*/)?.[0]??``;l=i.slice(0,e.start)+t+c+i.slice(e.end),u=e.start+t.length+c.length}else if(o){let e=i.replace(/\s+$/,``);l=(e?e.endsWith(`,`)?`${e} `:`${e}, `:``)+c,u=l.length}else l=c,u=l.length;ne(l),Ce(!0),ie(l),requestAnimationFrame(()=>{O.current?.setSelectionRange?.(u,u),pe()})}})},[w,g,o,_,p,m,f,ie,pe]);let ge=()=>{if(!_)return;let e=B.current.trim();if(!e||!v&&!ki(e))return;let t=e.startsWith(`=`);if(!t&&ki(e))return;let n=Za(M.current)?.getCalculation();if(!n)return;let r;try{let i=n.createFormula(t?e:`=`+e,N.current,{target:`display`});if(i.isValid())return;let a=i.autoCorrect();if(!a)return;let o=a.getExpression({target:`display`});r=t?`=`+o:o}catch{return}ne(r),ie(r)},_e=G(e=>{if(e.reason===`cancel`?L.revertToBaseline():ge(),Te(),ae(e),e.key===`Tab`)return;let t=O.current;t&&typeof document<`u`&&(document.activeElement===t?we():t.focus())},[ae,ie]),ve=(0,X.useRef)(null);ve.current||={insertText:e=>{let t=O.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length,i=t.value.slice(0,n)+e+t.value.slice(r);ne(i),ie(i),requestAnimationFrame(()=>t.setSelectionRange(n+e.length,n+e.length))},selectAll:()=>{O.current?.select()},setSelection:e=>{O.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{O.current?.focus()},toggleReferences:()=>{(async()=>{let e=O.current,t=M.current;if(!e||!t||Qa(B.current))return;let n=e.value,r=e.selectionStart??n.length;try{let i=Za(t)?.getCalculation();if(!i)return;if(_){if(!ki(n))return;let t=await Fi(i,n,r,N.current);if(!t)return;ne(t.value),ie(t.value),j.current&&pe(),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret));return}let a=$a(n).find(e=>r>=e.start&&r<=e.end);if(!a)return;let o=(a.text.match(/^\s*/)?.[0]??``).length,s=a.text.trim();if(!s)return;let c=a.start+o,l=Math.min(Math.max(r-c,0),s.length),u=await Fi(i,`=`+s,l+1);if(!u)return;let d=n.slice(0,c)+u.value.slice(1)+n.slice(c+s.length),f=c+(u.caret-1);ne(d),ie(d),j.current&&pe(),requestAnimationFrame(()=>e.setSelectionRange(f,f))}catch{}})()}};let ye=(0,X.useRef)(!1),be=()=>{ye.current||(ye.current=!0,console.warn(`[sheetxl] ${t} input has no workbook (pass the 'workbook' prop or wrap in a WorkbookProvider) — picking, select-current, and validation are disabled; the field degrades to plain text.`))},xe=()=>{let e=B.current,t=O.current?.selectionStart??e.length;if(!e.trim())return{kind:`insert`,at:t};if(!v&&!ki(e.trimStart()))return null;let n=M.current;if(n){let r=to(n,e,N.current,v);if(r){let n=Ai(e);for(let e=0;e<r.ranges.length;e++){if(!r.ranges[e])continue;let i=Ni(r.tokens,e,n);if(i&&t>=i.start&&t<=i.end)return{kind:`replace`,start:i.start,end:i.end}}}}return Oi(e,t)?{kind:`insert`,at:t}:null},Se=()=>!(f===`literal`&&!B.current.trim())&&xe()!==null,Ce=e=>{if(D(e),!_||!j.current)return;let t=k.current;y.setMode(n=>n&&n.selection===t&&n.mode!==(e?`point`:`show`)?{...n,mode:e?`point`:`show`}:n)},we=G(()=>{if(l||j.current||Qa(B.current))return;if(!g)return void be();let t=g.getSelectedWorksheet();if(!t)return;L.beginSession();let n=t.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});k.current=n,j.current=!0,x(!0),T(n);let r=!_||Se();D(r),y.setMode({mode:r?`point`:`show`,selection:n,activeInput:ve.current,allowMulti:_?e.allowMulti??!0:o,scope:s?void 0:oe()??void 0,onDone:_e}),pe()},[l,g,o,e.allowMulti,s,_]),Te=G(()=>{if(!j.current)return;j.current=!1,x(!1),T(null);let e=k.current;k.current=null,y.setMode(t=>t&&t.selection===e?null:t)},[]),Ee=y.getMode();(0,X.useEffect)(()=>{j.current&&k.current&&Ee?.selection!==k.current&&(j.current=!1,x(!1),T(null),k.current=null)},[Ee]),(0,X.useEffect)(()=>()=>{Te()},[Te]),(0,X.useEffect)(()=>{let e=io(n,t,M.current,N.current,f),r=ce(e),i=n==null||typeof n==`string`||n.isICellRanges?r.value??null:n;L.resetCommitted(e,i)&&(re(r.error??null),j.current&&pe())},[n]);let De=G(e=>{j.current||we(),ne(e.target.value),_?Ce(Se()):a===`done`&&D(!1),ie(e.target.value),j.current&&pe()},[we,ie,pe,a]),Oe=G(e=>{if(L.resetBlurGuard(),!(e.key!==`F2`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void Ce(!E);if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void ve.current?.toggleReferences();if(j.current&&E){let t=y.getMode(),n=g?.getSelectedWorksheet()?.getName();if(t&&n&&Ua(e,t,n))return}if(e.key===`Escape`&&j.current&&!L.touchedRef.current)return e.preventDefault(),e.stopPropagation(),void Te();L.handleDoneKeys(e)||L.handleTextKeys(e)},[E,g]),ke=G(e=>{L.resetBlurGuard(),we()},[we]),Ae=G(e=>{let t=L.consumeBlurGuard(),n=e.relatedTarget;(n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||_&&!E)&&(Te(),t||ge(),!t&&U.current&&ae({reason:`accept`}))},[Te,ae,_,E]),je=G(e=>{j.current&&a===`done`&&!_&&D(!1)},[a,_]),Me=G(e=>{j.current&&(_&&Ce(Se()),pe())},[pe,_]),Ne=G((e,t)=>{j.current||we(),ne(e),ie(e),j.current&&pe(),t!==void 0&&requestAnimationFrame(()=>O.current?.setSelectionRange?.(t,t))},[we,ie,pe]),Pe=G(()=>{j.current?_e({reason:`accept`}):(O.current?.focus(),we())},[we,_e]),Fe=G(()=>{if(!g)return void be();let e=g.getSelectedWorksheet();if(!e)return;let t=e.getSelectedRanges(),n=t?.getCount()??0;if(!n)return;if(_){let e=xe();if(!e)return;let n=O.current,r=B.current,i=t.at(0),a=i.getCoords(),o=me({rowStart:a.rowStart,colStart:a.colStart,rowEnd:a.rowEnd,colEnd:a.colEnd,scope:i.getWorksheet().getName()},e.kind===`replace`?r.slice(e.start,e.end):null);if(!o)return;let s,c;if(e.kind===`replace`)s=r.slice(0,e.start)+o+r.slice(e.end),c=e.start+o.length;else if(r.trim()){let e=n?.selectionStart??r.length,t=n?.selectionEnd??r.length,i=(e>0&&!`/*^&<>=:,+-@( `.includes(r[e-1])?`,`:``)+o;s=r.slice(0,e)+i+r.slice(t),c=e+i.length}else s=(f===`bare`?``:`=`)+o,c=s.length;ne(s),ie(s),j.current&&pe(),requestAnimationFrame(()=>n?.setSelectionRange?.(c,c));return}let r=[];for(let e=0;e<n;e++){let n=t.at(e),i=n.getCoords(),a=me({rowStart:i.rowStart,colStart:i.colStart,rowEnd:i.rowEnd,colEnd:i.colEnd,scope:n.getWorksheet().getName()});a&&r.push(a)}if(!r.length)return;let i=o?r.join(`, `):r[0];ne(i),ie(i),j.current&&pe()},[g,o,_,p,m,f,ie,pe]),Ie=G(()=>{L.revertToCommitted(),j.current&&pe()},[pe]),Le=(0,X.useMemo)(()=>_||K||!R.trim()||!g?[]:$a(R).map(e=>({text:e.text,start:e.start,end:e.end,valid:!!eo(g,e.text,N.current)})),[_,K,R,g,P]),Re=G(async e=>{let t=g,n=Le[e]?.text.trim();if(!t||!n)return null;try{let e=Za(t)?.getCalculation();return e?Ba(await e.createFormula(`=`+n,void 0,{target:`display`}).evaluate()):null}catch{return null}},[g,Le]),ze=G(()=>{try{return te.current?.getReferences()??null}catch{return null}},[]);return{inputProps:{value:le,readOnly:K,onChange:De,onKeyDown:Oe,onFocus:ke,onBlur:Ae,onMouseDown:je,onSelect:Me,ref:e=>{O.current=e}},text:R,overLength:K,segments:Le,tokens:fe,tokenBase:de,error:ee,dirty:z,engaged:b,pointArmed:E,togglePoint:Pe,engage:we,replaceText:Ne,selectCurrent:Fe,canSelectCurrent:!_||xe()!==null,revert:Ie,commit:L.commit,cancel:L.cancel,getRanges:ze,evaluateSegment:Re}},oo={function:`Function`,named:`NamedRange`,lambda:`FormulaCustom`,table:`Table`,parameter:`Named`,column:`Table`,specifier:`Table`,enum:`DataValidation`},so=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,co=e=>{let{item:t,summary:n,wrapSummary:r=!1,rowHeight:i=22}=e;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:i,padding:`0 10px`},children:[(0,Z.jsx)(j,{iconKey:t.iconKey??oo[t.kind??`function`],size:16,style:{color:so,flex:`0 0 auto`}}),(0,Z.jsx)(`span`,{className:`named-item-name`,style:{fontWeight:600,color:`var(--sxl-color-primary, rgb(33,115,70))`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:t.name}),t.detail&&(0,Z.jsx)(`span`,{style:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:t.detail}),t.category&&(0,Z.jsx)(`span`,{style:{marginLeft:`auto`,flex:`0 0 auto`,color:so},children:t.category})]}),n&&(0,Z.jsx)(`div`,{title:r?void 0:n,style:{padding:`0 10px 4px 34px`,fontSize:11,lineHeight:`14px`,color:so,...r?{whiteSpace:`normal`}:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`}},children:n})]})};co.displayName=`NamedItemLabel`;var lo=8,uo=e=>{let{items:t,selectedIndex:n,selectedSummary:r,onSelect:i,onHighlight:a,maxVisibleRows:o=lo}=e,s=(0,X.useRef)(null);return(0,X.useLayoutEffect)(()=>{let e=s.current,t=e?.children[n];e&&t&&f.scrollIntoContainer(e,t)},[n]),t.length===0?null:(0,Z.jsx)(`div`,{ref:s,role:`listbox`,style:{maxHeight:22*o,overflowY:`auto`,position:`relative`,width:`20rem`,padding:`2px 0`,fontFamily:`var(--sxl-font-family)`,fontSize:12,lineHeight:1.5,color:`var(--sxl-color-base-content, rgb(37,36,35))`},children:t.map((e,t)=>{let o=t===n;return(0,Z.jsx)(`div`,{role:`option`,"aria-selected":o,onMouseDown:n=>{n.preventDefault(),i(e,t)},onMouseMove:()=>{o||a?.(t)},style:{cursor:`pointer`,background:o?`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`:`transparent`},children:(0,Z.jsx)(co,{item:e,summary:o?r:null,rowHeight:22})},`${t}:${e.name}`)})})};uo.displayName=`NamedItemsPanel`;var fo=e=>{let t=/(\d+)$/.exec(e);return t?{base:e.slice(0,-t[1].length),n:parseInt(t[1],10)}:{base:e,n:1}},po=(e,t)=>{if(t<0)return null;for(let n=0;n<e.length;n++){let r=e[n],i=r.getRepeatingTypes();if(i||r.isRest()){let e=i??[r];return e[(t-n)%e.length]}if(n===t)return r}return null},mo=`0.6em`,ho=`calc(${mo} + 1px)`,go=()=>{let[e,t]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{let e=requestAnimationFrame(()=>t(!0));return()=>cancelAnimationFrame(e)},[]),(0,Z.jsx)(`span`,{"aria-hidden":!0,style:{display:`inline-block`,width:0,overflow:`visible`,verticalAlign:`baseline`},children:(0,Z.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`baseline`,width:mo,margin:`0 0 -1px 1px`,opacity:e?.6:0,transition:`opacity 0.2s ease-out`},children:(0,Z.jsx)(`svg`,{viewBox:`0 0 10 3`,width:`100%`,style:{display:`block`,overflow:`visible`},children:(0,Z.jsx)(`path`,{d:`M1.5 0.5v2h8v-2`,fill:`none`,stroke:`#a3a3a3`,strokeWidth:1,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})})})})},_o=new Set([`number`,`string`,`boolean`]),vo=`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 45%, transparent)`,yo={backgroundColor:De,borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${vo}`},bo={borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${vo}`},xo=[`#0431fa`,`#319331`,`#7b3814`],So=[`#ffd700`,`#da70d6`,`#179fff`],Co=e=>{let t=e%xo.length;return`light-dark(${xo[t]}, ${So[t]})`},wo={display:`inline-block`,width:0,overflow:`visible`,whiteSpace:`pre`},To=e=>({display:`inline-block`,transform:`scale(1.15)`,transformOrigin:`center 78%`,opacity:.7,fontWeight:700,color:e}),Eo=`var(--sxl-color-error, #d93025)`,Do=`var(--sxl-color-warning, #b26a00)`,Oo={textDecorationLine:`underline`,textDecorationStyle:`wavy`,textDecorationColor:Do,textDecorationSkipInk:`none`},ko={matchOf:new Map,depthOf:new Map,unmatched:new Set},Ao=e=>{if(!e)return ko;let t=new Map,n=new Map,r=new Set,i=[];return e.forEach((e,a)=>{if(e.type===`paren`){if(e.text===`(`)n.set(a,i.length),i.push(a);else if(e.text===`)`){let e=i.pop();e===void 0?r.add(a):(t.set(a,e),t.set(e,a),n.set(a,n.get(e)))}}}),{matchOf:t,depthOf:n,unmatched:r}},jo=(e,t,n,r)=>{let i=r,a=-1,o=-1;for(let t=0;t<e.length;t++){let r=e[t],s=(r.text??``).length;r.type!==`paren`||r.text!==`(`&&r.text!==`)`||(n===i+s?a=t:n===i&&(o=t)),i+=s}let s=a>=0?a:o;if(s<0)return null;let c=t.get(s);return c===void 0?null:s<c?[s,c]:[c,s]},Mo=(e,t)=>e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1],No=(e,t,n)=>{let r=new Set;if(e){let t=1/0;for(let r=e.lo;r<=e.hi;r++){let e=n.depthOf.get(r);e!==void 0&&e<t&&(t=e)}if(t===1/0)return r;for(let i=e.lo;i<=e.hi;i++){if(n.depthOf.get(i)!==t)continue;let a=n.matchOf.get(i);if(!(a===void 0||a<e.lo||a>e.hi)){r.add(i),r.add(a);break}}return r}return t&&(r.add(t[0]),r.add(t[1])),r},Po=`var(--sxl-color-base-content, rgb(37,36,35))`,Fo=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,Io=`var(--sxl-color-primary, rgb(33,115,70))`,Lo=`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,Ro=`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif)`,zo={color:Io,fontWeight:700},Bo=[],Vo=(e,t)=>{let n=e.length?Math.min(t,e.length-1):-1,r=[];return e.forEach((e,i)=>{let a=e.getName(),o=e.getRepeatingTypes();if(o){let e=o.length,{base:s,n:c}=fo(a),l=Math.max(0,t-i),u=c+Math.floor(l/e),d=i===n?l%e:-1,f=(t,n)=>{let r=`${e===1?s:t.getName()}${n}`;return n>c||t.isOptional()?`[${r}]`:r};o.forEach((t,n)=>{r.push({key:`${i}s${n}`,param:t,descKey:e===1?a:`${a}.${t.getName()}`,isRepeat:!1,optional:u>c||t.isOptional(),active:n===d,label:f(t,u),ellipsisBefore:n===0&&u>c})}),r.push({key:`${i}next`,param:o[0],descKey:e===1?a:`${a}.${o[0].getName()}`,isRepeat:!0,optional:!0,active:!1,label:`[${e===1?s:o[0].getName()}${u+1}]`,ellipsisAfter:!0})}else if(e.isRest()){let{base:o,n:s}=fo(a),c=s+Math.max(0,t-i),l=i===n,u=c>s;r.push({key:`${i}a`,param:e,descKey:a,isRepeat:!1,optional:u,active:l,label:u?`[${o}${c}]`:`${o}${c}`,ellipsisBefore:c>s}),r.push({key:`${i}b`,param:e,descKey:a,isRepeat:!0,optional:!0,active:!1,label:`[${o}${c+1}]`,ellipsisAfter:!0})}else{let t=e.isOptional();r.push({key:`${i}`,label:t?`[${a}]`:a,param:e,descKey:a,isRepeat:!1,optional:t,active:i===n})}}),r},Ho=e=>(0,Z.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,onMouseDown:e=>e.preventDefault(),onClick:e.onClick,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,border:`none`,borderRadius:4,background:`transparent`,color:Fo,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:e.children}),Uo=({up:e})=>(0,Z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,Z.jsx)(`path`,{d:e?`M2.5 7.5 L6 4 L9.5 7.5`:`M2.5 4.5 L6 8 L9.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Wo=()=>(0,Z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,Z.jsx)(`path`,{d:`M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})}),Go={number:S(`functionPreview.typeName.number`),string:S(`functionPreview.typeName.string`),boolean:S(`functionPreview.typeName.boolean`),error:S(`functionPreview.typeName.error`),richData:S(`functionPreview.typeName.richData`),null:S(`functionPreview.typeName.null`)},Ko=e=>{let t=e.getScalarType();return t&&t!==`*`?Go[t]:S(`functionPreview.anyValue`)},qo=e=>{let{param:t,repeat:n=!1,optional:r=!1,showType:i=!0,size:a=15,style:o}=e,s=z(),c=Ko(t),l=c===`functionPreview.anyValue`?s(c):s(`functionPreview.type`,{type:s(c)}),u={color:Fo};return(0,Z.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:3,flex:`0 0 auto`,...o},children:[n&&(0,Z.jsx)(j,{iconKey:`Repeat`,title:s(`functionPreview.repeatable`),size:a,style:u}),r&&(0,Z.jsx)(j,{iconKey:`DataArray`,title:s(`functionPreview.optional`),size:a,style:u}),i&&(0,Z.jsx)(j,{iconKey:`DataObject`,title:l,size:a,style:u})]})};qo.displayName=`FunctionArgIcons`;var Jo=({hint:e,wrap:t=!1})=>{let n=Vo(e.params,e.argIndex),r=e.argSeparator??`,`,i=[];for(let e of n)e.ellipsisBefore&&i.push({key:`${e.key}-lead`,text:`…`,active:!1}),i.push({key:e.key,text:e.label,active:e.active}),e.ellipsisAfter&&i.push({key:`${e.key}-trail`,text:`…`,active:!1});return(0,Z.jsxs)(`span`,{style:{whiteSpace:t?`normal`:`nowrap`,fontFamily:Lo,cursor:`default`},children:[(0,Z.jsx)(`span`,{style:{fontWeight:600,color:Io},children:e.nameLocal??e.name}),`(`,i.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(`span`,{style:{color:Fo},children:`${r} `}):null,(0,Z.jsx)(`span`,{style:e.active?zo:{color:Fo},children:e.text})]},e.key)),`)`]})};Jo.displayName=`FunctionSignature`;var Yo=({hint:e,descriptor:t,showParameters:n=!0})=>{let r=z(),{name:i,argIndex:a,params:o,warning:s}=e,c=n?Vo(o,a):Bo,l=!!s&&s.argIndex===a,u=t?.name===i,d=u?t.summary:void 0;return d||c.length!==0?(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,padding:`8px 10px 10px`,fontFamily:Ro},children:[d&&(0,Z.jsx)(`div`,{style:{color:Po},children:d}),c.length>0&&(0,Z.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:c.map(e=>{let n=(e=>u?t.params?.[e.descKey]?.description:void 0)(e);return(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:1,opacity:e.active?1:.6},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,Z.jsx)(`span`,{style:{fontFamily:Lo,fontWeight:e.active?700:600,color:e.active?Io:Po,whiteSpace:`nowrap`},children:e.label}),(0,Z.jsx)(qo,{param:e.param,repeat:e.isRepeat,optional:e.optional,style:{marginLeft:`auto`}})]}),n&&(0,Z.jsx)(`div`,{style:{color:Fo},children:n}),e.active&&l&&(0,Z.jsx)(`div`,{className:`function-preview-warning`,style:{color:Do},children:r(`functionPreview.enumOutOfSet`,{value:s.value,values:s.values})})]},e.key)})})]}):null};Yo.displayName=`FunctionPreviewContent`;var Xo=e=>{let{hint:t,collapsed:n,onToggle:r,onClose:i}=e,a=z(),o=a(n?`functionPreview.expand`:`functionPreview.collapse`);return(0,Z.jsxs)(`div`,{role:`button`,"aria-expanded":!n,onMouseDown:e=>e.preventDefault(),onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 6px 5px 10px`,cursor:`pointer`,borderBottom:n?`none`:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`},children:[(0,Z.jsx)(`div`,{style:{flex:1,minWidth:0,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:(0,Z.jsx)(Jo,{hint:t})}),(0,Z.jsx)(Ho,{label:o,onClick:e=>{e.stopPropagation(),r()},children:(0,Z.jsx)(Uo,{up:!n})}),i&&(0,Z.jsx)(Ho,{label:a(`functionPreview.close`),onClick:e=>{e.stopPropagation(),i()},children:(0,Z.jsx)(Wo,{})})]})};Xo.displayName=`FunctionPreviewHeader`;var Zo=e=>{let{hint:t,descriptor:n,onClose:r}=e,[i,a]=ge(`editor.functionPreview.collapsed`,!1);return(0,Z.jsxs)(`div`,{style:{minWidth:300,maxWidth:460,fontFamily:Ro,fontSize:12,lineHeight:`16px`,color:Po},children:[(0,Z.jsx)(Xo,{hint:t,collapsed:i,onToggle:()=>a(e=>!e),onClose:r}),(0,Z.jsx)(`div`,{style:{display:`grid`,gridTemplateRows:i?`0fr`:`1fr`,transition:`grid-template-rows 160ms ease`},children:(0,Z.jsx)(`div`,{style:{overflow:`hidden`,minHeight:0},children:(0,Z.jsx)(Yo,{hint:t,descriptor:n})})})]})};Zo.displayName=`FunctionPreviewPanel`;var Qo=e=>{let{list:t,preview:n}=e;return t&&t.items.length>0?(0,Z.jsx)(uo,{items:t.items,selectedIndex:t.selectedIndex,selectedSummary:t.selectedSummary,onSelect:t.onSelect,onHighlight:t.onHighlight}):n?(0,Z.jsx)(Zo,{hint:n.hint,descriptor:n.descriptor}):null};Qo.displayName=`NamedHintPanel`;var $o=(e,t)=>({name:e,summary:t.getSummary(),params:t.getParameters(),enums:t.getEnums()}),es=(e,t,n=1)=>{let r=n;for(let n=0;n<e.length;n++){let i=e[n],a=(i.text??``).length;if(a>0&&t>r&&t<=r+a)return{token:i,start:r,index:n};r+=a}return null},ts=e=>{switch(e.type){case`function`:case`named`:case`tableReference`:return!0;case`tableColumn`:case`tableSpecifier`:return!!e.value?.partial;case`parameter`:return!e.value?.declaration;default:return!1}},ns=(e,t,n)=>{let r=((e,t,n)=>{let r=n;for(let n=0;n<e.length&&!(r>t);n++){let i=e[n],a=(i.text??``).length;if(a===0&&r===t&&ts(i))return{token:i,start:r,index:n};r+=a}return null})(e,t,n)??es(e,t,n);if(!r||!ts(r.token))return null;let{token:i,start:a,index:o}=r,s=a+(i.text??``).length;if(i.type===`tableColumn`||i.type===`tableSpecifier`){let t=i.value,n=o-1;for(;n>=0&&(e[n].type!==`paren`||e[n].text!==`[`);)n--;return e[n]?.context?.argIndex===-1?{start:a,end:s,part:t}:{start:a,end:s,part:t,nested:!0}}let c=e[o+1],l=c?.type===`paren`?c.text:void 0;if(l===`(`||i.type===`tableReference`&&l===`[`)return null;let u=i.context?.bound;return u?{start:a,end:s,bound:u}:{start:a,end:s}},rs=(e,t,n)=>n?{name:e,argIndex:t,bound:n}:{name:e,argIndex:t},is=(e,t,n=1)=>{let r=n;for(let n of e){let e=(n.text??``).length;if(e>0&&t>r&&t<=r+e)return n.type===`function`?rs(n.value,0,n.context?.bound):n.type===`paren`&&n.text===`)`||n.context?.type===`table`?null:n.type===`separator`&&n.context?.name?rs(n.context.name,n.context.argIndex+1,n.context.bound):n.context?.name?rs(n.context.name,Math.max(0,n.context.argIndex),n.context.bound):null;r+=e}return null},as=(e,t)=>typeof e==`string`?`"${e.replace(/"/g,`""`)}"`:String(e).replace(`.`,t),os=e=>e.type===`whitespace`||e.type===`empty`,ss=(e,t,n)=>{let r=[],i=[],a=n;for(let e of t)i.push(a),a+=(e.text??``).length;let o=a;for(let n=0;n<t.length;n++){let a=t[n],s=a.context;if(!s?.name||s.type===`table`)continue;let c;if(a.type===`paren`&&a.text===`(`&&s.argIndex===-1)c=0;else{if(a.type!==`separator`)continue;c=s.argIndex+1}let l=n+1;for(;l<t.length&&os(t[l]);)l++;let u=t[l]?.type===`prefix`&&t[l].text===`-`,d=l;u&&l++;let f=t[l];if(!f||f.type!==`number`&&(f.type!==`string`||u)||f.context?.name!==s.name||f.context.argIndex!==c)continue;let p=l+1;for(;p<t.length&&os(t[p]);)p++;let m=t[p];if(m&&m.type!==`separator`&&(m.type!==`paren`||m.text!==`)`))continue;let h;try{h=e.getFunctions().getByName(s.name)}catch{continue}if(!h||h.isLambda())continue;let g=po(h.getDeclaration().getParameters(),c)?.getEnum();if(!g)continue;let _=g.getMembers(),v=_.map(e=>e.getValue()),y;if(f.type===`number`){if(g.getScalarType()!==`number`)continue;let e=(u?-1:1)*f.value;y=v.includes(e)}else{if(g.getScalarType()!==`string`)continue;let e=String(f.value).slice(1,-1).replace(/""/g,`"`).toLowerCase();y=v.some(t=>String(t).toLowerCase()===e)}if(y)continue;let b=u?[d,l]:[l];r.push({name:s.name,argIndex:c,tokens:b,text:b.map(e=>t[e].text??``).join(``),argStart:i[n]+(a.text??``).length,argEnd:m?i[p]:o,values:_.filter(e=>!e.isDeprecated()).map(e=>e.getValue())})}return r},cs=(e,t)=>{let n=e.getFunctions().getByName(t.name);if(n&&!n.isLambda())return{fn:n};let r=t.name.toUpperCase(),i=t.bound?.find(e=>e.name.toUpperCase()===r);return i?i.params?{bound:i}:null:n?{fn:n}:null},ls=e=>{let t=e?.enumOf;return t&&`${t.fn}:${t.id}`},us=(e,t,n)=>{let r=t.getEnum();if(!r)return[];let i=e.getName(),a=r.getId(),o=yn(n??`en`).decimal;return r.getMembers().filter(e=>!e.isDeprecated()).map(e=>{let t=e.getName(),n=e.getValue(),r=as(n,o),s={fn:i,id:a,member:t};return t===String(n)?{name:r,kind:`enum`,enumOf:s}:{name:t,detail:r,insert:r,kind:`enum`,enumOf:s}})},ds=e=>({getName:()=>e.name,isOptional:()=>!0===e.optional,isRest:()=>!1,getRepeatingTypes:()=>null,getScalarType:()=>null,getRangeType:()=>null,getLambda:()=>null,getArrayDepth:()=>0,isAcceptError:()=>!1,isNoLift:()=>!1,isNoFilter:()=>!1,isLazy:()=>!1,isValueOrRange:()=>!1,getDefaultValue:()=>{},getEnum:()=>null}),fs=[[`All`,`all`],[`Data`,`data`],[`Headers`,`headers`],[`Totals`,`totals`]],ps=(e,t,n)=>{try{let{colStart:r,colEnd:i,...a}=t.getCoords(),o={colStart:r,colEnd:i,rowStart:n?.rowStart??a.rowStart,rowEnd:n?.rowEnd??a.rowEnd};return e?Ga(e,o,t.getWorksheet().getName()):t.getWorksheet().getRange(o).toString()}catch{return}},ms=e=>{let t=(0,X.useRef)(e);t.current=e;let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)([]),[c,l]=(0,X.useState)(0),u=(0,X.useRef)(null),[d,f]=(0,X.useState)(null),p=(0,X.useRef)(o);p.current=o;let m=(0,X.useRef)(null),h=(e,t,n)=>{if(m.current!==null){if(m.current===e.text)return null;m.current=null}return ns(t,n,Ai(e.text))},g=G(()=>{let e=t.current,n=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!i||!n)return void r(null);let a=e.getCaret(),o=Ai(e.text);if(h(e,i,a))return void r(null);let s=is(i,a,o),c=s?cs(n,s):null;if(!c||!s)return void r(null);let l=yn(e.getLocale()??`en`).listSeparator,u=s.argIndex;if(`bound`in c){let{name:e,params:t}=c.bound;r(n=>n?.bound&&n.name===e&&n.argIndex===u&&n.params.length===t.length&&n.params.every((e,n)=>e.getName()===t[n].name&&e.isOptional()===(!0===t[n].optional))?n:{name:e,nameLocal:e,argSeparator:l,argIndex:u,params:t.map(ds),bound:!0});return}let d=c.fn,f=d.getName(),p=Yn()?.functions?.[f]??f,m=ss(n,i,o).find(e=>e.name===s.name&&e.argIndex===u&&a>=e.argStart&&a<=e.argEnd),g=yn(e.getLocale()??`en`).decimal,_=m?{argIndex:u,value:m.text,values:m.values.map(e=>as(e,g)).join(`${l} `)}:void 0;r(e=>e&&!e.bound&&e.name===f&&e.argIndex===u&&e.warning?.value===_?.value?e:{name:f,nameLocal:p,argSeparator:l,argIndex:u,params:d.getDeclaration().getParameters(),..._?{warning:_}:null})},[]),_=G(()=>{let e=t.current,n=()=>{u.current=null,p.current.length&&s([])},r=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!r)return void n();let a=e.getArgument?.()??null,o=Ai(e.text);if(a&&e.text.slice(o).trim()===``){let t=us(a.fn,a.param,e.getLocale());t.length===0?n():(u.current={start:o,end:e.text.length},ls(p.current[0])!==ls(t[0])&&(s(t),l(-1)));return}if(!i)return void n();let c=e.getCaret(),d=h(e,i,c),f=d??{start:c,end:c},m;if(d){let t=e.text.slice(f.start,c);m=d.part?((e,t,n,r={})=>{let i=e.toUpperCase(),a=[],o=Yn()?.specifiers,s=(e,t)=>{let n=`#`+(o?.[t]?.trim()||e);return{name:n,matches:n.toUpperCase().startsWith(i)||(`#`+e).toUpperCase().startsWith(i)}};try{let e=n.table.toUpperCase(),o=(e?t?.getItems().find(t=>t.getType()===`table`&&t.getName().toUpperCase()===e):null)?.getValue();if(!o)return a;let c=r.home??null,l=o.getRange().getCoords(),u=o.getDataRange().getCoords(),d=c?.getCoords()??null,f=!!d&&o.getWorksheet()?.getName()===c.getWorksheet().getName()&&d.rowIndex>=l.rowStart&&d.rowIndex<=l.rowEnd&&d.colIndex>=l.colStart&&d.colIndex<=l.colEnd,p=(e,t)=>e?ps(c,e,t):void 0,m=d&&d.rowIndex>=u.rowStart&&d.rowIndex<=u.rowEnd?{rowStart:d.rowIndex,rowEnd:d.rowIndex}:void 0;if(n.partial!==`column`){let e=s(`This Row`,`thisRow`);if(e.matches){let t=m?p(o.getDataRange(),m):void 0;a.push(r.nested?{name:e.name,kind:`specifier`,detail:t}:{name:`@ - `+e.name.slice(1),insert:`@`,kind:`specifier`,detail:t})}}if(n.partial!==`specifier`)for(let e of o.getColumns()){let t=e.getName();t.toUpperCase().startsWith(i)&&a.push({name:t,kind:`column`,detail:p(e.getRange(),u)})}if(n.partial===`column`||f)return a;let h={all:o.getRange(),data:o.getDataRange(),headers:o.isShowHeaders()?o.getHeaderRowRange():null,totals:o.isShowTotals()?o.getTotalRowRange():null};for(let[e,t]of fs){let{name:n,matches:r}=s(e,t);r&&a.push({name:n,kind:`specifier`,detail:p(h[t])})}}catch{}return a})(t,e.getNames?.()??null,d.part,{home:e.getCell?.()??null,nested:d.nested}):((e,t,n,r=[])=>{let i=t.toUpperCase(),a=[],o=[];try{let t=Yn()?.functions,n=e=>t?.[e]??e,r=e.getFunctions().getItems();o=r.filter(e=>e.isLambda()),a=r.filter(e=>!e.isLambda()).map(e=>({name:n(e.getName()),canonical:e.getName()})).filter(e=>e.name.toUpperCase().startsWith(i)||e.canonical.toUpperCase().startsWith(i)).map(e=>({name:e.name,kind:`function`})).sort((e,t)=>e.name.localeCompare(t.name)).slice(0,50)}catch{a=[]}let s=new Set(a.map(e=>e.name.toUpperCase())),c=(e,t)=>{let n=e.toUpperCase();n.startsWith(i)&&!s.has(n)&&(s.add(n),a.push({name:e,kind:t}))};for(let e of r)c(e.name,e.params?`lambda`:`parameter`);for(let e of o)c(e.getName(),`lambda`);try{for(let e of n?.getItems()??[])c(e.getName(),e.getType()===`table`?`table`:`named`)}catch{}return a.sort((e,t)=>e.name.localeCompare(t.name))})(r,t,e.getNames?.()??null,d.bound)}else m=((e,t,n,r,i)=>{let a=is(t,n,r);if(!a||!((e,t,n,r)=>{let i=n;for(let n=0;n<e.length&&i<=t;n++){let a=e[n];if(a.type===`empty`&&a.context?.name===r.name&&a.context.argIndex===r.argIndex){let r=i,a=n+1;for(;a<e.length&&e[a].type===`whitespace`;)r+=(e[a++].text??``).length;if(t>=i&&t<=r){let t=e[a];return!t||t.type===`separator`||t.type===`paren`&&t.text===`)`}}i+=(a.text??``).length}return!1})(t,n,r,a))return[];let o=cs(e,a);if(!o||!(`fn`in o))return[];let s=po(o.fn.getDeclaration().getParameters(),a.argIndex);return s?us(o.fn,s,i):[]})(r,i,c,Ai(e.text),e.getLocale());if(m.length===0)return void n();u.current=f;let g=p.current;(g.length!==m.length||g.some((e,t)=>e.name!==m[t].name||ls(e)!==ls(m[t])))&&(s(m),l(0))},[]),v=G(()=>{g(),_()},[]),y=G(e=>{let n=t.current,r=u.current;if(!r)return;let i=n.text,a=e.kind??`function`,o=a===`function`||a===`lambda`,c=i[r.end]===`(`,l=(e.insert??e.name)+(o&&!c?`(`:``);a===`column`&&(l=e.name.replace(/['#[\]]/g,`'$&`));let d=i.slice(0,r.start)+l+i.slice(r.end),f=r.start+(o?e.name.length+1:l.length);s([]),m.current=l===`@`?null:d,n.applyText(d,f)},[]),b=G(e=>{let t=p.current.length;if(t===0)return!1;switch(e.which){case he.Down:return e.preventDefault(),e.stopPropagation(),l(e=>(e+1)%t),!0;case he.Up:return e.preventDefault(),e.stopPropagation(),l(e=>e<=0?t-1:e-1),!0;case he.Enter:case he.Tab:return!(x.current<0)&&(e.preventDefault(),e.stopPropagation(),y(p.current[Math.min(x.current,t-1)]),!0);case he.Escape:return e.preventDefault(),e.stopPropagation(),u.current=null,s([]),!0;default:return!1}},[]),x=(0,X.useRef)(c);x.current=c;let S=G(()=>{u.current=null,m.current=null,p.current.length&&s([]),r(null)},[]),C=(0,X.useCallback)(()=>{let e=t.current,n=e.getCaret(),r=e.getTokens();if(!r)return n;let i=Ai(e.text);if(p.current.length>0&&p.current[0].kind!==`enum`){let e=es(r,n,i);return e?e.start:n}let a=((e,t,n)=>{let r=n,i=[],a=null;for(let n of e){if(r>=t)break;let e=r;n.type===`function`?a=e:n.type===`paren`&&n.text===`(`?(i.push(a??-1),a=null):(n.type===`paren`&&n.text===`)`&&i.pop(),a=null),r=e+(n.text??``).length}for(let e=i.length-1;e>=0;e--)if(i[e]>=0)return i[e];return null})(r,n,i);if(a!==null)return a;let o=es(r,n,i);return o?o.start:n},[]),w=(n&&!n.bound?n.name:null)??o[0]?.enumOf?.fn??null;(0,X.useEffect)(()=>{if(!w)return void a(null);let e=!1,n=t.current,r=n.getArgument?.()?.fn;return(r?.getName()===w?r:n.getCalculation()?.getFunctions().getByName(w))?.getDescriptor().then(t=>{e||a($o(w,t))}).catch(()=>{e||a(null)}),()=>{e=!0}},[w]);let T=o[c]??null,E=T?.name??null,D=T?.kind??`function`;(0,X.useEffect)(()=>{if(!E||D===`column`||D===`specifier`||D===`enum`)return void f(null);if(D!==`function`){let e=t.current.getNames?.()?.getItems()??[];f((e=>{if(!e)return null;let t=e.getComment?.();if(t)return t;try{let t=e.getRanges?.()?.toString();if(t)return t}catch{}let n=e.getValue?.();return typeof n==`string`?n:null})(e.find(e=>e.getName()===E)??null));return}let e=!1;return(t.current.getCalculation()?.getFunctions().getByName(E))?.getDescriptor().then(t=>{e||f(t.getSummary())}).catch(()=>{e||f(null)}),()=>{e=!0}},[E,D]);let{hoveredTokenIndex:O,text:k}=e,A=(0,X.useCallback)(()=>{let e=e=>{let t=e.enumOf;if(t&&i?.name===t.fn)return i.enums?.[t.id]?.members[t.member]},r=o.map(t=>{let n=t.insert===void 0?void 0:e(t);return n?{...t,name:n.nameLocal}:t}),a=o[c],s=a?.kind===`enum`?e(a)?.description:d,u=o.length>0?{items:r,selectedIndex:c,selectedSummary:s??void 0,onSelect:y,onHighlight:l}:null,f=t.current.getTokens(),p=O!=null&&f&&n?((e,t,n,r)=>{if(t<0||t>=e.length)return null;let i=n;for(let n=0;n<=t;n++)i+=(e[n].text??``).length;let a=is(e,i,n);return a&&a.name===r?a.argIndex:null})(f,O,Ai(k),n.name):null,m=n?{hint:p===null?n:{...n,argIndex:p},descriptor:i}:null;return u||m?(0,Z.jsx)(Qo,{list:u,preview:m}):null},[o,c,d,n,i,y,O,k]);return{active:!!n||o.length>0,update:v,handleKeyDown:b,dismiss:S,getAnchorOffset:C,renderPanel:A}},hs={placement:`bottom-start`,followAnchor:!0},gs={placement:`top-start`,followAnchor:!0},_s=e=>{let t=e.getFormulaText({target:`display`});if(t)return t;let n=e.getText({useFormattingCategory:!0})??``;return e.getStyle().getQuotePrefix()?`'`+n:n},vs=e=>{let{selection:t,fillNone:n}=e,r=e=>{let{open:r,mode:i,clean:a,dirty:o,token:s,autoFocus:c,initialSelection:l,zoom:u,cellSize:d,readOnly:f,onDirtyChange:p,onModeChange:m,onCommit:g,onCancel:_,onNaturalSize:v,editable:y,placeholder:b,maxContentWidth:x,lineHeight:S,inputMode:w,enterKeyHint:T,hintPlacement:E}=e,D=a?a():null,O=o??(D?r?_s(D):(e=>{if(e.getSpillKind()!==`fixed`)return _s(e);let t=e.getFormulaText({target:`display`})??e.getSpill()?.getCell().getFormulaText({target:`display`});return t?`{${t}}`:_s(e)})(D):``),k=ki(O),A=Ai(O),j=(0,X.useRef)(null),M=(0,X.useRef)(null),N=kt(j,O),P=(0,X.useRef)(D);P.current=D;let[F,I]=(0,X.useState)(!1),[L,ee]=(0,X.useState)(0),[z,B]=(0,X.useState)(void 0),[V,H]=(0,X.useState)(null),[U,W]=(0,X.useState)(0),te=(0,X.useRef)(null),ne=(0,X.useRef)(null),re=(0,X.useRef)(!1),ie=(0,X.useRef)(null),ae=ga(),oe=ae.getMode(),se=oe?.dragging??!1,ce=oe?.draggingIndex??null,[K,le]=(0,X.useState)(null),[ue,de]=(0,X.useState)(null),fe=(0,X.useRef)(null),me=(0,X.useRef)(K);me.current=K;let ge=D?.getType(),ve=(ge===wn.Number||ge===wn.Null)&&D.getStyle().getNumberFormat().includes(`%`),ye=e=>{if(!ve)return null;let t=e.replace(/%/g,``);return t.length===0||isNaN(Number(t))?null:{value:t+`%`,caret:t.length}},be=(0,X.useRef)(0);(0,X.useLayoutEffect)(()=>{if(!r||!c)return;let e=j.current;if(!e||(e.focus(),be.current===s))return;be.current=s;let t=ye(O);if(t&&t.value!==O)return N(t.caret),void p(t.value);let n=e.value.length,i=ae.getMode()?.selection?.getCoords()?.rangeIndex??-1,a=i>=0&&q?Ni(q.tokens,i,A):null,o=a?{start:a.end,end:a.end,direction:`forward`}:l??{start:n,end:n,direction:`forward`};e.setSelectionRange(o.start,o.end,o.direction)},[s,r,c]);let xe=D?D.getStyle():null,Se=xe?xe.getFont():null,Ce=Se?Se.toCSS(`adaptive`,u):{},we=Se?Se.toCSS(`adaptive`,1):{},Ee=!n&&xe&&Se&&typeof O==`string`&&O?xe.measureText(O).renderLetterSpacing??0:0;Ee&&(we.letterSpacing=`${Se.getLetterSpacing()+Ee}px`,Ce.letterSpacing=(Se.getLetterSpacing()+Ee)*u+`px`),n&&(we.fontSize=`inherit`,Ce.fontSize=`inherit`,we.color=`inherit`,we.fontStyle=`inherit`,we.fontWeight=`inherit`,we.textDecoration=`inherit`,Ce.color=`inherit`,Ce.fontStyle=`inherit`,Ce.fontWeight=`inherit`,Ce.textDecoration=`inherit`);let De=(D&&O[0]!==`=`?J.toCSSHorizontalTextAlign(D.getRenderHorizontalAlignment()):`left`)??`left`,Oe=xe?.getAlignment(),ke=Oe?.getOverflow()===J.Overflow.Wrap,Ae=Oe?(e=>{switch(e){case J.VerticalAlignment.Center:return`center`;case J.VerticalAlignment.Bottom:return`flex-end`;default:return`flex-start`}})(Oe.getVertical()):`flex-start`,je=!!d,Me=(ke||!je)&&!k,Ne=k,Pe=je&&D&&d?D.getTextPlacement(d,k):null,Ie=D?D.getInsets():null,Le=Pe?.lineHeight??S,Re=F?Math.min(U,O.length):O.length,ze=k&&Oi(O,Re),Be=ze&&Re>=O.length;(0,X.useLayoutEffect)(()=>{let e=Ie?Ie.left+Ie.right:4,t,n;if(Me){let e=j.current;if(!e)return;let r=e.style.height;e.style.height=`auto`,n=e.scrollHeight/u,e.style.height=r,t=0}else{let r=M.current;if(!r)return;n=r.offsetHeight,t=r.offsetWidth+e}ee(n),v?.({width:t,height:n})},[O,Me,u,v,Ie?.left,Ie?.right,Ne,x,Be]);let Ve=Rt({mode:i,value:O,onDirtyChange:p,onModeChange:m,onCommit:g,onCancel:_,onNavigate:e=>{t.navigate(e)},onTraverse:(e,n)=>{t.traverse(e,n)},setCaret:N}),He=(0,X.useRef)(p);He.current=p;let Ue=(0,X.useRef)(null);Ue.current||={insertText:e=>{let t=j.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length;He.current(t.value.slice(0,n)+e+t.value.slice(r));let i=n+e.length;requestAnimationFrame(()=>t.setSelectionRange(i,i))},selectAll:()=>{j.current?.select()},setSelection:e=>{j.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{j.current?.focus()},toggleReferences:()=>{let e=j.current,t=P.current;if(!e||!t)return;let n=e.value,r=e.selectionStart??n.length;Fi(t.getWorksheet().getCalculation(),n,r,tt(t)).then(t=>{t&&(He.current(t.value),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret)))})}};let We=ms({text:O,getTokens:()=>pt.current?.tokens??null,active:F,getCaret:()=>j.current?.selectionStart??j.current?.value.length??0,getCalculation:()=>P.current?.getWorksheet().getCalculation()??null,getNames:()=>P.current?.getWorksheet().getNames()??null,getCell:()=>P.current??null,getLocale:()=>P.current?.getWorksheet().getWorkbook()?.getLocale()??null,applyText:(e,t)=>{He.current(e),requestAnimationFrame(()=>j.current?.setSelectionRange(t,t))},hoveredTokenIndex:K?.ti??null}),{caretAnchor:Ge}=Te(j),Ke=(0,X.useMemo)(()=>Ge(We.getAnchorOffset,0),[Ge,We.getAnchorOffset]),qe=(0,X.useRef)(null),Je=(0,X.useCallback)(e=>!!qe.current?.contains(e),[]),Ye=pe({label:`formula-editor-hint`,anchor:Ke,autoFocus:!1,disableClickAway:Je,propsPopper:E===`above`?gs:hs,renderPopupPanel:We.renderPanel}),Xe=Ye.reference,Ze=We.active&&!ae.getMode()?.dragging;(0,X.useEffect)(()=>{Ze?Xe.open(0):Xe.close(0)},[Ze,Xe]);let Qe=Fe(),$e=(0,X.useRef)(Qe);$e.current=Qe;let et=()=>{if(y)return y.getSession();let e=$e.current.getMode();return e?.key===`edit`?e.args.editable.getSession():null},tt=e=>({...e.getCoords(),scope:et()?.getCoords().scope??e.getWorksheet().getName()}),nt=ae.getMode(),rt=nt?.selection??null,it=!!nt&&nt.activeInput===Ue.current;(0,X.useEffect)(()=>{if(r)return et()?.registerEditor(Ue.current)},[r,s]),(0,X.useEffect)(()=>{F&&et()?.setActiveEditor(Ue.current)},[F,r,s]);let at=Oe?.getVertical(),ot=Pe?.bounds.y??Ie?.top??0,st=Pe?Pe.bounds.y+Pe.bounds.height:null,ct=Pe&&at===J.VerticalAlignment.Top?ot:Ie?.top??0,lt;lt=st!==null&&at===J.VerticalAlignment.Bottom?st:st!==null&&at===J.VerticalAlignment.Center?st+(ot-ct):d?d.height-(Ie?.bottom??0)+2:0;let ut=!L||L<=lt-ct,dt=je?{position:`absolute`,left:(Ie?.left??0)*u,top:ct*u,right:(Ie?.right??0)*u,height:Math.max(0,lt-ct)*u,display:`flex`,flexDirection:`column`,justifyContent:ut?Ae:`flex-start`}:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,justifyContent:`flex-start`},ft=(0,X.useRef)(null),q=(0,X.useMemo)(()=>{let e=P.current;if(!e||!k)return null;try{let t=e.getWorksheet().getCalculation().createFormula(O,tt(e),{target:`display`}),n=t.getTokens();if(n.length===0)return{tokens:[],ranges:[],valid:!1};let r=[];try{let i=t.getReferences(),a=et()?.getCoords().scope??e.getWorksheet().getName();r=i?i.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[],r=Xa(e.getWorksheet(),n,r)}catch{}return{tokens:n,ranges:r,valid:t.isValid()}}catch{return{tokens:[],ranges:[],valid:!1}}},[O]),pt=(0,X.useRef)(q);pt.current=q;let mt=(0,X.useMemo)(()=>q&&q.tokens.map(e=>e.text??``).join(``)===O.slice(A)?q.tokens:null,[q,O,A]),ht=!!mt,gt=(0,X.useMemo)(()=>Ao(mt??null),[mt]),_t=(0,X.useMemo)(()=>{let e=P.current?.getWorksheet().getCalculation();return mt&&e?new Set(ss(e,mt,A).flatMap(e=>e.tokens)):new Set},[mt,A]),vt=(0,X.useMemo)(()=>No(K?{lo:K.lo,hi:K.hi}:null,V,gt),[V,K,gt]),yt=G(()=>{let e=j.current?.selectionStart??O.length;W(e);let t=mt;if(!t)return B(void 0),void H(null);let n=Ai(O),r=Mi(t,e,n);B(r>=0?ji(t[r]):void 0);let i=F?jo(t,gt.matchOf,e,n):null;H(e=>Mo(e,i)?e:i)},[mt,O,F,gt]);(0,X.useEffect)(()=>{yt()},[yt,mt,F]);let bt=G(()=>{fe.current=null,le(null)},[]),xt=G(()=>{me.current?.fromSelection||bt()},[]),St=Aa(()=>bt(),()=>Tt()),Ct=G(e=>{let t=ft.current;if(!ht||!q||!t)return void bt();if(St.blocksHover(e)||ja(j.current))return void xt();let n=e.clientX,r=e.clientY,i=t.querySelectorAll(`[data-ti]`),a=-1,o=null;for(let e=0;e<i.length;e++){let t=i[e].getBoundingClientRect();if(n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom){a=Number(i[e].getAttribute(`data-ti`)),o=t;break}}let s=q.tokens;if(a<0){let e=t.querySelector(`[data-eq]`),i=e?.getBoundingClientRect();if(!e||!i||n<i.left||n>i.right||r<i.top||r>i.bottom)return void bt();let a=Pa(s);if(!a)return void bt();let o=a.hi;if(fe.current===`root`)return;fe.current=`root`;let c=t.querySelector(`[data-ti="${o}"]`)?.getBoundingClientRect(),l=c&&Math.abs(c.top-i.top)<1?{left:i.left,right:c.right,top:i.top}:{left:i.left,right:i.right,top:i.top};le({rect:l,evalIndex:0,ti:-1,lo:0,hi:o,overEq:!0});return}let c=s[a];if(!c||c.type===`whitespace`)return void bt();let l=Ma(s,a);if(!l){if(_o.has(c.type)&&c.text){let e=`literal:${a}`;if(e===fe.current)return;if(fe.current=e,!o)return void bt();let t={left:o.left,right:o.right,top:o.top};le({rect:t,evalIndex:-1,ti:a,lo:a,hi:a,literal:c.text})}else bt();return}let u=`${l.evalIndex}:${l.lo}:${l.hi}`;if(u===fe.current)return;fe.current=u;let d=t.querySelector(`[data-ti="${l.lo}"]`),f=t.querySelector(`[data-ti="${l.hi}"]`),p=d?.getBoundingClientRect(),m=f?.getBoundingClientRect(),h=p&&m&&Math.abs(m.top-p.top)<1?{left:p.left,right:m.right,top:p.top}:o?{left:o.left,right:o.right,top:o.top}:null;h?le({rect:h,evalIndex:l.evalIndex,ti:a,lo:l.lo,hi:l.hi}):bt()},[ht,q]),wt=G(e=>{let t=P.current;if(!t)return!1;try{return t.getWorksheet().getCalculation().createFormula(`=`+e,tt(t),{target:`display`}).isValid()}catch{return!1}},[]),Tt=G(()=>{let e=()=>{me.current?.fromSelection&&bt()},t=j.current,n=ft.current;if(!(t&&n&&ht&&q&&F))return void e();if(St.isDragging())return;let r=t.selectionStart??0,i=t.selectionEnd??0;if(r===i)return void e();let a=Na(q.tokens,A,O,r,i,wt);if(!a)return void e();let o=`sel:${a.lo}:${a.hi}:${a.fragment??a.evalIndex}`;if(o===fe.current)return;fe.current=o;let s=n.querySelector(`[data-ti="${a.lo}"]`)?.getBoundingClientRect(),c=n.querySelector(`[data-ti="${a.hi}"]`)?.getBoundingClientRect(),l=s&&c&&Math.abs(c.top-s.top)<1?{left:s.left,right:c.right,top:s.top}:s?{left:s.left,right:s.right,top:s.top}:null;l?le({rect:l,ti:-1,lo:a.lo,hi:a.hi,fromSelection:!0,evalIndex:a.fragment===null?a.evalIndex:-1,literal:a.fragment??void 0}):bt()},[ht,q,A,O,F]);(0,X.useEffect)(()=>{F||bt()},[F,bt]);let Et=K?.evalIndex??null,Dt=K?.literal??null;(0,X.useEffect)(()=>{let e=P.current;if(!e||Dt===null&&(Et===null||!ki(O)))return void de(null);let t=!1;try{let n=e.getWorksheet().getCalculation(),r=Dt===null?n.createFormula(O,tt(e),{target:`display`}):n.createFormula(`=`+Dt,tt(e),{target:`display`});Promise.resolve(Dt===null?r.evaluate({evalIndex:Et}):r.evaluate()).then(e=>{t||de(Ba(e))}).catch(()=>{t||de(null)})}catch{de(null)}return()=>{t=!0}},[Et,Dt,O]),(0,X.useEffect)(()=>{bt()},[O,bt]),(0,X.useLayoutEffect)(()=>{let e=ne.current;if(e)return ne.current=null,te.current=null,void j.current?.setSelectionRange(e.start,e.end);let t=te.current;t!==null&&(te.current=null,j.current?.setSelectionRange(t,t))},[O]);let Ot=G((e,t)=>{let n=P.current;if(n&&ki(O))try{let r=n.getWorksheet().getCalculation().createFormula(O,tt(n),{target:`display`}),i=Ai(O),a=Ni(r.getTokens(),e,i);if(!a)return;let o=Pi(r.getTokens(),e)?void 0:r.getReferences()?.getCoords()?.[e],s={colStart:t.colStart,rowStart:t.rowStart,colEnd:t.colEnd,rowEnd:t.rowEnd,$colStart:o?.$colStart,$rowStart:o?.$rowStart,$colEnd:o?.$colEnd,$rowEnd:o?.$rowEnd},c=Ka(n,t)??Ya(n,t,s)??Ga(n,s,t.scope),l=O.slice(0,a.start)+c+O.slice(a.end);if(l!==O){let e=l.length-O.length,t=F?j.current?.selectionStart??O.length:null;te.current=t===null||t>=a.start&&t<=a.end?a.end+e:t<=a.start?t:t+e}He.current(l)}catch{}},[O]),At=G(e=>{let t=P.current;if(t&&ki(O))try{let n=Ka(t,e)??Ya(t,e)??Ga(t,{colStart:e.colStart,rowStart:e.rowStart,colEnd:e.colEnd,rowEnd:e.rowEnd},e.scope),r;if(F)r={start:j.current?.selectionStart??O.length,end:j.current?.selectionEnd??O.length};else{let e=ie.current;r=e!==null&&e<=O.length?{start:e,end:e}:{start:O.length,end:O.length}}if(q&&r.start===r.end){let e=Ai(O),t=e;for(let n of q.tokens){let i=(n.text??``).length;if(n.referenceIndex!==void 0&&r.start>=t&&r.start<=t+i){let t=Ni(q.tokens,n.referenceIndex,e);t&&(r={start:t.end,end:t.end});break}t+=i}}let i=(r.start>0&&!`/*^&<>=:,+-@( `.includes(O[r.start-1])?`,`:``)+n,a=O.slice(0,r.start)+i+O.slice(r.end);te.current=r.start+i.length,F||(ie.current=r.start+i.length),He.current(a)}catch{}},[O,F,q]),jt=(0,X.useRef)(0);jt.current=q?.ranges.length??0;let Mt=G(()=>{let e=ae.getMode();if(!e||e.activeInput!==Ue.current||!F)return;let t=e.selection,n=P.current,r=q?.ranges??null,i=j.current?.selectionStart??O.length,a=-1;if(r&&q){let e=Ai(O);for(let t of q.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&i>=e&&i<=e+n){a=t.referenceIndex;break}e+=n}a>=r.length&&(a=-1),a>=0&&!r[a]&&(a=-1)}let o=a>=0,s=k&&Oi(O,i)&&!o&&!!q,c=s||o&&!!q;ie.current=s?i:null;let l=r??[],u=n?{rowIndex:n.getCoords().rowIndex,colIndex:n.getCoords().colIndex,scope:n.getWorksheet().getName()}:C.EmptyCell,d;if(s)d={cell:u,ranges:l,rangeIndex:-1};else if(l.some(Boolean)){let e=(a>=0?l[a]:null)??l.find(Boolean);d={cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:e.scope},ranges:l,rangeIndex:a}}else d={cell:u,ranges:C.EmptyRanges,rangeIndex:-1};re.current=!0;try{t.updateCoords(d)}finally{re.current=!1}let f=c?`point`:`show`;e.mode!==f&&ae.setMode(e=>e&&e.mode!==f?{...e,mode:f}:e)},[q,O,i,F]),Nt=Qe.getMode()?.key??null;(0,X.useEffect)(()=>{Mt(),We.update()},[Mt,We.update,q,F,O,r,Nt,i,it,rt]),(0,X.useEffect)(()=>{F&&nt&&nt.activeInput!==Ue.current&&ae.setMode(e=>e&&{...e,activeInput:Ue.current})},[F,nt]),(0,X.useEffect)(()=>{r&&nt&&!nt.activeInput&&ae.setMode(e=>e&&!e.activeInput?{...e,activeInput:Ue.current}:e)},[r,nt]),(0,X.useEffect)(()=>{r||(ie.current=null)},[r]),(0,X.useEffect)(()=>()=>{ae.setMode(e=>e&&e.activeInput===Ue.current?{...e,activeInput:null}:e)},[]),(0,X.useEffect)(()=>{if(it&&rt)return rt.addListeners({onChange:e=>{if(re.current||Ha())return;let t=e.getCoords(),n=t.rangeIndex??-1;n<0||!t.ranges||n>=t.ranges.length||(n<jt.current?Ot(n,t.ranges[n]):At(t.ranges[n]))}})},[it,rt,Ot,At]);let Pt=Ce.color,Ft=je?0:2,It={boxSizing:`border-box`,paddingTop:0,paddingBottom:0,paddingLeft:Ft,paddingRight:ht&&Be?`calc(${Ft}px + ${ho})`:Ft,margin:0,whiteSpace:Me||Ne?`pre-wrap`:`pre`,wordBreak:Ne?`break-all`:Me?`break-word`:`normal`,textAlign:De,...Ce,...Le?{lineHeight:Le*u+`px`}:null};return(0,Z.jsxs)(`div`,{ref:qe,style:{position:`relative`,flex:`1 1 100%`,minWidth:0},onMouseDown:e=>{let t=j.current;if(!t||e.target===t||!Je(e.target))return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.clientY<n.top?0:t.value.length;t.focus(),t.setSelectionRange(r,r),i!==`edit`&&m(`edit`)},onPointerDown:e=>{e.stopPropagation()},children:[(0,Z.jsx)(`div`,{style:dt,children:(0,Z.jsxs)(`div`,{style:{position:`relative`,flex:je?`0 0 auto`:`1 1 100%`,width:`100%`,minWidth:0,...xe&&!n?xe.getFill()?.toCSS(`adaptive`):h.EmptyObject},children:[!!b&&!O&&(0,Z.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...It,color:Pt,opacity:.55},children:b}),ht&&(0,Z.jsxs)(`div`,{ref:ft,"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...It},children:[(()=>{let e=se&&ce!==null&&mt.some(e=>e.referenceIndex===ce),t=ze&&!Be?Re:-1,n=A,r=mt.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=A===1?(0,Z.jsx)(`span`,{"data-eq":!0,style:{color:Pt,opacity:e?.5:void 0},children:`=`},`eq`):null,a=mt.map((n,i)=>{let a=gt.unmatched.has(i),o=vt.has(i),s=gt.depthOf.get(i),c=a||s===void 0||n.referenceIndex!==void 0?void 0:Co(s),l=a?Eo:c??ji(n),u=e&&n.referenceIndex!==ce,d;(l||o||a||u)&&(d={},l&&(d.color=l),a&&(d.fontWeight=`bold`),u&&(d.opacity=.5),o&&(d.color=`transparent`)),_t.has(i)&&(d={...d,...Oo});let f=n.text??``,p=t>=r[i]&&t<r[i]+f.length;return(0,Z.jsxs)(`span`,{"data-ti":i,style:d,children:[o&&(0,Z.jsx)(`span`,{"aria-hidden":!0,style:wo,children:(0,Z.jsx)(`span`,{style:To(l??Pt??`inherit`),children:n.text})}),p?(0,Z.jsxs)(Z.Fragment,{children:[f.slice(0,t-r[i]),(0,Z.jsx)(go,{}),f.slice(t-r[i])]}):f]},i)});if(!K)return(0,Z.jsxs)(Z.Fragment,{children:[i,a]});let{lo:o,hi:s,overEq:c}=K,l=K.fromSelection?bo:yo,u=[...c||!i?[]:[i],...a.slice(0,o)],d=[...c&&i?[i]:[],...a.slice(o,s+1)],f=a.slice(s+1);return(0,Z.jsxs)(Z.Fragment,{children:[u,(0,Z.jsx)(`span`,{className:`formula-eval-run`,style:l,children:d},`eval-run`),f]})})(),Be&&(0,Z.jsx)(go,{})]}),(0,Z.jsx)(`textarea`,{ref:j,value:O,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,inputMode:w,enterKeyHint:T,name:`cell-editor`,readOnly:f,style:{position:`relative`,display:`block`,width:`100%`,height:je?L?L*u:void 0:`100%`,border:`none`,outline:`none`,resize:`none`,overflow:`hidden`,background:`transparent`,userSelect:`text`,...It,color:Pt,...ht?{WebkitTextFillColor:`transparent`}:null,caretColor:z??`auto`,...K&&!K.fromSelection?{[R]:`transparent`}:null},onChange:e=>{let t=ye(e.target.value);if(t)return requestAnimationFrame(()=>j.current?.setSelectionRange(t.caret,t.caret)),void p(t.value);p(e.target.value)},onSelect:()=>{Mt(),We.update(),yt(),Tt()},onScroll:e=>{let t=ft.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft,bt(),Tt())},onMouseMove:Ct,onMouseLeave:xt,onDragStart:St.onDragStart,onPointerDown:e=>{e.stopPropagation(),St.begin(e),Ze&&!Ye.isOpen&&Xe.open(0),i!==`edit`&&m(`edit`)},onKeyDown:e=>{if(!We.handleKeyDown(e))return e.which===he.Escape&&Ye.isOpen?(e.preventDefault(),e.stopPropagation(),void Xe.close(0)):void((e=>{if(e.which!==he.F9||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return!1;let t=j.current,n=P.current;if(!t||!n||f||!k||!q||q.tokens.length===0)return!1;let r=t.selectionStart??0,i=t.selectionEnd??0,a;if(r!==i)a=Na(q.tokens,A,O,r,i,wt);else{let e=Pa(q.tokens);a=e?{...e,...Fa(q.tokens,A,e.lo,e.hi),fragment:null}:null}if(!a)return!1;e.preventDefault(),e.stopPropagation();let o=O,s=n.getWorksheet().getCalculation(),c=tt(n),l=n.getWorksheet().getWorkbook()?.getLocale()??null,u=Ia(yn(l??`en`).decimal),d=Yn(),p={t:d?.booleans?.true??`TRUE`,f:d?.booleans?.false??`FALSE`};return(async()=>{let e=null,t=``;try{if(e=Ra(a.fragment===null?await s.createFormula(o,c,{target:`display`}).evaluate({evalIndex:a.evalIndex}):await s.createFormula(`=`+a.fragment,c,{target:`display`}).evaluate(),u,p),e===null||(t=o.slice(0,a.start)+e+o.slice(a.end),!s.createFormula(t,c,{target:`display`}).isValid()))return}catch{return}let n=j.current;n&&n.value===o&&(ne.current={start:a.start,end:a.start+e.length},_e.replaceRangeText(n,a.start,a.end,e))})(),!0})(e)||(e=>{if(i===`edit`||!it||!nt)return!1;let t=P.current?.getWorksheet(),n=(t?.getWorkbook()?.getSelectedWorksheet()??t)?.getName();return!!n&&Ua(e,nt,n)})(e)||Ve(e))},onFocus:()=>{I(!0),et()?.setActiveEditor(Ue.current)},onBlur:e=>{let t=Xe.floatElement?.();t&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||I(!1)}})]})}),(0,Z.jsxs)(`div`,{ref:M,"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,...we,...Le?{lineHeight:`${Le}px`}:null,...Ne&&x!==void 0?{whiteSpace:`pre-wrap`,wordBreak:`break-all`,width:`max-content`,maxWidth:Math.max(1,x-(Ie?Ie.left+Ie.right:4))}:null},children:[(()=>{if(O.length===0)return` `;if(O.endsWith(`
|
|
6
|
+
`))return O+` `;if(!ht||Be)return O;let e=(O.codePointAt(O.length-2)??0)>65535?2:1;return(0,Z.jsxs)(Z.Fragment,{children:[O.slice(0,-e),(0,Z.jsx)(`span`,{style:{display:`inline-block`,minWidth:ho},children:O.slice(-e)})]})})(),ht&&Be&&(0,Z.jsx)(`span`,{style:{display:`inline-block`,width:`0.6em`,marginLeft:`1px`}})]}),!1,Ye.component,K&&ue!==null&&(0,ir.createPortal)((0,Z.jsx)(`div`,{"aria-hidden":!0,style:{...ka,left:(K.rect.left+K.rect.right)/2,top:K.rect.top-6},children:ue}),document.body)]})};return r.displayName=`SheetCellInput`,r};function ys(e,t,n={}){let{mode:r=`edit`,initialSelection:i}=n;e.startEdit(e.getAnchor().getCoords(),{dirty:t,mode:r,initialSelection:i})}function bs(e,t){let n=e.getSession()?.getActiveEditor();return!!n&&(n.insertText(t),!0)}function xs(e,t,n={}){bs(e,t)||ys(e,t,n)}function Ss(e,t,n,r){let{autoRange:i,direction:a}=function(e){let t=e.getSelectedCell().getCoords(),n=null,r=0,i=t.rowIndex>0?e.getRange({rowIndex:t.rowIndex,colIndex:t.colIndex}).getExtended(Y.Direction.Up):null;i&&e.getRange({colStart:t.colIndex,rowStart:i.getCoords().rowStart,colEnd:t.colIndex,rowEnd:i.getCoords().rowStart}).isContentful()&&(n=Y.Direction.Up,r=t.rowIndex-i.getCoords().rowEnd);let a=t.colIndex>0?e.getRange({rowIndex:t.rowIndex,colIndex:t.colIndex-1}).getExtended(Y.Direction.Left):null;if(a&&e.getRange({colStart:a.getCoords().colStart,rowStart:t.rowIndex,colEnd:a.getCoords().colStart,rowEnd:t.rowIndex}).isContentful()){let e=t.colIndex-a.getCoords().colEnd;(e<r||!n)&&(n=Y.Direction.Left,r=e)}let o=null;if(n===Y.Direction.Up&&i){if(o={...i.getCoords()},(o.rowEnd===t.rowIndex||!e.getRange({colIndex:t.colIndex,rowIndex:t.rowIndex-1}).isContentful())&&o.rowStart>0&&e.getRange({colIndex:t.colIndex,rowIndex:o.rowStart-1}).isContentful()){let e=i.getExtended(Y.Direction.Up);o={colStart:t.colIndex,rowStart:e.getCoords().rowStart,colEnd:t.colIndex,rowEnd:i.getCoords().rowEnd}}o.rowEnd=t.rowIndex-1}else if(n===Y.Direction.Left&&a){if(o={...a.getCoords()},(o.colEnd===t.colIndex||!e.getRange({colIndex:t.colIndex-1,rowIndex:t.rowIndex}).isContentful())&&o.colStart>0&&e.getRange({colIndex:o.colStart-1,rowIndex:t.rowIndex}).isContentful()){let e=a.getExtended(Y.Direction.Left);o={colStart:e.getCoords().colStart,rowStart:t.rowIndex,colEnd:e.getCoords().colEnd,rowEnd:t.rowIndex}}o.colEnd=t.colIndex-1}return{autoRange:o,direction:n}}(t),o=t.getSelectedRange();if(r===`caret`||o.size===1||!a||!i){let a=i?t.getRange(i).toString():``,o=`=${n}(`,s=`${o}${a})`;r===`caret`?bs(e,s):ys(e,s,{mode:`edit`,initialSelection:{start:o.length,end:o.length+a.length}});return}let{rowStart:s,rowEnd:c,colStart:l,colEnd:u}=o.getCoords(),d=a===Y.Direction.Up;o.doBatch(async()=>{let e=o.createSparseBuilder({axis:Y.Axis.Column}),r={...i};for(let a=l;a<=u;a++){r.colStart=d?a:i.colStart+(a-l),r.colEnd=d?a:i.colEnd+(a-l);for(let o=s;o<=c;o++)r.rowStart=d?i.rowStart+(o-s):o,r.rowEnd=d?i.rowEnd+(o-s):o,e.pushAt(o,a,`=${n}(${t.getRange(r).toString()})`)}e.apply()})}var Cs=[[`insertFunctionSum`,`SUM`],[`insertFunctionAverage`,`AVERAGE`],[`insertFunctionCount`,`COUNT`],[`insertFunctionMax`,`MAX`],[`insertFunctionMin`,`MIN`]];function ws(e,t){let{editable:n,sheet:r,flavor:i}=t,a=e=>{e!=null&&(i===`caret`?bs(n,e):ys(n,e))};e.updateCommand(`insertCurrentTime`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:Pn.nowWithPrecision(),style:{numberFormat:`Medium Time`}}).getText())}),e.updateCommand(`insertCurrentDate`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:Pn.nowWithPrecision(),style:{numberFormat:`Short Date`}}).getText())}),e.updateCommand(`insertValueAbove`,{tags:[`noTransaction`],callback:()=>{let e=r.getSelectedCell().getCoords();if(!e||e.rowIndex<=0)return;let t=r.getRange({rowIndex:e.rowIndex-1,colIndex:e.colIndex}).getCell();if(!t)return;let n=t.getFormulaText({target:`display`});a(n??t.getText({useFormattingCategory:!0}))}});for(let[t,a]of Cs)e.updateCommand(t,{tags:[`noTransaction`],callback:()=>Ss(n,r,a,i)});return()=>{}}function Ts(e,t){let{editable:n}=t;return e.updateCommand(`relativeReferencesToggle`,{callback:()=>{(n.getSession()?.getActiveEditor())?.toggleReferences()}}),e.updateCommand(`toggleEditorFocus`,{callback:()=>{let e=n.getSession();if(!e)return;let t=e.getEditors();if(t.length<2)return;let r=e.getActiveEditor();t[((r?t.indexOf(r):-1)+1)%t.length]?.focus()}}),()=>{}}function Es(e,t){let{editable:n,sheet:r,active:i=!0}=t;if(!i)return()=>{};let a=ws(e,{editable:n,sheet:r,flavor:`caret`}),o=Ts(e,{editable:n});return()=>{a(),o()}}var Ds=async(e,t)=>{let n=[];for(let e of t)e.hasPassword()&&!e.isUnlocked()&&n.push(e);return n.length===0||!!e?.showInput&&(await e.showInput({title:A(`dialog.unlockRange.title`),description:n.length===1?A(`dialog.unlockRange.description`,{name:n[0].getName()}):A(`dialog.unlockRange.descriptionMany`),inputType:`password`,options:[{id:`Unlock`,label:()=>A(`dialog.unlock`)},`Cancel`],defaultOption:`Unlock`,cancelOption:`Cancel`,onValidateInput:async(e,t)=>{if(t!==`Unlock`)return{valid:!0};if(!e)return{valid:!1,message:A(`dialog.password.required`)};let r=!1;for(let t of n)await t.unlock(e)&&(r=!0);return r?{valid:!0}:{valid:!1,message:A(`dialog.password.incorrect`)}}}))?.option===`Unlock`},Os=e=>{let t=Se(),n=z(),r=(0,X.useRef)(!1);return(0,X.useEffect)(()=>{r.current=!1},[e]),G((i,a)=>{if(e.getProtection().isLocked()){if(i){let n=e.getProtectedRanges().getItems({address:{rowIndex:i.rowIndex,colIndex:i.colIndex}}).filter(e=>e.hasPassword()&&!e.isUnlocked());if(n.length>0)return void Ds(t,n).then(e=>{e&&a?.()})}if(r.current)return;r.current=!0,t?.showMessage?.(n(`error.sheet.protectedSheet`),{type:K.Error})}else i&&e.getRange({rowIndex:i.rowIndex,colIndex:i.colIndex}).getCell().getSpillKind()===`fixed`&&t?.showMessage?.(n(`error.sheet.changePartOfArray`),{type:K.Error})},[e,t])},{CommandScopeProvider:ks}=fe,As=Object.freeze({x:0,y:0,width:0,height:0}),js=({alignWidth:e,children:t})=>{let n=tt(),r=e/_e.getDevicePixelRatio();return(0,Z.jsx)(`div`,{style:n?{position:`absolute`,left:n.x-r,top:n.y-r,width:n.width,height:n.height,display:`flex`}:{position:`absolute`,inset:0,display:`flex`},children:t})};function Ms(e){let{sheet:t,editable:n,darkMode:r,alignment:i,alignWidth:a=2,zIndex:o,className:s,style:c,...l}=e,u=it(),d=(0,X.useMemo)(()=>vs({selection:t.getSelection()}),[t]),f=B(n,e=>e.getSession()),p=Re(f,e=>e.getState()),m=!p||!p.coords.scope||p.coords.scope===t.getName(),h=(0,X.useMemo)(()=>({editable:n,sheet:t,active:!!p}),[n,t,p]),[g,_]=(0,X.useState)(null),v=G(e=>{_(t=>t&&t.width===e.width&&t.height===e.height?t:e)},[]),y=G(e=>n.commit(e),[n]),b=G(()=>{n.cancel()},[n]);(0,X.useEffect)(()=>{p&&u&&m&&u.scrollCellCoordsIntoView(p.coords)},[p?.token,m]);let x=p?p.coords:n.getAnchor().getCoords(),S=x?{rowIndex:x.rowIndex,colIndex:x.colIndex}:null,C=(()=>{if(!p||!m)return`left`;let e=p.clean();if((p.dirty??(e?_s(e):``))[0]===`=`)return`left`;switch(e?.getRenderHorizontalAlignment()){case J.HorizontalAlignment.Right:return`right`;case J.HorizontalAlignment.Center:case J.HorizontalAlignment.CenterContinuous:return`center`;default:return`left`}})(),w=i??C,T=null,E=!1,D=!1;if(u&&S){let e=u.getRangeFromCell(S);if(D=u.toClipBounds(u.getBoundsFromRange({rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowStart,colEnd:e.colStart}))!==null,p){let e=Ot(u,S,g,w,a);T=e?.bounds??null,E=e?.inView??!1}else T=u.getBoundsFromRange(e)}let O,k=null;if(u&&S){let e=u.getBoundsFromRange(u.getRangeFromCell(S)),t=u.getZoom()||1;if(e){k={width:e.width/t,height:e.height/t};let n=u.getSurfaceSize();n?.width&&(O=Math.max(e.width,n.width-e.x-a)/t)}}let A=!!p&&!!T&&E&&m,j=`inline:${t.getId()}:${u?.getAnchor()??``}`,M=G(()=>{n.getSession()?.setActiveEditorId(j)},[n,j]),N=f?.getActiveEditorId()??null,P=!N||N===j,F={open:!!p,mode:p?.mode??`enter`,coords:p?.coords??null,clean:p?.clean??null,dirty:p?.dirty,token:p?.token??0,autoFocus:(p?.autoFocus??!0)&&P&&A&&D,initialSelection:p?.initialSelection,zoom:u?.getZoom()??1,cellSize:k,onDirtyChange:e=>f?.setDirty(e),onModeChange:e=>f?.setMode(e),onCommit:y,onCancel:b,onNaturalSize:v},I=!x||x.scope&&x.scope!==t.getName()?`transparent`:wa(t.getRange(x).getCell(),t,r,`var(--sxl-color-base-100)`);return(0,Z.jsx)(ks,{spec:{scopeName:{key:`layer:editor`,name:`editor`},contributor:{dynamic:Es},data:h},order:Ht().zIndex,children:(0,Z.jsx)(et,{className:Q(s,`editor`),children:T||p?(0,Z.jsx)(ct,{...l,bounds:T??As,alignWidth:a,keepMounted:!0,onFocus:M,style:{borderColor:`var(--sxl-color-primary, rgb(33, 115, 70))`,...c,display:`flex`,overflow:`hidden`,background:I,boxShadow:A?`rgba(60,64,67,.35) 2px 2px 6px 3px`:`none`,opacity:+!!A,pointerEvents:A?`auto`:`none`},children:(0,Z.jsx)(js,{alignWidth:a,children:(0,Z.jsx)(d,{...F,editable:n,maxContentWidth:O})})}):null})})}Ms.displayName=`SheetCellEditorLayer`;var Ns=(e,t,n,r)=>{if(!e.startEdit(t,n))return!1;let i=r?.isActive()?r.getEditorId():null;return i&&e.getSession()?.setActiveEditorId(i),!0};function Ps(e){let{sheet:t,editable:n,onEditRejected:r}=e,i=it(),a=ve(),o=Os(t),s=r??o,c=Se(),l=G(e=>{if(n.getSession())return;let r=i?.getElement(),o=!!i&&e.target===i.getFocusTarget();if(r&&e.target!==r&&!o)return;let l=n.getAnchor().getCoords();if(!l)return;let u=e.nativeEvent;if(!(u.key.length!==1||u.ctrlKey||u.metaKey||u.altKey||u.key===` `&&u.shiftKey||u.isComposing)){let n=zr({sheet:t,notifier:c,notifyEditRejected:s});if(function(e,t,n){Nr();let r=t.getSelection(),i=r.getCell(),a=r.getRanges(),o=new Map,s=new Set,c=a.getCount();for(let e=0;e<c;e++)for(let t of a.at(e).getControls()){if(s.has(t))continue;s.add(t);let e=t.getType(),n=o.get(e);n?n.push(t):o.set(e,[t])}let l=!1;for(let[a,s]of o)Fr(a)?.onKey?.(e,{sheet:t,selection:r,anchor:i,controls:s},n)&&(l=!0);return kr.size>0&&i.getType()===wn.RichData&&kr.get(i.getValue().getKind().getName())?.onKey?.(e,{sheet:t,selection:r,anchor:i,controls:[]},n)&&(l=!0),l}(u.key,t,n))return e.preventDefault(),void e.stopPropagation()}let d=$e(e.nativeEvent);if(!d)return;e.nativeEvent.key!==`Process`&&e.nativeEvent.keyCode!==229&&e.preventDefault(),e.stopPropagation();let f=o?a:void 0,p=()=>Ns(n,l,d,f);p()||s(l,()=>{p()})},[n,i,a,s,t,c]),u=G(e=>{let t=e.target;if(!(i&&t===i.getFocusTarget()&&t instanceof HTMLInputElement))return;let r=t.value;if(t.value=``,!r||n.getSession())return;let o=n.getAnchor().getCoords();if(!o)return;let c=()=>Ns(n,o,{mode:`enter`,dirty:r},a);c()||s(o,()=>{c()})},[n,i,a,s]);(0,X.useEffect)(()=>{let e=i?.getElement();if(e)return e.addEventListener(`input`,u),()=>e.removeEventListener(`input`,u)},[i,u]);let d=G(e=>{if(n.getSession())return;let r=i?.getCellFromPointer(e.clientX,e.clientY),a=r?{...r,scope:t.getName()}:n.getAnchor().getCoords();if(!a)return;let o=()=>n.startEdit(a,{mode:`edit`});o()||s(a,()=>{o()})},[i,n,t,s]);return(0,Z.jsx)(et,{className:`editor-start`,onKeyDown:l,onDoubleClick:d})}Ps.displayName=`SheetCellEditorStartLayer`;function Fs(e){return ve().isEnabled()?(0,Z.jsx)(Is,{...e}):null}function Is(e){let{editable:t}=e,n=it(),r=ve(),i=(0,X.useRef)(null),a=n!=null&&n===Je(n.getAllPanes());(0,X.useEffect)(()=>{if(n)return n.registerFocusTarget(()=>{let e=i.current;return e&&r.isActive()?(e.inputMode=r.getInputMode(),e):null})},[n,r]),(0,X.useEffect)(()=>{let e=n?.getElement();if(!n||!e)return;let t=e=>!!e.target?.closest?.(`input, textarea, [contenteditable]:not([contenteditable="false"])`),i=e=>{!r.isActive()||r.getOptions().keepOnTap||t(e)||r.hide()},a=e.ownerDocument,o=n=>{r.isActive()&&r.getOptions().keepOnTap&&e.contains(n.target)&&!t(n)&&n.preventDefault()},s=t=>{t.target===e&&r.isActive()&&n.focus({preventScroll:!0})};return e.addEventListener(`pointerdown`,i,!0),a.addEventListener(`mousedown`,o),e.addEventListener(`focus`,s),()=>{e.removeEventListener(`pointerdown`,i,!0),a.removeEventListener(`mousedown`,o),e.removeEventListener(`focus`,s)}},[n,r]),(0,X.useEffect)(()=>{if(!n)return;let e=r.isActive();return r.subscribe(()=>{let t=r.isActive();if(t===e)return;e=t;let o=document.activeElement;var s;t?!a||(s=o)&&(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||!0===s.isContentEditable)||n.focus({preventScroll:!0}):o&&o===i.current&&n.focus({preventScroll:!0})})},[n,r,a]),(0,X.useEffect)(()=>{if(!a||r.getOptions().disabled)return;let e=ke();return ze(()=>{let n=ke();n!==e&&(e=n,n?t.getSession()&&r.show():r.hide())})},[a,r,t]),(0,X.useEffect)(()=>{if(a)return se(e=>{e.key===`edit`&&r.hide()})},[a,r]);let o=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!a||!n||r.getOptions().disableScrollIntoView)return;let e=n.getSurfaceSize().height,i=o.current;o.current=e,i===null||e>=i||!ke()||n.scrollCellCoordsIntoView(t.getAnchor().getCoords())},[a,n,r,t]),(0,Z.jsx)(et,{className:`virtual-keyboard`,children:(0,Z.jsx)(`input`,{ref:i,className:`virtual-keyboard-input`,tabIndex:-1,inputMode:`none`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,enterKeyHint:`enter`,onFocus:e=>{e.currentTarget.value=``},style:{position:`absolute`,left:0,top:0,width:`1px`,height:`1px`,padding:0,border:`none`,opacity:0,caretColor:`transparent`,pointerEvents:`none`,fontSize:`16px`}})})}Fs.displayName=`VirtualKeyboardLayer`,Is.displayName=`VirtualKeyboardPaneLayer`;var Ls=class{constructor(e){this._listeners=new Set,this._removeSdkListener=null,this._sel=e}get selection(){return this._sel}getSelection(){return this._sel.getCoords()}setSelection(e){this._sel.updateCoords(e)}navigate(e,t=!1,n=!1,r){this._sel.navigate(e,t,n,r)}traverse(e=_.Row,t=!1,n){this._sel.traverse(e,t,n)}modify(e,t){this._sel.modify(e,t)}append(e,t=e){this._sel.append(e,t)}deselect(e){let t=this._sel.getCoords();if(!t.ranges||t.ranges.length===0)return;let n=[],r=-1,i=t.cell;for(let a of t.ranges){if(C.isRangesIntersect(a,e)){let i=h.subtractRect({top:a.rowStart,left:a.colStart,bottom:a.rowEnd+1,right:a.colEnd+1},{top:e.rowStart,left:e.colStart,bottom:e.rowEnd+1,right:e.colEnd+1});for(let e of i){let i={rowStart:e.top,colStart:e.left,rowEnd:e.bottom-1,colEnd:e.right-1};n.push(i),C.isCellWithinRange(t.cell,i)&&(r=n.length-1)}}else n.push(a);if(n.length>0&&r===-1&&C.isCellWithinRange(t.cell,a)){r=n.length-1;let e=n[n.length-1];i={rowIndex:e.rowStart,colIndex:e.colStart}}}this._sel.updateCoords({cell:i,rangeIndex:r,ranges:n})}getCoords(){return this._sel.getCoords().cell}subscribe(e){return this._listeners.add(e),this._listeners.size===1&&(this._removeSdkListener=this._sel.addListeners({onChange:()=>{this._listeners.forEach(e=>e())}})),()=>{this._listeners.delete(e),this._listeners.size===0&&(this._removeSdkListener?.(),this._removeSdkListener=null)}}};Object.freeze({[Wn.Presets.Copy.id]:S(`autoFill.preset.copy`),[Wn.Presets.Series.id]:S(`autoFill.preset.series`),[Wn.Presets.Linear.id]:S(`autoFill.preset.linear`),[Wn.Presets.Growth.id]:S(`autoFill.preset.growth`),[Wn.Presets.DateYears.id]:S(`autoFill.preset.dateYears`),[Wn.Presets.DateMonthEnd.id]:S(`autoFill.preset.dateMonthEnd`),[Wn.Presets.DateMonths.id]:S(`autoFill.preset.dateMonths`),[Wn.Presets.DateWeekdays.id]:S(`autoFill.preset.dateWeekdays`),[Wn.Presets.DateDays.id]:S(`autoFill.preset.dateDays`),[Wn.Presets.LinearTrend.id]:S(`autoFill.preset.linearTrend`),[Wn.Presets.GrowthTrend.id]:S(`autoFill.preset.growthTrend`)});function Rs(e){let{sheet:t,notifier:n,range:r,byDirection:i,direction:a,presetId:o,onClosed:s}=e,c={range:r,direction:a,offered:e=>i.get(e)?.offered??[],resolve:e=>{let n=i.get(e);return n?{template:t.getRange(n.template).getAddress(),destination:t.getRange(n.destination).getAddress(),templateSize:n.templateSize,size:n.size}:null},preview:e=>{let n=i.get(e.direction);if(!n)return null;try{return t.getRange(n.template).autoFill(n.destination,{...zs(e),preview:!0})}catch{return null}}},l={initialValue:{presetId:o,direction:a},context:()=>c,onInput:e=>{try{let r=e?i.get(e.direction):void 0;if(!e||!r)return;try{t.getRange(r.template).autoFill(r.destination,{...zs(e),autoSelect:!0})}catch(e){n?.showError?.(e)}}finally{s?.()}}};n?.showWindow?.(`fillSeries`,l)}function zs(e){let t=Wn.getPreset(e.presetId);if(!t)throw new O(A(`error.fillSeries.unknownType`));return Wn.toFillOptions(t,{trend:e.trend,stepValue:e.stepValue,stopValue:e.stopValue})}function Bs(e){let{sheet:t,template:n,destination:r,notifier:i,onSettled:a}=e,o=t.getRange(n),s=o.getDefaultAutoFillCriteria(void 0,r);if(!s)return null;let c=t.getRange(r),l=!1,u=!1,d=()=>{u||(u=!0,a?.())};return{template:o,destination:c,direction:s.direction,offered:s.offered,fill:async e=>{l=!0;let n=await i?.showBusy?.(A(`op.autoFill`));try{let n=e.presetId===void 0?void 0:Wn.getPreset(e.presetId);if(e.presetId!==void 0&&!n)throw new O(A(`error.fillSeries.unknownType`));let i={...n?Wn.toFillOptions(n):void 0,type:e.type,snap:!0};await t.doBatch(()=>{o.autoFill(r,i),c.autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:S(`op.autoFill`),autoSelect:!0})}catch(e){i?.showError?.(e)}finally{n?.(),d()}},series:()=>{l=!0,Rs({sheet:t,notifier:i,range:c,byDirection:new Map([[s.direction,s]]),direction:s.direction,presetId:s.presetId,onClosed:d}),i?.showWindow||d()},cancel:()=>{l||d()}}}function Vs(e,t){let{navigation:n,sheet:r}=t;if(!n)return()=>{};let i=[...n.getBindings().keys()].map(e=>({key:e,callback:()=>{n.invoke(e)}}));r&&(i.push({key:`traverseSelectionCorners`,callback:()=>{r.getSelection().traverseCorners()}}),i.push({key:`selectArray`,callback:()=>{(e=>{let t=e.getSelection(),n=e.getRange(t.getCoords().cell).getCell(),r=n.getSpillKind()===`error`?C.cellToRange(n.getCoords()):n.getSpill()?.getCoords();r&&t.updateCoords({cell:{rowIndex:r.rowStart,colIndex:r.colStart},ranges:[r],rangeIndex:0})})(r)}}));for(let t of i){let{key:n,...r}=t;e.updateCommand(n,r)}return()=>{}}var Hs={top:Y.Direction.Up,bottom:Y.Direction.Down,left:Y.Direction.Left,right:Y.Direction.Right},Us=({sheet:e,isActive:t=!0,onFillMenu:n,className:r,...i})=>{let a=Se(),o=z(),c=Fe(),[l,u]=(0,X.useState)(null),d=!!fe.useCommandScope(),f=(0,X.useMemo)(()=>({navigation:l,sheet:e}),[l,e]),[p]=fe.useCommands([`pasteFormats`]),m=G(async()=>{c.getMode()?.key===`formatPainter`&&(await p?.execute(),c.setMode(null))},[c,p]),h=(0,X.useMemo)(()=>new Ls(e.getSelection()),[e]),g=G(t=>{let n=e.getSelection();n.setAdjusting(t===`extend`?n.getCoords():null)},[e]),_=G(()=>e.getUsedRange()?.getCoords()??C.EmptyRange,[e]),v=G(t=>{let n=e.getTables().getItems();for(let e=0;e<n.length;e++){let r=n[e];if(C.isCellWithinRange(t,r.getRange().getCoords()))return r.getDataRange().getCoords()}return null},[e]),y=G(t=>{e.scrollTo({colStart:t.colIndex,colEnd:t.colIndex,rowStart:t.rowIndex,rowEnd:t.rowIndex},{})},[e]);s(e,[`onProtectionChange`,`onSelectionChange`]),s(e.getSelection(),[`onAdjustingChange`]);let b=e.getSelection().getAdjusting()!==null,x=c.getMode(),w=x?.key===`edit`,T=x?.key===`copy`||x?.key===`cut`,E=x?.key===`fill`,D=e.getSelectedRanges().getCount(),O=e.getProtection().isLocked(),k=t&&D<=1&&!w&&(!O||e.getSelectedRange().getCell().isEditAllowed()),A=Me()===`touch`,j=A&&t&&!w&&D<=1,M=k&&!A&&(!x||T||E),N=x&&Xs.has(x.key)?x.cursor:void 0,P=X.useMemo(()=>{if(!A)return;let e=Math.max(2,Math.round(2*_e.getDevicePixelRatio()));return{border:{alignWidth:e},inner:{alignWidth:e}}},[A]),F=(0,X.useRef)(null),I=e=>F.current?{...e,cancel:F.current}:e,L=G((e,t,n,r)=>{F.current=r,c.setMode(I(Zs(n)))},[c]),R=G((e,t,n,r)=>{c.setMode(I(Zs(r)))},[c]),ee=G(()=>{F.current=null,c.setMode(null)},[c]),B=(t,n,r)=>{let i=e.getRange(t).getMerges(),a=(C.isSingleCell(t)||i.length===1&&C.isEqualRanges(i[0],t)?e.getRange({rowIndex:n.rowStart,colIndex:n.colStart}).getMerges().find(e=>!C.isRangeWithinRange(e,t)):void 0)??n;return{to:a,refused:e.getRange(a).getMerges().some(e=>!C.isRangeWithinRange(e,a)&&(!r||C.isRangeWithinRange(e,t)))}},V=G((t,n)=>n.insert?!e.getRange(n.to).canInsertFrom(t,{isCut:!n.copy,axis:n.insert}):B(t,n.to,!n.copy).refused,[e]),H=G((e,t)=>B(e,t.to,!t.copy).to,[e]),U=G(async(t,n)=>{let r=await a?.showBusy?.(o(`op.autoFill`));try{await e.doBatch(()=>{e.getRange(t).autoFill(n,{snap:!0}),e.getRange(n).autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:S(`op.autoFill`),autoSelect:!0})}catch(e){a?.showError?.(e)}finally{r?.()}},[e,a]),W=G((t,n)=>e.getRange(t).autoFill(n,{preview:!0,snap:!0}).getCoords(),[e]),te=G((e,t,n)=>{F.current=n},[]),ne=G(()=>{c.setMode(I(Ys))},[c]),re=(0,X.useRef)(null),ie=G((t,n,r)=>{let i=Hs[n],a=e.getRange(t).getExtended(i,{basis:`content`,fromBlank:`before`}).getCoords();if(C.isEqualRanges(a,t))return;if(r.shiftKey)return void e.getRange(a).select();let o=e.getSelectedCell().getCoords(),s=n===`top`||n===`bottom`;e.getRange(s?{rowIndex:n===`top`?a.rowStart:a.rowEnd,colIndex:o.colIndex}:{rowIndex:o.rowIndex,colIndex:n===`left`?a.colStart:a.colEnd}).select()},[e]),ae=G(t=>e.getRange(t).getExtended(Y.Direction.Down,{basis:`adjacent`}).getCoords(),[e]),oe=G(()=>{F.current=null,c.setMode(null),re.current=null},[c]),se=G((t,r,i,o)=>{if(!n)return;let s=Bs({sheet:e,template:t,destination:r,notifier:a,onSettled:o});if(!s)return o(),void U(t,r);n({clientX:i.clientX,clientY:i.clientY,originalEvent:i},s)},[e,a,n,U]),ce=G(async(t,n,r,i)=>{if(C.isEqualRanges(t,n))return;let s=!i.copy,c=!!i.insert,l=e.getRange(n);if(!c&&a?.showOptions&&l.getDifferences(t,{ignoreSpilled:!0})?.isContentful()&&await a.showOptions({title:o(`dialog.confirm.title`),description:o(`selection.replaceData`),options:[{id:`Replace`,label:()=>o(`selection.replace`)},`Cancel`],defaultOption:`Replace`})!==`Replace`)return void h.setSelection({cell:{rowIndex:t.rowStart,colIndex:t.colStart},rangeIndex:0,ranges:[t]});let u=S(c?s?`op.insertMovedCells`:`op.insertCopiedCells`:s?`op.moveCells`:`op.copyCells`),d=await a?.showBusy?.(o(u));try{let n=e.getRange(t);await l.doBatch(async()=>{c?await l.insertFrom(t,{isCut:s,axis:i.insert,undoRange:n}):await l.copyFrom(t,{isCut:s,undoRange:n}),n.autoFit({skipCustomSize:!0,axes:Y.AxisSelection.Row,minContent:!0}),l.autoFit({skipCustomSize:!0,axes:Y.AxisSelection.Row,minContent:!0})},{description:u,autoSelect:!0})}catch(e){a?.showError?.(e)}finally{d?.()}},[e,a,h]);return(0,Z.jsxs)(fe.CommandScopeProvider,{spec:{scopeName:{key:`layer:selection`,name:`selection`},contributor:{dynamic:Vs},data:f},order:Ht().zIndex,children:[(0,Z.jsx)(qe,{className:Q(r,`selection`),selection:h,...i,singleStyle:P,getContentBounds:_,getRegionBounds:v,scrollIntoView:y,enabledMove:k,onMove:ce,isDropRefused:V,snapMoveDestination:H,onMoveStart:L,onMoveUpdate:R,onMoveEnd:ee,moveCursor:N,enableFill:M,snapFillDestination:W,onFill:U,onFillStart:te,onFillPreview:ne,onFillEnd:oe,onFillMenu:n?se:void 0,resolveFillExtent:ae,onEdgeDoubleClick:ie,onSelectionEnd:m,onDragModeChange:g,externalDrag:b,renderTip:t=>{if(t.kind===`select`){let{range:n}=t,r=e.getEntireRange().getCoords(),i=n.rowEnd-n.rowStart+1,a=n.colEnd-n.colStart+1,s=n.rowStart<=r.rowStart&&n.rowEnd>=r.rowEnd;return s===(n.colStart<=r.colStart&&n.colEnd>=r.colEnd)?i===1&&a===1?null:o(`selection.tip.size`,{rows:i,cols:a}):s?a===1?null:o(`selection.tip.columns`,{cols:a}):i===1?null:o(`selection.tip.rows`,{rows:i})}return t.kind===`move`?e.getRange(t.to).getAddress():((t,n)=>{if(C.isRangeWithinRange(n,t))return null;let r=[t.rowStart,t.colStart,t.rowEnd,t.colEnd,n.rowStart,n.colStart,n.rowEnd,n.colEnd].join(`,`);if(re.current?.key===r)return re.current.text;let i=null;try{let r=Ws(t,n),a=e.getRange(t).autoFill(n,{preview:!0,snap:!0}),o=a.getCell({rowIndex:r===Y.Direction.Up?n.rowStart:n.rowEnd,colIndex:r===Y.Direction.Left?n.colStart:n.colEnd}),s=o.getSpans(),c=s.width>1||s.height>1?o.getExtrusions():null,l=c?a.getCell({rowIndex:c.rowStart,colIndex:c.colStart}):o;l.isEmpty()||(i=l.getText({hideStringPrefix:!0})||null)}catch(e){a?.showError?.(e)}return re.current={key:r,text:i},i})(t.template,t.destination)},disableKeyboard:d,ref:u}),j&&(0,Z.jsx)(ft,{selection:h})]})};Us.displayName=`SheetSelectionLayer`;var Ws=(e,t)=>t.rowEnd>e.rowEnd?Y.Direction.Down:t.rowStart<e.rowStart?Y.Direction.Up:t.colEnd>e.colEnd?Y.Direction.Right:Y.Direction.Left,Gs={key:`dragCut`,description:S(`editMode.dragCut`),cursor:`move`},Ks={key:`dragCutInsert`,description:S(`editMode.dragCutInsert`),cursor:`move`},qs={key:`dragCopy`,description:S(`editMode.dragCopy`),cursor:`copy`},Js={key:`dragCopyInsert`,description:S(`editMode.dragCopyInsert`),cursor:`copy`},Ys={key:`fill`,description:S(`editMode.fill`),cursor:`crosshair`},Xs=new Set([Gs,Ks,qs,Js].map(e=>e.key)),Zs=e=>e.copy?e.insert?Js:qs:e.insert?Ks:Gs,Qs=(e,t)=>Object.assign(Object.create(e),{setSelection:n=>{let r=e.getSelection(),i=n.ranges,a=n.rangeIndex??-1;i&&a>=0&&a<i.length&&i[a]&&i[a]!==r?.ranges?.[a]&&i[a].scope!==t&&(n={...n,ranges:i.map((e,n)=>n===a?{...e,scope:t}:e)}),e.setSelection(n)}});function $s(e){let{sheet:t,sheetView:n,className:r,onKeyDown:i,...a}=e,o=ga(),s=o.getMode(),c=s?.selection??null,l=c?.getWorksheet().getName(),u=t.getName(),d=l===u,f=!!s?.scope&&s.scope!==u,p=Li(t,(n?.isShowFormulas()??!1)&&!c),m=(0,X.useMemo)(()=>{if(!p||!p.ranges.some(Boolean))return null;let e=t.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return e.updateCoords({cell:{rowIndex:p.coords.rowIndex,colIndex:p.coords.colIndex,scope:u},ranges:p.ranges,rangeIndex:-1}),new Ls(e)},[t,p,u]),h=G((e,t)=>{o.setMode(n=>n&&{...n,dragging:e,draggingIndex:e&&t!==null?t:void 0})},[]),g=G(e=>{if(i?.(e),e.defaultPrevented)return;let t=o.getMode();if(t?.mode!==`point`||t.scope&&t.scope!==u||Ua(e,t,u))return;if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)){if(!t.activeInput||e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),t.activeInput.toggleReferences();return}if(!t.onDone)return;let n=e.key;n!==`Enter`&&n!==`Tab`&&n!==`Escape`||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||(e.preventDefault(),e.stopPropagation(),t.onDone({reason:n===`Escape`?`cancel`:`accept`,key:n,shiftKey:e.shiftKey,altKey:e.altKey}))},[i,u]),_=(0,X.useMemo)(()=>c?Qs(new Ls(c),u):null,[c,u]),v=Re(_,e=>e.getSelection()),y=e=>!!e&&(e.scope===void 0&&d||e.scope===u),b=!!v?.ranges?.some(y),x=!f&&s?.mode===`point`,S=b||x;if(!s)return!m||!p?null:(0,Z.jsx)(Ct,{className:Q(r,`reference-picker`,`formula-view`),selection:m,getRangeStyle:(e,t)=>{let n=p.ranges[e];return n&&n.scope===u?vt(e):null},...a,animated:!1,disableDraw:!0,allowMulti:!1,anchors:ec,onKeyDown:i});if(!_||!v||!S)return null;let C=!0===s?.readOnly;return(0,Z.jsx)(Ct,{className:Q(r,`reference-picker`,C?`read-only`:void 0),selection:_,getRangeStyle:(e,t)=>{let n=v.ranges?.[e];return n&&y(n)?vt(e):null},...a,animated:!C&&(v.rangeIndex??-1)>=0,enabledMove:!C,anchors:C?ec:void 0,disableDraw:!x||C,allowMulti:!1!==s?.allowMulti,onDragActiveChange:h,onKeyDown:g})}$s.displayName=`SheetReferenceLayer`;var ec=[],tc=Object.freeze([]),nc=e=>{let t=zt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n]);o(e,{onTablesChange:()=>r(),onAutoTableChange:()=>r(),onLayoutChange:()=>r(),onInvalidated:()=>r()},rc);let a=t.getVisibleRange(),s=(0,X.useMemo)(()=>{if(!a)return tc;let t=e.getTables().getItems({address:a});return t.length>0?t:tc},[e,a?.rowStart,a?.colStart,a?.rowEnd,a?.colEnd,n]);return(0,X.useEffect)(()=>{if(s.length===0)return;let e=s.map(e=>e.addListeners({onAnyChange:()=>r()},ic));return()=>{for(let t of e)t?.()}},[s]),{visibleTables:s,cacheToken:i}},rc={transactional:!1,ignoreModelChange:!0},ic={transactional:!1},ac=Object.freeze([Xn.Feature.Borders,Xn.Feature.Fill,Xn.Feature.NumberFormat,Xn.Feature.DateFormat,Xn.Feature.AutoTable,Xn.Feature.Table,Xn.Feature.Pivot,Xn.Feature.Merge,Xn.Feature.Hyperlink,Xn.Feature.IgnoredErrors,Xn.Feature.Comments,Xn.Feature.Unlock,Xn.Feature.Formula,Xn.Feature.Spills,Xn.Feature.CalcStatus,Xn.Feature.CalcError,Xn.Feature.Circular,Xn.Feature.DataValidations,Xn.Feature.Conditionals,Xn.Feature.CellControl]),oc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:ac},sc=(e,t)=>{let n=zt(),r=t?.showFormulas??!1,i=t?.showZeros??!0,a=t?.contentOnly??!1,[s,c]=(0,X.useReducer)(e=>e+1,0),l=(0,X.useMemo)(()=>({}),[s,r,i,a]),u=(0,X.useRef)(new Map),d=(0,X.useRef)({showFormulas:r,showZeros:i,contentOnly:a});d.current.showFormulas===r&&d.current.showZeros===i&&d.current.contentOnly===a||(d.current={showFormulas:r,showZeros:i,contentOnly:a},u.current.clear());let f=n.getVisibleRange();ar(e,(0,X.useMemo)(()=>f?{rowStart:f.rowStart,colStart:f.colStart,rowEnd:f.rowEnd,colEnd:f.colEnd}:null,[f?.rowStart,f?.colStart,f?.rowEnd,f?.colEnd]),e=>{e.getTrigger()===`data`&&(u.current.clear(),c())},cc);let p=()=>{u.current.clear(),c()};return o(e,{onStyleChange:p,onLayoutChange:p},{ignoreModelChange:!0}),{getVisibleCells:G((t,n)=>{let o=u.current,s=n??t.getVisibleRange();if(!s)return[];let c=`${s.rowStart}:${s.colStart}:${s.rowEnd}:${s.colEnd}`,l=o.get(c);if(l)return l;let d=[];return e.getRange(s).forEach((e,t)=>{let n=t.getCoords(),o=t.getCell();if(!(e=>{if(e.isEmpty())return!1;if(a){let t=e.getConditionalDecorations();if(!1===t.dataBar?.showValue||!1===t.iconSet?.showValue)return!1}let t=e.getSpans();if(t.width>1||t.height>1||!a&&e.getStyle().hasVisibleStyling()||r&&e.getFormula()!==null)return!0;let n=e.getValue();return!(!a||n!==null||r||!e.getControl()?.isAccepted(n))||n!==null&&!(!i&&n===0&&e.getType()===wn.Number)})(o))return;let s=r?null:o.getExtrusions();d.push({cell:n,value:o,range:s??void 0})},oc),o.set(c,d),o.size>12&&o.delete(o.keys().next().value),d},[e,r,i,a]),cacheToken:l}},cc={transactional:!1,anchor:Dn.Type.Absolute},lc=(e,t)=>{let n=zt(),[r,i]=(0,X.useReducer)(e=>e+1,0),a=(0,X.useMemo)(()=>({}),[r,t,e]),s=(0,X.useRef)(new Map),c=G(()=>{s.current.clear(),i()},[]);o(e,{onStyleChange:c,onLayoutChange:c,onProtectionChange:c});let l=n.getVisibleRange();return ar(e,(0,X.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.getTrigger()===`data`&&c()},uc),{getRegions:G((n,r)=>{let i=r??n.getVisibleRange();if(!i)return[];let a=s.current,o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,c=a.get(o);if(c)return c;let l=[...e.getRange(i).getRegions(t)];return a.set(o,l),a.size>12&&a.delete(a.keys().next().value),l},[e,t]),cacheToken:a}},uc={transactional:!1,anchor:Dn.Type.Absolute},dc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:ac},fc=(e,t)=>{let n=zt(),[r,i]=(0,X.useReducer)(e=>e+1,0),a=(0,X.useMemo)(()=>({}),[r,t]),s=(0,X.useRef)(new Map),c=G(()=>{s.current.clear(),i()},[]);o(e,{onConditionalFormatsChange:c},{ignoreModelChange:!0});let l=n.getVisibleRange();return ar(e,(0,X.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.getTrigger()===`data`&&c()},mc),{getVisibleDecorations:G((n,r)=>{let i=s.current,a=r??n.getVisibleRange();if(!a)return pc;let o=`${a.rowStart}:${a.colStart}:${a.rowEnd}:${a.colEnd}`,c=i.get(o);if(c)return c;let l=e.getRange(a),u=pc;if(l.getConditionalFormats().length>0){let e=[];l.forEach((n,r)=>{let i=r.getCell(),a=i.getConditionalDecorations();if(!a[t])return;let o=i.getSpans(),s=o.width>1||o.height>1?i.getRange().getCoords():void 0;e.push({cell:r.getCoords(),value:i,range:s,decorations:a})},dc),e.length>0&&(u=e)}return i.set(o,u),i.size>12&&i.delete(i.keys().next().value),u},[e,t]),cacheToken:a}},pc=[],mc={transactional:!1,anchor:Dn.Type.Absolute},hc=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,className:i,style:a,...o}=e,c=zt();s(n,[`onStyleChange`,`onLayoutChange`]);let l=G(r,[r]),u=c.getPaneBounds();if(u.width===0||u.height===0)return null;if(!c.toClipBounds(c.getBoundsFromRange(),-3))return;let d=l(c),f=d?d.length:0;if(f===0)return;let p=null,m=null,h=c.getVisibleRange();for(let e=0;e<f;e++){let t=d[e],r=t.cell;if(!r)continue;let i=t.value,a=t?.range;if(a){let e=i.getSpans();e.height===1&&e.width===1&&(a=null)}let o=i;if(a){let e=`${a.rowStart}:${a.colStart}`;if(m?.has(e))continue;(m??=new Set).add(e),i.isTopLeft()||(o=n.getRange({rowIndex:a.rowStart,colIndex:a.colStart}).getCell())}let s=a?{...a}:C.cellToRange(r);if(!C.isRangesIntersect(s,h)&&!C.isRangeWithinRange(s,h))continue;let c=o.getStyle().getFill();c.hasVisibleStyling()&&(s.value=c,p||=[],p.push(s))}if(!p)return;let g=C.mergeRangeCoordValues(p,2,(e,t)=>{let n=e[0].value,r=e[1].value;if(n.isEqual(r))return t}),_=[],v=g.length;for(let e=0;e<v;e++){let t=g[e],n=t.value,r=n.getType()===dn.Type.Pattern?n.toCSSMask(`adaptive`):null,i,a=null;if(r)i=r.base,a=(0,Z.jsx)(`div`,{className:`cell-fill-marks`,style:{position:`absolute`,inset:0,...r.marks}});else{let e=c.getBoundsFromRange(t);i=n.toCSS(`adaptive`,e)}_.push((0,Z.jsx)(ct,{className:`cell-fill`,range:t,clipInsets:-10,coverGridlines:!0,style:{pointerEvents:`none`,...i},children:a},`fill-${e}`))}return(0,Z.jsx)(et,{...o,className:Q(i,`fills`),children:(0,Z.jsx)(ct,{fill:!0,ref:t,className:`fills-box`,style:{pointerEvents:`none`,overflow:`visible`,...a},children:_})})})),gc=(e,t)=>{let n=Nn.cellToString(e)??``;return e.scope&&e.scope!==t?Nn.sheetAndRangeToString(Nn.sheetNameToString(e.scope)??e.scope,n):n},_c=(e,t)=>{let n=t.scope,r=e;if(n&&n!==e.getName())try{r=e.getWorkbook()?.getWorksheet(n)??null}catch{r=null}return r?r.getRange({rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}).select({scrollIntoView:!0}):null},vc=(e,t)=>{let n=ga();(0,X.useEffect)(()=>{if(!e||!t||n.getMode())return;let r=t.getMembers();if(r.length===0)return;let i=r.map(t=>({rowStart:t.rowIndex,rowEnd:t.rowIndex,colStart:t.colIndex,colEnd:t.colIndex,scope:t.scope??e.getName()})),a=e.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return a.updateCoords({cell:{rowIndex:i[0].rowStart,colIndex:i[0].colStart,scope:i[0].scope},ranges:i,rangeIndex:-1}),n.setMode({mode:`show`,selection:a,activeInput:null,readOnly:!0}),()=>{n.setMode(e=>e?.selection===a?null:e)}},[e,t,n])},yc=`_panel_14jxb_5`,bc=`_search_14jxb_16`,xc=`_values_14jxb_24`,Sc=`_empty_14jxb_28`,Cc=e=>{let{items:t,currentText:n,onChoose:r,minWidth:i,search:a=!1,onClose:o,style:s,className:c,measureText:l,viewport:u,visibleRows:d}=e,f=z(),p=We(),m=(0,X.useRef)(null),[h,g]=(0,X.useState)(``),_=(0,X.useMemo)(()=>a?At(t,h):t,[t,h,a]),v=(0,X.useMemo)(()=>n==null?0:Math.max(0,_.findIndex(e=>e.text===n)),[_,n]),y=G((e,t)=>{r(t)},[r]),b=(0,X.useCallback)(e=>{let t=m.current;t&&(e.which===he.Down||e.which===he.Up?(e.preventDefault(),t.moveHighlight(e.which===he.Down?1:-1)):e.which===he.Enter&&(e.preventDefault(),t.chooseHighlighted()))},[]),x=a?(0,Z.jsx)(Mt,{className:bc,value:h,onChange:g,onClose:o,onKeyDown:b,placeholder:f(`picker.search`),clearLabel:f(`picker.clearSearch`),autoFocus:!0}):null;return(0,Z.jsxs)(`div`,{className:Q(yc,`cell-picker`,c),style:{minWidth:i,...s},...Be(`grid`,p),children:[x,_.length===0?(0,Z.jsx)(`div`,{className:Sc,children:f(h?`picker.noMatches`:`picker.noValues`)}):(0,Z.jsx)(mt,{ref:m,className:xc,items:_,highlightIndex:v,onChoose:y,measureText:l,viewport:u,visibleRows:d,autoFocus:!a})]})};Cc.displayName=`PickerPanel`;var wc=null,Tc=new Set,Ec=e=>(Tc.add(e),()=>{Tc.delete(e)}),Dc=e=>{wc!==e&&(wc=e,Tc.forEach(e=>e()))},Oc=e=>(0,X.useSyncExternalStore)(Ec,()=>wc===e,()=>!1),kc={placement:`bottom-end`,offsets:[0,1]},Ac=(e,t,n)=>{let r=e.getSession();if(r)return!!C.isEqualCells(r.getCoords(),t)&&(r.setDirty(n),e.commit());if(!e.startEdit(t,{dirty:n,autoFocus:!1}))return!1;let i=()=>{let t=xa();return e.cancel(),t&&ba(t),!1},a=e.commit();return!0===a||(!1===a?i():a.then(e=>e||i()))},jc=e=>{let{sheet:t,editable:n,resolveItems:r,getCurrentText:i,onChoose:a,search:o,visibleRows:s,label:c=`cell-picker`}=e,[l,u]=(0,X.useState)(null),d=l?.cell??e.cell,f=l?l.anchor:e.anchor,p=l?l.minWidth:e.minWidth,[m,h]=(0,X.useState)([]),[g,_]=(0,X.useState)(null),v=(0,X.useRef)(0),y=(0,X.useMemo)(()=>t.getStyles().getNormal().getFont().toCSS(`adaptive`),[t]),b=(0,X.useMemo)(()=>d?{rowIndex:d.rowIndex,colIndex:d.colIndex,scope:t.getName()}:null,[d,t]),x=G(e=>{b&&(a?a(e,b):n&&Ac(n,b,e.text))},[n,b,a]),S=(0,X.useCallback)(e=>{let{closeFloat:t}=e;return(0,Z.jsx)(Cc,{items:m,currentText:g,minWidth:p,search:o,visibleRows:s,style:y,onChoose:e=>{x(e),t?.()},onClose:()=>t?.()})},[m,g,p,o,s,y,x]),C=G(()=>Dc(t),[t]),w=G(()=>Dc(null),[]);(0,X.useEffect)(()=>()=>Dc(null),[]);let T=pe({label:c,anchor:f,autoFocus:!1,propsPopper:kc,renderFloatPanel:bt,renderPopupPanel:S,onOpen:C,onClose:w}),E=T.reference,D=G(async n=>{let a=n?.cell??e.cell;if(!a)return;let o=++v.current,s=await r(a);o===v.current&&(u(n??null),h(s),_(i?i(a):t.getCell(a).getText({hideStringPrefix:!0})),E.open(0))},[e.cell,r,i,t,E]);return{component:T.component,open:D,close:G(()=>{v.current++,E.close(0)},[E]),isOpen:T.isOpen}},Mc={side:`b`,align:`start`},Nc=(e,t,n=6)=>e.getBoundsFromRange(t).width+n,Pc=`_prompt_3wjdi_8`,Fc=`_line_3wjdi_24`,Ic=`_title_3wjdi_28`,Lc=`_message_3wjdi_28`,Rc=`_alert_3wjdi_34`,zc=`_alertRow_3wjdi_52`,Bc=`_alertIcon_3wjdi_58`,Vc=`_alertTitle_3wjdi_63`,Hc=`_alertHint_3wjdi_67`,Uc=(e,t)=>{let n=e.getCell({rowIndex:t.rowIndex,colIndex:t.colIndex}),r=n.getSpans();return r.width>1||r.height>1?n.getRange().getCoords():C.cellToRange(n.getCoords())},Wc=(e,t)=>{if(e.getDataValidations().getSettings().disablePrompts)return null;let n=e.getRange(C.cellToRange(t)).getDataValidations();for(let r=0;r<n.length;r++){let i=n[r];if(!i.isShowPromptMessage())continue;let a=i.getPromptTitle()??``,o=i.getPromptMessage()??``;if(a||o)return{range:Uc(e,t),title:a,message:o,dataValidation:i}}return null},Gc=(e,t,n)=>{if(!t)return null;let r=e.getStyles().getNormal().createStyle({font:{family:`Segoe UI`,size:11,weight:n?700:400},alignment:{horizontal:J.HorizontalAlignment.Left,overflow:J.Overflow.Wrap}}),i=r.createTextFrame(t,!0).layout({width:170}),a=i.lines.map(e=>({text:e.runs.map(e=>e.text).join(``).trimEnd(),height:e.bounds.height})),o=r.getFont().toCSS();return{lines:a,width:i.textBounds.width,font:{fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontStyle:o.fontStyle,letterSpacing:o.letterSpacing}}},Kc=e=>{let{sheet:t,prompt:n,floatProps:r}=e,i=(0,X.useMemo)(()=>Gc(t,n.title,!0),[t,n.title]),a=(0,X.useMemo)(()=>Gc(t,n.message,!1),[t,n.message]),o=Math.ceil(Math.max(i?.width??0,a?.width??0)),s=(e,t)=>e?(0,Z.jsx)(`div`,{className:t,style:e.font,children:e.lines.map((e,t)=>(0,Z.jsx)(`div`,{className:Fc,style:{height:e.height,lineHeight:`${e.height}px`},children:e.text},t))}):null;return(0,Z.jsxs)(`div`,{...r,className:Pc,style:{...r.style,width:o},role:`note`,children:[s(i,Ic),s(a,Lc)]})},qc=e=>{let{alert:t,floatProps:n}=e,r=z(),i=t.dataValidation,a=i.getAlertTitle(),o=i.getAlertMessage()||r(`validationAlert.default`),s=t.style===Fn.AlertStyle.Stop?r(`validationAlert.hint.stop`):t.style===Fn.AlertStyle.Warning?r(`validationAlert.hint.warning`):null;return(0,Z.jsx)(`div`,{...n,className:Rc,style:{...n.style,borderLeftColor:Qc[t.style]},role:`alert`,children:(0,Z.jsxs)(`div`,{className:zc,children:[(0,Z.jsx)(`span`,{className:Bc,children:(0,Z.jsx)(j,{iconKey:$c[t.style],size:14,ariaHidden:!0})}),(0,Z.jsxs)(`div`,{children:[a?(0,Z.jsx)(`div`,{className:Vc,children:a}):null,(0,Z.jsx)(`div`,{children:o}),s?(0,Z.jsx)(`div`,{className:Hc,children:s}):null]})]})})},Jc=(0,X.memo)(e=>{let{sheet:t,editable:n,offset:r=6,renderPrompt:i,renderAlert:a,className:o,style:s,...c}=e,l=(0,X.useMemo)(()=>new Ls(t.getSelection()),[t]),u=zt(),d=Oc(t),f=Sa(t);(0,X.useEffect)(()=>{if(!f)return;let e=()=>{let e=n?.getSession()??null;e&&C.isEqualCells(e.getCoords(),f.coords)||ba(null)};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`pointerdown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`pointerdown`,e,!0)}},[f,n]);let p=G((e,n)=>{let i=Wc(t,e);return i?{range:i.range,key:`prompt:${i.range.rowStart},${i.range.colStart}:${i.dataValidation.getIndex()}`,data:{prompt:i},alignOffset:Nc(n,i.range,r)}:null},[t]),m;if(f){let e=Uc(t,f.coords);m={range:e,key:`alert:${e.rowStart},${e.colStart}:${f.dataValidation.getIndex()}:${f.style}`,data:{alert:f},alignOffset:Nc(u,e,r)}}return(0,Z.jsx)(at,{...c,className:Q(o,`validation-prompt`,f&&`validation-alert`),style:s,activateOn:`selection`,selection:l,probe:p,target:m,placement:Mc,offset:r,whenOff:`hide`,interactive:`pointer`,dismiss:d,children:({data:e,floatProps:n})=>e.alert===void 0?i===void 0?(0,Z.jsx)(Kc,{sheet:t,prompt:e.prompt,floatProps:n}):(0,Z.jsx)(xe,{render:i,props:{prompt:e.prompt,floatProps:n}}):a===void 0?(0,Z.jsx)(qc,{alert:e.alert,floatProps:n}):(0,Z.jsx)(xe,{render:a,props:{alert:e.alert,floatProps:n}})})});Jc.displayName=`ValidationPromptLayer`;var Yc=(e,t,n)=>{let r=null,i=null,a=0;for(let o=0;o<e.length;o++){let s=e[o];s.getAlertAt(t,n)&&(a++,i??=s,!r&&s.isShowAlertMessage()&&(r=s))}return i?r?{state:r.getAlertStyle(),rule:r,others:a-1}:{state:`failed`,rule:i,others:a-1}:null},Xc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Zc={...Xc,includeEmpty:!0},Qc={failed:`var(--sxl-color-neutral, #9ca3af)`,[Fn.AlertStyle.Information]:`var(--sxl-color-info, #3b82f6)`,[Fn.AlertStyle.Warning]:`var(--sxl-color-warning, #f59e0b)`,[Fn.AlertStyle.Stop]:`var(--sxl-color-error, #ef4444)`},$c={failed:`ValidationFailed`,[Fn.AlertStyle.Information]:`ValidationInformation`,[Fn.AlertStyle.Warning]:`ValidationWarning`,[Fn.AlertStyle.Stop]:`ValidationStop`},el=({sheet:e,cycle:t})=>(vc(e,t),null),tl={error:`var(--sxl-color-error, #d32f2f)`,warning:`var(--sxl-color-warning, #ed6c02)`,circular:`var(--sxl-color-error, #d32f2f)`,validation:`var(--sxl-color-error, #d32f2f)`},nl={failed:`var(--sxl-color-neutral, #9e9e9e)`,information:`var(--sxl-color-info, #0288d1)`,warning:`var(--sxl-color-warning, #ed6c02)`,stop:`var(--sxl-color-error, #d32f2f)`},rl=e=>({boxSizing:`border-box`,maxWidth:320,padding:`8px 12px`,fontSize:`var(--sxl-font-size, 13px)`,lineHeight:1.45,color:`var(--sxl-color-base-content, rgba(0, 0, 0, 0.87))`,background:`var(--sxl-color-elevated, #ffffff)`,border:`1px solid var(--sxl-color-base-border, rgba(0, 0, 0, 0.26))`,borderLeft:`4px solid ${e}`,borderRadius:4,boxShadow:`0 4px 16px var(--sxl-color-shadow, rgba(0, 0, 0, 0.2))`,whiteSpace:`pre-line`,cursor:`default`}),il=e=>({fontWeight:600,color:e}),al=new Map([[Cn.Code.Parse,S(`cellError.description.parse`)],[Cn.Code.Null,S(`cellError.description.null`)],[Cn.Code.Div0,S(`cellError.description.div0`)],[Cn.Code.Value,S(`cellError.description.value`)],[Cn.Code.Ref,S(`cellError.description.ref`)],[Cn.Code.Name,S(`cellError.description.name`)],[Cn.Code.Num,S(`cellError.description.num`)],[Cn.Code.NA,S(`cellError.description.nA`)],[Cn.Code.GettingData,S(`cellError.description.gettingData`)],[Cn.Code.Spill,S(`cellError.description.spill`)],[Cn.Code.Connect,S(`cellError.description.connect`)],[Cn.Code.Blocked,S(`cellError.description.blocked`)],[Cn.Code.Unknown,S(`cellError.description.unknown`)],[Cn.Code.Field,S(`cellError.description.field`)],[Cn.Code.Calc,S(`cellError.description.calc`)],[Cn.Code.Busy,S(`cellError.description.busy`)],[Cn.Code.Python,S(`cellError.description.python`)],[Cn.Code.Timeout,S(`cellError.description.timeout`)]]),ol={opacity:.75,marginTop:2},sl={display:`inline-flex`,marginTop:2},cl={display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:8,overflow:`hidden`},ll={padding:0,border:0,background:`none`,color:`inherit`,font:`inherit`,textDecoration:`underline`,cursor:`pointer`},ul=(0,X.memo)(e=>{let{sheet:t,placement:n=Mc,offset:r=6,alignOffset:i,openDelay:a,closeDelay:o,renderTip:s,className:c,...l}=e,u=Fe(),d=u.getMode()?.key===`edit`,f=z(),p=e=>{let n=u.getMode();if(n?.key===`edit`){let r=n.args?.editable.getSession()?.getState().coords;if(r&&C.isEqualCells({...r,scope:r.scope??t.getName()},{...e,scope:t.getName()}))return null}let r=t.getCell(e),i=r.getRange().getCoords(),a=r.getErrors();if(a.length){let e=r.getValue();if(Cn.isError(e)){let t=r.getText(),n=e.message||a.filter(t=>String(t)!==String(e)).join(`
|
|
7
|
+
`),o=al.get(e.getCode());return{range:i,data:{kind:`error`,message:n,code:t,description:o?f(o):void 0}}}return{range:i,data:{kind:`error`,message:a.join(`
|
|
8
|
+
`)}}}let o=r.getCircularReference();if(o){let e=r.getCoords();return{range:i,data:{kind:`circular`,message:r.getWarnings().join(`
|
|
9
|
+
`),cycle:o,path:o.getPath({rowIndex:e.rowIndex,colIndex:e.colIndex,scope:t.getName()}),representative:o.getRepresentative()}}}let s=((e,t)=>{if(!e.getView().isShowInvalid())return null;let n=e.getCell(t),r=n.getCoords(),i=n.getSpans(),a=i.width>1||i.height>1?n.getRange().getCoords():C.cellToRange(r),o=e.getRange(a).getDataValidations();if(o.length===0)return null;let s=Yc(o,r.rowIndex,r.colIndex);if(!s)return null;let c=e.getSelectedCell().getCoords();if(c.rowIndex===r.rowIndex&&c.colIndex===r.colIndex&&Wc(e,r))return null;let l=s.rule,u=s.state===`failed`?[]:[l.getAlertTitle(),l.getAlertMessage()].filter(e=>!!e);return{range:a,message:u.length>0?u.join(`
|
|
10
|
+
`):l.getCondition()?.toString()??``,mark:s}})(t,e);if(s)return{range:i,data:{kind:`validation`,message:s.message,validation:s.mark}};let c=r.getWarnings();return c.length?{range:i,data:{kind:`warning`,message:c.join(`
|
|
11
|
+
`)}}:null},m=G((e,t)=>{let n=p(e);return n&&i===void 0?{...n,alignOffset:Nc(t,n.range,r)}:n},[t,u,f,i,r]),h=e=>{let t=e.validation;return(0,Z.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`flex-start`},children:[(0,Z.jsx)(`span`,{style:sl,children:(0,Z.jsx)(j,{iconKey:$c[t.state],size:14,ariaHidden:!0})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{style:cl,children:e.message}),t.others>0?(0,Z.jsx)(`div`,{style:{opacity:.8},children:f(`validationTip.more`,{count:t.others})}):null]})]})},g=(e,n,r,i)=>{let a=t.getName(),o=gc(e,a);return e.rowIndex===n.rowStart&&e.colIndex===n.colStart&&(e.scope??a)===a?(0,Z.jsx)(`span`,{style:i?{color:i}:void 0,children:o},r):(0,Z.jsx)(`button`,{type:`button`,style:i?{...ll,color:i}:ll,onMouseDown:e=>e.preventDefault(),onClick:()=>{_c(t,e)},children:o},r)},_=(e,t)=>{let n=t.path,r=(e=>{if(!e||gt.length===0)return()=>{};let t=e.getMembers();return e=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.rowIndex===e.rowIndex&&r.colIndex===e.colIndex&&(r.scope??null)===(e.scope??null))return gt[n%gt.length]}}})(t.cycle);if(n&&n.length>0){let i=[];for(let t=0;t<n.length;t++)t>0&&i.push(` → `),i.push(g(n[t],e,t,r(n[t])));return i.push(` → `,g(n[0],e,`back`,r(n[0]))),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{children:i}),v(t)]})}let i=t.representative;return i?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{children:[f(`circular.reads`),` `,g(i,e,`rep`,r(i))]}),v(t)]}):(0,Z.jsx)(`div`,{children:t.message})},v=e=>{let t=e.cycle;if(!t?.isIterative())return null;let n=t.getIterationCount();if(t.isConverged())return(0,Z.jsx)(`div`,{children:f(`circular.converged`,{count:n})});let r=t.getLastChange();return(0,Z.jsx)(`div`,{children:Number.isFinite(r)?f(`circular.unconverged`,{count:n,change:r}):f(`circular.unconvergedNoChange`,{count:n})})};return(0,Z.jsx)(rt,{...l,className:Q(c,`cell-error`),interactive:!0,bubble:!1,probe:m,placement:n,offset:r,alignOffset:i,openDelay:a,closeDelay:o,dismiss:d,children:({range:e,data:n,tipProps:r,state:i})=>{let a=n.kind===`circular`&&!!n.cycle?.isConverged(),o=n.validation?nl[n.validation.state]:a?`var(--sxl-color-info, #0288d1)`:tl[n.kind],c=n.kind===`error`?n.code??f(`cellError.error`):n.kind===`warning`?f(`cellError.warning`):n.kind===`circular`?f(`circular.title`):null;return(0,Z.jsxs)(Z.Fragment,{children:[n.kind===`circular`?(0,Z.jsx)(el,{sheet:t,cycle:n.cycle}):null,s===void 0?(0,Z.jsxs)(`div`,{...r,style:{...rl(o),...r.style},children:[c?(0,Z.jsx)(`div`,{style:il(o),children:c}):null,n.kind===`circular`?_(e,n):n.kind===`validation`?h(n):(0,Z.jsxs)(Z.Fragment,{children:[n.description?(0,Z.jsx)(`div`,{children:n.description}):null,n.message?(0,Z.jsx)(`div`,{style:n.description?ol:void 0,children:n.message}):null]})]}):(0,Z.jsx)(xe,{render:s,props:{range:e,message:n.message,code:n.code,description:n.description,kind:n.kind,state:i,cycle:n.cycle,path:n.path,representative:n.representative,validation:n.validation}})]})}})});ul.displayName=`CellErrorLayer`;var dl=e=>{let t=e.getProtection();return t.isInsertHyperlinksAllowed()&&t.isFormatCellsAllowed()},fl=`_preview_d64gw_2`,pl=`_previewShown_d64gw_8`,ml=`_previewSlide_d64gw_12`,hl=`_previewClip_d64gw_16`,gl=new Map,_l=new Map,vl=(0,X.memo)(e=>{let{sheet:t,renderCard:n,preview:r,placement:i={side:`b`,align:`start`},offset:a=4,className:o,...s}=e,c=Fe().getMode()?.key===`edit`,[l]=fe.useCommands([`updateHyperlink`]),u=Se(),d=G(e=>{let n=t.getCell(e),r=n.getHyperlink();return r?{range:n.getRange().getCoords(),data:{hyperlink:r}}:null},[t]),[f]=q(Ge,null),p=(0,X.useMemo)(()=>{let e=f?.getMovable(),t=f?.getHyperlink();return f&&e&&t?{range:e.getRange().getCoords(),key:`picture:${e.getId()}:${t.getAddress()}`,data:{hyperlink:t,picture:f}}:null},[f]);return(0,Z.jsx)(rt,{...s,className:Q(o,`hyperlink-card`),probe:d,hoveredOver:p,placement:i,offset:a,interactive:!0,bubble:!1,dismiss:c,children:({range:e,data:{hyperlink:i,picture:a},tipProps:o,state:s})=>{let c={rowIndex:e.rowStart,colIndex:e.colStart},d={sheet:t,coords:c,hyperlink:i,tipProps:o,state:s,open:async()=>{await i.open()},copy:async()=>{await navigator.clipboard?.writeText(i.getAddress())},edit:()=>{a?Ke(a,t,u):(t.getRange(e).select(),l?.execute())},remove:()=>{i.delete()},disabled:i.isReadOnly()||(a?a.isReadOnly():!dl(t))};return(0,Z.jsx)(yl,{...d,lookup:r,renderCard:n===void 0?Dl:n})}})});vl.displayName=`HyperlinkLayer`;var yl=e=>{let{lookup:t,renderCard:n,...r}=e,i=((e,t)=>{let[,n]=(0,X.useState)(null);return(0,X.useEffect)(()=>{if(!t||_l.has(e))return;let r=!1,i=gl.get(e);return i||(i=Promise.resolve().then(()=>t(e)).catch(()=>null).then(t=>(_l.set(e,t),t)),gl.set(e,i)),i.then(()=>{r||n(e)}),()=>{r=!0}},[e,t]),t?_l.get(e)??null:null})(r.hyperlink.getAddress(),t);return(0,Z.jsx)(xe,{render:n,props:{...r,preview:i}})},bl=e=>{let{src:t,expectedWidth:n,width:r=`100%`,style:i}=e,[a,o]=(0,X.useState)(0),[s,c]=(0,X.useState)(null),l=(0,X.useRef)(null),[u,d]=(0,X.useState)(t);t!==u&&(d(t),o(0),c(null));let f=a===0?t:`${t}${t.includes(`?`)?`&`:`?`}retry=${a}`,[p]=(0,X.useState)(()=>new Set);(0,X.useEffect)(()=>()=>{for(let e of p)clearTimeout(e)},[p]);let m=(e,t)=>{if(n==null||e.naturalWidth===n)return void c(e=>e??t);if(a>=8)return;let r=setTimeout(()=>o(e=>e+1),1500);p.add(r)};return(0,X.useLayoutEffect)(()=>{let e=l.current;e&&e.complete&&e.naturalWidth>0&&m(e,`at-once`)},[f]),(0,Z.jsx)(`div`,{className:Q(fl,s&&pl,s===`slide`&&ml),children:(0,Z.jsx)(`div`,{className:hl,children:(0,Z.jsx)(`img`,{ref:l,src:f,alt:``,style:{display:`block`,width:r,maxWidth:`100%`,borderRadius:4,...i},onLoad:e=>m(e.currentTarget,`slide`)},a)})})},xl={display:`flex`,flexDirection:`column`,width:320,boxSizing:`border-box`,padding:8,borderRadius:`var(--sxl-radius-box, 6px)`,"--icon-size":`1.25rem`,font:`var(--sxl-font-size, 13px)/1.4 var(--sxl-font-family, system-ui, sans-serif)`,color:`var(--sxl-color-base-content, #222)`,background:`var(--sxl-color-elevated, var(--sxl-color-base-100, white))`,border:`1px solid var(--sxl-color-base-border, rgba(0,0,0,0.26))`,boxShadow:`0 4px 16px var(--sxl-color-shadow, rgba(0,0,0,0.2))`},Sl={display:`flex`,alignItems:`center`,gap:6},Cl={border:`none`,background:`transparent`,cursor:`pointer`,padding:0,margin:0,font:`inherit`,color:`inherit`,textAlign:`left`,display:`block`,width:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},wl={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`transparent`,cursor:`pointer`,padding:3,borderRadius:4,color:`inherit`,opacity:.8},Tl={...wl,cursor:`default`,opacity:.35},El=e=>{let{hyperlink:t,open:n,copy:r,edit:i,remove:a,disabled:o,preview:s,tipProps:c}=e,l=z(),u=t.getScreenTip(),d=t.getAddress(),f=()=>{n()},p=s?.title;return(0,Z.jsxs)(`div`,{...c,role:`toolbar`,style:{...xl,...c.style},children:[(0,Z.jsxs)(`div`,{style:Sl,children:[(0,Z.jsx)(`button`,{type:`button`,style:wl,title:l(`hyperlink.open`),"aria-label":l(`hyperlink.open`),onClick:f,children:(0,Z.jsx)(j,{iconKey:`HyperlinkGoto`})}),(0,Z.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[p?(0,Z.jsx)(`button`,{type:`button`,style:{...Cl,fontWeight:600,color:`var(--sxl-color-primary, #1976d2)`},title:p,onClick:f,children:p}):null,(0,Z.jsx)(`button`,{type:`button`,title:u??d,onClick:f,style:p?{...Cl,opacity:.75}:{...Cl,color:`var(--sxl-color-primary, #1976d2)`},children:u??d})]}),(0,Z.jsxs)(`div`,{style:{display:`flex`,gap:2},children:[(0,Z.jsx)(`button`,{type:`button`,style:wl,title:l(`hyperlink.copy`),"aria-label":l(`hyperlink.copy`),onClick:()=>{r()},children:(0,Z.jsx)(j,{iconKey:`ContentCopy`})}),(0,Z.jsx)(`button`,{type:`button`,style:o?Tl:wl,title:l(`hyperlink.edit`),"aria-label":l(`hyperlink.edit`),disabled:o,onClick:i,children:(0,Z.jsx)(j,{iconKey:`HyperlinkEdit`})}),(0,Z.jsx)(`button`,{type:`button`,style:o?Tl:wl,title:l(`hyperlink.remove`),"aria-label":l(`hyperlink.remove`),disabled:o,onClick:a,children:(0,Z.jsx)(j,{iconKey:`HyperlinkDelete`})})]})]}),s?.image?(0,Z.jsx)(`button`,{type:`button`,style:{...Cl,whiteSpace:`normal`},onClick:f,tabIndex:-1,children:(0,Z.jsx)(bl,{src:s.image,expectedWidth:s.imageWidth,style:{marginTop:8}})}):null]})},Dl=e=>(0,Z.jsx)(El,{...e}),Ol=e=>{let t=e.getStyles().getNormal().getBorders(),[n,r]=kl(t.getBottom(),pn.Edge.Bottom,t.getTop(),pn.Edge.Top),[i,a]=kl(t.getRight(),pn.Edge.Right,t.getLeft(),pn.Edge.Left),o=Al(n,r),s=Al(i,a),c=(0,X.useMemo)(()=>$r(n,r),[o]),l=(0,X.useMemo)(()=>$r(i,a),[s]);return(0,X.useMemo)(()=>({rows:c,columns:l}),[c,l])},kl=(e,t,n,r)=>pn.compareStrokes(e,n)>=0?[e,t]:[n,r],Al=(e,t)=>e.isNone()?``:`${e.getStyle()}|${e.getColor().toCSS(`adaptive`)}|${t}`,jl=(e,t)=>e.getStyle().getBorders(),Ml=(e,t)=>{let n=e.getSpans();return n.width===1&&n.height===1?null:e.getExtrusions()},Nl=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,bordersCache:i,className:a,...o}=e,c=zt();s(n,[`onStyleChange`,`onLayoutChange`]);let l=Ol(n),{renderLayer:u}=ei({getVisibleCells:r,getBorderAt:jl,getMergeAt:Ml,normalRows:l.rows,normalColumns:l.columns,cache:i});if(c.getPaneBounds().width===0||c.getPaneBounds().height===0)return null;let d=u?.(c);return d&&c?(0,Z.jsx)(et,{...o,className:Q(a,`borders`),children:(0,Z.jsx)(ct,{fill:!0,className:`borders-box`,style:{pointerEvents:`none`},children:d})}):null})),Pl=(0,X.memo)(e=>{let{sheet:t,sheetView:n,renderCell:r,propsCellRender:i,editable:a,onEditRejected:o,className:c,...l}=e,u=zt(),d=Se(),f=Os(t),p=o??f,m=(0,X.useSyncExternalStore)(Lr,Rr);s(n,[`onZoomScaleChange`]);let h=n.isShowFormulas(),g=n.isShowZeros(),{getVisibleCells:_,cacheToken:v}=sc(t,{showFormulas:h,showZeros:g,contentOnly:!0}),y=(0,X.useMemo)(()=>({}),[v,m]),b=(0,X.useMemo)(()=>zr({sheet:t,notifier:d,notifyEditRejected:p}),[t,d,p]),x=(0,X.useMemo)(()=>{let e=e=>{let{control:n,context:r,interactiveProps:i,Default:a,...o}=e,s=t.getStyles();return(0,Z.jsx)(lr,{docTheme:s.getTheme(),normalStyle:s.getNormal(),showFormulas:h,showZeros:g,...o})};return e.displayName=`DefaultCellContent`,e},[t,h,g]),S=G(e=>{let{value:n,key:r,...a}=e,o=n;if(!o){let n=e.range;if(!n||(o=t.getRange({rowIndex:n.rowStart,colIndex:n.colStart}).getCell(),o.isEmpty()))return null}let s=h?null:Ir(o);if(s?.entry.renderer){let e=s.entry.renderer({...a,value:o,control:s.control,context:b,interactiveProps:Et,Default:x});return(0,X.isValidElement)(e)?(0,X.cloneElement)(e,{key:r}):e}let c;o.getHyperlink()&&(c=async e=>{if(i?.onLinkClick?.(e),e.button===0&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await o.getHyperlink()?.open()}catch(e){d.showError?.(e instanceof Error?e:String(e))}}});let{onColumnButtonMouseDown:l,propsColumnButton:u,renderColumnButton:f,onPivotButtonMouseDown:p,...m}=i??{},_=t.getStyles();return(0,X.createElement)(lr,{...a,key:r,docTheme:_.getTheme(),normalStyle:_.getNormal(),showFormulas:h,showZeros:g,onLinkClick:c,...m,value:o})},[t,h,g]),C=r??S,w=Re(a,e=>e.getSession()),T=Li(t,h,y),E=w?.getCoords()??T?.coords??null,D=null;if(T&&!w){let e={rowIndex:T.coords.rowIndex,colIndex:T.coords.colIndex},t=u.getBoundsFromRange(u.getRangeFromCell(e));if(t){let e=u.getZoom()||1;D=(0,Z.jsx)(ct,{bounds:t,className:`formula-view-anchor`,style:{pointerEvents:`none`},children:(0,Z.jsx)(Ii,{cell:T.cell,tokens:T.tokens,zoom:e,size:{width:t.width/e,height:t.height/e}})})}}let O=G(e=>{l.onPointerDown?.(e),e.isPropagationStopped()||function(e,t,n){if(e.button!==0)return!1;let r=ht(e.target);if(!r)return!1;let i=t.getCell(r),a=Ir(i);a?.entry.onPress&&(e.stopPropagation(),e.preventDefault(),a.entry.onPress(i,n,e))}(e,t,b)},[l.onPointerDown,t,b]),k=G(e=>{l.onDoubleClick?.(e),!e.isPropagationStopped()&&dt(e.target)&&(e.stopPropagation(),e.preventDefault())},[l.onDoubleClick]);return D||_(u).length!==0?(0,Z.jsxs)(et,{...l,className:Q(c,`cells`),onPointerDown:O,onDoubleClick:k,children:[(0,Z.jsx)(nt,{renderCell:C,getVisibleCells:_,cacheToken:y,suppressCell:E}),D]}):null});Pl.displayName=`SheetCellLayer`;var Fl=(0,X.memo)(e=>{let{sheet:t,onColumnButtonMouseDown:n,propsColumnButton:r,renderColumnButton:i=Vi,...a}=e,{cacheToken:o}=nc(t),s=G((e,n)=>{let r=n??e.getVisibleRange();if(!r)return[];let i=t.getTables().getItems({address:r}),a=t.getAutoTable(),o=a&&a.getRange().getIntersect(r)?[...i,a]:i;if(o.length===0)return[];let s=[],c=o.length;for(let e=0;e<c;e++){let n=o[e];if(n.isDeleted())continue;let r=n.getHeaderRowRange()?.getCoords();if(!r)continue;let i=n.getColumns(),a=i.length;for(let e=0;e<a;e++){let n=i[e];if(n.isHiddenButton())continue;let a={rowIndex:r.rowStart,colIndex:r.colStart+n.getIndex()};s.push({cell:a,value:{cell:t.getRange(a).getCell(),column:n}})}}return s},[t]),c=G(e=>{let{value:t,style:a,zoom:o=1,key:s}=e,{cell:c,column:l}=t;if(!a)return null;let u={x:0,y:0,width:a.width,height:a.height},d=(0,Z.jsx)(xe,{render:i,props:{bounds:u,className:`column-button`,disabled:!c.isEditAllowed(),zoom:o,column:l,onColumnButtonMouseDown:n,...r,style:{pointerEvents:`auto`,...r?.style}}});return(0,Z.jsx)(`div`,{style:{...a,position:`absolute`,display:`flex`,alignItems:`end`},children:d},s)},[n,r,i]);return(0,Z.jsx)(Pt,{...a,className:`column-buttons`,renderCell:c,getVisibleCells:s,cacheToken:o})});Fl.displayName=`SheetColumnButtonLayer`;var Il=e=>{let t=[e.getRange().getCoords()],n=e.getPageRange();return n&&t.push(n.getCoords()),t},Ll=e=>{let[t,n]=Il(e);return n?{rowStart:Math.min(t.rowStart,n.rowStart),colStart:Math.min(t.colStart,n.colStart),rowEnd:Math.max(t.rowEnd,n.rowEnd),colEnd:Math.max(t.colEnd,n.colEnd)}:t},Rl=(e,t)=>{for(let n of e.getPivotTables().getItems())if(!n.isDeleted()){for(let e of Il(n))if(C.isRangeWithinRange(t,e))return n}return null},zl=e=>{let t=e.getSelection().getCoords()?.cell;return t?Rl(e,{rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}):null},Bl=(e,t)=>{if(!e||!t)return null;let n=e.getProperties(),r=n.headerRow?.fill?.background??n.wholeTable?.borders?.top?.color?.toString();return r?t.getStyles().parseColor(r)?.toCSS(`adaptive`)??null:null},Vl=(e,t)=>Bl(e.getStyle(),t)??`var(--sxl-color-neutral, grey)`,Hl=`_PivotFields_1e9c2_4`,Ul=`_Search_1e9c2_15`,Wl=`_FieldList_1e9c2_30`,Gl=`_FieldRow_1e9c2_41`,Kl=`_FieldName_1e9c2_57`,ql=`_TypeGlyph_1e9c2_65`,Jl=`_FilterMark_1e9c2_74`,Yl=`_Empty_1e9c2_80`,Xl=`_Areas_1e9c2_86`,Zl=`_Area_1e9c2_86`,Ql=`_AreaLabel_1e9c2_100`,$l=`_AreaList_1e9c2_105`,eu=`_AreaHint_1e9c2_123`,tu=`_Chip_1e9c2_130`,nu=`_ChipCaption_1e9c2_144`,ru=`_ChipRename_1e9c2_172`,iu=`_ChipMenuButton_1e9c2_185`,au=`_ChipMenu_1e9c2_185`,ou=`_ChipMenuItem_1e9c2_220`,su=`_ChipMenuCheck_1e9c2_243`,cu=`_ChipMenuDivider_1e9c2_249`,lu=`_Pane_1e9c2_255`,uu=`_PaneName_1e9c2_270`,du=`_PaneEmpty_1e9c2_276`,fu=`_EmptyBox_1e9c2_285`,pu=`_EmptyContent_1e9c2_292`,mu=`_EmptyName_1e9c2_302`,hu=`_EmptyHint_1e9c2_315`,gu=`_EmptyPicture_1e9c2_321`,_u=`_EmptyPicturePaper_1e9c2_327`,vu=e=>{let t=zt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n]);o(e,{onPivotTablesChange:()=>r(),onStyleChange:()=>r(),onLayoutChange:()=>r(),onInvalidated:()=>r(),onProtectionChange:()=>r()},xu);let a=t.getVisibleRange();return{visibleTables:(0,X.useMemo)(()=>{if(!a)return Su;let t=e.getPivotTables().getItems().filter(e=>!e.isDeleted()&&C.isRangesIntersect(Ll(e),a));return t.length>0?t:Su},[e,a?.rowStart,a?.colStart,a?.rowEnd,a?.colEnd,n]),cacheToken:i}},yu=(0,X.memo)(e=>{let{sheet:t,onPivotButtonMouseDown:n,...r}=e,{visibleTables:i,cacheToken:a}=vu(t),o=G((e,n)=>{let r=n??e.getVisibleRange();if(!r)return[];let i=t.getPivotTables().getItems(),a=i.length;if(a===0)return[];let o=[];for(let e=0;e<a;e++){let n=i[e];if(n.isDeleted())continue;let a=Tn(n,r),s=a.length;for(let e=0;e<s;e++){let r=a[e],i={rowIndex:r.row,colIndex:r.column};o.push({cell:i,value:{cell:t.getRange(i).getCell(),table:n,control:r}})}}return o},[t]),s=G(e=>{let{value:r,style:i,zoom:a=1,key:o}=e,{cell:s,table:c,control:l}=r;if(!i)return null;let u=!t.getProtection().isPivotTablesAllowed();if(l.kind===`dropdown`){let e=c.getFields(),t={x:0,y:0,width:i.width,height:i.height};return(0,Z.jsx)(`div`,{style:{...i,position:`absolute`,display:`flex`,alignItems:`end`},children:(0,Z.jsx)(sa,{className:`column-button pivot-dropdown`,bounds:t,zoom:a,disabled:u,fields:l.fields.map(t=>e[t]),onPivotButtonMouseDown:n,style:{pointerEvents:`auto`}})},o)}let d=s.getStyle(),f=En(s);if(!f)return null;let p=Math.max(7,1|Math.round(f.size*a)),m=f.left*a,h=d.getInsets(),g=d.measureText(``),_=i.height/a,v=d.getAlignment().getVertical(),y=((v===J.VerticalAlignment.Top?2*h.top+h.bottom:v===J.VerticalAlignment.Center?(_-g.lineHeight)/2+h.top:_-g.lineHeight-h.bottom)+(g.baseline??g.lineHeight))*a+1,b=y-d.getFont().getSize()*(4/3)*.33*a,x=Math.round(Math.min(y-1,b+p/2))-p+1;return(0,Z.jsx)(`div`,{style:{...i,position:`absolute`,pointerEvents:`none`},children:(0,Z.jsx)(ca,{expanded:l.expanded,size:p,disabled:u,onToggle:()=>{let e=c.getFields()[l.field];(l.name===void 0?null:e?.getItem(l.name))?.setExpanded(!l.expanded)},style:{position:`absolute`,left:m,top:x}})},o)},[t,n]);return i.length===0?null:(0,Z.jsx)(et,{...r,className:`pivot-controls cells`,children:(0,Z.jsx)(nt,{renderCell:s,getVisibleCells:o,cacheToken:a})})});yu.displayName=`PivotLayer`;var bu=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,i=zt(),{visibleTables:a}=vu(t),[o,s]=(0,X.useState)(()=>zl(t));(0,X.useEffect)(()=>(s(zl(t)),t.getSelection().addListeners({onChange:()=>s(zl(t))})),[t]);let[c,l]=(0,X.useState)(null),u=G(e=>{let n=i.getCellFromPointer(e.clientX,e.clientY);l(n?Rl(t,C.cellToRange(n)):null)},[i,t]),d=G(()=>l(null),[]),f=z();if(a.length===0)return null;let p=[];for(let e of a){let n=e.getName();if(Cu(e)){let t=e.getRange()?.getCoords();t&&p.push((0,Z.jsx)(ct,{range:t,className:fu,"aria-hidden":`true`,children:(0,Z.jsxs)(`div`,{className:pu,children:[(0,Z.jsx)(`div`,{className:mu,children:n}),(0,Z.jsx)(`div`,{className:hu,children:f(e===o?`pivot.empty.hintInside`:`pivot.empty.hintOutside`)}),(0,Z.jsx)(wu,{})]})},`empty-${n}`))}let r=e===c,i=e===o,a=r||i?Bl(e.getStyle(),t)??`var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0;Il(e).forEach((e,t)=>{p.push((0,Z.jsx)(Vt,{className:`pivot-outline`,range:e,stroke:a??`var(--sxl-color-neutral, grey)`,propsStrokePath:{strokeWidth:.5,style:{willChange:`opacity, filter`,transition:`opacity 80ms ease-in-out, filter 80ms ease-in-out`,opacity:i||r?1:0,filter:r?`drop-shadow(0px 0px 1px ${a})`:void 0}}},`outline-${n}-${t}`))})}return(0,Z.jsx)(et,{...r,onMouseMove:u,onMouseLeave:d,className:n??`pivot-frame`,children:p})});bu.displayName=`PivotFrameLayer`;var xu={transactional:!1,ignoreModelChange:!0},Su=Object.freeze([]),Cu=e=>e.getRowFields().length===0&&e.getColumnFields().length===0&&e.getPageFields().length===0&&e.getDataFields().length===0,wu=()=>(0,Z.jsxs)(`svg`,{className:gu,viewBox:`0 0 120 92`,focusable:`false`,children:[(0,Z.jsxs)(`g`,{fill:`currentColor`,children:[[0,1,2,3,4,5].map(e=>(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`rect`,{x:4,y:8+6*e,width:10,height:4.5}),(0,Z.jsx)(`rect`,{x:16,y:8+6*e,width:12,height:4.5,fillOpacity:e===0?1:.35}),(0,Z.jsx)(`rect`,{x:30,y:8+6*e,width:12,height:4.5,fillOpacity:e===0?1:.35})]},e)),(0,Z.jsx)(`rect`,{x:62,y:4,width:54,height:84,fillOpacity:.3}),(0,Z.jsx)(`rect`,{x:68,y:10,width:42,height:32,className:_u}),[0,1,2,3].map(e=>(0,Z.jsx)(`rect`,{x:72,y:15+6*e,width:34,height:1.5,fillOpacity:.6},e)),[0,1].map(e=>[0,1].map(t=>(0,Z.jsx)(`rect`,{x:68+22*t,y:52+18*e,width:20,height:14,className:_u},`${e}-${t}`)))]}),(0,Z.jsx)(`circle`,{cx:58,cy:56,r:18,className:_u,stroke:`currentColor`,strokeOpacity:.3}),[0,1,2].map(e=>(0,Z.jsxs)(`g`,{stroke:`currentColor`,strokeOpacity:.7,fill:`none`,children:[(0,Z.jsx)(`rect`,{x:46,y:45+8*e,width:5,height:5,className:_u}),(0,Z.jsx)(`line`,{x1:54,y1:47.5+8*e,x2:70,y2:47.5+8*e,strokeWidth:2,strokeOpacity:.4})]},e)),(0,Z.jsx)(`path`,{d:`M47 55.5 l1.5 1.8 l3 -3.6`,stroke:`var(--sxl-color-error, #c43e1c)`,strokeWidth:1.2,fill:`none`})]}),Tu={side:`r`,align:`start`},Eu=e=>{let{name:t,sheet:n,hovered:r,rangeOf:i,contains:a,select:o,render:s}=e,c=Fe().getMode()?.key===`edit`,[l,u]=(0,X.useState)(!1),d=(0,X.useMemo)(()=>!r||r.isDeleted()?null:{range:i(r),key:r.getName(),data:r},[r,i]);return(0,Z.jsx)(pt,{name:t,hovered:d,group:!1,hold:l,openDelay:0,placement:Tu,offset:6,alignOffset:2,whenOff:`clamp`,interactive:`pointer`,dismiss:c,children:({data:e,floatProps:t,state:r})=>e.isDeleted()?null:(0,Z.jsx)(`div`,{style:{display:`contents`},onPointerDownCapture:t=>{t.button===0&&(e=>{e.isDeleted()||a(e,n.getSelectedCell().getCoords())||o(e)})(e)},children:s(e,{sheet:n,floatProps:t,setHeld:u,state:r})})})},Du=(e,t,n)=>(0,Z.jsx)(xe,{render:e===void 0?t:e,props:n}),Ou={display:`inline-flex`,boxSizing:`border-box`,height:28,borderRadius:4,overflow:`hidden`,color:`var(--sxl-color-base-content, rgba(0, 0, 0, 0.87))`,background:`var(--sxl-color-elevated, #ffffff)`,border:`1px solid var(--sxl-color-base-border, rgba(0, 0, 0, 0.26))`,boxShadow:`0 2px 8px var(--sxl-color-shadow, rgba(0, 0, 0, 0.2))`},ku={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,padding:0,border:`none`,background:`transparent`,color:`inherit`,cursor:`pointer`},Au={display:`block`,width:`100%`,padding:`4px 12px`,border:`none`,background:`transparent`,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,whiteSpace:`nowrap`},ju={...Au,opacity:.5,cursor:`default`},Mu={placement:`bottom-end`,offsets:{mainAxis:2}},Nu=e=>{let{target:t,commandKeys:n,color:r,iconKey:i,menuName:a,floatProps:o,setHeld:s}=e,c=fe.useCommands([...n]),l=c[0],u=G(e=>{let{closeFloat:r}=e;return Le({...e,role:`menu`,style:{...e.style,padding:`4px 0`,fontSize:`var(--sxl-font-size, 13px)`},children:c.map((e,i)=>e?(0,Z.jsx)(`button`,{type:`button`,role:`menuitem`,style:e.disabled()?ju:Au,disabled:e.disabled(),onClick:()=>{r?.(),e.execute(t)},children:e.getLabel()},n[i]):null)})},[c,t]),[d,f]=(0,X.useState)(null),p=pe({label:a,anchor:d,renderFloatPanel:ye,propsPopper:Mu,renderPopupPanel:u,onOpen:()=>s(!0),onClose:()=>s(!1)}),m=l?.getLabel()??t.getName();return(0,Z.jsxs)(`div`,{...o,role:`toolbar`,"aria-label":t.getName(),style:{...Ou,...o.style},children:[(0,Z.jsx)(`button`,{type:`button`,title:m,"aria-label":m,style:{...ku,width:28,color:`white`,background:r},disabled:!l||l.disabled(),onClick:()=>{l?.execute(t)},children:(0,Z.jsx)(j,{iconKey:i,size:20})}),(0,Z.jsx)(`button`,{ref:f,type:`button`,"aria-haspopup":`menu`,"aria-expanded":p.isOpen,style:{...ku,width:16},onClick:()=>{p.isOpen?p.reference.close(0):p.reference.open(0)},children:(0,Z.jsx)(j,{iconKey:`ExpandMore`,size:14})}),p.component]})},Pu=(e,t)=>Il(e).some(e=>C.isCellWithinRange(t,e)),Fu=e=>{e.getRange().select()},Iu=(0,X.memo)(e=>{let{sheet:t,renderToolbar:n,className:r,...i}=e,a=zt(),[o,s]=(0,X.useState)(null),c=G(e=>{let n=a.getCellFromPointer(e.clientX,e.clientY);s(n?Rl(t,Lu(n)):null)},[a,t]),l=G(()=>s(null),[]);return(0,Z.jsx)(et,{onMouseMove:c,onMouseLeave:l,className:r??`pivot-toolbar`,...i,children:(0,Z.jsx)(Eu,{name:`pivot-toolbar`,sheet:t,hovered:o,rangeOf:Ll,contains:Pu,select:Fu,render:(e,t)=>Du(n,zu,{...t,pivot:e})})})});Iu.displayName=`PivotToolbarLayer`;var Lu=e=>({rowStart:e.rowIndex,colStart:e.colIndex,rowEnd:e.rowIndex,colEnd:e.colIndex}),Ru=[`editPivotTable`,`refreshPivotTable`,`deletePivotTable`],zu=e=>(0,Z.jsx)(Nu,{target:e.pivot,commandKeys:Ru,color:Vl(e.pivot,e.sheet),iconKey:`Table`,menuName:`pivot-toolbar-menu`,floatProps:e.floatProps,setHeld:e.setHeld}),Bu=(0,X.memo)(e=>{let{sheet:t,sheetView:n,getVisibleCells:r,bordersCache:i,className:a,...o}=e,c=zt();s(t,[`onStyleChange`,`onLayoutChange`]),s(n,[`onZoomScaleChange`]);let[,l]=(0,X.useReducer)(e=>e+1,0),u=c.getVisibleRange();ar(t,(0,X.useMemo)(()=>u?{rowStart:u.rowStart,colStart:u.colStart,rowEnd:u.rowEnd,colEnd:u.colEnd}:null,[u?.rowStart,u?.colStart,u?.rowEnd,u?.colEnd]),e=>{e.getTrigger()===`data`&&l()},Hu);let d=(n?.getZoomScale()??100)/100,f=n.isShowRowGridlines()&&d>=.4,p=n.isShowColumnGridlines()&&d>=.4,m=n?.getGridLineColor(),h=t.getStyles().getNormal().getFill().getType()===dn.Type.None,g=Ol(t),_=m?.toCSS(`adaptive`)??`var(--sxl-color-base-300)`,v=!!m,y=f&&h&&!g.rows,b=p&&h&&!g.columns,x=(0,X.useMemo)(()=>y?{color:_,dashArray:v?Vu:null}:null,[y,_,v]),S=(0,X.useMemo)(()=>b?{color:_,dashArray:v?Vu:null}:null,[b,_,v]),{renderLayer:C}=ei({mode:`normal`,getVisibleCells:r,getBorderAt:jl,getMergeAt:Ml,normalRows:x,normalColumns:S,cache:i});if(!x&&!S)return null;let w=c.getPaneBounds();if(w.width===0||w.height===0)return null;let T=C?.(c);return T?(0,Z.jsx)(et,{...o,className:Q(a,`gridlines`),children:(0,Z.jsx)(ct,{fill:!0,className:`gridlines-box`,style:{pointerEvents:`none`},children:T})}):null});Bu.displayName=`SheetGridLineLayer`;var Vu=Object.freeze([1,1]),Hu={transactional:!1,anchor:Dn.Type.Absolute},Uu=(0,X.lazy)(async()=>({default:(await d(async()=>{let{PictureEditor:e}=await import(`./BNMBa8EZgWX2Eb3c.js`);return{PictureEditor:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).PictureEditor})),Wu=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,style:i,...a}=e,s=zt(),[c,l]=(0,X.useState)(()=>n.getPicture()),u=(0,X.useMemo)(()=>{let e=n.getStyles();return e.getNormal().getFill().getType()===dn.Type.None?{backgroundColor:`var(--sxl-sys-color-window)`}:e.getNormal().getFill().toCSS(`adaptive`)},[n]);o(n,{onStyleChange:()=>{l(n.getPicture())},onInvalidated:()=>{l(n.getPicture())}});let d=s?.getPaneBounds();if(!s||!d||d.width===0||d.height===0)return null;let f=s.getBoundsFromRange({rowStart:0,colStart:0,rowEnd:0,colEnd:0});return(0,Z.jsx)(et,{...a,className:Q(r,`background`),children:(0,Z.jsx)(ct,{fill:!0,ref:t,className:`background-box`,style:{pointerEvents:`none`,...u,...i},children:c?(0,Z.jsx)(X.Suspense,{fallback:null,children:(0,Z.jsx)(Uu,{picture:c,tile:!0,offsetX:f?.x??0,offsetY:f?.y??0})}):null})})}));Wu.displayName=`SheetBackgroundLayer`;var Gu=e=>e.getSelectedRuns().map(e=>`${e.min}-${e.max}:${e.value?`A`:`s`}`).join(`|`),Ku=(0,X.memo)(e=>{let{header:t,renderCell:n,invalidateToken:r,className:i,...a}=e,[s,c]=(0,X.useReducer)(e=>e+1,0),l=(0,X.useMemo)(()=>({}),[s,r]);o(t,{onMetricsChange:()=>c()},{ignoreModelChange:!0});let u=(0,X.useRef)(Gu(t));return o(t.getWorksheet()?.getSelection(),{onChange:()=>{let e=Gu(t);e!==u.current&&(u.current=e,c())}}),(0,Z.jsx)(Pt,{...a,className:Q(i,t.getAxis()===`row`?`headers row`:`headers column`),renderCell:n,cacheToken:l})});Ku.displayName=`SheetHeaderCellLayer`;var qu=(e,t,n,r)=>{let i=e.getBoundsFromRange(t?{colStart:n,colEnd:r,rowStart:0,rowEnd:0}:{rowStart:n,rowEnd:r,colStart:0,colEnd:0});return t?{start:i.x,size:i.width}:{start:i.y,size:i.height}},Ju=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,renderButton:i=ia,laneGap:a=1,bracketGap:s=0,className:c,...l}=e,u=z(),d=t.getOutline(),[f,p]=(0,X.useReducer)(e=>e+1,0);o(d,{onOutlineChange:()=>p()});let m=zt(),h=n===Y.Axis.Column,g=m.getVisibleRange(),_=d.getGroups(n,{from:h?g.colStart:g.rowStart,to:h?g.colEnd:g.rowEnd}),v=m.getPaneBounds(),y=((h?v.height:v.width)-a)/Math.max(1,r),b=Xi(y,a),x=Math.max(2,Math.floor(.3*y)),S=h?t.getColumnHeaders():t.getRowHeaders(),C=d.getSummaryDirection(n),w=C===Y.Direction.Down||C===Y.Direction.Right,T=S.getEntireRange().getCoords().max,E=(0,X.useCallback)(e=>{let t=h?e.colIndex:e.rowIndex,n=S.at(t).getOutlineLevel();if(n===0||n>=r)return 0;let i=w?t-1:t+1;return i>=0&&i<=T&&S.at(i).getOutlineLevel()>n?0:n},[S,h,r,w,T]),D=(0,X.useCallback)(e=>E(e)===0,[E]),O=(0,X.useCallback)(e=>{let{key:t,cell:n,style:r,"data-rc":i}=e,o=E(n);if(o===0)return null;let s=Math.floor(Yu/2),c=Math.round(a+o*y)+Math.floor((b-1)/2)-s,l=Math.floor(((h?r?.width:r?.height)??0)/2)-s;return(0,Z.jsx)(`div`,{"data-rc":i,style:{position:`absolute`,...r},children:(0,Z.jsx)(`div`,{style:{position:`absolute`,left:h?l:c,top:h?c:l,width:Yu,height:Yu,boxSizing:`border-box`,border:`1px solid var(--sxl-color-base-border)`,borderRadius:`50%`}})},t)},[E,y,a,b,h]),k=(0,X.useMemo)(()=>({}),[f]),[A]=Ne(`outlineToggleGroup`),j=A?.disabled()??!1,M=e=>{let r=e.summary;if(A)return void A.execute({axis:n,index:r,show:e.collapsed});let i=t.getRange(h?{colStart:r,colEnd:r,rowStart:0,rowEnd:0}:{rowStart:r,rowEnd:r,colStart:0,colEnd:0});e.collapsed?i.showGroupDetails(n):i.hideGroupDetails(n)},N=(e,t)=>h?`${e},${t}`:`${t},${e}`,P=[],F=[];for(let e=0;e<_.length;e++){let t=_[e],r=Math.round(a+(t.level-1)*y),o=r+(b-1)/2+.5,c=null;t.summary!==null&&(c=qu(m,h,t.summary,t.summary),c.size===0&&(c=null));let l=c?Math.round(c.start+(c.size-b)/2):null;if(!t.collapsed){let e=qu(m,h,t.start,t.end);if(e.size>0){let n=t.summary===null||t.summary>t.end,r=n?e.start+1:e.start+e.size-1,i=n?e.start+e.size:e.start;l!==null&&(i=n?l-s:l+b+s),P.push(`M${N(r,o+x)}L${N(r,o)}L${N(i,o)}`)}}l!==null&&F.push((0,Z.jsx)(`div`,{style:{position:`absolute`,left:h?l:r,top:h?r:l,width:b,height:b,display:`flex`,pointerEvents:`auto`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>e.stopPropagation(),children:(0,Z.jsx)(xe,{render:i,props:{axis:n,level:t.level,collapsed:t.collapsed,size:b,title:t.collapsed?u(`outline.expand`):u(`outline.collapse`),onToggle:()=>M(t),disabled:j}})},`${t.level}:${t.start}`))}return(0,Z.jsxs)(et,{...l,className:c??`outline`,children:[(0,Z.jsx)(nt,{className:`outline-dots`,style:{pointerEvents:`none`},renderCell:O,hiddenCellAt:D,cacheToken:k}),(0,Z.jsxs)(ct,{fill:!0,style:{pointerEvents:`none`},children:[(0,Z.jsx)(`svg`,{width:`100%`,height:`100%`,style:{position:`absolute`,left:0,top:0,overflow:`visible`},children:(0,Z.jsx)(`path`,{d:P.join(``),fill:`none`,stroke:`var(--sxl-color-base-border)`,strokeWidth:1,shapeRendering:`crispEdges`})}),F]})]})});Ju.displayName=`SheetOutlineLayer`;var Yu=3,Xu={ignoreModelChange:!0},Zu=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,movable:r,preview:i,onRefLoad:a,onRefUnload:s,onHide:c,onShow:l,adornmentHost:d=null,gesture:p,onUnFocus:m,isDragging:h,dragStart:g,style:_,disabled:v,renderMovable:y,...b}=e,x=zt(),[S,C]=(0,X.useState)(null),[w,T]=(0,X.useState)(!1),[,E]=(0,X.useReducer)(e=>e+1,0),D=(0,X.useRef)(null),O=(0,X.useRef)(null),k=tn(r,x,i),A=k.rotation,{horizontal:j,vertical:M}=k.flip,N=(0,X.useMemo)(()=>({horizontal:j,vertical:M}),[j,M]);o(r,{onBoundsChange:()=>{E()},onAnyChange:()=>{E()},onSelectionChange:()=>{let e=!!D.current&&f.hasFocus(D.current,!0);!w&&!e||r.isSelected()||(x.focus(),m?.())}}),o(r,{onRequestFocus:()=>D.current?f.whenFocus(D.current,!0):Promise.resolve(!1)},Xu),(0,X.useEffect)(()=>{let e=D.current;if(e)return a(e),()=>{s(e)}},[]);let P=_?.pointerEvents??`auto`,F=x.getZoom()||1,I=(0,X.useMemo)(()=>(0,Z.jsx)(xe,{render:y,props:{movable:r,zoom:F,flip:N,disabled:v,isDragging:h,style:{position:`relative`,left:0,top:0,width:`100%`,height:`100%`,pointerEvents:P},onHide:c,onShow:l,onDragZone:e=>{O.current=e},adornmentHost:d,gesture:p}}),[x,r,F,N,v,h,P,d,p]),L=u([D,t]);return(0,Z.jsx)(`div`,{className:`movable`,tabIndex:0,ref:L,style:{display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,position:`absolute`,maxWidth:`auto`,maxHeight:`auto`,minWidth:`auto`,minHeight:`auto`,left:k.left,top:k.top,width:k.width,height:k.height,transform:A?`rotate(${A}deg)`:void 0,transformOrigin:`center`,..._,pointerEvents:`none`},onPointerDown:async e=>{let t=e.shiftKey||e.ctrlKey,n=Gt(r,e.target,e.currentTarget),i=n.isSelected(),a=e.currentTarget,o=e.nativeEvent;if(t&&i)n.unselect();else{let s=O.current?.(e.nativeEvent)??!0,c=!!e.target.closest?.(`textarea, input, [contenteditable]:not([contenteditable="false"])`),l=async()=>{i&&!t||await n.select({addToSelection:t,autoFocus:!c})},u=()=>{c||a.focus()};if(o.pointerType===`touch`&&!r.isSelected()){let e=a.ownerDocument,t=o.pointerId,n=x.getScrollTopLeft(),r=e=>{if(e.pointerId!==t)return;s();let r=x.getScrollTopLeft();Math.abs(e.clientX-o.clientX)>10||Math.abs(e.clientY-o.clientY)>10||r.left!==n.left||r.top!==n.top||l().then(u)},i=e=>{e.pointerId===t&&s()},s=()=>{e.removeEventListener(`pointerup`,r),e.removeEventListener(`pointercancel`,i)};e.addEventListener(`pointerup`,r),e.addEventListener(`pointercancel`,i);return}await l(),s&&!c&&g(o),u()}},onFocus:e=>{e.relatedTarget&&!S&&C(e.relatedTarget),T(!0)},onBlur:e=>{S&&!D?.current?.contains(e.relatedTarget)&&C(null),e.relatedTarget&&T(!1)},...b,children:I})})),Qu=(0,X.memo)(({movables:e,width:t,height:n})=>{let r=zt(),[i]=q(nn,null);if(!i)return null;let a=e.getItems({deep:!0}),o=a.find(e=>e.getId()===i.connector)??null,s=new Set(o?[o]:[]);for(let e=o?.getParent();e;e=e.getParent())s.add(e);let c=[];for(let e of a){if(s.has(e)||e.isHidden()||e.isDeleted())continue;let t=e.getConnectionSites();if(!t)continue;let n=i.target===e.getId()?i.index:null;for(let i of t){let t=r.toPaneBounds({x:i.x,y:i.y,width:0,height:0}),a=i.index===n;c.push((0,Z.jsx)(`circle`,{cx:t.x,cy:t.y,r:a?5:3.5,fill:a?`var(--sxl-handle-color, rgb(33, 115, 70))`:`var(--sxl-color-base-100, white)`,stroke:`var(--sxl-handle-color, rgb(33, 115, 70))`,strokeWidth:1.5},`${e.getId()}:${i.index}`))}}return(0,Z.jsx)(`svg`,{className:`movable-connection-sites`,width:t,height:n,style:{position:`absolute`,left:0,top:0,overflow:`visible`,pointerEvents:`none`,zIndex:3002},children:c})});Qu.displayName=`ConnectionSites`;var $u=(e,t)=>((t?Math.round(e/t)*t:e)%360+360)%360,ed=`url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M18.4%208.5A7%207%200%201%200%2019%2013%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M18.4%208.5A7%207%200%201%200%2019%2013%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M20.5%204.5%2019.2%209.6%2014.2%208.1Z%22%20fill%3D%22black%22%20stroke%3D%22white%22%20stroke-width%3D%221%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") 12 12, crosshair`,td=(0,X.memo)(({isDragging:e=!1,onStart:t,onRotate:n,onEnd:r,onCancel:i,below:a=!1})=>{let o=(0,X.useRef)(null),s=(0,X.useCallback)(e=>{if(e.button!==0)return;e.stopPropagation(),e.preventDefault();let n=e.currentTarget.parentElement?.getBoundingClientRect();if(!n)return;let r={x:n.left+n.width/2,y:n.top+n.height/2},i=e.currentTarget.getBoundingClientRect();t(Math.hypot(i.left+i.width/2-r.x,i.top+i.height/2-r.y))&&(o.current={pointerId:e.pointerId,center:r,press:{x:e.clientX,y:e.clientY}},e.currentTarget.setPointerCapture(e.pointerId))},[t]),c=(0,X.useCallback)(e=>{let t=o.current;t&&t.pointerId===e.pointerId&&(e.stopPropagation(),n(((e,t,n)=>{let r=Math.atan2(t.y-e.y,t.x-e.x),i=180*(Math.atan2(n.y-e.y,n.x-e.x)-r)/Math.PI%360;return i>180?i-360:i<=-180?i+360:i})(t.center,t.press,{x:e.clientX,y:e.clientY}),e.shiftKey))},[n]),l=(0,X.useCallback)(e=>{let t=o.current;t&&t.pointerId===e.pointerId&&(e.stopPropagation(),o.current=null,r())},[r]),u=(0,X.useCallback)(e=>{let t=o.current;t&&t.pointerId===e.pointerId&&(o.current=null,i())},[i]);return(0,Z.jsx)(`div`,{className:[`movable-rotate-handle`,e?`dragging`:null,a?`below`:null].filter(Boolean).join(` `),style:{cursor:ed},onPointerDown:s,onPointerMove:c,onPointerUp:l,onPointerCancel:u,children:(0,Z.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`m 12.000001,0.49999989 c -6.0694556,0 -11.00000106,4.93054521 -11.00000106,11.00000111 -1.1e-7,6.069456 4.93054546,11.000001 11.00000106,11 6.046746,0 10.976832,-4.908053 11,-10.955388 v -0.216686 l -2.519506,-0.54384 v 0.715914 c 0,4.665771 -3.814723,8.480494 -8.480494,8.480494 -4.6657716,0 -8.4804952,-3.814723 -8.4804953,-8.480494 1e-7,-4.6657715 3.8147238,-8.4804953 8.4804953,-8.4804953 2.569528,0 4.854074,1.1408648 6.387988,2.9592508 l 0.01275,0.014871 -2.532252,2.0351489 4.33372,0.9092314 0.350521,0.065856 0.860371,0.1826961 1.293743,0.2676709 V 2.5139051 l -2.330438,1.8800696 -0.01275,-0.014871 C 18.366265,2.004373 15.346134,0.49999968 12.000001,0.49999989 Z`})})})});td.displayName=`RotateHandle`;var nd=`_movable-area_yq5rq_14`,rd=e=>typeof e.getContent().acceptRotation==`function`,id=e=>{let t=0;for(let n=e.getParent();n;n=n.getParent())t++;return t},ad=()=>{},od=`1px 1px 2px 2px rgba(0,0,0,.15)`,sd={bounds:{x:0,y:0,width:0,height:0}},cd={side:`b`,align:`end`},ld=Math.sin(Math.PI/8),ud=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{movables:n,movableSelection:r,renderMovable:i,onUnFocus:a,onFocus:s,disabled:c=!1,disableDrag:l=!1,disableResize:d=!1,className:p,style:m,resizeDirections:g=[`nw`,`n`,`ne`,`w`,`e`,`sw`,`s`,`se`],onFirstRender:_,renderTip:v,...y}=e,b=zt(),x=Me()===`touch`,w=b.getPaneBounds(),T=b.getVisibleRange(),E=`${T.rowStart}:${T.colStart}:${T.rowEnd}:${T.colEnd}`,D=G(_,[_]),O=G(a,[a]),k=G(s,[s]),[A,j]=(0,X.useState)(!1),[M,N]=(0,X.useState)(!1),P=(0,X.useRef)(new Map),F=(0,X.useRef)(new Map),I=()=>r.getItems().filter(e=>F.current.has(Yt(e))),L=(0,X.useRef)(new Map),R=(0,X.useRef)(new Map),ee=(0,X.useRef)([]),z=(0,X.useRef)(null),[B,V]=q(`movable-drag`,null),H=(0,X.useRef)(null),U=(0,X.useRef)(``),W=(0,X.useCallback)(e=>{H.current=e,V(e)},[V]),te=(0,X.useCallback)(e=>{let t=ee.current;if(t.length===0)return e;let n=t=>{let n=e[t.getId()],r=n?.bounds??t.getBounds();return r?{bounds:r,rotation:n?.rotation??(t.getRotation()||0),flip:n?.flip??t.getFlip(),adjustments:n?.content?.adjustments}:null};for(let r of t){if(e[r.getId()])continue;let t=r.getContent().getConnectorFormat()?.getGluedRoute(n);if(!t)continue;let{bounds:i,rotation:a,flip:o}=t.placement;e[r.getId()]={bounds:i,rotation:a,flip:o,content:t.shapeType?{shapeType:t.shapeType,adjustments:t.adjustments}:void 0}}return e},[]),[ne]=q(`movable-hover`,null),re=(0,X.useRef)(null);re.current=ne;let ie=()=>{let e=b.getVisibleRange(),t=n.getItems({address:e,ignoreHidden:!0,drawn:!0}),i=r.getItems().slice();re.current&&i.push(re.current);let a=t;for(let n=0;n<i.length;n++){let r=i[n];!r.isHidden()||r.isDeleted()||a.includes(r)||e&&!C.isRangesIntersect(r.getRange().getCoords(),e)||(a===t&&(a=t.slice()),a.push(r))}return a},[ae,oe]=(0,X.useState)(()=>new Map),se=(0,X.useCallback)((e,t)=>{oe(n=>{if((n.get(e)??null)===t)return n;let r=new Map(n);return t?r.set(e,t):r.delete(e),r})},[]),ce=(0,X.useRef)(new Map),K=(0,X.useRef)({onRequestFocus:e=>(_e(e),Promise.resolve(!1))}),le=(0,X.useRef)(null),[ue,de]=(0,X.useReducer)(e=>e+1,0);(0,X.useLayoutEffect)(()=>{de()},[n]),o(n,{onCollectionChange:()=>{let e=ie(),t=ce.current;t.forEach(e=>{e()}),t.clear();let n=K.current,r=e.length;for(let i=0;i<r;i++){let r=e[i];if(r.isDeleted())continue;let a=r.addListeners(n);t.set(r,a)}de()},onInvalidated:()=>{de()}}),o(r,{onChange(e){e.isEmpty()&&le.current&&f.hasFocus(le.current,!0)&&(b.focus(),O?.()),de()}});let[fe,pe]=(0,X.useState)(!1),me=(0,X.useRef)(null),ge=(0,X.useRef)(null),_e=G(async(e=null)=>{if(e||=r.getActive(),!e)return O?.(),!1;let t=F.current.get(e)??F.current.get(Yt(e));return t?(await f.whenFocus(t),t.focus(),ge.current=t,me.current=null,!0):(me.current=e,!1)},[r]);(0,X.useEffect)(()=>{D?.()},[]);let ve=G((e,t)=>{U.current=e,L.current.clear();let n=t??I();for(let e=0;e<n.length;e++){let t=n[e],r=t.getBounds();r&&L.current.set(t,{movable:t,startBounds:b.toPaneBounds(r),startRotation:t.getRotation()||0,startFlip:t.getFlip()})}R.current.clear();let r=new Set;for(let e of L.current.keys())for(let t of[e,...e.getMovables()?.getItems({deep:!0})??[]])for(let e of t.getGluedConnectors())L.current.has(e)||r.add(e);ee.current=Array.from(r)},[b,r]),ye=(0,X.useCallback)(()=>{let e=H.current,t=L.current,r=R.current;if(L.current=new Map,R.current=new Map,ee.current=[],!e||t.size===0)return void W(null);let i=r.size>0;if(t.forEach(t=>{let n=e[t.movable.getId()];var r,a;n&&(n.bounds&&!h.isEqualBounds(n.bounds,t.movable.getBounds()??void 0)&&(i=!0),n.rotation!==void 0&&n.rotation!==$u(t.movable.getRotation()||0)&&(i=!0),n.flip&&(r=n.flip,a=t.movable.getFlip(),r.horizontal!==a.horizontal||r.vertical!==a.vertical)&&(i=!0))}),i){try{let i=t=>{let n=e[t.getId()];n?.bounds&&t.setBounds(n.bounds),n?.rotation!==void 0&&t.setRotation(n.rotation),n?.flip&&t.setFlip(n.flip),r.get(t)?.(t)},a=Array.from(t.values(),e=>e.movable);a.every(e=>e.isSelected())?n.updateSelected(i,U.current):a[0].getRange().doBatch(()=>{for(let e of a)i(e)},U.current)}catch(e){console.warn(e)}W(null)}else W(null)},[n,W]),be=(0,X.useCallback)(()=>{z.current?.(),z.current=null,L.current=new Map,R.current=new Map,ee.current=[],W(null)},[W]),xe=G(()=>{z.current?.(),z.current=null,j(!1),N(!1),L.current.size!==0&&ye()},[ye]),Se=G(()=>{j(!1),N(!1),be()},[be]),Ce=G((e,t,n)=>{if(c||l||e.button!==0)return;z.current?.();let r=e.target?.ownerDocument??document,i=e.pointerId,a={x:e.clientX,y:e.clientY},o=!1,s=null,u=null,d=r.documentElement,f=null,p=e=>{if(e.pointerId!==i)return;if(!(1&e.buttons))return void(o?xe():g());let c=e.clientX-a.x,l=e.clientY-a.y;if(!o){if(Math.hypot(c,l)<3)return;o=!0,f=d.style.userSelect,d.style.userSelect=`none`,r.getSelection()?.removeAllRanges(),ve(S(`op.moveMovable`),n),N(!0);let e=L.current.get(t)??L.current.values().next().value,i=b.getPanePointFromPointer(a.x,a.y);e&&i&&(s=e.movable,u={kind:`move`,at:{x:i.x-e.startBounds.x,y:i.y-e.startBounds.y}})}if(L.current.size===0)return;let p={};L.current.forEach(({movable:e,startBounds:t})=>{let n={bounds:b.toAbsoluteBounds({...t,x:t.x+c,y:t.y+l})};e===s&&u&&(n.grip=u),p[e.getId()]=n}),W(te(p))},m=e=>{e.pointerId===i&&(o?xe():g())},h=e=>{e.pointerId===i&&(g(),o&&Se())},g=()=>{r.removeEventListener(`pointermove`,p),r.removeEventListener(`pointerup`,m),r.removeEventListener(`pointercancel`,h),f!==null&&(d.style.userSelect=f),f=null,z.current===g&&(z.current=null)};r.addEventListener(`pointermove`,p),r.addEventListener(`pointerup`,m),r.addEventListener(`pointercancel`,h),z.current=g},[b,c,l,ve,xe,Se,W]),we=(0,X.useRef)(null),Te=G(e=>!c&&!d&&(ve(S(`op.resizeMovable`),e.isSelected()?void 0:[e]),we.current=e,L.current.has(e)),[c,d,ve]),Ee=G((e,t,n)=>{let r=we.current?L.current.get(we.current):void 0;if(!r)return;j(!0);let[i,a]=((e,t,n)=>{let r=-n*Math.PI/180,i=Math.cos(r),a=Math.sin(r);return[e[0]*(t[0]*i-t[1]*a),e[1]*(t[0]*a+t[1]*i)]})(e,t,r.startRotation),o=b.toPaneBounds({x:0,y:0,width:0,height:0}),s={kind:`resize`,direction:e},c={};L.current.forEach(({movable:t,startBounds:l,startRotation:u,startFlip:d})=>{let f=r.startBounds.width?i*(l.width/r.startBounds.width):i,p=r.startBounds.height?a*(l.height/r.startBounds.height):a;u||(e[0]===-1&&(f=Math.min(f,l.x-o.x)),e[0]===1&&(f=Math.max(f,o.x-l.x-l.width)),e[1]===-1&&(p=Math.min(p,l.y-o.y)),e[1]===1&&(p=Math.max(p,o.y-l.y-l.height)));let m=t.isLockAspectRatio()||n,{bounds:h,crossed:g}=((e,t,n,r,i)=>{let[a,o]=t,s=e.width+(a?n[0]:0),c=e.height+(o?n[1]:0);if(i&&a&&o&&e.width>0&&e.height>0){let t=e.width/e.height,n=s<0?-1:1,r=c<0?-1:1;Math.abs(s)>Math.abs(c)*t?c=r*Math.abs(s)/t:s=n*Math.abs(c)*t}let l=a*(s-e.width)/2,u=o*(c-e.height)/2,d=r*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=e.x+e.width/2+l*f-u*p,h=e.y+e.height/2+l*p+u*f,g=Math.abs(s),_=Math.abs(c);return{bounds:{x:m-g/2,y:h-_/2,width:g,height:_},crossed:[s<0,c<0]}})(l,e,[f,p],u,m),_={bounds:b.toAbsoluteBounds(h),grip:s},v=t.getContent();v.acceptFlip&&(_.flip=v.acceptFlip({horizontal:d.horizontal!==g[0],vertical:d.vertical!==g[1]})),c[t.getId()]=_}),W(te(c))},[b,W,te]),De=(0,X.useRef)(null),Oe=G((e,t)=>(ve(S(`op.rotateMovable`),t.isSelected()?void 0:[t]),De.current={kind:`rotate`,radius:e,below:t.getFlip().vertical},L.current.size>0),[ve]),ke=G((e,t)=>{if(L.current.size===0)return;let n=De.current??void 0,r={};L.current.forEach(({movable:i,startRotation:a})=>{let o=i.getContent();o.acceptRotation&&(r[i.getId()]={rotation:o.acceptRotation($u(a+e,t?15:void 0)),grip:n})}),W(te(r))},[W,te]),Ae=G((e,t,n)=>!c&&!d&&(ve(t,e.isSelected()?void 0:[e]),we.current=e,!!L.current.has(e)&&(n&&R.current.set(e,n),!0)),[c,d,ve]),Ne=G((e,t)=>{L.current.has(e)&&(j(!0),W(te({...H.current??{},[e.getId()]:t})))},[W,te]),Pe=(0,X.useRef)(new WeakMap),Fe=G(e=>{let t=Pe.current.get(e);return t||(t={start:(t,n)=>Ae(e,t,n),preview:t=>Ne(e,t),finish:xe,cancel:Se},Pe.current.set(e,t)),t},[Ae,Ne,xe,Se]),Ie=(0,X.useMemo)(()=>{let e=ie();if(e.length===0&&P.current.size===0&&!B)return null;let t=[],n=(n,r,a,o=!0)=>{let s=n.isSelected(),u=B?B[n.getId()]??null:null,f=!!u||s&&(M||A),p=s&&o&&!c,m=!!B||M||A,h=e=>{let n=B?B[e.getId()]??null:null,r=n?.flip??e.getFlip(),i={movable:e,flip:r,gesture:Fe(e),directions:d?[]:g,rotation:n?.rotation??(e.getRotation()||0),isDragging:m,onResizeStart:()=>Te(e),onResize:Ee,onResizeEnd:xe,onResizeCancel:Se,onMoveStart:l?void 0:t=>Ce(t,e),children:rd(e)?(0,Z.jsx)(td,{isDragging:m,below:r.vertical,onStart:t=>Oe(t,e),onRotate:ke,onEnd:xe,onCancel:Se}):null},a=Zt(e.getContent().getType());t.push((0,Z.jsx)(en,{movable:e,preview:n,onHost:se,children:a?(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(Xt,{...i}),children:(0,Z.jsx)(a,{...i})}):(0,Z.jsx)(Xt,{...i})},`adornment-${e.getId()}`))},_=e=>{let n=B?B[e.getId()]??null:null;t.push((0,Z.jsx)(en,{movable:e,preview:n,onHost:ad,children:(0,Z.jsx)(Xt,{context:!0,directions:d?[]:g,rotation:n?.rotation??(e.getRotation()||0),isDragging:m,onResizeStart:()=>Te(e),onResize:Ee,onResizeEnd:xe,onResizeCancel:Se,onMoveStart:l?void 0:t=>Ce(t,e,[e]),children:rd(e)?(0,Z.jsx)(td,{isDragging:m,below:(n?.flip??e.getFlip()).vertical,onStart:t=>Oe(t,e),onRotate:ke,onEnd:xe,onCancel:Se}):null})},`adornment-context-${e.getId()}`))};if(p&&h(n),o&&!c){let e=n.getMovables();if(e){let t=new Set,n=[];for(let r of e.getItems({deep:!0}))if(r.isSelected()&&!r.isHidden()){n.push(r);for(let e=r.getParent();e;e=e.getParent())e.isSelected()||t.add(e)}let r=[...t].sort((e,t)=>id(e)-id(t));for(let e of r)_(e);for(let e of n)h(e)}}let v={tabIndex:a,movable:n,preview:u,onRefLoad:e=>{me.current===n&&(e.focus(),ge.current=e,me.current=null),F.current.set(n,e),r.rendered=!0,n.isSelected()&&de()},onRefUnload:e=>{F.current.delete(n),r.rendered=!1,n.isSelected()&&de()},onUnFocus:O,onHide:e=>{r.onHide=e},onShow:e=>{r.onShow=e},adornmentHost:p?ae.get(n)??null:null,gesture:p?Fe(n):void 0,isDragging:f,disabled:c,renderMovable:i,dragStart:e=>Ce(e,n),style:{opacity:u?.7:o?A&&s?.7:void 0:0,zIndex:f?n.getZIndex()+e.length:void 0,pointerEvents:o?void 0:`none`,cursor:M&&s?`grabbing`:c||l?`initial`:`move`,touchAction:!s||c||l?void 0:`none`,boxShadow:s&&(!M||A)&&Qt(n.getContent().getType())?od:void 0}};return(0,Z.jsx)(Zu,{...v},`movable-${n.getId()}`)},a=P.current,o=new Map,s=[],u=()=>({frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;let n=++t.visibilityRequestId;requestAnimationFrame(()=>{let r=P.current.get(e);r&&n===t.visibilityRequestId&&(t.onShow?.(e),r.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;let n=++t.visibilityRequestId,r=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==r&&(t.shown=!1,P.current.delete(e),de())},visibilityRequestId:0}),f=e.length;for(let t=0;t<f;t++){let r=e[t];if(r.isDeleted())continue;let i=a.get(r)??u();i.previewOnly=!1,i.frame=n(r,i,t,!0),s.push(i.frame),i.doShow(r,i),a.delete(r),o.set(r,i)}let p=[];return r.getItems().forEach(e=>{if(o.has(e))return;let t=a.get(e),r=!!B?.[e.getId()];if(t){if(t.previewOnly&&!r)return}else{if(!r)return;t=u(),t.previewOnly=!0}t.frame=n(e,t,-1,!1),p.push(t.frame),a.delete(e),o.set(e,t)}),a.forEach((e,t)=>{e.frame=n(t,e,-1,!1),p.push(e.frame),e.doHide(t,e),a.delete(t),o.set(t,e)}),P.current=o,{frames:[...p,...s],adornments:t}},[ue,b,E,B,ne,i,c,l,d,g,A,M,ae,se]),Le=(0,X.useRef)(null);(0,X.useEffect)(()=>{Le.current&&(Le.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[Le.current]);let Re=I(),ze=Re.map(e=>e.getId()).join(`,`);(0,X.useEffect)(()=>{let e=Re[0]?F.current.get(Re[0]):void 0;fe&&e&&ge.current!==e&&!e.contains(e.ownerDocument.activeElement)&&_e()},[ze]);let Be=je(t,()=>({isMovableLayer:()=>!0,focusMovable:_e,focus:()=>{_e()}}),[r]),[Ve,He]=(0,X.useState)(null),Ue=(0,X.useCallback)(e=>{e&&He(e)},[]),We=null,Ge=null;if(v&&B){let e=Object.keys(B),t=we.current,n=e.find(e=>B[e].grip?.kind===`move`)??(t&&B[t.getId()]?t.getId():e[0]),i=n?Array.from(L.current.keys()).find(e=>e.getId()===n)??r.getItems().find(e=>e.getId()===n):void 0,a=n?B[n]:void 0,o=i?.getBounds();if(i&&a&&o){let e=a.grip??null;We={kind:e?.kind??`move`,movable:i,bounds:a.bounds??o,rotation:a.rotation??$u(i.getRotation()||0)},Ge=((e,t,n,r)=>{let i=n.toPaneBounds(e.bounds);if(!t)return{anchor:{bounds:i},placement:cd};if(t.kind===`move`){let e=i.x+t.at.x,n=i.y+t.at.y;return r?{anchor:{bounds:{x:e,y:n,width:0,height:0}},placement:{side:`t`,align:`center`}}:{anchor:{bounds:{x:e,y:n-10,width:10,height:20}},placement:{side:`b`,align:`start`}}}let[a,o]=t.kind===`resize`?t.direction:[0,t.below?1:-1],s=t.kind===`resize`?a*i.width/2:0,c=t.kind===`resize`?o*i.height/2:o*t.radius,l=e.rotation*Math.PI/180,u=Math.cos(l),d=Math.sin(l),f=i.x+i.width/2+s*u-c*d,p=i.y+i.height/2+s*d+c*u,m=Math.hypot(a,o)||1,h=(a*u-o*d)/m,g=(a*d+o*u)/m,_=e=>e>ld?`start`:e<-ld?`end`:`center`;return{anchor:{bounds:{x:f,y:p,width:0,height:0}},placement:Math.abs(g)>=Math.abs(h)?{side:g<0?`t`:`b`,align:_(h)}:{side:h<0?`l`:`r`,align:_(g)}}})(We,e,b,x)}}let Ke=u([Be,Le,Ue]);return Ie?(0,Z.jsxs)(et,{className:Q(p,`movable-area`),onPointerDown:e=>{e.button!==0&&e.button!==2||r.isEmpty()||(r.clear(),O?.())},children:[(0,Z.jsx)(ct,{fill:!0,className:nd,style:{pointerEvents:`none`,...m,overflow:`hidden`,willChange:`transform`},ref:Ke,...y,children:(0,Z.jsx)(`div`,{className:`movable-scroll`,style:{position:`absolute`,left:0,top:0,width:w.width,height:w.height},...y,children:(0,Z.jsx)(`div`,{ref:le,style:{position:`absolute`,pointerEvents:`auto`},onFocus:e=>{k?.(),pe(!0)},onBlur:e=>{pe(!1)},onKeyDownCapture:e=>{e.isDefaultPrevented()||e.which===he.Escape&&L.current.size>0&&(Se(),e.preventDefault(),e.stopPropagation())},onPointerDown:e=>{e.stopPropagation()},onDoubleClick:e=>{e.stopPropagation()},children:(0,Z.jsxs)($t.Provider,{value:ae,children:[Ie.frames,Ie.adornments,(0,Z.jsx)(Qu,{movables:n,width:w.width,height:w.height})]})})})}),v&&(0,Z.jsx)(lt,{name:`movable-gesture`,active:We!==null,anchor:Ge?.anchor??sd,placement:Ge?.placement,offset:x?36:We?.kind===`move`?4:void 0,alignOffset:x||We?.kind!==`move`?void 0:2,children:We?v(We):null})]}):null})),dd=e=>{let{movable:t}=e;if(!t)return(0,Z.jsx)(Z.Fragment,{});let n=Kt(t.getContent().getType());return n?n(e):(0,Z.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,clipPath:`inset(0px)`,display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,pointerEvents:`all`},children:(0,Z.jsx)(an,{...e})},t.getId())},fd=`workbookToolbars`,pd=new Map;function md(e){let t=e.key.toLowerCase(),n=pd.get(t)??0;n===0&&fe.DefaultCommandButtonRegistry.register(e,!0),pd.set(t,n+1);let r=!1;return()=>{if(r)return;r=!0;let e=(pd.get(t)??1)-1;e>0?pd.set(t,e):(pd.delete(t),fe.DefaultCommandButtonRegistry.get(t)&&fe.DefaultCommandButtonRegistry.unregister(t))}}var hd=e=>`${e}Toolbar`;function gd(e,t){return{key:hd(e),contributions:{[fd]:{order:1}},getLabel:()=>t,members:[`moveForwardOptions`,`moveBackwardOptions`,`-`,`drawAlignOptions`,`drawGroupOptions`,`drawFlipOptions`,`-`,`drawSizingOptions`,`toggleLockAspectRatio`,`-`,`formatMovable`]}}var _d=!1;function vd(){if(_d)return;_d=!0;let e=fe.DefaultCommandButtonRegistry;e.register({key:`moveForwardOptions`,defaultKey:`moveToFront`,members:[`moveToFront`,`moveForward`]},!0),e.register({key:`moveBackwardOptions`,defaultKey:`moveToBack`,members:[`moveToBack`,`moveBackward`]},!0),e.register({key:`drawAlignOptions`,members:[`formatDrawAlignLeft`,`formatDrawAlignCenter`,`formatDrawAlignRight`,`-`,`formatDrawAlignTop`,`formatDrawAlignMiddle`,`formatDrawAlignBottom`,`-`,`formatDrawDistributeHorz`,`formatDrawDistributeVert`]},!0),e.register({key:`drawFlipOptions`,members:[`formatDrawFlipHorizontal`,`formatDrawFlipVertical`]},!0),e.register({key:`drawGroupOptions`,members:[`groupDrawings`,`ungroupDrawings`]},!0),e.register({key:`drawSizingOptions`,members:[`formatAnchorTypeTwoCell`,`formatAnchorTypeOneCell`,`formatAnchorTypeAbsolute`]},!0),e.register({key:`arrangeOptions`,members:[`moveForwardOptions`,`moveBackwardOptions`,`-`,`drawAlignOptions`,`drawGroupOptions`,`drawFlipOptions`,`-`,`drawSizingOptions`]},!0)}var yd=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){let n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,function(e){let{getTitle:t,getIcon:n}=e,r=e.key;return{...e,getTitle:()=>{let n=fe.DefaultCommandRegistry.findByKey(r)?.def;return typeof n?.label==`string`?n.label:k.lookup(`cmd.${r}.label`)??t.call(e)},getIcon:()=>{let t=fe.DefaultCommandRegistry.findByKey(r)?.def;return typeof t?.icon==`string`?t.icon:n?.call(e)}}}(e))}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return h.EmptyArray;let t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,``);for(let n of this._taskPanes.values()){let r=n.contributionPoints;if(r&&r.length!==0)for(let i of r)i=i.toLowerCase().replace(/\/+$/g,``),i.startsWith(e)&&t.push(n)}return t}},bd={TaskPaneArea:`_TaskPaneArea_4lp4n_5`,TaskPaneTitle:`_TaskPaneTitle_4lp4n_13`,TaskPaneFrame:`_TaskPaneFrame_4lp4n_36`,TaskPaneAreaFrames:`_TaskPaneAreaFrames_4lp4n_55`,TaskPaneAreaFrameHost:`_TaskPaneAreaFrameHost_4lp4n_63`,TaskPaneAreaFrameHidden:`_TaskPaneAreaFrameHidden_4lp4n_71`,TaskPaneStrip:`_TaskPaneStrip_4lp4n_75`,TaskPaneStripItem:`_TaskPaneStripItem_4lp4n_88`,TaskPaneStripItemIcon:`_TaskPaneStripItemIcon_4lp4n_117`,TaskPaneStripItemLabel:`_TaskPaneStripItemLabel_4lp4n_127`,TaskPaneStripItemLabelOpen:`_TaskPaneStripItemLabelOpen_4lp4n_134`,TaskPaneStripItemLabelClip:`_TaskPaneStripItemLabelClip_4lp4n_139`,TaskPaneStripItemLabelText:`_TaskPaneStripItemLabelText_4lp4n_146`,MovablePane:`_MovablePane_4lp4n_152`,MovablePaneKind:`_MovablePaneKind_4lp4n_166`,MovablePaneEmpty:`_MovablePaneEmpty_4lp4n_171`},xd=`formatMovable`,Sd=e=>{let{model:t,entryKey:n,args:r,frame:i,ref:a,className:o,...s}=e,c=l(),u=z(),[,d]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!c)return;let e=c.getView().addListeners({onMovableSelectionChange:d}),t=Jt(d);return()=>{e(),t()}},[c]);let f=c?.getView().getMovableSelection().getActive()??null,p=f?.getContent(),m=p?.getType(),h=m?qt(m):void 0,g;if((0,X.useEffect)(()=>{m&&!h&&Wt(m)},[m,h]),c&&f&&p){if(h?.pane){let e=h.pane;g=(0,Z.jsx)(e,{movable:f,sheet:c},p.getId())}else g=(0,Z.jsx)(`div`,{className:bd.MovablePaneEmpty,children:u(`movable.pane.none`,{kind:p.getTypeDescription()})})}else g=(0,Z.jsx)(`div`,{className:bd.MovablePaneEmpty,children:u(`movable.pane.empty`)});return(0,Z.jsxs)(`div`,{ref:a,className:Q(`sxl-movable-pane`,o,bd.MovablePane),...s,children:[p?(0,Z.jsx)(`div`,{className:bd.MovablePaneKind,children:p.getTypeDescription()}):null,g]})};function Cd(){yd.getRegisteredTaskPane(`formatMovable`)||yd.registerTaskPane({key:`formatMovable`,getTitle:()=>`formatMovable`,component:Sd})}var wd=e=>{let t=2**53-1,n=2**53-1,r=0,i=0;for(let a of e){let e=a.getBounds();e&&(t=Math.min(e.x,t),n=Math.min(e.y,n),r=Math.max(e.x+e.width,r),i=Math.max(e.y+e.height,i))}return{x:t,y:n,width:r-t,height:i-n}},Td=(e,t=!0)=>{let n=[],r=t?`x`:`y`,i=t?`y`:`x`,a=t?`width`:`height`,o=0,s=2**53-1,c=0;for(let t of e){let e=t.getBounds();e&&(o+=e[a],s=Math.min(e[r],s),c=Math.max(e[r]+e[a],c),n.push({bounds:e,movable:t}))}let l=(c-s-o)/(e.length-1);n.sort((e,t)=>e.bounds[r]===t.bounds[r]?e.bounds[i]-t.bounds[i]:e.bounds[r]-t.bounds[r]);let u=new Map;u.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){let t=n[e-1].bounds,i={...n[e].bounds};i[r]=t[r]+t[a]+l,n[e].bounds=i,u.set(n[e].movable,i)}return u.set(n[n.length-1].movable,n[n.length-1].bounds),u},Ed=e=>t=>{if(!t.getContent().acceptFlip)return;t.setFlip({[e]:!t.getFlip()[e]});let n=t.getRotation()%360;n&&t.setRotation((360-n)%360)},Dd=e=>{let t=e.getContent();return!0===t?.isIGroup?t:null},Od=(e,t)=>n=>{let r=n.getBounds();r&&n.setBounds({x:r.x+e,y:r.y+t})},kd=(e,t)=>n=>{let r=n.getBounds();if(!r)return;let i=t?1+e:1/(1+e),a=Math.sqrt(r.width**2+r.height**2),o=Math.atan2(r.height,r.width),s=i*a;if(s<10)return;let c=s*Math.cos(o),l=s*Math.sin(o);n.setBounds({x:r.x+(r.width-c)/2,y:r.y+(r.height-l)/2,width:c,height:l})},Ad=e=>t=>{t.setRotation(t.getRotation()+e)};function jd(e,t){let n=t.sheet;if(!n)return()=>{};let r=t,i=r?.notifier,a=r?.editModeHandler,o=(t,r,o,s)=>{e.updateCommand(t,{tags:[`noTransaction`,`noRepeat`],callback:()=>((e,t,r)=>{let o=n.getView().getMovableSelection();if(!o.isEmpty())try{n.doBatch(()=>{let e=o.getItems();if(e.length===0)return;let n=r?.(e);for(let r of e)t(r,n)},{description:e}),a?.setMode(null)}catch(e){i?.showError?.(e)}})(r,o,s)})},s=null,c=null,l=e=>{e!==s&&(c?.(),c=e?.addListeners({onAnyChange:u,onInvalidated:u},{transactional:!1})??null,s=e)},u=()=>{let t=n.getView().getMovableSelection(),r=t.getItems(),i=t.getActive();l(i),e.updateCommand(`groupDrawings`,{disabledReasons:r.length<2?[S(`reason.groupNeedsTwo`)]:[]}),e.updateCommand(`ungroupDrawings`,{disabledReasons:r.some(e=>Dd(e)!==null)?[]:[S(`reason.noGroupSelected`)]});let a=r.some(e=>!!e.getContent().acceptFlip)?[]:[S(`reason.cannotFlip`)];e.updateCommand(`formatDrawFlipHorizontal`,{disabledReasons:a}),e.updateCommand(`formatDrawFlipVertical`,{disabledReasons:a}),e.updateCommand(`formatAnchorTypeTwoCell`,{state:i?.getAnchorType?.()===Dn.Type.TwoCell}),e.updateCommand(`formatAnchorTypeOneCell`,{state:i?.getAnchorType?.()===Dn.Type.OneCell}),e.updateCommand(`formatAnchorTypeAbsolute`,{state:i?.getAnchorType?.()===Dn.Type.Absolute}),e.updateCommand(`toggleLockAspectRatio`,{state:i?.isLockAspectRatio()??!1});let o=i?.getFlip();e.updateCommand(`formatDrawFlipHorizontal`,{state:o?.horizontal??!1}),e.updateCommand(`formatDrawFlipVertical`,{state:o?.vertical??!1}),d()},d=()=>{f&&e.updateCommand(`formatMovable`,{state:r.taskPaneArea?.getActive()===`formatMovable`})},f=!1,p=()=>{if(n.getView().getMovableSelection().isEmpty())return f&&=(e.remove(),!1),void l(null);f||=((()=>{o(`moveToFront`,S(`op.bringToFront`),e=>e.moveToFront()),o(`moveForward`,S(`op.bringForward`),e=>e.moveForward()),o(`moveToBack`,S(`op.sendToBack`),e=>e.moveToBack()),o(`moveBackward`,S(`op.sendBackward`),e=>e.moveBackward()),o(`toggleLockAspectRatio`,S(`op.lockAspectRatio`),e=>e.setLockAspectRatio(!e.isLockAspectRatio())),o(`formatAnchorTypeTwoCell`,S(`op.anchor`),e=>e.setAnchorType(Dn.Type.TwoCell)),o(`formatAnchorTypeOneCell`,S(`op.anchor`),e=>e.setAnchorType(Dn.Type.OneCell)),o(`formatAnchorTypeAbsolute`,S(`op.anchor`),e=>e.setAnchorType(Dn.Type.Absolute)),o(`formatDrawAlignLeft`,S(`op.alignLeft`),(e,t)=>e.setBounds({x:t.x}),wd),o(`formatDrawAlignCenter`,S(`op.alignCenter`),(e,t)=>e.setBounds({x:(t.width-e.getBounds().width)/2+t.x}),wd),o(`formatDrawAlignRight`,S(`op.alignRight`),(e,t)=>e.setBounds({x:t.width-e.getBounds().width+t.x}),wd),o(`formatDrawAlignTop`,S(`op.alignTop`),(e,t)=>e.setBounds({y:t.y}),wd),o(`formatDrawAlignMiddle`,S(`op.alignMiddle`),(e,t)=>e.setBounds({y:(t.height-e.getBounds().height)/2+t.y}),wd),o(`formatDrawAlignBottom`,S(`op.alignBottom`),(e,t)=>e.setBounds({y:t.height-e.getBounds().height+t.y}),wd),o(`formatDrawDistributeHorz`,S(`op.distributeHorizontally`),(e,t)=>e.setBounds(t.get(e)),e=>Td(e,!0)),o(`formatDrawDistributeVert`,S(`op.distributeVertically`),(e,t)=>e.setBounds(t.get(e)),e=>Td(e,!1)),o(`formatDrawNudgeLeft`,S(`op.nudgeMovable`),Od(-1,0)),o(`formatDrawNudgeRight`,S(`op.nudgeMovable`),Od(1,0)),o(`formatDrawNudgeUp`,S(`op.nudgeMovable`),Od(0,-1)),o(`formatDrawNudgeDown`,S(`op.nudgeMovable`),Od(0,1)),o(`formatDrawNudgeLeftLarge`,S(`op.nudgeMovable`),Od(-10,0)),o(`formatDrawNudgeRightLarge`,S(`op.nudgeMovable`),Od(10,0)),o(`formatDrawNudgeUpLarge`,S(`op.nudgeMovable`),Od(0,-10)),o(`formatDrawNudgeDownLarge`,S(`op.nudgeMovable`),Od(0,10)),o(`formatDrawSizeIncrease`,S(`op.resizeMovable`),kd(.1,!0)),o(`formatDrawSizeDecrease`,S(`op.resizeMovable`),kd(.1,!1)),o(`formatDrawRotateLeft`,S(`op.rotateMovable`),Ad(-10)),o(`formatDrawRotateRight`,S(`op.rotateMovable`),Ad(10)),o(`formatDrawFlipHorizontal`,S(`op.flipMovable`),Ed(`horizontal`)),o(`formatDrawFlipVertical`,S(`op.flipMovable`),Ed(`vertical`)),e.updateCommand(`groupDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=n.getView().getMovableSelection(),t=e.getItems();if(!(t.length<2))try{await(e.getContainer()?.getMovables()??n.getMovables()).group(t),a?.setMode(null)}catch(e){i?.showError?.(e)}}}),e.updateCommand(`ungroupDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=n.getView().getMovableSelection().getItems().map(Dd).filter(e=>!!e);if(e.length!==0)try{await n.doBatch(async()=>{for(let t of e)await t.ungroup()},{description:S(`op.ungroupDrawings`)}),a?.setMode(null)}catch(e){i?.showError?.(e)}}}),o(`deleteDrawings`,S(`op.deleteMovable`),e=>e.getContent().delete()),e.updateCommand(`selectAllDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n.getView().getMovableSelection(),t=n.getMovables().getItems().filter(e=>e.getContent().getType()!==`note`||!e.isHidden()),r=e.getActive(),i=!!r&&t.includes(r);e.select(i?[...t.filter(e=>e!==r),r]:t)}});let t=e=>{n.getView().getMovableSelection().traverse(e).getActive()?.select({scrollIntoView:!0})};e.updateCommand(`selectNextDrawing`,{tags:[`noTransaction`,`noRepeat`],callback:()=>t(!1)}),e.updateCommand(`selectPreviousDrawing`,{tags:[`noTransaction`,`noRepeat`],callback:()=>t(!0)}),e.updateCommand(xd,{tags:[`noTransaction`,`noRepeat`],callback:()=>{Cd(),r.activateTaskPane?.(xd)}}),e.updateCommand(`clearDrawingSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{n.getView().getMovableSelection().clear()}})})(),!0),u()};p();let m=n.getView().addListeners({onMovableSelectionChange:p}),h=r.taskPaneArea?.addListener({onChange:d});return()=>{m(),h?.(),l(null)}}var Md=(0,X.createContext)(void 0),Nd={activate(e,t){console.warn(`No TaskPaneArea available to activate task pane`,e,t)},canActivate:e=>!1,getActive:()=>null,getOpen:()=>h.EmptyArray,close:e=>h.DonePromise,addListener:()=>()=>{}},Pd=(e=!1)=>{let t=(0,X.useContext)(Md),[n,r]=(0,X.useReducer)(e=>e+1,0);return(0,X.useEffect)(()=>{if(!e&&t)return t.addListener({onChange:()=>{r()}})},[t]),t||Nd},Fd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,title:r,icon:i,onClose:a,readOnly:o,focused:s,side:c=`right`,style:l,className:u,...d}=e,f=(0,X.useMemo)(()=>Q(`taskpane-title`,u,bd.TaskPaneTitle,{focused:s}),[u,s]);return(0,Z.jsxs)(`div`,{ref:t,className:f,style:l,...d,children:[(0,Z.jsx)(`div`,{className:`title`,style:{flex:`1 1 100%`},children:r}),(0,Z.jsx)(`div`,{"aria-label":`close`,role:`button`,style:{width:24,height:24,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},onPointerDown:e=>{e.stopPropagation()},onPointerUp:()=>{a()},children:(0,Z.jsx)(`div`,{style:{fontSize:`0.7em`},children:`✕`})})]})}));Fd.displayName=`TaskPaneTitle`;var Id=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,entry:r,close:i,listenerContainer:a,model:o,args:s,onMounted:c,onUnmounted:l,wrapperPane:u,propsPane:d,componentTitle:f=Fd,style:p,className:m,...h}=e,[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),b=G(i,[i]),x=ce(),S=(0,X.useRef)(null),C=(0,X.useRef)(null);(0,X.useEffect)(()=>(c?.(r),()=>{l?.(r)}),[r]);let w=(0,X.useRef)([]),T=(0,X.useMemo)(()=>({addListener:e=>{let t=a?.(e)??(()=>{});return w.current.push(t),t},close:()=>{b?.()},focus:e=>{S.current?.focus(e)}}),[a]);(0,X.useEffect)(()=>()=>{for(let e of w.current)e();w.current=[]},[]);let E=(0,X.useMemo)(()=>{let e=r.componentTitle??f;return(0,Z.jsx)(e,{ref:C,title:r.getTitle(),icon:null,readOnly:!1,focused:v!==null,onClose:b,onPointerDown:e=>{}})},[r,f,v,x]),D=(0,X.useMemo)(()=>{let e=r.component,n=u,i=(0,Z.jsx)(e,{entryKey:r.key,model:o,args:s,frame:T,ref:t,...d});return n&&(i=(0,Z.jsx)(n,{children:i})),i},[r,o,s,T,t,u]);return(0,Z.jsxs)(`div`,{className:Q(`taskpane-frame`,m,bd.TaskPaneFrame),tabIndex:0,ref:S,style:p,onPointerDown:async e=>{let t=e.currentTarget;t.contains(document.activeElement)||t.focus()},onFocus:e=>{e.relatedTarget&&!g&&_(e.relatedTarget),y(e.currentTarget)},onBlur:e=>{g&&!S?.current?.contains(e.relatedTarget)&&_(null),e.relatedTarget&&y(null)},...h,children:[(0,Z.jsx)(`div`,{style:{flex:`0 0 auto`,display:`flex`,flexDirection:`column`,width:`100%`,alignItems:`stretch`,justifyContent:`stretch`},children:E}),(0,Z.jsx)(`div`,{className:`taskpane-frame-content`,style:{flex:`1 1 auto`,minHeight:0,width:`100%`,overflow:`auto`,height:`100%`,display:`flex`},children:D})]})}));Id.displayName=`TaskPaneFrame`;var Ld=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,title:r,side:i=`right`,taskPanes:a,onSelect:o,selected:s,registry:c=yd,style:l,iconsOnly:u,className:d,...f}=e,p=ce(),m=(0,X.useMemo)(()=>a.map(e=>{let t=c.getRegisteredTaskPane(e);if(!t)return null;let n=t.getIcon?.();typeof n==`string`&&(n=(0,Z.jsx)(j,{iconKey:n}));let r=t.getTitle(),i=e===s,a=!n||!u&&i;return(0,Z.jsxs)(`div`,{title:a?void 0:r,className:Q(`taskpane-strip-item`,bd.TaskPaneStripItem,{selected:i}),onClick:()=>o(e),children:[n?(0,Z.jsx)(`span`,{className:bd.TaskPaneStripItemIcon,children:n}):null,(0,Z.jsx)(`span`,{className:Q(bd.TaskPaneStripItemLabel,{[bd.TaskPaneStripItemLabelOpen]:a}),children:(0,Z.jsx)(`span`,{className:bd.TaskPaneStripItemLabelClip,children:(0,Z.jsx)(`span`,{className:bd.TaskPaneStripItemLabelText,children:r})})})]},e)}),[a,s,o,c,u,p]),h=je(t,()=>({isTaskPaneStrip:()=>!0}),[]),g=(0,X.useMemo)(()=>Q(`taskpane-strip`,d,bd.TaskPaneStrip),[d]);return(0,Z.jsx)(`div`,{ref:h,className:g,style:l,...f,children:m})}));Ld.displayName=`TaskPaneStrip`;var Rd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{className:n=``,registry:r=yd,model:i,onOpen:a,onClose:o,wrapperPane:s,propsPane:c,wrapperFrame:l,propsFrame:u,componentTitle:d,componentStrip:f=Ld,alwaysShowStrip:p,side:m=`right`,style:h}=e,g=m!==`right`,_=G(a,[a]),v=G(o,[o]),[y,b]=(0,X.useState)(null),x=(0,X.useRef)(null),[S,C]=(0,X.useState)([]),[w,T]=(0,X.useState)({}),E=G((e,t)=>{T(n=>{if(n[e]===t)return n;let r={...n};return t===void 0?delete r[e]:r[e]=t,r})},[]),D=(0,X.useRef)(new Set),O=(0,X.useRef)(new Set),k=G(()=>{let e=Array.from(O.current);for(let t of e)try{t.onChange?.()}catch(e){console.error(`Error in TaskPaneArea listener:`,e)}},[]),A=G(async(e,t=!1)=>{let n=Array.from(D.current),r=n.length,i=!0;for(let e=0;i&&e<r;e++){let t=n[e];if(t.onBeforeHide)try{!1===await Promise.resolve(t.onBeforeHide())&&(i=!1)}catch{i=!1}}return i},[]),j=G(e=>{let t=Array.from(D.current),n=t.length,r=S.findIndex(t=>t.key===e);if(r===-1)return;let i=[...S];if(i.splice(r,1),E(e,void 0),C(i),i.length===0)b(null),x.current=null,v?.();else{let e=i[Math.min(r,i.length-1)];b(e),x.current=e.key,e.keepMounted&&requestAnimationFrame(()=>e.refPaneEl?.current?.focus?.())}for(let e=0;e<n;e++){let n=t[e];try{n.onHide?.()}catch{}}},[v,S]),M=G(async(e,t)=>{let n=r.getRegisteredTaskPane(e);if(!n)return void console.warn(`Invalid taskpane '${e}'`);let a=x.current===e,o=S.find(t=>t.key===e);if(a&&!o)return void E(e,t?.args);if(!a&&y&&!await A(y.key))return;if(o)return E(e,t?.args),b(o),x.current=e,void((o.keepMounted||a)&&requestAnimationFrame(()=>o.refPaneEl?.current?.focus?.()));E(e,t?.args);let l=(0,X.createRef)(),f={current:null},p={key:e,elem:(0,Z.jsx)(Id,{ref:e=>{f.current=e,e===null&&(x.current=null)},entry:n,model:i,close:async()=>{await A(e)&&j(e)},wrapperPane:s,propsPane:c,componentTitle:d,listenerContainer:e=>(D.current.add(e),()=>{D.current.delete(e)}),onMounted:t=>{t.key===e&&(x.current=null),_?.()},onUnmounted:e=>{},...u}),ref:l,keepMounted:n.keepMounted,refPaneEl:f};C(t=>{if(t.findIndex(t=>t.key===e)!==-1)return t;let n=[...t];return n.push(p),n}),b(p),x.current=e},[y,S,c,d]);(0,X.useEffect)(()=>{y&&!x.current&&M(y.key,{args:w[y.key]}),k()},[u,i,S,y,w]);let N=je(t,()=>{let e=Object.freeze(S.map(e=>e.key));return{activate:M,canActivate:e=>r.getRegisteredTaskPane(e)!==null,getActive:()=>y?.key??null,getOpen:()=>e,async close(e){await A(e)&&j(e)},addListener:e=>(O.current.add(e),()=>{O.current.delete(e)})}},[r,c,i,y,S]),P=(0,X.useMemo)(()=>{if(S.length<=1&&!p)return null;let e={className:bd.TaskPaneAreaStrip,taskPanes:Object.freeze(S.map(e=>e.key)),selected:y?.key,side:m,onSelect:e=>{M(e)},registry:r};return(0,Z.jsx)(f,{...e})},[S,y,r,p,m,f]),F=e=>(0,X.cloneElement)(e.elem,{model:i,args:w[e.key],propsPane:c,wrapperPane:s,componentTitle:d,...u}),I=y?.key??null,L=l,R=S.length===0?null:(0,Z.jsx)(`div`,{className:bd.TaskPaneAreaFrames,style:{display:`flex`,flex:`1 1 100%`,minWidth:0,minHeight:0,position:`relative`},children:S.map(e=>{let t=e.key===I;return t||e.keepMounted?(0,Z.jsx)(`div`,{className:Q(bd.TaskPaneAreaFrameHost,!t&&bd.TaskPaneAreaFrameHidden),style:{display:t?`flex`:`none`,flex:`1 1 100%`,minWidth:0,minHeight:0},children:L?(0,Z.jsx)(L,{children:F(e)}):F(e)},e.key):null})}),ee=g?P:R,z=g?R:P;return(0,Z.jsxs)(`div`,{ref:N,className:Q(`taskpane-area`,n,bd.TaskPaneArea),style:h,children:[ee,z]})}));Rd.displayName=`TaskPaneArea`;var zd=`formatCellControl`,Bd=e=>{let{model:t,entryKey:n,args:r,frame:i,ref:a,className:o,...s}=e,c=l(),u=z(),[,d]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!c)return;let e=c.getSelection().addListeners({onChange:d}),t=c.addListeners({onCellControlsChange:d}),n=Lr(d);return()=>{e(),t(),n()}},[c]);let f=c?(e=>{let t=e.getSelection().getCell(),n=t.getControl();return n?{cell:t,entry:Fr(n.getType())??null,control:n}:{cell:t,entry:Ir(t)?.entry??null,control:null}})(c):null,p;if(c&&f?.entry){if(f.entry.pane){let e=f.entry.pane;p=(0,Z.jsx)(e,{sheet:c,cell:f.cell,control:f.control},f.cell.getAddress())}else p=(0,Z.jsx)(`div`,{className:bd.MovablePaneEmpty,children:u(`cellControl.pane.none`)})}else p=(0,Z.jsx)(`div`,{className:bd.MovablePaneEmpty,children:u(`cellControl.pane.empty`)});return(0,Z.jsxs)(`div`,{ref:a,className:Q(`sxl-cell-control-pane`,o,bd.MovablePane),...s,children:[f?.control?(0,Z.jsx)(`div`,{className:bd.MovablePaneKind,children:f.control.getType()}):null,p]})};function Vd(){yd.getRegisteredTaskPane(`formatCellControl`)||yd.registerTaskPane({key:`formatCellControl`,getTitle:()=>`formatCellControl`,component:Bd})}var Hd=_e.isEditable,Ud=[`copy`,`cut`,`paste`,`selectAll`,`undo`,`redo`];function Wd(e){let{clipboard:t}=e,n=new Set(e.keys??Ud);return(e,r)=>{if(!n.has(e)||!Hd(r))return;let i=r;switch(e){case`copy`:return{callback:()=>async function(e,t){let n=Jd(e);n&&await t.writeText(n)}(i,t.getClipboard()),disabledReasons:Kd(i)?[]:[S(`reason.noSelection`)]};case`cut`:return{callback:()=>async function(e,t){let n=Jd(e);n&&(await t.writeText(n),function(e){if(!(typeof document<`u`&&document.execCommand(`delete`))&&Gd(e)){let t=e.selectionStart??0,n=e.selectionEnd??t;if(t===n)return;e.setRangeText(``,t,n,`end`),e.dispatchEvent(new Event(`input`,{bubbles:!0}))}}(e))}(i,t.getClipboard()),disabledReasons:Kd(i)?[]:[S(`reason.noSelection`)]};case`paste`:return{callback:()=>async function(e,t){let n=await t.readText();n&&function(e,t){if(Gd(e)){let n=e.selectionStart??e.value.length;_e.replaceRangeText(e,n,e.selectionEnd??n,t)}else typeof document<`u`&&document.execCommand(`insertText`,!1,t)}(e,n)}(i,t.getClipboard())};case`selectAll`:return{callback:()=>function(e){Gd(e)?e.select():typeof document<`u`&&document.execCommand(`selectAll`)}(i),disabledReasons:qd(i)?[]:[S(`reason.nothingToSelect`)]};case`undo`:return{callback:()=>Yd(`undo`)};case`redo`:return{callback:()=>Yd(`redo`)};default:return}}}function Gd(e){let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`}function Kd(e){if(Gd(e))return(e.selectionStart??0)!==(e.selectionEnd??0);let t=typeof window<`u`?window.getSelection():null;return!!t&&!t.isCollapsed&&t.toString().length>0}function qd(e){return Gd(e)?e.value.length>0:(e.textContent??``).length>0}function Jd(e){return Gd(e)?e.value.substring(e.selectionStart??0,e.selectionEnd??0):(typeof window<`u`?window.getSelection()?.toString():``)??``}function Yd(e){typeof document<`u`&&document.execCommand(e)}var{useCommandResolver:Xd}=fe,Zd=()=>{let e=ae(),t=(0,X.useRef)(e);t.current=e;let n=(0,X.useMemo)(()=>Wd({clipboard:{getClipboard:()=>t.current.getClipboard()}}),[]),r=Xd();return(0,X.useEffect)(()=>{if(!r)return;let e=r.addResolveInjector(n),t=()=>r.invalidate();return document.addEventListener(`selectionchange`,t),()=>{e(),document.removeEventListener(`selectionchange`,t)}},[r,n]),null};Zd.displayName=`InputClipboardInjector`;var Qd=(0,X.createContext)(null);function $d(){return(0,X.useContext)(Qd)}var{CommandScopeContext:ef,CommandChainContext:tf,useCommandScope:nf,LayerActivation:rf}=fe,af=({pane:e,children:t})=>{let n=nf(),r=e.getAnchor(),i=(0,X.useMemo)(()=>n?new rf(n.createChild(`pane:${r}`)):null,[n,r]);return(0,X.useEffect)(()=>{let e=i?.getBase();return()=>e?.dispose()},[i]),(0,X.useEffect)(()=>{if(i)return fe.attachWhenReady({get current(){return e.getElement()??null}},e=>i.getBase().attachElement(e,i))},[e,i]),i?(0,Z.jsx)(tf.Provider,{value:i,children:(0,Z.jsx)(ef.Provider,{value:i.getBase(),children:t})}):t};af.displayName=`PaneScopeProvider`;var of={"autoFill.preset.copy":`Copy Cells`,"autoFill.preset.dateDays":`Day`,"autoFill.preset.dateMonthEnd":`Month End`,"autoFill.preset.dateMonths":`Month`,"autoFill.preset.dateWeekdays":`Weekday`,"autoFill.preset.dateYears":`Year`,"autoFill.preset.growth":`Growth`,"autoFill.preset.growthTrend":`Growth Trend`,"autoFill.preset.linear":`Linear`,"autoFill.preset.linearTrend":`Linear Trend`,"autoFill.preset.series":`AutoFill`,"cellControl.pane.empty":`Select a cell with a control to see its options.`,"cellControl.pane.none":`This control has no options.`,"cellError.description.blocked":`Access to the data was blocked`,"cellError.description.busy":`The value is still being calculated`,"cellError.description.calc":`The formula cannot be calculated, for example an empty array`,"cellError.description.connect":`The data source could not be reached`,"cellError.description.div0":`Dividing by zero or an empty cell`,"cellError.description.field":`The field does not exist in the data type`,"cellError.description.gettingData":`The data is still being retrieved`,"cellError.description.nA":`A value is not available to the formula or function`,"cellError.description.name":`The formula uses a name or function that is not recognized`,"cellError.description.null":`The ranges given do not intersect`,"cellError.description.num":`A number is not valid, or the result is too large or too small`,"cellError.description.parse":`The formula could not be read`,"cellError.description.python":`The Python code returned an error`,"cellError.description.ref":`A reference is not valid, often because its cells were deleted`,"cellError.description.spill":`The result cannot spill: cells in its way are not empty`,"cellError.description.timeout":`The calculation took too long`,"cellError.description.unknown":`The data type is not recognized`,"cellError.description.value":`A value is the wrong type for the formula or function`,"cellError.error":`Error`,"cellError.warning":`Warning`,"cellInsert.columnHere":`Insert column here`,"cellInsert.rowHere":`Insert row here`,"chart.type.area":`Area Chart`,"chart.type.areaStacked":`Stacked Area Chart`,"chart.type.areaStackedPercent":`Percentage Area Chart`,"chart.type.bar":`Bar Chart`,"chart.type.barStacked":`Bar Stacked Chart`,"chart.type.barStackedPercent":`Bar Percent Chart`,"chart.type.bubble":`Bubble Chart`,"chart.type.bubble3D":`3D Bubble Chart`,"chart.type.column":`Column Chart`,"chart.type.columnStacked":`Stacked Column Chart`,"chart.type.columnStackedPercent":`Stacked Percentage Column Chart`,"chart.type.line":`Line Chart`,"chart.type.lineMarkers":`Line with Markers Chart`,"chart.type.lineStacked":`Stacked Line Chart`,"chart.type.lineStackedMarkers":`Line Stacked with Markers Chart`,"chart.type.lineStackedPercent":`Stacked Percentage Line Chart`,"chart.type.lineStackedPercentMarkers":`Line Percentage with Markers Chart`,"chart.type.pie":`Pie Chart`,"chart.type.pieDoughnut":`Pie Doughnut Chart`,"chart.type.scatterLines":`Scatter Chart with Lines`,"chart.type.scatterLinesMarkers":`Scatter Chart with Markers and Lines`,"chart.type.scatterLinesMarkersSmooth":`Scatter Chart with Markers and Smooth Lines`,"chart.type.scatterLinesSmooth":`Scatter Chart with Smooth Lines`,"chart.type.scatterMarkers":`Scatter Chart with Markers`,"checklist.add":`Add "{text}"`,"checklist.byValue":`By value`,"checklist.count":`{checked} / {total}`,"checklist.countFiltered":`{checked} / {total} (filtered)`,"checklist.searchOptions":`Search options`,"checklist.searchOrAdd":`Search or add`,"checklist.selectAll":`Select All`,"checklist.truncated":`(truncated)`,"checklist.truncatedDetail":`Not all unique items are listed.`,"circular.converged":`{count, plural, one {Converged after # iteration} other {Converged after # iterations}}`,"circular.reads":`Reads a circular reference at`,"circular.title":`Circular reference`,"circular.unconverged":`{count, plural, one {Did not converge after # iteration} other {Did not converge after # iterations}} (last change {change})`,"circular.unconvergedNoChange":`{count, plural, one {Did not converge after # iteration} other {Did not converge after # iterations}}`,"clipboard.pasting":`Pasting...`,"dialog.activate":`Activate`,"dialog.activateTask.inputLabel":`Task Name`,"dialog.activateTask.title":`Activate Task`,"dialog.change":`Change`,"dialog.changePicture.description":`Enter the web address for the picture to show instead.`,"dialog.changePicture.title":`Change Picture from Web`,"dialog.chartSelectData.description":`Enter the address of the cells to plot, with the series names and categories around them.`,"dialog.chartSelectData.inputLabel":`Data range`,"dialog.chartSelectData.title":`Select Data`,"dialog.confirm.title":`Confirm`,"dialog.goTo":`Go To`,"dialog.goTo.inputLabel":`Location`,"dialog.goTo.title":`Go To`,"dialog.insert":`Insert`,"dialog.insertImage.description":`Enter the web address for the image to insert.`,"dialog.insertImage.inputLabel":`Address`,"dialog.insertImage.title":`Insert Image from Web`,"dialog.newCellStyle.description":`Enter a name for the new cell style.`,"dialog.newCellStyle.inputLabel":`Style Name`,"dialog.newCellStyle.title":`New Cell Style`,"dialog.password.description":`Enter the password to unprotect this sheet.`,"dialog.password.incorrect":`That password is incorrect.`,"dialog.password.pauseDescription":`Enter the password to pause protection on this sheet.`,"dialog.password.required":`Enter a password.`,"dialog.password.title":`Password Required`,"dialog.pause":`Pause`,"dialog.select":`Select`,"dialog.sheetBackground.description":`Enter the web address for the background image.`,"dialog.sheetBackground.title":`Sheet Background from Web`,"dialog.unlock":`Unlock`,"dialog.unlockRange.description":`Enter the password to edit ''{name}''.`,"dialog.unlockRange.descriptionMany":`Enter the password for one of the ranges that cover this cell.`,"dialog.unlockRange.title":`Unlock Range`,"dialog.unprotect":`Unprotect`,"editMode.copy":`'Copy' Select destination and press ENTER or choose Paste.`,"editMode.cut":`'Cut' Select destination and press ENTER or choose Paste.`,"editMode.dragCopy":`Drag selection to copy cell contents.`,"editMode.dragCopyInsert":`Drag selection to insert copied cell contents.`,"editMode.dragCut":`Drag selection to move cell contents.`,"editMode.dragCutInsert":`Drag selection to insert cell contents.`,"editMode.edit":`Edit`,"editMode.enter":`Enter`,"editMode.fill":`Drag selection to extend series or fill.`,"editMode.formatPainter":`Use the mouse to apply the copied format to another selection.`,"error.clipboard.perms":`You do not have permissions to access the clipboard.
|
|
12
|
+
All copy and paste operations will be limited to the browser tab.`,"error.clipboard.safari":`The Safari browser does not support advanced copy and paste.
|
|
13
|
+
Copy and paste will be limited to within the browser tab.
|
|
14
|
+
|
|
15
|
+
Please use Chrome or Edge if external copy and paste is required.`,"error.fillSeries.invalidSelection":`Can not fill a series from this selection. Select the values to continue along with the cells to fill.`,"error.fillSeries.multipleRanges":`Can not fill a series across multiple cell ranges. Please select a single range and try again.`,"error.fillSeries.unknownType":`Unknown fill type.`,"error.group.multipleRanges":`Can not group multiple cell ranges. Please select a single range and try again.`,"error.insertImage.unresolved":`Unable to resolve image. {detail}`,"error.removeDuplicates.multipleRanges":`Can not perform Remove Duplicates on multiple cell ranges. Please select a single range and try again.`,"error.sheet.arrayFixedMultipleRanges":`An array formula can't be entered over a multiple selection.`,"error.sort.invalidSelection":`Invalid sort selection. Sort requires a single range with data.`,"error.sort.multipleRanges":`Can not sort on multiple cell ranges. Please select a single range and try again.`,"error.textToColumns.multipleRanges":`Can not perform Text to Columns on multiple cell ranges. Please select a single range and try again.`,"error.ungroup.multipleRanges":`Can not ungroup multiple cell ranges. Please select a single range and try again.`,"findReplace.replaced":`We replaced {count} cells.`,"formulaInput.equalsRequired":`Formula must start with '='.`,"formulaInput.invalid":`Invalid Formula`,"formulaInput.required":`Formula is required`,"formulaTrace.noDependents":`No formulas refer to the selected cells.`,"formulaTrace.noPrecedents":`The selected cells have no formulas that refer to other cells.`,"functionPreview.anyValue":`Any value`,"functionPreview.close":`Close`,"functionPreview.collapse":`Collapse`,"functionPreview.enumOutOfSet":`{value} is not one of this argument's values: {values}`,"functionPreview.expand":`Expand`,"functionPreview.optional":`Optional`,"functionPreview.repeatable":`Repeatable`,"functionPreview.type":`Type: {type}`,"functionPreview.typeName.boolean":`logical`,"functionPreview.typeName.error":`error`,"functionPreview.typeName.null":`empty`,"functionPreview.typeName.number":`number`,"functionPreview.typeName.richData":`data`,"functionPreview.typeName.string":`text`,"hyperlink.copy":`Copy link`,"hyperlink.edit":`Edit link`,"hyperlink.open":`Open link`,"hyperlink.remove":`Remove link`,"movable.contentError":`Unable to show ''{type}'': {message}`,"movable.pane.empty":`Select a drawing to format it.`,"movable.pane.none":`{kind} has no format options.`,"movable.tip.position":`{x}, {y}`,"movable.tip.rotation":`{degrees}°`,"movable.tip.size":`{width} × {height}`,"movable.unsupportedType":`Unsupported type: ''{type}''.`,"namedInput.invalid":`Invalid Name`,"op.alignBottom":`Align Bottom`,"op.alignCenter":`Align Center`,"op.alignLeft":`Align Left`,"op.alignMiddle":`Align Middle`,"op.alignRight":`Align Right`,"op.alignTop":`Align Top`,"op.anchor":`Anchor`,"op.bringForward":`Bring Forward`,"op.bringToFront":`Bring to Front`,"op.convertTableToRange":`Convert Table to Range`,"op.copyCells":`Copy Cells`,"op.deleteMovable":`Delete`,"op.deleteTable":`Delete Table`,"op.distributeHorizontally":`Distribute Horizontally`,"op.distributeVertically":`Distribute Vertically`,"op.findReplace":`Find & Replace`,"op.flipMovable":`Flip`,"op.insertMovedCells":`Insert Moved Cells`,"op.lockAspectRatio":`Lock Aspect Ratio`,"op.mergeCells":`Merge Cells`,"op.moveCells":`Move Cells`,"op.moveMovable":`Move`,"op.nudgeMovable":`Nudge`,"op.pivotValueSettings":`PivotTable Value Settings`,"op.resizeColumnsNamed":`{count, plural, one {Resize Column ''{name}''} other {Resize Columns ''{name}''}}`,"op.resizeMovable":`Resize`,"op.resizeRowsNamed":`{count, plural, one {Resize Row ''{name}''} other {Resize Rows ''{name}''}}`,"op.rotateMovable":`Rotate`,"op.sendBackward":`Send Backward`,"op.sendToBack":`Send to Back`,"op.sortCustom":`Custom Sort`,"op.typeInto":`Type ''{text}'' into {range}`,"op.unmergeCells":`Unmerge Cells`,"op.updateHyperlink":`Update Hyperlink`,"opaqueSheet.carried":`This sheet is kept as it was read and saved unchanged. It can be renamed, moved, hidden, colored or deleted, but not displayed yet.`,"opaqueSheet.kind.chart":`Chart sheet`,"opaqueSheet.kind.dialog":`Dialog sheet (Excel 5)`,"opaqueSheet.kind.macro":`Excel 4.0 macro sheet`,"outline.collapse":`Collapse`,"outline.expand":`Expand`,"outline.showLevel":`Show level {level}`,"picker.clearSearch":`Clear search`,"picker.noMatches":`No matches`,"picker.noValues":`No values`,"picker.search":`Search`,"pivot.area.column":`Columns`,"pivot.area.hint":`Drag fields here`,"pivot.area.page":`Filters`,"pivot.area.row":`Rows`,"pivot.area.values":`Values`,"pivot.chip.filtered":`Filtered`,"pivot.chip.rename":`Name`,"pivot.chip.valuesAsColumns":`Values as columns`,"pivot.chip.valuesAsRows":`Values as rows`,"pivot.empty.hintInside":`To build a report, choose fields from the PivotTable Field List`,"pivot.empty.hintOutside":`Click in this area to work with the PivotTable report`,"pivot.fields.list":`Fields`,"pivot.fields.none":`No field matches.`,"pivot.fields.search":`Search fields`,"pivot.function.average":`Average`,"pivot.function.count":`Count`,"pivot.function.countNums":`Count Numbers`,"pivot.function.max":`Max`,"pivot.function.min":`Min`,"pivot.function.product":`Product`,"pivot.function.stdDev":`StdDev`,"pivot.function.stdDevp":`StdDevp`,"pivot.function.sum":`Sum`,"pivot.function.var":`Var`,"pivot.function.varp":`Varp`,"pivot.menu.button":`Field options`,"pivot.menu.filter":`Filter…`,"pivot.menu.moveDown":`Move down`,"pivot.menu.moveTo.column":`Move to Columns`,"pivot.menu.moveTo.page":`Move to Filters`,"pivot.menu.moveTo.row":`Move to Rows`,"pivot.menu.moveTo.values":`Move to Values`,"pivot.menu.moveToEnd":`Move to end`,"pivot.menu.moveToStart":`Move to beginning`,"pivot.menu.moveUp":`Move up`,"pivot.menu.remove":`Remove`,"pivot.menu.sortAndFilter":`Sort and filter…`,"pivot.menu.valueSettings":`Value settings…`,"pivot.pane.deleted":`This PivotTable was deleted.`,"pivot.pane.empty":`Select a cell in a PivotTable to see its fields.`,"pivot.type.blank":`Blank`,"pivot.type.date":`Dates`,"pivot.type.mixed":`Mixed`,"pivot.type.number":`Numbers`,"pivot.type.text":`Text`,"reason.alreadyTable":`The selection is already in a table.`,"reason.cannotFlip":`None of the selected drawings can be flipped.`,"reason.cellHasNote":`The cell has a note.`,"reason.cellHasThread":`The cell has a threaded comment.`,"reason.chartTypeNotEditable":`A chart of this type cannot be edited yet; its title and legend can.`,"reason.connectorShape":`A line or connector cannot be changed to another shape.`,"reason.continuousSpan":`Not available with continuous / fill alignment.`,"reason.entireColumn":`Not available when entire columns are selected.`,"reason.entireRow":`Not available when entire rows are selected.`,"reason.freezeOrigin":`Select a cell below and/or right of where the panes should freeze.`,"reason.groupNeedsTwo":`Select two or more drawings to group.`,"reason.hyperlinkIsValue":`The link is the cell's value; change its formula to change it.`,"reason.mergeUnavailable":`Merge is not available for this selection.`,"reason.mixedSelection":`Not available for a mixed full / partial selection.`,"reason.noComments":`The sheet has no comments.`,"reason.noFreeze":`No frozen panes.`,"reason.noGroup":`The selection is not in a group.`,"reason.noGroupSelected":`No group is selected.`,"reason.noMerge":`No merged cells in the selection.`,"reason.noNote":`The cell has no note.`,"reason.noNotes":`The sheet has no notes.`,"reason.noPivotStyle":`No PivotTable style to clear.`,"reason.noPreviousSearch":`Nothing has been searched for yet.`,"reason.noSelection":`Nothing is selected.`,"reason.noSheetBackground":`The sheet has no background.`,"reason.noTableStyle":`No table style to clear.`,"reason.noTaskPane":`There is no task pane to show this in.`,"reason.nothingToRedo":`Nothing to redo.`,"reason.nothingToSelect":`Nothing to select.`,"reason.nothingToUndo":`Nothing to undo.`,"reason.notImplemented":`Not yet implemented.`,"reason.outlineTooDeep":`Groups can be nested no more than 7 levels deep.`,"reason.overlap":`Not available for an overlapping selection.`,"reason.pictureCropLocked":`The picture does not allow cropping.`,"reason.pictureNoHyperlink":`The picture has no link.`,"reason.protectionNotPausable":`Pausing needs a protected sheet.`,"reason.sheetLocked":`The sheet is locked.`,"reason.sheetProtected":`The sheet is protected.`,"reason.singleColumn":`Select a single column.`,"reason.sortRange":`Sort requires a single range.`,"reason.tableAmbiguous":`Select cells within a single table.`,"reason.tableBodyRows":`Select rows within the table body.`,"referenceInput.cancel":`Cancel`,"referenceInput.commit":`Commit`,"referenceInput.crossSheet":`Reference must be on the same sheet`,"referenceInput.invalid":`Invalid Reference`,"referenceInput.required":`Reference is required`,"referenceInput.selectCurrent":`Select Current Range`,"resizeIndicator.height":`Height`,"resizeIndicator.hiddenDisplay":`{label}: Hidden`,"resizeIndicator.sizeDisplay":`{label}: {unit} ({px} pixels)`,"resizeIndicator.sizeDisplayZoomed":`{label}: {unit} ({px} pixels; {screenPx} at {zoom}%)`,"resizeIndicator.width":`Width`,"scrollbar.column":`Column: {title}`,"scrollbar.row":`Row: {title}`,"selection.replace":`Replace`,"selection.replaceData":`There is already data here. Do you want to replace it?`,"selection.tip.columns":`{cols}C`,"selection.tip.rows":`{rows}R`,"selection.tip.size":`{rows}R × {cols}C`,"shape.category.basic":`Basic Shapes`,"shape.category.blockArrows":`Block Arrows`,"shape.category.callouts":`Callouts`,"shape.category.equation":`Equation Shapes`,"shape.category.flowchart":`Flowchart`,"shape.category.lines":`Lines`,"shape.category.more":`More Shapes`,"shape.category.rectangles":`Rectangles`,"shape.category.starsBanners":`Stars and Banners`,"shape.preset.accentBorderCallout1":`Callout: Line with Border and Accent Bar`,"shape.preset.accentBorderCallout2":`Callout: Bent Line with Border and Accent Bar`,"shape.preset.accentBorderCallout3":`Callout: Double Bent Line with Border and Accent Bar`,"shape.preset.accentCallout1":`Callout: Line with Accent Bar`,"shape.preset.accentCallout2":`Callout: Bent Line with Accent Bar`,"shape.preset.accentCallout3":`Callout: Double Bent Line with Accent Bar`,"shape.preset.actionButtonBackPrevious":`Action Button: Back or Previous`,"shape.preset.actionButtonBeginning":`Action Button: Beginning`,"shape.preset.actionButtonBlank":`Action Button: Blank`,"shape.preset.actionButtonDocument":`Action Button: Document`,"shape.preset.actionButtonEnd":`Action Button: End`,"shape.preset.actionButtonForwardNext":`Action Button: Forward or Next`,"shape.preset.actionButtonHelp":`Action Button: Help`,"shape.preset.actionButtonHome":`Action Button: Home`,"shape.preset.actionButtonInformation":`Action Button: Information`,"shape.preset.actionButtonMovie":`Action Button: Movie`,"shape.preset.actionButtonReturn":`Action Button: Return`,"shape.preset.actionButtonSound":`Action Button: Sound`,"shape.preset.arc":`Arc`,"shape.preset.bentArrow":`Arrow: Bent`,"shape.preset.bentConnector3":`Connector: Elbow`,"shape.preset.bentConnector3Arrow":`Connector: Elbow Arrow`,"shape.preset.bentConnector3ArrowDouble":`Connector: Elbow Double-Arrow`,"shape.preset.bentUpArrow":`Arrow: Bent-Up`,"shape.preset.bevel":`Bevel`,"shape.preset.blockArc":`Block Arc`,"shape.preset.borderCallout1":`Callout: Line`,"shape.preset.borderCallout2":`Callout: Bent Line`,"shape.preset.borderCallout3":`Callout: Double Bent Line`,"shape.preset.bracePair":`Double Brace`,"shape.preset.bracketPair":`Double Bracket`,"shape.preset.callout1":`Callout: Line with No Border`,"shape.preset.callout2":`Callout: Bent Line with No Border`,"shape.preset.callout3":`Callout: Double Bent Line with No Border`,"shape.preset.can":`Cylinder`,"shape.preset.chartPlus":`Chart Plus`,"shape.preset.chartStar":`Chart Star`,"shape.preset.chartX":`Chart X`,"shape.preset.chevron":`Arrow: Chevron`,"shape.preset.chord":`Chord`,"shape.preset.circularArrow":`Arrow: Circular`,"shape.preset.cloud":`Cloud`,"shape.preset.cloudCallout":`Thought Bubble: Cloud`,"shape.preset.corner":`L-Shape`,"shape.preset.cornerTabs":`Corner Tabs`,"shape.preset.cube":`Cube`,"shape.preset.curvedConnector3":`Connector: Curved`,"shape.preset.curvedConnector3Arrow":`Connector: Curved Arrow`,"shape.preset.curvedConnector3ArrowDouble":`Connector: Curved Double-Arrow`,"shape.preset.curvedDownArrow":`Arrow: Curved Down`,"shape.preset.curvedLeftArrow":`Arrow: Curved Left`,"shape.preset.curvedRightArrow":`Arrow: Curved Right`,"shape.preset.curvedUpArrow":`Arrow: Curved Up`,"shape.preset.decagon":`Decagon`,"shape.preset.diagStripe":`Diagonal Stripe`,"shape.preset.diamond":`Diamond`,"shape.preset.dodecagon":`Dodecagon`,"shape.preset.donut":`Circle: Hollow`,"shape.preset.doubleWave":`Double Wave`,"shape.preset.downArrow":`Arrow: Down`,"shape.preset.downArrowCallout":`Callout: Down Arrow`,"shape.preset.ellipse":`Oval`,"shape.preset.ellipseRibbon":`Ribbon: Curved and Tilted Down`,"shape.preset.ellipseRibbon2":`Ribbon: Curved and Tilted Up`,"shape.preset.flowChartAlternateProcess":`Flowchart: Alternate Process`,"shape.preset.flowChartCollate":`Flowchart: Collate`,"shape.preset.flowChartConnector":`Flowchart: Connector`,"shape.preset.flowChartDecision":`Flowchart: Decision`,"shape.preset.flowChartDelay":`Flowchart: Delay`,"shape.preset.flowChartDisplay":`Flowchart: Display`,"shape.preset.flowChartDocument":`Flowchart: Document`,"shape.preset.flowChartExtract":`Flowchart: Extract`,"shape.preset.flowChartInputOutput":`Flowchart: Data`,"shape.preset.flowChartInternalStorage":`Flowchart: Internal Storage`,"shape.preset.flowChartMagneticDisk":`Flowchart: Magnetic Disk`,"shape.preset.flowChartMagneticDrum":`Flowchart: Direct Access Storage`,"shape.preset.flowChartMagneticTape":`Flowchart: Sequential Access Storage`,"shape.preset.flowChartManualInput":`Flowchart: Manual Input`,"shape.preset.flowChartManualOperation":`Flowchart: Manual Operation`,"shape.preset.flowChartMerge":`Flowchart: Merge`,"shape.preset.flowChartMultidocument":`Flowchart: Multidocument`,"shape.preset.flowChartOfflineStorage":`Flowchart: Offline Storage`,"shape.preset.flowChartOffpageConnector":`Flowchart: Off-page Connector`,"shape.preset.flowChartOnlineStorage":`Flowchart: Stored Data`,"shape.preset.flowChartOr":`Flowchart: Or`,"shape.preset.flowChartPredefinedProcess":`Flowchart: Predefined Process`,"shape.preset.flowChartPreparation":`Flowchart: Preparation`,"shape.preset.flowChartProcess":`Flowchart: Process`,"shape.preset.flowChartPunchedCard":`Flowchart: Card`,"shape.preset.flowChartPunchedTape":`Flowchart: Punched Tape`,"shape.preset.flowChartSort":`Flowchart: Sort`,"shape.preset.flowChartSummingJunction":`Flowchart: Summing Junction`,"shape.preset.flowChartTerminator":`Flowchart: Terminator`,"shape.preset.foldedCorner":`Folded Corner`,"shape.preset.frame":`Frame`,"shape.preset.funnel":`Funnel`,"shape.preset.gear6":`Gear: 6 Teeth`,"shape.preset.gear9":`Gear: 9 Teeth`,"shape.preset.halfFrame":`Half Frame`,"shape.preset.heart":`Heart`,"shape.preset.heptagon":`Heptagon`,"shape.preset.hexagon":`Hexagon`,"shape.preset.homePlate":`Arrow: Pentagon`,"shape.preset.horizontalScroll":`Scroll: Horizontal`,"shape.preset.irregularSeal1":`Explosion: 8 Points`,"shape.preset.irregularSeal2":`Explosion: 14 Points`,"shape.preset.leftArrow":`Arrow: Left`,"shape.preset.leftArrowCallout":`Callout: Left Arrow`,"shape.preset.leftBrace":`Left Brace`,"shape.preset.leftBracket":`Left Bracket`,"shape.preset.leftCircularArrow":`Arrow: Circular Left`,"shape.preset.leftRightArrow":`Arrow: Left-Right`,"shape.preset.leftRightArrowCallout":`Callout: Left-Right Arrow`,"shape.preset.leftRightCircularArrow":`Arrow: Circular Left-Right`,"shape.preset.leftRightRibbon":`Ribbon: Left-Right`,"shape.preset.leftRightUpArrow":`Arrow: Left-Right-Up`,"shape.preset.leftUpArrow":`Arrow: Left-Up`,"shape.preset.lightningBolt":`Lightning Bolt`,"shape.preset.line":`Line`,"shape.preset.lineArrow":`Line Arrow`,"shape.preset.lineArrowDouble":`Line Arrow: Double`,"shape.preset.mathDivide":`Division Sign`,"shape.preset.mathEqual":`Equals`,"shape.preset.mathMinus":`Minus Sign`,"shape.preset.mathMultiply":`Multiplication Sign`,"shape.preset.mathNotEqual":`Not Equal`,"shape.preset.mathPlus":`Plus Sign`,"shape.preset.moon":`Moon`,"shape.preset.nonIsoscelesTrapezoid":`Trapezoid: Non-Isosceles`,"shape.preset.noSmoking":`"No" Symbol`,"shape.preset.notchedRightArrow":`Arrow: Notched Right`,"shape.preset.octagon":`Octagon`,"shape.preset.parallelogram":`Parallelogram`,"shape.preset.pentagon":`Pentagon`,"shape.preset.pie":`Partial Circle`,"shape.preset.pieWedge":`Pie Wedge`,"shape.preset.plaque":`Plaque`,"shape.preset.plaqueTabs":`Plaque Tabs`,"shape.preset.plus":`Cross`,"shape.preset.quadArrow":`Arrow: Quad`,"shape.preset.quadArrowCallout":`Callout: Quad Arrow`,"shape.preset.rect":`Rectangle`,"shape.preset.ribbon":`Ribbon: Tilted Down`,"shape.preset.ribbon2":`Ribbon: Tilted Up`,"shape.preset.rightArrow":`Arrow: Right`,"shape.preset.rightArrowCallout":`Callout: Right Arrow`,"shape.preset.rightBrace":`Right Brace`,"shape.preset.rightBracket":`Right Bracket`,"shape.preset.round1Rect":`Rectangle: Single Corner Rounded`,"shape.preset.round2DiagRect":`Rectangle: Diagonal Corners Rounded`,"shape.preset.round2SameRect":`Rectangle: Top Corners Rounded`,"shape.preset.roundRect":`Rectangle: Rounded Corners`,"shape.preset.rtTriangle":`Right Triangle`,"shape.preset.smileyFace":`Smiley Face`,"shape.preset.snip1Rect":`Rectangle: Single Corner Snipped`,"shape.preset.snip2DiagRect":`Rectangle: Diagonal Corners Snipped`,"shape.preset.snip2SameRect":`Rectangle: Top Corners Snipped`,"shape.preset.snipRoundRect":`Rectangle: Top Corners One Rounded and One Snipped`,"shape.preset.squareTabs":`Square Tabs`,"shape.preset.star10":`Star: 10 Points`,"shape.preset.star12":`Star: 12 Points`,"shape.preset.star16":`Star: 16 Points`,"shape.preset.star24":`Star: 24 Points`,"shape.preset.star32":`Star: 32 Points`,"shape.preset.star4":`Star: 4 Points`,"shape.preset.star5":`Star: 5 Points`,"shape.preset.star6":`Star: 6 Points`,"shape.preset.star7":`Star: 7 Points`,"shape.preset.star8":`Star: 8 Points`,"shape.preset.stripedRightArrow":`Arrow: Striped Right`,"shape.preset.sun":`Sun`,"shape.preset.swooshArrow":`Arrow: Swoosh`,"shape.preset.teardrop":`Teardrop`,"shape.preset.trapezoid":`Trapezoid`,"shape.preset.triangle":`Isosceles Triangle`,"shape.preset.upArrow":`Arrow: Up`,"shape.preset.upArrowCallout":`Callout: Up Arrow`,"shape.preset.upDownArrow":`Arrow: Up-Down`,"shape.preset.upDownArrowCallout":`Callout: Up-Down Arrow`,"shape.preset.uturnArrow":`Arrow: U-Turn`,"shape.preset.verticalScroll":`Scroll: Vertical`,"shape.preset.wave":`Wave`,"shape.preset.wedgeEllipseCallout":`Speech Bubble: Oval`,"shape.preset.wedgeRectCallout":`Speech Bubble: Rectangle`,"shape.preset.wedgeRoundRectCallout":`Speech Bubble: Rectangle with Corners Rounded`,"sheet.merge":`Merge`,"sheet.mergeCellsWarning":`Merging cells will only keep the upper-left value. Some data will be discarded. Continue?`,"slicer.clearFilter":`Clear Filter`,"slicer.multiSelect":`Multi-Select`,"table.columns.compact":`{count, plural, one{Table Column} other{# Table Columns}}`,"table.convert":`Convert`,"table.convertToRangeWarning":`Converting a table to range with ''{count}'' cells will set a large number of cell styles and may affect performance.
|
|
16
|
+
Continue?`,"table.deleteColumns":`{count, plural, one{Delete Table Column} other{Delete # Table Columns}}`,"table.deleteColumns.description":`Delete the selected table columns, shifting cells left only within the table.`,"table.deleteRows":`{count, plural, one{Delete Table Row} other{Delete # Table Rows}}`,"table.deleteRows.description":`Delete the selected table rows, shifting cells up only within the table.`,"table.insertColumns":`{count, plural, one{Insert Table Column} other{Insert # Table Columns}}`,"table.insertColumns.description":`Insert columns to the left of the selection, shifting cells right only within the table.`,"table.insertRows":`{count, plural, one{Insert Table Row} other{Insert # Table Rows}}`,"table.insertRows.description":`Insert rows above the selection, shifting cells down only within the table.`,"table.rows.compact":`{count, plural, one{Table Row} other{# Table Rows}}`,"table.totals.average":`Average`,"table.totals.count":`Count`,"table.totals.countNumbers":`Count Numbers`,"table.totals.max":`Max`,"table.totals.min":`Min`,"table.totals.moreFunctions":`More Functions...`,"table.totals.none":`None`,"table.totals.stdDev":`StdDev`,"table.totals.sum":`Sum`,"table.totals.var":`Var`,"validationAlert.default":`This value doesn't match the data validation restrictions defined for this cell.`,"validationAlert.hint.stop":`Change the entry, or press Esc to cancel.`,"validationAlert.hint.warning":`Press Enter again to keep it, or Esc to cancel.`,"validationTip.more":`{count, plural, one {# more rule} other {# more rules}}`,"workbook.untitled":`Untitled`,"workbookStrip.newSheet":`New sheet`},sf=[{sourceId:`chart`,catalog:{scope:`chart`,label:`Chart`,tag:`en`,version:1,commands:{chartChangeType:{label:`Change Chart Type`,description:`Draw every series as another type of chart.`,tags:[`mutator`]},chartSwitchRowColumn:{label:`Switch Row/Column`,description:`Plot the data's rows as series instead of its columns, or the other way round.`,tags:[`mutator`]},chartSelectData:{label:`Select Data`,description:`Change the cells the chart plots.`,groupLabels:{contextMenu:`Select Data…`},tags:[`mutator`]},chartAddElement:{label:`Add Chart Element`,description:`Add, move or remove a title, legend, data labels, data table, gridlines, axis titles, trendlines, error bars, lines or up/down bars.`,tags:[`mutator`]},chartTitleToggle:{label:`Chart Title`,description:`Show the chart's title above the chart, or remove it.`,tags:[`mutator`]},chartLegendToggle:{label:`Legend`,description:`Show the legend at the right, or remove it.`,tags:[`mutator`]},chartDataLabelsToggle:{label:`Data Labels`,description:`Label every point with its value, or remove the labels.`,tags:[`mutator`]},chartDataTableToggle:{label:`Data Table`,description:`Show the plotted values in a table under the chart, or remove it.`,tags:[`mutator`]},chartGridlinesToggle:{label:`Gridlines`,description:`Show the value axis's major gridlines, or remove them.`,tags:[`mutator`]},chartAxisTitlesToggle:{label:`Axis Titles`,description:`Show a title on each primary axis, or remove them.`,tags:[`mutator`]}}}},{sourceId:`clipboard`,catalog:{scope:`app`,label:`Application`,tag:`en`,version:1,commands:{cut:{label:`Cut`,description:`Remove the selection and put it on the clipboard so you can paste it somewhere else.`,icon:`cut`,shortcut:[`ctrl+X`,`shift+Delete`]},copy:{label:`Copy`,description:`Put a copy of the selection on the clipboard so you can paste it somewhere else.`,icon:`copy`,shortcut:[`ctrl+C`,`ctrl+Insert`]},paste:{label:`Paste`,description:`Add content on the clipboard to your document.`,icon:`paste.yellow`,shortcut:[`ctrl+V`,`shift+Insert`]}}}},{sourceId:`editor`,catalog:{scope:`editor`,label:`Cell Editor`,tag:`en`,version:1,commands:{relativeReferencesToggle:{label:`Toggle References`,description:`Toggle cell references from relative to absolute, to partially absolute, back to relative again.`,shortcut:`F4`,tags:[`editor`]},toggleEditorFocus:{label:`Toggle Editor Focus`,description:`Move focus between editors such as the formula editor and the inline editor.`,shortcut:`ctrl+F2`,tags:[`editor`]},insertFunctionSum:{label:`Quick Sum`,description:`Quick sum of the cells.`,groupLabels:{insertFunctionSumOptions:`Sum`},icon:`FunctionSum`,shortcut:`alt+=`,tags:[`mutator`],borrow:[`sheet`]},insertFunctionAverage:{label:`Quick Average`,description:`Quick average of the cells.`,groupLabels:{insertFunctionSumOptions:`Average`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionCount:{label:`Quick Count`,description:`Quick count of the cells.`,groupLabels:{insertFunctionSumOptions:`Count Numbers`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMax:{label:`Quick Max`,description:`Quick maximum of the cells.`,groupLabels:{insertFunctionSumOptions:`Max`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMin:{label:`Quick Min`,description:`Quick minimum of the cells.`,groupLabels:{insertFunctionSumOptions:`Min`},tags:[`mutator`],borrow:[`sheet`]},insertCurrentTime:{label:`Current Time`,description:`Insert the current time.`,shortcut:`ctrl+shift+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertCurrentDate:{label:`Current Date`,description:`Insert the current date.`,shortcut:`ctrl+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertValueAbove:{label:`Copy From Above`,description:`Copy the value from the cell above the active cell into the cell or the formula bar.`,shortcut:[`ctrl+Quote`,`ctrl+shift+"`],tags:[`mutator`],borrow:[`sheet`]}}}},{sourceId:`movable`,catalog:{scope:`movable`,label:`Objects`,tag:`en`,version:1,commands:{moveToFront:{label:`Bring to Front`,description:`Move to the front of all of the other drawings.`,icon:`DrawToFront`,shortcut:`ctrl+shift+BracketRight`},moveForward:{label:`Bring Forward`,description:`Move forward one layer in the z order.`,icon:`DrawMoveForward`,shortcut:`ctrl+BracketRight`},moveToBack:{label:`Send to Back`,description:`Move to the back of all of the other drawings.`,icon:`DrawToBack`,shortcut:`ctrl+shift+BracketLeft`},moveBackward:{label:`Send Backward`,description:`Move backwards one layer in the z order.`,icon:`DrawMoveBackward`,shortcut:`ctrl+BracketLeft`},groupDrawings:{label:`Group`,description:`Group the selected drawings into one object.`,icon:`DrawGroup`},ungroupDrawings:{label:`Ungroup`,description:`Break the selected group into its members.`,icon:`DrawUngroup`},deleteDrawings:{label:`Delete`,description:`Delete the selected drawings.`,shortcut:`Delete`},selectAllDrawings:{label:`Select All Drawings`,description:`Select all of the drawings on the sheet.`,shortcut:`ctrl+A`},selectNextDrawing:{label:`Select Next Drawing`,description:`Select the next drawing on the sheet.`,shortcut:`Tab`},selectPreviousDrawing:{label:`Select Previous Drawing`,description:`Select the previous drawing on the sheet.`,shortcut:`shift+Tab`},clearDrawingSelection:{label:`Return to Cells`,description:`Clear the drawing selection and return to the cells.`,shortcut:`Escape`},toggleLockAspectRatio:{label:`Lock Aspect Ratio`,description:`Toggle whether the aspect ratio should be maintained when resizing from corners.`,icon:`DrawAspect`},formatAnchorTypeTwoCell:{label:`Move and size with cells`,description:`Set your drawing to move and resize when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeOneCell:{label:`Move but don't size with cells`,description:`Set your drawing to only move when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeAbsolute:{label:`Don't move or size with cells`,description:`Set your drawing to never move or resize when underling sheet resizes.`,icon:`DrawResize`},formatDrawNudgeLeft:{label:`Nudge Left`,description:`Move the selected drawings 1 pixel left.`,shortcut:`ArrowLeft`},formatDrawNudgeRight:{label:`Nudge Right`,description:`Move the selected drawings 1 pixel right.`,shortcut:`ArrowRight`},formatDrawNudgeUp:{label:`Nudge Up`,description:`Move the selected drawings 1 pixel up.`,shortcut:`ArrowUp`},formatDrawNudgeDown:{label:`Nudge Down`,description:`Move the selected drawings 1 pixel down.`,shortcut:`ArrowDown`},formatDrawNudgeLeftLarge:{label:`Nudge Left (Large)`,description:`Move the selected drawings 10 pixels left.`,shortcut:`ctrl+ArrowLeft`},formatDrawNudgeRightLarge:{label:`Nudge Right (Large)`,description:`Move the selected drawings 10 pixels right.`,shortcut:`ctrl+ArrowRight`},formatDrawNudgeUpLarge:{label:`Nudge Up (Large)`,description:`Move the selected drawings 10 pixels up.`,shortcut:`ctrl+ArrowUp`},formatDrawNudgeDownLarge:{label:`Nudge Down (Large)`,description:`Move the selected drawings 10 pixels down.`,shortcut:`ctrl+ArrowDown`},formatDrawSizeIncrease:{label:`Increase Size`,description:`Grow the selected drawings by 10%.`,shortcut:[`shift+ArrowRight`,`shift+ArrowUp`,`ctrl+shift+ArrowRight`,`ctrl+shift+ArrowUp`]},formatDrawSizeDecrease:{label:`Decrease Size`,description:`Shrink the selected drawings by 10%.`,shortcut:[`shift+ArrowLeft`,`shift+ArrowDown`,`ctrl+shift+ArrowLeft`,`ctrl+shift+ArrowDown`]},formatDrawFlipHorizontal:{label:`Flip Horizontal`,description:`Mirror the selected drawings left to right.`,icon:`DrawFlipHorz`},formatDrawFlipVertical:{label:`Flip Vertical`,description:`Mirror the selected drawings top to bottom.`,icon:`DrawFlipVert`},formatDrawRotateLeft:{label:`Rotate Left`,description:`Rotate the selected drawings 10 degrees counterclockwise.`,shortcut:[`alt+ArrowLeft`,`ctrl+alt+ArrowLeft`]},formatDrawRotateRight:{label:`Rotate Right`,description:`Rotate the selected drawings 10 degrees clockwise.`,shortcut:[`alt+ArrowRight`,`ctrl+alt+ArrowRight`]},formatDrawAlignLeft:{label:`Align Left`,description:`Align the selected drawings to the left.`,icon:`DrawAlignLeft`},formatDrawAlignCenter:{label:`Align Center`,description:`Align the selected drawings vertically relative to each other.`,icon:`DrawAlignCenter`},formatDrawAlignRight:{label:`Align Right`,description:`Align the selected drawings to the right.`,icon:`DrawAlignRight`},formatDrawAlignTop:{label:`Align Top`,description:`Align the selected drawings to the top.`,icon:`DrawAlignTop`},formatDrawAlignMiddle:{label:`Align Middle`,description:`Align the selected drawings horizontally relative to each other.`,icon:`DrawAlignMiddle`},formatDrawAlignBottom:{label:`Align Bottom`,description:`Align the selected drawings to the bottom.`,icon:`DrawAlignBottom`},formatDrawDistributeHorz:{label:`Distribute Horizontally`,description:`Distribute the selected drawings horizontally with equal spacing between each.`,icon:`DrawDistributeHorz`},formatDrawDistributeVert:{label:`Distribute Vertically`,description:`Distribute the selected drawings vertically with equal spacing between each.`,icon:`DrawDistributeVert`},formatDrawFlipHorz:{label:`Flip Horizontally`,description:`Flip the selected drawings horizontally.`},formatDrawFlipVert:{label:`Flip Vertically`,description:`Flip the selected drawings vertically.`},formatDrawGroup:{label:`Group`,description:`Group the selected drawings into a single drawing.`,icon:`DrawGroup`},formatDrawUngroup:{label:`Ungroup`,description:`Break the group of a drawing into individual drawings.`,icon:`DrawUngroup`},formatDrawSwapShapes:{label:`Swap Shapes`,description:`Swap the positions of the swap.`},formatDrawSwapShapesHorz:{label:`Swap Shapes Horizontally`,description:`Swap the positions of the swap horizontally.`},formatDrawSwapShapesVert:{label:`Swap Shapes Vertically`,description:`Swap the positions of the swap vertically.`},formatMovable:{label:`Format`,description:`Show the options for formatting the selected drawing.`,icon:`CellsFormat`,groupLabels:{movableContextMenu:`Format…`}},arrangeOptions:{label:`Arrange`,description:`Order, align, group and anchor the selected drawings.`,icon:`DrawToFront`},drawAlignOptions:{label:`Align`,description:`Quickly change the placement of your drawings.`,icon:`DrawAlignLeft`},drawFlipOptions:{label:`Flip`,description:`Mirror drawings left to right or top to bottom.`,icon:`DrawFlipHorz`},drawGroupOptions:{label:`Group`,description:`Group drawings into one object, or break a group into its members.`,icon:`DrawGroup`},drawSizingOptions:{label:`Sizing`,description:`Determine how the drawing size will adjust as the cell sizes adjust.`,icon:`DrawResize`}}}},{sourceId:`picture`,catalog:{scope:`picture`,label:`Picture`,tag:`en`,version:1,commands:{changePictureFromFile:{label:`Change Picture`,description:`Show another picture from your device in the same frame, keeping its size and formatting.`,groupLabels:{changePictureOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},changePictureFromURL:{label:`Change Picture From Web`,description:`Show another picture from the web in the same frame, keeping its size and formatting.`,groupLabels:{changePictureOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},cropOptions:{label:`Crop`,description:`Crop the picture to a shape or a proportion, or place it in its frame.`,icon:`Crop`},cropToShape:{label:`Crop to Shape`,description:`Clip the picture to the outline of a shape, keeping its size and formatting.`,icon:`Crop`,tags:[`mutator`]},cropAspectOptions:{label:`Aspect Ratio`,description:`Crop the picture to a proportion.`,icon:`DrawAspect`},cropAspect1x1:{label:`1:1`,description:`Crop the picture to a proportion of 1:1, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect2x3:{label:`2:3`,description:`Crop the picture to a proportion of 2:3, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect3x4:{label:`3:4`,description:`Crop the picture to a proportion of 3:4, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect3x5:{label:`3:5`,description:`Crop the picture to a proportion of 3:5, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect4x5:{label:`4:5`,description:`Crop the picture to a proportion of 4:5, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect3x2:{label:`3:2`,description:`Crop the picture to a proportion of 3:2, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect4x3:{label:`4:3`,description:`Crop the picture to a proportion of 4:3, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect5x3:{label:`5:3`,description:`Crop the picture to a proportion of 5:3, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect5x4:{label:`5:4`,description:`Crop the picture to a proportion of 5:4, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect16x9:{label:`16:9`,description:`Crop the picture to a proportion of 16:9, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect16x10:{label:`16:10`,description:`Crop the picture to a proportion of 16:10, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropFill:{label:`Fill`,description:`Cover the whole frame with the picture, keeping its proportions. What overflows is cropped.`,icon:`Crop`,tags:[`mutator`]},cropFit:{label:`Fit`,description:`Show the whole picture inside the frame, keeping its proportions.`,icon:`Crop`,tags:[`mutator`]},pictureHyperlinkOptions:{label:`Link`,description:`Link the picture to a web page, a place in this workbook or an email address.`,icon:`HyperlinkInsert`},updatePictureHyperlink:{label:`Link`,description:`Add or edit the link a click on the picture follows.`,groupLabels:{pictureHyperlinkOptions:`Edit Link…`},icon:`HyperlinkEdit`,tags:[`mutator`]},openPictureHyperlink:{label:`Open Link`,description:`Follow the link on the picture.`,groupLabels:{pictureHyperlinkOptions:`Open Link`},icon:`HyperlinkGoto`},deletePictureHyperlink:{label:`Remove Link`,description:`Remove the link from the picture.`,groupLabels:{pictureHyperlinkOptions:`Remove Link`},icon:`HyperlinkDelete`,tags:[`mutator`]}}}},{sourceId:`pivot`,catalog:{scope:`pivot`,label:`PivotTable`,tag:`en`,version:1,commands:{pivotTableFields:{label:`PivotTable Fields`,icon:`Table`},pivotStyleOptions:{label:`PivotTable Style Options`,description:`Choose which parts of the PivotTable style show.`,groupLabels:{pivotToolbar:`Style`}},pivotRefreshOptions:{label:`Refresh`,description:`Read the PivotTable's source again and lay it out, or refresh everything the workbook reads.`,icon:`RefreshAll`},pivotShowOptions:{label:`Show`,description:`Choose which of the PivotTable's buttons and headers show.`},pivotDrillIndicatorsToggle:{label:`Toggle PivotTable +/- Buttons`,description:`Show or hide the buttons that expand and collapse the PivotTable's items.`,groupLabels:{pivotShowOptions:`+/- Buttons`}},pivotFieldHeadersToggle:{label:`Toggle PivotTable Field Headers`,description:`Show or hide the captions and filter buttons over the PivotTable's row and column fields.`,groupLabels:{pivotShowOptions:`Field Headers`}},pivotRowHeadersToggle:{label:`Toggle PivotTable Row Headers`,description:`Show special formatting for the first column of the PivotTable.`,groupLabels:{pivotStyleOptions:`Row Headers`}},pivotColumnHeadersToggle:{label:`Toggle PivotTable Column Headers`,description:`Show special formatting for the first row of the PivotTable.`,groupLabels:{pivotStyleOptions:`Column Headers`}},pivotBandedRowsToggle:{label:`Toggle PivotTable Banded Rows`,description:`Show banded rows, even rows formatted differently from odd ones.`,groupLabels:{pivotStyleOptions:`Banded Rows`}},pivotBandedColumnsToggle:{label:`Toggle PivotTable Banded Columns`,description:`Show banded columns, even columns formatted differently from odd ones.`,groupLabels:{pivotStyleOptions:`Banded Columns`}}}}},{sourceId:`selection`,catalog:{scope:`selection`,label:`Selection`,tag:`en`,version:1,commands:{moveToPageDown:{label:`Page Down`,description:`Shift viewport down one page.`,shortcut:`PageDown`,tags:[`selection`]},selectToPageDown:{label:`Select To Page Down`,description:`Shift viewport and select down one page.`,shortcut:`shift+PageDown`,tags:[`selection`]},moveToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`alt+PageDown`,tags:[`selection`]},selectToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`shift+alt+PageDown`,tags:[`selection`]},moveToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`PageUp`,tags:[`selection`]},selectToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`shift+PageUp`,tags:[`selection`]},moveToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`alt+PageUp`,tags:[`selection`]},selectToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`shift+alt+PageUp`,tags:[`selection`]},selectArray:{label:`Select Array`,description:`Select the whole spilled or array-entered block containing the active cell.`,shortcut:`ctrl+shift+?`,tags:[`selection`]},selectColumn:{label:`Select Column`,description:`Select the columns for the selected cells.`,shortcut:`ctrl+Space`,tags:[`selection`]},selectRow:{label:`Select Row`,description:`Select the rows for the selected cells.`,shortcut:`shift+Space`,tags:[`selection`]},selectToColumnStart:{label:`Select To Column Start`,description:`Select the columns to the beginning of the sheet.`,tags:[`selection`]},selectToColumnEnd:{label:`Select To Column End`,description:`Select the columns to the end of the sheet.`,tags:[`selection`]},moveToRowStart:{label:`Move to Row Home`,description:`Move to the beginning of the row.`,shortcut:`Home`,tags:[`selection`]},selectToRowStart:{label:`Select to Row Home`,description:`Select to the beginning of the row.`,shortcut:`shift+Home`,tags:[`selection`]},moveToGridStart:{label:`Move to Grid Home`,description:`Move to the beginning of the grid.`,shortcut:`ctrl+Home`,tags:[`selection`]},selectToGridStart:{label:`Select to Grid Home`,description:`Select to the beginning of the grid.`,shortcut:`ctrl+shift+Home`,tags:[`selection`]},moveToRowEnd:{label:`Move to Row End`,description:`Move to the end of the row.`,shortcut:`End`,tags:[`selection`]},selectToRowEnd:{label:`Select to Row End`,description:`Select to the end of the row.`,shortcut:`shift+End`,tags:[`selection`]},moveToGridEnd:{label:`Move to Grid End`,description:`Move to the end of the grid.`,shortcut:`ctrl+End`,tags:[`selection`]},selectToGridEnd:{label:`Select to Grid End`,description:`Select to the end of the grid.`,shortcut:`ctrl+shift+End`,tags:[`selection`]},scrollToActiveCoords:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell.`,shortcut:`ctrl+Backspace`,tags:[`selection`]},scrollToActiveCoordsClearSelection:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell and clear selection.`,shortcut:`shift+Backspace`,tags:[`selection`]},traverseSelectionRight:{label:`Traverse Right`,description:`Traverse the selection moving rightward.`,shortcut:`Tab`,tags:[`selection`]},traverseSelectionLeft:{label:`Traverse Left`,description:`Traverse the selection moving leftward.`,shortcut:`shift+Tab`,tags:[`selection`]},traverseSelectionDown:{label:`Traverse Down`,description:`Traverse the selection moving downward.`,shortcut:[`Enter`,`NumpadEnter`],tags:[`selection`]},traverseSelectionUp:{label:`Traverse Up`,description:`Traverse the selection moving upward.`,shortcut:[`shift+Enter`,`shift+NumpadEnter`],tags:[`selection`]},moveLeft:{label:`Move Left`,description:`Move active cell to the left.`,shortcut:`ArrowLeft`,tags:[`selection`]},selectLeft:{label:`Select Left`,description:`Extend selection left.`,shortcut:`shift+ArrowLeft`,tags:[`selection`]},moveContentfulLeft:{label:`Move Left Contentful`,description:`Move left to the next cell with content.`,shortcut:`ctrl+ArrowLeft`,tags:[`selection`]},selectContentfulLeft:{label:`Select Left Contentful`,description:`Extend selection left to the next cell with content.`,shortcut:`ctrl+shift+ArrowLeft`,tags:[`selection`]},moveRight:{label:`Move Right`,description:`Move active cell to the right.`,shortcut:`ArrowRight`,tags:[`selection`]},selectRight:{label:`Select Right`,description:`Extend selection right.`,shortcut:`shift+ArrowRight`,tags:[`selection`]},moveContentfulRight:{label:`Move Right Contentful`,description:`Move right to the next cell with content.`,shortcut:`ctrl+ArrowRight`,tags:[`selection`]},selectContentfulRight:{label:`Select Right Contentful`,description:`Extend selection right to the next cell with content.`,shortcut:`ctrl+shift+ArrowRight`,tags:[`selection`]},moveUp:{label:`Move Up`,description:`Move active cell to the up.`,shortcut:`ArrowUp`,tags:[`selection`]},selectUp:{label:`Select Up`,description:`Extend selection up.`,shortcut:`shift+ArrowUp`,tags:[`selection`]},moveContentfulUp:{label:`Move Up Contentful`,description:`Move up to the next cell with content.`,shortcut:`ctrl+ArrowUp`,tags:[`selection`]},selectContentfulUp:{label:`Select Up Contentful`,description:`Extend selection up to the next cell with content.`,shortcut:`ctrl+shift+ArrowUp`,tags:[`selection`]},moveDown:{label:`Move Down`,description:`Move active cell to the down.`,shortcut:`ArrowDown`,tags:[`selection`]},selectDown:{label:`Select Down`,description:`Extend selection down.`,shortcut:`shift+ArrowDown`,tags:[`selection`]},moveContentfulDown:{label:`Move Down Contentful`,description:`Move down to the next cell with content.`,shortcut:`ctrl+ArrowDown`,tags:[`selection`]},selectContentfulDown:{label:`Select Down Contentful`,description:`Extend selection down to the next cell with content.`,shortcut:`ctrl+shift+ArrowDown`,tags:[`selection`]},traverseSelectionPreviousRange:{label:`Traverse Previous Range`,description:`Traverse the selection to the previous range.`,shortcut:`ctrl+alt+ArrowLeft`,tags:[`selection`]},traverseSelectionNextRange:{label:`Traverse Next Range`,description:`Traverse the selection to the next range.`,shortcut:`ctrl+alt+ArrowRight`,tags:[`selection`]},traverseSelectionCorners:{label:`Traverse Corners`,description:`Traverse the selection through the corners of the selected range.`,shortcut:`ctrl+.`,tags:[`selection`]}}}},{sourceId:`shape`,catalog:{scope:`shape`,label:`Shape`,tag:`en`,version:1,commands:{changeShape:{label:`Change Shape`,description:`Change the selected shape to another one, keeping its text and formatting.`,icon:`shape:Shapes`,tags:[`mutator`]}}}},{sourceId:`sheet`,catalog:{scope:`sheet`,label:`Sheet`,tag:`en`,version:1,commands:{gridlinesToggle:{label:`Gridlines`,description:`Toggle whether the lines between rows and columns in the sheet are displayed.`,groupLabels:{view:`Gridlines`}},sheetViewToggleGridlinesRows:{label:`Row Gridlines`,description:`Toggle whether the lines between rows in the sheet are displayed.`,groupLabels:{view:`Row Gridlines`,gridlinesOptions:`Rows`}},sheetViewToggleGridlinesColumns:{label:`Column Gridlines`,description:`Toggle whether the lines between columns in the sheet are displayed.`,groupLabels:{view:`Columns Gridlines`,gridlinesOptions:`Columns`}},sheetViewFormatGridlinesColor:{label:`Gridlines Color`,description:`Color the rows and column gridlines.`},sheetViewToggleShowHeadings:{label:`Headings`,description:`Toggle whether the row and column headings are displayed.`,groupLabels:{view:`Headings`}},sheetViewToggleShowHeadingRows:{label:`Row Headings`,description:`Toggle whether the row headings are displayed.`,groupLabels:{view:`Row Headings`,headingsOptions:`Rows`}},sheetViewToggleShowHeadingColumns:{label:`Column Headings`,description:`Toggle whether the column headings are displayed.`,groupLabels:{view:`Columns Headings`,headingsOptions:`Columns`}},sheetViewToggleShowHeadingsNumeric:{label:`Numeric Headers`,description:`Toggle whether cell headings show numbers or A1 conventions.`,shortcut:`ctrl+shift+h`},sheetViewToggleFormulaView:{label:`Show Formulas`,description:`Toggle whether cells show formula or values.`,icon:`FormulaView`,shortcut:"ctrl+`"},sheetViewToggleShowZeros:{label:`Show Zeros`,description:`Toggle whether cell with zero value shows '0' or blank.`,icon:`ViewZero`},selectComments:{label:`Select Comments`,description:`Select the cells with comments.`,shortcut:`ctrl+shift+O`},selectAll:{label:`Select All`,description:`Select the closest data or the entire sheet if no data is nearby.`,shortcut:[`ctrl+A`,`ctrl+shift+Space`]},selectRegion:{label:`Select Region`,description:`Select the closest data.`,shortcut:`ctrl+shift+*`},clearHiddenSelection:{label:`Select Visible Cells`,description:`Break the selection around hidden rows and columns, leaving only the visible cells selected.`,shortcut:`alt+Semicolon`},formatTextRotate0:{label:`No Text Rotation`,description:`Remove all text rotation.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotate45:{label:`Angle Clockwise`,description:`Angle text 45 degrees downward.`,icon:`TextRotation45`,tags:[`mutator`]},formatTextRotate90:{label:`Rotate Text Down`,description:`Angle your text so that it aligns with the left.`,icon:`TextRotation90`,tags:[`mutator`]},formatTextRotate270:{label:`Rotate Text Up`,description:`Angle your text so that it aligns with the right.`,icon:`TextRotation2702`,tags:[`mutator`]},formatTextRotate315:{label:`Angle Counterclockwise`,description:`Angle text 45 degrees upward.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotateCustom:{label:`Custom Text Rotation`,description:`Angle your text using a custom angle.`,icon:`TextRotationCustom`,tags:[`mutator`],groupLabels:{textRotateOptions:`Custom`}},formatTextRotateVertical:{label:`Vertical Text`,description:`Stack text vertically.`,icon:`TextRotationVertical`,tags:[`mutator`]},sortAscending:{label:`Sort Ascending`,description:`Lowest to Highest.`,groupLabels:{sortOptions:`Ascending`,sortFilterOptions:`Ascending`},icon:`SortIncrease`,tags:[`mutator`]},sortDescending:{label:`Sort Descending`,description:`Highest to Lowest.`,groupLabels:{sortOptions:`Descending`,sortFilterOptions:`Descending`},icon:`SortDecrease`,tags:[`mutator`]},sortCustom:{label:`Custom Sort…`,description:`Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.`,groupLabels:{sortOptions:`Custom…`,sortFilterOptions:`Custom…`},icon:`SortCustom`,tags:[`mutator`]},protectionSheetToggle:{label:`{locked, select, true{Unprotect Sheet} other{Protect Sheet}}`,description:`Prevent unwanted changes from others by limiting their ability to edit.
|
|
17
|
+
For example, you can prevent people from editing locked cells or making formatting changes.`,groupLabels:{sheet:`{locked, select, true{Unprotect} other{Protect}}`},icon:`Lock`,params:{locked:!1}},protectionSheetPause:{label:`{paused, select, true{Resume Protection} other{Pause Protection}}`,description:`Temporarily lift protection on this sheet without unprotecting it.
|
|
18
|
+
Asks for the sheet password, if there is one. It applies to this session only and is never saved with the file.`,groupLabels:{protectionOptions:`{paused, select, true{Resume Protection} other{Pause Protection}}`},icon:`LockOpen`,params:{paused:!1}},protectionSheetProtectOrPause:{label:`{state, select, paused{Resume Protection} locked{Pause Protection} other{Protect Sheet}}`,description:`Protect the sheet, or pause protection on a protected one.
|
|
19
|
+
Never unprotects: pausing keeps the password and options, and applies to this session only.`,icon:`Lock`,params:{state:`none`}},protectionHighlight:{label:`Highlight Locked Cells`,description:`Shade the cells sheet protection locks, leaving the ranges that stay editable clear.
|
|
20
|
+
A view setting: it changes nothing in the workbook, and works whether or not the sheet is protected.`,groupLabels:{protectionOptions:`Highlight Locked Cells`}},manageProtection:{label:`Manage Protection`,description:`Sheet protection and its options, the ranges that stay editable, and workbook protection - in one place.`,groupLabels:{protectionOptions:`Manage Protection…`,sheetTabMenu:`Manage Protection…`,contextMenu:`Manage Protection…`},icon:`Lock`},protectionUnlockRange:{label:`Unlock Range…`,description:`Let the selected cells stay editable while the rest of the sheet is protected.`,groupLabels:{protectionOptions:`Unlock Range…`},icon:`LockRange`},formatSheetTabColor:{label:`Tab Color`,description:`Color the tab to help differentiate for other sheets.`,icon:`stroke.colored`},formatCellStyle:{label:`Cell Styles`,description:`A colorful style is a great way to make important data stand out on the sheet.`,groupLabels:{cellStyle:`Apply`},icon:`PresetStyles`,tags:[`mutator`]},formatTableStyle:{label:`{hasTable, select, true{Apply Table Style} other{Format as Table}}`,description:`Create a table or apply style to the current table.`,groupLabels:{tableStyleOptions:`Apply (Keep Styles)`},icon:`PresetStyles`,tags:[`mutator`],params:{hasTable:!1}},formatTableStyleClearCellStyles:{label:`Format as Table (Clear Styles)`,description:`Create a table or apply style to the current table and clears all cell styles.`,groupLabels:{tableStyleOptions:`Apply (Clear Styles)`},icon:`PresetStyles`},setDefaultTableStyle:{label:`Set Default Table Style`,description:`Sets the default table style used when a table is inserted.`,groupLabels:{tableStyleOptions:`Set As Default`}},deleteTableStyle:{label:`Delete Table Style`,description:`Remove the current table style.`,groupLabels:{tableStyleOptions:`Delete`}},formatBorder:{label:`Border`,description:`Create an outline border.`,tags:[`mutator`]},formatFillColor:{label:`Fill Color`,description:`Color the background of the cells to make them stand out.`,icon:`fill.colored`,tags:[`mutator`]},formatFontColor:{label:`Font Color`,description:`Change the color of your text.`,icon:`text.colored`,tags:[`mutator`]},formatBoldToggle:{label:`Bold`,description:`Toggle bold formatting of text.`,icon:`TextBold`,shortcut:[`ctrl+B`,`ctrl+2`],tags:[`mutator`]},formatItalicToggle:{label:`Italic`,description:`Toggle italic formatting of text.`,icon:`TextItalic`,shortcut:[`ctrl+I`,`ctrl+3`],tags:[`mutator`]},formatUnderlinedToggle:{label:`Underline`,description:`Underline the text.`,groupLabels:{underlineOptions:`Single`},icon:`TextUnderline`,shortcut:[`ctrl+u`,`ctrl+4`],tags:[`mutator`]},formatUnderlinedDoubleToggle:{label:`Double Underline`,description:`Double underline the text.`,groupLabels:{underlineOptions:`Double`},icon:`TextUnderlineDouble`},formatUnderlinedAccountingToggle:{label:`Accounting Underline`,description:`Use accounting underline for the text.`,groupLabels:{underlineOptions:`Accounting`},icon:`TextUnderlineAccounting`},formatUnderlinedAccountingDoubleToggle:{label:`Double Accounting Underline`,description:`Use accounting double underline the text.`,groupLabels:{underlineOptions:`Double Accounting`},icon:`TextUnderlineAccountingDouble`},formatStrikeThroughToggle:{label:`Strikethrough`,description:`Toggle strike-through formatting of text.`,icon:`TextStrike`,shortcut:`ctrl+5`,tags:[`mutator`]},formatSuperscriptToggle:{label:`Superscript`,description:`Format your text to be smaller and sit at the top of the line.`,icon:`TextSuperscript`,tags:[`mutator`]},formatSubscriptToggle:{label:`Subscript`,description:`Format your text to be smaller and sit at the bottom of the line.`,icon:`TextSubscript`,tags:[`mutator`]},formatAlignTopToggle:{label:`Align Top`,description:`Align text to the top.`,icon:`TextVerticalTop`,tags:[`mutator`]},formatTextOverflowVisibleToggle:{label:`Overflow Text`,description:`Overflow text to the next cells.`,icon:`TextHorizontalOverflow`,tags:[`mutator`]},formatTextOverflowWrapToggle:{label:`Wrap Text`,description:`Wrap text with the existing cell and increase the height as required.`,icon:`TextHorizontalWrap`,tags:[`mutator`]},formatTextOverflowClipToggle:{label:`Clip Text`,description:`Clip text that falls outside of the existing cell.`,icon:`TextHorizontalClip`,tags:[`mutator`]},formatTextOverflowShrinkToggle:{label:`Shrink Text`,description:`Shrink the text font to fit within existing cell.`,icon:`TextHorizontalShrink`,tags:[`mutator`]},formatTextOverflowEllipsisToggle:{label:`Ellipsis Text`,description:`Add a trailing '…' to the text to indicate text is partially hidden.`},formatAlignMiddleToggle:{label:`Align Middle`,description:`Align text so that it is centered between the top and bottom of the cell.`,icon:`TextVerticalCenter`,tags:[`mutator`]},formatAlignBottomToggle:{label:`Align Bottom`,description:`Align text to the bottom.`,icon:`TextVerticalBottom`,tags:[`mutator`]},formatAlignJustifyVerticalToggle:{label:`Justify Vertically`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedVerticalToggle:{label:`Distribute Vertically`,description:`Justify your content vertically.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignLeftToggle:{label:`Align Left`,description:`Align your content to the left.`,icon:`FormatAlignLeft`,tags:[`mutator`]},formatAlignCenterToggle:{label:`Align Center`,description:`Center your content.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignRightToggle:{label:`Align Right`,description:`Align your content to the right.`,icon:`FormatAlignRight`,tags:[`mutator`]},formatAlignJustifyToggle:{label:`Align Justify`,description:`Justify your content.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignCenterContinuousToggle:{label:`Center Across`,description:`Center your content across multiple cells.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignFillToggle:{label:`Fill Across`,description:`Repeat the value to fill the entire cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedHorizontalToggle:{label:`Distribute Horizontally`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatFontSizeIncrease:{label:`Increase Font Size`,description:`Make your text a bit bigger.`,icon:`TextSizeIncrease`,shortcut:`ctrl+shift+>`,tags:[`mutator`,`quickAction`]},formatFontSizeDecrease:{label:`Decrease Font Size`,description:`Make your text a bit smaller.`,icon:`TextSizeDecrease`,shortcut:`ctrl+shift+<`,tags:[`mutator`,`quickAction`]},formatFontFamily:{label:`Font`,description:`Select the font your text.`,tags:[`mutator`]},formatFontSize:{label:`Font Size`,description:`Change the size of your text.`,tags:[`mutator`]},formatCells:{label:`Format Cells`,description:`Open the Format Cells pane — number, alignment, font, fill and borders.`,icon:`CellsFormat`,groupLabels:{numberFormatOptions:`More Number Formats…`,cellsFormatOptions:`Format Cells…`,contextMenu:`Format Cells…`}},formatCellsNumber:{label:`Format Cells: Number`,description:`Open the Format Cells pane on the Number tab.`,icon:`CellsFormat`,shortcut:[`ctrl+1`,`ctrl+alt+1`]},formatCellsFont:{label:`Format Cells: Font`,description:`Open the Format Cells pane on the Font tab.`,icon:`CellsFormat`,shortcut:[`ctrl+shift+F`,`ctrl+alt+F`]},formatNumberFormat:{label:`Number Format`,description:`Choose the format for your cells, such as percentage, currency, date or time.`,tags:[`mutator`]},formatNumberFormatGeneralStyle:{label:`General Style`,description:`Remove all specific formatting.`,shortcut:`ctrl+shift+Backquote`,tags:[`mutator`]},formatNumberFormatNumberStyle:{label:`Number Style`,description:`Format as number with two decimals and comma.`,shortcut:`ctrl+shift+1`,tags:[`mutator`]},formatNumberFormatTimeStyle:{label:`Time Style`,description:`Format as time with hour and minute, and AM or PM.`,shortcut:`ctrl+shift+2`,tags:[`mutator`]},formatNumberFormatDateStyle:{label:`Date Style`,description:`Format as date with day, month, and year.`,shortcut:`ctrl+shift+3`,tags:[`mutator`]},formatNumberFormatAccountingStyle:{label:`Accounting Style`,description:`Format as Dollars, Euros, or other currency.`,icon:`CurrencyDollar`,shortcut:`ctrl+shift+4`,tags:[`mutator`,`quickAction`]},formatNumberFormatPercentStyle:{label:`Percent Style`,description:`Format as a percentage.`,icon:`Percent`,shortcut:`ctrl+shift+5`,tags:[`mutator`,`quickAction`]},formatNumberFormatScientificStyle:{label:`Scientific Style`,description:`Format as a scientific number with two decimal places .`,shortcut:`ctrl+shift+6`,tags:[`mutator`]},formatNumberFormatCommaStyle:{label:`Comma Style`,description:`Format with a thousands separator.`,icon:`Comma`,shortcut:`ctrl+,`,tags:[`mutator`,`quickAction`]},formatNumberFormatIncreaseDecimal:{label:`Increase Decimal`,description:`Show more decimal places for a more precise value.`,icon:`IncreaseDecimal2`,tags:[`mutator`,`quickAction`]},formatNumberFormatDecreaseDecimal:{label:`Decrease Decimal`,description:`Show few decimal places.`,icon:`DecreaseDecimal2`,tags:[`mutator`,`quickAction`]},displayPlaceholdersToggle:{label:`Display Placeholders`,description:`Switch between hiding objects, displaying objects, and displaying placeholders for objects.`,shortcut:`ctrl+6`},noOp:{label:`Do nothing`,description:`Do Nothing.`,shortcut:`ctrl+7`},displayOutlineSymbolsToggle:{label:`Display Outline Symbols`,description:`Display or hide the outline symbols.`,shortcut:`ctrl+8`},hideRows:{label:`{count, plural, one{Hide Row} other{Hide # Rows}}`,description:`Hide the rows.`,icon:`HideRow`,shortcut:`ctrl+9`,tags:[`mutator`],params:{count:1}},unhideRows:{label:`Unhide Rows`,description:`Unhide the rows.`,icon:`ShowRow`,shortcut:`ctrl+shift+(`,tags:[`mutator`]},hideColumns:{label:`{count, plural, one{Hide Column} other{Hide # Columns}}`,description:`Hide the columns.`,icon:`HideColumn`,shortcut:[`ctrl+0`,`ctrl+alt+0`],tags:[`mutator`],params:{count:1}},unhideColumns:{label:`Unhide Columns`,description:`Unhide the columns.`,icon:`ShowColumn`,shortcut:`ctrl+shift+)`,tags:[`mutator`]},group:{label:`{span, select, columns{Group Columns} rows{Group Rows} other{Group}}`,description:`Group the selected rows or columns, or both for a cell selection, so they can be collapsed and expanded together.`,icon:`Group`,tags:[`mutator`],params:{span:`both`}},groupRows:{label:`Group Rows`,description:`Group the selected rows so they can be collapsed and expanded together.`,shortcut:`alt+shift+ArrowDown`,tags:[`mutator`]},groupColumns:{label:`Group Columns`,description:`Group the selected columns so they can be collapsed and expanded together.`,tags:[`mutator`],shortcut:`alt+shift+ArrowRight`},ungroup:{label:`{span, select, columns{Ungroup Columns} rows{Ungroup Rows} other{Ungroup}}`,description:`Remove the selected rows or columns, or both for a cell selection, from their group.`,icon:`Ungroup`,tags:[`mutator`],params:{span:`both`}},ungroupRows:{label:`Ungroup Rows`,description:`Remove the selected rows from their group.`,shortcut:`alt+shift+ArrowUp`,tags:[`mutator`]},ungroupColumns:{label:`Ungroup Columns`,description:`Remove the selected columns from their group.`,tags:[`mutator`],shortcut:`alt+shift+ArrowLeft`},showDetail:{label:`Show Detail`,description:`Expand the group at the selection.`,icon:`OutlineShowDetail`,tags:[`mutator`]},hideDetail:{label:`Hide Detail`,description:`Collapse the group at the selection.`,icon:`OutlineHideDetail`,tags:[`mutator`]},outlineToggleGroup:{label:`Collapse or Expand Group`,description:`Collapse or expand one group from its button in the outline gutter.`,tags:[`mutator`]},outlineShowLevel:{label:`Show Outline Level`,description:`Show the groups down to a level and collapse the rest.`,tags:[`mutator`]},clearOutline:{label:`Clear Outline`,description:`Remove the selected rows and columns from every group.`,tags:[`mutator`]},autoOutline:{label:`Auto Outline`,description:`Group the rows and columns from the sheet's formulas: each total becomes a summary of the cells it adds up.`,tags:[`mutator`]},outlineSettings:{label:`Outline Settings…`,description:`Choose where summary rows and columns sit, and whether the outline styles apply.`,tags:[`mutator`]},calculate:{label:`Calculate Sheet`,description:`Recalculate the formulas on the current sheet.`,icon:`CalculateSheet`,shortcut:[`shift+F9`,`ctrl+=`]},insertFunctionDialog:{label:`Insert Function`,description:`Work with the function in the current cell.`,groupLabels:{insertFunctionSumOptions:`Function…`},icon:`FunctionThin`,shortcut:`shift+F3`,borrow:[`workbook`],tags:[`mutator`]},sheetZoomOut:{label:`Zoom Out`,description:`Zoom out to see less detail but more area.`,shortcut:[`ctrl+alt+-`,`ctrl+alt+NumpadSubtract`]},sheetZoomIn:{label:`Zoom In`,description:`Zoom in to see more detail but less area.`,shortcut:[`ctrl+alt+=`,`ctrl+alt+NumpadAdd`]},sheetZoom100:{label:`Zoom 100%`,description:`Zoom document to 100%.`,shortcut:`ctrl+alt+o`},sheetZoom200:{label:`Zoom 200%`,description:`Zoom document to 200%.`},sheetZoom75:{label:`Zoom 75%`,description:`Zoom document to 75%.`},sheetZoom50:{label:`Zoom 50%`,description:`Zoom document to 50%.`},sheetZoom25:{label:`Zoom 25%`,description:`Zoom document to 25%.`},sheetZoomSelection:{label:`Zoom to Selection`,description:`Zoom so the selected range fills the window.`},sheetZoomCustom:{label:`Custom Zoom`,description:`Zoom document to a custom scale.`,groupLabels:{sheetZoomOptions:`Custom`}},updateHyperlink:{label:`Link`,description:`Create a hyperlink to either another webpage or another location within this document.`,groupLabels:{contextMenu:`Insert Link…`,hyperlinkOptions:`Edit…`},icon:`HyperlinkInsert`,shortcut:[`ctrl+K`,`ctrl+alt+K`]},openContextMenu:{label:`Context Menu`,description:`Open the context menu.`,shortcut:[`shift+F10`,`ContextMenu`]},openHyperlink:{label:`Open Link`,description:`Open the hyperlink or goto another location within this document.`,groupLabels:{hyperlinkOptions:`Open`},icon:`HyperlinkGoto`,shortcut:`ctrl+Enter`},deleteHyperlink:{label:`Delete Link`,description:`Remove the hyperlink.`,groupLabels:{hyperlinkOptions:`Delete`},icon:`HyperlinkDelete`},editNote:{label:`{note, select, yes{Edit Note} other{Insert Note}}`,description:`Add a note to the cell, or edit the one it has.`,icon:`NoteInsert`,shortcut:`shift+F2`,params:{note:`no`},groupLabels:{contextMenu:`{note, select, yes{Edit Note} other{Insert Note…}}`,noteOptions:`Edit`}},showHideNote:{label:`Show Note`,description:`Keep the note on the sheet. Otherwise it shows only while its cell is pointed at.`,groupLabels:{noteOptions:`Show`}},showAllNotes:{label:`Show All Notes`,description:`Keep every note on the sheet. When every note is already shown, hide them all.`},updateComments:{label:`{thread, select, yes{Show Comment} other{Insert Comment}}`,description:`Add a comment to the cell, or reply to the one it has.`,groupLabels:{contextMenu:`{thread, select, yes{Show Comment} other{Insert Comment…}}`},icon:`CommentInsert`,shortcut:`ctrl+alt+M`,params:{thread:`no`}},deleteComments:{label:`Delete Comments`,description:`Remove any comments.`,icon:`CommentDelete`,groupLabels:{noteOptions:`Delete`}},previousComment:{label:`Previous Comment`,description:`Go to the comment before the selected cell.`,icon:`ArrowBack`},nextComment:{label:`Next Comment`,description:`Go to the comment after the selected cell.`,icon:`ArrowForward`},showCommentsPane:{label:`Show Comments`,description:`List every comment on the sheet in a pane.`,icon:`CommentEdit`},convertNotesToComments:{label:`Convert to Comments`,description:`Convert every note on the sheet to a comment that can be replied to.`},insertImageFromFile:{label:`Insert Image`,description:`Insert a picture from your device.`,groupLabels:{contextMenu:`Insert Image…`,insertImageOverCellsOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},insertImageFromURL:{label:`Insert Image From Web`,description:`Insert a picture from the web.`,groupLabels:{insertImageOverCellsOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},insertImageInCellFromFile:{label:`Insert Image in Cell`,description:`Insert a picture from your device as the value of the selected cell.`,groupLabels:{insertImageInCellOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},insertImageInCellFromURL:{label:`Insert Image in Cell From Web`,description:`Insert a picture from the web as the value of the selected cell.`,groupLabels:{insertImageInCellOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},insertShape:{label:`Shapes`,description:`Insert a ready-made shape, such as a rectangle, an arrow, a callout or a flowchart symbol.`,icon:`shape:Shapes`,tags:[`mutator`]},insertChart:{label:`Insert Chart`,description:`Insert a chart of the selected cells.`,groupLabels:{contextMenu:`Insert Chart…`},shortcut:`alt+F1`,tags:[`mutator`]},sheetBackgroundToggle:{label:`Toggle Sheet Background`,description:`Add or remove the picture that is tiled behind the sheet's cells.`,icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundFromFile:{label:`Sheet Background From Device`,description:`Use a picture from your device as the sheet's background.`,groupLabels:{sheetBackgroundOptions:`From Device…`},icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundFromURL:{label:`Sheet Background From Web`,description:`Use a picture from the web as the sheet's background.`,groupLabels:{sheetBackgroundOptions:`From the Web…`},icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundDelete:{label:`Delete Sheet Background`,description:`Remove the sheet's background picture.`,groupLabels:{sheetBackgroundOptions:`Delete Background`},icon:`Delete`,tags:[`mutator`]},manageDataValidation:{label:`Data Validation`,description:`Manage data validation rules to limit the type of data entered in a cell.`,groupLabels:{contextMenu:`Data Validation…`,dataValidationOptions:`Manage Rules…`},icon:`DataValidation`},dataValidationList:{label:`Data Validation List`,description:`Limit the selected cells to a list, seeded with the values already there.`,groupLabels:{dataValidationOptions:`List…`}},dataValidationUnique:{label:`Require Unique Values`,description:`Allow each value only once in the selected cells.`,groupLabels:{dataValidationOptions:`Unique`},tags:[`mutator`]},dataValidationShowInvalid:{label:`Show Invalid Data`,description:`Mark the cells whose value fails a data validation.
|
|
21
|
+
A view setting: it changes nothing in the rules.`,groupLabels:{dataValidationOptions:`Show Invalid`}},dataValidationNewRule:{label:`New Data Validation Rule`,description:`Create a new data validation rule for the selected cells.`,groupLabels:{dataValidationOptions:`New Rule…`}},dataValidationClearSelection:{label:`Clear Data Validation from Selected Cells`,description:`Remove the selected cells from every data validation rule covering them.`,groupLabels:{dataValidationClearOptions:`From Selected Cells`},tags:[`mutator`]},dataValidationClearSheet:{label:`Clear Data Validation from Entire Sheet`,description:`Remove every data validation rule on this sheet.`,groupLabels:{dataValidationClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageConditionalFormat:{label:`Conditional Formatting`,description:`Manage conditional formatting rules to change how cells look based on their values.`,groupLabels:{contextMenu:`Conditional Formatting…`,conditionalFormatOptions:`Manage Rules…`},icon:`ConditionalFormatOptions`},conditionalFormatNewRule:{label:`New Conditional Formatting Rule`,description:`Create a new conditional formatting rule for the selected cells.`,groupLabels:{conditionalFormatOptions:`New Rule…`}},conditionalFormatGreaterThan:{label:`Highlight Cells Greater Than`,description:`Highlight cells whose value is greater than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Greater Than…`},tags:[`mutator`]},conditionalFormatLessThan:{label:`Highlight Cells Less Than`,description:`Highlight cells whose value is less than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Less Than…`},tags:[`mutator`]},conditionalFormatBetween:{label:`Highlight Cells Between`,description:`Highlight cells whose value is between two values you set.`,groupLabels:{conditionalFormatHighlightOptions:`Between…`},tags:[`mutator`]},conditionalFormatEqualTo:{label:`Highlight Cells Equal To`,description:`Highlight cells whose value equals a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Equal To…`},tags:[`mutator`]},conditionalFormatTextContains:{label:`Highlight Cells with Text that Contains`,description:`Highlight cells whose text contains a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Text that Contains…`},tags:[`mutator`]},conditionalFormatDateOccurring:{label:`Highlight Cells with a Date Occurring`,description:`Highlight cells whose date falls in a period you set.`,groupLabels:{conditionalFormatHighlightOptions:`A Date Occurring…`},tags:[`mutator`]},conditionalFormatDuplicateValues:{label:`Highlight Duplicate Values`,description:`Highlight cells whose value appears more than once in the selection.`,groupLabels:{conditionalFormatHighlightOptions:`Duplicate Values…`},tags:[`mutator`]},conditionalFormatTopItems:{label:`Highlight Top 10 Items`,description:`Highlight the highest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10 Items…`},tags:[`mutator`]},conditionalFormatTopPercent:{label:`Highlight Top 10%`,description:`Highlight the top percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10%…`},tags:[`mutator`]},conditionalFormatBottomItems:{label:`Highlight Bottom 10 Items`,description:`Highlight the lowest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10 Items…`},tags:[`mutator`]},conditionalFormatBottomPercent:{label:`Highlight Bottom 10%`,description:`Highlight the bottom percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10%…`},tags:[`mutator`]},conditionalFormatAboveAverage:{label:`Highlight Above Average`,description:`Highlight values above the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Above Average…`},tags:[`mutator`]},conditionalFormatBelowAverage:{label:`Highlight Below Average`,description:`Highlight values below the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Below Average…`},tags:[`mutator`]},conditionalFormatDataBar:{label:`Data Bars`,description:`Add a colored bar to each cell whose length represents its value.`,groupLabels:{conditionalFormatOptions:`Data Bars`},tags:[`mutator`]},conditionalFormatColorScale:{label:`Color Scales`,description:`Color each cell along a gradient according to its value.`,groupLabels:{conditionalFormatOptions:`Color Scales`},tags:[`mutator`]},conditionalFormatIconSet:{label:`Icon Sets`,description:`Show an icon in each cell according to its value.`,groupLabels:{conditionalFormatOptions:`Icon Sets`},tags:[`mutator`]},conditionalFormatClearSelection:{label:`Clear Rules from Selected Cells`,description:`Remove the conditional formatting rules that touch the selected cells.`,groupLabels:{conditionalFormatClearOptions:`From Selected Cells`},tags:[`mutator`]},conditionalFormatClearSheet:{label:`Clear Rules from Entire Sheet`,description:`Remove every conditional formatting rule on this sheet.`,groupLabels:{conditionalFormatClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageProtectedRange:{label:`Allow Edit Ranges`,description:`Manage ranges that stay editable while the sheet is protected.`,groupLabels:{contextMenu:`Allow Edit Ranges…`},icon:`Lock`},dataRemoveDuplicates:{label:`Remove Duplicates`,description:`Remove duplicate rows from a sheet.`,icon:`DataRemoveDuplicates`,tags:[`mutator`]},dataTextToColumns:{label:`Text to Columns`,description:`Split a single columns of text into multiple columns.`,icon:`DataTextToColumns`,tags:[`mutator`]},insertTable:{label:`Insert Table`,description:`Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.`,groupLabels:{contextMenu:`Insert Table…`},icon:`TableInsert`,shortcut:[`ctrl+L`]},insertCheckbox:{label:`Checkbox`,description:`Insert checkboxes in the selected cells. A checked box is TRUE and an unchecked box is FALSE.`,icon:`CheckboxInsert`,tags:[`mutator`]},insertCellControl:{label:`Cell Control`,description:`Insert a cell control of the given type in the selected cells, replacing any control there and keeping the values. A value type, such as a button, replaces the values instead.`,icon:`CheckboxInsert`,tags:[`mutator`]},formatCellControl:{label:`Control Options`,description:`Show the options of the cell control under the active cell.`,icon:`CellsFormat`},editTable:{label:`Edit Table…`,description:`Edit the table to adjust formatting, sorting, filtering, or other advanced features.`,groupLabels:{tableOptions:`Edit…`,namedItem:`Edit…`},icon:`TableInsert`},deleteTable:{label:`Delete Table`,description:`Remove the table.
|
|
22
|
+
|
|
23
|
+
The table and table specific styling will be removed but the values will be preserved.`,groupLabels:{tableOptions:`Delete`,namedItem:`Delete`},icon:`TableInsert`,tags:[`mutator`]},convertTableToRange:{label:`Convert To Range`,description:`Convert the table into a normal range of cells.
|
|
24
|
+
|
|
25
|
+
The values and the formatting are preserved.`,icon:`TableInsert`,tags:[`mutator`]},insertPivotTable:{label:`PivotTable`,description:`Summarize data in a PivotTable. Choose its source and where it goes, then pick its fields.`,groupLabels:{contextMenu:`Insert PivotTable…`},icon:`Table`},editPivotTable:{label:`Edit PivotTable…`,description:`Show the PivotTable's fields to choose what it groups and what it computes.`,groupLabels:{pivotToolbar:`Field List`},icon:`Table`},refreshPivotTable:{label:`Refresh PivotTable`,description:`Read the PivotTable's source again and lay it out.`,groupLabels:{pivotRefreshOptions:`Refresh`},icon:`RefreshAll`,shortcut:`alt+F5`},deletePivotTable:{label:`Delete PivotTable`,description:`Remove the PivotTable and its cells.`,icon:`Delete`},formatPivotStyle:{label:`PivotTable Styles`,description:`Apply a style to the PivotTable.`,icon:`PresetStyles`},formatPivotStyleClear:{label:`Clear PivotTable Style`,description:`Remove the PivotTable's style.`,icon:`ClearFormats`},tableFilterToggle:{label:`Sort & Filter`,description:`Toggle Auto Table on/off.`,groupLabels:{filterOptions:`Filter`,sortFilterOptions:`Sort & Filter`},icon:`FilterToggle`,shortcut:`ctrl+shift+L`},formatPainterToggle:{label:`Format Painter`,description:`Apply style to another part of your workbook.`,icon:`FormatPaint.yellow`},insertCells:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{{mode, select, copy{Insert Copied Cells} cut{Insert Cut Cells} other{Insert Cells}}{shift, select, right{ (Shift Right)} down{ (Shift Down)} other{}}}}`,description:`Inserts cells at the current selection.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied At Selection} cut{Cut At Selection} other{At Selection}}`},icon:`InsertCells`,shortcut:`ctrl+shift+Equal`,params:{mode:`none`,shift:`none`,span:`none`,count:1}},insertCellsShiftRight:{label:`{span, select, columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{Insert Cells (Shift Right)}}`,description:`Insert cells to the left and shift the current cells to the right.`,groupLabels:{insertCellsOptions:`{span, select, columns{{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}} other{Shift Right}}`},icon:`InsertCellsRight`,params:{mode:`none`,span:`none`,count:1}},insertCellsShiftDown:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} other{Insert Cells (Shift Down)}}`,description:`Insert cells above and shift the current cells downward.`,groupLabels:{insertCellsOptions:`{span, select, rows{{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}} other{Shift Down}}`},icon:`InsertCellsDown`,params:{mode:`none`,span:`none`,count:1}},insertRows:{label:`{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}`,description:`Insert a row above the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}`},icon:`InsertRow`,params:{count:1,mode:`none`}},insertColumns:{label:`{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}`,description:`Insert a column before the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}`},icon:`InsertColumn2`,params:{count:1,mode:`none`}},insertRowsAfter:{label:`{mode, select, copy{Insert Copied Rows Below} cut{Insert Cut Rows Below} other{{count, plural, one{Insert Row Below} other{Insert # Rows Below}}}}`,description:`Insert a row below the current position.`,groupLabels:{insertCellsOptions:`Row Below`},params:{count:1,mode:`none`}},insertColumnsAfter:{label:`{mode, select, copy{Insert Copied Columns After} cut{Insert Cut Columns After} other{{count, plural, one{Insert Column After} other{Insert # Columns After}}}}`,description:`Insert a column after the current position.`,groupLabels:{insertCellsOptions:`Column After`},params:{count:1,mode:`none`}},deleteCells:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells{shift, select, left{ (Shift Left)} up{ (Shift Up)} other{}}}}`,description:`Delete the cells.`,groupLabels:{deleteCellsOptions:`At Selection`},icon:`DeleteCells`,shortcut:`ctrl+Minus`,params:{span:`none`,count:1,shift:`none`}},deleteCellsShiftUp:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} other{Delete Cells (Shift Up)}}`,description:`Delete cells the current current downward.`,groupLabels:{deleteCellsOptions:`{span, select, rows{{count, plural, one{Row} other{# Rows}}} other{Shift up}}`},icon:`DeleteCellsUp`,params:{span:`none`,count:1}},deleteCellsShiftLeft:{label:`{span, select, columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells (Shift Left)}}`,description:`Delete cells the current cells to the right.`,groupLabels:{deleteCellsOptions:`{span, select, columns{{count, plural, one{Column} other{# Columns}}} other{Shift Left}}`},icon:`DeleteCellsLeft`,params:{span:`none`,count:1}},deleteRows:{label:`{count, plural, one{Delete Row} other{Delete # Rows}}`,description:`Delete the rows at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Row} other{# Rows}}`},icon:`DeleteRows`,params:{count:1}},deleteColumns:{label:`{count, plural, one{Delete Column} other{Delete # Columns}}`,description:`Delete the columns at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Column} other{# Columns}}`},icon:`DeleteColumns`,params:{count:1}},flashFill:{label:`Flash Fill`,description:`Do a flash fill.`,shortcut:[`ctrl+e`,`ctrl+alt+e`]},fillDown:{label:`Fill Down`,description:`Copy the top-most value from the selection to the bottom of the selection.`,icon:`FillDown`,shortcut:[`ctrl+d`,`ctrl+alt+d`],tags:[`mutator`]},fillRight:{label:`Fill Right`,description:`Copy the left-most value from the selection to the right of the selection.`,icon:`FillRight`,shortcut:[`ctrl+r`],tags:[`mutator`]},fillUp:{label:`Fill Up`,description:`Copy the bottom-most value from the selection to the top of the selection.`,icon:`FillUp`,tags:[`mutator`]},fillLeft:{label:`Fill Left`,description:`Copy the right-most value from the selection to the left of the selection.`,icon:`FillLeft`,tags:[`mutator`]},fillSeries:{label:`Series…`,description:`Fill the selection with a series of numbers or dates, choosing the type, step value and stop value.`,tags:[`mutator`]},formatBorderAddOutline:{label:`Add Outline Border`,description:`Apply an outline border.`,shortcut:`ctrl+shift+7`,tags:[`mutator`]},formatBorderClearOutline:{label:`Remove Outline Border`,description:`Remove the outline border.`,shortcut:`ctrl+shift+_`,tags:[`mutator`]},formatIndentDecrease:{label:`Decrease Indent`,description:`Move your content closer to the border.`,icon:`FormatIndentDecrease`,tags:[`mutator`,`quickAction`]},formatIndentIncrease:{label:`Increase Indent`,description:`Move your content further from the border.`,icon:`FormatIndentIncrease`,tags:[`mutator`,`quickAction`]},mergeToggle:{label:`Merge`,description:`Combine and center the contents into a single cell.`,icon:`MergeAll`,shortcut:`ctrl+m`},mergeHorizontal:{label:`Merge Horizontally`,description:`Combine the contents into horizontal rows.`,icon:`MergeHorizontal`},mergeVertical:{label:`Merge Vertically`,description:`Combine the contents into vertical columns.`,icon:`MergeVertical`},unmerge:{label:`Unmerge`,description:`Split merged cells into multiple cells.`,icon:`MergeUnMerge`},clearContents:{label:`Clear Contents`,description:`Clear only the contents in the cells.
|
|
26
|
+
|
|
27
|
+
The formatting is not cleared.`,groupLabels:{clearOptions:`Contents`},icon:`ClearContents`,shortcut:`Delete`,tags:[`mutator`]},clearFormats:{label:`Clear Formats`,description:`Clear only the formatting that is applied to the cells.`,groupLabels:{clearOptions:`Formats`},icon:`ClearFormats`,tags:[`mutator`]},clearHyperlinks:{label:`Clear Hyperlinks`,description:`Clear only the hyperlinks in the cells.`,groupLabels:{clearOptions:`Hyperlinks`},tags:[`mutator`]},clearComments:{label:`Clear Comments`,description:`Clear the comments from the cells.`,groupLabels:{clearOptions:`Comments`},tags:[`mutator`]},clearAll:{label:`Clear All`,description:`Clears everything from the cells.
|
|
28
|
+
|
|
29
|
+
All contents and formatting are removed.`,groupLabels:{clearOptions:`All`},icon:`ClearAll`,shortcut:`ctrl+shift+Delete`,tags:[`mutator`]},freezeToggle:{label:`Freeze Panes`,description:`Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).`,icon:`FreezeBoth`},freezeToggleHorizontal:{label:`Freeze Top Rows`,description:`Keep the top rows visible while scrolling through the rest of the sheet.`,icon:`FreezeRows`},freezeToggleVertical:{label:`Freeze Left Columns`,description:`Keep the left columns visible while scrolling through the rest of the sheet.`,icon:`FreezeColumns`},unfreeze:{label:`Unfreeze Panes`,description:`Unfreeze both the rows and columns.`,icon:`MergeUnMerge`},freezePanesAt:{label:`Move Freeze`,description:`Freeze the rows or columns up to the given one.`},autoFitRows:{label:`Autofit Rows`,description:`Adjust the rows to the best height.`,icon:`RowsResizeAuto`,tags:[`mutator`]},resizeRows:{label:`Resize Rows`,description:`Resize the rows to the specified height.`,icon:`RowsResize`,tags:[`mutator`]},autoFitColumns:{label:`Autofit Columns`,description:`Adjust the columns to the best width.`,icon:`ColumnsResizeAuto`,tags:[`mutator`]},resizeColumns:{label:`Resize Columns`,description:`Resize the columns to the specified width.`,icon:`ColumnsResize`,tags:[`mutator`]},pasteValues:{label:`Paste Values`,description:`Paste only the values of the selected cells.
|
|
30
|
+
|
|
31
|
+
The formatting is not applied.`,groupLabels:{pasteOptions:`Values`},icon:`PasteValues`,shortcut:`ctrl+shift+V`},pasteFormats:{label:`Paste Formatting`,description:`Paste only the formats of the selected cells.
|
|
32
|
+
|
|
33
|
+
The content is not applied.`,groupLabels:{pasteOptions:`Formatting`},icon:`PasteFormats`},pasteFormulas:{label:`Paste Formulas`,description:`Paste only the formulas of the selected cells. The values and formatting is not applied.`,groupLabels:{pasteOptions:`Formulas`},icon:`PasteFormulas`},pasteTranspose:{label:`Paste Transpose`,description:`Paste with the rows and columns flipped.`,groupLabels:{pasteOptions:`Transpose`},icon:`PasteTranspose`},pasteLinks:{label:`Paste Links`,description:`Paste as formula references to the original cells.`,groupLabels:{pasteOptions:`Links`},icon:`PasteLinks`},undo:{label:`Undo`,icon:`Undo`,shortcut:`ctrl+z`,borrow:[`workbook`],description:`{hasAction, select, true{Undo {action}} other{Undo the last action.}}`,params:{hasAction:!1,action:``}},redo:{label:`Redo`,icon:`Redo`,shortcut:[`ctrl+y`,`F4`,`alt+Enter`],borrow:[`workbook`],description:`{hasAction, select, true{Redo {action}} other{Repeat the last action or undo the redo.}}`,params:{hasAction:!1,action:``}}}}},{sourceId:`slicer`,catalog:{scope:`slicer`,label:`Slicer`,tag:`en`,version:1,commands:{formatSlicerStyle:{label:`Slicer Styles`,description:`Change how the slicer and its items look.`,icon:`PresetStyles`,tags:[`mutator`]}}}},{sourceId:`table`,catalog:{scope:`table`,label:`Table`,tag:`en`,version:1,commands:{insertSlicer:{label:`Insert Slicer`,description:`Add a slicer that filters the table by the selected column. Picking a style adds one in that style.`,icon:`SlicerInsert`,tags:[`mutator`]},tableStyleOptions:{label:`Table Style`,description:`Toggle which structural elements (header, total, banded rows/columns, filter) the table shows.`,groupLabels:{tableToolbar:`Style`}},tableTotalRowToggle:{label:`Toggle Table Total Row`,description:`Toggle Total Row on/off.`,groupLabels:{tableStyleOptions:`Total Row`},shortcut:`ctrl+alt+T`},tableHeaderRowToggle:{label:`Toggle Table Header Row`,description:`Toggle Header Row on/off.`,groupLabels:{tableStyleOptions:`Header Row`}},tableBandedRowsToggle:{label:`Toggle Table Banded Rows`,description:`Toggle Banded Rows on/off.`,groupLabels:{tableStyleOptions:`Banded Rows`}},tableFirstColumnToggle:{label:`Toggle Table First Column`,description:`Toggle First Column on/off.`,groupLabels:{tableStyleOptions:`First Column`}},tableLastColumnToggle:{label:`Toggle Table Last Column`,description:`Toggle Last Column on/off.`,groupLabels:{tableStyleOptions:`Last Column`}},tableBandedColumnsToggle:{label:`Toggle Table Banded Columns`,description:`Toggle Banded Columns on/off.`,groupLabels:{tableStyleOptions:`Banded Columns`}},tableFilterRefresh:{label:`Reapply Sort & Filter`,description:`Reapply the sort and filter with the latest changes.`,groupLabels:{filterOptions:`Reapply`,sortFilterOptions:`Reapply`},icon:`FilterReapply`,shortcut:`ctrl+alt+L`},tableFilterClear:{label:`Clear Sort & Filter`,description:`Clear the sort and filters criteria from the current area..`,groupLabels:{filterOptions:`Clear`,sortFilterOptions:`Clear`},icon:`FilterClear`},formatTableStyleClearTableStyle:{label:`Clear Table Style`,description:`Remove all the styling that is specific for the table.`,groupLabels:{tableStyleOptions:`Clear Style`},icon:`ClearFormats`}}}},{sourceId:`workbook`,catalog:{scope:`workbook`,label:`Workbook`,tag:`en`,version:1,commands:{addSheet:{label:`Insert Sheet`,description:`Insert sheet before the current sheet.`,groupLabels:{sheet:`Insert`},shortcut:[`shift+F11`,`shift+alt+F1`]},deleteSheet:{label:`Delete Sheet`,description:`Delete the sheet and all the data.`,groupLabels:{sheet:`Delete`}},duplicateSheet:{label:`Duplicate Sheet`,description:`Duplicate the current sheet.`,groupLabels:{sheet:`Duplicate`}},hideSheet:{label:`Hide Sheet`,description:`Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.`,groupLabels:{sheet:`Hide`},icon:`VisibilityOff`},nextSheet:{label:`Next Sheet`,description:`Activate the next sheet.`,groupLabels:{sheet:`Next`},shortcut:`ctrl+PageDown`},previousSheet:{label:`Previous Sheet`,description:`Activate the previous sheet.`,groupLabels:{sheet:`Previous`},shortcut:`ctrl+PageUp`},selectNextSheet:{label:`Select Next Sheet`,description:`Select the next sheet.`,groupLabels:{sheet:`Select Next`},shortcut:`ctrl+shift+PageDown`},selectPreviousSheet:{label:`Select Previous Sheet`,description:`Select the previous sheet.`,groupLabels:{sheet:`Select Previous`},shortcut:`ctrl+shift+PageUp`},workbookViewToggleShowFormulaBar:{label:`View Formula bar`,description:`Show or hide the formula bar.`,groupLabels:{view:`Formula Bar`}},workbookViewToggleShowTabs:{label:`View Sheet Tabs`,description:`Show or hide the sheet tabs.`,groupLabels:{view:`Sheet Tabs`}},workbookViewToggleShowStatusBar:{label:`View Status Bar`,description:`Show or hide the status bar.`,groupLabels:{view:`Status Bar`}},workbookViewToggleShowHorizontalScrollBar:{label:`View Horizontal Scrollbar`,description:`Show or hide the horizontal scrollbar.`,groupLabels:{view:`Horizontal Scrollbar`}},workbookViewToggleShowVerticalScrollBar:{label:`View Vertical Scrollbar`,description:`Show or hide the vertical scrollbar.`,groupLabels:{view:`Vertical Scrollbar`}},workbookViewToggleExpandFormulaBar:{label:`Toggle Expand Formula bar`,description:`Expand or collapse the formula bar.`,shortcut:`ctrl+shift+U`},locale:{label:`Regional Format`,description:`The regional format used for numbers and dates. This is saved with the workbook.`,icon:`Locale`},newCellStyle:{label:`New Cell Style…`,description:`Create a new named style can can be quickly used later.`,groupLabels:{cellStyle:`New Cell Style`},icon:`NewPresetStyles`},deleteCellStyle:{label:`Delete Cell Style`,description:`Remove a named style that is no longer needed.`,groupLabels:{cellStyle:`Delete`}},modifyCellStyle:{label:`Modify Cell Style`,description:`Update a style with the currently style.`,groupLabels:{cellStyle:`Modify`}},find:{label:`Find`,description:`Open the Find window.`,icon:`Find`,shortcut:[`ctrl+F`,`shift+F5`]},findReplace:{label:`Find & Replace`,description:`Open the Find & Replace window.`,icon:`FindReplace`,shortcut:[`ctrl+H`,`ctrl+alt+H`]},findNext:{label:`Find Next`,description:`Find the next match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`shift+F4`},findPrevious:{label:`Find Previous`,description:`Find the previous match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`ctrl+shift+F4`},goto:{label:`Go To`,description:`Open the 'Go To' window.`,icon:`GoTo`,shortcut:`ctrl+G`},selectNamed:{label:`Select Named`,description:`Select the named item.`},addNamedReference:{label:`Define Named Reference`,description:`Add a new named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Define Name…`},icon:`InsertNamedRange`},editNamedReference:{label:`Edit Named Reference…`,description:`Edit the named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Edit…`},icon:`NamedRangeEdit`},deleteNamedReference:{label:`Delete Named Reference`,description:`Remove the named reference.`,groupLabels:{namedItem:`Delete`},icon:`DeleteNamedRange`},manageExternalLinks:{label:`Workbook Links`,description:`See every workbook this one links to, go to the formulas that cite one, and break a link.`,icon:`ExternalLinked`},showAnomaliesPane:{label:`Anomalies`,description:`List where the sheet breaks its own patterns: a formula unlike its neighbors, a typed value among formulas, a format that breaks its run.`,icon:`Find`},insertFunction:{label:`Insert Function`,description:`Insert a function into the current cell.`,icon:`FunctionThin`},selectTheme:{label:`Theme`,description:`Select a theme that coveys a style suitable for your data.`},calculateAll:{label:`Calculate Now`,description:`Recalculate the formulas whose values are out of date, on every sheet.`,icon:`Calculate`,shortcut:`F9`},calculateFull:{label:`Calculate Full`,description:`Recalculate every formula in the workbook, including those already up to date. Use this to replace the values a file was opened with.`,icon:`Calculate`,shortcut:`ctrl+alt+F9`},refreshAll:{label:`Refresh All`,description:`Get the latest data from every source the workbook reads: recalculate every formula, fetch what its functions read from the web again rather than from the copy the workbook keeps, update every external link, and refresh every PivotTable from its source.`,icon:`RefreshAll`,shortcut:`ctrl+alt+F5`},calcModeAutomatic:{label:`Automatic`,description:`Recalculate formulas whenever their inputs change.`},calcModeAutomaticExceptTables:{label:`Automatic Except for Data Tables`,description:`Recalculate formulas whenever their inputs change, except what-if data tables. Without data tables this is the same as Automatic.`},calcModeManual:{label:`Manual`,description:`Recalculate only when you ask (F9). Edits leave dependent formulas out of date until then.`},calcIterativeToggle:{label:`Enable Iterative Calculation`,description:`Resolve circular references by recalculating them repeatedly until they settle or the maximum iterations is reached. Off, a circular reference evaluates to 0.`},selectDirectPrecedents:{label:`Select Direct Precedents`,description:`Select the cells directly referenced by the formulas in the selection.`,shortcut:`ctrl+[`},selectPrecedents:{label:`Select All Precedents`,description:`Select all cells that contribute to the formulas in the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+{`},selectDirectDependents:{label:`Select Direct Dependents`,description:`Select the cells with formulas that directly reference the selection.`,shortcut:`ctrl+]`},selectDependents:{label:`Select All Dependents`,description:`Select all cells that are eventually affected by the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+}`},maximumWorkbookToggle:{label:`Maximize`,description:`Toggle showing the workbook maximized.`,shortcut:`ctrl+F10`},activeNameBox:{label:`Activate Name Box`,description:`Move the focus to the name box.`,shortcut:`alt+F3`},activeNameManager:{label:`Name Manager`,description:`Create, edit, delete, and find all the names used in the workbook.
|
|
34
|
+
|
|
35
|
+
Names can be used as a substitute for cell references.`,shortcut:`ctrl+F3`,icon:`NamedManager`,groupLabels:{namedItem:`Manage Names…`}},createNamedReferenceFromSelection:{label:`Create from Selection`,description:`Automatically generate names from the selected cells.`,shortcut:`ctrl+shift+F3`},spellCheck:{label:`Spell Check`,description:`Check the workbook for spelling mistakes.`,shortcut:`F7`},workbookStatistics:{label:`Workbook Statistics`,description:`Show the workbook statistics.`,icon:`WorkbookStatistics`,shortcut:`ctrl+shift+G`}}}}],{DefaultCommandCatalogService:cf}=fe,lf=!1;function uf(){lf||(lf=!0,cf.registerFromManifest(`@sheetxl/react`,import.meta.url,{messages:of,catalogs:sf}))}uf();var{CommandScope:df,DefaultCommandRegistry:ff,FocusActivation:pf,CommandRegistryContext:mf,CommandScopeContext:hf,CommandAnchorProvider:gf,CommandFallbackProvider:_f,useCommandScope:vf}=fe,yf=({initialAnchor:e,children:t})=>vf()?(0,Z.jsx)(Z.Fragment,{children:t}):(0,Z.jsx)(bf,{initialAnchor:e,children:t});yf.displayName=`CommandRootProvider`;var bf=({initialAnchor:e,children:t})=>{let n=(0,X.useRef)(e),{root:r,registry:i,studioTracker:a}=(0,X.useMemo)(()=>{let e=ff,t=new df(`app`,null,{registry:e});return{root:t,registry:e,studioTracker:new pf(t,n.current)}},[]);(0,X.useEffect)(()=>(r.connect(),()=>r.dispose()),[r]);let o=(0,X.useMemo)(()=>i.getDynamic(r.name),[i,r]);return(0,Z.jsx)(mf.Provider,{value:i,children:(0,Z.jsx)(Qd.Provider,{value:a,children:(0,Z.jsx)(hf.Provider,{value:r,children:(0,Z.jsxs)(gf,{tracker:a,keyBindings:`synthetic`,debounce:100,children:[(0,Z.jsx)(Zd,{}),(0,Z.jsxs)(_f,{children:[o.map((e,t)=>(0,Z.jsx)(e,{scope:r,data:void 0},t)),t]})]})})})})};bf.displayName=`CommandRootProviderOwn`;var{CommandScopeProvider:xf}=fe,Sf=(0,X.memo)(e=>{let{sheet:t,order:n}=e,[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=()=>{let e=(e=>{let t=e.getView().getMovableSelection().getActive()?.getContent();if(!t)return null;let n=t.getType(),r=qt(n);return!r&&Kt(n)?(Wt(n),null):{type:n,label:t.getTypeDescription(),commands:r?.commands,toolbar:r?.toolbar}})(t);i(t=>{return n=t,r=e,n?.type===r?.type&&n?.label===r?.label&&n?.commands===r?.commands&&n?.toolbar===r?.toolbar?t:e;var n,r}),o(e?t.getView().getMovableSelection().getActive():null)};e();let n=t.getView().addListeners({onMovableSelectionChange:e}),r=Jt(e);return()=>{n(),r()}},[t]);let s=(0,X.useMemo)(()=>r?r.toolbar??gd(r.type,r.label):null,[r]);(0,X.useEffect)(()=>{if(s)return vd(),md(s)},[s]);let c=Se(),l=Pd(!0),u=(0,X.useMemo)(()=>a?{sheet:t,movable:a,notifier:c,activateTaskPane:(e,t)=>l.activate(e,t),taskPaneArea:l}:null,[t,a,c,l]);return r&&u?(0,Z.jsx)(xf,{spec:{scopeName:{key:`layer:movable:${r.type}`,name:r.type},contributor:r.commands?{dynamic:r.commands}:void 0,data:u},order:n+.5},r.type):null});Sf.displayName=`MovableKindScope`;var{CommandScopeProvider:Cf}=fe,wf=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,propsMovable:i,renderMovable:a}=e;s(n,[`onProtectionChange`]);let o=!n.getProtection().isObjectsAllowed();(0,X.useEffect)(()=>{o&&n.getView().getMovableSelection().clear()},[o,n]);let c=Se(),l=Fe(),u=z(),d=Pd(!0),f=(0,X.useMemo)(()=>({sheet:n,notifier:c,editModeHandler:l,activateTaskPane:(e,t)=>d.activate(e,t),taskPaneArea:d}),[n,c,l,d]),p=Ht().zIndex;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Cf,{spec:{scopeName:{key:`layer:movable`,name:`movable`},contributor:{dynamic:jd},data:f},order:p,children:(0,Z.jsx)(ud,{ref:t,className:Q(r,`movable`),movables:n.getMovables(),disableResize:o,disableDrag:o,disabled:o,movableSelection:n.getView().getMovableSelection(),renderMovable:a,renderTip:e=>{let{kind:t,movable:r,bounds:i,rotation:a}=e;if(t===`rotate`)return u(`movable.tip.rotation`,{degrees:Math.round(a)});if(t===`resize`)return u(`movable.tip.size`,{width:Math.round(i.width),height:Math.round(i.height)});let o=r.getAnchorType?.()??Dn.Type.TwoCell;return o===Dn.Type.Absolute?u(`movable.tip.position`,{x:Math.round(i.x),y:Math.round(i.y)}):o===Dn.Type.OneCell?n.getRangeAtBounds({...i,width:0,height:0}).getAddress():n.getRangeAtBounds(i).getAddress()},...i,onFocus:()=>{i?.onFocus?.()}})}),(0,Z.jsx)(Sf,{sheet:n,order:p})]})})),Tf=e=>e.getRange().getCoords(),Ef=(e,t)=>C.isCellWithinRange(t,Tf(e)),Df=e=>{e.select()},Of=e=>{let{sheet:t,hovered:n,renderToolbar:r}=e;return(0,Z.jsx)(Eu,{name:`table-toolbar`,sheet:t,hovered:n,rangeOf:Tf,contains:Ef,select:Df,render:(e,t)=>Du(r,Af,{...t,table:e})})};Of.displayName=`TableToolbarFloat`;var kf=[`editTable`,`convertTableToRange`,`deleteTable`],Af=e=>(0,Z.jsx)(Nu,{target:e.table,commandKeys:kf,color:Vl(e.table,e.sheet),iconKey:`Table`,menuName:`table-toolbar-menu`,floatProps:e.floatProps,setHeld:e.setHeld}),jf=`_dropdown_1bnz9_13`,Mf=`white`,Nf=`black`,Pf=({handleProps:e,size:t,background:n})=>{let r=t/2-1.5,i=t/3;return(0,Z.jsx)(`div`,{...e,style:{...e.style,width:t,height:t},children:(0,Z.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,style:{display:`block`,overflow:`visible`},children:(0,Z.jsx)(`path`,{shapeRendering:`crispEdges`,d:`M ${r-i} ${r} L ${r} ${r} L ${r} ${r-i}`,stroke:n,strokeWidth:2,strokeLinejoin:`miter`,fill:`none`})})})},Ff=(e,t)=>({rowStart:e.rowStart,colStart:e.colStart,rowEnd:Math.max(e.rowStart,t.rowIndex),colEnd:Math.max(e.colStart,t.colIndex)}),If=e=>[{text:e(`table.totals.none`),totals:null},{text:e(`table.totals.average`),totals:101},{text:e(`table.totals.count`),totals:103},{text:e(`table.totals.countNumbers`),totals:102},{text:e(`table.totals.max`),totals:104},{text:e(`table.totals.min`),totals:105},{text:e(`table.totals.stdDev`),totals:107},{text:e(`table.totals.sum`),totals:109},{text:e(`table.totals.var`),totals:110},{text:e(`table.totals.moreFunctions`),totals:`more`}],Lf=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${Nf}' fill='${Mf}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`,Rf=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Nf}' fill='${Mf}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,zf=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Nf}' fill='${Mf}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,Bf=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,renderToolbar:r,className:i,...a}=e,s=zt(),{visibleTables:c,cacheToken:l}=nc(n),[u,d]=(0,X.useState)(()=>n.getSelection()?.getCoords().cell??null),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),b=(0,X.useRef)(!1),x=G(e=>{e.preventDefault(),e.stopPropagation();let t=s.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});r.length===1&&r[0].select()},[s,n]),S=G(e=>{e.preventDefault(),e.stopPropagation();let t=s.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});if(r.length===1){let e=r[0].getRange().getCoords(),i={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};n.getRange(i).select()}},[s,n]),w=G(e=>{e.preventDefault(),e.stopPropagation();let t=s.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});if(r.length===1){let e=r[0].getRange().getCoords(),i={colStart:t.colIndex,rowStart:e.rowStart,colEnd:t.colIndex,rowEnd:e.rowEnd};n.getRange(i).select()}},[s,n]);o(n?.getSelection(),{onChange(e){d(n.getSelection().getCoords().cell)}}),(0,X.useEffect)(()=>{let e=null;if(c&&u){let t=c.length;for(let n=0;n<t&&!e;n++){let t=c[n];if(t.isDeleted())continue;let r=t.getRange().getCoords();C.isCellWithinRange(u,r)&&(e=t)}}p(e)},[u,c]);let T=G(e=>{if(b.current)return;let t=null;if(c){let n=c.length;for(let r=0;!t&&r<n;r++){let n=c[r];if(n.isClosed()||n.isDeleted())continue;let i=n.getRange().getCoords(),a=s.getBoundsFromRange(i),o=s.getPanePointFromPointer(e.clientX,e.clientY);if(!o)continue;let l=o.x,u=o.y;if(l>=a.x&&l<=a.x+a.width&&u>=a.y&&u<=a.y+a.height){let e=s.getSurfaceSize();l<=0||u<=0||l>=e.width||u>=e.height||(t=n)}}}h(t)},[s,c]),E=G(()=>{b.current||h(null)},[]),D=Fe().getMode()?.key===`edit`,O=(0,X.useMemo)(()=>{if(!f||!u||D||!f.isShowTotals())return null;let e=f.getTotalRowRange().getCoords();if(!e||u.rowIndex!==e.rowStart)return null;let t=f.getColumnAt(u.colIndex-e.colStart);return t&&n.getCell(u).isEditAllowed()?{cell:u,column:t}:null},[n,f,u,D,l]),k=z(),A=(0,X.useRef)(null);A.current=O;let[M]=fe.useCommands([`insertFunctionDialog`]),N=jc({sheet:n,cell:null,anchor:null,resolveItems:G(async()=>If(k),[k]),getCurrentText:G(()=>{let e=A.current?.column.getTotalsRowFormula();return If(k).find(t=>t.totals===e)?.text??null},[k]),onChoose:G(e=>{let{totals:t}=e;t===`more`?M?.execute():A.current?.column.setTotalsRowFormula(t??void 0)},[M]),visibleRows:10,label:`totals-picker`}),P=(0,X.useRef)(N);P.current=N;let F=xt(!0),I=O?`${O.cell.rowIndex},${O.cell.colIndex}`:null,L=(0,X.useMemo)(()=>({}),[l,I]),R=G((e,t)=>{let n=A.current;return!n||t&&!C.isCellWithinRange(n.cell,t)?[]:[{cell:n.cell,value:n}]},[]),ee=G(e=>{let{value:t,style:n,zoom:r=1,key:i}=e,a=t;if(!n)return null;let o=n.width,s=n.height,c=17*r,l=Math.max(0,(c-s)/2);return(0,Z.jsx)(`div`,{style:{...n,position:`absolute`,top:n.top-l,width:o+c,height:s+2*l},children:(0,Z.jsx)(`div`,{className:jf,style:{position:`absolute`,left:o,top:l+(s-c)/2,width:c,height:c,pointerEvents:`auto`},role:`button`,"aria-haspopup":`listbox`,onPointerDown:e=>{if(e.button!==0)return;F(e),e.stopPropagation(),e.preventDefault();let t=P.current;t.isOpen?t.close():t.open({cell:a.cell,anchor:{range:C.cellToRange(a.cell)},minWidth:o})},children:(0,Z.jsx)(j,{iconKey:`ExpandMore`,size:.75*c})})},i)},[]),B=(0,X.useMemo)(()=>{if(!c||c.length===0)return null;let e=[],t=c.length;for(let r=0;r<t;r++){let t=c[r];if(t.isDeleted())continue;let i=t===m,a=t===f,o=t.getRange().getCoords(),l=s.getBoundsFromRange(o),u;if(i||a){let e=t.getStyle().getProperties(),r=e.headerRow?.fill?.background??e.wholeTable?.borders?.top?.color?.toString();if(r&&n){let e=n.getStyles().parseColor(r);e&&(u=e.toCSS(`adaptive`))}u||=`var(--sxl-color-shadow, rgba(0,0,0,.15))`}e.push((0,Z.jsx)(`div`,{className:`table-select-row`,style:{position:`absolute`,left:l.x,top:l.y,width:Math.min(16,l.width),height:l.height,pointerEvents:`all`,cursor:Rf},onMouseDown:S},`table-select-row-${t.getName()}`)),e.push((0,Z.jsx)(`div`,{className:`table-select-column`,style:{position:`absolute`,left:l.x,top:l.y,width:l.width,height:Math.min(7,l.height),pointerEvents:`all`,cursor:Lf},onMouseDown:w},`table-select-column-${t.getName()}`)),e.push((0,Z.jsx)(`div`,{className:`table-select-all`,style:{position:`absolute`,left:l.x,top:l.y,width:Math.min(16,l.width),height:Math.min(16,l.height),pointerEvents:`all`,cursor:zf},onMouseDown:x},`table-select-${t.getName()}`)),e.push((0,Z.jsx)(Vt,{className:`table-outline`,range:o,stroke:u??`var(--sxl-color-neutral, grey)`,propsStrokePath:{strokeWidth:.5,style:{willChange:`opacity, filter`,transition:`opacity 80ms ease-in-out, filter 80ms ease-in-out`,opacity:a||i?1:0,filter:i?`drop-shadow(0px 0px 1px ${u})`:void 0}}},`table-outline-${t.getName()}`))}return e},[n,s,m,f,c,l]),V=s.getVisibleRange(),H=(c??[]).map(e=>{if(e.isDeleted()||e.isHiddenDecorations())return null;let t=e.getRange().getCoords();return C.isCellWithinRange({rowIndex:t.rowEnd,colIndex:t.colEnd},V)?(0,Z.jsx)(Xe,{className:`table-resize-handle`,range:e===v&&g?g:t,anchor:`br`,size:12,background:Vl(e,n),renderHandle:Pf,onDragStart:()=>{b.current=!0,y(e)},onDragMove:(e,n)=>_(Ff(t,n)),onDragEnd:(n,r)=>{b.current=!1,y(null),_(null);let i=Ff(t,r);if(i.rowEnd!==t.rowEnd||i.colEnd!==t.colEnd)try{e.resize(i)}catch{}}},`table-resize-${e.getName()}`):null}),U=v&&g?(0,Z.jsx)(Vt,{className:`table-resize-preview`,range:g,stroke:Vl(v,n),alignWidth:1}):null;return(0,Z.jsxs)(et,{onMouseMove:T,onMouseLeave:E,className:Q(i,`table`),children:[B,U,H,(0,Z.jsx)(Of,{sheet:n,hovered:m&&!m.isHiddenDecorations()?m:null,renderToolbar:r}),(0,Z.jsx)(nt,{className:`table-totals-dropdown`,renderCell:ee,getVisibleCells:R,cacheToken:L}),N.component]})}));function Vf(e,t){let{manager:n,notifier:r}=t;if(!n)return()=>{};let i={undoManager:n},a=()=>{let t=n.getTopUndoDescription(),a=n.getTopRedoDescription();e.updateCommand(`undo`,{tags:[`noTransaction`],context:i,callback:e=>{try{n.undo(e??1)}catch(e){r?.showError?.(e)}},disabledReasons:n.hasUndo()?[]:[S(`reason.nothingToUndo`)],params:{hasAction:!!t,action:t?A(t):``}}),e.updateCommand(`redo`,{tags:[`noTransaction`],context:i,callback:e=>{try{n.redo(e??1)}catch(e){r?.showError?.(e)}},disabledReasons:n.hasRedo()?[]:[S(`reason.nothingToRedo`)],params:{hasAction:!!a,action:a?A(a):``}})};a();let o=n.addListener({onStackChange:a});return()=>{o()}}var Hf=(0,X.createContext)(null),Uf=()=>(0,X.useContext)(Hf),Wf={key:`tableStyleOptions`,showLabel:!0,members:[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`,`tableFilterToggle`]},Gf={key:`tableToolbar`,contributions:{[fd]:{order:1}},members:[`editTable`,`-`,`insertSlicer`,`-`,`dataRemoveDuplicates`,{key:`convertTableToRange`,showLabel:!0},`-`,`tableStyleOptions`,`-`,`formatTableStyle`]},Kf=(e,t)=>e?[t]:[],qf=[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`];function Jf(e,t){let n=t.sheet;if(!n)return()=>{};let r=t.notifier,i=()=>{let e=n.getSelectedRanges();if(e.getCount()!==1)return null;let t=e.at(0).getCoords();for(let e of n.getTables().getItems()){let n=e.getRange().getCoords();if(t.rowStart>=n.rowStart&&t.rowEnd<=n.rowEnd&&t.colStart>=n.colStart&&t.colEnd<=n.colEnd)return e}return null},a=e=>{let t=e.getDataRange().getCoords(),r=n.getSelectedRange().getCoords(),i=Math.min(Math.max(r.rowStart,t.rowStart),t.rowEnd),a=Math.min(Math.max(r.rowEnd,t.rowStart),t.rowEnd);return{index:i-t.rowStart,count:a-i+1,valid:r.rowStart>=t.rowStart&&r.rowEnd<=t.rowEnd}},o=e=>{let t=e.getRange().getCoords(),r=n.getSelectedRange().getCoords(),i=Math.min(Math.max(r.colStart,t.colStart),t.colEnd),a=Math.min(Math.max(r.colEnd,t.colStart),t.colEnd);return{index:i-t.colStart,count:a-i+1}},s=e=>()=>{let t=i(),n=t?a(t):null;return A(e,{count:n?.valid?n.count:1})},c=e=>()=>{let t=i();return A(e,{count:t?o(t).count:1})},l=()=>{let e=i();e&&a(e).valid&&n.getSelectedRange().insert({axis:Y.Axis.Row,span:!0})},u=()=>{let e=i();e&&a(e).valid&&n.getSelectedRange().delete({axis:Y.Axis.Row,span:!0})},d=()=>{i()&&n.getSelectedRange().insert({axis:Y.Axis.Column,span:!0})},f=()=>{i()&&n.getSelectedRange().delete({axis:Y.Axis.Column,span:!0})},p=()=>n.getSelectedRanges().getDefaultShiftAxis()===Y.Axis.Column,m=()=>{let t=i();e.updateCommand(`tableTotalRowToggle`,{state:t?.isShowTotals()??!1}),e.updateCommand(`tableHeaderRowToggle`,{state:t?.isShowHeaders()??!1}),e.updateCommand(`tableBandedRowsToggle`,{state:t?.isShowBandedRows()??!1}),e.updateCommand(`tableFirstColumnToggle`,{state:t?.isShowHighlightFirstColumn()??!1}),e.updateCommand(`tableLastColumnToggle`,{state:t?.isShowHighlightLastColumn()??!1}),e.updateCommand(`tableBandedColumnsToggle`,{state:t?.isShowBandedColumns()??!1});let r=n.getProtection(),o=Kf(!r.isFormatCellsAllowed(),S(`reason.sheetProtected`));for(let t of qf)e.updateCommand(t,{disabledReasons:o});let s=Kf(!r.isAutoTableAllowed()||!r.isSortAllowed(),S(`reason.sheetProtected`));if(e.updateCommand(`tableFilterRefresh`,{disabledReasons:s}),e.updateCommand(`tableFilterClear`,{disabledReasons:s}),e.updateCommand(`formatTableStyleClearTableStyle`,{disabledReasons:[...o,...Kf(!t||t.getStyleOptions().name===null,S(`reason.noTableStyle`))]}),t){let n=Kf(!a(t).valid,S(`reason.tableBodyRows`));e.updateCommand(`insertCellsShiftDown`,{disabledReasons:n}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:n});let i=p()?[]:n;e.updateCommand(`insertCells`,{disabledReasons:i}),e.updateCommand(`deleteCells`,{disabledReasons:i}),e.updateCommand(`insertSlicer`,{disabledReasons:Kf(!r.isObjectsAllowed(),S(`reason.sheetProtected`))})}},h=null,g=null,_=e=>{e!==h&&(g?.(),g=null,h=e,e&&(g=e.addListeners({onAnyChange:()=>{v!==null&&m()}},{transactional:!1})))},v=null,y=null,b=()=>{let a=i();_(a);let o=a?`table`:n.getAutoTable()?`auto`:null;o!==v&&(v!==null&&e.remove(),o!==null&&(e.use(on({transaction:n,notifier:r,manager:t.manager})),e.updateCommand(`tableTotalRowToggle`,{callback:()=>{let e=i();e&&e.setShowTotals(!e.isShowTotals())}}),e.updateCommand(`tableHeaderRowToggle`,{callback:()=>{let e=i();e&&e.setShowHeaders(!e.isShowHeaders())}}),e.updateCommand(`tableBandedRowsToggle`,{callback:()=>{let e=i();e&&e.setShowBandedRows(!e.isShowBandedRows())}}),e.updateCommand(`tableFirstColumnToggle`,{callback:()=>{let e=i();e&&e.setShowHighlightFirstColumn(!e.isShowHighlightFirstColumn())}}),e.updateCommand(`tableLastColumnToggle`,{callback:()=>{let e=i();e&&e.setShowHighlightLastColumn(!e.isShowHighlightLastColumn())}}),e.updateCommand(`tableBandedColumnsToggle`,{callback:()=>{let e=i();e&&e.setShowBandedColumns(!e.isShowBandedColumns())}}),e.updateCommand(`tableFilterRefresh`,{callback:async()=>{await(i()??n.getAutoTable())?.applySortsAndFilters()}}),e.updateCommand(`tableFilterClear`,{callback:async e=>{if(e)return e.getSort()?.delete(),void await e.getFilter()?.delete();await(i()??n.getAutoTable())?.deleteSortsAndFilters()}}),e.updateCommand(`formatTableStyleClearTableStyle`,{tags:[`noTransaction`],callback:()=>{i()?.updateStyleOptions({name:null})},context:()=>({styles:()=>n.getStyles(),table:()=>i(),getNames:()=>n.getNames(),resolveRanges:e=>(n.getWorkbook()??n).getRanges(e).getFixed(!0)})}),o===`table`&&(e.updateCommand(`insertSlicer`,{tags:[`noTransaction`],callback:async e=>{let t=i();if(!t)return;let r=n.getSelection().getCell().getCoords().colIndex-t.getRange().getCoords().colStart,a=t.getColumnAt(r);a&&await t.addSlicer(a,{style:e,autoSelect:!0})},context:()=>({styles:()=>n.getStyles()})}),e.updateCommand(`insertCellsShiftDown`,{label:s(S(`table.insertRows`)),groupLabels:{insertCellsOptions:s(S(`table.rows.compact`))},description:()=>A(`table.insertRows.description`),icon:`InsertRow`,callback:l}),e.updateCommand(`deleteCellsShiftUp`,{label:s(S(`table.deleteRows`)),groupLabels:{deleteCellsOptions:s(S(`table.rows.compact`))},description:()=>A(`table.deleteRows.description`),icon:`DeleteRows`,callback:u}),e.updateCommand(`insertCellsShiftRight`,{label:c(S(`table.insertColumns`)),groupLabels:{insertCellsOptions:c(S(`table.columns.compact`))},description:()=>A(`table.insertColumns.description`),icon:`InsertColumn2`,callback:d}),e.updateCommand(`deleteCellsShiftLeft`,{label:c(S(`table.deleteColumns`)),groupLabels:{deleteCellsOptions:c(S(`table.columns.compact`))},description:()=>A(`table.deleteColumns.description`),icon:`DeleteColumns`,callback:f}),e.updateCommand(`insertCells`,{label:()=>(p()?c(S(`table.insertColumns`)):s(S(`table.insertRows`)))(),groupLabels:{insertCellsOptions:()=>(p()?c(S(`table.columns.compact`)):s(S(`table.rows.compact`)))()},description:()=>p()?A(`table.insertColumns.description`):A(`table.insertRows.description`),callback:()=>{p()?d():l()}}),e.updateCommand(`deleteCells`,{label:()=>(p()?c(S(`table.deleteColumns`)):s(S(`table.deleteRows`)))(),groupLabels:{deleteCellsOptions:()=>(p()?c(S(`table.columns.compact`)):s(S(`table.rows.compact`)))()},description:()=>p()?A(`table.deleteColumns.description`):A(`table.deleteRows.description`),callback:()=>{p()?f():u()}}))),o===`table`?y??=(()=>{let e=md(Wf),t=md(Gf);return()=>{t(),e()}})():(y?.(),y=null),v=o),o!==null&&m()};b();let x=n.getSelection().addListeners({onChange:b}),C=n.addListeners({onTablesChange:b,onAutoTableChange:b,onProtectionChange:b});return()=>{x(),C(),_(null),y?.(),y=null,v=null}}var{CommandScopeProvider:Yf}=fe,Xf=(0,X.memo)(e=>{let{sheet:t}=e,n=Se(),r=Uf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(Yf,{spec:{scopeName:{key:`layer:table`,name:`table`},contributor:{dynamic:Jf},data:i},order:Ht().zIndex})});Xf.displayName=`SheetTableCommandLayer`;var Zf={key:`pivotStyleOptions`,showLabel:!0,members:[`pivotRowHeadersToggle`,`pivotColumnHeadersToggle`,`pivotBandedRowsToggle`,`pivotBandedColumnsToggle`]},Qf={key:`pivotShowOptions`,showLabel:!0,members:[`pivotDrillIndicatorsToggle`,`pivotFieldHeadersToggle`]},$f={key:`pivotRefreshOptions`,defaultKey:`refreshPivotTable`,showLabel:!0,members:[`refreshPivotTable`,`refreshAll`]},ep={key:`pivotToolbar`,contributions:{[fd]:{order:1}},members:[`editPivotTable`,`-`,`pivotRefreshOptions`,`-`,`pivotShowOptions`,`-`,`pivotStyleOptions`,`-`,`formatPivotStyle`]},tp=[[`pivotRowHeadersToggle`,`showRowHeaders`],[`pivotColumnHeadersToggle`,`showColumnHeaders`],[`pivotBandedRowsToggle`,`showRowStripes`],[`pivotBandedColumnsToggle`,`showColumnStripes`]];function np(e,t){let n=t.sheet;if(!n)return()=>{};let r=t.notifier,i=()=>zl(n),a=!1,o=null,s=()=>{let s=i()!==null;s!==a&&(a&&e.remove(),s?((()=>{e.use(on({transaction:n,notifier:r,manager:t.manager}));for(let[t,n]of tp)e.updateCommand(t,{callback:()=>{let e=i();e&&e.updateStyleOptions({[n]:!e.getStyleOptions()[n]})}});e.updateCommand(`pivotDrillIndicatorsToggle`,{callback:()=>{let e=i();e&&e.setHiddenDrillIndicators(!e.isHiddenDrillIndicators())}}),e.updateCommand(`pivotFieldHeadersToggle`,{callback:async()=>{let e=i();e&&await e.setHiddenFieldHeaders(!e.isHiddenFieldHeaders())}})})(),o??=(()=>{let e=md($f),t=md(Qf),n=md(Zf),r=md(ep);return()=>{r(),n(),t(),e()}})()):(o?.(),o=null),a=s),a&&(()=>{let t=i(),r=t?.getStyleOptions();for(let[t,n]of tp)e.updateCommand(t,{state:!0===r?.[n]});let a=(o=!n.getProtection().isPivotTablesAllowed(),s=S(`reason.sheetProtected`),o?[s]:[]);var o,s;for(let[t]of tp)e.updateCommand(t,{disabledReasons:a});e.updateCommand(`pivotDrillIndicatorsToggle`,{state:!!t&&!t.isHiddenDrillIndicators(),disabledReasons:a}),e.updateCommand(`pivotFieldHeadersToggle`,{state:!!t&&!t.isHiddenFieldHeaders(),disabledReasons:a})})()};s();let c=n.getSelection().addListeners({onChange:s}),l=n.addListeners({onPivotTablesChange:s,onProtectionChange:s});return()=>{c(),l(),o?.(),o=null,a=!1}}var{CommandScopeProvider:rp}=fe,ip=(0,X.memo)(e=>{let{sheet:t}=e,n=Se(),r=Uf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(rp,{spec:{scopeName:{key:`layer:pivot`,name:`pivot`},contributor:{dynamic:np},data:i},order:Ht().zIndex})});ip.displayName=`SheetPivotCommandLayer`;var ap=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,animationTime:r=60,className:i,style:a,...s}=e,c=zt(),[l,u]=(0,X.useState)(null),[d,f]=(0,X.useState)(!1),[m,h]=(0,X.useState)(null),g=(0,X.useRef)(null),_=G(()=>{let e=n.getSelectedCell(),t=e.getSpill()?.getCoords()??null;f(!!t&&e.getSpillKind()===`fixed`),C.isEqualRanges(t,l)||(h(t?{transition:l?`move`:`in`,coords:t}:{transition:`out`,coords:l}),u(t))},[n,c,l]);(0,X.useEffect)(()=>(g.current&&=(clearTimeout(g.current),null),m&&(g.current=setTimeout(()=>{h(null),g.current=null},r)),()=>{g.current&&=(clearTimeout(g.current),null)}),[m,r]);let v=(0,X.useMemo)(()=>p.debounce(p.throttle(_,80),80),[]);if(o(n?.getSelection(),{onChange(e){v()}}),o(n,{onSpillsChange(e){_()},onInvalidated(e){_()}}),!c)return null;let y=l??m?.coords;if(!y)return null;let b=!!l&&n.getRange(l).getValue()instanceof Cn.Spill,x=d?`var(--sxl-color-accent)`:`var(--sxl-color-primary)`,S=`color-mix(in srgb, ${x} 70%, black)`;return(0,Z.jsx)(et,{className:Q(i,`spill-outline`,d&&`spill-outline-fixed`),children:(0,X.createElement)(Vt,{...s,key:`spill-outline`,className:`spill-outline-box`,range:y,alignWidth:1,stroke:S,clipInsets:-10,style:{...a,opacity:m?.transition===`out`?0:1},propsStrokePath:{strokeDasharray:b?`6 3`:void 0,style:{filter:`drop-shadow(0px 0px 2px color-mix(in srgb, color-mix(in srgb, ${x} 80%, white) 80%, transparent))`}}})})})),op=Object.freeze([{key:`lightRedFillDarkRedText`,style:{font:{color:`#9C0006`},fill:{type:`solid`,color:`#FFC7CE`}}},{key:`yellowFillDarkYellowText`,style:{font:{color:`#9C6500`},fill:{type:`solid`,color:`#FFEB9C`}}},{key:`greenFillDarkGreenText`,style:{font:{color:`#006100`},fill:{type:`solid`,color:`#C6EFCE`}}},{key:`lightRedFill`,style:{fill:{type:`solid`,color:`#FFC7CE`}}},{key:`redText`,style:{font:{color:`#9C0006`}}},{key:`redBorder`,style:{borders:{[pn.Edge.Left]:{style:pn.StrokeStyle.Thin,color:`#9C0006`},[pn.Edge.Top]:{style:pn.StrokeStyle.Thin,color:`#9C0006`},[pn.Edge.Right]:{style:pn.StrokeStyle.Thin,color:`#9C0006`},[pn.Edge.Bottom]:{style:pn.StrokeStyle.Thin,color:`#9C0006`}}}}]),sp=`#F8696B`,cp=`#FFEB84`,lp=`#63BE7B`,up=`#FCFCFF`,dp=`#5A8AC6`,fp=`#FFEF9C`,pp=e=>{let t=e.map((t,n)=>n===0?{type:Ln.ColorStopType.Min,color:t}:n===e.length-1?{type:Ln.ColorStopType.Max,color:t}:{type:Ln.ColorStopType.Percentile,value:50,color:t});return{type:Ln.ScaleType.ColorScale,stops:t}},mp=Object.freeze([pp([lp,cp,sp]),pp([sp,cp,lp]),pp([lp,up,sp]),pp([sp,up,lp]),pp([dp,up,sp]),pp([sp,up,dp]),pp([up,sp]),pp([sp,up]),pp([lp,up]),pp([up,lp]),pp([lp,fp]),pp([fp,lp])]),hp=Object.freeze([`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`]),gp=(e,t)=>({type:Ln.ScaleType.DataBar,stops:[{type:Ln.ColorStopType.AutoMin},{type:Ln.ColorStopType.AutoMax}],color:e,...t?{gradient:!0,borderColor:e}:null}),_p=Object.freeze([...hp.map(e=>gp(e,!0)),...hp.map(e=>gp(e,!1))]),vp=()=>structuredClone(mp[1]),yp=()=>structuredClone(_p[0]),bp=e=>{let t=[];for(let n=0;n<e;n++)t.push({type:Ln.ColorStopType.Percent,value:Math.round(100*n/e)});return t},xp=()=>({type:Ln.ScaleType.IconSet,iconSet:bn.IconSet.TrafficLights3,stops:bp(3)}),Sp=Object.freeze([{key:`directional`,rows:[[bn.IconSet.Arrows3,bn.IconSet.ArrowsGray3],[bn.IconSet.Arrows4,bn.IconSet.ArrowsGray4],[bn.IconSet.Arrows5,bn.IconSet.ArrowsGray5],[bn.IconSet.Triangles3,null]]},{key:`shapes`,rows:[[bn.IconSet.Signs3,bn.IconSet.TrafficLights3_2],[bn.IconSet.TrafficLights3,bn.IconSet.TrafficLights4],[bn.IconSet.RedToBlack4,null]]},{key:`indicators`,rows:[[bn.IconSet.Symbols3,bn.IconSet.Symbols3_2],[bn.IconSet.Flags3,null]]},{key:`ratings`,rows:[[bn.IconSet.Stars3,bn.IconSet.Rating4],[bn.IconSet.Quarters5,bn.IconSet.Rating5],[bn.IconSet.Boxes5,null]]}]);Object.freeze({set:bn.IconSet.NoIcons,id:0});var Cp={bad:`var(--sxl-cf-icon-bad)`,lightBad:`var(--sxl-cf-icon-light-bad)`,neutral:`var(--sxl-cf-icon-neutral)`,good:`var(--sxl-cf-icon-good)`,purple:`var(--sxl-cf-icon-purple)`,gold:`var(--sxl-cf-icon-gold)`,gray:`var(--sxl-cf-icon-gray)`,black:`var(--sxl-cf-icon-black)`},wp=(e,t)=>({iconKey:`cf:${e}`,color:t}),Tp=[`arrowDown`,`arrowRight`,`arrowUp`],Ep=[`arrowDown`,`arrowDownRight`,`arrowUpRight`,`arrowUp`],Dp=[`arrowDown`,`arrowDownRight`,`arrowRight`,`arrowUpRight`,`arrowUp`],Op=[Cp.bad,Cp.neutral,Cp.good],kp=[Cp.bad,Cp.lightBad,Cp.lightBad,Cp.good],Ap=[Cp.bad,Cp.lightBad,Cp.lightBad,Cp.lightBad,Cp.good],jp=(e,t)=>e.map((e,n)=>wp(e,t[n])),Mp=(e,t)=>e.map(e=>wp(e,t)),Np=(e,t)=>t.map(t=>wp(e,t)),Pp=[`rating0`,`rating1`,`rating2`,`rating3`,`rating4`],Fp={[bn.IconSet.Arrows3]:jp(Tp,Op),[bn.IconSet.ArrowsGray3]:Mp(Tp,Cp.gray),[bn.IconSet.Flags3]:Np(`flag`,Op),[bn.IconSet.Signs3]:jp([`diamond`,`triangleUp`,`circle`],Op),[bn.IconSet.Symbols3]:jp([`circleCross`,`circleExclamation`,`circleCheck`],Op),[bn.IconSet.Symbols3_2]:jp([`cross`,`exclamation`,`check`],Op),[bn.IconSet.TrafficLights3]:Np(`circle`,Op),[bn.IconSet.TrafficLights3_2]:Np(`circleRimmed`,Op),[bn.IconSet.Triangles3]:jp([`triangleDownSharp`,`dash`,`triangleUpSharp`],Op),[bn.IconSet.Stars3]:Mp([`star0`,`star1`,`star2`],Cp.gold),[bn.IconSet.Arrows4]:jp(Ep,kp),[bn.IconSet.ArrowsGray4]:Mp(Ep,Cp.gray),[bn.IconSet.Rating4]:Mp(Pp.slice(1),Cp.gray),[bn.IconSet.RedToBlack4]:Np(`circle`,[Cp.black,Cp.gray,Cp.purple,Cp.bad]),[bn.IconSet.TrafficLights4]:Np(`circleRimmed`,[Cp.black,Cp.bad,Cp.neutral,Cp.good]),[bn.IconSet.Arrows5]:jp(Dp,Ap),[bn.IconSet.ArrowsGray5]:Mp(Dp,Cp.gray),[bn.IconSet.Quarters5]:Mp([`quarters0`,`quarters1`,`quarters2`,`quarters3`,`quarters4`],Cp.black),[bn.IconSet.Rating5]:Mp(Pp,Cp.gray),[bn.IconSet.Boxes5]:Mp([`boxes0`,`boxes1`,`boxes2`,`boxes3`,`boxes4`],Cp.black),[bn.IconSet.NoIcons]:[]},Ip=(e,t)=>Fp[e]?.[t]??null,Lp=Object.freeze([]);new Map(Object.keys(Cp).map(e=>[Cp[e],e])),(()=>{let e=new Set,t=[];for(let n of Sp)for(let r of n.rows)for(let n of r){if(!n)continue;let r=Fp[n]??Lp;for(let i=r.length-1;i>=0;i--){let a=r[i],o=`${a.iconKey}|${a.color}`;e.has(o)||(e.add(o),t.push({set:n,id:i,spec:a}))}}return Object.freeze(t)})();var Rp=`_bar_6li90_16`,zp=`_axis_6li90_23`,Bp=(0,X.memo)(e=>{let{sheet:t,margin:n=1,className:r,style:i,...a}=e,o=zt(),{getVisibleDecorations:s,cacheToken:c}=fc(t,`dataBar`),l=(0,X.useMemo)(()=>({}),[c,n]),u=G(e=>{let{value:t,style:r,zoom:i=1,key:a}=e,o=t?.getConditionalDecorations().dataBar;if(!o||!r)return null;let s=Math.max(1,Math.round(n*i)),c=1/_e.getDevicePixelRatio(),l={x:r.left+s+c,y:r.top+s+c,width:r.width-2*s-c,height:r.height-2*s-c};return(0,Z.jsx)(Vp,{bar:o,track:l},a)},[n]);return s(o).length===0?null:(0,Z.jsx)(et,{...a,className:Q(r,`conditional-bars`),children:(0,Z.jsx)(nt,{renderCell:u,getVisibleCells:s,cacheToken:l,style:i})})});Bp.displayName=`ConditionalBarLayer`;var Vp=({bar:e,track:t})=>{let{value:n,axis:r,gradient:i,direction:a}=e,o=n<r,s=Math.min(n,r)*t.width,c=Math.abs(n-r)*t.width,l=a===`rightToLeft`,u=(e,n)=>l?t.x+t.width-e-n:t.x+e,d=!!e.axisColor&&r>0&&r<1;if(c<=0&&!d)return null;let f=(o?e.negativeColor:void 0)??e.color,p=(o?e.negativeBorderColor:void 0)??e.borderColor,m=i?`linear-gradient(to ${o===l?`right`:`left`}, ${f}, color-mix(in srgb, ${f} var(--sxl-cf-bar-fade), transparent))`:f;return(0,Z.jsxs)(X.Fragment,{children:[c>0?(0,Z.jsx)(`div`,{className:Q(Rp,`conditional-bar`),style:{left:u(s,c),top:t.y,width:c,height:t.height,background:m,border:p?`1px solid ${p}`:void 0}}):null,d?(0,Z.jsx)(`div`,{className:Q(zp,`conditional-bar-axis`),style:{left:u(r*t.width,1),top:t.y,height:t.height,background:e.axisColor}}):null]})},Hp=`_box_1qgal_41`,Up=(0,X.memo)(e=>{let{sheet:t,className:n,style:r,...i}=e,a=zt(),{getVisibleDecorations:o,cacheToken:s}=fc(t,`iconSet`),c=G(e=>{let{value:t,style:n,zoom:r=1,key:i}=e,a=t,o=a?.getConditionalDecorations().iconSet;if(!o||!n)return null;let s=Ip(o.set,o.index);if(!s)return null;let c=a.getStyle(),l=c.getInsets(),u=c.measureText(``),d=((u.ascent??u.lineHeight)+(u.descent??0))*r,f=c.getAlignment().getVertical(),p=Wp[f]??`flex-end`,m=Gp[f]??`center bottom`;return(0,Z.jsx)(j,{className:Hp,iconKey:s.iconKey,size:d,style:{left:n.left+l.left*r,top:n.top+l.top*r,width:d,height:n.height-(l.top+l.bottom)*r,minHeight:0,alignItems:p,color:s.color,"--sxl-cf-icon-origin":m}},i)},[]);return o(a).length===0?null:(0,Z.jsx)(et,{...i,className:Q(n,`conditional-icons`),children:(0,Z.jsx)(nt,{renderCell:c,getVisibleCells:o,cacheToken:s,style:r})})});Up.displayName=`ConditionalIconsLayer`;var Wp={[J.VerticalAlignment.Top]:`flex-start`,[J.VerticalAlignment.Center]:`center`,[J.VerticalAlignment.Bottom]:`flex-end`,[J.VerticalAlignment.Justify]:`center`,[J.VerticalAlignment.Distributed]:`center`},Gp={[J.VerticalAlignment.Top]:`center top`,[J.VerticalAlignment.Center]:`center`,[J.VerticalAlignment.Bottom]:`center bottom`,[J.VerticalAlignment.Justify]:`center`,[J.VerticalAlignment.Distributed]:`center`},Kp=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,className:r,style:i,...a}=e,o=zt(),{getVisibleCells:c,cacheToken:l}=qp(t),u=(0,X.useMemo)(()=>({}),[l,n]),d=G(e=>{let{style:t,zoom:r=1,key:i,value:a}=e;if(!t||!a)return null;let o=1/_e.getDevicePixelRatio();return(0,Z.jsx)(la,{anchorLocation:g.BottomRight,size:n*r,inset:0,cellWidth:t.width+o,cellHeight:t.height+o,fill:Qc[a.state],style:{left:t.left,top:t.top}},i)},[n]);return s(t.getView(),`onAnyChange`),t.getView().isShowInvalid()?c(o).length===0?null:(0,Z.jsx)(et,{...a,className:Q(r,`validation-marks`),children:(0,Z.jsx)(nt,{renderCell:d,getVisibleCells:c,cacheToken:u,style:i})}):null});Kp.displayName=`ValidationIndicatorLayer`;var qp=e=>{let t=zt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n,e]),a=(0,X.useRef)(new Map),s=G(()=>{a.current.clear(),r()},[]);o(e,{onDataValidationsChange:s},{ignoreModelChange:!0});let c=t.getVisibleRange();return ar(e,(0,X.useMemo)(()=>c?{rowStart:c.rowStart,colStart:c.colStart,rowEnd:c.rowEnd,colEnd:c.colEnd}:null,[c?.rowStart,c?.colStart,c?.rowEnd,c?.colEnd]),e=>{e.getTrigger()===`data`&&s()},Yp),{getVisibleCells:G((t,n)=>{let r=a.current,i=n??t.getVisibleRange();if(!i)return Jp;let o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,s=r.get(o);if(s)return s;let c=((e,t)=>{let n=e.getRange(t),r=n.getDataValidations();if(r.length===0)return[];let i=r.some(e=>!!e.getCondition()&&!e.isIncludeBlanks()),a=i?new Set:null,o=[];return n.forEach((e,t)=>{let n=t.getCoords(),i=Yc(r,n.rowIndex,n.colIndex);if(!i)return;let s=t.getCell(),c=s.getSpans(),l=c.width>1||c.height>1?s.getRange().getCoords():void 0;if(l&&a){let e=`${l.rowStart}:${l.colStart}`;if(a.has(e))return;a.add(e)}o.push({cell:n,range:l,value:i})},i?Zc:Xc),o})(e,i),l=c.length>0?c:Jp;return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:i}},Jp=[],Yp={transactional:!1,anchor:Dn.Type.Absolute},Xp=async(e,t)=>e.length===0?[]:(e=>{if(e.length===0)return[];if(e.length===1)return e[0];let t=e.slice(1).map(e=>new Set(e.map(e=>e.text)));return e[0].filter(e=>t.every(t=>t.has(e.text)))})(await Promise.all(e.map(e=>e.getListItemsAt(t.rowIndex,t.colIndex)))),Zp=(0,X.memo)(e=>{let{sheet:t,editable:n,dropdownWidth:r=17,onOpenDropdown:i,className:a,style:o,...s}=e,c=(0,X.useMemo)(()=>new Ls(t.getSelection()),[t]),l=Fe().getMode()?.key===`edit`,u=G((e,n)=>{let r=t.getRange(C.cellToRange(e)).getDataValidations();if(r.length===0)return null;let i=[];for(let e=0;e<r.length;e++)r[e].getRenderHints().includes(`list`)&&i.push(r[e]);if(i.length===0||i[0].isHideDropdown())return null;let a=t.getCell(e),o=a.getCoords();if(!o)return null;let s=a.getSpans(),c=s.width>1||s.height>1?a.getRange().getCoords():void 0;return{range:c??C.cellToRange(o),key:`${o.rowIndex},${o.colIndex}`,data:{dataValidation:i[0],dataValidations:i,cell:o,merge:c}}},[t]);return(0,Z.jsx)(at,{...s,className:Q(a,`validation-dropdown`),style:o,activateOn:`selection`,selection:c,probe:u,placement:{side:`r`,align:`center`},offset:0,whenOff:`hide`,dismiss:l,children:({data:e,floatProps:a,state:o})=>(0,Z.jsx)(Qp,{sheet:t,editable:n,data:e,floatProps:a,state:o,dropdownWidth:r,onOpenDropdown:i})})});Zp.displayName=`ValidationDropdownLayer`;var Qp=e=>{let{sheet:t,editable:n,data:r,floatProps:i,state:a,dropdownWidth:o,onOpenDropdown:s}=e,{pane:c}=a,l=(0,X.useMemo)(()=>({range:r.merge??C.cellToRange(r.cell)}),[r.merge,r.cell]),u=(e=>{let{sheet:t,editable:n,dataValidations:r,cell:i,anchor:a,minWidth:o}=e,s=(0,X.useCallback)(e=>Xp(r,e),[r]);return jc({sheet:t,editable:n,cell:n?i:null,anchor:a,minWidth:o,resolveItems:s,label:`validation-picker`})})({sheet:t,editable:n,dataValidations:r.dataValidations,cell:r.cell,anchor:l,minWidth:a.bounds?.width}),d=o*(c?.getZoom()||1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{...i,className:jf,style:{...i.style,width:d,height:d},role:`button`,"aria-haspopup":`listbox`,onPointerDown:e=>{e.button===0&&(e.preventDefault(),s?s(r.cell,r.dataValidation):u.isOpen?u.close():u.open())},children:(0,Z.jsx)(j,{iconKey:`ExpandMore`,size:.75*d})}),u.component]})};Qp.displayName=`DropdownButton`;var $p=`_mark_p3uld_7`,em=`_unresolved_p3uld_19`,tm={ignoreHidden:!0,reuseContext:!0},nm=(0,X.memo)(e=>{let{sheet:t,markSize:n=11,inset:r=1,className:i,style:a,...o}=e,s=zt(),{getRegions:c,cacheToken:l}=lc(t,Xn.Feature.Circular),u=(0,X.useMemo)(()=>({}),[l,n,r]),d=G((e,n)=>{let r=c(e,n);if(r.length===0)return rm;let i=t.getName(),a=[];for(let e=0;e<r.length;e++){let n=r[e],o=n.getCell().getCircularReference();if(!o)continue;let s=n.getCoords(),c={rowIndex:s.rowStart,colIndex:s.colStart,scope:i};o.isMember(c)&&t.getRange(s).forEach((e,t)=>{a.push({cell:t.getCoords(),value:t.getCell()})},tm)}return a.length>0?a:rm},[t,c]),f=G(e=>{let{value:t,style:i,zoom:a=1,key:o}=e,s=t?.getCircularReference();if(!s||!i)return null;let c=n*a,l=r*a;return(0,Z.jsx)(j,{iconKey:`CircularReferenceIndicator`,className:Q($p,!s.isConverged()&&em),style:{left:i.left+l,top:i.top+l,width:c,height:c},size:c,ariaHidden:!0},o)},[n,r]);return d(s).length===0?null:(0,Z.jsx)(et,{...o,className:Q(i,`circular-indicators`),children:(0,Z.jsx)(nt,{renderCell:f,getVisibleCells:d,cacheToken:u,style:a})})});nm.displayName=`CircularIndicatorLayer`;var rm=[],im=`_pending_ldaq4_9`,am=`_sweep_ldaq4_19`,om=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,barHeight:r=2,className:i,style:a,...o}=e,s=zt(),{getVisibleCells:c,cacheToken:l}=sm(t),u=(0,X.useMemo)(()=>({}),[l,n,r]),d=G(e=>{let{style:t,zoom:i=1,key:a,value:o}=e;if(!t||!o)return null;let s=t.left,c=t.top,l=t.width,u=t.height,d=[];return o.error&&d.push((0,Z.jsx)(la,{anchorLocation:g.TopLeft,size:n*i,inset:0,cellWidth:l,cellHeight:u,style:{left:s,top:c}},`${a}:error`)),o.pending&&d.push((0,Z.jsx)(`div`,{className:im,style:{left:s,top:c+u-r,width:l,height:r},children:(0,Z.jsx)(`div`,{className:am})},`${a}:pending`)),d},[n,r]);return c(s).length===0?null:(0,Z.jsx)(et,{...o,className:Q(i,`cell-indicators`),children:(0,Z.jsx)(nt,{renderCell:d,getVisibleCells:c,cacheToken:u,style:a})})});om.displayName=`CellIndicatorLayer`;var sm=e=>{let t=zt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n,e]),a=(0,X.useRef)(new Map),s=G(()=>{a.current.clear(),r()},[]);o(e,{onMergesChange:s,onLayoutChange:s},{ignoreModelChange:!0});let c=e.getWorkbook()?.getCalculation()??null;o(c,{onPendingChange:s});let l=t.getVisibleRange();return ar(e,(0,X.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.getTrigger()===`data`&&s()},fm),{getVisibleCells:G((t,n)=>{let r=a.current,i=n??t.getVisibleRange();if(!i)return um;let o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,s=r.get(o);if(s)return s;let c=null;e.getRange(i).forEach((e,n)=>{let r=n.getCell(),i=cm(r);if(!i)return;let a=n.getCoords(),o=r.getSpans(),s=o.width>1||o.height>1?t.getRangeFromCell(a):void 0;(c??=[]).push({cell:a,range:s,value:i})},dm);let l=c??um;return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:i}},cm=e=>{let t=e.getCalculationStatus(),n=t===An.ResultStatus.Pending||t===An.ResultStatus.Waiting,r=e.getValue(),i=Cn.isError(r)?!lm(r):e.getErrors().length>0;return n||i?{error:i,pending:n}:null},lm=e=>{let t=e.getCode();return t===Cn.Code.Busy||t===Cn.Code.GettingData},um=[],dm={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:[Xn.Feature.Merge,Xn.Feature.CalcError,Xn.Feature.CalcStatus,Xn.Feature.Circular]},fm={transactional:!1,anchor:Dn.Type.Absolute},pm=new WeakMap,mm=new WeakMap,hm=0,gm=new WeakMap,_m=e=>{for(let t of[mm.get(e),gm.get(e)])if(t)for(let e of Array.from(t))e()},vm=(e,t,n)=>{pm.set(e,{rowIndex:t.rowIndex,colIndex:t.colIndex,focusRequest:!1===n?.autoFocus?0:++hm}),_m(e)},ym=e=>{pm.delete(e)&&_m(e)},bm=e=>pm.get(e)??null,xm=e=>(mm.get(e)?.size??0)>0,Sm=(e,t)=>{let n=mm.get(e);return n||(n=new Set,mm.set(e,n)),n.add(t),()=>{n.delete(t)}},Cm=e=>(0,X.useSyncExternalStore)(t=>{let n=gm.get(e);return n||(n=new Set,gm.set(e,n)),n.add(t),()=>{n.delete(t)}},()=>bm(e),()=>null),wm=e=>(0,X.useSyncExternalStore)(t=>Sm(e,t),()=>bm(e),()=>null),Tm=`var(--sxl-comment-note-indicator, #e53935)`,Em=`var(--sxl-comment-thread-indicator, #7e57c2)`,Dm=`var(--sxl-comment-resolved-indicator, #9e9e9e)`,Om=`var(--sxl-comment-leader-color, var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))))`,km=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,openDelay:r=300,closeDelay:i=150,className:a,style:s,...c}=e,l=zt(),u=t.getView(),d=t.getMovables(),{getVisibleCells:f,cacheToken:p}=Pm(t),m=(0,X.useMemo)(()=>({}),[p,n]),h=G(e=>{let{style:t,zoom:r=1,key:i,value:a}=e;if(!t||!a)return null;let o=a!==Fm&&a.isNote(),s=o?Tm:a!==Fm&&a.isResolved()?Dm:Em,c=1/_e.getDevicePixelRatio();return(0,Z.jsx)(la,{anchorLocation:g.TopRight,shape:o?`triangle`:`bubble`,size:(o?n:1.15*n)*r,inset:0,cellWidth:t.width+c,cellHeight:t.height,fill:s,style:{left:t.left,top:t.top}},i)},[n]),{open:_,setTarget:v}=yt({openDelay:r,closeDelay:i,group:!1}),y=(0,X.useRef)(null),[b,x]=(0,X.useState)(null),[S,C]=q(`movable-hover`,null),w=e=>{e&&(y.current=e);let t=e?e.getId():null;v(t),x(t)},T=G(e=>{let n=l.getCellFromPointer(e.clientX,e.clientY);if(n){let e=t.getComments().getAt(n);if(e?.isNote())return void(y.current!==e&&w(e))}let r=y.current;if(r&&!r.isDeleted()){let n=l.getPanePointFromPointer(e.clientX,e.clientY),i=r.getMovable()?.getBounds();if(n&&i){let e=l.toPaneBounds(i),a=Am(r)!==null&&Nm(n,jm(l,t,r,e),5);if(Mm(n,e,4)||a)return void w(r)}}w(null)},[l,t]),E=G(()=>{w(null)},[]);(0,X.useEffect)(()=>{let e=y.current;if(_&&e){let t=e.getMovable();t&&C(t)}else _||(b===null&&(y.current=null),C(t=>t&&t.getContent()===e?null:t))},[_,b,C]),(0,X.useEffect)(()=>()=>{let e=y.current;e&&C(t=>t&&t.getContent()===e?null:t)},[C]);let[D,O]=(0,X.useReducer)(e=>e+1,0);o(d,{onCollectionChange:O,onInvalidated:O}),o(t,{onLayoutChange:O}),o(u,{onMovableSelectionChange:O});let[k]=q(`movable-drag`,null),A=l.getVisibleRange(),j=(0,X.useMemo)(()=>{if(!A)return Lm;let e=d.getItems({address:A,ignoreHidden:!0,type:`note`}),n=u.getMovableSelection().getItems().slice();S&&n.push(S);let r=t.getComments().getItems({address:A,ignoreHidden:!0});for(let e=0;e<r.length;e++){let t=r[e].isNote()?r[e].getMovable():null;t&&!t.isHidden()&&n.push(t)}let i=e;for(let t=0;t<n.length;t++){let r=n[t];r.getContent().getType()!==`note`||r.isDeleted()||i.includes(r)||(i===e&&(i=e.slice()),i.push(r))}return i},[d,t,u,S,A?.rowStart,A?.colStart,A?.rowEnd,A?.colEnd,m,D]);(0,X.useEffect)(()=>{let e=[];for(let t=0;t<j.length;t++)e.push(j[t].addListeners({onBoundsChange:O},{transactional:!1})),e.push(j[t].getContent().addListeners({onAnyChange:O},{transactional:!1}));return()=>{for(let t=0;t<e.length;t++)e[t]()}},[j]);let M=`comment-leader-arrow-${(0,X.useId)().replace(/[^\w-]/g,``)}`,N=[],P=[];for(let e=0;e<j.length;e++){let n=j[e],r=n.getContent();if(r.isDeleted())continue;let i=Am(r);if(i===null)continue;let a=k?.[n.getId()]?.bounds??n.getBounds();if(!a)continue;let o=jm(l,t,r,l.toPaneBounds(a)),s=P.indexOf(i);s===-1&&(s=P.push(i)-1),N.push((0,Z.jsx)(`line`,{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,stroke:i,strokeWidth:1,markerEnd:`url(#${M}-${s})`},n.getId()))}let F=f(l).length>0;return F||N.length!==0?(0,Z.jsxs)(et,{...c,className:Q(a,`comments`),onPointerMove:T,onPointerLeave:E,children:[F?(0,Z.jsx)(nt,{renderCell:h,getVisibleCells:f,cacheToken:m,style:s}):null,N.length>0?(0,Z.jsxs)(`svg`,{className:`comment-leaders`,style:{position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,overflow:`visible`,pointerEvents:`none`},children:[(0,Z.jsx)(`defs`,{children:P.map((e,t)=>(0,Z.jsx)(`marker`,{id:`${M}-${t}`,viewBox:`0 0 7 7`,refX:7,refY:3.5,markerWidth:7,markerHeight:7,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,Z.jsx)(`path`,{d:`M 0 0 L 7 3.5 L 0 7 Z`,fill:e})},t))}),N]}):null]}):null});km.displayName=`CommentsLayer`;var Am=e=>{let t=e.getStyle(),n=t?.toJSON()?.stroke;if(!t||!n)return Om;let r=t.getStroke();if(!r.isVisible())return null;if(!n.fill)return Om;try{return r.getFill().getColor()?.toCSS(`adaptive`)??Om}catch{return Om}},jm=(e,t,n,r)=>{let i=n.getRange().getCoords(),a=t.getCell({rowIndex:i.rowStart,colIndex:i.colStart}),o=a.getSpans(),s=e.getBoundsFromRange(o.width>1||o.height>1?a.getRange().getCoords():{rowStart:i.rowStart,colStart:i.colStart,rowEnd:i.rowStart,colEnd:i.colStart}),c=s.x+s.width,l=s.y;return{x1:r.x+r.width<=c?r.x+r.width:r.x,y1:r.y+r.height<=l?r.y+r.height:r.y,x2:c,y2:l}},Mm=(e,t,n)=>e.x>=t.x-n&&e.x<=t.x+t.width+n&&e.y>=t.y-n&&e.y<=t.y+t.height+n,Nm=(e,t,n)=>{let r=t.x2-t.x1,i=t.y2-t.y1,a=r*r+i*i,o=a===0?0:((e.x-t.x1)*r+(e.y-t.y1)*i)/a;o=Math.max(0,Math.min(1,o));let s=t.x1+o*r-e.x,c=t.y1+o*i-e.y;return s*s+c*c<=n*n},Pm=e=>{let[t,n]=(0,X.useReducer)(e=>e+1,0),r=Cm(e),i=r?.rowIndex??-1,a=r?.colIndex??-1,s=(0,X.useRef)(new Map),c=(0,X.useMemo)(()=>(s.current.clear(),{}),[t,e,i,a]),l=G(()=>{s.current.clear(),n()},[]);return o(e,{onCommentsChange:l,onMergesChange:l},{ignoreModelChange:!0}),{getVisibleCells:G((t,n)=>{let r=s.current,o=n??t.getVisibleRange();if(!o)return Im;let c=`${o.rowStart}:${o.colStart}:${o.rowEnd}:${o.colEnd}`,l=r.get(c);if(l)return l;let u=e.getComments().getItems({address:o,ignoreHidden:!0}),d=[],f=(t,n)=>{let r=e.getCell(t),i=r.getSpans(),a=i.width>1||i.height>1?r.getRange().getCoords():void 0;d.push({cell:t,range:a?C.sanitizeRange(a):void 0,value:n})};for(let e=0;e<u.length;e++){let t=u[e].getRange().getCoords();f({rowIndex:t.rowStart,colIndex:t.colStart},u[e])}return i>=o.rowStart&&i<=o.rowEnd&&a>=o.colStart&&a<=o.colEnd&&!e.getComments().getAt({rowStart:i,colStart:a,rowEnd:i,colEnd:a})&&f({rowIndex:i,colIndex:a},Fm),r.set(c,d),r.size>12&&r.delete(r.keys().next().value),d},[e,i,a]),cacheToken:c}},Fm=Symbol(`comment-draft`),Im=[],Lm=[],Rm=e=>`${e.rowIndex},${e.colIndex}`,zm=(0,X.memo)(e=>{let{sheet:t,renderCard:n,paneKey:r=`comments`,offset:i=18,openDelay:a=300,closeDelay:s=250,className:c,style:l,...u}=e,d=wm(t),f=Pd().getActive()===r,p=Fe().getMode()?.key===`edit`,[,m]=(0,X.useReducer)(e=>e+1,0);o(t,{onCommentsChange:m,onMergesChange:m},{ignoreModelChange:!0});let[h,g]=(0,X.useState)(!1);(0,X.useEffect)(()=>{h&&g(!1)},[h]),o(t.getSelection(),{onChange(){let e=d;if(!e)return;let n=t.getSelectedCell().getCoords();n&&n.rowIndex===e.rowIndex&&n.colIndex===e.colIndex||ym(t)}},{ignoreModelChange:!0}),(0,X.useEffect)(()=>()=>{ym(t)},[t]);let _=G((e,n,r)=>{let i=t.getCell(e),a=i.getCoords();if(!a)return null;let o=i.getComments();if(o?.isNote())return null;let s=o??null;if(!s&&!r)return null;let c=i.getSpans();return{range:c.width>1||c.height>1?i.getRange().getCoords():C.cellToRange(a),key:Rm(a),data:{coords:a,comment:s,focusRequest:n}}},[t]),v=G((e,t)=>_(e,0,!1),[_]),y=G(()=>{ym(t),g(!0)},[t]),b=f||p,x=d&&!b?_(d,d.focusRequest,!0):null;return(0,Z.jsx)(at,{...u,className:Q(c,`comment-card`),style:l,activateOn:`hover`,probe:b?void 0:v,target:x??void 0,dismiss:b||h,placement:{side:`r`,align:`start`},offset:i,openDelay:a,closeDelay:s,whenOff:`hide`,interactive:`focus`,onDismiss:y,children:({data:e,floatProps:r})=>(0,Z.jsx)(`div`,{...r,className:`comment-card-float`,children:(0,Z.jsx)(xe,{render:n,props:{sheet:t,coords:e.coords,comment:e.comment,focusRequest:e.focusRequest,onClose:y}})})})});zm.displayName=`CommentCardLayer`;var Bm=Object.freeze([]),Vm=(e,t)=>t.walk-e.walk||e.index-t.index,Hm=e=>e!==`working`,Um=e=>{let t=e.lastIndexOf(`!`);if(t<0)return``;let n=e.slice(0,t);return n.startsWith(`'`)&&n.endsWith(`'`)?n.slice(1,-1).replace(/''/g,`'`):n},Wm=class{constructor(e){this.workbook=e,this._byId=new Map,this._anchors=new Map,this._listeners=new Set,this._walkSeq=0,this._version=0,this._currentId=null,this._state=null}getState(){if(this._state)return this._state;let e=this._byId.size?Object.freeze([...this._byId.values()].sort(Vm)):Bm,t=e.length?Object.freeze(e.filter(e=>e.status===`open`&&Hm(e.intent))):Bm,n=this._currentId?t.findIndex(e=>e.id===this._currentId):-1;return this._state=Object.freeze({annotations:e,navigable:t,current:n>=0?t[n]:null,position:n+1,version:this._version}),this._state}get(e){return this._byId.get(e)??null}add(e,t,n){if((n?.replace??e===`working`)&&this._removeWhere(t=>t.intent===e),t.length===0)return this._changed(),[];let r=++this._walkSeq,i=Date.now(),a=[];return t.forEach((t,o)=>{let s=`${r}:${o}`,c=((e,t,n)=>{let r;try{r=e.getRange(t)}catch{return null}let i={sheet:r.getWorksheet().getName(),range:r.getAddress()},a=i,o=e=>{e?.range===i?.range&&e?.sheet===i?.sheet||(i=e,n(e))},s=r.addListener(e=>{let t=e.getSource();t.isInvalid()?o(null):o({sheet:t.getWorksheet().getName(),range:t.getAddress()})},{ignoreDataChanges:!0}),c=!1;return{initial:a,remove(){c||(c=!0,s())}}})(this.workbook,t.range,e=>this._move(s,e)),l={id:s,intent:e,source:n?.source,sheet:c?.initial.sheet??Um(t.range),range:c?.initial.range??t.range,label:t.label,walk:r,index:o,createdAt:i,status:c?`open`:`stale`};this._byId.set(s,l),c&&this._anchors.set(s,c),a.push(l)}),this._changed(),a}remove(e){let t=this.getState().navigable;if(!this._removeWhere(t=>t.id===e))return!1;if(this._currentId===e){let n=t.findIndex(t=>t.id===e),r=t.filter(t=>t.id!==e);this._currentId=r.length===0?null:r[n<0||n>=r.length?0:n].id}return this._changed(),!0}clear(e){let t=0;return this._removeWhere(n=>{let r=e(n);return r&&t++,r}),t&&(this._currentId&&!this._byId.has(this._currentId)&&(this._currentId=null),this._changed()),t}setCurrent(e){if(e!==null){let t=this._byId.get(e);if(!t||t.status!==`open`||!Hm(t.intent))return}e!==this._currentId&&(this._currentId=e,this._changed())}getCurrentId(){return this._currentId}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_move(e,t){let n=this._byId.get(e);n&&(this._byId.set(e,t?{...n,sheet:t.sheet,range:t.range,status:`open`}:{...n,status:`stale`}),this._changed())}_removeWhere(e){let t=!1;for(let[n,r]of this._byId)e(r)&&(this._byId.delete(n),this._anchors.get(n)?.remove(),this._anchors.delete(n),t=!0);return t}_changed(){this._version++,this._state=null;for(let e of[...this._listeners])e()}},Gm=new WeakMap,Km=e=>{let t=Gm.get(e);return t||(t=new Wm(e),Gm.set(e,t)),t},qm=Object.freeze({annotations:Bm,navigable:Bm,current:null,position:0,version:0}),Jm=e=>Gm.get(e)?.getState()??qm,Ym=(e,t)=>Gm.get(e)?.remove(t)??!1,Xm=async(e,t)=>{let n=Gm.get(e)?.get(t);if(n&&n.status===`open`)try{let t=e.getRange(n.range),r=t.getWorksheet();r!==e.getSelectedWorksheet()&&await r.select();let i=t.getCoords();await r.scrollTo({rowStart:i.rowStart,rowEnd:i.rowEnd,colStart:i.colStart,colEnd:i.colEnd},{})}catch{}},Zm=(e,t)=>{let n=Gm.get(e);n&&(n.setCurrent(t),t!==null&&n.getCurrentId()===t&&Xm(e,t))},Qm=(e,t,n)=>{let r=Gm.get(e);if(!r)return;let i=r.getState().navigable;if(i.length===0)return;let a=t??r.getCurrentId(),o=a?i.findIndex(e=>e.id===a):-1;Zm(e,(n===1?i[(o+1)%i.length]:i[o<=0?i.length-1:o-1]).id)},$m=(e,t)=>Qm(e,t,1),eh=(e,t)=>Qm(e,t,-1),th=(e,t)=>Km(e).subscribe(t),nh=e=>(0,X.useSyncExternalStore)(t=>e?th(e,t):()=>{},()=>e?Jm(e):qm,()=>qm),rh=Object.freeze({working:{border:`rgba(64,150,255,0.90)`,fill:`rgba(64,150,255,0.14)`,chip:`rgb(48,128,232)`},finding:{border:`rgba(64,190,120,0.90)`,fill:`rgba(64,190,120,0.14)`,chip:`rgb(38,150,90)`},question:{border:`rgba(240,180,60,0.90)`,fill:`rgba(240,180,60,0.14)`,chip:`rgb(200,140,30)`}}),ih=rh.finding,ah={t:`↑`,b:`↓`,l:`←`,r:`→`},oh=e=>{e.stopPropagation()},sh={border:`none`,background:`transparent`,color:`inherit`,cursor:`pointer`,font:`11px/1 system-ui, sans-serif`,padding:`2px 3px`,borderRadius:3},ch=e=>{let{workbook:t,annotation:n,more:r,position:i,total:a,isCurrent:o,style:s}=e,c=i>0&&a>1,l=[i>0?`${i}/${a}`:``,r>0?`+${r}`:``].filter(Boolean).join(` `);return(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,maxWidth:280,cursor:`pointer`,background:s.chip,color:`#fff`,borderRadius:4,padding:n.label?`0 2px 2px`:`0 2px`,font:`11px/15px system-ui, sans-serif`,boxShadow:o?`0 2px 6px rgba(0,0,0,0.4)`:`0 1px 3px rgba(0,0,0,0.3)`},onClick:()=>ph(t,n),children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:2,padding:`1px 1px 1px 4px`},children:[(0,Z.jsx)(`span`,{style:{flex:`1 1 auto`,fontWeight:600},children:l}),c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{style:sh,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),eh(t,n.id)},children:`↑`}),(0,Z.jsx)(`button`,{style:sh,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),$m(t,n.id)},children:`↓`})]}):null,(0,Z.jsx)(`button`,{style:sh,"aria-label":`Dismiss`,onClick:e=>{e.stopPropagation(),Ym(t,n.id)},children:`×`})]}),n.label?(0,Z.jsx)(`div`,{style:{background:`var(--sxl-color-base-100, white)`,color:`var(--sxl-color-base-content, #222)`,borderRadius:2,padding:`3px 6px`,overflowWrap:`anywhere`,cursor:`default`},children:n.label}):null]})},lh=e=>{let{workbook:t,annotation:n,more:r,position:i,total:a,style:o,state:s}=e,c=i>0?`${i}/${a}`:``;return(0,Z.jsxs)(`button`,{"aria-label":`Go to annotation`,title:n.label,onClick:()=>ph(t,n),style:{display:`inline-flex`,alignItems:`center`,gap:4,cursor:`pointer`,background:o.chip,color:`#fff`,border:`none`,borderRadius:10,padding:`2px 7px`,font:`11px/14px system-ui, sans-serif`,fontWeight:600,boxShadow:`0 1px 3px rgba(0,0,0,0.3)`},children:[(0,Z.jsx)(`span`,{children:ah[s.slid?.direction??s.placement.side]}),c?(0,Z.jsx)(`span`,{children:c}):null,r>0?(0,Z.jsxs)(`span`,{style:{opacity:.8},children:[`+`,r]}):null]})},uh=(0,X.memo)(e=>{let{sheet:t,styles:n,renderChip:r,renderMarker:i,dimOpacity:a=.45,showChip:o=fh,className:s,...c}=e,u=l(),d=t??u,f=d?.getWorkbook()??null,{annotations:p,navigable:m,current:h}=nh(f),[g,_]=(0,X.useState)(null),v=(0,X.useMemo)(()=>n?{...rh,...n}:rh,[n]),y=Q(s,`range-annotations`);if(!d||!f||p.length===0)return(0,Z.jsx)(et,{...c,className:y});let b=d.getName(),x=m.length,S=[];for(let e of p){if(e.status!==`open`||e.sheet!==b)continue;let t=m.indexOf(e)+1,n;try{let t=f.getRange(e.range).getCoords();n={rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowEnd,colEnd:t.colEnd}}catch{continue}S.push({annotation:e,coords:n,isCurrent:e===h,position:t})}if(S.length===0)return(0,Z.jsx)(et,{...c,className:y});let C=e=>`${e.coords.rowStart}:${e.coords.colStart}`,w=e=>g!==null&&C(e)===g,T=e=>w(e)?2:+!!e.isCurrent;S.sort((e,t)=>T(e)-T(t));let E=new Map;for(let e of S){let t=C(e),n=E.get(t);n?n.push(e):E.set(t,[e])}let D=e=>v[e]??ih;return(0,Z.jsxs)(et,{...c,className:y,children:[S.map(e=>{let{annotation:t,coords:n,isCurrent:r}=e,i=D(t.intent),o=!!h&&!r&&!w(e)&&dh(t);return(0,Z.jsx)(Vt,{className:`range-annotation-box`,range:n,stroke:i.border,fill:i.fill,alignWidth:r?2:1,style:{opacity:o?a:1}},`box-${t.id}`)}),[...E.entries()].map(([e,t])=>{let n=t.find(e=>e.isCurrent)??t[0];if(!o(n.annotation)&&t.length===1)return null;let a={workbook:f,annotation:n.annotation,more:t.length-1,position:n.position,total:x,isCurrent:n.isCurrent,style:D(n.annotation.intent)};return(0,Z.jsx)(Bt,{className:`range-annotation-chip`,anchor:{range:n.coords},placement:{side:`t`,align:`start`},offset:2,whenOff:`clamp`,zIndex:P(`grid`,e===g?2:+!!n.isCurrent),children:t=>(0,Z.jsx)(`div`,{style:{pointerEvents:`auto`},onPointerDown:oh,onMouseDown:oh,onDoubleClick:oh,onPointerEnter:()=>_(e),onPointerLeave:()=>_(t=>t===e?null:t),children:t.outOfView?(0,Z.jsx)(xe,{render:i??hh,props:{...a,state:t}}):(0,Z.jsx)(xe,{render:r??mh,props:{...a,state:t}})})},`chip-${e}`)})]})});uh.displayName=`RangeAnnotationLayer`;var dh=e=>e.intent!==`working`,fh=e=>dh(e)||!!e.label,ph=(e,t)=>{dh(t)?Zm(e,t.id):Xm(e,t.id)},mh=e=>(0,Z.jsx)(ch,{...e}),hh=e=>(0,Z.jsx)(lh,{...e}),gh=(0,X.createContext)(null),_h=gh.Provider,vh=()=>(0,X.useContext)(gh),yh=class{constructor(){this._entries=new Map,this._listeners=new Set,this._version=0,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this.getVersion=()=>this._version}set(e,t){this._entries.set(e,t),this._changed()}delete(e){this._entries.delete(e)&&this._changed()}entries(){return this._entries.entries()}_changed(){this._version++,this._listeners.forEach(e=>e())}},bh=(0,X.createContext)(null),xh=()=>{let e=(0,X.useContext)(bh),t=(0,X.useRef)(null);return e||(t.current||=new yh,t.current)},Sh=bh.Provider,Ch=(e,t)=>e===void 0||(typeof e==`function`?e(t):Array.isArray(e)?e.includes(t):e===t),wh=(e,t,n)=>{let r=(0,X.useContext)(bh),i=n??r,a=(0,X.useSyncExternalStore)(i?.subscribe??Th,i?.getVersion??Eh);return(0,X.useMemo)(()=>{let n=[];if(!i||!e)return n;for(let[r,a]of i.entries())a.surfaces.includes(t)&&Ch(a.sheets,e)&&X.Children.forEach(a.children,e=>{(0,X.isValidElement)(e)&&n.push((0,X.cloneElement)(e,{key:`${r}${e.key??n.length}`}))});return n},[i,a,e,t])},Th=()=>()=>{},Eh=()=>0,Dh=`_insert_1qm8h_8`,Oh=`_button_1qm8h_12`,kh=`_line_1qm8h_37`,Ah=`_row_1qm8h_44`,jh=`_column_1qm8h_51`,Mh=`_pressed_1qm8h_58`,Nh=e=>`cell-insert:${e}`,Ph=(0,X.memo)(e=>{let t=vh();return t===((e.axis??`row`)===`column`?`columnHeaders`:`rowHeaders`)?(0,Z.jsx)(Fh,{...e}):t===`cells`?(0,Z.jsx)(Lh,{axis:e.axis??`row`,className:e.className}):null});Ph.displayName=`CellInsertLayer`;var Fh=e=>{let{axis:t=`row`,resolve:n,onInsert:r,size:i=16,renderButton:a=zh,className:o,...s}=e,c=l(),u=zt(),d=t===`column`,[f,p]=(0,X.useState)(null),m=e=>{if(!c)return null;let t=c.getEntireCoords();if(e>(d?t.colEnd:t.rowEnd))return null;let r=c.getRange(d?{...t,colStart:e,colEnd:e}:{...t,rowStart:e,rowEnd:e});if(n)return n(r);let i=c.getProtection();return(d?i.isInsertColumnsAllowed():i.isInsertRowsAllowed())?r:null},h=G(e=>{let t=u.getCellFromPointer(e.clientX,e.clientY,!0),n=u.getPanePointFromPointer(e.clientX,e.clientY),r=null;if(t&&n){let e=u.getBoundsFromRange({rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}),i=d?t.colIndex+ +(n.x-e.x>e.width/2):t.rowIndex+ +(n.y-e.y>e.height/2),a=m(i);if(a){let e=a.getCoords();r={range:d?{rowStart:0,colStart:i,rowEnd:0,colEnd:i}:{rowStart:i,colStart:0,rowEnd:i,colEnd:0},key:`${e.rowStart}:${e.colStart}:${e.rowEnd}:${e.colEnd}`,data:a}}}p(e=>e?.key===r?.key?e:r)},[m]),g=G(()=>{p(null)},[]),_=G(e=>{r?r(e):e.insert(t)},[r,t]);return(0,Z.jsx)(et,{...s,className:Q(o,`cell-insert`,`cell-insert-${t}`),onPointerMove:h,onPointerLeave:g,children:(0,Z.jsx)(pt,{hovered:f,group:!1,openDelay:0,placement:{side:d?`b`:`r`,align:`start`},offset:0,boundary:`viewport`,whenPartial:{side:`slide`,align:`hide`},children:e=>(0,Z.jsx)(Ih,{info:e,axis:t,size:i,renderButton:a,onInsert:_,onLeave:g})})})},Ih=e=>{let{info:{data:t,floatProps:n,state:r},axis:i,size:a,renderButton:o,onInsert:s,onLeave:c}=e,l=z(),u=i===`column`,d=a*(r.pane?.getZoom()||1),f=st(Nh(i),null);(0,X.useEffect)(()=>(f({range:t,pressed:!1}),()=>f(e=>e?.range===t?null:e)),[t,f]);let p=e=>{f(n=>n?.range===t&&n.pressed!==e?{range:t,pressed:e}:n)};return(0,Z.jsx)(`div`,{...n,className:Dh,style:{...n.style,width:d,height:d,left:-d/2,top:-d/2},onPointerLeave:()=>{n.onPointerLeave(),p(!1),c()},onPointerDown:()=>p(!0),onPointerUp:()=>p(!1),onPointerCancel:()=>p(!1),children:(0,Z.jsx)(xe,{render:o,props:{axis:i,range:t,size:d,title:l(u?`cellInsert.columnHere`:`cellInsert.rowHere`),onInsert:()=>s(t)}})})},Lh=e=>{let{axis:t,className:n}=e,r=zt(),[i]=q(Nh(t),null),a=null;if(i){let e=i.range.getCoords(),n=r.getVisibleRange();if(t===`column`){let t=n.rowEnd-n.rowStart+1;a={...e,rowStart:Math.max(e.rowStart,n.rowStart-t),rowEnd:Math.min(e.rowEnd,n.rowEnd+t)}}else{let t=n.colEnd-n.colStart+1;a={...e,colStart:Math.max(e.colStart,n.colStart-t),colEnd:Math.min(e.colEnd,n.colEnd+t)}}}return(0,Z.jsx)(et,{className:Q(n,`cell-insert-preview`,`cell-insert-preview-${t}`),children:a?(0,Z.jsx)(ct,{range:a,style:{pointerEvents:`none`,overflow:`visible`},children:(0,Z.jsx)(`div`,{className:Q(kh,t===`column`?jh:Ah,`cell-insert-line`,i?.pressed&&[Mh,`cell-insert-line-pressed`])})}):null})},Rh=(0,X.memo)(e=>{let{axis:t,range:n,size:r,title:i,onInsert:a,className:o,...s}=e;return(0,Z.jsx)(`button`,{type:`button`,title:i,"aria-label":i,onClick:a,...s,className:Q(Oh,`cell-insert-button`,o),children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:r,height:r,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`7`}),(0,Z.jsx)(`path`,{d:`M8 4.5v7M4.5 8h7`})]})})});Rh.displayName=`CellInsertButton`;var zh=e=>(0,Z.jsx)(Rh,{...e}),Bh=Symbol(`unlock.uniform`),Vh=e=>Bh,Hh=(0,X.memo)(e=>{let{sheet:t,sheetView:n,className:r,...i}=e,a=zt();s(n,[`onAnyChange`]),s(t,[`onProtectionChange`]);let{getRegions:o}=lc(t,Xn.Feature.Unlock),c=(0,X.useId)().replace(/[^a-zA-Z0-9_-]/g,``),l=`sxl-locked-hatch-${c}`,u=`sxl-locked-holes-${c}`;if(!a||!n?.isShowLockedShading()||!t.getProtection().isLocked())return null;let d=a.getPaneBounds(),f=d.width,p=d.height;if(f<=0||p<=0)return null;let m=[];for(let e of(e=>{let t=[];for(let n=0;n<e.length;n++)t.push({...e[n].getCoords(),value:Vh(e[n])});return t.length<=1?t:C.mergeRangeCoordValues(t,2,(e,t)=>e[0].value===e[1].value?t:void 0)})(o(a))){let t=a.getBoundsFromRange(e),n=Math.round(t.x),r=Math.round(t.y),i=Math.round(t.x+t.width),o=Math.round(t.y+t.height);i<=n||o<=r||m.push({x:n,y:r,width:i-n,height:o-r})}return(0,Z.jsx)(et,{...i,className:Q(r,`locked-hatch`),children:(0,Z.jsx)(ct,{fill:!0,className:`locked-hatch-box`,style:{pointerEvents:`none`,overflow:`hidden`},children:(0,Z.jsxs)(`svg`,{width:f,height:p,viewBox:`0 0 ${f} ${p}`,style:{display:`block`},"aria-hidden":`true`,focusable:`false`,children:[(0,Z.jsxs)(`defs`,{children:[(0,Z.jsx)(`pattern`,{id:l,patternUnits:`userSpaceOnUse`,width:7,height:7,patternTransform:`rotate(45)`,children:(0,Z.jsx)(`line`,{x1:0,y1:0,x2:0,y2:7,stroke:`color-mix(in srgb, var(--sxl-color-base-content, rgb(0, 0, 0)) 26%, transparent)`,strokeWidth:1})}),(0,Z.jsxs)(`mask`,{id:u,children:[(0,Z.jsx)(`rect`,{x:0,y:0,width:f,height:p,fill:`white`}),m.map((e,t)=>(0,Z.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,fill:`black`},`hole-${t}`))]})]}),(0,Z.jsx)(`rect`,{x:0,y:0,width:f,height:p,fill:`url(#${l})`,mask:`url(#${u})`}),m.map((e,t)=>(0,Z.jsx)(`rect`,{x:e.x+.5,y:e.y+.5,width:Math.max(0,e.width-1),height:Math.max(0,e.height-1),fill:`none`,stroke:`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 90, 158)) 60%, transparent)`,strokeWidth:1},`outline-${t}`))]})})})});Hh.displayName=`ProtectionLayer`;var Uh=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{selection:n,adapter:r,axis:i,entireCoords:a,edgeSize:o=1,edgeColor:s=`var(--sxl-color-base-300)`,scrollIntoView:c,hideAccent:l=!1,preserveFocus:u=!1,replaceActive:d=!1,allowMulti:f=!0,onPointerDownInterceptor:p,onSelectionStart:m,onSelectionEnd:h,zIndex:g,className:_,style:v,...y}=e,b=zt(),x=i===Y.Axis.Column?b.getPaneBounds().height:b.getPaneBounds().width,S=(0,X.useMemo)(()=>r??new Ls(n),[r,n]);Re(S,e=>e.getSelection());let C=G(()=>{m?.(),n.setAdjusting(n.getCoords())},[n,m]),w=G(()=>{n.setAdjusting(null),h?.()},[n,h]),T=G(()=>{u||b.focus()},[b,u]),E=Nt(S,{axis:i,entireRange:a,scrollIntoView:c,replaceActive:d,allowMulti:f,preserveFocus:u,onPointerDownInterceptor:p,onDragStart:C,onDragEnd:w,onPointerUp:T}),D=l?null:n.getSelectedRuns(i),O=b.getAnchor(),k=[];if(!l){k.push(Wh(`edge:${O}`,i,x,o,s));for(let e=0;D&&e<D.length;e++){let t=D[e],n=Kh(t.min,t.max,i,b);n&&k.push(Gh(`selection:${O}:${e}`,n,i,x))}}return(0,Z.jsx)(et,{...y,className:Q(_,`header-selection`),onPointerDown:E.onPointerDown,onPointerMove:E.onPointerMove,onPointerUp:E.onPointerUp,children:(0,Z.jsx)(ct,{fill:!0,className:`header-selection-box`,style:{pointerEvents:`none`,...v},ref:t,children:k})})})),Wh=(e,t,n,r,i)=>{let a=_e.getDevicePixelRatio(),o=r/a,s=_e.snapDeviceEdge(n-o,a),c=t===Y.Axis.Column?{position:`absolute`,background:i,pointerEvents:`none`,left:0,width:`100%`,top:`${s}px`,height:`${o}px`}:{position:`absolute`,background:i,pointerEvents:`none`,top:0,height:`100%`,left:`${s}px`,width:`${o}px`};return(0,Z.jsx)(`div`,{className:`header-selection-edge`,style:c},e)},Gh=(e,t,n,r)=>{if(!t)return;let i=`var(--sxl-color-primary)`,a=_e.getDevicePixelRatio(),o=2/a,s=_e.edgeCenter(r,`leading`,2,a),c;if(n===Y.Axis.Column){let e=_e.edgeCenter(t.x,`leading`,2,a);c={position:`absolute`,background:i,pointerEvents:`none`,top:s-o/2+`px`,height:`${o}px`,left:e-o/2+`px`,width:`${_e.edgeCenter(t.x+t.width,`trailing`,2,a)-e+o}px`}}else{let e=_e.edgeCenter(t.y,`leading`,2,a);c={position:`absolute`,background:i,pointerEvents:`none`,left:s-o/2+`px`,width:`${o}px`,top:e-o/2+`px`,height:`${_e.edgeCenter(t.y+t.height,`trailing`,2,a)-e+o}px`}}return(0,Z.jsx)(`div`,{className:`header-selection-border`,style:c},e)},Kh=(e,t,n,r)=>{let i={x:0,y:0,width:0,height:0};if(n===Y.Axis.Column){let n=r.toClipBounds(r.getBoundsFromRange({colStart:e,rowStart:0,colEnd:t,rowEnd:0}),-10);if(!n)return null;i.x=n.x,i.width=n.width}else{let n=r.toClipBounds(r.getBoundsFromRange({colStart:0,rowStart:e,colEnd:0,rowEnd:t}),-10);if(!n)return null;i.y=n.y,i.height=n.height}return{x:i.x,y:i.y,width:i.width,height:i.height}},qh=e=>`resize-indicator:`+(e===Y.Axis.Column?`col`:`row`),Jh={side:`b`,align:`center`},Yh={side:`r`,align:`center`},Xh=(0,X.memo)(e=>{let{sheetHeader:t}=e,n=z(),r=t.getAxis(),i=r===Y.Axis.Column,[a]=q(qh(r),null),o=!!a&&a.sizePX!==null,s=a?.index??0,c=a?.sizePX??0,l=t.getWorksheet(),u=Math.floor(10*f.getDPI())/10,d=l.getView()?.getZoomScale()??100,p=h.roundAccurately(c/(d/100)*u,0)??0,m=h.roundAccurately(c*u,0)??0,g=(h.roundAccurately(p/(t.getMetrics().getScaleFactor()*f.getDPI()),2)??0).toFixed(2),_=n(i?`resizeIndicator.width`:`resizeIndicator.height`),v=o?c===0?n(`resizeIndicator.hiddenDisplay`,{label:_}):d===100?n(`resizeIndicator.sizeDisplay`,{label:_,unit:g,px:p}):n(`resizeIndicator.sizeDisplayZoomed`,{label:_,unit:g,px:p,screenPx:m,zoom:d}):null;return(0,Z.jsx)(lt,{name:`header-resize`,active:o,anchor:{range:i?{colStart:s,colEnd:s,rowStart:0,rowEnd:0}:{rowStart:s,rowEnd:s,colStart:0,colEnd:0}},placement:i?Jh:Yh,offset:4,boundary:`viewport`,children:v})});Xh.displayName=`ResizeTooltip`;var Zh=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheetHeader:n,isColumn:r,oppositeSize:i=30,onResizeHeadersStart:a,onResizeHeaders:s,onResizeHeadersEnd:c,onResizeHeadersDown:l,onResizeHeadersUp:u,className:d,...f}=e,m=zt(),[g,_]=(0,X.useState)(n.getSelectedRuns()),[v,y]=(0,X.useReducer)(e=>e+1,0),b=z(),x=(0,X.useCallback)(p.debounce(()=>{y()},10),[]);o(n?.getWorksheet(),{onSelectionChange(e){let t=n.getSelectedRuns();_(t),x()},onProtectionChange(){y()},onViewChange(){w(n.getWorksheet().getView().getZoomScale()/100),x()}});let[C,w]=(0,X.useState)(n?.getWorksheet().getView().getZoomScale()/100),T=r?Y.Axis.Column:Y.Axis.Row,E=st(qh(T),null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),k=(0,X.useCallback)(()=>{O.current&&=(clearTimeout(O.current),null)},[]);(0,X.useEffect)(()=>k,[k]);let A=(0,X.useCallback)(e=>n.at(e)?.isHidden()||n.at(e)?.getSize()===0,[n]),j=(0,X.useCallback)((e,t)=>n.getMetrics().hiddenHeadersAt(e,t),[A]),M=(0,X.useCallback)(()=>n.getMinSize(),[n]),N=(0,X.useCallback)(()=>n.getMaxSize(),[n]),P=G((e,t,r)=>{t/=C;let i={size:t=Math.max(M(),Math.min(h.roundAccurately(t,M())??t,N())),hidden:!1},a=[];t<=0&&(i.hidden=!0,i.size=r),a.push({address:{min:e,max:e},update:i});let o=m.getMetrics();if(t<0){let n=T===Y.Axis.Column,r=n?o.getColOffset:o.getRowOffset,i=n?o.getColIndex:o.getRowIndex,s=r(e),c=i(s+t),l=r(c);l===s+t?c--:a.push({address:{min:c,max:c},update:{size:s-l+t}}),e-c>1&&a.push({address:{min:c+1,max:e-1},update:{hidden:!0}})}n.updateHeaderPairs(a),E({index:e,sizePX:t*C}),s?.(e,t,r)},[v,m,n,C,s]),F=G((e,t,r)=>{let i=T===Y.Axis.Column,a=null,o={min:e,max:e};if(n.isSelectedAll(e)){let s=n.getSelectedRuns();s.length>1?a=S(i?`op.resizeColumns`:`op.resizeRows`):o=s[0];let c={hidden:t<=0,size:(t<=0?r:t)/C};n.updateHeaderPairs(Qh(s,c,e))}if(o){let e=o.max-o.min+1,t;t=e===1?n.getRange(o).at(0).getText():n.getRange(o).toString(),a=b(i?`op.resizeColumnsNamed`:`op.resizeRowsNamed`,{count:e,name:t})}D.current?.commit({description:a??void 0}),D.current=null,E(null),c?.(e,t,a)},[v,b,n,c]),I=G((e,t)=>{let r=T===Y.Axis.Column?S(`op.resizeColumns`):S(`op.resizeRows`);D.current=n.getWorksheet().beginCommit(r),k(),E({index:e,sizePX:t}),a?.(e,t,r)},[T,n]),L=G((e,t)=>{k(),O.current=setTimeout(()=>{O.current=null,E({index:e,sizePX:t})},360),l?.(e,t)},[l]),R=G(e=>{k(),E(null),u?.(e)},[u]),ee=G(e=>{let t=n.getMetrics(),r=t.hiddenHeadersAt(e,!0);if(r===0)return;let i=t.hiddenHeadersAt(e);n.getRange({min:e-r+1,max:e+i-1}).setHidden(!1)},[n]),B=G(e=>{let t=!1,r=T===Y.Axis.Column,i=n.getWorksheet().getEntireRange().getCoords(),a=[],o=n.getSelectedRuns(),s=e=>{let t;t=r?{colStart:e.min,rowStart:i.rowStart,colEnd:e.max,rowEnd:i.rowEnd}:{colStart:i.colStart,rowStart:e.min,colEnd:i.colEnd,rowEnd:e.max},a.push(t)},l=o.length;for(let n=0;n<l;n++){let r=o[n];r.value&&(r.min<=e&&r.max>=e&&(t=!0),s(r))}t||s({min:e,max:e}),n.getWorksheet().getRanges(a).autoFit({axes:r?Y.AxisSelection.Column:Y.AxisSelection.Row}),k(),E(null),c?.(e,null,S(`op.resizeColumns`))},[v,n,c,A]),V=n.isProtected(),H=V?void 0:P,U=null,W=(r?m.getVisibleColumns():m.getVisibleRows()).map(e=>e.index),te=r?m.getPaneRange().colStart:m.getPaneRange().rowStart;W.length>0&&W[0]>te&&(W=[W[0]-1,...W]);let ne=[],re=[],ie=W.length;for(let e=0;e<ie;e++){let t=W[e],n=e<ie-1?W[e+1]:t+j(t+1,!1)+1,r=t+1!==n;(!U||U.max<t)&&(U=g.length>0&&g[g.length-1].max>=t?g[h.findEqualOrGreater(g,t,e=>e.max)]:null);let i=!1,a=!1;if(U&&(U.min<=t||U.min<=n&&!r)&&(i=!0,a=U.value??!1),t===te){let e=!1,n=!1;U&&U.min<=t&&(e=!0,n=U.value??!1),t>0&&re.push({index:t-1,isNextHidden:r,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(a&&ne.push(re.length),re.push({index:t,isHidden:e===0&&j(t,!1)>0,isNextHidden:r,isSelected:i,isSelectedAll:a,onDividerMouseDown:L,onDividerResizeStart:I,onDividerResize:H,onDividerMouseUp:R,onDividerResizeEnd:F,onDividerAutoFit:B}),r){let e=!1,r=!1;U&&U.min>=t&&U.max<=n-1&&U.value&&ne.push(re.length),U&&U.max>=n||(U=g.length>0&&g[g.length-1].max>=n?g[h.findEqualOrGreater(g,n,e=>e.max)]:null),U&&U.min<=n&&(e=!0,r=U.value??!1),n>0&&re.push({index:n-1,isHidden:!0,isSelected:e,isSelectedAll:r,onDividerMouseDown:L,onDividerResizeStart:I,onDividerResize:H,onDividerMouseUp:R,onDividerResizeEnd:F,onDividerAutoFit:B})}}if(ne.length>0){let e=ne.length-1;if(ne.length>0){let t=re[ne[e]].index,n=null;r?(n=m.getBoundsFromRange({rowStart:0,rowEnd:0,colStart:t,colEnd:t}),n.x+n.width>m.getPaneBounds().width&&(--e,e===0&&(e=-1))):(n=m.getBoundsFromRange({rowStart:t,rowEnd:t,colStart:0,colEnd:0}),n.y+n.height>m.getPaneBounds().height&&(--e,e===0&&(e=-1)))}let t=g?.[g.length-1],n=m.getAnchor();if(n===`t`||n===`l`){let e=re[ne[Math.max(0,ne.length-1)]];e.showTouchDivider=!!t&&t.max<=e.index}else e>=0&&(re[ne[e]].showTouchDivider=!0)}let ae=re.length,oe=Dt(m,T),se=Array(ae);for(let e=0;e<ae;e++)se[e]=(0,Z.jsx)(It,{...re[e],axis:T,visibleBounds:oe,disabled:V,onDividerUnhide:V?void 0:ee},`divider${e}`);return(0,Z.jsxs)(et,{...f,className:Q(d,`header-resizer`),children:[se,(0,Z.jsx)(Xh,{sheetHeader:n})]})})),Qh=(e,t,n=null)=>{let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a];if(!i.value)continue;let o=i.min,s=i.max;o===s&&o===n||r.push({address:{min:o,max:s},update:t})}return r},$h=`var(--sxl-color-primary)`,eg=`var(--sxl-color-base-100)`,tg=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,i=zt(),[a]=q(qh(Y.Axis.Column),null),[o]=q(qh(Y.Axis.Row),null),s=!!a,c=a??o,l=Q(n,`resize-indicator`);if(!c)return(0,Z.jsx)(et,{...r,className:l});let{index:u,sizePX:d}=c,f=d===0,p=t.getEntireRange().getCoords(),m=s?{rowStart:0,rowEnd:p.rowEnd,colStart:u,colEnd:u}:{rowStart:u,rowEnd:u,colStart:0,colEnd:p.colEnd},h=null;if(i.toClipBounds(i.getBoundsFromRange(m))){let e=i.getMetrics(),t=i.getPaneBounds(),n=s?e.getColOffset(u):e.getRowOffset(u),r=d===null?s?e.getColOffset(u+1):e.getRowOffset(u+1):n+Math.max(0,d),a=Math.max(0,n),o=Math.min(s?t.x+t.width:t.y+t.height,r),c,l,p,m;if(s){let e=t.height;c=[0,0,0,e],l=`-0.5px 0px 0px 0px ${eg}`,p={x:a-1,y:0,width:1,height:e},m={x:o,y:0,width:1,height:e}}else{let e=t.width;c=[0,0,e,0],l=`0px -0.5px 0px 0px ${eg}`,p={x:0,y:a-1,width:e,height:1},m={x:0,y:o,width:e,height:1}}let g={style:{boxShadow:l},propsPath:{stroke:$h,strokeWidth:`2px`,strokeDasharray:`0 0 8 4`}};h=(0,Z.jsxs)(X.Fragment,{children:[f?void 0:(0,Z.jsx)(Ze,{linePoints:c,bounds:p,propsPath:{stroke:$h,strokeWidth:`2px`}}),(0,Z.jsx)(Ze,{linePoints:c,bounds:m,...g})]},`resize-dividers`)}return(0,Z.jsx)(et,{...r,className:l,children:h})});tg.displayName=`ResizeIndicator`;var ng=e=>`freeze-drag:`+(e===Y.Axis.Column?`col`:`row`),rg=e=>`freeze-active:`+(e===Y.Axis.Column?`col`:`row`),ig=`var(--sxl-color-primary)`,ag=(e,t,n,r,i,a=0)=>{let o=e.getPanePointFromPointer(t?n:0,t?0:n);if(!o)return null;let s=e.getPaneBounds(),c=(t?o.x:o.y)+a,l=t?s.width:s.height;if(c<-1||c>l+1)return null;let u=t?s.height:s.width;return(0,Z.jsx)(Ze,{linePoints:t?[0,0,0,u]:[0,0,u,0],bounds:t?{x:c,y:0,width:1,height:u}:{x:0,y:c,width:u,height:1},propsPath:i},r)},og={stroke:ig,strokeWidth:`2px`},sg={stroke:ig,strokeWidth:`2px`,strokeDasharray:`4 3`},cg=(0,X.memo)(e=>{let{showStart:t=!1}=e,n=zt(),[r]=q(ng(Y.Axis.Column),null),[i]=q(ng(Y.Axis.Row),null),[a]=q(rg(Y.Axis.Column),!1),[o]=q(rg(Y.Axis.Row),!1),s=n.getAllPanes(),c=n.getPaneBounds(),l=t&&a&&!s[g.Left]&&c.x===0?lg(n,!0):null,u=t&&o&&!s[g.Top]&&c.y===0?lg(n,!1):null,d=!!r,f=r??i;return(0,Z.jsxs)(Z.Fragment,{children:[l,u,f?.pointerClient===void 0?null:ag(n,d,f.pointerClient,`freeze-pointer`,sg),f?ag(n,d,f.snapClient,`freeze-snap`,og,+(f.index===0)):null]})}),lg=(e,t)=>{let n=e.getPaneBounds(),r=t?n.height:n.width;return(0,Z.jsx)(Ze,{linePoints:t?[0,0,0,r]:[0,0,r,0],bounds:t?{x:1,y:0,width:1,height:r}:{x:0,y:1,width:r,height:1},propsPath:og},t?`freeze-start-col`:`freeze-start-row`)};cg.displayName=`FreezeDragLines`;var ug=(e,t,n)=>{let r=t===Y.Axis.Column,i=e.getFreezePanes(),a=i.coords?.colIndex??0,o=i.coords?.rowIndex??0,s=r?n:a,c=r?o:n;if(s===a&&c===o)return;if(s===0&&c===0)return void e.setFreezePanes(null);let l=e.getTopLeft();e.setFreezePanes({coords:{colIndex:s,rowIndex:c},topLeft:{left:a>0?i.topLeft?.left??0:l.left,top:o>0?i.topLeft?.top??0:l.top}})},dg=(e,t)=>{let n=zt(),r=t===Y.Axis.Column,[,i]=(0,X.useReducer)(e=>e+1,0);o(e.getView(),{onFreezePaneChange(){i()}});let a=st(ng(t),null),[s,c]=q(rg(t),!1),l=(0,X.useRef)(null),u=()=>{let e=l.current;e?.frame&&cancelAnimationFrame(e.frame),l.current=null};(0,X.useEffect)(()=>u,[]);let d=e=>{let t=l.current;if(!t)return;let n=Math.max(0,e-t.time);t.time=e;let r=t.target.snapClient-t.shown;t.shown=Math.abs(r)<.5?t.target.snapClient:t.shown+r*(1-Math.exp(-n/30)),a({...t.target,snapClient:t.shown}),t.frame=t.shown===t.target.snapClient?0:requestAnimationFrame(d)},f=G(e=>{u(),l.current={target:e,shown:e.snapClient,frame:0,time:0},a(e)},[]),p=G(e=>{let t=l.current;t?(t.target=e,t.shown===e.snapClient?a(e):t.frame||=(t.time=performance.now(),requestAnimationFrame(d))):a(e)},[]),m=G(()=>{u(),a(null)},[]),h=fe.useCommandScope(),g=()=>h?.resolve(`freezePanesAt`,h),_=G(n=>{u(),a(null);let r={axis:t,index:n.index};h?g()?.execute(r):ug(e.getView(),r.axis,r.index)},[e,t,h]),v=(r?e.getView().getFreezePanes().coords?.colIndex:e.getView().getFreezePanes().coords?.rowIndex)??0,y=!!h&&(g()?.disabled()??!0);if(!y&&v>0){let e=(Je(n.getAllPanes())??n).getMetrics(),t=r?e.getColOffset(v):e.getRowOffset(v);y=Math.abs(t)>.5}return{disabled:y,isActive:s,onFreezeDragStart:f,onFreezeDrag:p,onFreezeDragEnd:_,onFreezeDragCancel:m,onActiveChange:c}},fg=(0,X.memo)(e=>{let{sheetHeader:t,className:n,...r}=e,i=t.getAxis(),{isActive:a,...o}=dg(t.getWorksheet(),i);return(0,Z.jsxs)(et,{...r,className:Q(n,`header-freeze`),children:[(0,Z.jsx)(cg,{}),(0,Z.jsx)(Ye,{axis:i,highlight:a,...o})]})});fg.displayName=`HeaderFreezeLayer`;var pg=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,{isActive:i,...a}=dg(t,Y.Axis.Column),{isActive:o,...s}=dg(t,Y.Axis.Row);return(0,Z.jsxs)(et,{...r,className:Q(n,`freeze`),children:[(0,Z.jsx)(cg,{showStart:!0}),(0,Z.jsx)(ot,{axis:Y.Axis.Column,...a}),(0,Z.jsx)(ot,{axis:Y.Axis.Row,...s})]})});pg.displayName=`GridFreezeLayer`;var{CommandScopeProvider:mg}=fe,hg=(e,t)=>(e.updateCommand(`openContextMenu`,{callback:()=>{t.openAtSelectedCell()}}),()=>{}),gg=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,onSheetContextMenu:r,className:i,...a}=e,o=zt(),s=(0,X.useCallback)(e=>{let t=o.getCellFromPointer(e.clientX,e.clientY);t&&r&&(r({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[o,r]),c=G(()=>{if(!o||!r)return;let e=n.getSelection().getCoords().cell;o.scrollCellCoordsIntoView(e).then(t=>{requestAnimationFrame(()=>{let n=o.getMetrics().getColOffset(e.colIndex+1),i=o.getMetrics().getRowOffset(e.rowIndex+1),a=o.getPanePointFromPointer(0,0)||{x:0,y:0};r({clientX:n-a.x-(t.left??0)+6,clientY:i-a.y-(t.top??0)+6})})})},[o,n,r]),l=(0,X.useMemo)(()=>({openAtSelectedCell:c}),[c]);return(0,Z.jsx)(mg,{spec:{scopeName:`layer:contextmenu`,contributor:{dynamic:hg},data:l},order:Ht().zIndex,children:(0,Z.jsx)(et,{onContextMenu:s,className:Q(i,`contextMenu`),...a})})}));function _g(e){let{axis:t,entireCoords:n,scrollIntoView:r,className:i,...a}=e,o=ga().getMode(),s=o?.selection??null,c=l()?.getName(),u=(0,X.useMemo)(()=>{if(!s)return null;let e=new Ls(s);return c?Qs(e,c):e},[s,c]);return o&&o.mode===`point`&&s?o.scope&&o.scope!==c?null:(0,Z.jsx)(Uh,{className:Q(i,`reference-header`),selection:s,adapter:u,axis:t,entireCoords:n,scrollIntoView:r,hideAccent:!0,preserveFocus:!0,replaceActive:!0,allowMulti:!1!==o.allowMulti,...a}):null}gg.displayName=`ContextMenuLayer`,_g.displayName=`SheetReferenceHeaderLayer`;var vg=e=>{let{style:t,...n}=e??{};return(0,Z.jsxs)(`svg`,{style:{width:`135px`,height:`37px`,...t},viewBox:`0 0 135 37`,...n,children:[(0,Z.jsx)(`path`,{d:`M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z`,fill:`#547dbe`,fillRule:`evenodd`}),(0,Z.jsx)(`path`,{d:`M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z`,fill:`#ffffff`,fillRule:`evenodd`}),(0,Z.jsx)(`path`,{d:`m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z`,fill:`#547dbe`,fillRule:`evenodd`,strokeWidth:`0.4`}),(0,Z.jsx)(`path`,{d:`M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z`,fill:`#eb594d`}),(0,Z.jsx)(`path`,{d:`m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z`,stroke:`#eb594d`,strokeWidth:`2`,fill:`#f9cecb`})]})},yg=(0,X.memo)(e=>{let{colorLicensee:t=`blue`,colorError:n=`red`,colorCredits:r=`grey`,credits:i=`All rights reserved - Michael Ford`,feature:a,style:o,...s}=e??{},[c,l]=(0,X.useState)(null);(0,X.useEffect)(()=>{(async()=>{let e=await zn.getDetails();l(e)})()},[]);let[u,d]=(0,X.useState)(!1),f={opacity:.65},p=(0,X.useMemo)(()=>{let e=c?.getExceptions(),t=e?.length??0;if(t===0)return null;let r=[];for(let i=0;i<t;i++){let t=e[i];r.push((0,Z.jsx)(`div`,{style:{opacity:.8,fontSize:`16px`,textAlign:`left`,color:n},children:t},i))}return r},[c,n]);if(c===null||c.isValidFor(a??``))return null;let m=c.getType(),h=!p&&m.endsWith(`ity`),g=c.getLicensee(),_=h?1.6:1,v=135/_,y=37/_,b=null;return(g?.length??0)>0&&(b=(0,Z.jsx)(`div`,{style:{opacity:.7,fontWeight:`500`,fontSize:`16px`,textAlign:`left`,color:t},children:g})),(0,Z.jsx)(`div`,{style:{pointerEvents:`none`,display:`flex`,flexDirection:`column`,overflow:`hidden`,...o},...s,children:(0,Z.jsxs)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`},children:[u?(0,Z.jsx)(vg,{style:f}):(0,Z.jsx)(`svg`,{width:v,height:y,style:f,children:(0,Z.jsx)(`image`,{style:{width:v,height:y},href:`https://www.sheetxl.com/watermark.svg`,onError:()=>d(!0)})}),(0,Z.jsxs)(`div`,{children:[b,p,(0,Z.jsx)(`div`,{style:{height:`0px`,fontSize:`16px`,textAlign:`left`,width:`0px`,opacity:.8,color:r},children:i})]})]})})}),bg=e=>{let[t,n]=(0,X.useState)(()=>({header:e,metrics:e.getMetrics()})),r=t;t.header!==e&&(r={header:e,metrics:e.getMetrics()},n(r));let i=G(()=>{let t=e.getMetrics();n(n=>n.header===e&&n.metrics===t?n:{header:e,metrics:t})},[e]);return o(e,{onMetricsChange:i}),[r.metrics,i]},xg={key:`copy`,description:S(`editMode.copy`)},Sg={key:`cut`,description:S(`editMode.cut`)},Cg={type:qn.Content.Values},wg={fitDestination:!0,type:qn.Content.Formats},Tg={fitDestination:!0,type:qn.Content.Formulas},Eg={transpose:!0},Dg={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getAddress({$colIndex:!0,$rowIndex:!0})}`})};function Og(e,t){let n=t.sheet,r=t,{notifier:i,editModeHandler:a,globalClipboard:o,element:s}=t,c={element:s,doCopy:e=>{let t=n.getSelectedRanges().getSnapshot(e);return new $n(t)}},l={element:s,importFromExternal:async(e,t)=>{let r=n.getSelectedRange().getTopLeft().getCoords(),i=new tr(n.getRuntime(),e,{colIndex:r.colStart,rowIndex:r.rowStart},t,n.getStyles());return await i.parse()?i:null},doPaste:async(e,t)=>{if(e?.getItemType()!==`range`)return!1;t?.contentsOnly&&delete(t={...t,type:qn.Content.Values}).contentsOnly;let r=e.getItem?.();if(!r)return!1;let i=r.getName?.(),a=n.getSelectedRange();if(i===`HTML`&&a.size>1){let e=r.getCoords?.();e&&C.isSingleCell(e)&&(a=a.getResizeTo(1,1))}return await a.doBatch(async()=>{let e=await a.copyFrom(r,{...t});!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:i?A(`op.pasteNamed`,{name:i}):S(`op.paste`),autoSelect:!0}),!0}},u=async e=>{if(c.element?.())try{await(async e=>{if(!c.element)return;let t=o.getClipboard(),n=c.doCopy?.(e);typeof n==`string`?await t.writeText(n):await t.writeReference(n)})(e??{})}catch(e){i?.showError(e)}},d=async(e,t,o)=>{try{if(!1===await e.doPaste?.(t,o))return;((e,t)=>{if(e?.getItemType()!==`range`)return;let i=a.getMode()?.key===`cut`||e.isCut?.();if(!i&&a.getMode()?.key===`copy`){let t=e.getItem?.()?.getCoords?.(),r=n.getSelectedRanges().getCoords(),a=!1;if(t&&r&&e.getItem?.()?.getSource?.()===n)for(let e=0;!a&&e<r.length;e++)a=C.isRangesIntersect(t,r[e]);i=a}i&&a.setMode(null),s?.()?.focus(),r.onPaste?.(e,t)})(t,o)}catch(e){i?.showError(e)}},p=async(e,t,n)=>{let r=l.element?.();if(r&&await f.whenFocus(r),!e&&!t)return;let a=await i?.showBusy?.(A(`clipboard.pasting`));if(t)try{await d(l,t,n),a?.();return}catch(e){a?.(),i?.showError(e)}if(!e)return void a?.();let o=l.importFromExternal;o||=()=>({getItemType:()=>`text`,toText:()=>e?.text??``,isClipboardItem:!0});let s=null;try{s=await o(e,{isCut:!1})}catch(e){a?.(),i?.showError(e)}if(s)try{let e=await Promise.resolve(s);await d(l,e,n),a?.()}catch(e){a?.(),i?.showError(e)}else a?.()},m=async e=>{if(!l.element)return;let t=o.getClipboard();try{let n=await t.readReference();if(n)return void await p(null,n,e??{});let r=[];r[0]=await v.readStringFromClipboard(t,D.Plain),r[1]=await v.readHTMLFromClipboard(t,D.Html),r[2]=await v.readBlobFromClipboard(t,D.Png);let i={text:r[0]??null,html:r[1]??null,image:r[2]??null};await p(i,null,e??{})}catch(e){if(e?.message===`Document is not focused.`)return;i?.showError(e)}};e.updateCommand(`copy`,{callback:()=>u()}),e.updateCommand(`cut`,{callback:()=>u({isCut:!0})}),e.updateCommand(`paste`,{callback:()=>m()}),e.updateCommand(`pasteValues`,{callback:e=>m({...Cg,...e})}),e.updateCommand(`pasteFormats`,{callback:(e,t)=>m({...wg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteFormulas`,{callback:(e,t)=>m({...Tg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteTranspose`,{callback:(e,t)=>m({...Eg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteLinks`,{callback:(e,t)=>m({...Dg,description:t?.getLabel(),...e})}),e.updateCommand(`formatPainterToggle`,{state:a.getMode()?.key===`formatPainter`,callback:()=>{if(a.getMode()?.key!==`formatPainter`)return u({editMode:{key:`formatPainter`,description:S(`editMode.formatPainter`),cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}});a.setMode(null)}});let h=[`pasteFormats`,`pasteTranspose`,`pasteLinks`,`formatPainterToggle`],g=[`cut`,`paste`,`pasteValues`,`pasteFormulas`],_=()=>{let t=n.getProtection(),r=t.isFormatCellsAllowed()?[]:[S(`reason.sheetProtected`)];for(let t of h)e.updateCommand(t,{disabledReasons:r});let i=t.isLocked()&&!n.getSelectedRange().getCell().isEditAllowed()?[S(`reason.sheetProtected`)]:[];for(let t of g)e.updateCommand(t,{disabledReasons:i})};_();let y=o.getClipboard(),b=async()=>{a.getMode()?.key!==`edit`&&(e=>{let t=e?.getItemType()===`range`?e:null;if(t){let n=e.editMode?.(),r=e?.isCut?.()?Sg:xg,i=(n?.key??r.key)!==`formatPainter`,s={...r,...n,args:{isClipboard:!0,reference:t,...n?.args},cancel:()=>a.setMode(e=>e===s?null:e),done:i?async()=>{await m(),a.setMode(e=>e===s?null:e)}:void 0,onModeChange:e=>{e?.args?.isClipboard||o.getClipboard().clear(!0),n?.onModeChange?.(e)}};a.setMode(s)}r.onClipboardUpdate?.(t)})(await y.readReference())},w={safari:S(`error.clipboard.safari`),perms:S(`error.clipboard.perms`)},T=e=>i?.showMessage?.(A(w[e.code]),{onceKey:`clipboard.features`}),E=()=>T(x.ErrorMessages.PermsRead),O=()=>T(x.ErrorMessages.PermsWrite);y.addEventListener(`clipboardchange`,b),y.addEventListener(`clipboarderrorread`,E),y.addEventListener(`clipboarderrorwrite`,O);let k=n.addListeners({onProtectionChange:_,onStyleChange:_,onInvalidated:_}),j=n.getSelection().addListeners({onChange:_});return()=>{y.removeEventListener(`clipboardchange`,b),y.removeEventListener(`clipboarderrorread`,E),y.removeEventListener(`clipboarderrorwrite`,O),k(),j()}}var{CommandScopeProvider:kg,useCommandExecute:Ag}=fe,jg=({sheet:e,className:t,...n})=>{let r=Se(),i=Fe(),a=ae(),o=zt(),s=Ag(),c=i.getMode(),l=G(()=>o.getElement(),[o]),u=(0,X.useMemo)(()=>({sheet:e,notifier:r,editModeHandler:i,globalClipboard:a,element:l}),[e,r,i,a,l]),d=c?.key,f=d===`copy`||d===`cut`||d===`formatPainter`,p=c?.args?.reference,m=p?.getItem?.(),h=m?.getSource()===e,g=m?.getCoords?.();return(0,Z.jsx)(kg,{spec:{scopeName:`layer:clipboard`,contributor:{dynamic:Og},data:u},order:Ht().zIndex,children:(0,Z.jsx)(et,{onKeyDown:async e=>{let t=i.getMode()?.key,n=t===`copy`||t===`cut`;(n||t===`formatPainter`)&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),i.setMode(null)):n&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),await s(`paste`),i.setMode(null)))},...n,className:Q(t,`clipboard`),children:f&&p&&h&&g&&(0,Z.jsx)(Vt,{range:g,alignWidth:2,stroke:p.isCut?.()?`var(--sxl-color-warning)`:`var(--sxl-color-primary)`,animatedStroke:!0,clipInsets:-10})})})};jg.displayName=`SheetClipboardLayer`;var Mg=`_sheet-scrollbar_104cg_1`,Ng={side:`l`,align:`center`},Pg={side:`t`,align:`center`},Fg=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{style:n=_e.EmptyCssProperties,orientation:r,sheet:i,onScrollOffset:a,showCustomScrollButtons:s,offset:c=0,totalSize:l=0,viewportSize:d=0,className:f,endGap:p,...m}=e;if(!i)throw Error(`SheetScrollbar needs an IWorksheet`);let h=(0,X.useRef)(null),g=u([h,t]),_=r===Ce.Vertical,v=z(),[y,b]=(0,X.useState)(()=>{let e=(i.getView().getZoomScale()??100)/100,t=i.getView().getTopLeft();return(_?t.top:t.left)*e}),x=()=>{let e=i.getView().getFreezePanes(),t=(i.getView().getZoomScale()??100)/100;if(_){let n=e.coords?.rowIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.top??0;return{shift:(i.getRowHeaders().getMetrics().getOffset(n)-r)*t,scroll:r*t}}{let n=e.coords?.colIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.left??0;return{shift:(i.getColumnHeaders().getMetrics().getOffset(n)-r)*t,scroll:r*t}}},[S,w]=(0,X.useState)(x),[T,E]=(0,X.useState)(null),D=r===Ce.Vertical?i.getRowHeaders():i.getColumnHeaders(),O=()=>{let e=i.getUsedRange()?.getCoords()??C.EmptyRange,t=i.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[k,A]=(0,X.useState)(O),j=k?(_?k.rowIndex:k.colIndex)+1:0,M=()=>{let e=O();C.isEqualCells(k,e)||A(e)};o(i.getView(),{onFreezePaneChange:()=>{w(x)}}),o(i.getSelection(),{onChange:M}),o(i,{onUsedRangeChange:M}),(0,X.useEffect)(()=>{A(O())},[i]);let N=c-S.scroll,P=d-S.shift,F=l-(S.shift+S.scroll),I=D.getMetrics().getOffset(j)*(i.getView().getZoomScale()/100)-(S.scroll+S.shift),L=G((e,t,n)=>{b(e);let r=e+S.scroll,i=t+S.shift,o=n+S.shift+S.scroll;a?.(r,i,o)},[a,S]),R=G(e=>{E(e.dragging?{element:e.element}:null)},[]),ee=null,B=T?T.element??h.current?.querySelector(`[role="slider"]`)??null:null;if(B){let e=D.getTextAt(D.getMetrics().getIndex(y/(i.getView().getZoomScale()/100)+S.scroll+S.shift));ee=v(_?`scrollbar.row`:`scrollbar.column`,{title:e})}let H=(0,X.useMemo)(()=>(0,Z.jsx)(V,{ref:g,className:Q(f,Mg),style:n,offset:N,viewportSize:P,totalSize:F,orientation:r,showCustomScrollButtons:s,onMouseDown:e=>{e.preventDefault()},onScrollOffset:L,minSize:I,onThumbDrag:R,...m}),[f,N,P,F,r,s,n,I,p]);return(0,Z.jsxs)(Z.Fragment,{children:[H,B?(0,Z.jsx)(lt,{name:`scrollbar-thumb`,active:!!T,anchor:{element:B},placement:_?Ng:Pg,children:ee}):null]})}));Fg.displayName=`SheetScrollbar`;var Ig=Object.freeze([]),Lg={style:{display:`none`}},Rg=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheetHeader:n,oppositeSize:r=30,edgeSize:i=1,edgeColor:a=`var(--sxl-color-base-300)`,headerText:s,freezeStart:c,colorScheme:l,verticalPadding:d,horizontalPadding:f,onSheetContextMenu:p,onResizeHeadersStart:m,onResizeHeaders:h,onResizeHeadersEnd:g,onResizeHeadersDown:_,onResizeHeadersUp:v,viewport:y,onSelectionStart:b,onSelectionEnd:x,propsCellRender:S,style:C,className:w,...T}=e,E=(0,X.useMemo)(()=>n.getAxis(),[n]),D=G(m,[m]),O=G((e,t,n)=>{U(),h?.(e,t,n)},[h]),k=G(g,[g]),A=G(_,[_]),j=G(v,[v]),M=(0,X.useRef)(null),[N,P]=(0,X.useReducer)(e=>e+1,0),F=n?.getWorksheet(),I=(0,X.useRef)(!1);(0,X.useLayoutEffect)(()=>{I.current=!0},[n]);let[L,R]=(0,X.useState)(0),[ee,z]=(0,X.useState)(F?.getView().getZoomScale()/100),[B,V]=(0,X.useState)(()=>F?.getEntireRange().getCoords()??null);o(F,{onViewChange:()=>{z(F.getView().getZoomScale()/100)},onLayoutChange:()=>{let e=F.getEntireRange().getCoords();V(t=>t&&t.rowEnd===e.rowEnd&&t.colEnd===e.colEnd?t:e)}});let[H,U]=bg(n);o(n,{onMetricsChange:()=>{R(n.getEntireRange().getCoords().max+1)}});let W=(0,X.useCallback)((e,t)=>H.hiddenHeadersAt(e,t),[H]),te=G(e=>n.isSelected(e),[n]),ne=G(e=>n.isSelectedAll(e),[n]),ie=(0,X.useCallback)(()=>{let e=n.getFilteredRanges();return e.length===0?Ig:e.map(e=>e.getCoords())},[n]),ae=(0,X.useRef)(Ig),[oe,se]=(0,X.useReducer)(e=>e+1,0);(0,X.useLayoutEffect)(()=>{ae.current=ie()},[ie]),o(F,{onTablesChange:()=>{let e=ae.current,t=ie();ae.current=t,((e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].min!==t[n].min||e[n].max!==t[n].max)return!1;return!0})(e,t)||se()}});let ce=G(e=>{let t=ae.current;for(let n=0;n<t.length;n++)if(e>=t[n].min&&e<=t[n].max)return!0;return!1},[]),K=(0,X.useMemo)(()=>{let e=E===Y.Axis.Column;return{getColOffset:t=>e?H.getOffset(t):t===0?0:r/ee,getColIndex:t=>e?H.getIndex(t):0,getRowOffset:t=>e?t===0?0:r/ee:H.getOffset(t),getRowIndex:t=>e?0:H.getIndex(t)}},[H,E,r,ee]),le=(0,X.useMemo)(()=>(0,Z.jsx)(Zh,{sheetHeader:n,isColumn:E===Y.Axis.Column,oppositeSize:r,onResizeHeadersStart:D,onResizeHeaders:O,onResizeHeadersEnd:k,onResizeHeadersDown:A,onResizeHeadersUp:j},`header-resizer-layer-${E}-[${n.getWorksheet().getId()}]`),[n,r,E,N]),ue=(0,X.useMemo)(()=>(0,Z.jsx)(fg,{sheetHeader:n},`header-freeze-layer-${E}-[${n.getWorksheet().getId()}]`),[n,E]),fe=G(e=>{let t=E===Y.Axis.Column;p?.({...e,rowIndex:t?-1:e.rowIndex,colIndex:t?e.colIndex:-1})},[E,p]),pe=G(e=>{F?.scrollTo({colStart:e.colIndex,colEnd:e.colIndex,rowStart:e.rowIndex,rowEnd:e.rowIndex},{})},[F]),me=(0,X.useMemo)(()=>(0,Z.jsx)(Uh,{selection:n.getWorksheet().getSelection(),axis:E,entireCoords:B??n.getWorksheet().getEntireRange().getCoords(),edgeSize:i,edgeColor:a,scrollIntoView:pe,onPointerDownInterceptor:(e,t)=>!(e.button===2&&n.isSelectedAll(E===Y.Axis.Column?t.colIndex:t.rowIndex)),onSelectionStart:b,onSelectionEnd:x},`header-selection-layer-${E}-[${n.getWorksheet().getId()}]`),[n,L,B,c,i,a,pe]),he=(0,X.useMemo)(()=>(0,Z.jsx)(_g,{axis:E,entireCoords:B??n.getWorksheet().getEntireRange().getCoords(),scrollIntoView:pe},`header-reference-layer-${E}-[${n.getWorksheet().getId()}]`),[n,L,B,c,E,pe]),ge=(0,X.useMemo)(()=>p?(0,Z.jsx)(gg,{sheet:n.getWorksheet(),onSheetContextMenu:fe},`context-menu-layer-${E}-[${n.getWorksheet().getId()}]`):null,[n,p,N]),ve=G(e=>s?s(e):n.getTextAt(e),[s,n]),ye=G(e=>{let{range:t,key:r,...i}=e,a=E===Y.Axis.Column?t?.colStart??e.cell.colIndex:t?.rowStart??e.cell.rowIndex,o=n.at(a);return(0,Z.jsx)(Yi,{axis:E,index:a,isSelected:te,isSelectedAll:ne,isFiltered:ce,zoomScale:100*ee,headerText:ve,verticalPadding:d,horizontalPadding:f,onColumnButtonMouseDown:S?.onColumnButtonMouseDown,propsColumnButton:S?.propsColumnButton,renderColumnButton:S?.renderColumnButton,...i,value:o},`${r}-${E}-[${n.getWorksheet().getId()}]`)},[N,S,L,ee,n]),be=Fe(),xe=je(t,()=>({scrollTo:e=>{M.current?.scrollTo(e)},forceRender:()=>{P()},getGridSurface:()=>M.current}),[]),Se=(0,X.useMemo)(()=>{if(y)return E===Y.Axis.Column?new de(y,new re,!0,!1,y):new de(new re,y,!1,!0,y)},[y,E]),Ce=l===`dark`?`dark`:`light`,we=(0,X.useMemo)(()=>{let e={overflow:`visible`,...(F?.getStyles().getNormal().getFont()).toCSS(`adaptive`,1),...C},t=`white`,n=`black`;if(_e.detectIt().primaryInput!==`touch`){let r=E===Y.Axis.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;be.getMode()?.key===`formatPainter`&&(r=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),e.cursor=r}e.backgroundColor=`var(--sxl-color-base-100)`;let i=E===Y.Axis.Column;return e.boxSizing=`border-box`,e.width=i?`100%`:r,e.height=i?r:`100%`,e.contain=`size layout style`,e.clipPath=i?`inset(-9999px 0px -9999px 0px)`:`inset(0px -9999px 0px -9999px)`,e},[E,be,l,C,r,N]),Te=E===Y.Axis.Column?`columnHeaders`:`rowHeaders`,Ee=wh(n.getWorksheet(),Te),De=(0,X.useMemo)(()=>[(0,Z.jsx)(Ku,{header:n,renderCell:ye,invalidateToken:oe},`header-cells-${E}-[${n.getWorksheet().getId()}]`),me,he,le,ue,ge,...Ee],[le,ue,me,he,ge,Ee,n,ye,E,oe]),Oe=u([xe,M]),ke=(0,X.useMemo)(()=>{let e=E===Y.Axis.Column;return(0,Z.jsx)(_h,{value:Te,children:(0,Z.jsx)(ut,{ref:Oe,className:Q(w,`sheet-header`),style:{touchAction:`none`,...we},...Be(`header`,Ce),viewport:Se,columnCount:e?L:1,rowCount:e?1:L,freezeLeft:e?c:void 0,freezeTop:e?void 0:c,propsFreezeLeft:Lg,propsFreezeTop:Lg,hiddenColumnsAt:e?W:void 0,hiddenRowsAt:e?void 0:W,metrics:K,...T,children:De})})},[L,De,Te,K,Se,we,w,Ce,T,Oe]);return(0,X.useEffect)(()=>{I.current=!1,M.current?.invalidate()},[n]),ke})),zg=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,thickness:i,freezeStart:a,viewport:s,colorScheme:c,renderButton:l,laneGap:u,bracketGap:d,className:f,style:p,...m}=e,h=n===Y.Axis.Column,g=h?t.getColumnHeaders():t.getRowHeaders(),_=()=>(t.getView().getZoomScale()??100)/100,v=()=>g.getEntireRange().getCoords().max+1,[y,b]=(0,X.useState)(_),[x,S]=(0,X.useState)(v),[C]=bg(g);o(t,{onViewChange:()=>b(_())}),o(g,{onMetricsChange:()=>S(v())});let w=(0,X.useMemo)(()=>({getColOffset:e=>h?C.getOffset(e):e===0?0:i/y,getColIndex:e=>h?C.getIndex(e):0,getRowOffset:e=>h?e===0?0:i/y:C.getOffset(e),getRowIndex:e=>h?0:C.getIndex(e)}),[C,h,i,y]),T=(0,X.useCallback)((e,t)=>C.hiddenHeadersAt(e,t),[C]),E=(0,X.useMemo)(()=>{if(s)return h?new de(s,new re,!0,!1,s):new de(new re,s,!1,!0,s)},[s,h]),D=(0,X.useMemo)(()=>({boxSizing:`border-box`,width:h?`100%`:i,height:h?i:`100%`,contain:`size layout style`,...p}),[h,i,p]),O=c===`dark`?`dark`:`light`;return(0,Z.jsx)(ut,{className:Q(f,`sheet-outline`),style:D,...Be(`app`,O),viewport:E,columnCount:h?x:1,rowCount:h?1:x,freezeLeft:h?a:void 0,freezeTop:h?void 0:a,hiddenColumnsAt:h?T:void 0,hiddenRowsAt:h?void 0:T,metrics:w,...m,children:(0,Z.jsx)(Ju,{sheet:t,axis:n,lanes:r,renderButton:l,laneGap:u,bracketGap:d},`outline-${n}-[${t.getId()}]`)})});zg.displayName=`SheetOutlineElement`;var Bg=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,laneSize:i,laneGap:a=1,colorScheme:s,renderLevelButton:c=aa,className:l,style:u,...d}=e,f=z(),p=n===Y.Axis.Column,m=Xi(i,a),[,h]=(0,X.useReducer)(e=>e+1,0);o(t.getOutline(),{onOutlineChange:()=>h()});let g=Hg(t.getOutline(),n)+1,_=s===`dark`?`dark`:`light`,[v]=Ne(`outlineShowLevel`),y=v?.disabled()??!1,b=e=>{v?v.execute({axis:n,level:e}):t.getOutline().setVisibleLevels(p?Y.Axis.Column:Y.Axis.Row,e)},x=[];for(let e=1;e<=r;e++)x.push((0,Z.jsx)(`div`,{style:{width:i,height:i,flex:`none`,display:`flex`,justifyContent:p?`flex-end`:`flex-start`,alignItems:p?`flex-start`:`flex-end`},children:(0,Z.jsx)(`div`,{style:{width:m,height:m,display:`flex`},onMouseDown:e=>e.preventDefault(),children:(0,Z.jsx)(xe,{render:c,props:{axis:n,level:e,shown:e<=g,size:m,title:f(`outline.showLevel`,{level:e}),onShowLevel:()=>b(e),disabled:y}})})},e));return(0,Z.jsx)(`div`,{className:Q(l,`sheet-outline-levels`),...Be(`header`,_),...d,style:{display:`flex`,flexDirection:p?`column`:`row`,alignItems:`flex-end`,justifyContent:`flex-start`,paddingLeft:p?0:a,paddingTop:p?a:0,paddingRight:p?Vg:0,paddingBottom:p?0:Vg,boxSizing:`border-box`,width:`100%`,height:`100%`,overflow:`hidden`,...u},children:x})});Bg.displayName=`SheetOutlineLevels`;var Vg=3,Hg=(e,t)=>{let n=[],r=0,i=e.getLevelCount(t);for(let a=1;a<=i;a++){let i=n,o=[],s=0;for(let n of e.getGroups(t,{level:a}))if(!n.collapsed){if(a>1){for(;s<i.length&&i[s].end<n.start;)s++;if(s>=i.length||i[s].start>n.start)continue}o.push(n)}if(o.length===0)break;r=a,n=o}return r},Ug=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,colorScheme:r,className:i,style:a,width:s,height:c,onMouseDown:l,...u}=e,[d,f]=(0,X.useState)(n.getSelection().isEntire()),[p,m]=(0,X.useState)(!1),[h]=Ne(`selectAll`);o(n?.getSelection(),{onChange:()=>{f(n.getSelection().isEntire()),m(n.getSelection().hasTopOrLeft())}});let g=r===`dark`?`dark`:`light`,_=d?`var(--sxl-color-primary)`:`var(--sxl-color-base-100)`,v=d?`color-mix(in srgb, var(--sxl-color-primary) 20%, transparent)`:`var(--sxl-color-base-hover)`,y=`var(--sxl-color-base-300)`,b=_e.getDevicePixelRatio(),x=e=>e/b+`px`;return(0,Z.jsxs)(`div`,{tabIndex:-1,className:Q(i,`top-left-corner`),...Be(`header`,g),...u,onMouseDown:e=>{let t=e.button!==0||!e.ctrlKey&&!n.getSelection().isEntire();h?.execute(t),l?.(e)},style:{gridColumn:`1 / 2`,gridRow:`1 / 2`,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSizing:`border-box`,position:`relative`,cursor:`cell`,zIndex:100,borderRight:`solid ${x(1)} ${y}`,borderBottom:`solid ${x(1)} ${y}`,...a},ref:t,children:[(0,Z.jsx)(`div`,{style:{height:c-5+`px`,width:c-5+`px`,clipPath:`path('M${c-5} 0 L0 ${c-5} L${c-5} ${c-5} L${c-5} 0 Z')`,borderRight:`${x(2)} solid ${_}`,borderBottom:`${x(2)} solid ${_}`,background:`${v}`,boxSizing:`border-box`,position:`absolute`,right:x(2),bottom:x(2)}}),(0,Z.jsx)(`div`,{style:{position:`absolute`,right:x(-2),bottom:x(-2),width:x(p?2:1),height:x(p?2:1),background:p?`var(--sxl-color-primary)`:`var(--sxl-color-base-300)`}})]})}));Ug.displayName=`TopLeftCorner`;var Wg=/^(line|lineInv|straightConnector1|bentConnector\d|curvedConnector\d)$/,Gg=e=>Wg.test(e)?{type:ln.Type.Connector,geometry:e}:e===`rect`?{}:{geometry:e},$=(e,t)=>({key:e,label:t,json:Gg(e)}),Kg=(e,t,n,r=!1)=>({key:e,label:n,json:{...Gg(t),stroke:r?{headType:hn.LineEndType.Triangle,tailType:hn.LineEndType.Triangle}:{tailType:hn.LineEndType.Triangle}}});S(`shape.category.lines`),$(`line`,S(`shape.preset.line`)),Kg(`lineArrow`,`line`,S(`shape.preset.lineArrow`)),Kg(`lineArrowDouble`,`line`,S(`shape.preset.lineArrowDouble`),!0),$(`bentConnector3`,S(`shape.preset.bentConnector3`)),Kg(`bentConnector3Arrow`,`bentConnector3`,S(`shape.preset.bentConnector3Arrow`)),Kg(`bentConnector3ArrowDouble`,`bentConnector3`,S(`shape.preset.bentConnector3ArrowDouble`),!0),$(`curvedConnector3`,S(`shape.preset.curvedConnector3`)),Kg(`curvedConnector3Arrow`,`curvedConnector3`,S(`shape.preset.curvedConnector3Arrow`)),Kg(`curvedConnector3ArrowDouble`,`curvedConnector3`,S(`shape.preset.curvedConnector3ArrowDouble`),!0),S(`shape.category.rectangles`),$(`rect`,S(`shape.preset.rect`)),$(`roundRect`,S(`shape.preset.roundRect`)),$(`snip1Rect`,S(`shape.preset.snip1Rect`)),$(`snip2SameRect`,S(`shape.preset.snip2SameRect`)),$(`snip2DiagRect`,S(`shape.preset.snip2DiagRect`)),$(`snipRoundRect`,S(`shape.preset.snipRoundRect`)),$(`round1Rect`,S(`shape.preset.round1Rect`)),$(`round2SameRect`,S(`shape.preset.round2SameRect`)),$(`round2DiagRect`,S(`shape.preset.round2DiagRect`)),S(`shape.category.basic`),$(`ellipse`,S(`shape.preset.ellipse`)),$(`triangle`,S(`shape.preset.triangle`)),$(`rtTriangle`,S(`shape.preset.rtTriangle`)),$(`parallelogram`,S(`shape.preset.parallelogram`)),$(`trapezoid`,S(`shape.preset.trapezoid`)),$(`diamond`,S(`shape.preset.diamond`)),$(`pentagon`,S(`shape.preset.pentagon`)),$(`hexagon`,S(`shape.preset.hexagon`)),$(`heptagon`,S(`shape.preset.heptagon`)),$(`octagon`,S(`shape.preset.octagon`)),$(`decagon`,S(`shape.preset.decagon`)),$(`dodecagon`,S(`shape.preset.dodecagon`)),$(`pie`,S(`shape.preset.pie`)),$(`chord`,S(`shape.preset.chord`)),$(`teardrop`,S(`shape.preset.teardrop`)),$(`frame`,S(`shape.preset.frame`)),$(`halfFrame`,S(`shape.preset.halfFrame`)),$(`corner`,S(`shape.preset.corner`)),$(`diagStripe`,S(`shape.preset.diagStripe`)),$(`plus`,S(`shape.preset.plus`)),$(`plaque`,S(`shape.preset.plaque`)),$(`can`,S(`shape.preset.can`)),$(`cube`,S(`shape.preset.cube`)),$(`bevel`,S(`shape.preset.bevel`)),$(`donut`,S(`shape.preset.donut`)),$(`noSmoking`,S(`shape.preset.noSmoking`)),$(`blockArc`,S(`shape.preset.blockArc`)),$(`foldedCorner`,S(`shape.preset.foldedCorner`)),$(`smileyFace`,S(`shape.preset.smileyFace`)),$(`heart`,S(`shape.preset.heart`)),$(`lightningBolt`,S(`shape.preset.lightningBolt`)),$(`sun`,S(`shape.preset.sun`)),$(`moon`,S(`shape.preset.moon`)),$(`cloud`,S(`shape.preset.cloud`)),$(`arc`,S(`shape.preset.arc`)),$(`bracketPair`,S(`shape.preset.bracketPair`)),$(`bracePair`,S(`shape.preset.bracePair`)),$(`leftBracket`,S(`shape.preset.leftBracket`)),$(`rightBracket`,S(`shape.preset.rightBracket`)),$(`leftBrace`,S(`shape.preset.leftBrace`)),$(`rightBrace`,S(`shape.preset.rightBrace`)),S(`shape.category.blockArrows`),$(`rightArrow`,S(`shape.preset.rightArrow`)),$(`leftArrow`,S(`shape.preset.leftArrow`)),$(`upArrow`,S(`shape.preset.upArrow`)),$(`downArrow`,S(`shape.preset.downArrow`)),$(`leftRightArrow`,S(`shape.preset.leftRightArrow`)),$(`upDownArrow`,S(`shape.preset.upDownArrow`)),$(`quadArrow`,S(`shape.preset.quadArrow`)),$(`leftRightUpArrow`,S(`shape.preset.leftRightUpArrow`)),$(`bentArrow`,S(`shape.preset.bentArrow`)),$(`uturnArrow`,S(`shape.preset.uturnArrow`)),$(`leftUpArrow`,S(`shape.preset.leftUpArrow`)),$(`bentUpArrow`,S(`shape.preset.bentUpArrow`)),$(`curvedRightArrow`,S(`shape.preset.curvedRightArrow`)),$(`curvedLeftArrow`,S(`shape.preset.curvedLeftArrow`)),$(`curvedUpArrow`,S(`shape.preset.curvedUpArrow`)),$(`curvedDownArrow`,S(`shape.preset.curvedDownArrow`)),$(`stripedRightArrow`,S(`shape.preset.stripedRightArrow`)),$(`notchedRightArrow`,S(`shape.preset.notchedRightArrow`)),$(`homePlate`,S(`shape.preset.homePlate`)),$(`chevron`,S(`shape.preset.chevron`)),$(`rightArrowCallout`,S(`shape.preset.rightArrowCallout`)),$(`downArrowCallout`,S(`shape.preset.downArrowCallout`)),$(`leftArrowCallout`,S(`shape.preset.leftArrowCallout`)),$(`upArrowCallout`,S(`shape.preset.upArrowCallout`)),$(`leftRightArrowCallout`,S(`shape.preset.leftRightArrowCallout`)),$(`quadArrowCallout`,S(`shape.preset.quadArrowCallout`)),$(`circularArrow`,S(`shape.preset.circularArrow`)),S(`shape.category.equation`),$(`mathPlus`,S(`shape.preset.mathPlus`)),$(`mathMinus`,S(`shape.preset.mathMinus`)),$(`mathMultiply`,S(`shape.preset.mathMultiply`)),$(`mathDivide`,S(`shape.preset.mathDivide`)),$(`mathEqual`,S(`shape.preset.mathEqual`)),$(`mathNotEqual`,S(`shape.preset.mathNotEqual`)),S(`shape.category.flowchart`),$(`flowChartProcess`,S(`shape.preset.flowChartProcess`)),$(`flowChartAlternateProcess`,S(`shape.preset.flowChartAlternateProcess`)),$(`flowChartDecision`,S(`shape.preset.flowChartDecision`)),$(`flowChartInputOutput`,S(`shape.preset.flowChartInputOutput`)),$(`flowChartPredefinedProcess`,S(`shape.preset.flowChartPredefinedProcess`)),$(`flowChartInternalStorage`,S(`shape.preset.flowChartInternalStorage`)),$(`flowChartDocument`,S(`shape.preset.flowChartDocument`)),$(`flowChartMultidocument`,S(`shape.preset.flowChartMultidocument`)),$(`flowChartTerminator`,S(`shape.preset.flowChartTerminator`)),$(`flowChartPreparation`,S(`shape.preset.flowChartPreparation`)),$(`flowChartManualInput`,S(`shape.preset.flowChartManualInput`)),$(`flowChartManualOperation`,S(`shape.preset.flowChartManualOperation`)),$(`flowChartConnector`,S(`shape.preset.flowChartConnector`)),$(`flowChartOffpageConnector`,S(`shape.preset.flowChartOffpageConnector`)),$(`flowChartPunchedCard`,S(`shape.preset.flowChartPunchedCard`)),$(`flowChartPunchedTape`,S(`shape.preset.flowChartPunchedTape`)),$(`flowChartSummingJunction`,S(`shape.preset.flowChartSummingJunction`)),$(`flowChartOr`,S(`shape.preset.flowChartOr`)),$(`flowChartCollate`,S(`shape.preset.flowChartCollate`)),$(`flowChartSort`,S(`shape.preset.flowChartSort`)),$(`flowChartExtract`,S(`shape.preset.flowChartExtract`)),$(`flowChartMerge`,S(`shape.preset.flowChartMerge`)),$(`flowChartOnlineStorage`,S(`shape.preset.flowChartOnlineStorage`)),$(`flowChartDelay`,S(`shape.preset.flowChartDelay`)),$(`flowChartMagneticTape`,S(`shape.preset.flowChartMagneticTape`)),$(`flowChartMagneticDisk`,S(`shape.preset.flowChartMagneticDisk`)),$(`flowChartMagneticDrum`,S(`shape.preset.flowChartMagneticDrum`)),$(`flowChartDisplay`,S(`shape.preset.flowChartDisplay`)),S(`shape.category.starsBanners`),$(`irregularSeal1`,S(`shape.preset.irregularSeal1`)),$(`irregularSeal2`,S(`shape.preset.irregularSeal2`)),$(`star4`,S(`shape.preset.star4`)),$(`star5`,S(`shape.preset.star5`)),$(`star6`,S(`shape.preset.star6`)),$(`star7`,S(`shape.preset.star7`)),$(`star8`,S(`shape.preset.star8`)),$(`star10`,S(`shape.preset.star10`)),$(`star12`,S(`shape.preset.star12`)),$(`star16`,S(`shape.preset.star16`)),$(`star24`,S(`shape.preset.star24`)),$(`star32`,S(`shape.preset.star32`)),$(`ribbon2`,S(`shape.preset.ribbon2`)),$(`ribbon`,S(`shape.preset.ribbon`)),$(`ellipseRibbon2`,S(`shape.preset.ellipseRibbon2`)),$(`ellipseRibbon`,S(`shape.preset.ellipseRibbon`)),$(`verticalScroll`,S(`shape.preset.verticalScroll`)),$(`horizontalScroll`,S(`shape.preset.horizontalScroll`)),$(`wave`,S(`shape.preset.wave`)),$(`doubleWave`,S(`shape.preset.doubleWave`)),S(`shape.category.callouts`),$(`wedgeRectCallout`,S(`shape.preset.wedgeRectCallout`)),$(`wedgeRoundRectCallout`,S(`shape.preset.wedgeRoundRectCallout`)),$(`wedgeEllipseCallout`,S(`shape.preset.wedgeEllipseCallout`)),$(`cloudCallout`,S(`shape.preset.cloudCallout`)),$(`borderCallout1`,S(`shape.preset.borderCallout1`)),$(`borderCallout2`,S(`shape.preset.borderCallout2`)),$(`borderCallout3`,S(`shape.preset.borderCallout3`)),$(`accentCallout1`,S(`shape.preset.accentCallout1`)),$(`accentCallout2`,S(`shape.preset.accentCallout2`)),$(`accentCallout3`,S(`shape.preset.accentCallout3`)),$(`callout1`,S(`shape.preset.callout1`)),$(`callout2`,S(`shape.preset.callout2`)),$(`callout3`,S(`shape.preset.callout3`)),$(`accentBorderCallout1`,S(`shape.preset.accentBorderCallout1`)),$(`accentBorderCallout2`,S(`shape.preset.accentBorderCallout2`)),$(`accentBorderCallout3`,S(`shape.preset.accentBorderCallout3`)),S(`shape.category.more`),$(`chartPlus`,S(`shape.preset.chartPlus`)),$(`chartStar`,S(`shape.preset.chartStar`)),$(`chartX`,S(`shape.preset.chartX`)),$(`cornerTabs`,S(`shape.preset.cornerTabs`)),$(`squareTabs`,S(`shape.preset.squareTabs`)),$(`plaqueTabs`,S(`shape.preset.plaqueTabs`)),$(`funnel`,S(`shape.preset.funnel`)),$(`gear6`,S(`shape.preset.gear6`)),$(`gear9`,S(`shape.preset.gear9`)),$(`leftCircularArrow`,S(`shape.preset.leftCircularArrow`)),$(`leftRightCircularArrow`,S(`shape.preset.leftRightCircularArrow`)),$(`swooshArrow`,S(`shape.preset.swooshArrow`)),$(`leftRightRibbon`,S(`shape.preset.leftRightRibbon`)),$(`nonIsoscelesTrapezoid`,S(`shape.preset.nonIsoscelesTrapezoid`)),$(`pieWedge`,S(`shape.preset.pieWedge`)),$(`upDownArrowCallout`,S(`shape.preset.upDownArrowCallout`)),$(`flowChartOfflineStorage`,S(`shape.preset.flowChartOfflineStorage`)),$(`actionButtonBlank`,S(`shape.preset.actionButtonBlank`)),$(`actionButtonHome`,S(`shape.preset.actionButtonHome`)),$(`actionButtonHelp`,S(`shape.preset.actionButtonHelp`)),$(`actionButtonInformation`,S(`shape.preset.actionButtonInformation`)),$(`actionButtonBackPrevious`,S(`shape.preset.actionButtonBackPrevious`)),$(`actionButtonForwardNext`,S(`shape.preset.actionButtonForwardNext`)),$(`actionButtonBeginning`,S(`shape.preset.actionButtonBeginning`)),$(`actionButtonEnd`,S(`shape.preset.actionButtonEnd`)),$(`actionButtonReturn`,S(`shape.preset.actionButtonReturn`)),$(`actionButtonDocument`,S(`shape.preset.actionButtonDocument`)),$(`actionButtonSound`,S(`shape.preset.actionButtonSound`)),$(`actionButtonMovie`,S(`shape.preset.actionButtonMovie`));var qg=e=>{let t=e.getRange().getCoords();return{rowIndex:t.rowStart,colIndex:t.colStart}},Jg=(e,t)=>{let n=e.getRange().getCoords(),r=t.getRange().getCoords();return n.rowStart-r.rowStart||n.colStart-r.colStart},Yg=86400;7*Yg,30*Yg,7*Yg,365*Yg,30*Yg,365*Yg;var Xg=class{constructor(e){this._snapshot=null,this._listeners=new Set,this._removeSheetListener=null,this._queue=Promise.resolve(),this._pivot=e}getPivotTable(){return this._pivot}getSnapshot(){return this._removeSheetListener?this._snapshot??=e_(this._pivot):e_(this._pivot)}subscribe(e){return this._listeners.add(e),this._removeSheetListener||=this._pivot.getWorksheet().addListeners({onPivotTablesChange:()=>this._changed()}),()=>{this._listeners.delete(e),this._listeners.size===0&&this._stopListening()}}close(){this._listeners.clear(),this._stopListening()}tick(e){return this._run(async()=>{let t=this._field(this._pivot,e);$g(this._pivot,t)||(t.getDataType()===`number`?await this._pivot.addDataField(t):await t.setAxis(`row`))})}untick(e){return this._run(()=>this._batch(S(`op.movePivotField`),async t=>{let n=this._field(t,e);await n.setAxis(null);for(let e of Qg(t,n))await e.delete()}))}place(e,t,n){let r=n===void 0?void 0:n+1;return this._run(async()=>{if(e.kind===`values`){let e=this._pivot.getValuesField();if(!e||t===`page`||t===`values`)return;e.getAxis()===t&&r!==void 0?await e.setPosition(r):await e.setAxis(t,r)}else if(e.kind===`data`){let n=this._data(this._pivot,e.name);if(t===`values`)return void(r!==void 0&&await n.setPosition(r));let i=n.getField().getName();await this._batch(S(`op.movePivotField`),async n=>{await this._data(n,e.name).delete(),await this._toAxis(this._field(n,i),t,r)})}else t===`values`?await this._batch(S(`op.addPivotDataField`),async t=>{let n=await t.addDataField(this._field(t,e.name));r!==void 0&&await n.setPosition(r)}):await this._toAxis(this._field(this._pivot,e.name),t,r)})}remove(e){return this._run(async()=>{e.kind===`values`?await this._pivot.getValuesField()?.setAxis(null):e.kind===`data`?await this._data(this._pivot,e.name).delete():await this._field(this._pivot,e.name).setAxis(null)})}setFunction(e,t){return this._run(()=>this._data(this._pivot,e).setFunction(t))}applyValueSettings(e,t){return this._run(()=>this._batch(S(`op.pivotValueSettings`),async n=>{let r=this._data(n,e);t.function!==void 0&&await r.setFunction(t.function),t.showAs!==void 0&&await r.setShowAs(t.showAs),t.numberFormat!==void 0&&await r.setNumberFormat(t.numberFormat),t.name!==void 0&&await r.setName(t.name)}))}rename(e,t){return this._run(async()=>{e.kind===`values`?await this._pivot.getValuesField()?.setName(t):e.kind===`data`?await this._data(this._pivot,e.name).setName(t):await this._field(this._pivot,e.name).setName(t)})}async _toAxis(e,t,n){e.getAxis()===t?n!==void 0&&await e.setPosition(n):await e.setAxis(t,n)}_field(e,t){let n=e.getField(t);if(!n)throw Error(`'${t}' is not a field of this PivotTable.`);return n}_data(e,t){let n=e.getDataField(t);if(!n)throw Error(`'${t}' is not a value of this PivotTable.`);return n}_run(e){let t=this._queue.then(e);return this._queue=t.catch(()=>{}),t}async _batch(e,t){let n=this._pivot.getWorksheet().getName(),r=this._pivot.getName(),i=this._pivot.getWorksheet().getWorkbook();if(!i)throw Error(`The PivotTable '${r}' is gone.`);await i.doBatch(async(e,i)=>{let a=i.getWorksheets().getByName(n)?.getPivotTables().getByName(r);if(!a)throw Error(`The PivotTable '${r}' is gone.`);await t(a)},{description:e})}_changed(){this._snapshot=null;for(let e of[...this._listeners])e()}_stopListening(){this._removeSheetListener?.(),this._removeSheetListener=null,this._snapshot=null}},Zg={row:[],column:[],page:[],values:[]},Qg=(e,t)=>e.getDataFields().filter(e=>e.getField().getName()===t.getName()),$g=(e,t)=>t.getAxis()!==null||Qg(e,t).length>0,e_=e=>{if(e.isDeleted())return{deleted:!0,name:e.getName(),source:null,location:null,fields:[],areas:Zg};let t=new Set(e.getDataFields().map(e=>e.getField().getName())),n=e.getFields().map(e=>({name:e.getName(),dataType:e.getDataType(),ticked:e.getAxis()!==null||t.has(e.getName()),axis:e.getAxis(),filtered:e.isFiltered()})),r=e=>({kind:`field`,name:e.getName(),filtered:e.isFiltered()}),i=(t,n)=>{let i=n.map(r),a=e.getValuesField(),o=a?.getAxis()===t?a.getPosition():null;return a&&o!==null&&i.splice(o-1,0,{kind:`values`,name:a.getName()}),i};return{deleted:!1,name:e.getName(),source:e.getSource(),location:e.getRange().getA1(),fields:n,areas:{row:i(`row`,e.getRowFields()),column:i(`column`,e.getColumnFields()),page:e.getPageFields().map(r),values:e.getDataFields().map(e=>({kind:`data`,name:e.getName(),field:e.getField().getName(),function:e.getFunction()}))}}};function t_(e){let t=(0,X.useMemo)(()=>e?n_(new Xg(e)):null,[e]),n=(0,X.useSyncExternalStore)(t?.subscribe??r_,t?.getVersion??i_),r=(0,X.useMemo)(()=>t?.model.getSnapshot()??null,[t,n]);return t&&r?{model:t.model,snapshot:r}:null}var n_=e=>{let t=0;return{model:e,subscribe:n=>e.subscribe(()=>{t++,n()}),getVersion:()=>t}},r_=()=>()=>{},i_=()=>0,a_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function o_(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function s_(e){return`nodeType`in e}function c_(e){var t;return e?o_(e)?e:s_(e)&&(t=e.ownerDocument?.defaultView)!=null?t:window:window}function l_(e){let{Document:t}=c_(e);return e instanceof t}function u_(e){return!o_(e)&&e instanceof c_(e).HTMLElement}function d_(e){return e instanceof c_(e).SVGElement}function f_(e){return e?o_(e)?e.document:s_(e)?l_(e)?e:u_(e)||d_(e)?e.ownerDocument:document:document:document}var p_=a_?X.useLayoutEffect:X.useEffect;function m_(e){let t=(0,X.useRef)(e);return p_(()=>{t.current=e}),(0,X.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function h_(e,t){t===void 0&&(t=[e]);let n=(0,X.useRef)(e);return p_(()=>{n.current!==e&&(n.current=e)},t),n}function g_(e,t){let n=(0,X.useRef)();return(0,X.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function __(e){let t=m_(e),n=(0,X.useRef)(null);return[n,(0,X.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function v_(e){let t=(0,X.useRef)();return(0,X.useEffect)(()=>{t.current=e},[e]),t.current}var y_={};function b_(e,t){return(0,X.useMemo)(()=>{if(t)return t;let n=y_[e]==null?0:y_[e]+1;return y_[e]=n,e+`-`+n},[e,t])}function x_(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var S_=x_(1),C_=x_(-1);function w_(e){if(!e)return!1;let{KeyboardEvent:t}=c_(e.target);return t&&e instanceof t}function T_(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=c_(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return`clientX`in e&&`clientY`in e}(e)?{x:e.clientX,y:e.clientY}:null}var E_=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[E_.Translate.toString(e),E_.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),D_=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function O_(e){return e.matches(D_)?e:e.querySelector(D_)}var k_={display:`none`};function A_(e){let{id:t,value:n}=e;return X.createElement(`div`,{id:t,style:k_},n)}function j_(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return X.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}var M_=(0,X.createContext)(null),N_,P_={draggable:`
|
|
36
|
+
To pick up a draggable item, press the space bar.
|
|
37
|
+
While dragging, use the arrow keys to move the item.
|
|
38
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
39
|
+
`},F_={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function I_(e){let{announcements:t=F_,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=P_}=e,{announce:a,announcement:o}=function(){let[e,t]=(0,X.useState)(``);return{announce:(0,X.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}(),s=b_(`DndLiveRegion`),[c,l]=(0,X.useState)(!1);if((0,X.useEffect)(()=>{l(!0)},[]),function(e){let t=(0,X.useContext)(M_);(0,X.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}((0,X.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=X.createElement(X.Fragment,null,X.createElement(A_,{id:r,value:i.draggable}),X.createElement(j_,{id:s,announcement:o}));return n?(0,ir.createPortal)(u,n):u}function L_(){}function R_(e,t){return(0,X.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function z_(){var e=[...arguments];return(0,X.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(N_||={});var B_=Object.freeze({x:0,y:0});function V_(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function H_(e,t){let n=T_(e);return n?(n.x-t.left)/t.width*100+`% `+(n.y-t.top)/t.height*100+`%`:`0 0`}function U_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function W_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function G_(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function K_(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function q_(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}var J_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=q_(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=V_(q_(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(U_)};function Y_(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s;return Number((i/(n+r-i)).toFixed(4))}return 0}var X_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Y_(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(W_)};function Z_(e,t){let{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}function Q_(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:B_}function $_(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var ev=$_(1);function tv(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var nv,rv={ignoreTransform:!1};function iv(e,t){t===void 0&&(t=rv);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=c_(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=tv(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function av(e){return iv(e,{ignoreTransform:!0})}function ov(e,t){let n=[];return e?function r(i){if(t!=null&&n.length>=t||!i)return n;if(l_(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!u_(i)||d_(i)||n.includes(i))return n;let a=c_(e).getComputedStyle(i);return i!==e&&function(e,t){t===void 0&&(t=c_(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}(i,a)&&n.push(i),function(e,t){return t===void 0&&(t=c_(e).getComputedStyle(e)),t.position===`fixed`}(i,a)?n:r(i.parentNode)}(e):n}function sv(e){let[t]=ov(e,1);return t??null}function cv(e){return a_&&e?o_(e)?e:s_(e)?l_(e)||e===f_(e).scrollingElement?window:u_(e)?e:null:null:null}function lv(e){return o_(e)?e.scrollX:e.scrollLeft}function uv(e){return o_(e)?e.scrollY:e.scrollTop}function dv(e){return{x:lv(e),y:uv(e)}}function fv(e){return!(!a_||!e)&&e===document.scrollingElement}function pv(e){let t={x:0,y:0},n=fv(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(nv||={});var mv={x:.2,y:.2};function hv(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=mv);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=pv(e),p={x:0,y:0},m={x:0,y:0},h=t.height*i.y,g=t.width*i.x;return!l&&a<=t.top+h?(p.y=nv.Backward,m.y=r*Math.abs((t.top+h-a)/h)):!u&&c>=t.bottom-h&&(p.y=nv.Forward,m.y=r*Math.abs((t.bottom-h-c)/h)),!f&&s>=t.right-g?(p.x=nv.Forward,m.x=r*Math.abs((t.right-g-s)/g)):!d&&o<=t.left+g&&(p.x=nv.Backward,m.x=r*Math.abs((t.left+g-o)/g)),{direction:p,speed:m}}function gv(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function _v(e){return e.reduce((e,t)=>S_(e,dv(t)),B_)}function vv(e,t){if(t===void 0&&(t=iv),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);sv(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var yv,bv,xv=[[`x`,[`left`,`right`],function(e){return e.reduce((e,t)=>e+lv(t),0)}],[`y`,[`top`,`bottom`],function(e){return e.reduce((e,t)=>e+uv(t),0)}]],Sv=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=ov(t),r=_v(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of xv)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Cv=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function wv(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}function Tv(e){e.preventDefault()}function Ev(e){e.stopPropagation()}(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(yv||={}),function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`}(bv||={});var Dv={start:[bv.Space,bv.Enter],cancel:[bv.Esc],end:[bv.Space,bv.Enter,bv.Tab]},Ov=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case bv.Right:return{...n,x:n.x+25};case bv.Left:return{...n,x:n.x-25};case bv.Down:return{...n,y:n.y+25};case bv.Up:return{...n,y:n.y-25}}},kv=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Cv(f_(t)),this.windowListeners=new Cv(c_(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yv.Resize,this.handleCancel),this.windowListeners.add(yv.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yv.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&vv(n),t(B_)}handleKeyDown(e){if(w_(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Dv,coordinateGetter:a=Ov,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:B_;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=C_(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=pv(n),p=gv(n),m={x:Math.min(i===bv.Right?p.right-p.width/2:p.right,Math.max(i===bv.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===bv.Down?p.bottom-p.height/2:p.bottom,Math.max(i===bv.Down?p.top:p.top+p.height/2,u.y))},h=i===bv.Right&&!s||i===bv.Left&&!c,g=i===bv.Down&&!l||i===bv.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===bv.Right&&e<=d.x||i===bv.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:o});r.x=a?n.scrollLeft-e:i===bv.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===bv.Down&&e<=d.y||i===bv.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:o});r.y=a?n.scrollTop-e:i===bv.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,S_(C_(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};function Av(e){return!!(e&&`distance`in e)}function jv(e){return!!(e&&`delay`in e)}kv.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Dv,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];var Mv=class{constructor(e,t,n){n===void 0&&(n=function(e){let{EventTarget:t}=c_(e);return e instanceof t?e:f_(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=f_(i),this.documentListeners=new Cv(this.document),this.listeners=new Cv(n),this.windowListeners=new Cv(c_(i)),this.initialCoordinates=T_(r)??B_,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(yv.Resize,this.handleCancel),this.windowListeners.add(yv.DragStart,Tv),this.windowListeners.add(yv.VisibilityChange,this.handleCancel),this.windowListeners.add(yv.ContextMenu,Tv),this.documentListeners.add(yv.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(jv(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Av(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(yv.Click,Ev,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yv.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=T_(e)??B_,s=C_(n,o);if(!t&&a){if(Av(a)){if(a.tolerance!=null&&wv(s,a.tolerance))return this.handleCancel();if(wv(s,a.distance))return this.handleStart()}return jv(a)&&wv(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===bv.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Nv={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Pv=class extends Mv{constructor(e){let{event:t}=e,n=f_(t.target);super(e,Nv,n)}};Pv.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||n.button!==0)&&(r?.({event:n}),!0)}}];var Fv,Iv={move:{name:`mousemove`},end:{name:`mouseup`}};(function(e){e[e.RightClick=2]=`RightClick`})(Fv||={});var Lv=class extends Mv{constructor(e){super(e,Iv,f_(e.event.target))}};Lv.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Fv.RightClick&&(r?.({event:n}),!0)}}];var Rv,zv,Bv={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Vv=class extends Mv{constructor(e){super(e,Bv)}static setup(){return window.addEventListener(Bv.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Bv.move.name,e)};function e(){}}};function Hv(e){let{acceleration:t,activator:n=Rv.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=zv.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=function(e){let{delta:t,disabled:n}=e,r=v_(t);return g_(e=>{if(n||!r||!e)return Gv;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[nv.Backward]:e.x[nv.Backward]||i.x===-1,[nv.Forward]:e.x[nv.Forward]||i.x===1},y:{[nv.Backward]:e.y[nv.Backward]||i.y===-1,[nv.Forward]:e.y[nv.Forward]||i.y===1}}},[n,t,r])}({delta:d,disabled:!a}),[m,h]=function(){let e=(0,X.useRef)(null);return[(0,X.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,X.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}(),g=(0,X.useRef)({x:0,y:0}),_=(0,X.useRef)({x:0,y:0}),v=(0,X.useMemo)(()=>{switch(n){case Rv.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Rv.DraggableRect:return i}},[n,i,c]),y=(0,X.useRef)(null),b=(0,X.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,X.useMemo)(()=>s===zv.TreeOrder?[...l].reverse():l,[s,l]);(0,X.useEffect)(()=>{if(a&&l.length&&v){for(let e of x){if(!1===r?.(e))continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=hv(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0)return h(),y.current=e,m(b,o),g.current=s,void(_.current=a)}g.current={x:0,y:0},_.current={x:0,y:0},h()}else h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}Vv.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return!(i.length>1)&&(r?.({event:n}),!0)}}],function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`}(Rv||={}),function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`}(zv||={});var Uv,Wv,Gv={x:{[nv.Backward]:!1,[nv.Forward]:!1},y:{[nv.Backward]:!1,[nv.Forward]:!1}};(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Uv||={}),function(e){e.Optimized=`optimized`}(Wv||={});var Kv=new Map;function qv(e,t){return g_(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Jv(e){let{callback:t,disabled:n}=e,r=m_(t),i=(0,X.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,X.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Yv(e){return new Sv(iv(e),e)}function Xv(e,t,n){t===void 0&&(t=Yv);let[r,i]=(0,X.useState)(null);function a(){i(r=>{if(!e)return null;if(!1===e.isConnected)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=function(e){let{callback:t,disabled:n}=e,r=m_(t),i=(0,X.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,X.useEffect)(()=>()=>i?.disconnect(),[i]),i}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Jv({callback:a});return p_(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}var Zv=[];function Qv(e,t){t===void 0&&(t=[]);let n=(0,X.useRef)(null);return(0,X.useEffect)(()=>{n.current=null},t),(0,X.useEffect)(()=>{let t=e!==B_;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?C_(e,n.current):B_}function $v(e){return(0,X.useMemo)(()=>e?function(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}var ey=[];function ty(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return u_(t)?t:e}var ny=[{sensor:Pv,options:{}},{sensor:kv,options:{}}],ry={current:{}},iy={draggable:{measure:av},droppable:{measure:av,strategy:Uv.WhileDragging,frequency:Wv.Optimized},dragOverlay:{measure:iv}},ay=class extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},oy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ay,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:L_},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:iy,measureDroppableContainers:L_,windowRect:null,measuringScheduled:!1},sy={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:L_,draggableNodes:new Map,over:null,measureDroppableContainers:L_},cy=(0,X.createContext)(sy),ly=(0,X.createContext)(oy);function uy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ay}}}function dy(e,t){switch(t.type){case N_.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case N_.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case N_.DragEnd:case N_.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case N_.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new ay(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case N_.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new ay(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case N_.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new ay(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function fy(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,X.useContext)(cy),a=v_(r),o=v_(n?.id);return(0,X.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!w_(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=O_(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function py(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}var my,hy=(0,X.createContext)({...B_,scaleX:1,scaleY:1});(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(my||={});var gy=(0,X.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=ny,collisionDetection:o=X_,measuring:s,modifiers:c,...l}=e,[u,d]=(0,X.useReducer)(dy,void 0,uy),[f,p]=function(){let[e]=(0,X.useState)(()=>new Set),t=(0,X.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,X.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}(),[m,h]=(0,X.useState)(my.Uninitialized),g=m===my.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,X.useRef)({initial:null,translated:null}),C=(0,X.useMemo)(()=>_==null?null:{id:_,data:x?.data??ry,rect:S},[_,x]),w=(0,X.useRef)(null),[T,E]=(0,X.useState)(null),[D,O]=(0,X.useState)(null),k=h_(l,Object.values(l)),A=b_(`DndDescribedBy`,t),j=(0,X.useMemo)(()=>b.getEnabled(),[b]),M=(0,X.useMemo)(()=>({draggable:{...iy.draggable,...N?.draggable},droppable:{...iy.droppable,...N?.droppable},dragOverlay:{...iy.dragOverlay,...N?.dragOverlay}}),[(N=s)?.draggable,N?.droppable,N?.dragOverlay]);var N;let{droppableRects:P,measureDroppableContainers:F,measuringScheduled:I}=function(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,X.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,X.useRef)(e),d=function(){switch(l){case Uv.Always:return!1;case Uv.BeforeDragging:return n;default:return!n}}(),f=h_(d),p=(0,X.useCallback)(function(e){e===void 0&&(e=[]),f.current||o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,X.useRef)(null),h=g_(t=>{if(d&&!n)return Kv;if(!t||t===Kv||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Sv(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,X.useEffect)(()=>{u.current=e},[e]),(0,X.useEffect)(()=>{d||p()},[n,d]),(0,X.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,X.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null}}(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),L=function(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return g_(e=>t==null?null:r??e??null,[r,t])}(v,_),R=(0,X.useMemo)(()=>D?T_(D):null,[D]),ee=function(){let e=!1===T?.autoScrollEnabled,t=typeof r==`object`?!1===r.enabled:!1===r,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}(),z=function(e,t){return qv(e,t)}(L,M.draggable.measure);(function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,X.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;p_(()=>{if(!o&&!s||!t)return void(a.current=!1);if(a.current||!r)return;let e=t?.node.current;if(!e||!1===e.isConnected)return;let i=Q_(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=sv(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])})({activeNode:_==null?null:v.get(_),config:ee.layoutShiftCompensation,initialRect:z,measure:M.draggable.measure});let B=Xv(L,M.draggable.measure,z),V=Xv(L?L.parentElement:null),H=(0,X.useRef)({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),U=b.getNodeFor(H.current.over?.id),W=function(e){let{measure:t}=e,[n,r]=(0,X.useState)(null),i=Jv({callback:(0,X.useCallback)(e=>{for(let{target:n}of e)if(u_(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=__((0,X.useCallback)(e=>{let n=ty(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,X.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}({measure:M.dragOverlay.measure}),te=W.nodeRef.current??L,G=g?W.rect??B:null,ne=!!(W.nodeRef.current&&W.rect),re=Q_(ie=ne?null:B,qv(ie));var ie;let ae=$v(te?c_(te):null),oe=function(e){let t=(0,X.useRef)(e),n=g_(n=>e?n&&n!==Zv&&e&&t.current&&e.parentNode===t.current.parentNode?n:ov(e):Zv,[e]);return(0,X.useEffect)(()=>{t.current=e},[e]),n}(g?U??L:null),se=function(e,t){t===void 0&&(t=iv);let[n]=e,r=$v(n?c_(n):null),[i,a]=(0,X.useState)(ey);function o(){a(()=>e.length?e.map(e=>fv(e)?r:new Sv(t(e),e)):ey)}let s=Jv({callback:o});return p_(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}(oe),ce=py(c,{transform:{x:y.x-re.x,y:y.y-re.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:B,containerNodeRect:V,draggingNodeRect:G,over:H.current.over,overlayNodeRect:W.rect,scrollableAncestors:oe,scrollableAncestorRects:se,windowRect:ae}),K=R?S_(R,y):null,le=function(e){let[t,n]=(0,X.useState)(null),r=(0,X.useRef)(e),i=(0,X.useCallback)(e=>{let t=cv(e.target);t&&n(e=>e?(e.set(t,dv(t)),new Map(e)):null)},[]);return(0,X.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=cv(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,dv(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{cv(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,X.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>S_(e,t),B_):_v(e):B_,[e,t])}(oe),ue=Qv(le),de=Qv(le,[B]),fe=S_(ce,ue),pe=G?ev(G,ce):null,me=C&&pe?o({active:C,collisionRect:pe,droppableRects:P,droppableContainers:j,pointerCoordinates:K}):null,he=K_(me,`id`),[ge,_e]=(0,X.useState)(null),ve=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ne?ce:S_(ce,de),ge?.rect??null,B),ye=(0,X.useRef)(null),be=(0,X.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:H,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,ir.unstable_batchedUpdates)(()=>{r?.(i),h(my.Initializing),d({type:N_.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ye.current),O(a)})},onMove(e){d({type:N_.DragMove,coordinates:e})},onEnd:s(N_.DragEnd),onCancel:s(N_.DragCancel)});function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=H.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===N_.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=N_.DragCancel)}w.current=null,(0,ir.unstable_batchedUpdates)(()=>{d({type:e}),h(my.Uninitialized),_e(null),E(null),O(null),ye.current=null;let t=e===N_.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}ye.current=o},[v]),xe=function(e,t){return(0,X.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(a,(0,X.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};!0===e(n,t.options,o)&&(i.dndKit={capturedBy:t.sensor},w.current=r,be(n,t))},[v,be]));(function(e){(0,X.useEffect)(()=>{if(!a_)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))})(a),p_(()=>{B&&m===my.Initializing&&h(my.Initialized)},[B,m]),(0,X.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=H.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:fe.x,y:fe.y},over:i};(0,ir.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[fe.x,fe.y]),(0,X.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=H.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(he),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,ir.unstable_batchedUpdates)(()=>{_e(s),a?.(c),f({type:`onDragOver`,event:c})})},[he]),p_(()=>{H.current={activatorEvent:D,active:C,activeNode:L,collisionRect:pe,collisions:me,droppableRects:P,draggableNodes:v,draggingNode:te,draggingNodeRect:G,droppableContainers:b,over:ge,scrollableAncestors:oe,scrollAdjustedTranslate:fe},S.current={initial:G,translated:pe}},[C,L,me,pe,v,te,G,P,b,ge,oe,fe]),Hv({...ee,delta:y,draggingRect:pe,pointerCoordinates:K,scrollableAncestors:oe,scrollableAncestorRects:se});let Se=(0,X.useMemo)(()=>({active:C,activeNode:L,activeNodeRect:B,activatorEvent:D,collisions:me,containerNodeRect:V,dragOverlay:W,draggableNodes:v,droppableContainers:b,droppableRects:P,over:ge,measureDroppableContainers:F,scrollableAncestors:oe,scrollableAncestorRects:se,measuringConfiguration:M,measuringScheduled:I,windowRect:ae}),[C,L,B,D,me,V,W,v,b,P,ge,F,oe,se,M,I,ae]),Ce=(0,X.useMemo)(()=>({activatorEvent:D,activators:xe,active:C,activeNodeRect:B,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:ge,measureDroppableContainers:F}),[D,xe,C,B,d,A,v,ge,F]);return X.createElement(M_.Provider,{value:p},X.createElement(cy.Provider,{value:Ce},X.createElement(ly.Provider,{value:Se},X.createElement(hy.Provider,{value:ve},i)),X.createElement(fy,{disabled:!1===n?.restoreFocus})),X.createElement(I_,{...n,hiddenTextDescribedById:A}))}),_y=(0,X.createContext)(null),vy=`button`;function yy(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=b_(`Draggable`),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,X.useContext)(cy),{role:p=vy,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,X.useContext)(g?hy:_y),[v,y]=__(),[b,x]=__(),S=function(e,t){return(0,X.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}(o,t),C=h_(n);return p_(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,X.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!g||p!==vy)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function by(){return(0,X.useContext)(ly)}var xy={timeout:25};function Sy(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=b_(`Droppable`),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,X.useContext)(cy),u=(0,X.useRef)({disabled:n}),d=(0,X.useRef)(!1),f=(0,X.useRef)(null),p=(0,X.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...xy,...i},_=h_(h??r),v=Jv({callback:(0,X.useCallback)(()=>{d.current?(p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)):d.current=!0},[g]),disabled:m||!o}),[y,b]=__((0,X.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=h_(t);return(0,X.useEffect)(()=>{v&&y.current&&(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,X.useEffect)(()=>(s({type:N_.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:N_.UnregisterDroppable,key:a,id:r})),[r]),(0,X.useEffect)(()=>{n!==u.current.disabled&&(s({type:N_.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Cy(e){let{animation:t,children:n}=e,[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(null),s=v_(n);return n||r||!s||i(s),p_(()=>{if(!a)return;let e=r?.key,n=r?.props.id;e!=null&&n!=null?Promise.resolve(t(n,a)).then(()=>{i(null)}):i(null)},[t,r,a]),X.createElement(X.Fragment,null,n,r?(0,X.cloneElement)(r,{ref:o}):null)}var wy={x:0,y:0,scaleX:1,scaleY:1};function Ty(e){let{children:t}=e;return X.createElement(cy.Provider,{value:sy},X.createElement(hy.Provider,{value:wy},t))}var Ey={position:`fixed`,touchAction:`none`},Dy=e=>w_(e)?`transform 250ms ease`:void 0,Oy=(0,X.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Dy}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Ey,width:s.width,height:s.height,top:s.top,left:s.left,transform:E_.Transform.toString(d),transformOrigin:i&&r?H_(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return X.createElement(n,{className:o,style:f,ref:t},a)}),ky=e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}},Ay={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:E_.Transform.toString(t)},{transform:E_.Transform.toString(n)}]},sideEffects:ky({styles:{active:{opacity:`0`}}})};function jy(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return m_((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=ty(a);if(!c)return;let{transform:l}=c_(a).getComputedStyle(a),u=tv(l);if(!u)return;let d=typeof t==`function`?t:function(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Ay,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}(t);return vv(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}var My=0;function Ny(e){return(0,X.useMemo)(()=>{if(e!=null)return++My},[e])}var Py=X.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=by(),S=(0,X.useContext)(hy),C=Ny(d?.id),w=py(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=qv(f),E=jy({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return X.createElement(Ty,null,X.createElement(Cy,{animation:E},d&&C?X.createElement(Oy,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))});function Fy(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Iy(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Ly(e){return e!==null&&e>=0}var Ry={scaleX:1,scaleY:1},zy=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=function(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r&&(i||a)?n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width):0}(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...Ry}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...Ry}:a<r&&a>=i?{x:o.width+s,y:0,...Ry}:{x:0,y:0,...Ry}},By=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Fy(t,r,n),o=t[i],s=a[i];return s&&o?{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}:null},Vy={scaleX:1,scaleY:1},Hy=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...Vy}:null}let s=function(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Vy}:r<t&&r>=a?{x:0,y:o.height+s,...Vy}:{x:0,y:0,...Vy}},Uy=`Sortable`,Wy=X.createContext({activeIndex:-1,containerId:Uy,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:By,disabled:{draggable:!1,droppable:!1}});function Gy(e){let{children:t,id:n,items:r,strategy:i=By,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=by(),d=b_(Uy,n),f=s.rect!==null,p=(0,X.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,X.useRef)(p),v=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(p,_.current),y=g!==-1&&h===-1||v,b=function(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}(a);p_(()=>{v&&m&&u(p)},[v,p,m,u]),(0,X.useEffect)(()=>{_.current=p},[p]);let x=(0,X.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Iy(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return X.createElement(Wy.Provider,{value:x},t)}var Ky=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Fy(n,r,i).indexOf(t)},qy=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!(!l||!r)&&(s===a||i!==o)&&(!!n||o!==i&&t===c)},Jy={duration:200,easing:`ease`},Yy=`transform`,Xy=E_.Transition.toString({property:Yy,duration:0,easing:`linear`}),Zy={roleDescription:`sortable`};function Qy(e){let{animateLayoutChanges:t=qy,attributes:n,disabled:r,data:i,getNewIndex:a=Ky,id:o,strategy:s,resizeObserverConfig:c,transition:l=Jy}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,X.useContext)(Wy),y=function(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}(r,p),b=u.indexOf(o),x=(0,X.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,X.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=Sy({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:P,setActivatorNodeRef:F,transform:I}=yy({id:o,data:x,attributes:{...Zy,...n},disabled:y.draggable}),L=function(){var e=[...arguments];return(0,X.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}(E,j),R=!!D,ee=R&&!m&&Ly(f)&&Ly(g),z=!_&&N,B=ee?(z&&ee?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,V=Ly(f)&&Ly(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,H=D?.id,U=(0,X.useRef)({activeId:H,items:u,newIndex:V,containerId:d}),W=u!==U.current.items,te=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:l,wasDragging:U.current.activeId!=null}),G=function(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,X.useState)(null),s=(0,X.useRef)(n);return p_(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=iv(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,X.useEffect)(()=>{a&&o(null)},[a]),a}({disabled:!te,index:b,node:w,rect:C});return(0,X.useEffect)(()=>{R&&U.current.newIndex!==V&&(U.current.newIndex=V),d!==U.current.containerId&&(U.current.containerId=d),u!==U.current.items&&(U.current.items=u)},[R,V,d,u]),(0,X.useEffect)(()=>{if(H===U.current.activeId)return;if(H!=null&&U.current.activeId==null)return void(U.current.activeId=H);let e=setTimeout(()=>{U.current.activeId=H},50);return()=>clearTimeout(e)},[H]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:V,items:u,isOver:T,isSorting:R,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:L,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:G??B,transition:function(){if(G||W&&U.current.newIndex===b)return Xy;if(!(z&&!w_(O)||!l)&&(R||te))return E_.Transition.toString({...l,property:Yy})}()}}function $y(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var eb=[bv.Down,bv.Right,bv.Up,bv.Left],tb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(eb.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case bv.Down:r.top<a.top&&t.push(n);break;case bv.Up:r.top>a.top&&t.push(n);break;case bv.Left:r.left>a.left&&t.push(n);break;case bv.Right:r.left<a.left&&t.push(n)}});let u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=G_(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=G_(r),o=i.reduce((e,t,r)=>e+V_(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(U_)})({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),d=K_(u,`id`);if(d===o?.id&&u.length>1&&(d=u[1].id),d!=null){let e=a.get(n.id),t=a.get(d),o=t?i.get(t.id):null,u=t?.node.current;if(u&&o&&e&&t){let n=ov(u).some((e,t)=>s[t]!==e),i=nb(e,t),a=(l=t,!(!$y(c=e)||!$y(l))&&!!nb(c,l)&&c.data.current.sortable.index<l.data.current.sortable.index),d=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},f={x:o.left,y:o.top};return d.x&&d.y?f:C_(f,d)}}}var c,l};function nb(e,t){return!(!$y(e)||!$y(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var rb=(0,X.createContext)(null),ib=()=>{let e=(0,X.useContext)(rb);if(!e)throw Error(`PivotFieldList and PivotAreas must be inside a PivotDragContext.`);return e},ab=`pivot-root`,ob=e=>`pivot-area|${e}`,sb=(e,t)=>`pivot-chip|${e}|${t.kind}|${t.name}`,cb=e=>`pivot-row|${e}`,lb={number:S(`pivot.type.number`),date:S(`pivot.type.date`),text:S(`pivot.type.text`),mixed:S(`pivot.type.mixed`),blank:S(`pivot.type.blank`)},ub={number:`DataTypeNumber`,date:`DataTypeDate`,text:`DataTypeText`,mixed:`DataTypeMixed`,blank:`DataTypeBlank`},db=e=>{let{className:t,...n}=e,{snapshot:r}=ib(),i=z(),[a,o]=(0,X.useState)(``),{setNodeRef:s}=Sy({id:`pivot-list`,data:{list:!0}}),c=a.trim().toLocaleLowerCase(),l=c?r.fields.filter(e=>e.name.toLocaleLowerCase().includes(c)):r.fields;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`input`,{type:`search`,className:Ul,placeholder:i(`pivot.fields.search`),"aria-label":i(`pivot.fields.search`),value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(`div`,{ref:s,role:`group`,"aria-label":i(`pivot.fields.list`),className:Q(`sxl-pivot-field-list`,t,Wl),...n,children:[l.map(e=>(0,Z.jsx)(fb,{field:e},e.name)),l.length===0&&c?(0,Z.jsx)(`div`,{className:Yl,children:i(`pivot.fields.none`)}):null]})]})},fb=e=>{let{field:t}=e,{model:n,run:r}=ib(),i=z(),a={item:{kind:`field`,name:t.name},area:null},{setNodeRef:o,listeners:s,isDragging:c}=yy({id:cb(t.name),data:a});return(0,Z.jsxs)(`label`,{ref:o,className:Q(Gl,{dragging:c}),onPointerDown:s?.onPointerDown,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:t.ticked,onChange:()=>r(t.ticked?n.untick(t.name):n.tick(t.name))}),(0,Z.jsx)(`span`,{className:Kl,title:t.name,children:t.name}),t.filtered?(0,Z.jsx)(j,{iconKey:`FilterToggle`,size:12,className:Jl,title:i(`pivot.chip.filtered`)}):null,(0,Z.jsx)(j,{iconKey:ub[t.dataType],size:12,className:ql,title:i(lb[t.dataType])})]})},pb=e=>{let{chip:t,area:n,overlay:r,dragging:i,propsCaption:a,menuButton:o,renaming:s,onRename:c,className:l,ref:u,...d}=e,f=z(),p;t.kind===`values`&&(p=f(n===`row`?`pivot.chip.valuesAsRows`:`pivot.chip.valuesAsColumns`));let m=t.kind===`field`&&t.filtered,{ref:h,className:g,..._}=a??{};return(0,Z.jsxs)(`div`,{ref:u,title:p,className:Q(`sxl-pivot-chip`,l,tu,{overlay:r,dragging:i}),...d,children:[s?(0,Z.jsx)(mb,{name:t.name,label:f(`pivot.chip.rename`),onDone:e=>c?.(e)}):(0,Z.jsx)(`div`,{ref:h,className:Q(nu,g),..._,children:t.name}),m?(0,Z.jsx)(j,{iconKey:`FilterToggle`,size:12,className:Jl,title:f(`pivot.chip.filtered`)}):null,o]})},mb=e=>{let{name:t,label:n,onDone:r}=e,i=(0,X.useRef)(!1),a=e=>{if(i.current)return;i.current=!0;let n=e?.trim();r(n&&n!==t?n:null)};return(0,Z.jsx)(`input`,{className:ru,defaultValue:t,"aria-label":n,autoFocus:!0,onFocus:e=>e.currentTarget.select(),onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),a(e.currentTarget.value)):e.key===`Escape`&&(e.preventDefault(),a(null))},onBlur:e=>a(e.currentTarget.value)})},hb=`pivotValueSettings`,gb=[`page`,`row`,`column`,`values`],_b={page:S(`pivot.menu.moveTo.page`),row:S(`pivot.menu.moveTo.row`),column:S(`pivot.menu.moveTo.column`),values:S(`pivot.menu.moveTo.values`)},vb={sum:S(`pivot.function.sum`),count:S(`pivot.function.count`),average:S(`pivot.function.average`),max:S(`pivot.function.max`),min:S(`pivot.function.min`),product:S(`pivot.function.product`),countNums:S(`pivot.function.countNums`),stdDev:S(`pivot.function.stdDev`),stdDevp:S(`pivot.function.stdDevp`),var:S(`pivot.function.var`),varp:S(`pivot.function.varp`)},yb=[`sum`,`count`,`average`,`max`,`min`,`product`],bb=(e,t)=>{let{chip:n,area:r,index:i,count:a}=e,{model:o,run:s,t:c,close:l,focus:u,openValueSettings:d,openFilter:f}=t,p=(e,t,n,r)=>({key:e,label:t,...r,run:()=>{l(),n()}}),m=(e,t)=>{n.kind===`data`&&e!==`values`||u(sb(e,n)),s(o.place(n,e,t))},h=[];if(n.kind===`data`){let e=yb.includes(n.function)?yb:[...yb,n.function];h.push(e.map(e=>p(`function.${e}`,c(vb[e]),()=>{e!==n.function&&s(o.setFunction(n.name,e))},{checked:e===n.function})))}let g=i===0,_=i>=a-1;h.push([p(`moveUp`,c(`pivot.menu.moveUp`),()=>m(r,i-1),{disabled:g}),p(`moveDown`,c(`pivot.menu.moveDown`),()=>m(r,i+1),{disabled:_}),p(`moveToStart`,c(`pivot.menu.moveToStart`),()=>m(r,0),{disabled:g}),p(`moveToEnd`,c(`pivot.menu.moveToEnd`),()=>m(r,a-1),{disabled:_})]);let v=gb.filter(e=>e!==r&&(n.kind!==`values`||e===`row`||e===`column`));if(h.push(v.map(e=>p(`moveTo.${e}`,c(_b[e]),()=>m(e)))),n.kind===`field`&&f){let e=c(r===`page`?`pivot.menu.filter`:`pivot.menu.sortAndFilter`);h.push([p(`filter`,e,()=>f(n.name))])}return n.kind!==`values`&&h.push([p(`remove`,c(`pivot.menu.remove`),()=>s(o.remove(n)))]),n.kind===`data`&&h.push([p(`valueSettings`,c(`pivot.menu.valueSettings`),()=>d(n.name))]),h},xb=e=>(0,Z.jsx)(`div`,{role:`menu`,className:au,children:e.groups.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(`div`,{role:`separator`,className:cu}):null,e.map(e=>(0,Z.jsxs)(`button`,{type:`button`,role:e.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":e.checked,disabled:e.disabled,className:ou,onClick:e.run,children:[(0,Z.jsx)(`span`,{className:su,children:e.checked?(0,Z.jsx)(j,{iconKey:`Check`,size:14}):null}),e.label]},e.key))]},t))}),Sb=e=>(0,Z.jsx)(xb,{...e}),Cb={placement:`bottom-end`,offsets:{mainAxis:2}},wb=[`page`,`column`,`row`,`values`],Tb={page:S(`pivot.area.page`),column:S(`pivot.area.column`),row:S(`pivot.area.row`),values:S(`pivot.area.values`)},Eb=e=>{let{className:t,...n}=e,{snapshot:r}=ib(),i=(0,X.useRef)(null),a=(0,X.useRef)(null);return(0,X.useLayoutEffect)(()=>{let e=a.current;if(!e)return;a.current=null;let t=i.current?.querySelectorAll(`[data-chip-id]`)??[],n=Array.from(t).find(t=>t.dataset.chipId===e);n&&n!==document.activeElement&&n.focus()},[r]),(0,Z.jsx)(`div`,{ref:i,className:Q(`sxl-pivot-areas`,t,Xl),...n,children:wb.map(e=>(0,Z.jsx)(Db,{area:e,chips:r.areas[e],refocus:e=>{a.current=e}},e))})},Db=e=>{let{area:t,chips:n,refocus:r}=e,i=z(),{setNodeRef:a,isOver:o}=Sy({id:ob(t),data:{area:t}}),s=n.map(e=>sb(t,e)),c=i(Tb[t]);return(0,Z.jsxs)(`div`,{className:Zl,children:[(0,Z.jsx)(`div`,{className:Ql,children:c}),(0,Z.jsx)(Gy,{id:ob(t),items:s,strategy:Hy,children:(0,Z.jsxs)(`div`,{ref:a,role:`list`,"aria-label":c,className:Q($l,{over:o}),children:[n.map((e,i)=>(0,Z.jsx)(Ob,{id:s[i],area:t,chip:e,index:i,count:n.length,refocus:r},s[i])),n.length===0?(0,Z.jsx)(`span`,{className:eu,children:i(`pivot.area.hint`)}):null]})})]})},Ob=e=>{let{id:t,area:n,chip:r,index:i,count:a,refocus:o}=e,{model:s,run:c,renderMenu:l,renderFilter:u}=ib(),{attributes:d,listeners:f,setNodeRef:p,setActivatorNodeRef:m,transform:h,transition:g,isDragging:_}=Qy({id:t,data:{item:r,area:n,index:i}}),v=(e=>{let{place:t,model:n,run:r,renderMenu:i,renderFilter:a,focus:o}=e,s=z(),c=Se(),l=G(e=>{let t=n.getPivotTable().getDataField(e);if(!t)return;let i={initialValue:{value:t},onInput:t=>{t?.changes&&r(n.applyValueSettings(e,t.changes))}};c.showWindow?.(hb,i)},[n,r,c]),u=i===void 0?Sb:i,[d,f]=(0,X.useState)(null),p=G(e=>{let t=d?n.getPivotTable().getField(d):null;if(!a||!t)return null;let r={fields:[t],floatReference:e.floatReference??y.reference};return Le({...e,children:(0,Z.jsx)(xe,{render:a,props:r})})},[d,n,a]),m=G(e=>{f(e),y.reference.open(0)},[]),h=G(e=>{let i={chip:t.chip,area:t.area,groups:bb(t,{model:n,run:r,t:s,close:()=>{e.closeFloat?.()},focus:o,openValueSettings:l,openFilter:a?m:null}),floatReference:e.floatReference??v.reference};return Le({...e,children:(0,Z.jsx)(xe,{render:u,props:i})})},[t,n,r,u,s,o,l,m,a]),[g,_]=(0,X.useState)(null),v=pe({label:`pivot-chip-menu`,anchor:g,propsPopper:Cb,renderPopupPanel:h}),y=pe({label:`pivot-chip-filter`,anchor:g,propsPopper:Cb,renderPopupPanel:p});return u?{button:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{ref:_,type:`button`,className:iu,"aria-label":s(`pivot.menu.button`),title:s(`pivot.menu.button`),"aria-haspopup":`menu`,"aria-expanded":v.isOpen,onClick:()=>{v.isOpen?v.reference.close(0):v.reference.open(0)},children:(0,Z.jsx)(j,{iconKey:`ExpandMore`,size:14})}),v.component,y.component]}),open:()=>v.reference.open(0)}:{button:null,open:()=>{}}})({place:{chip:r,area:n,index:i,count:a},model:s,run:c,renderMenu:l,renderFilter:u,focus:o}),[y,b]=(0,X.useState)(!1),x=(0,X.useRef)(null),S=(0,X.useCallback)(e=>{x.current=e,m(e)},[m]),C=(0,X.useRef)(!1);return(0,X.useLayoutEffect)(()=>{C.current&&!y&&x.current?.focus(),C.current=y},[y]),(0,Z.jsx)(pb,{ref:p,role:`listitem`,chip:r,area:n,dragging:_,style:{transform:E_.Translate.toString(h),transition:g},onContextMenu:e=>{v.button&&(e.preventDefault(),v.open())},propsCaption:{ref:S,"data-chip-id":t,...d,...f,onKeyDown:e=>{if(e.altKey&&(e.key===`ArrowUp`||e.key===`ArrowDown`)){e.preventDefault(),e.stopPropagation();let l=i+(e.key===`ArrowUp`?-1:1);if(l<0||l>=a)return;o(t),c(s.place(r,n,l));return}let l=!e.altKey&&!e.ctrlKey&&!e.metaKey;!l||e.key!==`Delete`&&e.key!==`Backspace`?l&&!e.shiftKey&&e.key===`F2`?(e.preventDefault(),e.stopPropagation(),b(!0)):e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`?(e.preventDefault(),e.stopPropagation(),v.open()):f?.onKeyDown?.(e):(e.preventDefault(),e.stopPropagation(),c(s.remove(r)))},onDoubleClick:()=>b(!0)},menuButton:v.button,renaming:y,onRename:e=>{b(!1),e!==null&&(o(sb(n,{...r,name:e})),c(s.rename(r,e)))}})},kb=e=>{let{fields:t,onError:n,renderMenu:r,renderFilter:i,children:a,...o}=e,{model:s,snapshot:c}=t,l=G(e=>{e.catch(e=>{n?n(e):console.error(e)})},[n]),u=(0,X.useMemo)(()=>({model:s,snapshot:c,run:l,renderMenu:r,renderFilter:i}),[s,c,l,r,i]),d=z_(R_(Pv,{activationConstraint:{distance:4}}),R_(kv,{coordinateGetter:tb})),[f,p]=(0,X.useState)(null),m=null;if(f){let e=f.item.kind!==`field`||`filtered`in f.item?f.item:{kind:`field`,name:f.item.name,filtered:!1};m=(0,Z.jsx)(pb,{chip:e,area:f.area??`row`,overlay:!0})}return(0,Z.jsx)(rb.Provider,{value:u,children:(0,Z.jsx)(gy,{sensors:d,collisionDetection:Mb,onDragStart:e=>{p(e.active.data.current??null)},onDragEnd:e=>{p(null);let t=e.active.data.current;if(!t)return;let n=e.over;if(!n)return void(t.area&&l(s.remove(t.item)));if(n.id===`pivot-root`)return;let r=n.data.current;if(!r||r.list)return void(t.area&&l(s.remove(t.item)));let i=r.area;if(!i)return;let a=r.index;if(a!==void 0&&t.area!==i){let t=e.active.rect.current.translated;t&&t.top+t.height/2>n.rect.top+n.rect.height/2&&a++}(t.area!==i||a!==void 0&&a!==t.index)&&l(s.place(t.item,i,a))},onDragCancel:()=>p(null),children:(0,Z.jsxs)(Ab,{...o,children:[a,(0,Z.jsx)(Py,{dropAnimation:null,children:m})]})})})},Ab=e=>{let{setNodeRef:t}=Sy({id:ab});return(0,Z.jsx)(`div`,{ref:t,...e})},jb=e=>e===`pivot-root`?2:e===`pivot-list`||String(e).startsWith(`pivot-area|`)?1:0,Mb=e=>e.pointerCoordinates?(e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let i=[];for(let e of t){let{id:t}=e,a=n.get(t);if(a&&Z_(r,a)){let n=G_(a).reduce((e,t)=>e+V_(r,t),0),o=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(U_)})(e).sort((e,t)=>jb(e.id)-jb(t.id)):J_({...e,droppableContainers:e.droppableContainers.filter(e=>e.id!==ab)}),Nb=e=>{let{className:t,...n}=e;return(0,Z.jsxs)(kb,{className:Q(`sxl-pivot-fields`,t,Hl),...n,children:[(0,Z.jsx)(db,{}),(0,Z.jsx)(Eb,{})]})},Pb=`pivotTableFields`,Fb=e=>{let{model:t,entryKey:n,args:r,renderMenu:i,renderFilter:a,renderHeader:o,frame:s,ref:c,className:u,...d}=e,f=l(),p=Se(),m=z(),[h,g]=(0,X.useState)(()=>r?.pivot??(f?zl(f):null));(0,X.useEffect)(()=>{r?.pivot&&g(r.pivot)},[r?.pivot]),(0,X.useEffect)(()=>{if(f)return f.getSelection().addListeners({onChange:()=>g(zl(f))})},[f]);let _=t_(h),v=e=>{p.showError?.(e instanceof Error?e:String(e))},y;return y=_?_.snapshot.deleted?(0,Z.jsx)(`div`,{className:du,children:m(`pivot.pane.deleted`)}):(0,Z.jsxs)(Z.Fragment,{children:[o&&h?o({pivot:h,name:_.snapshot.name,source:_.snapshot.source,onError:v}):(0,Z.jsx)(`div`,{className:uu,children:_.snapshot.name}),(0,Z.jsx)(Nb,{fields:_,renderMenu:i,renderFilter:a,onError:v})]}):(0,Z.jsx)(`div`,{className:du,children:m(`pivot.pane.empty`)}),(0,Z.jsx)(`div`,{ref:c,className:Q(`sxl-pivot-table-pane`,u,lu),...d,children:y})};function Ib(){yd.getRegisteredTaskPane(`pivotTableFields`)||yd.registerTaskPane({key:`pivotTableFields`,getTitle:()=>`PivotTable Fields`,getIcon:()=>`Table`,component:Fb})}var Lb=e=>{let t=0;for(let n of(e.getWorkbook()?.getPivotTables()??e.getPivotTables()).getItems()){let e=/^PivotTable(\d+)$/i.exec(n.getName())?.[1];e&&(t=Math.max(t,parseInt(e,10)))}return`PivotTable${t+1}`},Rb=(e,t)=>t?.at(0)?.getWorksheet()??e,zb=(e,t)=>e?[t]:[],Bb=new Set([`formatTextRotate0`,`formatTextRotate45`,`formatTextRotate90`,`formatTextRotate270`,`formatTextRotate315`,`formatTextRotateCustom`,`formatTextRotateVertical`]),Vb={autoSelect:!0,autoFit:{axes:Y.AxisSelection.Column,expandOnly:!0,skipCustomSize:!0}},Hb=new Set([`dataTextToColumns`,`sortAscending`,`sortDescending`,`sheetBackgroundDelete`]),Ub=new Set([`editNote`,`showHideNote`,`showAllNotes`,`deleteComments`,`updateComments`,`convertNotesToComments`]),Wb=new Set([`fillDown`,`fillRight`,`fillUp`,`fillLeft`,`fillSeries`,`clearContents`,`clearAll`,`insertImageInCellFromFile`,`insertImageInCellFromURL`]),Gb=`comments`;function Kb(e,t,n){let r=()=>t.getView();e.updateCommand(`gridlinesToggle`,{callback:()=>{let e=r().isShowColumnGridlines()&&r().isShowRowGridlines();r().update({showColumnGridlines:!e,showRowGridlines:!e})}}),e.updateCommand(`sheetViewToggleGridlinesRows`,{callback:()=>{r().setShowRowGridlines(!r().isShowRowGridlines())}}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{callback:()=>{r().setShowColumnGridlines(!r().isShowColumnGridlines())}}),e.updateCommand(`sheetViewFormatGridlinesColor`,{callback:e=>{r().setGridLineColor(e)},context:()=>({...Jb(t),autoColor:null,onColorSelect:()=>{}})}),e.updateCommand(`sheetViewToggleShowHeadings`,{callback:()=>{let e=r().isShowColumnHeaders()&&r().isShowRowHeaders();r().update({showColumnHeaders:!e,showRowHeaders:!e})}}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{callback:()=>{r().setShowColumnHeaders(!r().isShowColumnHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{callback:()=>{r().setShowRowHeaders(!r().isShowRowHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{callback:()=>{let e=r(),t=e.getColumnHeaderStyle()===Jn.HeaderTextStyle.Zero&&e.getRowHeaderStyle()===Jn.HeaderTextStyle.Zero;e.update({columnHeaderStyle:t?Jn.HeaderTextStyle.A1:Jn.HeaderTextStyle.Zero,rowHeaderStyle:t?Jn.HeaderTextStyle.One:Jn.HeaderTextStyle.Zero})}}),e.updateCommand(`sheetViewToggleFormulaView`,{callback:()=>{r().setShowFormulas(!r().isShowFormulas())}}),e.updateCommand(`sheetViewToggleShowZeros`,{callback:()=>{r().setShowZeros(!r().isShowZeros())}}),e.updateCommand(`displayOutlineSymbolsToggle`,{callback:()=>{r().setShowOutlineSymbols(!r().isShowOutlineSymbols())}}),e.updateCommand(`protectionHighlight`,{callback:()=>{r().setShowLockedShading(!r().isShowLockedShading())}}),e.updateCommand(`dataValidationShowInvalid`,{callback:()=>{r().setShowInvalid(!r().isShowInvalid())}}),e.updateCommand(`calculate`,{callback:()=>{t.calculate()}}),e.updateCommand(`sheetZoomOut`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomOut()}}),e.updateCommand(`sheetZoomIn`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomIn()}}),e.updateCommand(`sheetZoom100`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(100)}}),e.updateCommand(`sheetZoom200`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(200)}}),e.updateCommand(`sheetZoom75`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(75)}}),e.updateCommand(`sheetZoom50`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(50)}}),e.updateCommand(`sheetZoom25`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(25)}}),e.updateCommand(`sheetZoomCustom`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{r().setZoomScale(e??100)}}),e.updateCommand(`sheetZoomSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n?.getClient();if(!e||e.width<=0||e.height<=0)return;let i=r(),a=t.getSelection().getCoords(),o=a.ranges?.[0]??C.cellToRange(a.cell),s=t.getColumnHeaders(),c=t.getRowHeaders(),l=s.getMetrics().getOffset(o.colStart),u=c.getMetrics().getOffset(o.rowStart),d=s.getMetrics().getOffset(o.colEnd+1)-l,f=c.getMetrics().getOffset(o.rowEnd+1)-u,p=i.getFreezePanes().coords,m=p?.colIndex?s.getMetrics().getOffset(p.colIndex):0,h=p?.rowIndex?c.getMetrics().getOffset(p.rowIndex):0,g=l>=m,_=u>=h,v=d>0?d+(g?m:0):0,y=f>0?f+(_?h:0):0,b=Math.min(v>0?e.width/v:1/0,y>0?e.height/y:1/0);if(!isFinite(b))return;let x=Math.min(400,Math.max(10,Math.floor(100*b)));i.setTopLeft({left:g?l-m:0,top:_?u-h:0}),i.setZoomScale(x)}});let i=()=>(r().getFreezePanes().coords?.rowIndex??0)!==0,a=()=>(r().getFreezePanes().coords?.colIndex??0)!==0;e.updateCommand(`freezeToggle`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();i()||a()?r().setFreezePanes(null):r().setFreezePanes({coords:e})}}),e.updateCommand(`freezeToggleHorizontal`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();ug(r(),Y.Axis.Row,i()?0:e.rowIndex)}}),e.updateCommand(`freezeToggleVertical`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();ug(r(),Y.Axis.Column,a()?0:e.colIndex)}}),e.updateCommand(`unfreeze`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setFreezePanes(null)}}),e.updateCommand(`freezePanesAt`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{e&&ug(r(),e.axis,e.index)}});let o=()=>{let n=r(),o=n.getColumnHeaderStyle()===Jn.HeaderTextStyle.Zero&&n.getRowHeaderStyle()===Jn.HeaderTextStyle.Zero;e.updateCommand(`gridlinesToggle`,{state:n.isShowColumnGridlines()||n.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{state:n.isShowColumnGridlines()}),e.updateCommand(`sheetViewToggleGridlinesRows`,{state:n.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleShowHeadings`,{state:n.isShowColumnHeaders()||n.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{state:n.isShowColumnHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{state:n.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{state:o}),e.updateCommand(`sheetViewToggleFormulaView`,{state:n.isShowFormulas()}),e.updateCommand(`sheetViewToggleShowZeros`,{state:n.isShowZeros()}),e.updateCommand(`displayOutlineSymbolsToggle`,{state:n.isShowOutlineSymbols()}),e.updateCommand(`protectionHighlight`,{state:n.isShowLockedShading()}),e.updateCommand(`dataValidationShowInvalid`,{state:n.isShowInvalid()}),e.updateCommand(`sheetViewFormatGridlinesColor`,{state:n.getGridLineColor()});let s=n.getZoomScale();e.updateCommand(`sheetZoom200`,{state:s===200}),e.updateCommand(`sheetZoom100`,{state:s===100}),e.updateCommand(`sheetZoom75`,{state:s===75}),e.updateCommand(`sheetZoom50`,{state:s===50}),e.updateCommand(`sheetZoom25`,{state:s===25}),e.updateCommand(`sheetZoomCustom`,{state:s});let c=t.getSelectedCell().getCoords();if(!c)return;let l=i(),u=a(),d=l||u;e.updateCommand(`freezeToggle`,{state:d,disabledReasons:d||c.rowIndex!==0||c.colIndex!==0?[]:[S(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleHorizontal`,{state:l,disabledReasons:l||c.rowIndex!==0?[]:[S(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleVertical`,{state:u,disabledReasons:u||c.colIndex!==0?[]:[S(`reason.freezeOrigin`)]}),e.updateCommand(`unfreeze`,{disabledReasons:d?[]:[S(`reason.noFreeze`)]})};o();let s={onFreezePaneChange:o,onZoomScaleChange:o,onHeaderChange:o},c=r().addListeners(s,{transactional:!1}),l=t.addListeners({onViewChange:()=>{c(),c=r().addListeners(s,{transactional:!1}),o()}}),u=t.getSelection().addListeners({onChange:o});return()=>{c(),l(),u()}}var qb=new fn(`transparent`);function Jb(e){let t=e.getStyles();return{schemeLookup:t.schemeLookup(),recentColors:()=>t.recentColors(),addRecentColor:e=>t.addRecentColor(e),clearRecentColors:()=>t.clearRecentColors()}}function Yb(e,t,n){let r=()=>t.getSelectedRanges();e.updateCommand(`hideRows`,{callback:()=>{r().getRowHeaders().setHidden(!0)}}),e.updateCommand(`hideColumns`,{callback:()=>{r().getColumnHeaders().setHidden(!0)}}),e.updateCommand(`unhideRows`,{callback:()=>{r().getRowHeaders().setHidden(!1)}}),e.updateCommand(`unhideColumns`,{callback:()=>{r().getColumnHeaders().setHidden(!1)}}),e.updateCommand(`autoFitRows`,{callback:()=>{r().autoFit({axes:Y.AxisSelection.Row})}}),e.updateCommand(`autoFitColumns`,{callback:()=>{r().autoFit({axes:Y.AxisSelection.Column})}});let i=(e,t)=>{let i=r();if(i.getCount()>1){let t=A(e?`error.ungroup.multipleRanges`:`error.group.multipleRanges`);n?.showError(new O(t))}else e?i.at(0).ungroup(t):i.at(0).group(t)};e.updateCommand(`group`,{callback:()=>i(!1)}),e.updateCommand(`groupRows`,{callback:()=>i(!1,Y.Axis.Row)}),e.updateCommand(`groupColumns`,{callback:()=>i(!1,Y.Axis.Column)}),e.updateCommand(`ungroup`,{callback:()=>i(!0)}),e.updateCommand(`ungroupRows`,{callback:()=>i(!0,Y.Axis.Row)}),e.updateCommand(`ungroupColumns`,{callback:()=>i(!0,Y.Axis.Column)});let a=e=>{let n=r().at(0),i=(()=>{let e=r();if(e.isEntireColumns())return[Y.Axis.Column];if(e.isEntireRows())return[Y.Axis.Row];let n=t.getOutline(),i=e.at(0).getCoords(),a=[];for(let e of[Y.Axis.Row,Y.Axis.Column]){let t=e===Y.Axis.Column?i.colStart:i.rowStart,r=e===Y.Axis.Column?i.colEnd:i.rowEnd;n.getGroups(e,{from:t,to:r}).length>0&&a.push(e)}return a})();for(let t=0;t<i.length;t++)e?n.showGroupDetails(i[t]):n.hideGroupDetails(i[t])};e.updateCommand(`showDetail`,{callback:()=>a(!0)}),e.updateCommand(`hideDetail`,{callback:()=>a(!1)}),e.updateCommand(`outlineToggleGroup`,{callback:e=>{if(!e)return;let n=t.getRange(e.axis===Y.Axis.Column?{colStart:e.index,colEnd:e.index,rowStart:0,rowEnd:0}:{rowStart:e.index,rowEnd:e.index,colStart:0,colEnd:0});e.show?n.showGroupDetails(e.axis):n.hideGroupDetails(e.axis)}}),e.updateCommand(`outlineShowLevel`,{callback:e=>{e&&t.getOutline().setVisibleLevels(e.axis,e.level)}}),e.updateCommand(`clearOutline`,{callback:()=>{let e=r();for(let t=0;t<e.getCount();t++)e.at(t).clearGroups()}}),e.updateCommand(`autoOutline`,{callback:()=>{t.getOutline().autoOutline()}}),e.updateCommand(`outlineSettings`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getOutline(),r={initialValue:{summaryBelow:e.getSummaryDirection(Y.Axis.Row)===Y.Direction.Down,summaryRight:e.getSummaryDirection(Y.Axis.Column)===Y.Direction.Right,automaticStyles:e.isAutomaticStyles()},onInput:n=>{n&&t.doBatch(()=>{e.setSummaryDirection(Y.Axis.Row,n.summaryBelow?Y.Direction.Down:Y.Direction.Up),e.setSummaryDirection(Y.Axis.Column,n.summaryRight?Y.Direction.Right:Y.Direction.Left),e.setAutomaticStyles(n.automaticStyles)},{description:S(`op.updateOutline`)})}};n?.showWindow(`outlineSettings`,r)}});let o=(e,i)=>{let a=e===Y.Axis.Row,o=S(a?`op.resizeRows`:`op.resizeColumns`),s={initialValue:{size:i,unit:`Px`},context:()=>({getAxis:()=>e,getUnitText:()=>`Pt`}),onInput:(e,n)=>{if(n===`Autofit`)return void t.doBatch(()=>r().autoFit({axes:a?Y.AxisSelection.Row:Y.AxisSelection.Column}),{description:S(`op.autofit`),autoSelect:!0});if(!e)return;let i=a?r().getRowHeaders():r().getColumnHeaders();t.doBatch(()=>i.setSize(e.size+e.unit),{description:o,autoSelect:!0})}};n?.showWindow(`resizeHeader`,s)};return e.updateCommand(`resizeRows`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(Y.Axis.Row,20)}),e.updateCommand(`resizeColumns`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(Y.Axis.Column,100)}),()=>{}}function Xb(e,t,n){e.updateCommand(`dataRemoveDuplicates`,{callback:async e=>{let r=t.getSelectedRanges();r.getCount()>1?n?.showError(new O(A(`error.removeDuplicates.multipleRanges`))):r.at(0).removeDuplicates({autoSelect:!0,...e})}}),e.updateCommand(`dataTextToColumns`,{callback:async e=>{let r=t.getSelectedRanges();if(r.getCount()>1)return void n?.showError(new O(A(`error.textToColumns.multipleRanges`)));let i=typeof e==`string`?{delimiter:e}:e;r.at(0).textToColumns({autoSelect:!0,...i})}});let r=async(e,r,i,a)=>{let o=r,s=t.getSelectedRange(),c=t.getSelectedCell(),l=c.getCoords(),u,d=null;if(o){let e=o.getRange().getCoords();d=t.getTables().getItems({address:{colIndex:e.colStart,rowIndex:e.rowStart}})[0]??t.getAutoTable(),d&&!d.getRange().getIntersect(e)&&(d=null)}else if(d=t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??t.getAutoTable(),d){let e=d.getRange();e.getIntersect(l)?o=d.getSortAt(l.colIndex-e.getCoords().colStart):d=null}if(o){let e=o,t=d;u=n=>{if(i&&t)return void t.sort({...n,description:a});let r={...n};delete r.sorts,e.setCriteria(r)},c=e.getRange().getCell(),s=t?t.getRange():e.getRange()}else{let n=t.getSelectedRanges();if(n.getCount()>1)throw new O(A(`error.sort.multipleRanges`));let r=n.at(0);r.size===1&&(r=r.getSurrounding({contentOnly:!0})),s=r,u=t=>{r.doBatch(()=>{let n={...t,...e};r.sort(n),r.autoFit({axes:n?.axis===Y.Axis.Column?Y.AxisSelection.Column:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},a)}}let f=async e=>{if(!e)return;let t=await Promise.resolve(n?.showBusy?.(A(a))??null);try{u(e)}catch(e){t?.(),n?.showError?.(e);return}t?.()},p=s.getDefaultSortCriteria(Y.Axis.Row,c);if(!p){if(i)throw new O(A(`error.sort.invalidSelection`));return}if(!i)return void await f({...p.options,...e});let m=s,h=p.options;h.hasHeader&&(m=s.getIntersect(p.sortCoords)),m.select();let g={range:s,cell:c},_={initialValue:h,context:()=>g,onInput:e=>{e&&f(e)}};n?.showWindow?.(`sort`,_)};return e.updateCommand(`sortAscending`,{tags:[`noTransaction`],callback:e=>r({reverse:!1},e,!1,S(`op.sortAscending`))}),e.updateCommand(`sortDescending`,{tags:[`noTransaction`],callback:e=>r({reverse:!0},e,!1,S(`op.sortDescending`))}),e.updateCommand(`sortCustom`,{tags:[`noTransaction`],callback:e=>r({},e,!0,S(`op.sortCustom`))}),()=>{}}function Zb(e,t,n,r){e.updateCommand(`editNote`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getSelectedCell(),n=e.getComments();if(n&&!n.isNote())return;n||=t.getComments().add(e,``,{asNote:!0});let r=n.getMovable();r&&(await r.select({autoFocus:!1}),rn(r))}}),e.updateCommand(`showHideNote`,{callback:()=>{let e=t.getSelectedCell().getComments(),n=e?.isNote()?e.getMovable():null;n&&n.setHidden(!n.isHidden())}}),e.updateCommand(`showAllNotes`,{callback:()=>{let e=[],n=t.getComments().getItems({notes:!0});for(let t=0;t<n.length;t++){let r=n[t].getMovable();r&&e.push(r)}let r=e.every(e=>!e.isHidden());for(let t=0;t<e.length;t++)e[t].setHidden(r)}});let i=()=>r?.getActive()===Gb;e.updateCommand(`updateComments`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell(),r=e.getComments();if(r?.isNote())return;if(i()||!xm(t))return void n?.(Gb,{args:r?{focus:r}:{insert:!0}});let a=e.getCoords();a&&vm(t,a)}});let a=async e=>{let n=t.getComments().getItems({notes:!1}).sort(Jg);if(n.length===0)return;let r=t.getSelectedCell().getCoords(),a=null;for(let t=0;r&&t<n.length;t++){let i=n[e?t:n.length-1-t],o=qg(i),s=o.rowIndex-r.rowIndex||o.colIndex-r.colIndex;if(e?s>0:s<0){a=i;break}}a??=n[e?0:n.length-1];let o=qg(a);await t.getRange(C.cellToRange(o)).select(),!i()&&xm(t)&&vm(t,o,{autoFocus:!1})};e.updateCommand(`previousComment`,{tags:[`noTransaction`,`noRepeat`],callback:()=>a(!1)}),e.updateCommand(`nextComment`,{tags:[`noTransaction`,`noRepeat`],callback:()=>a(!0)}),e.updateCommand(`showCommentsPane`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i()?r.close(Gb):n?.(Gb)}}),e.updateCommand(`convertNotesToComments`,{callback:()=>{let e=t.getComments().getItems({notes:!0});for(let t=0;t<e.length;t++)e[t].update({asNote:!1,content:e[t].getContent()})}});let o=()=>{e.updateCommand(`showCommentsPane`,{state:i()})};o();let s=r?.addListener({onChange:o}),c=()=>{let n=!t.getProtection().isObjectsAllowed(),r=zb(n,S(`reason.sheetProtected`)),i=t.getSelectedCell().getComments(),a=i?.isNote()?i:null,o=t.getComments().getItems(),s=0;for(let e=0;e<o.length;e++)o[e].isNote()&&s++;e.updateCommand(`updateComments`,{disabledReasons:zb(!!a,S(`reason.cellHasNote`)),params:{thread:i&&!a?`yes`:`no`}});let c=zb(o.length===s,S(`reason.noComments`));e.updateCommand(`previousComment`,{disabledReasons:c}),e.updateCommand(`nextComment`,{disabledReasons:c});let l=zb(s===0,S(`reason.noNotes`));e.updateCommand(`convertNotesToComments`,{disabledReasons:[...r,...l]}),e.updateCommand(`showAllNotes`,{disabledReasons:[...r,...l]});let u=n&&s>0&&t.getComments().getItems({address:t.getSelectedRange(),notes:!0}).length>0;e.updateCommand(`deleteComments`,{disabledReasons:zb(u,S(`reason.sheetProtected`))}),e.updateCommand(`editNote`,{disabledReasons:[...r,...zb(!!i&&!a,S(`reason.cellHasThread`))],params:{note:a?`yes`:`no`}}),e.updateCommand(`showHideNote`,{disabledReasons:[...r,...zb(!a,S(`reason.noNote`))],state:!!a&&!1===a.getMovable()?.isHidden()})};c();let l=t.addListeners({onProtectionChange:c,onCommentsChange:c,onMovablesChange:c}),u=t.getSelection().addListeners({onChange:c});return()=>{l(),u(),s?.()}}function Qb(e,t,n,r,i){let a=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null,o=(e,r=!1)=>{let i=a();if(i)return void i.updateStyleOptions(e);let o=t.getSelectedRanges(),s=o.getCount()===1&&o.at(0).size===1?o.at(0).getSurrounding({contentOnly:!0}):null,c=s?t.getRanges(s).getFixed(!0):o.getFixed(!0),l=(s??t.getSelectedRange()).getDefaultSortCriteria(),u={getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0),table:()=>null,styles:()=>null},d={initialValue:{ranges:c,hasHeader:l?.options?.hasHeader??!1},context:()=>u,onInput:n=>{var i;(i=n??null)&&t.doBatch(async()=>{let n=i.ranges.at(0);r&&n.getStyle().clear(),await t.getTables().add(n,{hasHeader:i.hasHeader,properties:{name:i.name,style:e?.name}}).getRange().select()},{description:S(`op.insertTable`)})}};n?.showWindow?.(`tableNew`,d)};e.updateCommand(`insertTable`,{tags:[`noTransaction`],callback:()=>o()});let s=()=>({styles:()=>t.getStyles(),table:()=>a(),getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)});e.updateCommand(`formatTableStyle`,{tags:[`noTransaction`],callback:e=>o(e),context:s}),e.updateCommand(`formatTableStyleClearCellStyles`,{tags:[`noTransaction`],callback:e=>o(e,!0),context:s}),e.updateCommand(`editTable`,{tags:[`noTransaction`,`noRepeat`],callback:async n=>{let i=null,o=!1;if(n?.isITable?i=n:n?.getValue?.()&&(i=n.getValue(),o=!0),!i&&(i=a(),i)){let e=t.getSelectedRange();e.size===1&&(e=e.getSurrounding()),await e.select()}if(!i)return;let s=i;if(o)try{await s.select()}catch{}let c={styles:()=>t.getStyles(),table:()=>s,getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)};e.updateCommand(`editTable`,{context:()=>c}),r?.(`tableDetails`)}});let c=async(e,r)=>{let i=(e=>e?e.isITable?e:e.getValue?.()??null:a())(e);if(i){if(!r){let e=i.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4&&n?.showOptions&&await n.showOptions({title:A(`dialog.confirm.title`),description:A(`table.convertToRangeWarning`,{count:t}),options:[{id:`Convert`,label:()=>A(`table.convert`)},`Cancel`],defaultOption:`Convert`})!==`Convert`)return}await t.doBatch(()=>{r?i.delete():i.convertToRange()},{description:S(r?`op.deleteTable`:`op.convertTableToRange`)})}};e.updateCommand(`deleteTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>c(e,!0)}),e.updateCommand(`convertTableToRange`,{tags:[`noTransaction`,`noRepeat`],callback:e=>c(e,!1)}),e.updateCommand(`setDefaultTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyles().setDefault(e)}}),e.updateCommand(`deleteTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyles().getByName(e)?.delete()}});let l=()=>{let n=a(),r=t.getTables().getItems({address:t.getSelectedRange()}),i=[...zb(!t.getProtection().isFormatCellsAllowed(),S(`reason.sheetProtected`)),...zb(r.length>0&&!n,S(`reason.tableAmbiguous`))];e.updateCommand(`formatTableStyle`,{params:{hasTable:!!n},disabledReasons:i}),e.updateCommand(`formatTableStyleClearCellStyles`,{disabledReasons:i}),e.updateCommand(`insertTable`,{disabledReasons:[...i,...zb(r.length>0,S(`reason.alreadyTable`))]})};l();let u=()=>{e.updateCommand(`editTable`,{state:i?.getActive()===`tableDetails`,disabledReasons:zb(!i?.canActivate(`tableDetails`),S(`reason.noTaskPane`))})};u();let d=i?.addListener({onChange:u}),f=t.getSelection().addListeners({onChange:l}),p=t.addListeners({onTablesChange:l,onProtectionChange:l});return()=>{f(),p(),d?.()}}function $b(e,t,n,r,i){let a=e=>(e&&!e.isDeleted()?e:null)??zl(t),o=e=>{Ib(),r?.(Pb,{args:{pivot:e}})},s=(e=>({validateName:(t,n)=>{if(t.length===0||t.length>255)throw new O(A(`error.pivotTable.nameInvalid`));if(Rb(e,n).getPivotTables().getByName(t))throw new O(A(`error.pivotTable.nameExists`))},checkLocation:e=>{let t=e.at(0);if(!t)return null;let{rowStart:n,colStart:r}=t.getCoords(),i=t.getWorksheet().getRange({rowStart:n,colStart:r,rowEnd:n+18-1,colEnd:r+3-1});return i.getPivotTables().length>0?S(`error.pivotTable.overlapsPivot`):i.getValues().some(e=>e.some(e=>e!=null))?S(`error.pivotTable.destinationOccupied`):null}}))(t);e.updateCommand(`insertPivotTable`,{tags:[`noTransaction`],callback:()=>{let e=t.getSelectedCell().getCoords(),r=t.getTables().getItems({address:e})[0],i=t.getSelectedRanges(),a=i.getCount()===1&&i.at(0).size===1?i.at(0).getSurrounding({contentOnly:!0}):null,c={initialValue:{source:r?r.getName():(a?t.getRanges(a):i).getFixed(!0),location:null,name:Lb(t)},context:()=>s,onInput:e=>{(async e=>{if(!e?.source||!e.location)return;let n=Rb(t,e.location),r=await n.getPivotTables().add(typeof e.source==`string`?e.source:e.source.at(0),e.location.at(0),{name:e.name});n.getName()!==t.getName()&&await n.select(),await r.getRange().select(),o(r)})(e??null).catch(e=>{n?.showMessage?.(e?.message??String(e),{type:K.Error})})}};n?.showWindow?.(`pivotTableNew`,c)}}),e.updateCommand(`editPivotTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=a(e);t&&o(t)}}),e.updateCommand(`refreshPivotTable`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{await a(e)?.refresh()}}),e.updateCommand(`deletePivotTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{a(e)?.delete()}});let c=()=>({pivot:()=>zl(t),styles:()=>t.getStyles()});e.updateCommand(`formatPivotStyle`,{callback:e=>{e&&zl(t)?.updateStyleOptions(e)},context:c}),e.updateCommand(`formatPivotStyleClear`,{callback:()=>{zl(t)?.updateStyleOptions({name:null})},context:c});let l=()=>{e.updateCommand(`insertPivotTable`,{disabledReasons:zb(t.getProtection().isLocked(),S(`reason.sheetProtected`))});let n=zb(!t.getProtection().isPivotTablesAllowed(),S(`reason.sheetProtected`));e.updateCommand(`refreshPivotTable`,{disabledReasons:n}),e.updateCommand(`deletePivotTable`,{disabledReasons:n});let r=zl(t)?.getStyleOptions();e.updateCommand(`formatPivotStyle`,{state:r,disabledReasons:n});let i=r?.name;e.updateCommand(`formatPivotStyleClear`,{disabledReasons:[...n,...zb(!i,S(`reason.noPivotStyle`))]})};l();let u=()=>{e.updateCommand(`editPivotTable`,{state:i?.getActive()===Pb,disabledReasons:zb(!r,S(`reason.noTaskPane`))})};u();let d=i?.addListener({onChange:u}),f=t.getSelection().addListeners({onChange:l}),p=t.addListeners({onProtectionChange:l,onPivotTablesChange:l});return()=>{f(),p(),d?.()}}function ex(e,t){let n=t.sheet;if(!n)return()=>{};let r=t,i=r?.notifier;e.use(on({transaction:n,notifier:i,manager:r?.manager})),e.updateCommand(`protectionSheetToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let r=n.getProtection(),a=null;try{if(r.isLocked()||r.isPaused()){let e=null;if(r.hasPassword()){let t=await i?.showInput({title:A(`dialog.password.title`),description:A(`dialog.password.description`),options:[{id:`Unprotect`,label:()=>A(`dialog.unprotect`)},`Cancel`],defaultOption:`Unprotect`,inputType:`password`});if(t?.option!==`Unprotect`)return;e=t.input}a=await Promise.resolve(i?.showBusy(t?.getLabel?.())??null),await r.unlock(e??void 0)}else a=await Promise.resolve(i?.showBusy(t?.getLabel?.())??null),await r.lock();a?.()}catch(e){a?.(),i?.showError(e)}}});let a=async e=>{let t=n.getProtection();if(t.isPaused())return void t.resume();let r;if(t.hasPassword()){let e=await i?.showInput({title:A(`dialog.password.title`),description:A(`dialog.password.pauseDescription`),options:[{id:`Pause`,label:()=>A(`dialog.pause`)},`Cancel`],defaultOption:`Pause`,inputType:`password`});if(e?.option!==`Pause`)return;r=e.input??void 0}let a=null;try{a=await Promise.resolve(i?.showBusy(e?.getLabel?.())??null),await t.pause(r),a?.()}catch(e){a?.(),i?.showError(e)}};e.updateCommand(`protectionSheetPause`,{tags:[`noTransaction`,`noRepeat`],callback:(e,t)=>a(t)}),e.updateCommand(`protectionSheetProtectOrPause`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let r=n.getProtection();if(r.isLocked()||r.isPaused())return void await a(t);let o=null;try{o=await Promise.resolve(i?.showBusy(t?.getLabel?.())??null),await r.lock(),o?.()}catch(e){o?.(),i?.showError(e)}}}),e.updateCommand(`manageProtection`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=e===`sheet`||e===`ranges`||e===`cells`||e===`workbook`?e:`sheet`;r?.activateTaskPane?.(`manageProtection`,{args:{tab:t}})}}),e.updateCommand(`manageDataValidation`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`dataValidationDetails`)}}),e.updateCommand(`manageConditionalFormat`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`conditionalFormatDetails`)}}),e.updateCommand(`conditionalFormatNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`conditionalFormatDetails`,{args:{insert:!0}})}});let o=e=>{n.getConditionalFormats().add(n.getSelectedRanges(),{...e,replaceExisting:!0})},s=e=>({tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`conditionalFormatDetails`,{args:{draft:{condition:e,style:structuredClone(op[0].style)}}})}}),c=Bn.BuiltInOperatorNames,l=Bn.BuiltInSelectorNames;e.updateCommand(`conditionalFormatGreaterThan`,s({selector:l.Number,operator:c.GreaterThan,param:10})),e.updateCommand(`conditionalFormatLessThan`,s({selector:l.Number,operator:c.LessThan,param:10})),e.updateCommand(`conditionalFormatBetween`,s({selector:l.Number,operator:c.Between,param:{from:10,to:20}})),e.updateCommand(`conditionalFormatEqualTo`,s({selector:l.Number,operator:c.EqualTo,param:10})),e.updateCommand(`conditionalFormatTextContains`,s({selector:l.Text,operator:c.TextContains,param:``})),e.updateCommand(`conditionalFormatDateOccurring`,s({operator:c.TimePeriod,param:{type:Bn.TimePeriodType.Today}})),e.updateCommand(`conditionalFormatDuplicateValues`,s({operator:c.Not,param:{operator:c.Unique}})),e.updateCommand(`conditionalFormatTopItems`,s({operator:c.TopN,param:{top:!0,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatTopPercent`,s({operator:c.TopN,param:{top:!0,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatBottomItems`,s({operator:c.TopN,param:{top:!1,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatBottomPercent`,s({operator:c.TopN,param:{top:!1,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatAboveAverage`,s({operator:c.Average,param:{type:Bn.AverageType.Above}})),e.updateCommand(`conditionalFormatBelowAverage`,s({operator:c.Average,param:{type:Bn.AverageType.Below}})),e.updateCommand(`conditionalFormatDataBar`,{callback:e=>{o({scale:e?structuredClone(e):yp()})}}),e.updateCommand(`conditionalFormatColorScale`,{callback:e=>{o({scale:e?structuredClone(e):vp()})}}),e.updateCommand(`conditionalFormatIconSet`,{callback:e=>{o({scale:e?structuredClone(e):xp()})}}),e.updateCommand(`conditionalFormatClearSelection`,{callback:()=>{let e=n.getConditionalFormats(),t=new Set;for(let r of n.getSelectedRanges().getCoords())for(let n of e.getItems({address:r}))t.add(n);for(let e of t)e.delete()}}),e.updateCommand(`conditionalFormatClearSheet`,{callback:()=>{for(let e of n.getConditionalFormats().getItems())e.delete()}}),e.updateCommand(`dataValidationNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`dataValidationDetails`,{args:{insert:!0}})}}),e.updateCommand(`dataValidationList`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=Rn.BuiltInOperators.InSet,t=e.createDefaultParam(void 0,{ranges:n.getSelectedRanges()});r?.activateTaskPane?.(`dataValidationDetails`,{args:{draft:{condition:{operator:e.getName(),param:t,includeBlanks:!0}}}})}}),e.updateCommand(`dataValidationUnique`,{callback:()=>{let e=n.getSelectedRanges(),t=e.getCoords();n.getDataValidations().getItems().some(e=>e.getCondition()?.getOperator()?.getName()===c.Unique&&C.isEqualRangesArrays(e.getRanges().getCoords(),t))||n.getDataValidations().add(e,{condition:{operator:c.Unique,includeBlanks:!0},alertStyle:Fn.AlertStyle.Stop,showAlertMessage:!0})}}),e.updateCommand(`dataValidationClearSelection`,{callback:()=>{n.getSelectedRanges().clear(qn.Content.DataValidations)}}),e.updateCommand(`dataValidationClearSheet`,{callback:()=>{for(let e of n.getDataValidations().getItems())e.delete()}}),e.updateCommand(`protectionUnlockRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`manageProtection`,{args:{tab:`ranges`,items:{insert:!0}}})}}),e.updateCommand(`manageProtectedRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`manageProtection`,{args:{tab:`ranges`}})}});let u=async e=>{let t=t=>{n.doBatch(()=>{let r=n.getSelectedRanges();r.merge({axes:e,discardMultipleValues:t}),e===Y.AxisSelection.Both&&r.getStyle().update({alignment:{horizontal:J.HorizontalAlignment.Center}})},{description:S(`op.mergeCells`)})};try{t(!1)}catch(e){if(e?.type===`discardMultipleValues`&&i?.showOptions){if(await i.showOptions({title:A(`dialog.confirm.title`),description:A(`sheet.mergeCellsWarning`),options:[{id:`Merge`,label:()=>A(`sheet.merge`)},`Cancel`],defaultOption:`Merge`})!==`Merge`)return;try{t(!0)}catch(e){i?.showError?.(e)}}else i?.showError?.(e)}},d=()=>{n.doBatch(()=>{let e=n.getSelectedRanges();e.unmerge(),e.getStyle().update({alignment:{horizontal:null}})},{description:S(`op.unmergeCells`)})};e.updateCommand(`mergeToggle`,{tags:[`noTransaction`],callback:()=>{C.isSingleCell(n.getSelectedRange().getCoords())||(n.getSelectedRanges().getMerges().length===0?u(Y.AxisSelection.Both):d())}}),e.updateCommand(`mergeHorizontal`,{tags:[`noTransaction`],callback:()=>{u(Y.AxisSelection.Column)}}),e.updateCommand(`mergeVertical`,{tags:[`noTransaction`],callback:()=>{u(Y.AxisSelection.Row)}}),e.updateCommand(`unmerge`,{tags:[`noTransaction`],callback:()=>d()});let p=e.getKeysByTag(`mutator`),m=()=>{let t=n.getProtection(),i=t.isLocked(),a=!t.isFormatCellsAllowed(),o=zb(a,S(`reason.sheetProtected`)),s=t.isPaused(),c=i||s;e.updateCommand(`protectionSheetToggle`,{state:c,params:{locked:c}}),e.updateCommand(`protectionSheetPause`,{state:s,params:{paused:s},disabledReasons:zb(!s&&!i,S(`reason.protectionNotPausable`))}),e.updateCommand(`protectionSheetProtectOrPause`,{state:c,params:{state:s?`paused`:i?`locked`:`none`},icon:s?`LockOpen`:`Lock`}),e.updateCommand(`protectionUnlockRange`,{disabledReasons:zb(i,S(`reason.sheetProtected`))}),e.updateCommand(`conditionalFormatNewRule`,{disabledReasons:o});let l=zb(i,S(`reason.sheetProtected`));e.updateCommand(`dataValidationNewRule`,{disabledReasons:l}),e.updateCommand(`dataValidationList`,{disabledReasons:l});let u=n.getSelectedRanges(),d=n.getSelectedRange(),f=u.getCoords(),m=u.getMerges().length>0,h=u.isOverlapping(),g=!0;for(let e=0;g&&e<f.length;e++)g=C.isSingleCell(f[e]);let _=f.length===1&&f[0].colStart===f[0].colEnd,v=!(n.getTables().getItems({address:d}).length>0)&&!h&&(m||!g),y=!1,b=!1,x=!1,w=!1;a||(y=u.isEntireRowsAny(),b=y&&!u.isEntireRows(),x=u.isEntireColumnsAny(),w=x&&!u.isEntireColumns());for(let t of p)Bb.has(t)||Hb.has(t)||Ub.has(t)||Wb.has(t)||e.updateCommand(t,{disabledReasons:o});let T=zb(i&&!d.getCell().isEditAllowed(),S(`reason.sheetProtected`));for(let t of Wb)e.updateCommand(t,{disabledReasons:T});let E=n.getSelectedCell().getStyle().getAlignment().getHorizontal(),D=E===J.HorizontalAlignment.CenterContinuous||E===J.HorizontalAlignment.Fill;for(let t of Bb)e.updateCommand(t,{disabledReasons:[...o,...zb(D,S(`reason.continuousSpan`))]});e.updateCommand(`dataTextToColumns`,{disabledReasons:[...o,...zb(!_,S(`reason.singleColumn`)),...zb(i,S(`reason.sheetLocked`))]});let O=[...o,...zb(u.getCount()!==1,S(`reason.sortRange`))];e.updateCommand(`sortAscending`,{disabledReasons:O}),e.updateCommand(`sortDescending`,{disabledReasons:O}),e.updateCommand(`sheetBackgroundDelete`,{disabledReasons:[...o,...zb(!n.getPicture(),S(`reason.noSheetBackground`))]});let k=zb(!v,S(`reason.mergeUnavailable`));e.updateCommand(`mergeToggle`,{state:m,disabledReasons:[...o,...k]}),e.updateCommand(`mergeHorizontal`,{disabledReasons:[...o,...k]}),e.updateCommand(`mergeVertical`,{disabledReasons:[...o,...k]}),e.updateCommand(`unmerge`,{disabledReasons:[...o,...zb(!m,S(`reason.noMerge`)),...k]});let A=zb(h,S(`reason.overlap`)),j=[...o,...zb(x,S(`reason.entireColumn`)),...A,...zb(b,S(`reason.mixedSelection`))],M=[...o,...zb(y,S(`reason.entireRow`)),...A,...zb(w,S(`reason.mixedSelection`))];e.updateCommand(`insertCellsShiftDown`,{disabledReasons:j}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:j}),e.updateCommand(`insertCellsShiftRight`,{disabledReasons:M}),e.updateCommand(`deleteCellsShiftLeft`,{disabledReasons:M});let N=[...o,...zb(x,S(`reason.entireColumn`)),...A,...zb(b,S(`reason.mixedSelection`))],P=[...o,...zb(y,S(`reason.entireRow`)),...A,...zb(w,S(`reason.mixedSelection`))];for(let t of[`insertRows`,`insertRowsAfter`,`deleteRows`])e.updateCommand(t,{disabledReasons:N});for(let t of[`insertColumns`,`insertColumnsAfter`,`deleteColumns`])e.updateCommand(t,{disabledReasons:P});let F=n.getOutline(),I=zb(i,S(`reason.sheetProtected`)),L=(e,t)=>{for(let n=0;n<f.length;n++){let r=f[n],i=e===Y.Axis.Column?r.colStart:r.rowStart,a=e===Y.Axis.Column?r.colEnd:r.rowEnd;if(F.getGroups(e,{from:i,to:a,level:t}).length>0)return!0}return!1},R=!x||y,ee=!y||x,z=L(Y.Axis.Row),B=L(Y.Axis.Column),V=R&&z||ee&&B,H=x||y?V:z||B,U=e=>zb(L(e,7),S(`reason.outlineTooDeep`)),W=zb(x,S(`reason.entireColumn`)),te=zb(y,S(`reason.entireRow`)),G=y&&x?[...te,...W]:[],ne=zb(R&&L(Y.Axis.Row,7)||ee&&L(Y.Axis.Column,7),S(`reason.outlineTooDeep`));e.updateCommand(`group`,{disabledReasons:[...I,...G,...ne]}),e.updateCommand(`groupRows`,{disabledReasons:[...I,...W,...U(Y.Axis.Row)]}),e.updateCommand(`groupColumns`,{disabledReasons:[...I,...te,...U(Y.Axis.Column)]}),e.updateCommand(`ungroup`,{disabledReasons:[...I,...G,...zb(!V,S(`reason.noGroup`))]}),e.updateCommand(`ungroupRows`,{disabledReasons:[...I,...W,...zb(!z,S(`reason.noGroup`))]}),e.updateCommand(`ungroupColumns`,{disabledReasons:[...I,...te,...zb(!B,S(`reason.noGroup`))]}),e.updateCommand(`showDetail`,{disabledReasons:[...o,...zb(!H,S(`reason.noGroup`))]}),e.updateCommand(`hideDetail`,{disabledReasons:[...o,...zb(!H,S(`reason.noGroup`))]}),e.updateCommand(`clearOutline`,{disabledReasons:[...I,...zb(!z&&!B,S(`reason.noGroup`))]}),e.updateCommand(`autoOutline`,{disabledReasons:I}),e.updateCommand(`outlineSettings`,{disabledReasons:I});let re=r?.editModeHandler?.getMode()?.key,ie=re===`copy`?`copy`:re===`cut`?`cut`:`none`,ae=h?1:u.getRowCount(),oe=h?1:u.getColumnCount(),se=u.getDefaultShiftAxis()===Y.Axis.Column,ce=y&&!b,K=x&&!w,le=ce?`rows`:K?`columns`:`none`,ue=K?oe:ae;e.updateCommand(`insertCells`,{params:{mode:ie,shift:se?`right`:`down`,span:le,count:ue}}),e.updateCommand(`deleteCells`,{params:{shift:se?`left`:`up`,span:le,count:ue}}),e.updateCommand(`insertCellsShiftDown`,{params:{mode:ie,span:ce?`rows`:`none`,count:ae}}),e.updateCommand(`deleteCellsShiftUp`,{params:{span:ce?`rows`:`none`,count:ae}}),e.updateCommand(`insertCellsShiftRight`,{params:{mode:ie,span:K?`columns`:`none`,count:oe}}),e.updateCommand(`deleteCellsShiftLeft`,{params:{span:K?`columns`:`none`,count:oe}});for(let t of[`insertRows`,`insertRowsAfter`])e.updateCommand(t,{params:{mode:ie,count:ae}});for(let t of[`insertColumns`,`insertColumnsAfter`])e.updateCommand(t,{params:{mode:ie,count:oe}});e.updateCommand(`deleteRows`,{params:{count:ae}}),e.updateCommand(`deleteColumns`,{params:{count:oe}}),e.updateCommand(`hideRows`,{params:{count:u.getRowCount()}}),e.updateCommand(`hideColumns`,{params:{count:u.getColumnCount()}});let de=y===x?`both`:x?`columns`:`rows`;e.updateCommand(`group`,{params:{span:de}}),e.updateCommand(`ungroup`,{params:{span:de}})};m();let g=n.addListeners({onProtectionChange:m,onStyleChange:m,onInvalidated:m,onClose:()=>e.remove()}),_=n.getSelection().addListeners({onChange:m}),v=n.getOutline().addListeners({onOutlineChange:m}),b=Kb(e,n,t.viewport),x=function(e,t,n,r,i,a){let o=(e,n=!1,r)=>{let i=r??{autoSelect:!0,autoFit:!0},a=t.getSelectedRanges();n&&a.getStyle().update(null,i),a.getStyle().update(e,i)},s=()=>t.getSelectedCell().getStyle().getFont(),c=()=>t.getSelectedCell().getStyle().getAlignment(),l=()=>{let e=s().getWeight();return!isNaN(e)&&e>500};e.updateCommand(`formatBoldToggle`,{callback:()=>{o({font:{weight:l()?400:700}})}}),e.updateCommand(`formatItalicToggle`,{callback:()=>{o({font:{italic:!s().getItalic()}})}}),e.updateCommand(`formatStrikeThroughToggle`,{callback:()=>{o({font:{strike:s().getStrike()===un.StrikeStyle.None?un.StrikeStyle.Single:un.StrikeStyle.None}})}});let u=(t,n)=>{e.updateCommand(t,{callback:()=>{o({font:{underline:s().getUnderline()===n?un.UnderlineStyle.None:n}})}})};u(`formatUnderlinedToggle`,un.UnderlineStyle.Single),u(`formatUnderlinedDoubleToggle`,un.UnderlineStyle.Double),u(`formatUnderlinedAccountingToggle`,un.UnderlineStyle.SingleAccounting),u(`formatUnderlinedAccountingDoubleToggle`,un.UnderlineStyle.DoubleAccounting);let d=(t,n)=>{e.updateCommand(t,{callback:()=>{o({font:{baseline:Math.sign(s().getBaseline())===Math.sign(n)?0:n}})}})};d(`formatSuperscriptToggle`,mn.Baseline.Superscript),d(`formatSubscriptToggle`,mn.Baseline.Subscript);let f=(t,n)=>{e.updateCommand(t,{callback:()=>{o({alignment:{overflow:c().getOverflow()===n?J.Overflow.Visible:n}})}})};f(`formatTextOverflowVisibleToggle`,J.Overflow.Visible),f(`formatTextOverflowWrapToggle`,J.Overflow.Wrap),f(`formatTextOverflowClipToggle`,J.Overflow.Clip),f(`formatTextOverflowShrinkToggle`,J.Overflow.Shrink),e.updateCommand(`formatTextOverflowEllipsisToggle`,{callback:()=>{o({alignment:{overflow:c().getOverflow()===J.Overflow.Ellipsis?J.Overflow.Visible:J.Overflow.Ellipsis}})},disabledReasons:[S(`reason.notImplemented`)]});let p=(t,n)=>{e.updateCommand(t,{callback:()=>{o({alignment:{vertical:c().getVertical()===n?J.VerticalAlignment.Bottom:n}})}})};p(`formatAlignTopToggle`,J.VerticalAlignment.Top),p(`formatAlignMiddleToggle`,J.VerticalAlignment.Center),p(`formatAlignBottomToggle`,J.VerticalAlignment.Bottom),p(`formatAlignJustifyVerticalToggle`,J.VerticalAlignment.Justify),p(`formatAlignDistributedVerticalToggle`,J.VerticalAlignment.Distributed);let m=(t,n,r=!1)=>{e.updateCommand(t,{callback:()=>{let e=c().getHorizontal()===n?J.HorizontalAlignment.General:n;o({alignment:r?{horizontal:e,rotation:null,stacked:null}:{horizontal:e}})}})};m(`formatAlignLeftToggle`,J.HorizontalAlignment.Left),m(`formatAlignCenterToggle`,J.HorizontalAlignment.Center),m(`formatAlignCenterContinuousToggle`,J.HorizontalAlignment.CenterContinuous,!0),m(`formatAlignFillToggle`,J.HorizontalAlignment.Fill,!0),m(`formatAlignDistributedHorizontalToggle`,J.HorizontalAlignment.Distributed),m(`formatAlignRightToggle`,J.HorizontalAlignment.Right),m(`formatAlignJustifyToggle`,J.HorizontalAlignment.Justify),e.updateCommand(`formatBorder`,{callback:e=>{o({borders:e})}}),e.updateCommand(`formatFillColor`,{callback:e=>{o({fill:e})}}),e.updateCommand(`formatFontColor`,{callback:e=>{o({font:{color:e}})}}),e.updateCommand(`formatFillColor`,{context:()=>({...Jb(t),autoColor:qb,quickColor:r?.getLastFillColor?.()??new fn(xn.Scheme.Bg2,t.getStyles().schemeLookup()),onColorSelect:e=>r?.setLastFillColor?.(e??qb)})}),e.updateCommand(`formatFontColor`,{context:()=>({...Jb(t),autoColor:t.getStyles().getNormal().getFont().getColor(),quickColor:r?.getLastFontColor?.()??void 0,onColorSelect:e=>r?.setLastFontColor?.(e)})}),e.updateCommand(`formatBorder`,{context:()=>{let e=t.getStyles();return{autoColor:e.getNormal().getFont().getColor(),autoStyle:pn.StrokeStyle.Thin,schemeLookup:e.schemeLookup(),quickBorder:r?.getLastBorder?.()??void 0,createBorder:t=>e.getNormal().createStyle({borders:t}).getBorders(),onBorderSelect:e=>r?.setLastBorder?.(e)}}}),e.updateCommand(`formatFontFamily`,{callback:e=>{o({font:{family:e}})}}),e.updateCommand(`formatFontSize`,{callback:e=>{o({font:{size:e}})}}),e.updateCommand(`formatFontSizeIncrease`,{callback:()=>{o(e=>({font:{size:vn.findNextFontSize(e.getFont().getSize(),!0)}}))}}),e.updateCommand(`formatFontSizeDecrease`,{callback:()=>{o(e=>({font:{size:vn.findNextFontSize(e.getFont().getSize(),!1)}}))}}),e.updateCommand(`formatNumberFormat`,{callback:e=>{o({numberFormat:e})}}),e.updateCommand(`formatNumberFormatGeneralStyle`,{callback:()=>{o({numberFormat:gn.Type.General})}}),e.updateCommand(`formatNumberFormatNumberStyle`,{callback:()=>{o({numberFormat:4})}}),e.updateCommand(`formatNumberFormatTimeStyle`,{callback:()=>{o({numberFormat:18})}}),e.updateCommand(`formatNumberFormatDateStyle`,{callback:()=>{o({numberFormat:15})}}),e.updateCommand(`formatNumberFormatAccountingStyle`,{callback:e=>{o(e?{numberFormat:e}:{named:bn.BuiltInName.Currency})}}),e.updateCommand(`formatNumberFormatPercentStyle`,{callback:()=>{o({named:bn.BuiltInName.Percent})}}),e.updateCommand(`formatNumberFormatScientificStyle`,{callback:()=>{o({numberFormat:11})}}),e.updateCommand(`formatNumberFormatCommaStyle`,{callback:()=>{o({named:bn.BuiltInName.Comma})}}),e.updateCommand(`formatNumberFormatIncreaseDecimal`,{callback:()=>{o(e=>({numberFormat:gn.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}}),e.updateCommand(`formatNumberFormatDecreaseDecimal`,{callback:()=>{o(e=>({numberFormat:gn.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}});let h={style:pn.StrokeStyle.Thin,color:null};e.updateCommand(`formatBorderAddOutline`,{callback:()=>{o({borders:{left:h,top:h,right:h,bottom:h}})}}),e.updateCommand(`formatBorderClearOutline`,{callback:()=>{o({borders:null})}}),e.updateCommand(`formatIndentDecrease`,{callback:()=>{o(e=>{let t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}},!1,Vb)}}),e.updateCommand(`formatIndentIncrease`,{callback:()=>{o(e=>{let t={alignment:{indent:e.getAlignment().getIndent()+1}};return e.getAlignment().getHorizontal()===J.HorizontalAlignment.General&&(t.alignment.horizontal=J.HorizontalAlignment.Left),t},!1,Vb)}}),e.updateCommand(`formatCellStyle`,{callback:e=>{t.getSelectedRanges().getStyle().setNamed(e,{autoSelect:!0,autoFit:!0})},context:()=>({styles:()=>t.getStyles(),named:()=>t.getSelectedCell().getStyle().getNamed(),createCell:e=>t.createCell(e)})});let g=e=>{o({alignment:{rotation:e}})};e.updateCommand(`formatTextRotate0`,{callback:()=>g(0)}),e.updateCommand(`formatTextRotate45`,{callback:()=>g(45)}),e.updateCommand(`formatTextRotate90`,{callback:()=>g(90)}),e.updateCommand(`formatTextRotate270`,{callback:()=>g(270)}),e.updateCommand(`formatTextRotate315`,{callback:()=>g(315)}),e.updateCommand(`formatTextRotateCustom`,{callback:e=>g(e??0)}),e.updateCommand(`formatTextRotateVertical`,{callback:()=>{o({alignment:{stacked:!c().getStacked()}})}});let _=e=>{i?.(`formatCells`,{args:{tab:e}})};e.updateCommand(`formatCells`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{_(e)}}),e.updateCommand(`formatCellsNumber`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{_(`number`)}}),e.updateCommand(`formatCellsFont`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{_(`font`)}}),e.updateCommand(`formatSheetTabColor`,{callback:e=>{t.setTabColor(e)},state:t.getTabColor()??qb,context:()=>({...Jb(t),autoColor:qb,onColorSelect:()=>{}})});let v=()=>{let n=s(),r=n.getUnderline(),i=n.getBaseline();e.updateCommand(`formatBoldToggle`,{state:l()}),e.updateCommand(`formatItalicToggle`,{state:n.getItalic()}),e.updateCommand(`formatStrikeThroughToggle`,{state:n.getStrike()!==un.StrikeStyle.None}),e.updateCommand(`formatUnderlinedToggle`,{state:r===un.UnderlineStyle.Single}),e.updateCommand(`formatUnderlinedDoubleToggle`,{state:r===un.UnderlineStyle.Double}),e.updateCommand(`formatUnderlinedAccountingToggle`,{state:r===un.UnderlineStyle.SingleAccounting}),e.updateCommand(`formatUnderlinedAccountingDoubleToggle`,{state:r===un.UnderlineStyle.DoubleAccounting}),e.updateCommand(`formatSuperscriptToggle`,{state:i>0}),e.updateCommand(`formatSubscriptToggle`,{state:i<0}),e.updateCommand(`formatFontFamily`,{state:n.getFamily()}),e.updateCommand(`formatFontSize`,{state:n.getSize()});let a=t.getSelectedCell().getStyle().getNumberFormat();e.updateCommand(`formatNumberFormat`,{state:a,context:()=>t.getSelectedCell()});let o=t.getSelectedCell().getStyle().getFill(),u=null;o?.getType()===dn.Type.Solid?u=o.getColor():o?.getType()===dn.Type.Gradient?u=o.getStops()?.[0]?.getColor()??null:o?.getType()===dn.Type.Pattern&&(u=o.getBackground()),e.updateCommand(`formatFillColor`,{state:u}),e.updateCommand(`formatFontColor`,{state:n.toJSON()?.color?n.getColor():null});let d=c(),f=d.getOverflow();e.updateCommand(`formatTextOverflowVisibleToggle`,{state:f===J.Overflow.Visible}),e.updateCommand(`formatTextOverflowWrapToggle`,{state:f===J.Overflow.Wrap}),e.updateCommand(`formatTextOverflowClipToggle`,{state:f===J.Overflow.Clip}),e.updateCommand(`formatTextOverflowShrinkToggle`,{state:f===J.Overflow.Shrink}),e.updateCommand(`formatTextOverflowEllipsisToggle`,{state:f===J.Overflow.Ellipsis});let p=d.getVertical();e.updateCommand(`formatAlignTopToggle`,{state:p===J.VerticalAlignment.Top}),e.updateCommand(`formatAlignMiddleToggle`,{state:p===J.VerticalAlignment.Center}),e.updateCommand(`formatAlignBottomToggle`,{state:p===J.VerticalAlignment.Bottom}),e.updateCommand(`formatAlignJustifyVerticalToggle`,{state:p===J.VerticalAlignment.Justify}),e.updateCommand(`formatAlignDistributedVerticalToggle`,{state:p===J.VerticalAlignment.Distributed});let m=d.getHorizontal();e.updateCommand(`formatAlignLeftToggle`,{state:m===J.HorizontalAlignment.Left}),e.updateCommand(`formatAlignCenterToggle`,{state:m===J.HorizontalAlignment.Center}),e.updateCommand(`formatAlignCenterContinuousToggle`,{state:m===J.HorizontalAlignment.CenterContinuous}),e.updateCommand(`formatAlignFillToggle`,{state:m===J.HorizontalAlignment.Fill}),e.updateCommand(`formatAlignDistributedHorizontalToggle`,{state:m===J.HorizontalAlignment.Distributed}),e.updateCommand(`formatAlignRightToggle`,{state:m===J.HorizontalAlignment.Right}),e.updateCommand(`formatAlignJustifyToggle`,{state:m===J.HorizontalAlignment.Justify});let h=d.getStacked(),g=h?0:d.getRotation();e.updateCommand(`formatTextRotate0`,{state:g===0&&!h}),e.updateCommand(`formatTextRotate45`,{state:g===45}),e.updateCommand(`formatTextRotate90`,{state:g===90}),e.updateCommand(`formatTextRotate270`,{state:g===270}),e.updateCommand(`formatTextRotate315`,{state:g===315}),e.updateCommand(`formatTextRotateVertical`,{state:h}),e.updateCommand(`formatTextRotateCustom`,{state:g??0})};v();let y=()=>{e.updateCommand(`formatCells`,{state:a?.getActive()===`formatCells`})};y();let b=a?.addListener({onChange:y}),x=t.addListeners({onStyleChange:v}),C=t.getSelection().addListeners({onChange:v});return()=>{x(),C(),b?.()}}(e,n,0,r?.pickerMemory,r?.activateTaskPane,r?.taskPaneArea),w=function(e,t){let n=e=>{t.getSelectedRanges().clear(e)};return e.updateCommand(`clearContents`,{callback:()=>{n(qn.Content.Values)}}),e.updateCommand(`clearFormats`,{callback:()=>{n(qn.Content.Formats)}}),e.updateCommand(`clearHyperlinks`,{callback:()=>{n(qn.Content.Hyperlinks)}}),e.updateCommand(`clearComments`,{callback:()=>{n(qn.Content.Comments)}}),e.updateCommand(`clearAll`,{callback:()=>{n()}}),e.updateCommand(`deleteHyperlink`,{callback:()=>{t.getSelectedRange().setHyperlink(null)}}),e.updateCommand(`deleteComments`,{callback:()=>{t.getSelectedRange().setComments(null)}}),()=>{}}(e,n),T=function(e,t){let n=(e,n)=>{t.getSelection().selectRegion({contentOnly:e,entireRegion:n})};return e.updateCommand(`selectAll`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{n(!1,e??!1)}}),e.updateCommand(`selectRegion`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{n(!0,!1)}}),e.updateCommand(`selectComments`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getComments().getItems();e.length!==0&&await t.getRanges(e.map(e=>{let{rowStart:t,colStart:n,rowEnd:r,colEnd:i}=e.getRange().getCoords();return{rowStart:t,colStart:n,rowEnd:r,colEnd:i}})).select()}}),e.updateCommand(`clearHiddenSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.getSelection().clearHidden()}}),()=>{}}(e,n),E=function(e,t){let n=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null;e.updateCommand(`tableFilterToggle`,{callback:()=>{let e=n();if(e)return void e.setHiddenButtons(!e.isHiddenButtons());let r=t.getAutoTable();r?r.delete():t.addAutoTable()}});let r=()=>{let r=n()??t.getAutoTable(),i=t.getProtection(),a=!i.isAutoTableAllowed()||!i.isSortAllowed();e.updateCommand(`tableFilterToggle`,{state:!!r&&!r.isHiddenButtons(),disabledReasons:zb(a,S(`reason.sheetProtected`))})};r();let i=t.getSelection().addListeners({onChange:r}),a=t.addListeners({onTablesChange:r,onProtectionChange:r});return()=>{i(),a()}}(e,n),D=Yb(e,n,i),k=function(e,t,n){let r=(e,n)=>{let r=t.getSelectedRanges();r.doBatch(()=>{let n=e===Y.Direction.Up||e===Y.Direction.Down,i=e===Y.Direction.Up||e===Y.Direction.Left,a=t.getEntireCoords(),o=n?a.rowEnd:a.colEnd,s=e=>n?[e.rowStart,e.rowEnd]:[e.colStart,e.colEnd],c=(e,t,r)=>n?{...e,rowStart:t,rowEnd:r}:{...e,colStart:t,colEnd:r},l=e=>{let n=e;for(;;){let[e,r]=s(n),i=e,a=r;for(let e of t.getRange(n).getMerges()){let[t,n]=s(e);i=Math.min(i,t),a=Math.max(a,n)}if(i===e&&a===r)return n;n=c(n,i,a)}},u=r.getCoords(),d=u.length===1;for(let e of u){let[n,r]=s(e),a;if(n!==r)a=l(i?c(e,r,r):c(e,n,n));else{if(!d)continue;let t=i?r+1:n-1;if(t<0||t>o)continue;a=l(c(e,t,t))}let[u,f]=s(a),p=c(e,Math.min(n,u),Math.max(r,f));t.getRange(a).autoFill(p,{filler:Wn.Types.Copy}),t.getRange(e).autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:n})};return e.updateCommand(`fillDown`,{callback:()=>r(Y.Direction.Down,`Fill Down`)}),e.updateCommand(`fillRight`,{callback:()=>r(Y.Direction.Right,`Fill Right`)}),e.updateCommand(`fillUp`,{callback:()=>r(Y.Direction.Up,`Fill Up`)}),e.updateCommand(`fillLeft`,{callback:()=>r(Y.Direction.Left,`Fill Left`)}),e.updateCommand(`fillSeries`,{tags:[`noTransaction`],callback:()=>{let e=t.getSelectedRanges();if(e.getCount()>1)throw new O(A(`error.fillSeries.multipleRanges`));let r=e.at(0),i=r.getDefaultAutoFillCriteria(),a=i?.direction!==Y.Direction.Right,o=r.getDefaultAutoFillCriteria(a?Y.Direction.Right:Y.Direction.Down),s=new Map([[Y.Direction.Down,a?i:o],[Y.Direction.Right,a?o:i]]),c=(i?.offered.length?i:null)??(o?.offered.length?o:null);if(!c)throw new O(A(`error.fillSeries.invalidSelection`));Rs({sheet:t,notifier:n,range:r,byDirection:s,direction:c.direction,presetId:c.presetId})}}),()=>{}}(e,n,i),j=function(e,t,n,r){let i=async(e,i=!1,a=!1)=>{let o=t.getSelectedRanges();i&&(e===Y.Axis.Row?o=o.getEntireRows(a):e===Y.Axis.Column&&(o=o.getEntireColumns(a)));let s=null,c=n?.getMode()?.key;if((c===`copy`||c===`cut`)&&r){let e=await r.getClipboard().readReference();e&&e.getItemType()===`range`&&(s=e.getItem?.()??null,s?.getCoords?.()||(s=null))}if(s){let t=await o.insertFrom(s,{...s.getMarkOptions(),axis:e,autoSelect:!0});!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0}),n?.setMode(null)}else o.insert({axis:e,autoSelect:!0})},a=(e,n=!1)=>{let r=t.getSelectedRanges();n&&(e===Y.Axis.Row?r=r.getEntireRows():e===Y.Axis.Column&&(r=r.getEntireColumns())),r.delete(e)};return e.updateCommand(`insertCells`,{callback:()=>i()}),e.updateCommand(`insertCellsShiftRight`,{callback:()=>i(Y.Axis.Column)}),e.updateCommand(`insertCellsShiftDown`,{callback:()=>i(Y.Axis.Row)}),e.updateCommand(`insertRows`,{callback:()=>i(Y.Axis.Row,!0)}),e.updateCommand(`insertColumns`,{callback:()=>i(Y.Axis.Column,!0)}),e.updateCommand(`insertRowsAfter`,{callback:()=>i(Y.Axis.Row,!0,!0)}),e.updateCommand(`insertColumnsAfter`,{callback:()=>i(Y.Axis.Column,!0,!0)}),e.updateCommand(`deleteCells`,{callback:()=>a()}),e.updateCommand(`deleteCellsShiftUp`,{callback:()=>a(Y.Axis.Row)}),e.updateCommand(`deleteCellsShiftLeft`,{callback:()=>a(Y.Axis.Column)}),e.updateCommand(`deleteRows`,{callback:()=>a(Y.Axis.Row,!0)}),e.updateCommand(`deleteColumns`,{callback:()=>a(Y.Axis.Column,!0)}),()=>{}}(e,n,r?.editModeHandler,r?.globalClipboard),M=Xb(e,n,i),N=function(e,t,n){e.updateCommand(`updateHyperlink`,{tags:[`noTransaction`],callback:()=>{let e={disabled:!dl(t),context:()=>t.getSelectedCell(),onInput:e=>{t.doBatch(()=>{t.getSelectedRange().setHyperlink(e)},{description:S(`op.updateHyperlink`)})}};n?.showWindow?.(`hyperlink`,e)}}),e.updateCommand(`openHyperlink`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getSelectedCell().getHyperlink();if(e)try{await e.open()}catch(e){n?.showError?.(e)}}});let r=()=>{let n=t.getSelectedCell().getHyperlink(),r=!dl(t),i=zb(!!n?.isReadOnly(),S(`reason.hyperlinkIsValue`));e.updateCommand(`updateHyperlink`,{disabledReasons:[...i,...zb(r&&!n,S(`reason.sheetProtected`))]}),e.updateCommand(`deleteHyperlink`,{disabledReasons:[...i,...zb(r,S(`reason.sheetProtected`))]})};r();let i=t.addListeners({onProtectionChange:r,onDataChange:r,onStyleChange:r,onInvalidated:r}),a=t.getSelection().addListeners({onChange:r});return()=>{i(),a()}}(e,n,i),P=function(e,t,n,r){e.updateCommand(`insertCheckbox`,{callback:()=>{t.getCellControls().add(t.getSelectedRanges(),{type:`checkbox`})}}),e.updateCommand(`insertCellControl`,{callback:e=>{let n=t.getSelectedRanges();e&&!jn.get(e)&&Gn.get(e)?n.setValue({type:e}):t.getCellControls().add(n,{type:e||`checkbox`})}});let i=()=>{let n=zb(!t.getProtection().isFormatCellsAllowed(),S(`reason.sheetProtected`));e.updateCommand(`insertCheckbox`,{disabledReasons:n}),e.updateCommand(`insertCellControl`,{disabledReasons:n})};i();let a=t.addListeners({onProtectionChange:i});e.updateCommand(zd,{tags:[`noTransaction`,`noRepeat`],callback:()=>{Vd(),n?.(zd)}});let o=()=>{e.updateCommand(zd,{state:r?.getActive()===zd})};o();let s=r?.addListener({onChange:o});return()=>{a(),s?.()}}(e,n,r?.activateTaskPane,r?.taskPaneArea),F=Zb(e,n,r?.activateTaskPane,r?.taskPaneArea),I=function(e,t,n,r){let i=e=>{let t=e;if(typeof t!=`string`){console.warn(e);let n=typeof e?.cause==`string`?e.cause:``,r=typeof e?.message==`string`?e.message:``;n&&(r=r?`${r} (${n})`:n),t=A(`error.insertImage.unresolved`,{detail:r})}n?.showMessage?.(t,{type:K.Error})},a=async(e,a,o=S(`op.insertImage`))=>{let s=await Promise.resolve(n?.showBusy?.(A(o))??null);try{await t.getMovables().addPicture(e,{autoSelect:!0,...a}),s?.(),r?.setMode(null)}catch(e){s?.(),i(e)}},o=async e=>{let a=S(`op.insertImage`),o=t.getSelectedCell().getRange(),s=`resource:${h.uuidV4()}`,c=await Promise.resolve(n?.showBusy?.(A(a))??null),l;try{l=t.getResources().add({...e,fetchedFrom:s});let n=await l.toBuffer(),{asUrl:r}=await y.loadImageDetails(n,(await l.getType())?.mime);URL.revokeObjectURL(r)}catch(e){c?.(),i(e);return}c?.(),o.setValue(new Un(s,{resource:l}),{description:a}),r?.setMode(null)},s=async()=>{let e=await n?.showInput?.({title:A(`dialog.insertImage.title`),description:A(`dialog.insertImage.description`),inputLabel:A(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>A(`dialog.insert`)}]});return e?.option===`Insert`?e.input:void 0};e.updateCommand(`insertImageFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=null,n=null;if(typeof e==`string`?n=e:t=e?.file?e.file:e??null,!t&&(t=await f.openFileDialog(n??`image/*`),!t))return;let r=await Promise.resolve(t);await a({source:{file:r}},e?.options)}}),e.updateCommand(`insertImageFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=e||await s();t&&await a({source:{fetch:t}})}}),e.updateCommand(`insertImageInCellFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=e??await f.openFileDialog(`image/*`);t&&await o({source:{file:t}})}}),e.updateCommand(`insertImageInCellFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=e||await s();t&&await o({source:{fetch:t}})}});let c=async e=>{let r=await Promise.resolve(n?.showBusy?.(A(S(`op.setPicture`)))??null);try{let n=t.getResources().add(e);await n.toBuffer(),t.setPicture(n),r?.()}catch(e){r?.(),i(e)}},l=async e=>{let t=null,n=null;typeof e==`string`?n=e:t=e??null,(t||(t=await f.openFileDialog(n??`image/*`),t))&&await c({source:{file:await Promise.resolve(t)}})};e.updateCommand(`sheetBackgroundFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{await l(e)}}),e.updateCommand(`sheetBackgroundFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{if(!e){let t=await n?.showInput?.({title:A(`dialog.sheetBackground.title`),description:A(`dialog.sheetBackground.description`),inputLabel:A(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>A(`dialog.insert`)}]});if(!t||t.option!==`Insert`)return;e=t.input}e&&await c({source:{fetch:e}})}}),e.updateCommand(`sheetBackgroundDelete`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.setPicture(null)}}),e.updateCommand(`sheetBackgroundToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{t.getPicture()?t.setPicture(null):await l()}}),e.updateCommand(`insertChart`,{tags:[`noTransaction`],callback:async e=>{let n=typeof e==`string`?e:e?.type;await t.getCharts().add(t.getSelection().getRanges(),{type:n,autoSelect:!0}),r?.setMode(null)}}),e.updateCommand(`insertShape`,{tags:[`noTransaction`],callback:async e=>{let n=typeof e==`object`&&e?e:Gg(e??`rect`),i=_n.withThemeDefaults(n,t.getStyles().getTheme());await t.getMovables().add({type:`shape`,json:i,bounds:{width:96,height:96},autoPlace:`viewport`,autoSelect:!0}),r?.setMode(null)}});let u=()=>{e.updateCommand(`sheetBackgroundToggle`,{state:!!t.getPicture()})};u();let d=t.addListeners({onStyleChange:u,onInvalidated:u});return()=>{d()}}(e,n,i,r?.editModeHandler),L=Qb(e,n,i,r?.activateTaskPane,r?.taskPaneArea),R=$b(e,n,i,r?.activateTaskPane,r?.taskPaneArea);return()=>{g(),_(),v(),b(),x(),w(),T(),E(),D(),k(),j(),M(),N(),P(),F(),I(),L(),R()}}var{CommandScopeProvider:tx}=fe;uf();var nx={dynamic:(e,t)=>{let n=ex(e,t),r=t.editable&&t.sheet?ws(e,{editable:t.editable,sheet:t.sheet,flavor:`startEdit`}):void 0,i=t.ownsUndo?Vf(e,{manager:t.manager??null,notifier:t.notifier}):void 0;return()=>{n(),r?.(),i?.()}}},rx=({sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a})=>fe.useCommandScope()?(0,Z.jsx)(ix,{sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a}):(0,Z.jsx)(Z.Fragment,{children:a}),ix=({sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a})=>{let o=Se(),s=Pd(),c=Fe(),l=ae(),u=Uf(),[d,f]=(0,X.useState)(null);(0,X.useEffect)(()=>{if(u||!e)return void f(null);let t=new er(e.getTransactions());return f(t),()=>t.close()},[u,e]);let p=u??d,m=!u&&!!d,h=(0,X.useMemo)(()=>({serializer:{parse:t=>t?e?.getStyles().parseColor(t)??null:null,stringify:e=>e?e.toString():``}}),[e]),[g,_]=ge(`sheet.lastFillColor`,e?.getStyles().parseColor(xn.Scheme.Bg2),h),[v,y]=ge(`sheet.lastFontColor`,e?.getStyles().parseColor(e?.getStyles().getNormal().getFont().getColor()),h),[b,x]=ge(`sheet.lastBorder`,null),S=(0,X.useRef)(g);S.current=g;let C=(0,X.useRef)(v);C.current=v;let w=(0,X.useRef)(b);w.current=b;let T=(0,X.useMemo)(()=>({getLastFillColor:()=>S.current,setLastFillColor:_,getLastFontColor:()=>C.current,setLastFontColor:y,getLastBorder:()=>w.current,setLastBorder:x}),[_,y,x]),E=(0,X.useMemo)(()=>({scopeName:`sheet`,contributor:nx,data:{sheet:e,editable:t,ownsUndo:m,notifier:o,manager:p??void 0,activateTaskPane:(e,t)=>s.activate(e,t),taskPaneArea:s,editModeHandler:c,globalClipboard:l,pickerMemory:T,viewport:i}}),[e,t,m,o,p,s,c,l,T,i]);return(0,Z.jsx)(tx,{spec:E,scopeRef:n,elementRef:r,children:(0,Z.jsx)(Hf.Provider,{value:p,children:a})})};ix.displayName=`SheetCommandProviderInner`;var ax=`_loading-panel_bjv3h_1`,ox=`_loading-spinner_bjv3h_10`,sx=e=>{let{transitionDelay:t,transparentBackground:n,onMount:r,onUnmount:i,className:a,style:o,...s}=e;return(0,Z.jsx)(`div`,{className:Q(ax,a),style:{background:n?`transparent`:`var(--sxl-color-base-100, #fff)`,...o},...s,children:(0,Z.jsx)(`div`,{className:ox})})},cx=e=>{let{error:t,style:n,...r}=e;return(0,Z.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,textAlign:`center`,boxSizing:`border-box`,...n},...r,children:t instanceof Error?t.message:String(t)})},lx=`_sheetxl-sheet_ap3es_5`,ux=`_viewport-overlay_ap3es_6`,dx=(0,X.memo)(e=>{let t=Fe();return(0,Z.jsx)(wt,{...e,dismiss:t.getMode()?.key===`edit`})});dx.displayName=`SheetRangeTooltipHost`;var fx=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,style:i=_e.EmptyCssProperties,ref:a,colorScheme:s,gridColorScheme:l,onSheetContextMenu:d,onFillMenu:p,showColumnHeaders:m,propsColumnHeader:h,showRowHeaders:_,propsRowHeader:v,showScrollbars:y=!0,showCellErrors:b=!0,showCircularReferences:x=!0,propsScrollPane:S,viewport:w,onViewportChange:T,layers:E,renderMovable:D=dd,renderCommentCard:O,renderHyperlinkCard:k,propsHyperlink:A,renderCellErrorTip:j,renderValidationPrompt:M,renderValidationAlert:N,renderTableToolbar:P,renderPivotToolbar:I,propsOutline:L,viewportComponent:R,onFirstRender:ee,editable:z,onFocus:B,onBlur:V,propsGrid:H,propsCellRender:W,children:te,...ie}=e;if((0,X.useEffect)(()=>{zn._validate(!0)},[]),!n)throw Error(`IWorksheet must be provided.`);let[ae,oe]=(0,X.useReducer)(e=>e+1,0),[,se]=(0,X.useReducer)(e=>e+1,0),ce=(0,X.useRef)(null),K=(0,X.useRef)(!1),le=(0,X.useRef)(null),de=(0,X.useRef)(null);(0,X.useMemo)(()=>{de.current!==n&&(le.current=n?n.getId():null),de.current=n},[n]);let fe=We(l)===`dark`,pe=Ue();Gr();let he=(0,X.useId)(),ge=(0,X.useMemo)(()=>me(`sheet`,he),[he]),ve=(0,X.useMemo)(()=>St({scope:`.${ge}`}),[ge]),ye=(0,X.useMemo)(()=>Yr(`sxl-defaults`,`.${ge}`),[ge]),be=n.getStyles(),xe=be.getTheme(),Ce=be.getDefaultFontSize(),we=(0,X.useMemo)(()=>{let e=be.getNormal().measureText(``,Ce,xe.getFontScheme().getMinorFont()).lineHeight;return Zr(xe,Ce,e,`sxl-defaults`,`.${ge}`)},[be,xe,Ce,ge]),Te=Fe(),Ee=(0,X.useCallback)(e=>{},[]),[De,Oe]=(0,X.useState)(null),ke=(0,X.useRef)(null),Ae=(0,X.useCallback)(e=>{e&&(Oe(e),ke.current=e)},[]),[Me,Ne]=(0,X.useState)(()=>n?.getView()),Pe=(Me?.getZoomScale()??100)/100,Ie=m??Me?.isShowColumnHeaders(),Le=_??Me?.isShowRowHeaders(),[ze,Ve]=(0,X.useState)({width:0,height:0}),He=ze.width,Ge=ze.height,Ke=(0,X.useMemo)(()=>{let e=bx,t=yx,r=n?.getStyles().getNormal().getFont();if(ze.width>0&&ze.height>0){let n=r?.toCSS()?.fontFamily??`Calibri`,i=r?.getSize()??8.25,a=Vn.getShared().getByName(n).table.measure(``+Math.max(ze.height,xx),Math.ceil(i*un.getDeviceScale()));e=a.width??e,t=(a.ascent??a.lineHeight)+(a.descent??0)}return{width:Math.round(e+2*Sx+1),height:Math.round(t+3)}},[He,Ge,n]),qe=e=>({width:Le?e*Ke.width:1,height:Ie?e*Ke.height:1}),{width:Je,height:Ye}=qe(Pe),[,Xe]=(0,X.useReducer)(e=>e+1,0);o(n?.getOutline(),{onOutlineChange:()=>Xe()});let Ze=n?.getOutline(),[$e,tt]=(0,X.useState)(()=>n?.getView().isShowOutlineSymbols()??!1);(0,X.useLayoutEffect)(()=>{tt(n?.getView().isShowOutlineSymbols()??!1)},[n]),o(n?.getView(),{onAnyChange:()=>{tt(n.getView().isShowOutlineSymbols())}});let nt=$e?Ze.getLevelCount(Y.Axis.Row):0,rt=$e?Ze.getLevelCount(Y.Axis.Column):0,it=e=>Math.round((L?.laneSize??Cx)*e),at=it(Pe),ot=nt>0?nt+1:0,st=rt>0?rt+1:0,lt=L?.laneGap??1,dt=e=>{let t=it(e);return{width:ot>0?lt+ot*t:0,height:st>0?lt+st*t:0}},{width:ft,height:q}=dt(Pe),pt=e=>{let t=qe(e),n=dt(e);return{left:t.width+n.width,top:t.height+n.height}},[mt]=bg(n.getColumnHeaders()),[ht]=bg(n.getRowHeaders()),gt=mt.getDefaultSize()+Je+1,vt=ht.getDefaultSize()+Ye+1,yt=(0,X.useRef)(new Map),bt=(0,X.useRef)(null),xt=(0,X.useMemo)(()=>({getColOffset:e=>mt.getOffset(e),getColIndex:e=>mt.getIndex(e),getRowOffset:e=>ht.getOffset(e),getRowIndex:e=>ht.getIndex(e)}),[mt,ht]),[Ct,wt]=(0,X.useState)(!1),Et=ha(),Dt=(0,X.useMemo)(()=>Oa(n,{referenceMode:Et}),[n.getWorkbook()??n,Et]),Ot=z??Dt,kt=Se();(0,X.useEffect)(()=>Ot.subscribeCommitError(e=>{kt?.showError?.(e instanceof Error?e:String(e))}),[Ot,kt]),(0,X.useEffect)(()=>{if(!Ot)return;let e=Ot.getSession();return Ot.subscribe(()=>{let t=e;if(e=Ot.getSession(),!t||e||!t.getActiveEditorId()?.startsWith(`inline:`))return;let n=ke.current;n?.contains(document.activeElement)&&n.focus()})},[Ot]);let At=Re(Ot,e=>e.getSession())?.getCoords()??null,[jt,Mt]=(0,X.useState)();(0,X.useEffect)(()=>{if(n&&!n.isDeleted())return n.getEntireRange().addListener(()=>{an.current.clear()})},[n]);let Nt=G(e=>{if(Mt(e),!n||le.current)return;let t=(n.getView().getZoomScale()??100)/100;n.getView().setTopLeft(e?{left:e.left/t,top:e.top/t}:null),T?.(e)},[n,T]),[Pt,It]=(0,X.useState)(()=>n?.getView().getTopLeft()),Lt=(0,X.useMemo)(()=>{let e=n?.getView().getTopLeft();return new re({topLeft:{left:(e?.left??0)*Pe,top:(e?.top??0)*Pe},zoom:Pe})},[]),Rt=w??Lt;(0,X.useEffect)(()=>Rt.subscribe(()=>{Rt.isReady()&&Rt.isSettled()&&(K.current?Rt.getScroll():Nt(Rt.getMetrics()))}),[Rt]);let zt=(0,X.useRef)(Pt);zt.current=Pt,(0,X.useLayoutEffect)(()=>{let e=zt.current;Rt.setZoom(Pe,(e?.left??0)*Pe,(e?.top??0)*Pe)},[Rt,Pe]),(0,X.useLayoutEffect)(()=>{Pt?.left!=null&&Rt.setTarget(Pt.left*Pe,Rt.getTarget().top)},[Rt,Pt?.left,Pe]),(0,X.useLayoutEffect)(()=>{Pt?.top!=null&&Rt.setTarget(Rt.getTarget().left,Pt.top*Pe)},[Rt,Pt?.top,Pe]),(0,X.useLayoutEffect)(()=>{K.current=!1},[Pe]);let Bt=(0,X.useRef)(n?.getId()??null);(0,X.useLayoutEffect)(()=>{let e=n?.getId();if(Bt.current===e)return;Bt.current=e;let t=n?.getView().getTopLeft(),r=(n?.getView().getZoomScale()??100)/100;Rt.setTarget((t?.left??0)*r,(t?.top??0)*r)},[Rt,n]);let Vt=G(e=>{let t=C.cellToRange(e);if(le.current||n.isDeleted())return t;let r=n.getRange(t,{ignoreHidden:!0}).getMerges();return r.length===0?t:r[0]},[n]),Ht=e=>{let t=e?.coords?.colIndex??0,n=e?.coords?.rowIndex??0;if(!e||t===0&&n===0)return null;let r={};return t>0&&(r[g.Left]={index:t,offset:e.topLeft?.left??0}),n>0&&(r[g.Top]={index:n,offset:e.topLeft?.top??0}),r},[Ut,Wt]=(0,X.useState)(()=>Ht(n.getView().getFreezePanes())),Gt=Os(n),Kt=G(()=>jt,[jt]),[qt,Jt]=(0,X.useState)(!(Me?.getMovableSelection().isEmpty()??1)),Yt=At!==null||qt,Xt=(0,X.useMemo)(()=>{let e=Te.getMode();return e?.cursor?e.cursor:null},[null,Te]);o(n?.getView(),{onFreezePaneChange:()=>{Wt(Ht(n.getView().getFreezePanes()))},onTopLeftChange:()=>{It(n.getView().getTopLeft())},onZoomScaleChange:()=>{an.current.clear(),se()},onMovableSelectionChange:()=>{Jt(!n.getView().getMovableSelection().isEmpty())}}),o(n,{onViewChange(){Ne(n.getView())},onLayoutChange:()=>{let e=n.getEntireRange();Ve({height:e.getRowCount(),width:e.getColumnCount()}),Qt()},onStyleChange:()=>{Qt()},onMovablesChange:()=>{},onTablesChange:()=>{Qt()},onInvalidated:()=>{Qt()}}),o(n,{onRequestScrollIntoView:async(e,t)=>{if(!t)return!1;let n={colIndex:t?.coords?.colStart,rowIndex:t?.coords?.rowStart};return await ke.current?.scrollCellCoordsIntoView(n,t?.scroll),!0},onRequestFocus:()=>f.whenFocus(Zt.current),onRequestViewport:async()=>{let e=Kt();return e?{x:e.left,y:e.top,width:e.width,height:e.height}:null}},_x);let Zt=je(t,()=>{let e=e=>{bt.current=null,ke.current?.focus(e)},t=async(e=null)=>{if(e||=n?.getView().getMovableSelection().getActive()??null,!e)return!1;let t=e.getRange().getCoords();if(!t)return!1;let r=ke.current?.getPaneFromCell({colIndex:t.colStart,rowIndex:t.rowStart});if(!r)return!1;let i=r.getAnchor(),a=n?.getView().getMovableSelection();a&&!a.isSelected(e)&&a.select([e]);let o=yt.current?.get(i);return o?.current?(await o.current.focusMovable(e),!0):(bt.current={movable:e,anchor:i},!0)};return{getGridSurface:()=>ke.current,getRowHeaderElement:()=>gn.current,getColumnHeaderElement:()=>J.current,focus:r=>{let i=Ot.getSession(),a=i?.getCoords().scope;(!i||a&&a!==n.getName())&&(n?.getView().getMovableSelection().isEmpty()??1?e(r):t())},focusSheet:e,focusMovable:t,contains:e=>ke.current?.contains?.(e)??!1,invalidate:Qt,isSheetElement:()=>!0,getWorksheet:()=>n}},[n]),Qt=(0,X.useCallback)(()=>{le.current||(an.current.clear(),ke.current?.invalidate(),oe?.())},[]),$t=(0,X.useMemo)(()=>R?(0,Z.jsx)(`div`,{className:Q(`viewport-overlay`,ux),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`},children:R}):(0,Z.jsx)(Z.Fragment,{}),[R]),en=null;Ie&&Le&&(en=(0,Z.jsx)(Ug,{width:Je,height:Ye,sheet:n,colorScheme:s,style:{gridColumn:`2 / 3`,gridRow:`2 / 3`},onMouseDown:e=>{e.nativeEvent.which===U.Right?d?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):ke.current?.focus()}}));let tn=G(e=>{let t=n?.getView();if(!t)return;let r=t.getZoomScale(),i=Math.min(400,Math.max(10,Math.round(100*e.zoom)));e.phase===`end`&&Math.abs(i-100)<3&&(i=100);let a=e.panX??0,o=e.panY??0;if(i===r){if(a!==0||o!==0){let e=Rt.getTarget();Rt.setTarget(e.left-a,e.top-o)}return}let s=r/100,c=i/100,l=ce.current?.getBoundingClientRect(),u=l?Math.max(0,e.clientX-l.left):0,d=l?Math.max(0,e.clientY-l.top):0,f=t.getTopLeft(),p=pt(s),m=pt(c),h=t.getFreezePanes().coords,g=(h?.colIndex??0)>0,_=(h?.rowIndex??0)>0,v={left:Math.max(0,(f?.left??0)-a/c+(g?0:u/s-u/c+(m.left-p.left)/c)),top:Math.max(0,(f?.top??0)-o/c+(_?0:d/s-d/c+(m.top-p.top)/c))};e.phase,e.zoom,K.current=!0,t.setTopLeft(v),t.setZoomScale(i)},[n]);(0,X.useEffect)(()=>Rt.subscribeZoom(tn),[Rt,tn]),(0,X.useEffect)(()=>{Ne(n.getView()),Wt(Ht(n.getView().getFreezePanes())),an.current.clear(),oe()},[De,n?.getView()]);let nn=(0,X.useCallback)((e,t)=>ht.hiddenHeadersAt(e,t),[ht]),rn=(0,X.useCallback)((e,t)=>mt.hiddenHeadersAt(e,t),[mt]),an=(0,X.useRef)(new Map),on=(0,X.useMemo)(()=>({entries:[]}),[n]),sn=G((e,t)=>{if(le.current)return[];let r=an.current,i=t??e.getVisibleRange();if(!i)return[];let a=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,o=r.get(a);if(o)return o;let s=[];if(n.getRange(i).forEach((e,t)=>{let n=t.getCoords(),r=t.getCell();if(!(e=>{if(e.isEmpty())return!1;let t=e.getSpans();if(t.width>1||t.height>1||e.getStyle().hasVisibleStyling()||Me.isShowFormulas()&&e.getFormula()!==null)return!0;let n=e.getValue();return n!==null&&!(!Me.isShowZeros()&&n===0&&e.getType()===wn.Number)})(r))return;let i;Me.isShowFormulas()||(i=r.getExtrusions()??void 0),s.push({cell:n,value:r,range:i})},vx),r.set(a,s),r.size>12){let e=r.keys().next().value;e!==void 0&&r.delete(e)}return s},[n,Me.isShowZeros(),Me.isShowFormulas()]),cn=(0,X.useMemo)(()=>Tt(),[]),ln=Qe(cn,rg(Y.Axis.Column),!1),dn=Qe(cn,rg(Y.Axis.Row),!1),fn=(0,X.useMemo)(()=>({...Be(`app`,pe),propsPath:Tx}),[pe]),pn=(0,X.useMemo)(()=>({...Be(`app`,pe),propsPath:Ex}),[pe]),mn=ln?pn:fn,hn=dn?pn:fn,gn=(0,X.useRef)(null),_n=(0,X.useMemo)(()=>(0,Z.jsx)(Rg,{ref:gn,tabIndex:-1,freezeStart:Ut?.[g.Top],oppositeSize:Je,sheetHeader:n.getRowHeaders(),colorScheme:s,propsCellRender:W,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),viewport:Rt,onSheetContextMenu:d,onFocus:()=>{ke.current?.focus()},style:{position:`relative`,flex:`0`,gridColumn:`2 / 3`,gridRow:`3 / 4`,zIndex:1}}),[Je,Ye,n,W,Rt,Ut?.[g.Top],d,v,De]),J=(0,X.useRef)(null),vn=(0,X.useMemo)(()=>(0,Z.jsx)(Rg,{ref:J,tabIndex:-1,freezeStart:Ut?.[g.Left],oppositeSize:Ye,sheetHeader:n.getColumnHeaders(),colorScheme:s,propsCellRender:W,viewport:Rt,onSheetContextMenu:d,onFocus:()=>{ke.current?.focus()},style:{position:`relative`,display:`flex`,gridColumn:`3 / 4`,gridRow:`2 / 3`,zIndex:1}}),[Ye,n,W,Rt,Ut?.[g.Left],d,h,De]),yn=xh(),bn=wh(n,`cells`,yn),xn=(0,X.useMemo)(()=>{let e=n.getId();return[(0,Z.jsx)(Ps,{sheet:n,editable:Ot,onEditRejected:Gt},`editor-start-[${e}]`),(0,Z.jsx)(Fs,{editable:Ot},`virtual-keyboard-[${e}]`),(0,Z.jsx)(gg,{sheet:n,onSheetContextMenu:d},`context-menu-[${e}]`),(0,Z.jsx)(Wu,{sheet:n},`background-[${e}]`),(0,Z.jsx)(Bu,{sheet:n,sheetView:Me,getVisibleCells:sn,bordersCache:on},`gridlines-[${e}]`),(0,Z.jsx)(hc,{getVisibleCells:sn,sheet:n},`fills-[${e}]`),(0,Z.jsx)(Bp,{sheet:n},`conditional-bars-[${e}]`),(0,Z.jsx)(Pl,{sheet:n,sheetView:Me,propsCellRender:W,editable:Ot,onEditRejected:Gt},`cells-[${e}]`),(0,Z.jsx)(Nl,{getVisibleCells:sn,bordersCache:on,sheet:n},`cell-borders-[${e}]`),(0,Z.jsx)(Up,{sheet:n},`conditional-icons-[${e}]`),(0,Z.jsx)(ap,{sheet:n},`spill-[${e}]`),(0,Z.jsx)(om,{sheet:n},`cell-indicators-[${e}]`),(0,Z.jsx)(Hh,{sheet:n,sheetView:Me},`locked-hatch-[${e}]`),x?(0,Z.jsx)(nm,{sheet:n},`circular-[${e}]`):null,(0,Z.jsx)(bu,{sheet:n},`pivot-frame-[${e}]`),(0,Z.jsx)(Us,{sheet:n,onFillMenu:p},`selection-[${e}]`),(0,Z.jsx)(Bf,{sheet:n,renderToolbar:P},`table-[${e}]`),(0,Z.jsx)(Xf,{sheet:n},`table-commands-[${e}]`),(0,Z.jsx)(ip,{sheet:n},`pivot-commands-[${e}]`),(0,Z.jsx)($s,{sheet:n,sheetView:Me,className:`references`},`ref-picker-[${e}]`),(0,Z.jsx)(jg,{sheet:n},`clipboard-[${e}]`),(0,Z.jsx)(Fl,{sheet:n,onColumnButtonMouseDown:W?.onColumnButtonMouseDown,propsColumnButton:W?.propsColumnButton,renderColumnButton:W?.renderColumnButton},`column-buttons-[${e}]`),(0,Z.jsx)(yu,{sheet:n,onPivotButtonMouseDown:W?.onPivotButtonMouseDown},`pivot-controls-[${e}]`),(0,Z.jsx)(Iu,{sheet:n,renderToolbar:I},`pivot-toolbar-[${e}]`),(0,Z.jsx)(Kp,{sheet:n},`validation-[${e}]`),(0,Z.jsx)(Jc,{sheet:n,editable:Ot,renderPrompt:M,renderAlert:N},`validation-prompt-[${e}]`),(0,Z.jsx)(Zp,{sheet:n,editable:Ot},`validation-dropdown-[${e}]`),(0,Z.jsx)(km,{sheet:n},`comments-[${e}]`),O?(0,Z.jsx)(zm,{sheet:n,renderCard:O},`comment-card-[${e}]`):null,(0,Z.jsx)(wf,{sheet:n,renderMovable:D},`movable-[${e}]`),(0,Z.jsx)(et,{className:`grid-border`,children:(0,Z.jsx)(ct,{fill:!0,className:`grid-border-box`,...Be(`app`,pe),style:Dx})},`grid-border-[${e}]`),(0,Z.jsx)(Ms,{sheet:n,editable:Ot,darkMode:fe},`editor-[${e}]`),b?(0,Z.jsx)(ul,{className:`errors`,sheet:n,renderTip:j},`cell-errors-[${e}]`):null,(0,Z.jsx)(vl,{sheet:n,renderCard:k,...A},`hyperlink-card-[${e}]`),(0,Z.jsx)(tg,{sheet:n},`resize-indicator-[${e}]`),(0,Z.jsx)(pg,{sheet:n},`freeze-grip-[${e}]`),E,...bn,(0,Z.jsx)(dx,{},`range-tooltips-[${e}]`)]},[n,be,D,O,k,A,j,M,N,P,I,d,p,E,bn,Ot,b,x,Me,fe,pe,sn,on,W,Gt]),Sn=(0,X.useCallback)((e,t)=>(0,Z.jsx)(af,{pane:e,children:t}),[]),[Cn,Tn]=(0,X.useState)(!1),En=(0,X.useMemo)(()=>{let e=n.getStyles().getNormal(),t=e.getFont(),r=e.getFill();return(0,Z.jsx)(_h,{value:`cells`,children:(0,Z.jsx)(ut,{className:`sheetxl-sheet-primary`,wrapPane:Sn,style:{...gx,cursor:Xt??null??`cell`,...r.toCSS(`adaptive`),...t.toCSS(`adaptive`,Pe),minWidth:gt,minHeight:vt},ref:Ae,...H,onFirstRender:e=>{Tn(!0),H?.onFirstRender?.(e)},freezeLeft:Ut?.[g.Left],propsFreezeLeft:mn,freezeTop:Ut?.[g.Top],propsFreezeTop:hn,columnCount:ze.width,rowCount:ze.height,metrics:xt,getRangeFromCell:Vt,hiddenRowsAt:nn,hiddenColumnsAt:rn,viewport:Rt,children:xn},`grid-main`)})},[He,Ge,Xt,null,gt,vt,ae,xn,mn,hn]);(0,X.useEffect)(()=>{le.current||an.current.clear()},[Ut,Pe,H,gt,vt,Xt,xn,null]),(0,X.useEffect)(()=>{le.current||oe()},[Ut,Pe,Pt?.left,Pt?.top,H,gt,vt,Xt,xn,null]);let Dn=hx;y||(Dn={...Dn,...i});let On=fe?`dark`:`light`,kn=G(e=>{let{style:t,...r}=e;return(0,Z.jsx)(Fg,{...r,style:{...t,paddingLeft:`4px`,paddingRight:`4px`},sheet:n})},[n]),An=(0,X.useMemo)(()=>{let{renderButton:e,renderLevelButton:t,laneSize:r,laneGap:i,bracketGap:a,style:o,...s}=L??{},c=(e,t)=>({...o,gridColumn:e,gridRow:t,position:`relative`}),l=[];return ot>0&&(l.push((0,Z.jsx)(zg,{...s,sheet:n,axis:Y.Axis.Row,lanes:ot,thickness:ft,renderButton:e,laneGap:i,bracketGap:a,freezeStart:Ut?.[g.Top],viewport:Rt,colorScheme:pe,style:c(`1 / 2`,`3 / 4`)},`outline-row`)),Ie&&l.push((0,Z.jsx)(Bg,{...s,sheet:n,axis:Y.Axis.Row,lanes:ot,laneSize:at,laneGap:i,renderLevelButton:t,colorScheme:pe,style:c(`1 / 2`,`2 / 3`)},`outline-row-levels`))),st>0&&(l.push((0,Z.jsx)(zg,{...s,sheet:n,axis:Y.Axis.Column,lanes:st,thickness:q,renderButton:e,laneGap:i,bracketGap:a,freezeStart:Ut?.[g.Left],viewport:Rt,colorScheme:pe,style:c(`3 / 4`,`1 / 2`)},`outline-column`)),Le&&l.push((0,Z.jsx)(Bg,{...s,sheet:n,axis:Y.Axis.Column,lanes:st,laneSize:at,laneGap:i,renderLevelButton:t,colorScheme:pe,style:c(`2 / 3`,`1 / 2`)},`outline-column-levels`))),l},[n,ot,st,ft,q,at,Ut?.[g.Top],Ut?.[g.Left],Rt,pe,L,Le,Ie]),jn=(0,Z.jsxs)(`div`,{...Be(`grid`,On),style:{gridColumn:`3 / 4`,gridRow:`3 / 4`,overflow:`hidden`,position:`relative`},ref:ce,children:[En,$t,(0,Z.jsx)(yg,{style:{position:`absolute`,right:24,bottom:4},colorLicensee:`var(--sxl-color-primary)`,colorCredits:`var(--sxl-color-base-content)`})]}),Mn=u([Zt,Ee]),Nn=(0,Z.jsxs)(`div`,{className:ge,style:Dn,onTouchStart:()=>{In()},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||(wt(!0),B?.(e))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(wt(!1),V?.(e))},ref:Mn,...ie,children:[(0,Z.jsx)(`style`,{children:ve}),(0,Z.jsx)(`style`,{children:ye}),(0,Z.jsx)(`style`,{children:we}),(0,Z.jsx)(`div`,{className:Q(r,`sheetxl-sheet`,lx),ref:a,...Be(`grid`,On),style:{position:`absolute`,width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`auto auto 1fr`,gridTemplateRows:`auto auto 1fr`,flex:`1 1 100%`},children:(0,Z.jsx)(Ft,{store:cn,children:(0,Z.jsxs)(Sh,{value:yn,children:[te,An,en,vn,_n,jn]})})})]});y&&(Nn=(0,Z.jsx)(F,{style:{flex:`1 1 100%`,width:`100%`,height:`100%`,overflow:`hidden`,background:`var(--sxl-color-base-100)`,minHeight:2*Ke.height,minWidth:2*Ke.width,...i},viewport:Rt,disableTouch:Yt,zoomable:!0,renderScrollbarHorizontal:kn,renderScrollbarVertical:kn,...S,children:Nn})),(0,X.useEffect)(()=>{le.current=null,an.current.clear(),oe?.(),Ct&&Zt.current?.focus()},[n]);let[Pn,Fn]=(0,X.useState)(!1),In=G(()=>{Pn||Fn(!0)},[Pn]);return(0,X.useEffect)(()=>{if(Cn)return typeof ee==`function`&&ee(),_e.detectIt().primaryInput===`touch`&&In(),()=>{}},[ee,Cn,Pn]),(0,Z.jsx)(rx,{sheet:n,editable:z,elementRef:Zt,viewport:Rt,children:(0,Z.jsx)(ue,{themeScopeClass:ge,themeSurface:`app`,themeMode:s,children:(0,Z.jsx)(_t,{children:(0,Z.jsx)(c,{sheet:n,children:(0,Z.jsx)(ne,{scope:n.getWorkbook(),children:Nn})})})})})}));fx.displayName=`WorksheetElementBody`;var px=e=>{let[t,n]=(0,X.useState)(()=>h.isPromiseLike(e)||Vn.getShared().isLoading()?{status:`loading`}:{status:`loaded`,sheet:e});return(0,X.useEffect)(()=>{let t=!0;return(async()=>{try{let r=await e;if(await Vn.getShared().whenReady(),!t)return;n(e=>e.status===`loaded`&&e.sheet===r?e:{status:`loaded`,sheet:r})}catch(e){t&&n({status:`error`,error:e})}})(),()=>{t=!1}},[e]),t},mx=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,onSheetChange:r,propsSheetLoading:i,renderSheetLoading:a=sx,renderSheetError:o=cx,...s}=e,c=px(n),l=c.status===`loaded`?c.sheet:null,u=G(r??(()=>{}),[r]);return(0,X.useEffect)(()=>{u(l)},[l]),l?(0,Z.jsx)(yf,{children:(0,Z.jsx)(fx,{...s,sheet:l,ref:t})}):(0,Z.jsx)(`div`,{className:e.className,style:{position:`relative`,...e.style},children:c.status===`error`?(0,Z.jsx)(xe,{render:o,props:{error:c.error}}):(0,Z.jsx)(xe,{render:a,props:{...i}})})}));mx.displayName=`WorksheetElement`;var hx=Object.freeze({flex:`1 1 100%`,width:`100%`,height:`100%`,minWidth:0,minHeight:0,display:`flex`,alignContent:`stretch`,position:`relative`}),gx={position:`absolute`,top:0,left:0,bottom:0,right:0},_x={ignoreModelChange:!0},vx={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:ac},yx=20,bx=40,xx=100,Sx=4,Cx=18,wx=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,Tx={stroke:`var(--sxl-color-neutral, grey)`},Ex={stroke:`var(--sxl-color-primary)`,strokeWidth:`2px`},Dx={pointerEvents:`none`,borderTop:wx,borderLeft:wx,borderRight:wx,borderBottom:`none`},Ox=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),kx=(0,X.memo)(e=>{let{kind:t,style:n,className:r}=e;return t===`chart`?(0,Z.jsx)(Ox,{className:r,style:{width:`1em`,height:`1em`,...n}}):t===`macro`?(0,Z.jsx)(j,{iconKey:`ScriptMacro`,className:r,style:n}):t===`dialog`?(0,Z.jsx)(j,{iconKey:`ValidationInformation`,className:r,style:n}):null});kx.displayName=`SheetKindIcon`;var Ax=(0,X.memo)(e=>{let{sheet:t,onFirstRender:n,style:r,...i}=e,a=z(),[,s]=X.useReducer(e=>e+1,0);o(t,{onNameChange:s}),(0,X.useEffect)(()=>{n?.()},[]);let c=t.getKind(),l=a(c===`chart`?`opaqueSheet.kind.chart`:c===`macro`?`opaqueSheet.kind.macro`:`opaqueSheet.kind.dialog`);return(0,Z.jsxs)(`div`,{role:`region`,"aria-label":t.getName(),style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:`8px`,flex:`1 1 100%`,padding:`24px`,boxSizing:`border-box`,textAlign:`center`,background:`var(--sxl-color-base-100, #fff)`,color:`var(--sxl-color-base-content, inherit)`,...r},...i,children:[(0,Z.jsx)(kx,{kind:c,style:{width:`48px`,height:`48px`,fontSize:`48px`}}),(0,Z.jsx)(`div`,{style:{fontWeight:600},children:t.getName()}),(0,Z.jsx)(`div`,{children:l}),(0,Z.jsx)(`div`,{style:{opacity:.7,maxWidth:`40em`},children:a(`opaqueSheet.carried`)})]})});Ax.displayName=`OpaqueSheetElement`;var jx=[`selectedItemWithData`,`unselectedItemWithData`,`selectedItemWithNoData`,`unselectedItemWithNoData`],Mx=(0,X.memo)(e=>{let{styleName:t,styles:n,width:r=56,height:i=60,style:a,...o}=e,s=cn(t,n),c=(e,t)=>(0,Z.jsx)(`div`,{style:{width:`${t}%`,height:2,backgroundColor:e.color??`currentColor`,opacity:.85}}),l=sn(s?.headerRow,n);return(0,Z.jsxs)(`div`,{...o,style:{width:r,height:i,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,gap:2,padding:3,overflow:`hidden`,backgroundColor:`var(--sxl-color-base-100, white)`,border:`var(--sxl-color-neutral, grey) solid 1px`,...sn(s?.wholeTable,n),...a},children:[(0,Z.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:7,flex:`none`,...l},children:c(l,45)}),jx.map((e,t)=>{let r=sn(s?.[e],n);return(0,Z.jsx)(`div`,{style:{flex:`1 1 0`,minHeight:0,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid transparent`,...r},children:c(r,40)},t)})]})});Mx.displayName=`SlicerStylePreview`,M.register(`shape`,()=>d(()=>import(`./DYJSIlNxrNw8qk-w.js`),[],import.meta.url));var Nx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1387 h -469 v -640 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 1131 h -469 v -811 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z`})]}),Px=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1515 h -469 v -1195 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 875 h -469 v -555 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z`})]}),Fx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z`})]}),Ix=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),Lx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1877 299 h -1770 v -43 h 1770 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),Rx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z`})]}),zx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z`})]}),Bx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z`})]}),Vx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z`})]}),Hx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z`})]}),Ux=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1813 277 v 299 h -1706 v -299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1088 v 299 h -810 v -299 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 896 1109 h -795 v -42 h 838 v 322 h -43 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z`})]}),Wx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 704 832 v -469 h 640 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1600 v -469 h 811 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z`})]}),Gx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 533 832 v -469 h 1195 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1173 1600 v -469 h 555 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z`})]}),Kx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z`})]}),qx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),Jx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1941 1941 h -1834 v -1834 h 1834 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z`})]}),Yx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`})]}),Xx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z`})]}),Zx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z`})]}),Qx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z`})]}),$x=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),eS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),tS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),nS={themed:`_themed_f2asj_9`,small:`_small_f2asj_36`,medium:`_medium_f2asj_37`,large:`_large_f2asj_38`},rS=(0,X.memo)(e=>{let{size:t=`medium`,className:n,children:r,...i}=e;return(0,Z.jsx)(`span`,{className:Q(`icon`,nS.themed,nS[t],n),...i,children:r})});rS.displayName=`ThemedChartIcon`;var iS={Column:`column`,ColumnStacked:`columnStacked`,ColumnStackedPercent:`columnStackedPercent`,Line:`line`,LineStacked:`lineStacked`,LineStackedPercent:`lineStackedPercent`,LineMarkers:`lineMarkers`,LineStackedMarkers:`lineStackedMarkers`,LineStackedPercentMarkers:`lineStackedPercentMarkers`,Pie:`pie`,PieDoughnut:`pieDoughnut`,Bar:`bar`,BarStacked:`barStacked`,BarStackedPercent:`barStackedPercent`,Area:`area`,AreaStacked:`areaStacked`,AreaStackedPercent:`areaStackedPercent`,ScatterMarkers:`scatterMarkers`,ScatterLinesMarkersSmooth:`scatterLinesMarkersSmooth`,ScatterLinesMarkers:`scatterLinesMarkers`,ScatterLinesSmooth:`scatterLinesSmooth`,ScatterLines:`scatterLines`,Bubble:`bubble`,Bubble3D:`bubble3D`},aS=new Map;aS.set(iS.Column,{Icon:Ox,description:S(`chart.type.column`),type:`columnClustered`}),aS.set(iS.ColumnStacked,{Icon:Nx,description:S(`chart.type.columnStacked`),type:`columnStacked`}),aS.set(iS.ColumnStackedPercent,{Icon:Px,description:S(`chart.type.columnStackedPercent`),type:`columnStacked100`}),aS.set(iS.Line,{Icon:Fx,description:S(`chart.type.line`),type:`line`}),aS.set(iS.LineStacked,{Icon:Ix,description:S(`chart.type.lineStacked`),type:`lineStacked`}),aS.set(iS.LineStackedPercent,{Icon:Lx,description:S(`chart.type.lineStackedPercent`),type:`lineStacked100`}),aS.set(iS.LineMarkers,{Icon:Rx,description:S(`chart.type.lineMarkers`),type:`lineMarkers`}),aS.set(iS.LineStackedMarkers,{Icon:zx,description:S(`chart.type.lineStackedMarkers`),type:`lineMarkersStacked`}),aS.set(iS.LineStackedPercentMarkers,{Icon:Bx,description:S(`chart.type.lineStackedPercentMarkers`),type:`lineMarkersStacked100`}),aS.set(iS.Pie,{Icon:Vx,description:S(`chart.type.pie`),type:`pie`}),aS.set(iS.PieDoughnut,{Icon:Hx,description:S(`chart.type.pieDoughnut`),type:`doughnut`}),aS.set(iS.Bar,{Icon:Ux,description:S(`chart.type.bar`),type:`barClustered`}),aS.set(iS.BarStacked,{Icon:Wx,description:S(`chart.type.barStacked`),type:`barStacked`}),aS.set(iS.BarStackedPercent,{Icon:Gx,description:S(`chart.type.barStackedPercent`),type:`barStacked100`}),aS.set(iS.Area,{Icon:Kx,description:S(`chart.type.area`),type:`area`}),aS.set(iS.AreaStacked,{Icon:qx,description:S(`chart.type.areaStacked`),type:`areaStacked`}),aS.set(iS.AreaStackedPercent,{Icon:Jx,description:S(`chart.type.areaStackedPercent`),type:`areaStacked100`}),aS.set(iS.ScatterMarkers,{Icon:Yx,description:S(`chart.type.scatterMarkers`),type:`xyscatter`}),aS.set(iS.ScatterLinesMarkersSmooth,{Icon:Xx,description:S(`chart.type.scatterLinesMarkersSmooth`),type:`xyscatterSmooth`}),aS.set(iS.ScatterLinesMarkers,{Icon:Qx,description:S(`chart.type.scatterLinesMarkers`),type:`xyscatterLines`}),aS.set(iS.ScatterLinesSmooth,{Icon:Zx,description:S(`chart.type.scatterLinesSmooth`),type:`xyscatterSmoothNoMarkers`}),aS.set(iS.ScatterLines,{Icon:$x,description:S(`chart.type.scatterLines`),type:`xyscatterLinesNoMarkers`}),aS.set(iS.Bubble,{Icon:eS,description:S(`chart.type.bubble`),type:`bubble`}),aS.set(iS.Bubble3D,{Icon:tS,description:S(`chart.type.bubble3D`),type:`bubble3DEffect`});var oS={placement:`bottom-start`,followAnchor:!0},sS=new Set,cS={x:0,y:0,top:0,left:0,bottom:0,right:0,width:0,height:0,toJSON:()=>({})},lS=e=>{let{api:t,grammar:n,disabled:r}=e,i=n===`formula`,a=cr(),o=e.workbook===void 0?a:e.workbook,s=ga().getMode(),c=!!s?.activeInput&&!t.engaged,[l,u]=(0,X.useState)(-1),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(null),h=(0,X.useMemo)(()=>Ao(i?t.tokens:null),[i,t.tokens]),g=(0,X.useMemo)(()=>{if(!i||!t.tokens)return sS;let e;try{e=Za(o)?.getCalculation()??null}catch{e=null}return e?new Set(ss(e,t.tokens,t.tokenBase).flatMap(e=>e.tokens)):sS},[i,t.tokens,t.tokenBase,o]),[_,v]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=t.tokens,n=i&&t.engaged&&e&&l>=0?jo(e,h.matchOf,l,t.tokenBase):null;v(e=>Mo(e,n)?e:n)},[i,t.engaged,t.tokens,t.tokenBase,l,h]);let y=(0,X.useMemo)(()=>No(i?d:null,_,h),[i,d,_,h]),b=l>=0?Math.min(l,t.text.length):t.text.length,x=i&&t.engaged&&t.text.length>0&&Oi(t.text,b),S=x&&b>=t.text.length,C=x&&!S?b:-1,w=(0,X.useMemo)(()=>{if(i){let e=t.tokens;if(!e)return null;let n=t.tokenBase,r=e.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=e.map((e,t)=>{let n=h.unmatched.has(t),i=y.has(t),a=h.depthOf.get(t),o=n||a===void 0||e.referenceIndex!==void 0?void 0:Co(a),s=n?Eo:o??ji(e),c;(s||i||n)&&(c={},s&&(c.color=s),n&&(c.fontWeight=`bold`),i&&(c.color=`transparent`)),g.has(t)&&(c={...c,...Oo});let l=e.text??``,u=C>=r[t]&&C<r[t]+l.length;return(0,Z.jsxs)(`span`,{"data-si":t,style:c,children:[i&&(0,Z.jsx)(`span`,{"aria-hidden":!0,style:wo,children:(0,Z.jsx)(`span`,{style:To(s??`inherit`),children:e.text})}),u?(0,Z.jsxs)(Z.Fragment,{children:[l.slice(0,C-r[t]),(0,Z.jsx)(go,{}),l.slice(C-r[t])]}):l]},`t-${t}`)}),a=t.tokenBase>0?(0,Z.jsx)(`span`,{children:t.text.slice(0,t.tokenBase)},`eq`):null,o=S?(0,Z.jsx)(go,{},`expected`):null;if(!d)return[a,...i,o].filter(Boolean);let{lo:s,hi:c,outline:l}=d,u=l?bo:yo;return[a,...i.slice(0,s),(0,Z.jsx)(`span`,{className:`formula-eval-run`,style:u,children:i.slice(s,c+1)},`eval-run`),...i.slice(c+1),o].filter(Boolean)}if(t.segments.length===0)return null;let e=[];return t.segments.forEach((t,n)=>{n>0&&e.push((0,Z.jsx)(`span`,{children:`,`},`sep-${n}`));let r=d&&d.lo===n;e.push((0,Z.jsx)(`span`,{"data-si":n,style:{...t.valid?{color:gt[n%gt.length]}:null,...r?d.outline?bo:yo:null},children:t.text},`seg-${n}`))}),e},[i,t.tokens,t.tokenBase,t.text,t.segments,h,y,d,S,C,g]),T=!r&&!c&&!!w,E=(0,X.useRef)(null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),[k,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=D.current;if(!e)return;M(e.ownerDocument.activeElement===e);let t=()=>M(!0),n=()=>M(!1);return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[]),(0,X.useLayoutEffect)(()=>{if(!T)return void A(null);let e=D.current,t=E.current;if(!e||!t)return;let n=()=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.getComputedStyle(e);A({position:`absolute`,left:n.left-r.left,top:n.top-r.top,width:n.width,height:n.height,boxSizing:`border-box`,paddingLeft:i.paddingLeft,paddingRight:i.paddingRight,paddingTop:i.paddingTop,paddingBottom:i.paddingBottom,font:i.font,letterSpacing:i.letterSpacing,display:`flex`,alignItems:`center`,whiteSpace:`pre`,overflow:`hidden`,pointerEvents:`none`,textAlign:`left`});let a=O.current;a&&(a.scrollLeft=e.scrollLeft)};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[T,t.text]);let N=ms({text:t.text,getTokens:()=>i?t.tokens:null,active:i&&t.engaged,getCaret:()=>D.current?.selectionStart??t.text.length,getCalculation:()=>{try{return Za(o)?.getCalculation()??null}catch{return null}},getNames:()=>{try{return Za(o)?.getNames()??null}catch{return null}},getLocale:()=>o?.getLocale()??null,applyText:(e,n)=>{t.replaceText(e,n)},hoveredTokenIndex:p,getArgument:()=>i?e.argument??null:null});(0,X.useEffect)(()=>{N.update()},[N.update,t.text,l,t.engaged]);let P=(0,X.useMemo)(()=>({getBoundingClientRect:()=>D.current?.getBoundingClientRect()??cS}),[]),F=X.useCallback(e=>!!E.current?.contains(e),[]),I=pe({label:`formula-field-hint`,anchor:P,autoFocus:!1,disableClickAway:F,propsPopper:oS,renderPopupPanel:N.renderPanel}),L=N.active&&!s?.dragging,R=I.reference;(0,X.useEffect)(()=>{L?R.open(0):R.close(0)},[L,R]);let[ee,z]=(0,X.useState)(null),B=(0,X.useRef)(null),V=(0,X.useRef)(!1),H=()=>{B.current=null,V.current=!1,z(null),f(null),m(null)},U=()=>{V.current||H()},W=Aa(()=>H(),()=>G()),te=t=>{if(!o)return!1;try{return Za(o)?.getCalculation().createFormula(`=`+t,e.home,{target:`display`}).isValid()??!1}catch{return!1}},G=()=>{let n=D.current,r=O.current,a=()=>{V.current&&H()};if(!n||!r||!T)return void a();if(W.isDragging())return;let s=n.selectionStart??0,c=n.selectionEnd??0;if(s===c)return void a();let l=null;if(i){let n=o?Na(t.tokens,t.tokenBase,t.text,s,c,te):null;n&&(l={lo:n.lo,hi:n.hi,key:`sel:f:${n.lo}:${n.hi}:${n.fragment??n.evalIndex}`,evaluate:async()=>{let r=Za(o)?.getCalculation();return r?Ba(n.fragment===null?await r.createFormula(t.text,e.home,{target:`display`}).evaluate({evalIndex:n.evalIndex}):await r.createFormula(`=`+n.fragment,e.home,{target:`display`}).evaluate()):null}})}else{let e=0,n=-1;for(let r=0;r<t.segments.length;r++){r>0&&(e+=1);let i=e;if(e+=t.segments[r].text.length,i<c&&e>s){if(n>=0){n=-1;break}n=r}}if(n>=0&&t.segments[n].valid){let e=n;l={lo:e,hi:e,key:`sel:s:${e}:${t.segments[e].text}`,evaluate:()=>t.evaluateSegment(e)}}}if(!l)return void a();if(l.key===B.current)return;B.current=l.key,V.current=!0,z(null),m(null),f({lo:l.lo,hi:l.hi,outline:!0});let u=r.querySelector(`[data-si="${l.lo}"]`)?.getBoundingClientRect(),d=r.querySelector(`[data-si="${l.hi}"]`)?.getBoundingClientRect();if(!u)return void H();let p=d&&Math.abs(d.top-u.top)<1?{left:(u.left+d.right)/2,top:u.top-6}:{left:(u.left+u.right)/2,top:u.top-6},h=l.key;l.evaluate().then(e=>{B.current===h&&e!=null&&z({...p,text:e})}).catch(()=>{})};(0,X.useEffect)(()=>{t.engaged||H()},[t.engaged]);let ne=n=>{if(n.which!==he.F9||n.shiftKey||n.ctrlKey||n.altKey||n.metaKey)return!1;let a=D.current;if(!i||!a||!o||r||!t.tokens?.length)return!1;let s=a.selectionStart??0,c=a.selectionEnd??0,l;if(s!==c)l=Na(t.tokens,t.tokenBase,t.text,s,c,te);else{let e=Pa(t.tokens);l=e?{...e,...Fa(t.tokens,t.tokenBase,e.lo,e.hi),fragment:null}:null}if(!l)return!1;n.preventDefault(),n.stopPropagation();let u=t.text,d=Za(o)?.getCalculation();if(!d)return!1;let f=Ia(yn(o.getLocale()??`en`).decimal),p=Yn(),m={t:p?.booleans?.true??`TRUE`,f:p?.booleans?.false??`FALSE`};return(async()=>{let t=null,n=``;try{if(t=Ra(l.fragment===null?await d.createFormula(u,e.home,{target:`display`}).evaluate({evalIndex:l.evalIndex}):await d.createFormula(`=`+l.fragment,e.home,{target:`display`}).evaluate(),f,m),t===null||(n=u.slice(0,l.start)+t+u.slice(l.end),!d.createFormula(n,e.home,{target:`display`}).isValid()))return}catch{return}let r=D.current;if(!r||r.value!==u)return;_e.replaceRangeText(r,l.start,l.end,t);let i=l.start,a=l.start+t.length;requestAnimationFrame(()=>{D.current?.value===n&&D.current.setSelectionRange(i,a)})})(),!0};(0,X.useEffect)(()=>{H()},[t.text]);let re={onScroll:e=>{let t=O.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft),H(),G()},onMouseMove:n=>{let r=O.current;if(!r)return;if(W.blocksHover(n)||ja(D.current))return void U();let a=n.clientX,s=n.clientY,c=r.querySelectorAll(`[data-si]`),l=-1,u=null;for(let e=0;e<c.length;e++){let t=c[e].getBoundingClientRect();if(a>=t.left&&a<=t.right&&s>=t.top&&s<=t.bottom){l=Number(c[e].getAttribute(`data-si`)),u=t;break}}if(l<0||!u)return void H();if(i){let n=t.tokens;if(!n||!o)return void H();let i=Ma(n,l);if(!i)return void H();let a=`f:${i.evalIndex}:${i.lo}:${i.hi}`;if(a===B.current)return;B.current=a,z(null),f({lo:i.lo,hi:i.hi}),m(l);let s=r.querySelector(`[data-si="${i.lo}"]`)?.getBoundingClientRect(),c=r.querySelector(`[data-si="${i.hi}"]`)?.getBoundingClientRect(),d=s&&c&&Math.abs(c.top-s.top)<1?{left:(s.left+c.right)/2,top:s.top-6}:{left:(u.left+u.right)/2,top:u.top-6};try{let n=Za(o)?.getCalculation();if(!n)return;let r=n.createFormula(t.text,e.home,{target:`display`});Promise.resolve(r.evaluate({evalIndex:i.evalIndex})).then(e=>{if(B.current!==a)return;let t=Ba(e);t!=null&&z({...d,text:t})}).catch(()=>{})}catch{}return}if(!t.segments[l]?.valid)return void H();let d=`s:${l}:${t.segments[l].text}`;if(d===B.current)return;B.current=d,z(null),f({lo:l,hi:l});let p={left:(u.left+u.right)/2,top:u.top-6};t.evaluateSegment(l).then(e=>{B.current===d&&e!=null&&z({...p,text:e})})},onMouseLeave:U,onDragStart:W.onDragStart,onSelect:e=>{u(D.current?.selectionStart??-1),G()},onPointerDown:e=>{W.begin(e),L&&!I.isOpen&&R.open(0)}},ie=T&&k?(0,Z.jsx)(`div`,{ref:O,"aria-hidden":!0,style:k,children:(0,Z.jsx)(`span`,{style:{whiteSpace:`pre`},children:w})}):null,ae=ee?(0,ir.createPortal)((0,Z.jsx)(`div`,{className:`sxl-formula-eval-tip`,style:{...ka,left:ee.left,top:ee.top},children:ee.text}),document.body):null;return{containerRef:E,inputElRef:D,overlayActive:T,inputHandlers:re,inputExpected:x&&j,handleKeyDown:e=>!!N.handleKeyDown(e)||(e.which===he.Escape&&I.isOpen?(e.preventDefault(),e.stopPropagation(),R.close(0),!0):!!ne(e)),overlayElement:ie,tipElement:ae,hintElement:I.component}},uS=e=>{e.button===0&&e.preventDefault()},dS=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{grammar:n=`formula`,value:r,onChangeInput:i,onChangeText:a,onDone:o,changeOn:s,workbook:c,apiRef:l,hideAdornment:u,hideError:d,home:f,equals:p,pickAs:m,pickSpills:h,allowMulti:g,allowCrossSheet:_,argument:v,disabled:y,className:b,style:x,onKeyDown:S,onFocus:C,onBlur:w,placeholder:T,...E}=e,D=z(),O=ao({value:r,onChange:i,onChangeText:a,onDone:o,changeOn:s,workbook:c,home:f,equals:p,pickAs:m,pickSpills:h,allowMulti:g,allowCrossSheet:_,disabled:y},n);(0,X.useImperativeHandle)(l,()=>O,[O]);let k=lS({api:O,grammar:n,disabled:y,workbook:c,home:f,argument:v}),A=!!O.error&&!k.inputExpected,M=s===`done`,N={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`none`,padding:`0 2px`,margin:0,cursor:`pointer`,color:`inherit`,opacity:.8},P=u?null:(0,Z.jsx)(`span`,{className:`sxl-input-adornment`,onMouseDown:uS,style:{display:`inline-flex`,alignItems:`center`,flex:`0 0 auto`},children:O.engaged&&M&&O.dirty?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`commit-reference`,title:D(`referenceInput.commit`),style:N,disabled:!!O.error,tabIndex:-1,onMouseDown:uS,onClick:()=>{O.commit()},children:(0,Z.jsx)(j,{iconKey:`CheckSuccess`})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`cancel-reference`,title:D(`referenceInput.cancel`),style:N,tabIndex:-1,onMouseDown:uS,onClick:()=>{O.cancel()},children:(0,Z.jsx)(j,{iconKey:`CloseError`})})]}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":`select-current-range`,title:D(`referenceInput.selectCurrent`),style:y||!O.canSelectCurrent?{...N,opacity:.3,cursor:`default`}:N,disabled:y||!O.canSelectCurrent,tabIndex:-1,onMouseDown:uS,onClick:()=>{O.engaged||O.togglePoint(),O.selectCurrent()},children:(0,Z.jsx)(j,{iconKey:`SelectRangeMode`})})});return(0,Z.jsxs)(`div`,{ref:e=>{k.containerRef.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:Q(`sxl-formula-input`,b),"data-grammar":n,"data-error":A?``:void 0,"data-engaged":O.engaged?``:void 0,style:{position:`relative`,display:`inline-flex`,flexDirection:`column`,minWidth:0,fontFamily:`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)`,...x},children:[(0,Z.jsxs)(`span`,{style:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`,border:`1px solid `+(A?`var(--sxl-color-error, #d93025)`:`var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))`),borderRadius:`var(--sxl-input-radius, 4px)`,background:`var(--sxl-input-bg, transparent)`},children:[(0,Z.jsx)(`input`,{...E,type:`text`,spellCheck:!1,autoComplete:`off`,placeholder:T,disabled:y,readOnly:y||O.inputProps.readOnly,"aria-invalid":!!A||void 0,value:O.inputProps.value,ref:e=>{k.inputElRef.current=e,O.inputProps.ref(e)},onChange:O.inputProps.onChange,onKeyDown:e=>{k.handleKeyDown(e)||(O.inputProps.onKeyDown(e),e.defaultPrevented||S?.(e))},onPointerDown:k.inputHandlers.onPointerDown,onMouseDown:O.inputProps.onMouseDown,onSelect:e=>{O.inputProps.onSelect(e),k.inputHandlers.onSelect(e)},onFocus:e=>{O.inputProps.onFocus(e),C?.(e)},onBlur:e=>{O.inputProps.onBlur(e),w?.(e)},onScroll:k.inputHandlers.onScroll,onMouseMove:k.inputHandlers.onMouseMove,onMouseLeave:k.inputHandlers.onMouseLeave,onDragStart:k.inputHandlers.onDragStart,onContextMenu:e=>{e.stopPropagation()},style:{flex:`1 1 auto`,minWidth:0,font:`inherit`,color:`inherit`,background:`none`,border:`none`,outline:`none`,padding:`var(--sxl-input-padding, 4px 6px)`,...k.overlayActive?{color:`transparent`,caretColor:`var(--sxl-color-text, light-dark(#000, #fff))`}:null}}),P]}),!d&&(0,Z.jsx)(`span`,{className:`sxl-formula-input-error`,style:{display:`block`,visibility:A?`visible`:`hidden`,color:`var(--sxl-color-error, #d93025)`,fontSize:`0.75em`,paddingTop:`2px`},children:A?D(O.error):`\xA0`}),k.overlayElement,k.tipElement,k.hintElement]})}));dS.displayName=`FormulaInput`;var fS=`_editable-input_1u3oj_6`,pS=e=>(0,Z.jsx)(`input`,{...e}),mS=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{style:n={},className:r,value:i=``,onSubmit:a,onChange:o,onCancel:s,renderInput:c=pS,styleHover:l={},dragging:u,maxLength:d,disabled:f=!1,readOnly:p=!1,...m}=e,[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(i);(0,X.useEffect)(()=>{b(i)},[i]);let x=(0,X.useRef)(null),[S,C]=(0,X.useState)(null),w=Se(),T=(0,X.useCallback)(function(e){let t=e.message;S!==t&&(w?.showMessage?.(t,{type:K.Error}),C(t))},[w,S]),E=(0,X.useCallback)(e=>{let t=!1;try{t=a?.(e)??!0}catch(e){T(e)}return t?(x.current=null,v(!1),b(e),t):(setTimeout(()=>{x.current?.focus()},0),t)},[a]),D=G(()=>{b(i),x.current=null,v(!1),s?.()},[s,i]),O=(0,X.useMemo)(()=>{if(!_)return null;let e={className:Q(fS),autoFocus:!0,spellCheck:!1,name:`editable-label`,autoComplete:`off`,maxLength:d,type:`text`,value:y,onFocus:e=>{x.current||(x.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{x.current&&E(y)},onChange:e=>{_&&b(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>e.code===`Escape`?(e.preventDefault(),void D()):e.code===`Enter`?(e.preventDefault(),void E(e.target.value)):void(e.code===`Tab`?E(e.target.value):e.stopPropagation())};return(0,Z.jsx)(xe,{render:c,props:e})},[_,y,E,D,c,f]),[k,A]=(0,X.useState)();(0,X.useLayoutEffect)(()=>{let e=Object.assign({},n);(u||h)&&(e=Object.assign(e,l)),A(e)},[u,h,l,n]),(0,X.useEffect)(()=>{O&&o?.(y)},[O,o,y]);let j=je(t,()=>({startEdit(){f||p||v(!0)},cancel(){D()}}),[]);return(0,Z.jsxs)(`div`,{...m,ref:j,style:{flexDirection:`column`,display:`flex`,...k},className:Q(r),children:[(0,Z.jsxs)(`div`,{style:{position:`relative`,boxSizing:`content-box`,whiteSpace:`pre`,userSelect:`none`,display:`flex`,justifyContent:`center`},onDoubleClick:()=>{f||p||v(!0)},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[(0,Z.jsx)(`div`,{className:`editable-label-container`,style:{textAlign:`center`,display:`flex`,minHeight:`1em`,opacity:+!_},children:y}),O]}),(0,Z.jsx)(`div`,{style:{whiteSpace:`pre`,position:`relative`,maxHeight:`0px`,height:`0px`,visibility:`hidden`,marginLeft:`1px`,marginRight:`1px`,overflow:`hidden`,...l},children:y})]})})),hS=e=>{let{transform:t}=e;return{...t,y:0}},gS=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},_S=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,style:r,className:i,index:a,editing:o,editable:s,selectedIndex:c,background:l,activeColor:u,borderColor:d,borderWidth:f,dragging:p,...m}=e;return(0,Z.jsxs)(`div`,{ref:t,className:Q(i),style:{...r,display:`flex`,flexDirection:`column`,background:c===a?`white`:l,minHeight:`0px`,fontFamily:`inherit`,fontSize:`16px`,fontWeight:c===a?`700`:`400`,lineHeight:`1`,letterSpacing:`0px`,textTransform:`none`,minWidth:`unset`},...m,children:[(0,Z.jsxs)(`div`,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},children:[(0,Z.jsx)(`div`,{style:{marginLeft:c===a?`0px`:`-1px`,marginTop:c===a?`0px`:`4px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}),n,c===a?(0,Z.jsx)(`div`,{style:{marginLeft:`0px`,marginTop:`0px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}):(0,Z.jsx)(Z.Fragment,{})]}),(0,Z.jsx)(`div`,{style:{flex:`1 1 100%`,background:c===a&&u?u:`none`,minHeight:`2px`}})]})})),vS={Wrapper:`_Wrapper_10yib_21`,fadeIn:`_fadeIn_10yib_29`,dragOverlay:`_dragOverlay_10yib_33`,Item:`_Item_10yib_43`,pop:`_pop_10yib_1`,withHandle:`_withHandle_10yib_57`,dragging:`_dragging_10yib_62`,disabled:`_disabled_10yib_72`},yS=(0,X.memo)((0,X.forwardRef)(({color:e,dragOverlay:t,dragging:n,disabled:r,fadeIn:i,handle:a,height:o,index:s,listeners:c,onRemove:l,renderItem:u,sorting:d,style:f,transition:p,transform:m,value:h,wrapperStyle:g,..._},v)=>{(0,X.useEffect)(()=>{if(t)return document.body.style.cursor=`grabbing`,()=>{document.body.style.cursor=``}},[t]);let y=u?u({dragOverlay:!!t,dragging:!!n,sorting:!!d,index:s,fadeIn:!!i,listeners:c,ref:v,style:f,transform:m,transition:p,value:h}):(0,Z.jsx)(Z.Fragment,{children:h});return(0,Z.jsx)(`div`,{className:Q(`tab-item`,vS.Wrapper,i&&vS.fadeIn,d&&vS.sorting,t&&vS.dragOverlay),style:{...g,transition:[p,g?.transition].filter(Boolean).join(`, `),"--translate-x":m?`${Math.round(m.x)}px`:void 0,"--translate-y":m?`${Math.round(m.y)}px`:void 0,"--scale-x":m?.scaleX?`${m.scaleX}`:void 0,"--scale-y":m?.scaleY?`${m.scaleY}`:void 0,"--index":s},ref:v,children:(0,Z.jsx)(`div`,{className:Q(vS.Item,n&&vS.dragging,a&&vS.withHandle,t&&vS.dragOverlay,r&&vS.disabled,e&&vS.color,`dragging`),style:f,"data-cypress":`draggable-item`,...a?void 0:c,..._,tabIndex:a?void 0:-1,children:y})})})),bS={Row:`_Row_1kr10_1`},xS=(0,X.memo)((0,X.forwardRef)(({children:e,horizontal:t,style:n},r)=>(0,Z.jsx)(`div`,{ref:r,style:{...n},className:Q(bS.Row,t&&bS.horizontal),children:e}))),SS={...Ay,sideEffects:ky({styles:{active:{opacity:`0`}}})},CS=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{className:n,activationConstraint:r,animateLayoutChanges:i,adjustScale:a=!1,collisionDetection:o=J_,coordinateGetter:s=tb,dropAnimation:c=SS,getItemStyles:l=()=>({}),getNewIndex:u,handle:d=!1,items:f,onMove:p,isDisabled:m=()=>!1,measuring:h,modifiers:g,renderItem:_,renderDivider:v,reorderItems:y=Fy,strategy:b=By,style:x,useDragOverlay:S=!0,onDragStart:C,wrapperStyle:w=()=>({})}=e,[T,E]=(0,X.useState)(()=>f);(0,X.useEffect)(()=>{E(f)},[f]);let[D,O]=(0,X.useState)(null),k=z_(R_(Lv,{activationConstraint:r}),R_(Vv,{activationConstraint:r}),R_(kv,{scrollBehavior:`Cypress`in window?`auto`:void 0,coordinateGetter:s})),A=T.indexOf.bind(T),j=D?A(String(D)):-1,M=[];T.map((e,t)=>{M.push((0,Z.jsx)(wS,{id:e,handle:d,index:t,style:l,wrapperStyle:w,disabled:m(e),renderItem:_,animateLayoutChanges:i,useDragOverlay:S,getNewIndex:u},e)),v&&M.push((0,Z.jsx)(xe,{render:v,props:{}},`divider-`+e))});let{getPortalContainer:N}=Ae(),P=Ee()?.themeScope,F={};P?.mode&&(F[`data-sxl-theme-mode`]=P.mode),P?.surface&&(F[`data-sxl-theme-surface`]=P.surface);let I=P?.classes?.join(` `),L=(0,X.useRef)(null),R=(0,X.useRef)(null),ee=()=>{let e=R.current;R.current=null,e&&setTimeout(()=>{let{el:t,start:n,end:r}=e;if(document.activeElement!==t)return;let i=r??t.value.length;try{t.setSelectionRange(n??i,i)}catch{}},80)};return(0,Z.jsxs)(gy,{sensors:k,collisionDetection:o,onDragStart:e=>{let{active:t}=e;t&&(C?.(e),O(t.id))},autoScroll:{canScroll:e=>{if(e===document.scrollingElement||e===document.documentElement||e===document.body)return!1;let t=L.current;return!!t&&e.contains(t)}},onDragEnd:e=>{if(O(null),ee(),e.over){let t=A(String(e.over.id));j!==t&&(p?.(j,t),E(e=>y(e,j,t)))}},onDragCancel:()=>{O(null),ee()},measuring:h,modifiers:g,children:[(0,Z.jsx)(`div`,{ref:L,style:{display:`flex`,justifyContent:`flex-start`,boxSizing:`border-box`,...x},className:Q(n,vS.Wrapper),onMouseDown:e=>{(()=>{let e=document.activeElement;R.current=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?{el:e,start:e.selectionStart,end:e.selectionEnd}:null})();let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable||e.preventDefault()},children:(0,Z.jsx)(Gy,{items:T,strategy:b,children:(0,Z.jsx)(xS,{ref:t,children:M})})}),S?(0,ir.createPortal)((0,Z.jsx)(Py,{adjustScale:a,dropAnimation:c,children:D?(0,Z.jsx)(`div`,{className:I,...F,style:{display:`flex`},children:(0,Z.jsx)(yS,{value:T[j],handle:d,renderItem:_,wrapperStyle:w({index:j,isDragging:!0,id:T[j]}),index:j,dragging:!0,style:l({id:T[j],index:j,isSorting:D!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0})}):null}),N()):null]})}));function wS({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:r,id:i,index:a,onRemove:o,style:s,renderItem:c,useDragOverlay:l,wrapperStyle:u}){let{attributes:d,isDragging:f,isSorting:p,listeners:m,overIndex:h,setNodeRef:g,transform:_,transition:v}=Qy({id:i,animateLayoutChanges:t,disabled:e,getNewIndex:n});return(0,Z.jsx)(yS,{ref:g,value:i,disabled:e,dragging:f,sorting:p,handle:r,renderItem:c,index:a,style:s({index:a,id:i,isDragging:f,isSorting:p,overIndex:h}),onRemove:o?()=>o(i):void 0,transform:_,transition:v,wrapperStyle:u({index:a,isDragging:f,id:i}),listeners:m,"data-index":a,"data-id":i,dragOverlay:!l&&f,...d})}var TS=`_TabStrip_3x0dp_1`,ES=`rgb(33, 115, 70)`,DS=`#eee`,OS=e=>(0,Z.jsx)(_S,{...e}),kS=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,style:r,className:i,selectedTabIndex:a=0,tabNames:o=[],onSelectedTabIndexChange:s,onTabNameChange:c,onTabMove:l,renderScrollButtonStart:u=ee,renderScrollButtonEnd:d=oe,renderScrollButtonEdge:f=W,renderTabButton:p=OS,renderTabDivider:m,propsEditLabel:h,disabled:g=!1,disableDrag:_=!1,background:v=`white`,activeColor:y=ES,borderColor:b=DS,borderWidth:x=1,seam:S=!0}=e,[C,w]=(0,X.useState)(a),[T,E]=(0,X.useState)(o),D=(0,X.useCallback)(e=>{let t=P.current?.[e]?.closest(`.tab-item`)??P.current?.[e];if(!t||!V.current)return;let n=V.current,r=t.getBoundingClientRect(),i=n.getBoundingClientRect();r.left>=i.left&&r.right<=i.right&&r.top>=i.top&&r.bottom<=i.bottom||n.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:`smooth`})},[]);(0,X.useEffect)(()=>{D(a)},[a]);let O=(0,X.useCallback)((e,t)=>{t!==C&&(w(t),s?.(t))},[s,C]),k=(0,X.useCallback)((e,t)=>{l?.(e,t),w(n=>n===e?t:e<n&&t>=n?n-1:e>n&&t<=n?n+1:n)},[l]),A=(0,X.useRef)(null),[j,M]=(0,X.useState)(-1),N=(0,X.useCallback)((e,t)=>{c?.(e,t)},[c]);(0,X.useLayoutEffect)(()=>{w(a)},[a]),(0,X.useLayoutEffect)(()=>{E(o)},[o]);let P=(0,X.useRef)([]),F=(0,X.useRef)(null);(0,X.useImperativeHandle)(t,()=>Object.assign({startEdit(e){P.current?.[e]?.startEdit()},cancel(e){P.current?.[e]?.cancel()}},F.current),[C,j]);let I=(0,X.useCallback)(({value:e,index:t,dragging:n})=>{let{style:r,maxLength:i,...a}=h||{},o=(0,Z.jsx)(mS,{ref:e=>{P.current[t]=e},value:e,disabled:g,maxLength:i,style:{color:C===t&&y?y:`inherit`,flex:`1 1 100%`,paddingTop:`1px`,paddingBottom:`1px`,...r},styleHover:{},onSubmit:e=>(A.current=!1,M(-1),N(t,e)),onCancel:()=>{A.current=!1,M(-1)},onChange:e=>{A.current=!0,M(t)},...a});return(0,Z.jsx)(xe,{render:p,props:{onClick:e=>O(e,t),value:e,index:t,editing:j===t&&A.current,editable:!0,disabled:g,selectedIndex:C,background:v,activeColor:y,borderColor:b,borderWidth:x,dragging:n,children:o}})},[C,N,O,h,g,j,p]),[L,{width:R}]=be(),[z,{width:B}]=be(),V=(0,X.useRef)(null),[H,U]=(0,X.useState)({left:0,top:0,width:0,height:0}),[te,G]=(0,X.useState)(null);(0,X.useEffect)(()=>{te!==null&&V.current&&V.current.scrollTo({left:te,behavior:`smooth`})},[te]);let ne=(0,X.useCallback)((e,t=!1)=>{if(!V.current)return 0;let n=V.current.firstChild.getBoundingClientRect(),r=V.current.firstChild.firstChild.children,i=0;return i=t?0:ie.getScrollTo(e,n.left,r,!0,Math.max(0,e-200)),G(i),Math.max(0,i)},[]),re=(0,X.useCallback)((e,t=!1)=>{if(!V.current)return 0;let n=V.current.firstChild.getBoundingClientRect(),r=V.current.firstChild.firstChild.children,i=0,a=Math.ceil(B-R);return i=t?a:ie.getScrollTo(e,n.left,r,!1,Math.max(0,e+200)),G(i),Math.min(a,i)},[B,R]),ae=(0,X.useRef)(null),se=(0,X.useRef)(null),ce=(0,X.useCallback)(()=>{se.current&&(clearTimeout(se.current),se.current=null,ae.current=null)},[]),K=(0,X.useCallback)((e,t,n=260)=>{ae.current=e,se.current=setTimeout(()=>{let n=t?ne(ae.current||e):re(ae.current||e);n===ae.current?ce():K(n,t,120)},n)},[ne,re,ce]);(0,X.useEffect)(()=>()=>ce(),[ce]);let le=(0,X.useMemo)(()=>({style:{marginLeft:`4px`,marginRight:`6px`},disabled:Math.floor(H.left)<=0||Math.floor(B-R)===0,orientation:Ce.Horizontal,isBefore:!0,onMouseUp:ce,onMouseLeave:ce,onMouseDown:e=>{e.preventDefault(),K(V.current.scrollLeft,!0)},onClick:e=>ne(Math.min(V.current.scrollLeft,te??2**53-1),e.ctrlKey)}),[H,te,B,R]),ue=(0,X.useMemo)(()=>({style:{marginLeft:`6px`,marginRight:`4px`},disabled:Math.floor(B-R)<=Math.ceil(H.left),orientation:Ce.Horizontal,isBefore:!1,onMouseUp:ce,onMouseLeave:ce,onMouseDown:e=>{e.preventDefault(),K(V.current.scrollLeft,!1)},onClick:e=>re(Math.max(V.current.scrollLeft,te??0),e.ctrlKey)}),[H,te,B,R]),de=(0,X.useMemo)(()=>(0,Z.jsxs)(Z.Fragment,{children:[f?(0,Z.jsx)(`div`,{style:{minWidth:`16px`}}):null,n,(0,Z.jsx)(xe,{render:f,props:le})]}),[le,ue,u,d,n,f]);return(0,Z.jsxs)(`div`,{style:{...r,display:`flex`,alignItems:`stretch`},className:Q(i,TS),ref:F,children:[(0,Z.jsx)(`div`,{style:{borderTop:S?`solid ${b} ${x}px`:void 0,position:`absolute`,width:`100%`}}),(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:de}),(0,Z.jsx)(`div`,{className:`Tabs`,ref:L,style:{flex:`1 1 100%`,display:`flex`,position:`relative`,overflow:`hidden`},children:(0,Z.jsx)(`div`,{style:{position:`relative`,overflowY:`hidden`,overflowX:`hidden`,marginBottom:`3px`},ref:V,onScroll:e=>{U({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:(0,Z.jsx)(CS,{isDisabled:e=>g||_,items:T,strategy:zy,modifiers:[hS,gS],ref:z,renderItem:I,renderDivider:m,onMove:k,activationConstraint:{distance:15}})})}),(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:(0,Z.jsx)(xe,{render:f,props:ue})})]})}));kS.displayName=`TabStrip`;var AS={"sheet-tab":`_sheet-tab_1cbiv_2`,ghost:`_ghost_1cbiv_18`},jS=e=>{let{disabled:t,editing:n,...r}=e;return(0,Z.jsx)(`div`,{...r})},MS=(e,t)=>`color-mix(in srgb, ${e} ${t}%, transparent)`,NS={top:3,right:4.5,bottom:1.5,left:4},PS=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,sheet:r,style:i,className:a,value:s,index:c,editing:l,editable:u,disabled:d,selectedIndex:f,dragging:p,borderColor:m,borderWidth:h,activeColor:g,background:_=`white`,tabRadius:v=4,slotSurface:y=jS,inverted:b=!0,...x}=e,S=r?.isIWorksheet?r:null,C=()=>{let e=S?.getProtection();return e?e.isPaused()?`LockOpen`:e.isLocked()?`Lock`:null:null},[w,T]=(0,X.useState)(C),[E,D]=(0,X.useState)(()=>r?r.getTabColor():null);o(r,{onProtectionChange:()=>{T(C())},onTabColorChange:()=>{D(r.getTabColor())},onStyleChange:()=>{D(r.getTabColor())}});let O=f===c,k=We(),A=!O&&!p&&!E,M=p&&!E&&!O,N=null,P=null;if(E||p||A){let e=_,t=e,n=e;E?(P=E.toBlackOrWhite().toCSS(),e=E.toCSS(),t=MS(e,75),n=MS(e,10)):O||(e=`var(--sxl-color-base-100)`);let r=`linear-gradient(0deg, ${e} 0%, ${t} 60%, ${n} 90%, transparent 100%)`;N=(0,Z.jsx)(`div`,{className:Q(AS.pill,A&&AS.ghost),style:{position:`absolute`,boxSizing:`border-box`,top:`3px`,left:`4px`,right:`4.5px`,bottom:`1.5px`,opacity:O?.5:1,borderRadius:`4px`,border:A?void 0:M?`1px solid var(--sxl-tab-hover-border)`:O?`${_} solid 1px`:`var(--sxl-color-base-300) solid 1px`,background:A?void 0:M?`linear-gradient(var(--sxl-tab-hover-bg), var(--sxl-tab-hover-bg)), var(--sxl-color-base-100)`:O&&E?r:e}})}let F=m??null,I=O?(0,Z.jsx)(`div`,{style:{width:`100%`,borderRadius:`4px`,minWidth:`4px`,height:`2px`,backgroundColor:`var(--sxl-color-primary)`}}):null,L=O?`var(--sxl-color-primary)`:P||`color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent)`;return(0,Z.jsx)(`div`,{ref:t,className:Q(a),"data-sxl-theme-surface":O?`grid`:void 0,"data-sxl-theme-mode":O?k:void 0,style:{...i,display:`flex`,flexDirection:`column`,minHeight:`0px`,fontFamily:`var(--sxl-font-family)`,fontWeight:O?700:400,fontSize:`0.85rem`,letterSpacing:`0`,lineHeight:`1`,textTransform:`none`,minWidth:`unset`,cursor:p?`grabbing`:void 0,"--sxl-tab-hover-bg":`var(--sxl-color-base-100)`,"--sxl-tab-hover-border":`var(--sxl-color-base-300)`},...x,children:(0,Z.jsx)(te,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},radius:v,variant:O&&b?`tab`:`rounded`,clipInset:O&&b?void 0:NS,strokeColor:O?F:`transparent`,children:(0,Z.jsxs)(y,{className:AS[`sheet-tab`],disabled:d,editing:l,style:{position:`relative`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,textTransform:`none`,borderRadius:`0px`,minHeight:`0px`,paddingLeft:`11px`,paddingRight:`12px`,paddingTop:`3px`,paddingBottom:`3px`,flex:`1 1 100%`,fontWeight:O?700:400,fontSize:`0.85rem`,letterSpacing:`0`,cursor:p?`grabbing`:d?`default`:`pointer`,color:L,backgroundColor:O?_:`transparent`,minWidth:`unset`,"--sxl-sheet-tab-input-color":`var(--sxl-color-base-content)`},children:[N,(0,Z.jsxs)(`div`,{style:{zIndex:1,display:`flex`,flexDirection:`row`,alignItems:`center`},children:[r&&r.getKind()!==`worksheet`?(0,Z.jsx)(kx,{kind:r.getKind(),style:{width:`14px`,height:`14px`,marginRight:`4px`,flex:`none`}}):null,(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,rowGap:`1px`,lineHeight:`1`,marginTop:O?void 0:`1px`},children:[n,I]}),w?(0,Z.jsx)(j,{iconKey:w,style:{scale:`0.80`,marginLeft:`2px`,width:`22px`,height:`22px`}}):(0,Z.jsx)(`div`,{style:{minHeight:`22px`}})]})]},s+`:`+c)})})}));PS.displayName=`SheetTab`;var FS=(0,X.memo)(e=>{let{icons:t,order:n=`ascending`,size:r=16,gap:i=4,style:a,...o}=e,s=n===`descending`?[...t].reverse():t;return(0,Z.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`${i}px`,lineHeight:1,...a},...o,children:s.map((e,t)=>e?(0,Z.jsx)(j,{iconKey:e.iconKey,size:r,style:{color:e.color,flex:`0 0 auto`}},t):(0,Z.jsx)(`span`,{style:{width:`${r}px`,height:`${r}px`,flex:`0 0 auto`}},t))})});FS.displayName=`IconSetGlyphs`,a({FindScopeOptions:()=>IS});var IS={Workbook:`workbook`,Sheet:`sheet`};function LS(e,t){let n=t.workbook;if(!n)return()=>{};let r=t,i=r?.notifier,a=e=>e??n.getSelectedSheetIndex(),o=e=>n.getSheets()[a(e)];e.updateCommand(`addSheet`,{callback:e=>{n.getWorksheets().add({index:e,autoSelect:!0})}}),e.updateCommand(`deleteSheet`,{callback:e=>{o(e)?.delete()}}),e.updateCommand(`duplicateSheet`,{callback:async e=>{let t=o(e);t?.isIWorksheet&&(await t.duplicate())?.select()}}),e.updateCommand(`hideSheet`,{callback:e=>{o(e)?.setVisibility(kn.Visibility.Hidden)}}),e.updateCommand(`nextSheet`,{callback:e=>{n.getNextSheet(a(e)).select()}}),e.updateCommand(`previousSheet`,{callback:e=>{n.getPreviousSheet(a(e)).select()}}),e.updateCommand(`selectNextSheet`,{callback:e=>{n.getNextSheet(a(e)).select()}}),e.updateCommand(`selectPreviousSheet`,{callback:e=>{n.getPreviousSheet(a(e)).select()}}),r?.focusNameBox&&e.updateCommand(`activeNameBox`,{callback:()=>{r.focusNameBox()}}),e.updateCommand(`activeNameManager`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`managedNames`)}});let s=e=>{if(!e||!r.editable)return;let t=`=${e.getName()}(`;xs(r.editable,`${t})`,{mode:`edit`,initialSelection:{start:t.length,end:t.length}}),r.editable.getSession()?.getActiveEditor()?.focus()},c=async()=>{let e=n.getCalculation();return await e.start(),e.getFunctions()},l=()=>({searchByCategory:async e=>(await c()).search({category:e,type:`formula`}),searchByText:async(e,t)=>e?.trim()?(await c()).search({text:e,category:t?.category,limit:t?.limit,type:`formula`}):h.EmptyArray,getCategories:async()=>(await c()).getCategories({type:`formula`})}),u;e.updateCommand(`insertFunction`,{tags:[`noTransaction`],callback:e=>{s(e)},context:l}),e.updateCommand(`insertFunctionDialog`,{tags:[`noTransaction`],callback:i?.showWindow?()=>{let e=r.editable?.getAnchor().getCoords()??null;i.showWindow(`insertFunction`,{context:l,onInput:t=>{typeof t==`string`?((e,t)=>{let n=r.editable;n&&(bs(n,e)?n.getSession()?.getActiveEditor()?.focus():n.startEdit(t??n.getAnchor().getCoords(),{dirty:e,mode:`edit`,autoFocus:!1})&&n.commit())})(t,e):s(t)}})}:void 0,context:l});let d=()=>{let t=n.getSelectedWorksheet(),r=t&&!t.getProtection().isFormatCellsAllowed()?[S(`reason.sheetProtected`)]:[];e.updateCommand(`insertFunction`,{disabledReasons:r}),e.updateCommand(`insertFunctionDialog`,{disabledReasons:r})},f=()=>{u?.(),u=n.getSelectedWorksheet()?.addListeners({onProtectionChange:d}),d()};f();let p=e=>{let t=n.getCalculation(),r=t.getStatus();t.calculate(e).then(t=>{globalThis.__sxlKeyDebug&&console.log(`[calc] ${e?`calculateFull`:`calculateAll`}: status ${r} -> ${t}`)})};e.updateCommand(`calculateAll`,{callback:()=>{p(!1)}}),e.updateCommand(`calculateFull`,{callback:()=>{p(!0)}}),e.updateCommand(`refreshAll`,{callback:()=>{n.getCalculation().calculate({full:!0,external:!0});let e=n.getPivotTables();e.getItems().length!==0&&e.refreshAll().catch(e=>{i?.showError?.(e)})}});let m=[`noTransaction`,`noRepeat`],g=()=>{let t=n.getCalculation(),r=t.getCalculationMode(),i=[[`calcModeAutomatic`,An.CalculationMode.Automatic],[`calcModeAutomaticExceptTables`,An.CalculationMode.AutomaticExceptTables],[`calcModeManual`,An.CalculationMode.Manual]];for(let[n,a]of i)e.updateCommand(n,{state:r===a,tags:m,callback:()=>{t.setCalculationMode(a)}});e.updateCommand(`calcIterativeToggle`,{state:t.getIterativeCalculation().enabled,tags:[...m,I],callback:()=>{t.setIterativeCalculation(!t.getIterativeCalculation().enabled)}})};g();let _=n.getCalculation().addListeners({onOptionsChange:g});e.updateCommand(`workbookStatistics`,{callback:()=>{i?.showWindow&&i.showWindow(`workbookStatistics`,{context:()=>({getWorkbook:()=>n})})}});let v=async(e,t)=>{let r=n.getSelectedRanges(),a;try{a=await(e?r?.getDependents(t):r?.getPrecedents(t))}catch(e){i?.showError?.(e);return}if(a)try{await a.select()}catch(e){i?.showError?.(e)}else i?.showMessage?.(A(e?`formulaTrace.noDependents`:`formulaTrace.noPrecedents`))};e.updateCommand(`selectDirectPrecedents`,{callback:()=>v(!1,!1)}),e.updateCommand(`selectPrecedents`,{callback:()=>v(!1,!0)}),e.updateCommand(`selectDirectDependents`,{callback:()=>v(!0,!1)}),e.updateCommand(`selectDependents`,{callback:()=>v(!0,!0)}),e.updateCommand(`selectTheme`,{callback:e=>{e&&n.setTheme(e)},...r?.themes?{context:()=>({theme:n.getTheme(),themes:r.themes})}:{}}),e.updateCommand(`deleteCellStyle`,{callback:e=>{e?.delete()}}),e.updateCommand(`modifyCellStyle`,{callback:e=>{let t=e?.named,r=n.getSelectedWorksheet();t&&r&&n.getStyles().getNamedStyles().set({name:t.getName(),style:r.getSelectedRange().getCell().getStyle()})}}),e.updateCommand(`newCellStyle`,{callback:()=>{i?.showInput&&i.showInput({initialValue:(()=>{let e=0;for(;;){e++;let t=`Style ${e}`;try{return n.getStyles().validateStyleName(t,!0),t}catch{}}})(),title:A(`dialog.newCellStyle.title`),description:A(`dialog.newCellStyle.description`),inputLabel:A(`dialog.newCellStyle.inputLabel`),propsInput:{style:{minWidth:`300px`}},options:[`Ok`,`Cancel`],defaultOption:`Ok`,onValidateInput:async e=>{let t=e??``,r=null;try{n.getStyles().validateStyleName(t,!1)}catch(e){r=e.message}let i=n.getStyles().getNamedStyles().getByName(t);return{valid:r===null,message:r??(i?`Update style '${i.getName()}'.`:void 0)}}}).then(({input:e,option:t})=>{let r=n.getSelectedWorksheet()?.getSelectedRange();if(t!==`Ok`||!r)return;let i=n.getStyles().getNamedStyles().set({name:e,style:r.getCell().getStyle()});r.getStyle().update({named:i.getName()})})}});let y=r?.findMemory,b=()=>y?.getLastFind?.()??null,x=async e=>{let t=0,r=null,a=S(`op.findReplace`);e?.replace&&!e?.replaceOptions?.maxCount&&(a=S(`op.replaceAll`));let o=await Promise.resolve(i?.showBusy?.(A(a))??null);try{let a=n.getSelectedWorksheet();if(!a)return 0;let s={from:a.getSelectedCell(),...e.findOptions},c=(e?.scope??`sheet`)===`sheet`?a.find(s):n.find(s);if(e.replace){let i=n.replace(c,e.replaceText,e.replaceOptions);t=i.count,e.replaceOptions?.maxCount&&(r=i.last)}else{let e=c.next();e.done||(t++,r=e.value)}r?.select({scrollIntoView:!0,autoFocus:!1}),o?.(),!e.replaceOptions?.maxCount&&t>1&&i?.showMessage?.(A(`findReplace.replaced`,{count:t}))}catch(e){o?.(),i?.showError?.(e)}return t},C=async e=>{let t=await x(e),n=(e=>{let t=e.findOptions;return t?.text?{text:t.text,matchCase:t.matchCase,matchEntireCell:t.matchEntireCell,useRegex:t.useRegex,fields:t.fields,axis:t.axis,scope:e.scope}:null})(e);return n&&(y?.setLastFind?.(n),E()),t},w=(e=!1)=>{if(!i?.showWindow)return;let t=n.getSelectedCell(),r={initialValue:{findOptions:{text:(t.getFormulaText({target:`display`})??t.getText({useFormattingCategory:!0}))||b()?.text||``},replace:e},context:()=>C,autoFocus:!0,disableAutoDestroy:!0};i.showWindow(`find`,r)};e.updateCommand(`find`,{callback:()=>w(!1)}),e.updateCommand(`findReplace`,{callback:()=>w(!0)});let T=e=>{let t=b();if(!t)return;let{scope:n,...r}=t;return x({findOptions:{...r,reverse:e},scope:n,replace:!1})};function E(){let t=b()?[]:[S(`reason.noPreviousSearch`)];e.updateCommand(`findNext`,{disabledReasons:t}),e.updateCommand(`findPrevious`,{disabledReasons:t})}e.updateCommand(`findNext`,{callback:()=>{T(!1)}}),e.updateCommand(`findPrevious`,{callback:()=>{T(!0)}}),E(),e.updateCommand(`goto`,{callback:()=>{i?.showInput&&i.showInput({title:A(`dialog.goTo.title`),inputLabel:A(`dialog.goTo.inputLabel`),options:[{id:`Go To`,label:()=>A(`dialog.goTo`)}],onInput:async e=>{if(e)try{await n.getRanges(e).select()}catch(e){i.showMessage?.(e.message,{type:K.Error})}}})}}),e.updateCommand(`selectNamed`,{callback:async e=>{if(e)try{await e.select()}catch(e){i?.showError?.(e)}}}),e.updateCommand(`addNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`managedNames`,{args:{insert:!0}})}}),e.updateCommand(`editNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{e&&r?.activateTaskPane?.(`managedNames`,{args:{edit:e}})}}),e.updateCommand(`deleteNamedReference`,{callback:e=>{e?.delete?.()}}),e.updateCommand(`manageExternalLinks`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=e===`settings`?`settings`:`links`;r?.activateTaskPane?.(`externalLinks`,{args:{tab:t}})}}),e.updateCommand(`showAnomaliesPane`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(`anomalies`)}}),e.updateCommand(`activateTask`,{callback:()=>{i?.showInput&&i.showInput({title:A(`dialog.activateTask.title`),inputLabel:A(`dialog.activateTask.inputLabel`),options:[{id:`Activate`,label:()=>A(`dialog.activate`)}],onInput:async e=>{if(e)try{r?.activateTaskPane?.(e)}catch(e){i.showError?.(e.message)}}})}});let D=()=>{let t=n.getView();t&&(e.updateCommand(`workbookViewToggleShowFormulaBar`,{state:t.isShowFormulaBar(),callback:()=>{t.setShowFormulaBar(!t.isShowFormulaBar())}}),e.updateCommand(`workbookViewToggleShowTabs`,{state:t.isShowTabs(),callback:()=>{t.setShowTabs(!t.isShowTabs())}}),e.updateCommand(`workbookViewToggleShowStatusBar`,{state:t.isShowStatusBar(),callback:()=>{t.setShowStatusBar(!t.isShowStatusBar())}}),e.updateCommand(`workbookViewToggleShowHorizontalScrollBar`,{state:t.isShowHorizontalScrollbar(),callback:()=>{t.setShowHorizontalScrollbar(!t.isShowHorizontalScrollbar())}}),e.updateCommand(`workbookViewToggleShowVerticalScrollBar`,{state:t.isShowVerticalScrollbar(),callback:()=>{t.setShowVerticalScrollbar(!t.isShowVerticalScrollbar())}}))};D();let O=()=>{e.updateCommand(`locale`,{state:n.getPinnedLocale(),callback:e=>{n.setLocale(e??null)}})};O();let k=()=>{let t=n.getProtection().isStructureAllowed()?[]:[`The workbook structure is protected.`];for(let n of[`addSheet`,`duplicateSheet`,`selectTheme`,`addNamedReference`,`editNamedReference`,`deleteNamedReference`])e.updateCommand(n,{disabledReasons:t});let r=n.getSheets().length<=1,i=[...t,...r?[`A workbook must have at least one visible sheet.`]:[]];e.updateCommand(`hideSheet`,{disabledReasons:i}),e.updateCommand(`deleteSheet`,{disabledReasons:i})};k();let j=n.addListeners({onSheetsChange:()=>{k()},onViewChange:()=>{D(),O()},onProtectionChange:()=>{k()},onSelectedSheetChange:()=>{f()}});return()=>{j(),_(),u?.()}}var RS={dynamic:(e,t)=>{let n=t.manager?Vf(e,{manager:t.manager,notifier:t.notifier}):void 0,r=LS(e,t);return()=>{n?.(),r()}}},zS=new class{constructor(){this._loadedIO=null,this._loadPromise=null,this._backingStore=null,this._listeners=new Set,this._lazyDefaultStore={write:async e=>(await this._loadIO()).getBackingStore().write?.(e)??null}}async _loadIO(){return this._loadedIO?this._loadedIO:(this._loadPromise||=(async()=>{try{let e=await d(()=>import(`./Bh33WyohJvbKZVQN.js`),__vite__mapDeps([17,8,7,18,19]),import.meta.url);return await Zn.install(e.IOPlugin),this._loadedIO=Zn,this._loadedIO.addListeners({onRead:(e,t)=>{for(let e of this._listeners)e.onRead?.(this,t)},onWrite:(e,t)=>{for(let e of this._listeners)e.onWrite?.(this,t)}}),this._backingStore&&this._loadedIO.setBackingStore(this._backingStore),this._loadedIO}catch(e){throw this._loadPromise=null,e}})(),this._loadPromise)}async getReadFormats(e){return(await this._loadIO()).getReadFormats(e)}async getWriteFormats(e){return(await this._loadIO()).getWriteFormats(e)}async install(e){return(await this._loadIO()).install(e)}getOrigin(e){return new Qn(e)}async read(e){return(await this._loadIO()).read(e)}async writeArrayBuffer(e,t){return(await this._loadIO()).writeArrayBuffer(e,t)}async write(e,t,n){return(await this._loadIO()).write(e,t,n)}async writeAs(e,t,n){return(await this._loadIO()).writeAs(e,t,n)}getBackingStore(){return this._backingStore??(this._loadedIO?this._loadedIO.getBackingStore():this._lazyDefaultStore)}setBackingStore(e){this._backingStore=e??null,this._loadedIO?.setBackingStore(this._backingStore)}canWrite(){return typeof this.getBackingStore().write==`function`}canRead(){return typeof this.getBackingStore().read==`function`}addListeners(e,t){return this._listeners.add(e),()=>{this._listeners.delete(e)}}addCommitListener(e){return this.addListeners({onWrite:(t,n)=>{n.save&&e.onCommit?.({store:n.workbook.getTransactions(),commitId:n.commitId})}})}get isIWorkbookIO(){return!0}},BS=async(e,t={})=>{let{io:n=zS,defaultTheme:r}=t;if(e instanceof nr)return e;if(!e||!h.isPromiseLike(e)&&Object.keys(e).length===0)return new nr({theme:r});let i=await Promise.resolve(e);return i instanceof nr?i:i&&i.source?n.read(i):i},VS=(e,t={})=>{let{io:n,defaultTheme:r,reloadKey:i}=t,a=(0,X.useRef)({io:n,defaultTheme:r});a.current={io:n,defaultTheme:r};let[o,s]=(0,X.useState)(()=>e instanceof nr&&!e.getFonts().isLoading()?{status:`loaded`,workbook:e}:{status:`loading`}),c=(0,X.useRef)(o);return c.current=o,(0,X.useEffect)(()=>{let t=!0;return s(e=>e.status===`loaded`?e:{status:`loading`}),(async()=>{try{let n=await BS(e,a.current);if(!t)return;let r=c.current,i=n??(r.status===`loaded`?r.workbook:new nr({theme:a.current.defaultTheme}));if(await i.whenFontsReady(),!t)return;s(e=>e.status===`loaded`&&e.workbook===i?e:{status:`loaded`,workbook:i})}catch(e){if(!t)return;s({status:`error`,error:e})}})(),()=>{t=!1}},[e,i]),o},HS=!1,US=null,WS=async e=>{if((await zn.getDetails()).isEval()){try{let e=top??window;e.SheetXL||=Object.freeze({getSelectedWorkbook:()=>US?.getWorkbook(),getSelectedWorksheet:()=>US?.getWorkbook().getSelectedWorksheet()??null,getSelectedRange:()=>US?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>US?.getWorkbook().getSelectedRanges(),getRange:e=>US?.getWorkbook().getRange(e),getSelectedWorkbookElement:()=>US,getLicenseManager:()=>zn,moreExamples:()=>{console.table({"SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])":{Summary:`Set an array of values.`},"SheetXL.getRange('a1:e5').setValue(100, { autoSelect: true })":{Summary:`Set a single repeating value to a range.`},"SheetXL.getRange('Sheet1!e5:f6').getValues()":{Summary:`Get the values as a 2d array (see forEach).`},"SheetXL.getSelectedRange().setValue(new Date())":{Summary:`Set current date/time using Javascript Date.`},"SheetXL.getSelectedRange().setValue('10/23/95')":{Summary:`Set current date/time using string.`},"SheetXL.getSelectedWorksheet().getUsedRange().getValues()":{Summary:`Get all of the values in a sheet.`},"SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })":{Summary:`Set fill to theme color 4.`},"SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:`Set some columns to a modified theme color.`},"SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})":{Summary:`Set border.`},"SheetXL.getSelectedRange().getStyle().getFill().toCSS()":{Summary:`Get the fill style as css for the selected range.`},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:`Autofill down.`},"SheetXL.getRange('e7:i9').merge({ axis: 'rows' })":{Summary:`Merge cells horizontally.`},"SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })":{Summary:`Sort selected cells ascending with a header.`},"SheetXL.getSelectedRange().clear('all')":{Summary:`Clear the current range a different way.`},"SheetXL.getSelectedWorksheet().getTables().add('b2:e9')":{Summary:`Create a 4x8 table at b2 for current sheet.`},"SheetXL.getRange('a1:c3').copyFrom('e1:g3')":{Summary:`Copy cells.`},"SheetXL.getRange('c:t').getColumnHeaders().setSize(30)":{Summary:`Set the size of columns to 30 pixels.`},"SheetXL.getRange('2:3').delete()":{Summary:`Remove rows 2 and 3 and shift up.`},"SheetXL.getSelectedWorksheet().getMovables().addPicture('https://www.sheetxl.com/logo-text.svg')":{Summary:`Add an image.`},"SheetXL.getSelectedWorksheet().getMovables().addPicture('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })":{Summary:`Add an image of height 100.`},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')":{Summary:`Set value to 100 and numberformat to 0% as a single.`},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')":{Summary:`Set a value and style to Note style and autofit text.`},"SheetXL.getSelectedWorkbook().getNames().addFormula('Small_Range', 'A2:E5');":{Summary:`Add a named range.`},"SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })":{Summary:`Listen for updates at a range.`}})}})}catch(e){e instanceof DOMException||console.error(e),HS=!0}if(US!==e&&(US=e,!HS))try{HS=!0,(top??window).SheetXL&&(await zn._validate(!0),zn.wasPrinted()&&(()=>{h.consoleWithNoSource(`%cTip: You can access the API directly in the console.
|
|
40
|
+
Try
|
|
41
|
+
%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
|
|
42
|
+
>%c SheetXL.moreExamples()`,`color:#ffa726;`,`font-family:monospace;color:#1976d2;font-size:12px;`,`font-family:monospace;`,`font-family:monospace;color:#1976d2;font-size:12px;`,`font-family:monospace;`),HS=!0;let e=document.getElementById(`openEditorLink`);e&&e.addEventListener(`click`,e=>{e.preventDefault(),console.log(`openScriptEditor called from console`)})})())}catch(e){e instanceof DOMException||console.error(e)}}},GS=`_add-button_1b4ig_1`,KS=e=>(0,Z.jsx)(PS,{...e}),qS=`var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3)))`,JS=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,workbook:r,onBeforeUserChange:i,onUserChange:a,disabled:s=!1,readOnly:c=!1,className:l,style:u,condensed:d=!1,seam:f=!0,renderSheetTab:p=KS,onTabContextMenu:m,renderScrollButtonStart:h,renderScrollButtonEnd:g,renderScrollButtonEdge:_,...v}=e,y=z(),b=f?`solid ${qS} 1px`:void 0,x=d?null:h,S=d?null:g,C=d?null:_,w=(0,X.useRef)(null),T=(0,X.useRef)(null);(0,X.useImperativeHandle)(t,()=>Object.assign({startEdit(e){T.current?.startEdit(e)},cancel(e){T.current?.cancel(e)}},w.current),[]);let[E,D]=(0,X.useState)(r?.getSelectedSheetIndex()),[O,k]=(0,X.useState)(r?.getSheets()??[]),[A,M]=(0,X.useState)(()=>r?.getProtection().isStructureAllowed()??!0);o(r,{onViewChange(e){D(e?.getSelectedSheetIndex())},onSheetsChange:e=>{k(e.getSheets())},onProtectionChange:e=>{M(e?.getProtection().isStructureAllowed()??!0)}});let N=c||!A,P=`color-mix(in srgb, var(--sxl-color-base-300) 25%, transparent)`,F=(0,X.useMemo)(()=>{let e=[];for(let t=0;t<O.length;t++)e.push(O[t].getName());return e},[O]),I=(0,X.useCallback)(e=>{!1!==i?.(e)&&(r.getSheets()[e]?.select(),a?.(e))},[r,i,a]),L=(0,X.useCallback)((e,t)=>{r.getSheets()[e]?.setName(t),a?.(e)},[r,a]),R=(0,X.useCallback)((e,t)=>{r.getSheets()[e]?.setIndex(t),a?.(t)},[r,a]),ee=G(()=>{if(!1===i?.(E))return;let e=E+1;r.getWorksheets().add({name:void 0,index:e,autoSelect:!0}),a?.(e)},[r,i,a,E]),B=G(e=>{let t=r.getSheets()[e.index];return t?p({sheet:t,inverted:!d,onContextMenu:m?t=>{I(e.index),m(t,e.index)}:void 0,...e}):null},[r,d,p,m,I]),V=G(e=>{let{style:t,...n}=e;return(0,Z.jsx)(`div`,{...n,style:{alignSelf:`stretch`,width:`1px`,marginLeft:`-1px`,marginTop:`6px`,marginBottom:`6px`,background:P,...t}})},[P]),H=(0,X.useMemo)(()=>N?null:(0,Z.jsx)(`button`,{type:`button`,className:Q(`workbook-strip-add`,GS),disabled:s,"aria-label":`addTab`,title:y(`workbookStrip.newSheet`),onMouseDown:e=>{e.button===0&&e.preventDefault()},onClick:()=>ee(),children:(0,Z.jsx)(j,{iconKey:`AddCircle`,style:{width:`18px`,height:`18px`}})}),[s,N,ee,y]);return(0,Z.jsxs)(`div`,{ref:w,className:Q(`workbook-strip`,l),style:{position:`relative`,display:`flex`,alignItems:`stretch`,flex:`1 1 100%`,maxWidth:`100%`,...u},...v,children:[(0,Z.jsx)(kS,{ref:T,selectedTabIndex:E,tabNames:F,onSelectedTabIndexChange:I,onTabNameChange:L,onTabMove:R,background:`var(--sxl-color-base-100)`,borderColor:qS,seam:f,activeColor:null,disabled:s,disableDrag:N,renderTabButton:B,renderTabDivider:V,renderScrollButtonStart:x,renderScrollButtonEnd:S,renderScrollButtonEdge:C,propsEditLabel:{readOnly:N,maxLength:31,styleHover:{fontWeight:`700`},onKeyPress:e=>{r.isValidSheetNameCharacter(e.key)||e.preventDefault()},onCancel:()=>{a?.(E)}},children:n}),(0,Z.jsx)(`div`,{style:{borderTop:b,minWidth:`4px`}}),(0,Z.jsx)(`div`,{style:{borderTop:b,flex:`none`,display:`flex`,alignItems:`center`},children:H}),(0,Z.jsx)(`div`,{style:{borderTop:b,flex:1,minWidth:`24px`}})]})}));JS.displayName=`WorkbookStrip`;var YS=e=>{let{key:t,...n}=e;return(0,Z.jsx)(mx,{...n},t)},XS=e=>{let{key:t,...n}=e;return(0,Z.jsx)(Ax,{...n},t)},ZS=e=>(0,Z.jsx)(JS,{...e}),QS=e=>sx(e),$S={"sheetxl-workbook":`_sheetxl-workbook_7tom8_11`,"sheetxl-reset":`_sheetxl-reset_7tom8_36`,viewport:`_viewport_7tom8_30`},eC={version:1};uf();var tC={ignoreModelChange:!0},nC={flex:`1 1 100%`,display:`flex`,boxSizing:`border-box`},rC=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,iC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{workbook:n,onWorkbookLoad:r,prefetch:i=`auto`,autoFocus:a=!1,style:s,className:c,onFocus:l,onBlur:d,onKeyDown:f,undoManager:p,focusNameBox:m,showTabs:h,propsTabs:g,renderTabs:_=ZS,propsContextMenu:v,renderContextMenu:y,renderColumnMenu:b,renderPivotMenu:x,renderMovableMenu:S,renderFillMenu:C,propsFloatPanel:w,renderFloatPanel:E,renderWorkbookLoading:D=QS,propsWorkbookLoading:O,propsSheet:k,editable:A,renderWorksheet:j=YS,renderOpaqueSheet:M=XS,wrapperMain:N,children:P,showHorizontalScrollbar:I,showVerticalScrollbar:R,colorScheme:ee,gridColorScheme:z,...B}=e;if(!n)throw Error(`IWorkbook must be provided.`);let V=(0,X.useRef)(null),H=xh(),U=(0,X.useRef)(null),W=(0,X.useMemo)(()=>(0,Z.jsx)(`div`,{className:Q(`sheetxl-viewport`,$S.viewport),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`,pointerEvents:`none`},ref:U}),[]),[te,ne]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(!1),oe=(0,X.useCallback)(()=>{ne(!0)},[]),se=(0,X.useRef)(null),ce=je(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>n,getSheetElement:()=>V.current,getViewportElement:()=>U.current,getCommandScope:()=>se.current,focus(){V&&V.current&&V.current.focus()}}),[n]),[K,le]=(0,X.useState)(null),de=(0,X.useCallback)(e=>{e&&le(e)},[]),he=(0,X.useRef)(null);(0,X.useLayoutEffect)(()=>{te&&K&&(async()=>{he.current!==r&&(await r?.({source:K}),he.current=r??null),ae(!0)})()},[te,K]),(0,X.useEffect)(()=>{if(!ie||!i)return;On.getTypes(),Ut();let e=new AbortController,t=()=>{T.prefetch({signal:e.signal,onlyWhenFast:i===`auto`})};t();let n=navigator.connection;return window.addEventListener(`online`,t),n?.addEventListener?.(`change`,t),()=>{e.abort(),window.removeEventListener(`online`,t),n?.removeEventListener?.(`change`,t)}},[ie,i]);let ve=G(e=>{g?.onUserChange?.(e);let t=document.activeElement;t&&t!==document.body&&!ce.current?.contains(t)||requestAnimationFrame(()=>{V?.current?.focus()})},[g]),[ye,Ce]=(0,X.useState)(n.getSelectedSheet()),Te=ye?.isIWorksheet?ye:null,[Ee,De]=(0,X.useState)(n.getProtection());o(n,{onSheetsChange:e=>{Ce(e?.getSelectedSheet())},onViewChange(e){Ce(e?.getSelectedSheet())},onProtectionChange:e=>{De(e?.getProtection())}}),o(n,{onRequestSelect:async(e,t)=>new Promise(e=>{let n=V.current;t.isIWorksheet&&n&&n.getWorksheet()!==t?n.getGridSurface()?.onPaneChangeOnce(()=>{V.current?.getWorksheet()!==t&&e(!1),e(!0)}):e(!0)})},tC);let[Oe,ke]=(0,X.useReducer)(e=>e+1,0),Ae=n.getView();o(Ae,{onViewChange:e=>{ke()}});let[Me]=ge(Ve.Mode,He[Ve.Mode]),[Ne]=ge(Ve.DarkImages,He[Ve.DarkImages]),{themeMode:Fe}=we({mode:ee??Me??void 0}),Ie=We(z),Le=(0,X.useId)(),Re=(0,X.useMemo)(()=>me(`workbook`,Le),[Le]),ze=(0,X.useMemo)(()=>St({scope:`.${Re}`}),[Re]),Be=(0,X.useMemo)(()=>Yr(`sxl-defaults`,`.${Re}`),[Re]),[Ue,Ge]=(0,X.useState)({});(0,X.useLayoutEffect)(()=>{if(!K)return;let e=getComputedStyle(K),t=t=>e.getPropertyValue(t).trim()||void 0,n=t(`--icon-color`);Ge({base100:t(`--sxl-color-base-100`),primary:t(`--sxl-color-primary`),icon:n&&n!==`currentColor`?n:e.color||void 0})},[K,Fe]);let Ke=(0,X.useMemo)(()=>({backgroundColor:Ue.base100,borderColor:Ue.primary,fillColor:Ue.icon??`grey`}),[Ue]),qe=(0,X.useMemo)(()=>new re,[]),Je=fe.useCommandScope(),Ye=Se(),Xe=Pd(),Ze=Hr(),[Qe,$e]=(0,X.useState)(p??null);(0,X.useEffect)(()=>{if(!Je)return void $e(null);if(p)return void $e(p);if(!n)return void $e(null);let e=new er(n.getTransactions());return $e(e),()=>e.close()},[Je,n,p]);let[et,tt]=ge(`workbook.lastFind`,null,eC),nt=(0,X.useRef)(et);nt.current=et;let rt=(0,X.useMemo)(()=>({getLastFind:()=>nt.current,setLastFind:tt}),[tt]),it=(0,X.useMemo)(()=>({scopeName:{key:n?`workbook:${n.getId()}`:`workbook`,name:`workbook`},contributor:RS,data:{workbook:n,editable:A,notifier:Ye,manager:Qe??void 0,activateTaskPane:(e,t)=>Xe.activate(e,t),themes:Ze,focusNameBox:m,findMemory:rt}}),[n,A,Ye,Qe,Xe,Ze,m,rt]),at=h??Ae?.isShowTabs(),ot=I??Ae?.isShowHorizontalScrollbar(),st=R??Ae?.isShowVerticalScrollbar(),[ct,{width:lt}]=be(),ut=lt===0||lt>560,dt=(0,X.useMemo)(()=>{if(!at||!_)return null;let e=(0,Z.jsx)(xe,{render:_,props:{condensed:!ut,seam:ut||_e.detectIt().primaryInput!==`touch`,workbook:n,...g,onUserChange:ve}});return ut?e:(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`},children:e})},[_,g,n,ut,at]),ft=(0,X.useCallback)(e=>{let{style:t,...r}=e,i=null,a=null,o=null;if(ot&&Te&&(a=(0,Z.jsx)(`div`,{className:`workbook-strip-scrollbar`,style:{display:`flex`,flex:`1 1 100%`,borderTop:rC,flexDirection:`column`,justifyContent:`center`},children:(0,Z.jsx)(Fg,{...r,style:{paddingLeft:`4px`,paddingRight:`4px`,...t},propsTouchThumb:Ke,endGap:700,sheet:Te})})),at&&ut&&(o=dt),at&&ut&&!ot&&(o=(0,Z.jsxs)(`div`,{style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`},children:[o,(0,Z.jsx)(`div`,{style:{borderTop:rC,flex:`1`}})]})),o&&ot){let e=Ue.icon??`grey`;i=(0,Z.jsx)(L,{position:n.getView().getTabRatio()/10+`%`,onPositionChange:({percent:e})=>{n.getView().setTabRatio(Math.round(10*e))},minBefore:`200px`,minAfter:`180px`,propsResizer:{style:{minWidth:`11px`,backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${e}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:`no-repeat`,backgroundPosition:`center`,borderTop:rC,borderBottom:`solid 3px transparent`}},elementBefore:o,elementAfter:a??void 0})}else if(ot)i=a;else{if(!o)return(0,Z.jsx)(`div`,{className:Q(`workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`,height:`1px`,width:`100%`,borderTop:rC}});i=o}return(0,Z.jsx)(`div`,{className:Q(`workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,width:`100%`,alignContent:`center`},children:i})},[Te,n,at,ot,ut,dt,Ke,Ue]),[q,pt]=(0,X.useState)(null),mt=$d(),ht=(0,X.useMemo)(()=>new fe.ManualActivation(null),[]),gt=(0,X.useRef)(null),_t=(0,X.useMemo)(()=>({placement:`right-start`,...q?.propsPopper}),[q?.propsPopper]),{reference:vt,component:yt}=pe({label:`contextMenu`,propsPopper:_t,anchor:q?.anchor??{getBoundingClientRect:()=>new DOMRect(q?.clientX||0,q?.clientY||0)},onOpen:()=>{gt.current=q},onClose:()=>{let e=gt.current;gt.current=null,e?.onClose?.(),e===q&&pt(null)},renderPopupPanel:q?.renderPopupPanel,renderFloatPanel:E});(0,X.useEffect)(()=>{q?vt.open(0):vt.close(0)},[q]);let bt=G((e,t)=>!!e?.isDefaultPrevented()||!!b&&(e.preventDefault(),e.stopPropagation(),q&&q.anchor===e.currentTarget?(pt(null),!0):(ht.setAnchor(mt?.getAnchor()??null),pt({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},renderPopupPanel:()=>b({column:t,floatReference:vt,...v})}),!0)),[b,v,n,q]),xt=G((e,t)=>!!e?.isDefaultPrevented()||!!x&&(e.preventDefault(),e.stopPropagation(),q&&q.anchor===e.currentTarget?(pt(null),!0):(ht.setAnchor(mt?.getAnchor()??null),pt({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},renderPopupPanel:()=>x({fields:t,floatReference:vt,...v})}),!0)),[x,v,n,q]),Ct=G(e=>!!e.originalEvent?.isDefaultPrevented()||!!y&&(e.originalEvent?.preventDefault(),ht.setAnchor(mt?.getAnchor()??null),pt({clientX:e.clientX,clientY:e.clientY,renderPopupPanel:()=>y({workbook:n,floatReference:vt,...v})}),!0),[y,v,n]),wt=G((e,t)=>!!C&&(e.originalEvent?.preventDefault(),ht.setAnchor(mt?.getAnchor()??null),pt({clientX:e.clientX,clientY:e.clientY,onClose:()=>{t.cancel()},renderPopupPanel:()=>C({workbook:n,menu:t,floatReference:vt,...v})}),!0),[C,v,n]),Tt=G((e,t)=>!!e?.isDefaultPrevented()||!!S&&(e.preventDefault(),ht.setAnchor(mt?.getAnchor()??null),pt({clientX:e.clientX,clientY:e.clientY,renderPopupPanel:()=>S({movable:t,floatReference:vt,...v})}),!0),[S,v,n]),Et=G(()=>{K&&WS(K)},[K]),Dt=(0,X.useCallback)(e=>{let{style:t,...n}=e;return Te?(0,Z.jsx)(Fg,{...n,style:{...t,paddingTop:`4px`,paddingBottom:`4px`},propsTouchThumb:Ke,sheet:Te,endGap:700}):(0,Z.jsx)(Z.Fragment,{})},[Te,Ke]);(0,X.useEffect)(()=>{a&&ie&&V.current&&V.current.focus(typeof a==`object`?a:void 0)},[a,ie]);let Ot=(0,X.useRef)(null),kt=(0,X.useMemo)(()=>ie||!D?null:(0,Z.jsx)(xe,{render:D,props:{...O}}),[ie,D,O]),At=(0,X.useMemo)(()=>kt?(0,Z.jsx)(`div`,{ref:Ot,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,left:`0px`,top:`0px`,width:`100%`,height:`100%`,position:`absolute`,boxSizing:`border-box`,pointerEvents:s?.pointerEvents},children:kt}):null,[kt,s]),jt=(0,X.useCallback)(e=>{let{movable:t}=e;return t?dd({onContextMenuCapture:e=>{Tt(e,t)},...e}):(0,Z.jsx)(Z.Fragment,{})},[]),Mt=(0,X.useMemo)(()=>Te?(0,Z.jsx)(xe,{render:j,props:{ref:V,style:nC,colorScheme:Fe,gridColorScheme:Ie,sheet:Te,editable:A,onSheetContextMenu:Ct,onFillMenu:wt,viewport:qe,showScrollbars:!1,viewportComponent:W,onFirstRender:oe,renderMovable:jt,...k,propsCellRender:{onColumnButtonMouseDown:(e,t)=>{k?.propsCellRender?.onColumnButtonMouseDown?.(e,t),bt(e,t)},onPivotButtonMouseDown:(e,t)=>{k?.propsCellRender?.onPivotButtonMouseDown?.(e,t),xt(e,t)},...k?.propsCellRender}}}):null,[k,Te,Fe,Ie,A]),Nt=(0,X.useMemo)(()=>{if(!Te){let e=(0,Z.jsxs)(`div`,{ref:ct,style:{...nC,display:`flex`,flexDirection:`column`},children:[(0,Z.jsx)(xe,{render:M,props:{sheet:ye,onFirstRender:oe}},ye?.getId()),dt?(0,Z.jsx)(`div`,{className:Q(`workbook-strip-area`),style:{display:`flex`,flex:`none`,width:`100%`,borderTop:rC},children:dt}):null]});return N?N(e):e}let e=(0,Z.jsx)(F,{ref:ct,style:nC,viewport:qe,zoomable:!0,showHorizontalScrollbar:ot||at,showVerticalScrollbar:st,renderScrollbarHorizontal:ft,renderScrollbarVertical:Dt,children:Mt});return ut||lt===0||(e=(0,Z.jsxs)(Z.Fragment,{children:[e,dt]})),N?N(e):e},[ot,at,ft,st,qe,ut,Mt,dt,N,Te,ye,M]),Pt=(0,X.useMemo)(()=>({boxSizing:`border-box`,fontFamily:`var(--sxl-font-family)`,"--sxl-image-filter":Ie===`dark`&&Ne?`hue-rotate(180deg) invert(1) brightness(95%)`:`none`,...s}),[Ie,Ne,s]),Ft=(0,X.useMemo)(()=>({flex:`1 1 100%`,width:`100%`,display:`flex`,flexDirection:`column`,opacity:!ie&&kt?0:void 0}),[ie,kt]),It=u([ce,de]);return(0,Z.jsx)(ue,{renderFloatPanel:E,propsFloatPanel:w,themeScopeClass:Re,themeSurface:`app`,themeMode:Fe,children:(0,Z.jsx)(sr,{workbook:n,children:(0,Z.jsx)(fe.CommandScopeProvider,{spec:it,scopeRef:se,elementRef:ce,children:(0,Z.jsx)(Hf.Provider,{value:Qe,children:(0,Z.jsxs)(`div`,{className:Q(`sheetxl-workbook`,$S[`sheetxl-workbook`],$S[`sheetxl-theme`],Pe,Re,c),style:Pt,"data-sxl-theme-mode":Fe,...B,ref:It,onFocus:e=>{Et(),l?.(e)},onBlur:e=>{d?.(e)},onKeyDown:e=>{f?.(e)},children:[(0,Z.jsx)(`style`,{children:ze}),(0,Z.jsx)(`style`,{children:Be}),(0,Z.jsxs)(`div`,{className:$S[`sheetxl-reset`],style:Ft,children:[(0,Z.jsxs)(Sh,{value:H,children:[P,Nt]}),(0,Z.jsx)(fe.CommandAnchorProvider,{tracker:ht,keyBindings:!1,children:yt})]}),At]})})})})})}));iC.displayName=`WorkbookElementBase`;var aC=e=>{let{colorScheme:t,children:n}=e,[r]=ge(Ve.Mode,He[Ve.Mode]),{themeMode:i}=we({mode:t??r??void 0}),a=(0,X.useId)(),o=(0,X.useMemo)(()=>me(`workbook`,a),[a]),s=(0,X.useMemo)(()=>St({scope:`.${o}`}),[o]);return(0,Z.jsxs)(`div`,{className:o,"data-sxl-theme-mode":i,style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--sxl-color-base-100)`,color:`var(--sxl-color-base-content)`,fontFamily:`var(--sxl-font-family)`},children:[(0,Z.jsx)(`style`,{children:s}),n]})},oC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{workbook:n,renderWorkbookError:r=cx,renderWorkbookLoading:i=QS,propsWorkbookLoading:a,onWorkbookChange:o,...s}=e,c=VS(n),l=c.status===`loaded`?c.workbook:null,u=G(o??(()=>{}),[o]),d;return(0,X.useEffect)(()=>{u(l)},[l]),d=c.status===`error`?(0,Z.jsx)(aC,{colorScheme:s.colorScheme,children:(0,Z.jsx)(xe,{render:r,props:{error:c.error}})}):c.status===`loaded`?(0,Z.jsx)(iC,{ref:t,...s,workbook:c.workbook,renderWorkbookLoading:i,propsWorkbookLoading:a}):(0,Z.jsx)(aC,{colorScheme:s.colorScheme,children:(0,Z.jsx)(xe,{render:i,props:{...a}})}),(0,Z.jsx)(yf,{children:d})}));oC.displayName=`WorkbookElement`;var sC=`/workbook.sxl`,cC=()=>new Promise(e=>requestAnimationFrame(()=>e())),lC=async()=>{await cC(),await cC()},uC=e=>/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`'${e.replace(/'/g,`''`)}'`,dC,fC,pC=new Promise((e,t)=>{dC=e,fC=t}),mC=fetch(sC).then(e=>{if(!e.ok)throw Error(`workbook fetch failed: ${e.status}`);return e.arrayBuffer()}).then(e=>zS.read({source:e,format:`sxl`,calcOnLoad:`none`})).then(e=>{if(!e)throw Error(`The workbook could not be read.`);return e});mC.catch(e=>fC(e));var hC=X.createRef(),gC=null,_C=(e,t)=>{if(t){let n=e.getRange(t);return{sheet:n.getWorksheet(),coords:{...n.getCoords()}}}let n=e.getActiveSheet();if(!n)throw Error(`The workbook has no worksheet to frame.`);let r=n.getUsedRange();return{sheet:n,coords:r?{...r.getCoords()}:{rowStart:0,colStart:0,rowEnd:0,colEnd:0}}},vC=()=>{let e=hC.current?.getSheetElement();if(!e)throw Error(`The sheet has not rendered.`);return e};window.__sheetxlScreenshot={ready:pC,async measure(e){await pC;let t=await mC,{sheet:n,coords:r}=_C(t,e.range);t.getActiveSheet()!==n&&(await n.select(),await lC());let i=n.getView();i.setFreezePanes(null),i.setZoomScale(100),i.setShowRowHeaders(e.headers),i.setShowColumnHeaders(e.headers),i.setShowRowGridlines(e.gridlines),i.setShowColumnGridlines(e.gridlines);let a=n.getRowHeaders().getMetrics(),o=n.getColumnHeaders().getMetrics();i.setTopLeft({left:o.getOffset(r.colStart),top:a.getOffset(r.rowStart)}),await lC(),gC={sheet:n,coords:r,headers:e.headers};let s=vC(),c=e.headers?s.getRowHeaderElement().getBoundingClientRect().width:0,l=e.headers?s.getColumnHeaderElement().getBoundingClientRect().height:0;return{width:Math.ceil(c+o.getOffset(r.colEnd+1)-o.getOffset(r.colStart))+2,height:Math.ceil(l+a.getOffset(r.rowEnd+1)-a.getOffset(r.rowStart))+2,range:`${uC(n.getName())}!${n.getRange(r).getA1()}`}},async clip(){if(!gC)throw Error(`measure() must be called before clip().`);let{sheet:e,coords:t,headers:n}=gC,r=await mC;await r.whenFontsReady(),await lC(),await Oe(r),await lC();let i=vC().getGridSurface().getPane(),a=i?.getElement();if(!i||!a)throw Error(`The grid has not rendered.`);let o=a.getBoundingClientRect(),s=i.getBoundsFromRange(t),c=o.left+s.x,l=o.top+s.y,u=e.getRowHeaders().getMetrics(),d=e.getColumnHeaders().getMetrics(),f=(e,t,n,r)=>{let i=t;for(;i<n&&e.getOffset(i+2)-e.getOffset(t)<=r;)i++;return i},p=f(d,t.colStart,t.colEnd,window.innerWidth-c),m=f(u,t.rowStart,t.rowEnd,window.innerHeight-l),h={...t,colEnd:p,rowEnd:m},g=c+d.getOffset(p+1)-d.getOffset(t.colStart),_=l+u.getOffset(m+1)-u.getOffset(t.rowStart),v=n?0:c,y=n?0:l;return{x:v,y,width:Math.ceil(g-v)+1,height:Math.ceil(_-y)+1,shown:`${uC(e.getName())}!${e.getRange(h).getA1()}`}}},rr.createRoot(document.getElementById(`root`)).render((0,Z.jsx)(oC,{ref:hC,workbook:mC,showTabs:!1,showHorizontalScrollbar:!1,showVerticalScrollbar:!1,style:{position:`absolute`,inset:0},onWorkbookLoad:async()=>{await lC(),dC()}}));
|