@sheetxl/react 0.4.9 → 0.4.10
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/browser/cjs/{DLL4A5aF_1HuWIr5.cjs → BkuITQ2sNHxvsmB0.cjs} +1 -1
- package/browser/cjs/{C9n_wMqHvH0dL8n6.cjs → DNo5c_VFRpVYlOmp.cjs} +1 -1
- package/browser/cjs/index.cjs +10 -10
- package/browser/cjs/{CHwSaAIUkspCiH6o.cjs → wDNFYRRXgRT9EMu2.cjs} +1 -1
- package/browser/esm/{kV_N8ySzY88DxIVA.mjs → CD-LLUyw3wwDiAZr.mjs} +1 -1
- package/browser/esm/{CZBZdo6JvJJ12ngU.mjs → Cv3UmnkBp-69XB-f.mjs} +1 -1
- package/browser/esm/{BNans21Vs1G4_8lc.mjs → D7ucmKEU706sujEB.mjs} +1 -1
- package/browser/esm/index.mjs +542 -541
- package/node/esm/{qVMCnBvRVvSaMxkR.mjs → dxyFXUyZ0WCn3N9j.mjs} +1 -1
- package/node/esm/index.mjs +10 -9
- package/package.json +5 -5
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;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}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
"use strict";/**
|
|
3
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.
|
|
3
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.10
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),ue=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Dt=require("react-dom"),cn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),ml=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:cn},Symbol.toStringTag,{value:"Module"})),hr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),ao=(e,t=!0,n=hr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let i=ue.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},fl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:hr,findNextFontSize:ao},Symbol.toStringTag,{value:"Module"})),so=o.memo(e=>{const{anchorLocation:t=ue.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:p,style:g,...q}=e,h=a,f=l;let I="red",S=[],D=[];return t===ue.AnchorLocation.TopLeft?(I=d?"rgb(255, 198, 246)":"green",S.push(f),D.push(f),S.push(f+h),D.push(f),S.push(f),D.push(f+h)):t===ue.AnchorLocation.TopRight?(I=d?"rgb(0, 255, 255)":"red",S.push(n-f),D.push(f),S.push(n-(f+h)),D.push(f),S.push(n-f),D.push(f+h)):t===ue.AnchorLocation.BottomRight?(I=d?"rgb(236, 252, 211)":"purple",S.push(n-f),D.push(i-f),S.push(n-(f+h)),D.push(i-f),S.push(n-f),D.push(i-(f+h))):t===ue.AnchorLocation.BottomLeft&&(I=d?"rgb(255, 236, 183)":"blue",S.push(f),D.push(i-f),S.push(f+h),D.push(i-f),S.push(f),D.push(i-(f+h))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...g},...q,children:c.jsx("path",{d:`M ${S[0]} ${D[0]} L ${S[1]} ${D[1]} L ${S[2]} ${D[2]} L ${S[0]} ${D[0]} Z`,fill:m??I,...p})})}),mr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...p}=e,g=o.useMemo(()=>{let I=null;const S=l.getSortField();S&&(I=S.reverse);const D=l.getField(),z=D&&D.criteria&&D.criteria.length>0;return I===!0?z?"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":I===!1?z?"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":z?"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":"m 3,5.025 4.5,5 4.5,-5 z"},[l]),[q,h]=o.useState(!1),f=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${f}px`,height:`${f}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${q&&!a?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(f>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:I=>{d?.(I,l)},...p,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${q&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:g})})})},fr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:p,bodyStyle:g,normalStyle:q,showFormulas:h,showZeros:f,docTheme:I,onLinkMouseDown:S,onFilterButtonMouseDown:D,filterButtonProps:z,createFilterButton:W=mr,...K}=e,w=i.height/m,j=i.width/m,R=t,y=R.getValue(),M=t.getStyle(),B=g?.darkMode??!1;let F,A;const _=y&&y.isFormulaError,G=_&&y instanceof s.FormulaError.Parse;let P,V=h||G;if(V)if(R.isSpillOverflow())A="";else{const Ae=R.getFormulaText();Ae?A=Ae:F=R.getNumberFormat(s.NumberFormat.Type.General)}else F=R.getNumberFormat();V||(P=R.getTextOverflow());const $=P?P.colBounds.width+P.leftOffset+P.rightOffset:j,te=P?P.anchorBounds.x-P.leftOffset:0,N=P?P.anchorBounds.width:j,x=P?P.anchorBounds.x:0;let H,re=R.getRenderHorizontalAlignment();F&&(H=F?.formattedRuns,A=H?.runs[0]?.text??F.displayText);const ye=R.getCalcStatus()===s.ICell.CalcStatus.Pending;let ne=null,X=M.getFill().toCSS(B,i),ae=0,Me=0;if(!M.getBorder().isEmpty()){const Ae=M.getBorder().getRight();!Ae.isNone()&&s.IBorder.BuiltInDefinitions.get(Ae.getStyle()).width>1&&(ae=1);const k=M.getBorder().getBottom();!k.isNone()&&s.IBorder.BuiltInDefinitions.get(k.getStyle()).width>1&&(Me=1)}let Te=null;if(j!==N||ae||Me||typeof X?.backgroundPosition=="number"){const{backgroundPosition:Ae,...k}=X,oe=Ae??0,O=p?.getScrollTopLeft(),Y=oe?-(i.x+(O.left??0))%oe:0,u=oe?-(i.y+(O.top??0))%oe:0;(Ae!==void 0||ae||Me||j!==N)&&(Object.keys(k).length===1&&k.background==="none"||(X=null,Te=c.jsx("div",{className:"fill",style:{marginLeft:`${Y}px`,marginTop:`${u}px`,left:x*m,width:r.ReactUtils.boundPixel(N*m-Y+1+ae),height:r.ReactUtils.boundPixel(i.height-u+1+Me),...k}},"background")))}let fe=null;const Be=R.getComments(),pe=R.getWarnings(),Pe=R.getErrors();if(Be||_||Pe.length>0||pe.length>0){const Ae={size:7*m,darkMode:B,cellWidth:N*m+2,cellHeight:w*m+2,style:{top:-1,left:x*m-1}};fe=fe??[],(pe.length>0||Pe.length>0||_)&&fe.push(c.jsx(so,{anchorLocation:ue.AnchorLocation.TopLeft,...Ae},`indicator-${fe.length}`)),Be&&fe.push(c.jsx(so,{anchorLocation:ue.AnchorLocation.TopRight,...Ae},`indicator-${fe.length}`))}const Se=M.getFont();let ge=F?.conditionalColor;const ce=M.getAlignment(),we=ce.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,de=ce.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||we,be=de||V?0:ce.getRotation(),Fe=R.getInsets(),ve=Fe.top+Fe.bottom;let Ee=Fe.left,Oe=Fe.right;const He={...l,left:l.left-1,top:l.top-1,width:l.width+1+ae,height:l.height+1+Me},C=R.getColumnFilter(),Ue=C&&!C?.hasHiddenButton();let Qe=null;ye&&(Qe=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const $e=!(ye||Ue||Te||a||fe||H?.runs.length>1||P||be%360!=0);X?.background==="none"&&(X=null);let J=de||!(!P||!(P.rightIndex>0||P.leftIndex>0||P.colSpan>1));if(!J){const Ae=R.getSpans();(Ae.width>1||Ae.height>1)&&(J=!0)}const Ie={...X,...He,pointerEvents:S?"auto":void 0};if(!ue.CommonUtils.isEmpty(A)||!ue.CommonUtils.isEmpty(F?.repeatPlaceholder)){const Ae=F?.canWrap??!1;let k=null,oe=null,O=null,Y=[],u=!0;f||V||y!==0||(u=!1);const T=R.getTextFrame(V);if(u&&T){let E=$-1-(Ee+Oe);if(be){k=T.layout().bounds;const Ce={x:0,y:0,width:$-1,height:w};if(H){let he=H.width;if(F.repeatPlaceholder||F.repeatChars.length>0){const me=s.GeomUtils.boundsToPoints(Ce),xe=s.GeomUtils.rotatePoints(me,-be);he=s.GeomUtils.minBoundingRect(xe).width}k={...k,width:he}}O=s.GeomUtils.clipToOuterRect({...k,width:k.width+1+Ee+Oe},Ce,be),E=O.width-1-(Ee+Oe)+.01}let b=null;Ae&&(b={width:E});let L=null,v=F?.repeatPlaceholder;const U=T.layout(b);if(k=U.bounds,V?k={...k,width:0}:H&&(k={...k,width:F.repeatPlaceholder||F.repeatChars.length>0?E:H.width}),be&&Ae){let se=null;U.visitLines({visitTextLine:(Ce,he)=>{let me=Ce.bounds;const xe=s.GeomUtils.boundsToPoints(me),Le=s.GeomUtils.rotatePoints(xe,be),De=s.GeomUtils.minBoundingRect(Le);me={...me,x:(De.width-me.width)/2,y:(De.height-me.height)/2},se=se?s.GeomUtils.unionBounds(se,me):me}}),k={...se,width:se.width+Ee+Oe}}if(!v&&R.getType()!==s.ScalarType.String&&Math.floor(k.width)>E){if(M.getNumberFormat()==="General"&&R.getType()===s.ScalarType.Number){const se=M.measureText("0"),Ce=Math.floor(E/se.width),he=y,me=ue.CommonUtils.splitNumber(he),xe=Math.min(10,Ce-(Math.max(1,me.ipLength)+1)-(he<0?1:0));if(xe>=-1){const Le=`0${xe>0?".":""}${"#".repeat(Math.max(0,xe))}`;L=R.getNumberFormat(Le).displayText,L==="0"&&he<0&&(L="-0")}else if(Math.abs(he)>=Math.pow(10,5)||Math.abs(he)<=Math.pow(10,-5)){const Le=Ce-5-(he<0?1:0);if(Le>=0){const De=`0.${"0".repeat(Math.max(0,Le-1))}E+00`;L=R.getNumberFormat(De).displayText}}}L||(v="#")}if(!v&&H?.lastRepeatIndex>=0&&H?.width>E&&(v="#"),v&&E>0){const se=M.measureText(v),Ce=Math.floor((E||1)/(se?.width||1));L=Ce>0?v.repeat(Ce):""}if(V&&(re=s.ITextFrame.HorizontalAlignment.Left),L){const se=M.measureText(L).width;se&&(k={...k,width:se})}if(oe={...k,width:k.width+Ee+Oe,height:k.height},be&&!Ae){const se=s.GeomUtils.boundsToPoints(oe),Ce=s.GeomUtils.rotatePoints(se,be),he=s.GeomUtils.minBoundingRect(Ce);oe.width=he.width,oe.height=he.height}re===s.ITextFrame.HorizontalAlignment.Center||re===s.ITextFrame.HorizontalAlignment.CenterContinuous?oe.x=($-oe.width)/2:re===s.ITextFrame.HorizontalAlignment.Right?oe.x=$-oe.width-.5:oe.x=.5,ce.getVertical()===s.ITextFrame.VerticalAlignment.Center?oe.y=(w-oe.height)/2:ce.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?oe.y=w-oe.height-ve:oe.y=ve;const Z=$e?{...K}:void 0,ee={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:be?`rotate(${be}deg)`:void 0,cursor:S?"pointer":void 0,pointerEvents:S?"auto":void 0,zIndex:J?1:void 0,...X},onMouseDown:S,onDoubleClick:S?se=>{se.stopPropagation(),se.preventDefault()}:null,...Z};G&&(ee.style.textDecorationStyle="wavy",ee.style.textDecorationColor=B?"rgb(0, 255, 255)":"red",ee.style.textDecorationLine="underline");const le=Se.getSize(),ie=(se,Ce,he,me,xe,Le,De,We=null)=>{let je=le*m,Ge=he,Ne=De?.runs?De.runs:[{type:s.NumberFormat.ParseRunType.Text,text:se,width:M.measureText(se,je).width}];De&&De?.width!==k.width&&(k={...k,width:De?.width});let Xe=Ee;if(De?.lastRepeatIndex>=0&&E>De?.width){const _e=De.runs[De.lastRepeatIndex];if(_e){const rt=[...Ne],vt=Math.max(0,E-1-De.width);let yt=0,Ct="";if(vt>0){const gt=Math.floor(vt/_e.width);Ct=gt>0?_e.text.repeat(gt):"",yt=vt}rt[De.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:Ct,width:yt},Ne=rt,k={...k,width:De.width+yt}}}const it=(_e,rt,vt,yt,Ct,gt,lt,Tt,Lt,Zt=null)=>{let Ft,Xt=Ge.width;xe===s.ITextFrame.HorizontalAlignment.Justify?(Xt=Ct,Le||(Ft="justify")):xe===s.ITextFrame.HorizontalAlignment.Distributed&&(Xt=Ct,Ft=Le||_e.text.split(" ").length-1==0?"center":"justify");const{style:Mt,className:vn,...Cn}=Zt;let Ot=_e.text;if(xe===s.ITextFrame.HorizontalAlignment.Fill&&F?.repeatChars.length===0){const at=Math.max(1,Math.floor((Ge?.width??0)/(lt?.width??1)));Ot=Ot.repeat(at)}let kt=Ge.height;const At=Se.getVerticalAlignment(),Yt=At===s.IFont.VerticalAlignment.Sub,Hn=At===s.IFont.VerticalAlignment.Super;if(Yt||Hn){const at=Se.getSuperSubScale();je*=at,kt*=at}const nt={textAlign:Ft,textAlignLast:Ft,background:void 0,...Mt,...Se.toCSS(B,m,!0),fontSize:je*s.IFont.getDeviceScale()};ge&&(nt.color=ge.toCSS(B));const Jt=Xe+rt;let jt=Fe.top+Ge.y+0;if(Yt&&(jt+=Lt-je),gt){const at=(lt.x+Jt)*m+1,ht=(lt.y+jt)*m+1;ht<0?nt.marginTop=ht:nt.paddingTop=ht,at<0?(nt.width=(Mt?.width??0)-at,nt.left=(Mt?.left??0)+at):nt.paddingLeft=at,nt.paddingRight=Math.max(0,(Mt?.width??0)-Xt*m-at),nt.paddingBottom=Math.max(0,(Mt?.height??0)-Ge.height*m-ht),nt.height=(Mt?.height??0)+(ht<0?-ht:0),(ht<0||at<0)&&(nt.clipPath=`inset(${ht<0?-ht:0}px 0px 0px ${at<0?1-at:0}px)`)}else if(nt.left=(lt.x+Jt)*m+1,nt.top=(lt.y+jt)*m+1,nt.width=lt.width*m,nt.height=lt.height*m,be&&!Ae){nt.left=(lt.x+rt)*m+1,nt.top=(lt.y+(Ge.y+0))*m+1;const at=s.GeomUtils.centerPoint({x:Xe+rt,y:0,width:_e.width,height:Ge.height}),ht=s.GeomUtils.centerPoint({x:Xe,y:0,width:Ct,height:Ge.height}),Qt=s.GeomUtils.rotatePoints([at],be,ht),yn={x:Qt[0].x-at.x,y:Qt[0].y-at.y};nt.left=nt.left+yn.x*m,nt.top=nt.top+yn.y*m;const Bt={...Ge,x:Xe,y:Fe.top,width:Ge.width+(Ee+Oe)},Un=s.GeomUtils.boundsToPoints(Bt),en=s.GeomUtils.rotatePoints(Un,be),wn=s.GeomUtils.minBoundingRect(en);Bt.width=wn.width,Bt.height=wn.height;const Vt=s.GeomUtils.centerPoint(Bt),xn={x:Vt.x-ht.x,y:Vt.y-ht.y};nt.left=nt.left+xn.x*m,nt.top=nt.top+xn.y*m}nt.lineHeight=kt*m+"px";const bn=$e?void 0:"text-line";Y.push(c.jsx("div",{className:vn?`${vn} ${bn}`:bn,style:nt,...Cn,children:Ot},`text-${Ge.y}-${yt}-${vt}`))};if(ce.getOverflow()===s.ITextFrame.Overflow.Shrink&&E>0){let _e=k?.width??0,rt=0;for(;_e>1&&_e>E&&je>2&&rt<100;)je*=E/_e,_e=M.measureText(se,je).width,rt++;k={...k,width:_e}}let pt=Ge.x;xe===s.ITextFrame.HorizontalAlignment.Right?pt+=k.width-Ge.width:xe!==s.ITextFrame.HorizontalAlignment.Center&&xe!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(pt+=(k.width-Ge.width)/2),De?.lastRepeatIndex>=0&&(pt=Ge.x);const wt=Ne.length;for(let _e=0;_e<wt;_e++){const rt=Ne[_e];(rt.type===s.NumberFormat.ParseRunType.Text||rt.type===s.NumberFormat.ParseRunType.Repeat)&&(rt.type,s.NumberFormat.ParseRunType.Repeat,it(rt,pt,_e,Ce,xe===s.ITextFrame.HorizontalAlignment.Justify||xe===s.ITextFrame.HorizontalAlignment.Distributed||De?.lastRepeatIndex>=0?E:Ge.width,$e,{x:oe.x+te,y:oe.y,width:rt.width,height:k.height},0,me,We)),pt+=rt.width}};L?ie(L,0,{x:0,y:0,...k},U.lines[0].baseline,re,!0,null,ee):U.visitLines({visitTextLine:(se,Ce,he)=>{const me=se.runs[0].text.replace(/\s+$/,""),xe=Ce===he-1;let Le=re===s.ITextFrame.HorizontalAlignment.Justify&&(xe||se.runs[0].text.endsWith(`
|
|
8
|
-
`))?s.ITextFrame.HorizontalAlignment.Left:re,De=0;Ce>0&&(ce.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||ce.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(De=Math.max(0,(
|
|
9
|
-
`+N.textValue.substring(T.selectionEnd);return X(b),void V({start:T.selectionStart+1,end:T.selectionStart+1,direction:T.selectionDirection})}return void(Te()&&f.getSelection().traverse(s.IRange.Orientation.Column,O))}if(k.which===r.KeyCodes.Tab)return k.preventDefault(),void(Te()&&f.getSelection().traverse(s.IRange.Orientation.Row,O));let E=null;switch(k.which){case r.KeyCodes.Left:E=s.IRange.Direction.Left;break;case r.KeyCodes.Right:E=s.IRange.Direction.Right;break;case r.KeyCodes.Up:E=s.IRange.Direction.Up;break;case r.KeyCodes.Down:E=s.IRange.Direction.Down}if(E&&!(oe||O||Y||u)&&!$.editMode)return void Te();$.editMode&&(E||pl.includes(k.which))&&k.stopPropagation()},[$,f,N]),pe=o.useCallback(()=>{x.current?.focus(),setTimeout(()=>{x.current?.select()},0)},[]),Pe=o.useCallback(()=>{x.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Se=r.useCallbackRef(()=>{const k=x.current?.value;let oe="";if(h.rowIndex>0){const O=f.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();O&&(oe=O.toTextUnformatted(!0))}X(k+oe)},[h,f]);o.useEffect(()=>f.getRange(h).addListener(()=>{const k={...$,clean:()=>f.getRange(h).getCell()};te(k),ne?.(k)}),[h,f]);const ge=o.useCallback(()=>{const k=$.clean().createTemporaryCell({value:cn(),style:{numberFormat:"Medium Time"}}).toText();X((x.current?.value??"")+k)},[f]),ce=o.useCallback(()=>{const k=$.clean().createTemporaryCell({value:cn(),style:{numberFormat:"Short Date"}}).toText();X((x.current?.value??"")+k)},[f]),we=o.useMemo(()=>({element:()=>x.current,doCopy:k=>{const oe=x.current.value.substring(x.current.selectionStart,x.current.selectionEnd);if(k?.isCut){const O=x.current.value.substring(0,x.current.selectionStart)+x.current.value.substring(x.current.selectionEnd,x.current.value.length);X(O)}return oe}}),[x.current]),de=o.useMemo(()=>({element:()=>x.current,doPaste:async(k,oe)=>{const O=await k.toText?.();if(!O)return!0;const Y=x.current.value.substring(0,x.current.selectionStart)+O+x.current.value.substring(x.current.selectionEnd,x.current.value.length);return X(Y),V({start:x.current.selectionStart+O.length,end:x.current.selectionStart+O.length,direction:"forward"}),!0}}),[x.current]),be=o.useMemo(()=>({contains:k=>x.current?.contains(k)||!1,focus(){x.current.focus()}}),[]),Fe=o.useMemo(()=>[new r.SimpleCommand("selectAll",be,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},pe),new r.SimpleCommand("startEditValueAbove",be,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Se),new r.SimpleCommand("startEditCurrentTime",be,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},ge),new r.SimpleCommand("startEditCurrentDate",be,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},ce),new r.Command("relativeReferencesToggle",be,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Pe),new r.Command("toggleEditorFocus",be,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ve=o.useMemo(()=>{let k=null;const oe=()=>({contains:O=>x.current?.contains(O)||!1,focus(){x.current.focus()}});return k=I?I.createChildGroup(oe,"editor",!1):new r.CommandGroup(oe,"editor"),k.addCommands(Fe,!0),k},[I,Fe]),Ee=o.useMemo(()=>({notifier:null,source:we,target:de,commands:ve}),[we,de,ve]);r.useCopyPaste(Ee);const[Oe,He]=o.useState(!R);o.useEffect(()=>{He(!1)},[]);const C=r.useCallbackRef(k=>{G(!0),ve?.activate();const oe=A.current;if(oe!==!1){let O,Y;const u=x.current.value;Io($,u)&&(O=u.length-1,Y=u.length-1),O=oe?.start??O??u.length,Y=oe?.end??Y??u.length,A.current=!1,V({start:O,end:Y,direction:"forward"})}z?.(k)},[z,$]),Ue=N.insets;let Qe=Ue.left+1;const $e=Ue.left+Ue.right+2-1,J=re?.bounds.height??0;let Ie,Ve=Ue.top;N.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?Ve=Math.max(0,(M-(Ue.top+Ue.bottom)-J)/2):N.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(Ve=Math.max(0,M-(Ue.top+Ue.bottom)-J)),j!==void 0&&re?.lines[0]?.bounds&&(Ie=re?.lines[0]?.bounds.height*j);const ke=N.style.getFont();let ze=ke.getSize();ke.isSuperSub()&&(ze*=ke.getSuperSubScale()),ze*=s.IFont.getDeviceScale()*w;const Ae=g?ke.toCSS(F,w):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:k=>{x.current&&document.activeElement!==x.current&&requestAnimationFrame(()=>{x.current.focus()})},ref:H,...y,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...K},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Ve*w+1,left:Qe*w,width:`calc(100% - ${$e*w}px)`,maxWidth:`calc(100% - ${$e*w}px)`,height:(Ie??J)*w,maxHeight:(Ie??J)*w},children:c.jsx("textarea",{spellCheck:"false",placeholder:N.placeholder,ref:x,value:N.textValue,disabled:Oe,readOnly:W||f.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ae,fontSize:ze?`${ze}px`:"inherit",textAlign:N.textAlign,lineHeight:(re?.lines[0]?.bounds.height??0)*w+"px",height:(re?.bounds.height??0)*w,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:N.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:C,onBlur:()=>{G(!1)},onSelect:k=>{},onChange:k=>{x.current&&!Me.current&&(A.current=!1,X(k.target.value),N.textValue,k.target.value,k.target.selectionStart,k.target.selectionEnd,k.target.selectionDirection,V({start:k.target.selectionStart,end:k.target.selectionEnd,direction:k.target.selectionDirection}))},onMouseDown:k=>{_&&ae(!0)},onKeyDown:Be})})})})),vr=(e,t)=>({clean:e,dirty:t,editMode:!1}),Cr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:p=0,isVertical:g=!1,...q}=e,h=K=>{let w=null;if(K&&n>0){w="";for(let j=0;j<K.length;j++)w+=K[j],j<K.length-1&&(w+=",")}return w},f=h(i);let I=f;a&&(I=h(a));let S=n,D=t,z=null;if(l){S=Math.floor(n/2);const K=S+S/2+1;let w=null;w=g?`M ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p+D)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+K)} L ${r.ReactUtils.boundPixel(m+D)} ${r.ReactUtils.boundPixel(p+K)}`,z=c.jsx("path",{strokeWidth:S,strokeDasharray:I,d:w,...q})}if(d){S=n/2;const K=S+S/2;let w=I,j=null;j=g?`M ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p+D)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+K)} L ${r.ReactUtils.boundPixel(m+D)} ${r.ReactUtils.boundPixel(p+K)}`,z=c.jsx("path",{strokeWidth:S,strokeDasharray:w,strokeDashoffset:"1",shapeRendering:"crispEdges",d:j,...q})}let W=null;return W=g?`M ${r.ReactUtils.boundPixel(m+S/2)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+S/2)} ${r.ReactUtils.boundPixel(p+D)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+S/2)} L ${r.ReactUtils.boundPixel(m+D)} ${r.ReactUtils.boundPixel(p+S/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:S,strokeDasharray:f,d:W,...q}),z]})};function Qn(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Wt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=Qn(i,t),l=typeof a=="function";n.push(l?a:()=>Qn(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)Qn(n,t)}},vl=function(){},br=typeof window<"u",rn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Cl=br?o.useLayoutEffect:o.useEffect,Eo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const zt=br&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(Eo),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var p=m[0].contentRect,g=p.x,q=p.y,h=p.width,f=p.height,I=p.top,S=p.left,D=p.bottom,z=p.right;l({x:g,y:q,width:h,height:f,top:I,left:S,bottom:D,right:z})}})},[]);return Cl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[vl,Eo]},bl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,yl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,wl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:p=!1,intersections:g,layout:q}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const f=n[0],I=n[1],S=n[2],D=n[3];let z=1+(p?D-I:S-f),W=0;const K=a.getColor().toRGBA(l).toString(),w=h.description.toLowerCase().includes("double");let j,R;const y=p?"rowStart":"colStart",M=p?"rowEnd":"colEnd",B=p?I:f;if(g?.length>0){const G=g[0];if(G?.range[y]===i[y]){const V=s.IBorder.BuiltInDefinitions.get(G.stroke.getStyle());W=Math.floor(V.width/2)}if(g[g.length-1]?.range[M]===i[M]){const V=s.IBorder.BuiltInDefinitions.get(g[g.length-1].stroke.getStyle());z=Math.floor(z+(V.width===2?0:V.width/2))}if(w){const V=p?"colStart":"rowStart",$=p?"colEnd":"rowEnd",te=p?q?.getRowOffset:q?.getColOffset;let N=0,x=0;j=[],R=[];for(let H=0;H<g.length;H++){const re=g[H];if(re.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&te){const ye=te(re.range[y])-(B-W);re.range[V]<i[V]&&(j.push(ye-N),N=ye,j.push(1),N++),re.range[$]>i[$]&&(R.push(ye-x),x=ye,R.push(1),x++)}}j.length>0&&N<z&&j.push(z-N),R.length>0&&x<z&&R.push(z-x)}}let F=p?-Math.floor(h.width/2):-W,A=p?-W:-Math.floor(h.width/2);const _=m&&h.width>2?-1:0;return c.jsx(Cr,{offsetX:f+F+_,offsetY:I+A+_,length:z+W,isVertical:p,stroke:K,width:h.width,dashArray:j??h.pattern,dashArrayAdditional:R,isDouble:w,isAngled:h.description.toLowerCase().includes("slant")},t)},po=({getBorderAt:e,borderRenderer:t=wl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>g=>{const q=g.toClipBounds(g.getRangeCoordsBounds(),-3);if(!q)return;const h=m(g);if(h.length===0)return;const f=g.getVisibleColumnOffsets(),I=g.getVisibleRowOffsets();let S=[],D=[];const z=g.getVisibleColumns(),W=g.getVisibleRows(),K=[],w=[],j=[],R=(F,A,_,G,P,V,$)=>{const te={index:G,stroke:P,visibleIndex:_,edge:V,length:$};F[A]||(F[A]=[]),F[A].length>0&&F[A][F[A].length-1]?.index===G?F[A][F[A].length-1]=te:F[A].push(te)};for(let F=0;F<h.length;F++){const A=h[F],_=A.coords;if(!_)continue;const G=A?.range??{rowStart:_.rowIndex,colStart:_.colIndex,rowEnd:_.rowIndex,colEnd:_.colIndex},P=g.getVisibleRangeCoords();if(!ue.CoordUtils.isRangesIntersect(G,P)&&!ue.CoordUtils.isRangeWithinRange(G,P))continue;const V=_.colIndex,$=_.rowIndex,te=f[V],N=I[$];if(G.rowEnd!==G.rowStart){const Be=I[G.rowStart]?.spanIndex??-1,pe=I[G.rowEnd]?.spanIndex??I[W[W.length-1]].spanIndex+1;S.push({...G,rowStart:Be,rowEnd:pe})}if(G.colEnd!==G.colStart){const Be=f[G.colStart]?.spanIndex??-1,pe=f[G.colEnd]?.spanIndex??f[z[z.length-1]].spanIndex+1;D.push({...G,colStart:Be,colEnd:pe})}const x=A.value,H=e(x,F);if(!H||H.isEmpty())continue;const re=H.getLeft(),ye=H.getTop(),ne=H.getRight(),X=H.getBottom();let ae=1,Me=1;if(!te||!N)continue;const Te=te.spanIndex,fe=N.spanIndex;re.isNone()||R(K,Te,fe,$,re,s.IBorder.Edge.Left,ae),ye.isNone()||R(w,fe,Te,V,ye,s.IBorder.Edge.Top,Me),ne.isNone()||R(K,Te+Me,fe,$,ne,s.IBorder.Edge.Right,ae),X.isNone()||R(w,fe+ae,Te,V,X,s.IBorder.Edge.Bottom,Me)}const y=(F,A,_)=>{const G=[];return F.forEach((P,V)=>{let $=null;P.sort((te,N)=>te.visibleIndex-N.visibleIndex);for(let te=0;te<P.length;te++){const N=P[te];if(!N?.stroke||A[V]===void 0&&A[V-1]===void 0)continue;let x=!1;if(_)for(let ne=0;!x&&ne<S.length;ne++){let X=S[ne];X.colStart<=N.index&&X.colEnd>=N.index&&X.rowStart<V&&X.rowEnd>=V&&(x=!0)}else for(let ne=0;!x&&ne<D.length;ne++){let X=D[ne];X.rowStart<=N.index&&X.rowEnd>=N.index&&X.colStart<V&&X.colEnd>=V&&(x=!0)}if(x)continue;const H=N.stroke?.getColor(),re=H?H.toRGBA().toString():l,ye=N.stroke.getStyle()+":"+re;(ye!==$?.key||$&&$.visibleIndex+1<N.visibleIndex)&&($&&G.push($),$={key:ye,index:A[V]??A[V-1]+1,visibleIndex:N.visibleIndex,edge:N.edge,stroke:N.stroke,from:N.index,to:N.index+N.length-1,intersections:[],length:1}),$.to=N.index+N.length-1,$.visibleIndex=N.visibleIndex}$&&G.push($)}),G};S=S.sort(yl),D=D.sort(bl);const M=y(K,z,!1),B=y(w,W,!0);if(M.length===0&&B.length===0)return null;for(let F=0;F<B.length;F++){const A=B[F];let _=ue.CommonUtils.findEqualOrGreater(M,A.from,P=>P.index),G=!1;for(;!G;){const P=M[_++];P&&P.index>=A.from&&P.index<=A.to+1&&P.from<=A.index&&P.to+1>=A.index&&(A.intersections.push({stroke:P.stroke,range:{rowStart:P.from,rowEnd:P.to+1,colStart:P.index,colEnd:P.index}}),P.intersections.push({stroke:A.stroke,range:{rowStart:A.index,rowEnd:A.index,colStart:A.from,colEnd:A.to+1}})),G=!P||P.index>A.to+1}}for(let F=0;F<B.length;F++){const A=B[F];let _=A.stroke;const G=`rBorder:${A.index}:${A.from}:${A.to}:${A.edge}`,P={rowStart:A.index,rowEnd:A.index,colStart:A.from,colEnd:A.to+1},V=g.getLayout(),$=!1,te=V.getColOffset(P.colStart),N=V.getRowOffset(P.rowStart),x=[te,N,V.getColOffset(P.colEnd),N];j.push(t({key:G,points:x,stroke:_,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:A.intersections,layout:V,isVertical:$}))}for(let F=0;F<M.length;F++){const A=M[F];let _=A.stroke;const G=`cBorder:${A.index}:${A.from}:${A.to}:${A.edge}`,P={rowStart:A.from,rowEnd:A.to+1,colStart:A.index,colEnd:A.index},V=g.getLayout(),$=!0,te=V.getColOffset(P.colStart),N=[te,V.getRowOffset(P.rowStart),te,V.getRowOffset(P.rowEnd)];j.push(t({key:G,stroke:_,points:N,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:A.intersections,layout:V,isVertical:$}))}return c.jsx("svg",{width:`${q.width}`,height:`${q.height}`,viewBox:`0 0 ${q.width} ${q.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${q.width}px`,height:`${q.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:j},"borders")},[e,i])}},Fo=ue.AnchorLocation.Center,xl=Object.freeze({horizontal:!1,vertical:!1}),Ao=ue.TypesUtils.EmptyTopLeft,ql=(e,t)=>ue.CoordUtils.EmptyCell,Sl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Rl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:p,children:g,...q}=e,h=o.useRef(null),[f,{width:I,height:S}]=zt(),D=n??I,z=i??S,W=o.useMemo(()=>{const $=[];for(let te=0;te<l;te++)for(let N=0;N<d;N++){const x={colIndex:N,rowIndex:te};$.push({coords:x,value:x})}return $},[]),K=o.useCallback($=>W,[W]),{overlay:w}=po({getVisibleCells:K,getBorderAt:t,darkMode:m,forceThinBorder:p}),j=Math.floor(D/d),R=Math.floor(z/l),y={getColOffset:$=>Math.ceil($*j)+0,getRowOffset:$=>Math.ceil($*R)+0,getColIndex:$=>Math.floor(($-0)/j)-1,getRowIndex:$=>Math.floor(($-0)/R)-1},M={rowStart:0,colStart:0,rowEnd:l,colEnd:d},B={x:0,y:0,width:Math.max(0,D)+0,height:Math.max(0,z)+0},F=o.useMemo(()=>{const $={},te=Math.floor(D/d);for(let N=0;N<d;N++)$[N]={offset:N*te,size:te,spanIndex:N};return $},[D,z]),A=o.useMemo(()=>{const $={},te=Math.floor(z/l);for(let N=0;N<l;N++)$[N]={offset:N*te,size:te,spanIndex:N};return $},[D,z]);if(!w)return null;const _={width:D,height:z},G={width:D,height:z},P={getStage:()=>h.current,getTotalSize:()=>_,getViewportSize:()=>G,getLayout:()=>y,getCellCoordsAsRangeCoords:ue.CoordUtils.cellToRange,getVisibleRangeCoords:()=>M,getVisibleRows:()=>{const $=[];for(let te=0;te<l;te++)$.push(te);return $},getTotalRangeCoords:()=>M,getRelativePointFromClient:($,te)=>({x:$,y:te}),getVisibleColumns:()=>{const $=[];for(let te=0;te<d;te++)$.push(te);return $},toClipBounds:($,te)=>B,toViewBounds:$=>$,toAbsoluteBounds:$=>$,getBounds:()=>B,getInsets:()=>null,getRangeCoordsBounds:($,te)=>null,getVisibleColumnOffsets:()=>F,getVisibleRowOffsets:()=>A,allViews:()=>({[Fo]:P}),getAnchor:()=>Fo,getZoom:()=>1,scrollCellCoordsIntoView:Sl,getCellCoordsFromClient:ql,getScrollOrientation:()=>xl,getScrollTopLeft:()=>Ao,getFreezeTopLeft:()=>Ao},V=w(P);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...q,children:[c.jsx("div",{ref:Wt([h,f]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),V]})});function yr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=yr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function bt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=yr(e))&&(i&&(i+=" "),i+=t);return i}const kl="_sheetxl-sheet_1qeq6_5",Ml="_viewport-overlay_1qeq6_6",wr=e=>{const{style:t,...n}=e??{};return c.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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"})]})},Tl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:d,...m}=e??{},[p,g]=o.useState(null);o.useEffect(()=>{(async()=>{const R=await s.LicenseManager.getDetails();g(R)})()},[]);const[q,h]=o.useState(!1),f={opacity:.65},I=o.useMemo(()=>{if(!(p?.exceptions().length>0))return null;const R=[];for(let y=0;y<p.exceptions().length;y++){const M=p.exceptions()[y];R.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:M},y))}return R},[p,n]);if(p==null||p.isValidFor(l))return null;const S=p.type(),D=!I&&S.endsWith("ity"),z=p.licensee(),W=D?1.6:1,K=135/W,w=37/W;let j=null;return!S&&z?.length>0&&(j=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:z})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...m,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[q?c.jsx(wr,{style:f}):c.jsx("svg",{width:K,height:w,style:f,children:c.jsx("image",{style:{width:K,height:w},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),c.jsxs("div",{children:[j,I,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),tt=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),d={},m=l.length;for(let g=0;g<m;g++){const q=l[g];d[q]=(h,f)=>{i.current[q]?.(h,f)}}const p=e.addListeners(d,n);if(a)for(let g=0;g<m;g++)d[l[g]](e);return()=>{p?.()}},[e])},Rn=new s.Color("transparent");function xr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:p}=e,[g,q]=o.useState(null),[h,f]=o.useState(null),I=o.useRef(null),S=r.useCallbackRef(m,[m]),D=r.useCallbackRef(p,[p]),[z,W]=o.useState(),[K,w]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[j,R]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),y=r.useEditMode();o.useRef(y.getMode()).current=y.getMode();const M=r.useGlobalClipboard(),[B,F]=o.useState(ue.CommonUtils.EmptyArray),A=o.useCallback(()=>{if(I.current!==t)return;const u=t.getSelectedRanges();let T=null;B.length>0&&ue.CoordUtils.isCellWithinRange(g,B[0].getRange().getCoords())&&(T=B[0]);const E=t?.getSelectedCell(),b=E?.getCoords()??null;Dt.unstable_batchedUpdates(()=>{re(T),q(b),f(u)})},[t,B,h,g]),_=o.useCallback(ue.CommonUtils.debounce(A,210),[A]);o.useEffect(()=>{I.current=t,A()},[t]);const G=r.useCallbackRef(()=>t.getRange(g).getCell(),[t,g]),P=r.useCallbackRef(async(u,T,E=null,b=!1,L=!0)=>{const v=u?.label?.(),U=async()=>{const ie=await Promise.resolve(L&&d?.showBusy?.(v??"Busy..."));try{await t.doBatch(async()=>T(t),v),b&&y.setMode(null),ie&&ie()}catch(se){if(ie&&ie(),!se)return;d?.showError?.(se)}},Z=[];let ee=!1;const le=async()=>(Z.push(U),(async()=>{if(!ee){for(ee=!0;Z.length>0;){const ie=Z.shift();ie&&await ie()}ee=!1}})());if(n){let ie=null;if(E!==!1&&u){const se=E??v;ie=new r.SimpleCommand(u.key(),l,{label:se,description:se},le)}n(ie)}return le()},[t,n,d]),V=r.useCallbackRef((u,T,E=!1,b)=>P(u,L=>{const v=L.getSelectedRanges();E&&v.updateStyle(null,b),v.updateStyle(T,b),v.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),$=r.useCallbackRef((u,T,E)=>{P(u,b=>{let L=T;(E||T?.address)&&(L=L??{},!E&&T?.address?.startsWith("#")?E=T?.address.substring(1):E&&(L.displayText=E)),b.getSelectedRange().setHyperlink(L)})},[t]),te=r.useCallbackRef((u,T)=>{P(u,E=>{E.getSelectedRange().setComments(T)})},[t]),N=r.useCallbackRef((u,T)=>{P(u,E=>{E.getSelectedRanges().clear(T)})},[t]),x=r.useCallbackRef(async(u,T,E=!1,b=!1)=>P(u,async L=>{let v=L.getSelectedRanges();E&&(T===s.IRange.Orientation.Row?v=v.getEntireRows(b):T===s.IRange.Orientation.Column&&(v=v.getEntireColumns(b)));let U=null;const Z=y.getMode()?.key;if(Z==="copy"||Z==="cut"){const ee=await M.getClipboard().readReference();ee&&ee.getItemType()==="range"&&(U=ee.getItem(),U.getCoords()||(U=null))}if(U){const ee=await v.insertFrom(U,{...U.getMarkOptions(),orientation:T,autoSelect:!0});!ee||ee.isEntireRows()||ee.isEntireColumns()||ee.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),y.setMode(null)}else v.insert(T,{autoSelect:!0})},"Insert Cells",!1),[y]),[H,re]=o.useState(null),ye=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),ne=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),X=r.useCallbackRef((u,T)=>{P(u,async E=>{const b=E.getSelectedRange(),L=E.getSelectedCell().getCoords();let v=null,U=0;const Z=L.rowIndex>0?E.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex}).getExtended(s.IRange.Direction.Up):null;Z&&E.getRange({colStart:L.colIndex,rowStart:Z.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowStart}).isContentful()&&(v=s.IRange.Direction.Up,U=L.rowIndex-Z.getCoords().rowEnd);const ee=L.colIndex>0?E.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(ee&&E.getRange({colStart:ee.getCoords().colStart,rowStart:L.rowIndex,colEnd:ee.getCoords().colStart,rowEnd:L.rowIndex}).isContentful()){const ie=L.colIndex-ee.getCoords().colEnd;(ie<U||!v)&&(v=s.IRange.Direction.Left,U=ie)}let le=null;if(v===s.IRange.Direction.Up){if(le={...Z.getCoords()},(le.rowEnd===L.rowIndex||!E.getRange({colIndex:L.colIndex,rowIndex:L.rowIndex-1}).isContentful())&&le.rowStart>0&&E.getRange({colIndex:L.colIndex,rowIndex:le.rowStart-1}).isContentful()){const ie=Z.getExtended(s.IRange.Direction.Up);le={colStart:L.colIndex,rowStart:ie.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowEnd}}le.rowEnd=L.rowIndex-1}else if(v===s.IRange.Direction.Left){if(le={...ee.getCoords()},(le.colEnd===L.colIndex||!E.getRange({colIndex:L.colIndex-1,rowIndex:L.rowIndex}).isContentful())&&le.colStart>0&&E.getRange({colIndex:le.colStart-1,rowIndex:L.rowIndex}).isContentful()){const ie=ee.getExtended(s.IRange.Direction.Left);le={colStart:ie.getCoords().colStart,rowStart:L.rowIndex,colEnd:ie.getCoords().colEnd,rowEnd:L.rowIndex}}le.colEnd=L.colIndex-1}if(b.size!==1&&v){const ie=b.getCoords(),se=b.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),Ce={...le},he=ie.rowStart,me=ie.rowEnd,xe=ie.colStart,Le=ie.colEnd,De=v===s.IRange.Direction.Up;for(let We=xe;We<=Le;We++){Ce.colStart=De?We:le.colStart+(We-xe),Ce.colEnd=De?We:le.colEnd+(We-xe);for(let je=he;je<=me;je++){Ce.rowStart=De?le.rowStart+(je-he):je,Ce.rowEnd=De?le.rowEnd+(je-he):je;const Ge=E.getRange(Ce).toString();se.pushAt(je,We,`=${T}(${Ge})`)}}se.apply()}else{const ie=le?E.getRange(le).toString():"",se=`=${T}(`;S?.({text:`${se}${ie})`,editMode:!0,initialSelection:{start:se.length,end:se.length+ie.length}})}},!1)},[t]),ae=r.useCallbackRef((u,T,E=!1,b=!0)=>{P(u,async L=>{let v=null;if(H)return void H.updateStyleOptions(T);{const ee=L.getSelectedRanges().getFixed(!0),le=L.getSelectedRange().getDefaultSortCriteria();let ie={ranges:ee,hasHeader:le?.options?.hasHeader??!1};v=b?new Promise((se,Ce)=>{const he={tableOptions:ie,onCancel:()=>{Ce()},onDone:me=>{se(me)},context:{getNames:()=>L.getNames()}};d.showWindow?.("tableNew",he)}):{option:"Ok",tableOptions:ie}}const U=await Promise.resolve(v);if(U?.option!=="Ok")throw null;const Z=await Promise.resolve(d?.showBusy?.(u.label()));try{await L.getTables().add(U.tableOptions.ranges.at(0),{styleName:T?.name,clearFormatting:E,hasHeader:U.tableOptions.hasHeader}).getRange().select()}catch(ee){Z(),d?.showError?.(ee)}Z()},!1,!0,!1)},[H]),Me=r.useCallbackRef(()=>i,[i]),Te=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:Me,getNames:()=>t.getNames()}),[t]),fe=r.useCallbackRef(async(u,T,E,b=!0)=>{let L=null;if(!T){let v=t.getSelectedRange();v.size===1&&(v=v.getSurrounding());let U=t.getTables().search({address:t.getSelectedRange()});U.length>0&&(T=U[0]),await v.select()}if(T){if(b){try{E&&await T.select()}catch{}L=new Promise(async(v,U)=>{u.update({context:Te(T)});const Z={command:u,commands:C,notifier:d,onDone:le=>{v(le)}},ee=await d.showWindow?.("tableDetails",Z,{disableAutoDestroy:!0});setTimeout(()=>{ee.focus()},180)})}Promise.resolve(L).then(v=>{},v=>{d?.showError?.(v)})}},[d]),Be=r.useCallbackRef(async(u,T,E=!1)=>{let b=null;if(T)T.isITable?b=T:T.getValue()&&(b=T.getValue());else{const L=t.getTables().search({address:t.getSelectedRange()});L.length>0&&(b=L[0])}if(b){if(!E){const L=b.getRange().getCoords(),v=(L.colEnd-L.colStart+1)*(L.rowEnd-L.rowStart+1);if(v>1e4&&await d?.showOptions({title:"Confirm",description:`Converting a table to range with '${v}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
-
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}P(u,async()=>{E?b.delete():b.convertToRange()},!1,!0)}},[d]),pe=r.useCallbackRef((u,T,E)=>{P(u,async b=>{let L=b.getSelectedRanges();if(L.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let v=L.at(0);v.size===1&&(v=v.getSurrounding());const U=b.getSelection().getCoords().cell;let Z=v.getDefaultSortCriteria(s.IRange.Orientation.Row,U);if(!Z){if(E)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ee=Z.options;if(E&&(ee=new Promise((ie,se)=>{const Ce={range:v,options:Z.options,cell:U,onCancel:()=>{se()},onDone:he=>{he?ie(he.options):se()}};d.showWindow?.("sort",Ce)})),ee=await Promise.resolve(ee),!ee)return;const le=await Promise.resolve(d?.showBusy?.(u.label()));try{v.doBatch(()=>{const ie={...ee,...T};v.sort(ie),v.autoFit({orientations:ie?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.label?.())}catch(ie){le(),d?.showError?.(ie)}le()},!1,!1,!1)},[d]),Pe=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),T=t.getSelectedRanges().getFlattened().getCoords(),E=(v=>{const U=new Blob([v],{type:"application/javascript"}),Z=URL.createObjectURL(U),ee=new Worker(Z);return URL.revokeObjectURL(Z),ee})("console.log('hello from worker');");setTimeout(()=>{E.terminate(),console.log("Worker terminated")},5e3);let b=-1;for(let v=0;b===-1&&v<T.length;v++)ue.CoordUtils.isCellWithinRange(u.cell,T[v])&&(b=v);if(ue.CoordUtils.isEqualRangesArrays(u.ranges,T))return;const L={cell:u.cell,ranges:T,rangeIndex:b};t.getSelection().updateCoords(L)},[t]),Se=r.useCallbackRef(()=>{console.log("selectComments")},[t]),ge=r.useCallbackRef(async(u=!1,T=!1)=>{let E=null;if(T)E=t.getEntireRange();else{const b=t.getSelectedRange();if(b.isEntireRange()){const L=t.getSelection().getCoords().cell,v=t.getRange(L);E=v.getSurrounding(),E.isEntireRange()&&(E=v)}else E=b.getSurrounding({contentOnly:u})}E&&await E.select()},[t]),ce=r.useCallbackRef((u,T,E)=>{P(u,async b=>{let L=b.getSelectedRanges();E&&(T===s.IRange.Orientation.Row?L=L.getEntireRows():T===s.IRange.Orientation.Column&&(L=L.getEntireColumns())),L.delete(T)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let T=null;const E=D(),b=Math.min(E.width-8,480),L=Math.min(E.height-8,288);try{t.getSelectedRanges(),T=await t.getMovables().add({bounds:{x:E.left+(E.width-b)/2,y:E.top+(E.height-L)/2,width:b,height:L},type:"chart",json:u.template}),T.select(),
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),ue=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Dt=require("react-dom"),cn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),ml=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:cn},Symbol.toStringTag,{value:"Module"})),hr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),ao=(e,t=!0,n=hr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let i=ue.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},fl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:hr,findNextFontSize:ao},Symbol.toStringTag,{value:"Module"})),so=o.memo(e=>{const{anchorLocation:t=ue.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:p,style:g,...q}=e,h=a,f=l;let I="red",S=[],D=[];return t===ue.AnchorLocation.TopLeft?(I=d?"rgb(255, 198, 246)":"green",S.push(f),D.push(f),S.push(f+h),D.push(f),S.push(f),D.push(f+h)):t===ue.AnchorLocation.TopRight?(I=d?"rgb(0, 255, 255)":"red",S.push(n-f),D.push(f),S.push(n-(f+h)),D.push(f),S.push(n-f),D.push(f+h)):t===ue.AnchorLocation.BottomRight?(I=d?"rgb(236, 252, 211)":"purple",S.push(n-f),D.push(i-f),S.push(n-(f+h)),D.push(i-f),S.push(n-f),D.push(i-(f+h))):t===ue.AnchorLocation.BottomLeft&&(I=d?"rgb(255, 236, 183)":"blue",S.push(f),D.push(i-f),S.push(f+h),D.push(i-f),S.push(f),D.push(i-(f+h))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...g},...q,children:c.jsx("path",{d:`M ${S[0]} ${D[0]} L ${S[1]} ${D[1]} L ${S[2]} ${D[2]} L ${S[0]} ${D[0]} Z`,fill:m??I,...p})})}),mr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...p}=e,g=o.useMemo(()=>{let I=null;const S=l.getSortField();S&&(I=S.reverse);const D=l.getField(),z=D&&D.criteria&&D.criteria.length>0;return I===!0?z?"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":I===!1?z?"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":z?"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":"m 3,5.025 4.5,5 4.5,-5 z"},[l]),[q,h]=o.useState(!1),f=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${f}px`,height:`${f}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${q&&!a?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(f>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:I=>{d?.(I,l)},...p,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${q&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:g})})})},fr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:p,bodyStyle:g,normalStyle:q,showFormulas:h,showZeros:f,docTheme:I,onLinkMouseDown:S,onFilterButtonMouseDown:D,filterButtonProps:z,createFilterButton:W=mr,...K}=e,y=i.height/m,B=i.width/m,R=t,w=R.getValue(),M=t.getStyle(),O=g?.darkMode??!1;let F,A;const _=w&&w.isFormulaError,G=_&&w instanceof s.FormulaError.Parse;let P,V=h||G;if(V)if(R.isSpillOverflow())A="";else{const Ae=R.getFormulaText();Ae?A=Ae:F=R.getNumberFormat(s.NumberFormat.Type.General)}else F=R.getNumberFormat();V||(P=R.getTextOverflow());const $=P?P.colBounds.width+P.leftOffset+P.rightOffset:B,te=P?P.anchorBounds.x-P.leftOffset:0,N=P?P.anchorBounds.width:B,x=P?P.anchorBounds.x:0;let H,re=R.getRenderHorizontalAlignment();F&&(H=F?.formattedRuns,A=H?.runs[0]?.text??F.displayText);const ye=R.getCalcStatus()===s.ICell.CalcStatus.Pending;let ne=null,X=M.getFill().toCSS(O,i),ae=0,Me=0;if(!M.getBorder().isEmpty()){const Ae=M.getBorder().getRight();!Ae.isNone()&&s.IBorder.BuiltInDefinitions.get(Ae.getStyle()).width>1&&(ae=1);const k=M.getBorder().getBottom();!k.isNone()&&s.IBorder.BuiltInDefinitions.get(k.getStyle()).width>1&&(Me=1)}let Te=null;if(B!==N||ae||Me||typeof X?.backgroundPosition=="number"){const{backgroundPosition:Ae,...k}=X,oe=Ae??0,j=p?.getScrollTopLeft(),Y=oe?-(i.x+(j.left??0))%oe:0,u=oe?-(i.y+(j.top??0))%oe:0;(Ae!==void 0||ae||Me||B!==N)&&(Object.keys(k).length===1&&k.background==="none"||(X=null,Te=c.jsx("div",{className:"fill",style:{marginLeft:`${Y}px`,marginTop:`${u}px`,left:x*m,width:r.ReactUtils.boundPixel(N*m-Y+1+ae),height:r.ReactUtils.boundPixel(i.height-u+1+Me),...k}},"background")))}let fe=null;const Be=R.getComments(),pe=R.getWarnings(),Pe=R.getErrors();if(Be||_||Pe.length>0||pe.length>0){const Ae={size:7*m,darkMode:O,cellWidth:N*m+2,cellHeight:y*m+2,style:{top:-1,left:x*m-1}};fe=fe??[],(pe.length>0||Pe.length>0||_)&&fe.push(c.jsx(so,{anchorLocation:ue.AnchorLocation.TopLeft,...Ae},`indicator-${fe.length}`)),Be&&fe.push(c.jsx(so,{anchorLocation:ue.AnchorLocation.TopRight,...Ae},`indicator-${fe.length}`))}const Se=M.getFont();let ge=F?.conditionalColor;const ce=M.getAlignment(),we=ce.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,de=ce.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||we,be=de||V?0:ce.getRotation(),Fe=R.getInsets(),ve=Fe.top+Fe.bottom;let Ee=Fe.left,Oe=Fe.right;const He={...l,left:l.left-1,top:l.top-1,width:l.width+1+ae,height:l.height+1+Me},C=R.getColumnFilter(),Ue=C&&!C?.hasHiddenButton();let Qe=null;ye&&(Qe=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const $e=!(ye||Ue||Te||a||fe||H?.runs.length>1||P||be%360!=0);X?.background==="none"&&(X=null);let J=de||!(!P||!(P.rightIndex>0||P.leftIndex>0||P.colSpan>1));if(!J){const Ae=R.getSpans();(Ae.width>1||Ae.height>1)&&(J=!0)}const Ie={...X,...He,pointerEvents:S?"auto":void 0};if(!ue.CommonUtils.isEmpty(A)||!ue.CommonUtils.isEmpty(F?.repeatPlaceholder)){const Ae=F?.canWrap??!1;let k=null,oe=null,j=null,Y=[],u=!0;f||V||w!==0||(u=!1);const T=R.getTextFrame(V);if(u&&T){let E=$-1-(Ee+Oe);if(be){k=T.layout().bounds;const Ce={x:0,y:0,width:$-1,height:y};if(H){let he=H.width;if(F.repeatPlaceholder||F.repeatChars.length>0){const me=s.GeomUtils.boundsToPoints(Ce),xe=s.GeomUtils.rotatePoints(me,-be);he=s.GeomUtils.minBoundingRect(xe).width}k={...k,width:he}}j=s.GeomUtils.clipToOuterRect({...k,width:k.width+1+Ee+Oe},Ce,be),E=j.width-1-(Ee+Oe)+.01}let b=null;Ae&&(b={width:E});let L=null,v=F?.repeatPlaceholder;const U=T.layout(b);if(k=U.bounds,V?k={...k,width:0}:H&&(k={...k,width:F.repeatPlaceholder||F.repeatChars.length>0?E:H.width}),be&&Ae){let se=null;U.visitLines({visitTextLine:(Ce,he)=>{let me=Ce.bounds;const xe=s.GeomUtils.boundsToPoints(me),Le=s.GeomUtils.rotatePoints(xe,be),De=s.GeomUtils.minBoundingRect(Le);me={...me,x:(De.width-me.width)/2,y:(De.height-me.height)/2},se=se?s.GeomUtils.unionBounds(se,me):me}}),k={...se,width:se.width+Ee+Oe}}if(!v&&R.getType()!==s.ScalarType.String&&Math.floor(k.width)>E){if(M.getNumberFormat()==="General"&&R.getType()===s.ScalarType.Number){const se=M.measureText("0"),Ce=Math.floor(E/se.width),he=w,me=ue.CommonUtils.splitNumber(he),xe=Math.min(10,Ce-(Math.max(1,me.ipLength)+1)-(he<0?1:0));if(xe>=-1){const Le=`0${xe>0?".":""}${"#".repeat(Math.max(0,xe))}`;L=R.getNumberFormat(Le).displayText,L==="0"&&he<0&&(L="-0")}else if(Math.abs(he)>=Math.pow(10,5)||Math.abs(he)<=Math.pow(10,-5)){const Le=Ce-5-(he<0?1:0);if(Le>=0){const De=`0.${"0".repeat(Math.max(0,Le-1))}E+00`;L=R.getNumberFormat(De).displayText}}}L||(v="#")}if(!v&&H?.lastRepeatIndex>=0&&H?.width>E&&(v="#"),v&&E>0){const se=M.measureText(v),Ce=Math.floor((E||1)/(se?.width||1));L=Ce>0?v.repeat(Ce):""}if(V&&(re=s.ITextFrame.HorizontalAlignment.Left),L){const se=M.measureText(L).width;se&&(k={...k,width:se})}if(oe={...k,width:k.width+Ee+Oe,height:k.height},be&&!Ae){const se=s.GeomUtils.boundsToPoints(oe),Ce=s.GeomUtils.rotatePoints(se,be),he=s.GeomUtils.minBoundingRect(Ce);oe.width=he.width,oe.height=he.height}re===s.ITextFrame.HorizontalAlignment.Center||re===s.ITextFrame.HorizontalAlignment.CenterContinuous?oe.x=($-oe.width)/2:re===s.ITextFrame.HorizontalAlignment.Right?oe.x=$-oe.width-.5:oe.x=.5,ce.getVertical()===s.ITextFrame.VerticalAlignment.Center?oe.y=(y-oe.height)/2:ce.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?oe.y=y-oe.height-ve:oe.y=ve;const Z=$e?{...K}:void 0,ee={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:be?`rotate(${be}deg)`:void 0,cursor:S?"pointer":void 0,pointerEvents:S?"auto":void 0,zIndex:J?1:void 0,...X},onMouseDown:S,onDoubleClick:S?se=>{se.stopPropagation(),se.preventDefault()}:null,...Z};G&&(ee.style.textDecorationStyle="wavy",ee.style.textDecorationColor=O?"rgb(0, 255, 255)":"red",ee.style.textDecorationLine="underline");const le=Se.getSize(),ie=(se,Ce,he,me,xe,Le,De,We=null)=>{let je=le*m,Ge=he,Ne=De?.runs?De.runs:[{type:s.NumberFormat.ParseRunType.Text,text:se,width:M.measureText(se,je).width}];De&&De?.width!==k.width&&(k={...k,width:De?.width});let Xe=Ee;if(De?.lastRepeatIndex>=0&&E>De?.width){const _e=De.runs[De.lastRepeatIndex];if(_e){const rt=[...Ne],vt=Math.max(0,E-1-De.width);let yt=0,Ct="";if(vt>0){const gt=Math.floor(vt/_e.width);Ct=gt>0?_e.text.repeat(gt):"",yt=vt}rt[De.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:Ct,width:yt},Ne=rt,k={...k,width:De.width+yt}}}const it=(_e,rt,vt,yt,Ct,gt,lt,Tt,Lt,Zt=null)=>{let Ft,Xt=Ge.width;xe===s.ITextFrame.HorizontalAlignment.Justify?(Xt=Ct,Le||(Ft="justify")):xe===s.ITextFrame.HorizontalAlignment.Distributed&&(Xt=Ct,Ft=Le||_e.text.split(" ").length-1==0?"center":"justify");const{style:Mt,className:vn,...Cn}=Zt;let Ot=_e.text;if(xe===s.ITextFrame.HorizontalAlignment.Fill&&F?.repeatChars.length===0){const at=Math.max(1,Math.floor((Ge?.width??0)/(lt?.width??1)));Ot=Ot.repeat(at)}let kt=Ge.height;const At=Se.getVerticalAlignment(),Yt=At===s.IFont.VerticalAlignment.Sub,Hn=At===s.IFont.VerticalAlignment.Super;if(Yt||Hn){const at=Se.getSuperSubScale();je*=at,kt*=at}const nt={textAlign:Ft,textAlignLast:Ft,background:void 0,...Mt,...Se.toCSS(O,m,!0),fontSize:je*s.IFont.getDeviceScale()};ge&&(nt.color=ge.toCSS(O));const Jt=Xe+rt;let jt=Fe.top+Ge.y+0;if(Yt&&(jt+=Lt-je),gt){const at=(lt.x+Jt)*m+1,ht=(lt.y+jt)*m+1;ht<0?nt.marginTop=ht:nt.paddingTop=ht,at<0?(nt.width=(Mt?.width??0)-at,nt.left=(Mt?.left??0)+at):nt.paddingLeft=at,nt.paddingRight=Math.max(0,(Mt?.width??0)-Xt*m-at),nt.paddingBottom=Math.max(0,(Mt?.height??0)-Ge.height*m-ht),nt.height=(Mt?.height??0)+(ht<0?-ht:0),(ht<0||at<0)&&(nt.clipPath=`inset(${ht<0?-ht:0}px 0px 0px ${at<0?1-at:0}px)`)}else if(nt.left=(lt.x+Jt)*m+1,nt.top=(lt.y+jt)*m+1,nt.width=lt.width*m,nt.height=lt.height*m,be&&!Ae){nt.left=(lt.x+rt)*m+1,nt.top=(lt.y+(Ge.y+0))*m+1;const at=s.GeomUtils.centerPoint({x:Xe+rt,y:0,width:_e.width,height:Ge.height}),ht=s.GeomUtils.centerPoint({x:Xe,y:0,width:Ct,height:Ge.height}),Qt=s.GeomUtils.rotatePoints([at],be,ht),yn={x:Qt[0].x-at.x,y:Qt[0].y-at.y};nt.left=nt.left+yn.x*m,nt.top=nt.top+yn.y*m;const Bt={...Ge,x:Xe,y:Fe.top,width:Ge.width+(Ee+Oe)},Un=s.GeomUtils.boundsToPoints(Bt),en=s.GeomUtils.rotatePoints(Un,be),wn=s.GeomUtils.minBoundingRect(en);Bt.width=wn.width,Bt.height=wn.height;const Vt=s.GeomUtils.centerPoint(Bt),xn={x:Vt.x-ht.x,y:Vt.y-ht.y};nt.left=nt.left+xn.x*m,nt.top=nt.top+xn.y*m}nt.lineHeight=kt*m+"px";const bn=$e?void 0:"text-line";Y.push(c.jsx("div",{className:vn?`${vn} ${bn}`:bn,style:nt,...Cn,children:Ot},`text-${Ge.y}-${yt}-${vt}`))};if(ce.getOverflow()===s.ITextFrame.Overflow.Shrink&&E>0){let _e=k?.width??0,rt=0;for(;_e>1&&_e>E&&je>2&&rt<100;)je*=E/_e,_e=M.measureText(se,je).width,rt++;k={...k,width:_e}}let pt=Ge.x;xe===s.ITextFrame.HorizontalAlignment.Right?pt+=k.width-Ge.width:xe!==s.ITextFrame.HorizontalAlignment.Center&&xe!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(pt+=(k.width-Ge.width)/2),De?.lastRepeatIndex>=0&&(pt=Ge.x);const wt=Ne.length;for(let _e=0;_e<wt;_e++){const rt=Ne[_e];(rt.type===s.NumberFormat.ParseRunType.Text||rt.type===s.NumberFormat.ParseRunType.Repeat)&&(rt.type,s.NumberFormat.ParseRunType.Repeat,it(rt,pt,_e,Ce,xe===s.ITextFrame.HorizontalAlignment.Justify||xe===s.ITextFrame.HorizontalAlignment.Distributed||De?.lastRepeatIndex>=0?E:Ge.width,$e,{x:oe.x+te,y:oe.y,width:rt.width,height:k.height},0,me,We)),pt+=rt.width}};L?ie(L,0,{x:0,y:0,...k},U.lines[0].baseline,re,!0,null,ee):U.visitLines({visitTextLine:(se,Ce,he)=>{const me=se.runs[0].text.replace(/\s+$/,""),xe=Ce===he-1;let Le=re===s.ITextFrame.HorizontalAlignment.Justify&&(xe||se.runs[0].text.endsWith(`
|
|
8
|
+
`))?s.ITextFrame.HorizontalAlignment.Left:re,De=0;Ce>0&&(ce.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||ce.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(De=Math.max(0,(y-(ve+3)-se.bounds.height*he)/(he-1)*Ce)),ce.getVertical()===s.ITextFrame.VerticalAlignment.Distributed&&be&&be%90==0&&be%180!=0&&(Le=s.ITextFrame.HorizontalAlignment.Distributed),Le!==s.ITextFrame.HorizontalAlignment.Justify&&Le!==s.ITextFrame.HorizontalAlignment.Distributed&&Le!==s.ITextFrame.HorizontalAlignment.Fill||(k={...k,width:E});const We={...se.bounds,y:se.bounds.y+De+0,width:we||F&&(F.repeatChars.length>0||F.spacingChars.length>0)?k.width:se.bounds.width};ie(me,Ce,We,T.lines[0].baseline,Le,xe,he===1?H:null,$e&&Ce>0?{...ee,style:{...ee.style,background:void 0}}:ee)}})}Y.length>0&&(ne=Y)}if($e)return ne&&ne.length>0?ne:c.jsx("div",{style:Ie,...K});let Ve=S?"auto":He.pointerEvents,ke=null;if(Ue){const Ae={x:x*m-1,y:-1,width:N*m+1,height:y*m+1};Ve="auto",ke=W({renderBounds:Ae,darkMode:O,className:"filter-button",disabled:!R.isEditAllowed(),zoom:m,filter:R.getColumnFilter(),onFilterButtonMouseDown:D,...z}),ke&&(ke=c.jsx("div",{style:{...Ae,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:k=>{k.stopPropagation(),k.preventDefault()},children:ke},"filterButton"))}ye&&!ne&&(ne=c.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const ze=[Te,ne,a,fe,Qe,ke];return c.jsx("div",{style:{...X,...He,pointerEvents:Ve},...K,children:ze})},To={text:"",placeholder:""},Io=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},pl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),pr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:d,onDoneEdit:m,defaultTextStyle:p,useRichStyling:g=!0,bodyStyle:q,activeCoords:h,sheet:f,commands:I,containerBounds:S,setNaturalDimensions:D,onFocus:z,disabled:W,style:K,zoom:y=1,linesVisible:B,autoFocus:R=!1,...w}=e,{height:M=0,width:O=0}=S??{},F=q?.darkMode??!1,A=o.useRef(null),[_,G]=o.useState(!1),[P,V]=o.useState(null),[$,te]=o.useState(()=>n);o.useEffect(()=>{Me.current=!1,te(n)},[n]);const N=o.useMemo(()=>{const k=$.clean();let oe=k.getStyle();g||(oe=oe.createTemporaryStyle({font:{size:p?.fontSize}}));const j=k.getFormula(),Y=oe.getAlignment(),u=j?s.ITextFrame.HorizontalAlignment.Left:Y.getHorizontal(),T=Y.getVertical(),E=Y.getOverflow()===s.ITextFrame.Overflow.Wrap||k.getType()===s.ScalarType.String&&(u===s.ITextFrame.HorizontalAlignment.Justify||u===s.ITextFrame.HorizontalAlignment.Distributed||T===s.ITextFrame.VerticalAlignment.Justify||T===s.ITextFrame.VerticalAlignment.Distributed),b=(U=>{if(!U)return To;const Z=U.clean();if(!Z)return To;let ee=Z.getStyle()?.getQuotePrefix();if(U.dirty===void 0||U.dirty===null){let le="",ie=Z.getFormulaText();ie&&(le=ie,ee=!1),le||(le=Z.toTextUnformatted(!0)??"");let se="";if(!U.editMode&&Z.isSpillOverflow()){const Ce=Z.getSpill();if(Ce){const he=Ce.getCell(),me=he.getFormulaText();he.isEqual(Z)||(se=me)}}return ee&&(le="'"+le),{text:le,placeholder:se}}return{text:U.dirty??"",placeholder:""}})($),L=b.text,v=s.ITextFrame.toCSSHorizontalTextAlign(g&&!j?$.clean()?.getRenderHorizontalAlignment():s.ITextFrame.HorizontalAlignment.Left);return{style:oe,isWrapped:E,textValue:L,formula:j,frameVertAlign:T,placeholder:b.placeholder,insets:g?k.getInsets():ue.TypesUtils.EmptyRect,textAlign:v}},[$,p,F,y,g]),x=o.useRef(null),H=r.useImperativeElement(t,()=>({startEdit:k=>{A.current=k?.initialSelection;const oe={...n,editMode:k?.editMode??!1};k?.text!==void 0&&(oe.dirty=k.text),oe.editMode===n.editMode&&oe.dirty===n.dirty||(te(oe),ne?.(oe))},submitEdit:()=>Te(),cancelEdit(){fe()},autoFocus(){x.current.focus()},dispatchEvent:k=>x.current.dispatchEvent(k),focus(){x.current.focus()},getLineHeight:ye}),[i,n]);o.useLayoutEffect(()=>{if(!P||!_)return;const k=x.current;N.textValue,k&&k.setSelectionRange(P.start,P.end,P.direction)},[x.current,P,N.textValue]);const re=o.useMemo(()=>{const k=$?.clean(),oe=N.style.createTemporaryTextFrame(N.textValue,k?.getType()===s.ScalarType.String),j=g?k.getInsets().right+k.getInsets().left:0;let Y=null;return N.isWrapped&&(Y={width:O-j}),oe.layout(Y)},[N,O,$,g]),ye=r.useCallbackRef(()=>Math.ceil(re?.lines[0]?.bounds.height),[re]);o.useLayoutEffect(()=>{if(!re)return;const k=N.style,oe=k.getInsets()??ue.TypesUtils.EmptyRect,j=g?oe.left+oe.right:0,Y=g?.04*k.getFont().getSize():1,u=Math.round(N.isWrapped?void 0:re.bounds.width+j+Y),T=Math.round(re.bounds.height);D?.({width:u,height:T})},[re,D,N,g,$]);const ne=r.useCallbackRef(a,[a]),X=r.useCallbackRef(k=>{if($.dirty===k)return;const oe={...$};oe.dirty=k,x.current,te(oe),ne?.(oe)},[$]),ae=r.useCallbackRef(k=>{if($.editMode===k)return;const oe={...$};oe.editMode=k,te(oe),ne?.(oe)},[$]),Me=o.useRef(!1),Te=r.useCallbackRef(()=>{if(Me.current)return!1;try{l?.($),m?.(),Me.current=!0}catch{return!1}return!0},[l,$]),fe=r.useCallbackRef(()=>{Me.current=!0,te(n),d?.(),m?.()},[d,n]),Be=r.useCallbackRef(k=>{if(!x.current)return;if(k.key,k.isDefaultPrevented(),!(k.isTrusted||k.nativeEvent.ctrlKey||k.nativeEvent.metaKey||k.nativeEvent.altKey||k.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(k.nativeEvent.key)===-1&&k.nativeEvent.key!=="Backspace")){const b={...$};let L=0;return Io(b,b.dirty)&&!isNaN(parseFloat(k.key))?(b.dirty?.endsWith("%")?b.dirty=(b.dirty.substring(0,b.dirty.length-1)??"")+k.key+"%":b.dirty=(b.dirty??"")+k.key+"%",L=b.dirty.length-1):k.nativeEvent.key==="Backspace"?(b.dirty="",L=b.dirty.length):(b.dirty=(b.dirty??"")+k.key,L=b.dirty.length),x.current.value=b?.dirty,A.current={start:L,end:L,direction:"forward"},x.current?.setSelectionRange(L,L,"forward"),te(b),ne?.(b),void k.preventDefault()}const oe=k.nativeEvent.ctrlKey,j=k.nativeEvent.shiftKey,Y=k.nativeEvent.altKey,u=k.nativeEvent.metaKey;if(oe&&k.key==="z"&&k.stopPropagation(),k.which===r.KeyCodes.Escape)return k.preventDefault(),void fe();if(k.which===r.KeyCodes.F2)return ae(!0),void k.preventDefault();const T=k.target;if(k.key==="%"&&T.selectionStart===T.selectionEnd&&T.value[T.selectionStart]==="%"&&$?.clean().getStyle().numberFormat.includes("%"))return V({start:T.selectionStart+1,end:T.selectionEnd+1,direction:T.selectionDirection}),void k.preventDefault();if(k.which===r.KeyCodes.Enter){if(k.preventDefault(),u||Y){const b=N.textValue.substring(0,T.selectionStart)+`
|
|
9
|
+
`+N.textValue.substring(T.selectionEnd);return X(b),void V({start:T.selectionStart+1,end:T.selectionStart+1,direction:T.selectionDirection})}return void(Te()&&f.getSelection().traverse(s.IRange.Orientation.Column,j))}if(k.which===r.KeyCodes.Tab)return k.preventDefault(),void(Te()&&f.getSelection().traverse(s.IRange.Orientation.Row,j));let E=null;switch(k.which){case r.KeyCodes.Left:E=s.IRange.Direction.Left;break;case r.KeyCodes.Right:E=s.IRange.Direction.Right;break;case r.KeyCodes.Up:E=s.IRange.Direction.Up;break;case r.KeyCodes.Down:E=s.IRange.Direction.Down}if(E&&!(oe||j||Y||u)&&!$.editMode)return void Te();$.editMode&&(E||pl.includes(k.which))&&k.stopPropagation()},[$,f,N]),pe=o.useCallback(()=>{x.current?.focus(),setTimeout(()=>{x.current?.select()},0)},[]),Pe=o.useCallback(()=>{x.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Se=r.useCallbackRef(()=>{const k=x.current?.value;let oe="";if(h.rowIndex>0){const j=f.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();j&&(oe=j.toTextUnformatted(!0))}X(k+oe)},[h,f]);o.useEffect(()=>f.getRange(h).addListener(()=>{const k={...$,clean:()=>f.getRange(h).getCell()};te(k),ne?.(k)}),[h,f]);const ge=o.useCallback(()=>{const k=$.clean().createTemporaryCell({value:cn(),style:{numberFormat:"Medium Time"}}).toText();X((x.current?.value??"")+k)},[f]),ce=o.useCallback(()=>{const k=$.clean().createTemporaryCell({value:cn(),style:{numberFormat:"Short Date"}}).toText();X((x.current?.value??"")+k)},[f]),we=o.useMemo(()=>({element:()=>x.current,doCopy:k=>{const oe=x.current.value.substring(x.current.selectionStart,x.current.selectionEnd);if(k?.isCut){const j=x.current.value.substring(0,x.current.selectionStart)+x.current.value.substring(x.current.selectionEnd,x.current.value.length);X(j)}return oe}}),[x.current]),de=o.useMemo(()=>({element:()=>x.current,doPaste:async(k,oe)=>{const j=await k.toText?.();if(!j)return!0;const Y=x.current.value.substring(0,x.current.selectionStart)+j+x.current.value.substring(x.current.selectionEnd,x.current.value.length);return X(Y),V({start:x.current.selectionStart+j.length,end:x.current.selectionStart+j.length,direction:"forward"}),!0}}),[x.current]),be=o.useMemo(()=>({contains:k=>x.current?.contains(k)||!1,focus(){x.current.focus()}}),[]),Fe=o.useMemo(()=>[new r.SimpleCommand("selectAll",be,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},pe),new r.SimpleCommand("startEditValueAbove",be,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Se),new r.SimpleCommand("startEditCurrentTime",be,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},ge),new r.SimpleCommand("startEditCurrentDate",be,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},ce),new r.Command("relativeReferencesToggle",be,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Pe),new r.Command("toggleEditorFocus",be,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ve=o.useMemo(()=>{let k=null;const oe=()=>({contains:j=>x.current?.contains(j)||!1,focus(){x.current.focus()}});return k=I?I.createChildGroup(oe,"editor",!1):new r.CommandGroup(oe,"editor"),k.addCommands(Fe,!0),k},[I,Fe]),Ee=o.useMemo(()=>({notifier:null,source:we,target:de,commands:ve}),[we,de,ve]);r.useCopyPaste(Ee);const[Oe,He]=o.useState(!R);o.useEffect(()=>{He(!1)},[]);const C=r.useCallbackRef(k=>{G(!0),ve?.activate();const oe=A.current;if(oe!==!1){let j,Y;const u=x.current.value;Io($,u)&&(j=u.length-1,Y=u.length-1),j=oe?.start??j??u.length,Y=oe?.end??Y??u.length,A.current=!1,V({start:j,end:Y,direction:"forward"})}z?.(k)},[z,$]),Ue=N.insets;let Qe=Ue.left+1;const $e=Ue.left+Ue.right+2-1,J=re?.bounds.height??0;let Ie,Ve=Ue.top;N.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?Ve=Math.max(0,(M-(Ue.top+Ue.bottom)-J)/2):N.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(Ve=Math.max(0,M-(Ue.top+Ue.bottom)-J)),B!==void 0&&re?.lines[0]?.bounds&&(Ie=re?.lines[0]?.bounds.height*B);const ke=N.style.getFont();let ze=ke.getSize();ke.isSuperSub()&&(ze*=ke.getSuperSubScale()),ze*=s.IFont.getDeviceScale()*y;const Ae=g?ke.toCSS(F,y):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:k=>{x.current&&document.activeElement!==x.current&&requestAnimationFrame(()=>{x.current.focus()})},ref:H,...w,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...K},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Ve*y+1,left:Qe*y,width:`calc(100% - ${$e*y}px)`,maxWidth:`calc(100% - ${$e*y}px)`,height:(Ie??J)*y,maxHeight:(Ie??J)*y},children:c.jsx("textarea",{spellCheck:"false",placeholder:N.placeholder,ref:x,value:N.textValue,disabled:Oe,readOnly:W||f.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ae,fontSize:ze?`${ze}px`:"inherit",textAlign:N.textAlign,lineHeight:(re?.lines[0]?.bounds.height??0)*y+"px",height:(re?.bounds.height??0)*y,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:N.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:C,onBlur:()=>{G(!1)},onSelect:k=>{},onChange:k=>{x.current&&!Me.current&&(A.current=!1,X(k.target.value),N.textValue,k.target.value,k.target.selectionStart,k.target.selectionEnd,k.target.selectionDirection,V({start:k.target.selectionStart,end:k.target.selectionEnd,direction:k.target.selectionDirection}))},onMouseDown:k=>{_&&ae(!0)},onKeyDown:Be})})})})),vr=(e,t)=>({clean:e,dirty:t,editMode:!1}),Cr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:p=0,isVertical:g=!1,...q}=e,h=K=>{let y=null;if(K&&n>0){y="";for(let B=0;B<K.length;B++)y+=K[B],B<K.length-1&&(y+=",")}return y},f=h(i);let I=f;a&&(I=h(a));let S=n,D=t,z=null;if(l){S=Math.floor(n/2);const K=S+S/2+1;let y=null;y=g?`M ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p+D)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+K)} L ${r.ReactUtils.boundPixel(m+D)} ${r.ReactUtils.boundPixel(p+K)}`,z=c.jsx("path",{strokeWidth:S,strokeDasharray:I,d:y,...q})}if(d){S=n/2;const K=S+S/2;let y=I,B=null;B=g?`M ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+K)} ${r.ReactUtils.boundPixel(p+D)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+K)} L ${r.ReactUtils.boundPixel(m+D)} ${r.ReactUtils.boundPixel(p+K)}`,z=c.jsx("path",{strokeWidth:S,strokeDasharray:y,strokeDashoffset:"1",shapeRendering:"crispEdges",d:B,...q})}let W=null;return W=g?`M ${r.ReactUtils.boundPixel(m+S/2)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+S/2)} ${r.ReactUtils.boundPixel(p+D)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+S/2)} L ${r.ReactUtils.boundPixel(m+D)} ${r.ReactUtils.boundPixel(p+S/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:S,strokeDasharray:f,d:W,...q}),z]})};function Qn(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Wt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=Qn(i,t),l=typeof a=="function";n.push(l?a:()=>Qn(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)Qn(n,t)}},vl=function(){},br=typeof window<"u",rn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Cl=br?o.useLayoutEffect:o.useEffect,Eo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const zt=br&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(Eo),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var p=m[0].contentRect,g=p.x,q=p.y,h=p.width,f=p.height,I=p.top,S=p.left,D=p.bottom,z=p.right;l({x:g,y:q,width:h,height:f,top:I,left:S,bottom:D,right:z})}})},[]);return Cl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[vl,Eo]},bl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,yl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,wl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:p=!1,intersections:g,layout:q}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const f=n[0],I=n[1],S=n[2],D=n[3];let z=1+(p?D-I:S-f),W=0;const K=a.getColor().toRGBA(l).toString(),y=h.description.toLowerCase().includes("double");let B,R;const w=p?"rowStart":"colStart",M=p?"rowEnd":"colEnd",O=p?I:f;if(g?.length>0){const G=g[0];if(G?.range[w]===i[w]){const V=s.IBorder.BuiltInDefinitions.get(G.stroke.getStyle());W=Math.floor(V.width/2)}if(g[g.length-1]?.range[M]===i[M]){const V=s.IBorder.BuiltInDefinitions.get(g[g.length-1].stroke.getStyle());z=Math.floor(z+(V.width===2?0:V.width/2))}if(y){const V=p?"colStart":"rowStart",$=p?"colEnd":"rowEnd",te=p?q?.getRowOffset:q?.getColOffset;let N=0,x=0;B=[],R=[];for(let H=0;H<g.length;H++){const re=g[H];if(re.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&te){const ye=te(re.range[w])-(O-W);re.range[V]<i[V]&&(B.push(ye-N),N=ye,B.push(1),N++),re.range[$]>i[$]&&(R.push(ye-x),x=ye,R.push(1),x++)}}B.length>0&&N<z&&B.push(z-N),R.length>0&&x<z&&R.push(z-x)}}let F=p?-Math.floor(h.width/2):-W,A=p?-W:-Math.floor(h.width/2);const _=m&&h.width>2?-1:0;return c.jsx(Cr,{offsetX:f+F+_,offsetY:I+A+_,length:z+W,isVertical:p,stroke:K,width:h.width,dashArray:B??h.pattern,dashArrayAdditional:R,isDouble:y,isAngled:h.description.toLowerCase().includes("slant")},t)},po=({getBorderAt:e,borderRenderer:t=wl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>g=>{const q=g.toClipBounds(g.getRangeCoordsBounds(),-3);if(!q)return;const h=m(g);if(h.length===0)return;const f=g.getVisibleColumnOffsets(),I=g.getVisibleRowOffsets();let S=[],D=[];const z=g.getVisibleColumns(),W=g.getVisibleRows(),K=[],y=[],B=[],R=(F,A,_,G,P,V,$)=>{const te={index:G,stroke:P,visibleIndex:_,edge:V,length:$};F[A]||(F[A]=[]),F[A].length>0&&F[A][F[A].length-1]?.index===G?F[A][F[A].length-1]=te:F[A].push(te)};for(let F=0;F<h.length;F++){const A=h[F],_=A.coords;if(!_)continue;const G=A?.range??{rowStart:_.rowIndex,colStart:_.colIndex,rowEnd:_.rowIndex,colEnd:_.colIndex},P=g.getVisibleRangeCoords();if(!ue.CoordUtils.isRangesIntersect(G,P)&&!ue.CoordUtils.isRangeWithinRange(G,P))continue;const V=_.colIndex,$=_.rowIndex,te=f[V],N=I[$];if(G.rowEnd!==G.rowStart){const Be=I[G.rowStart]?.spanIndex??-1,pe=I[G.rowEnd]?.spanIndex??I[W[W.length-1]].spanIndex+1;S.push({...G,rowStart:Be,rowEnd:pe})}if(G.colEnd!==G.colStart){const Be=f[G.colStart]?.spanIndex??-1,pe=f[G.colEnd]?.spanIndex??f[z[z.length-1]].spanIndex+1;D.push({...G,colStart:Be,colEnd:pe})}const x=A.value,H=e(x,F);if(!H||H.isEmpty())continue;const re=H.getLeft(),ye=H.getTop(),ne=H.getRight(),X=H.getBottom();let ae=1,Me=1;if(!te||!N)continue;const Te=te.spanIndex,fe=N.spanIndex;re.isNone()||R(K,Te,fe,$,re,s.IBorder.Edge.Left,ae),ye.isNone()||R(y,fe,Te,V,ye,s.IBorder.Edge.Top,Me),ne.isNone()||R(K,Te+Me,fe,$,ne,s.IBorder.Edge.Right,ae),X.isNone()||R(y,fe+ae,Te,V,X,s.IBorder.Edge.Bottom,Me)}const w=(F,A,_)=>{const G=[];return F.forEach((P,V)=>{let $=null;P.sort((te,N)=>te.visibleIndex-N.visibleIndex);for(let te=0;te<P.length;te++){const N=P[te];if(!N?.stroke||A[V]===void 0&&A[V-1]===void 0)continue;let x=!1;if(_)for(let ne=0;!x&&ne<S.length;ne++){let X=S[ne];X.colStart<=N.index&&X.colEnd>=N.index&&X.rowStart<V&&X.rowEnd>=V&&(x=!0)}else for(let ne=0;!x&&ne<D.length;ne++){let X=D[ne];X.rowStart<=N.index&&X.rowEnd>=N.index&&X.colStart<V&&X.colEnd>=V&&(x=!0)}if(x)continue;const H=N.stroke?.getColor(),re=H?H.toRGBA().toString():l,ye=N.stroke.getStyle()+":"+re;(ye!==$?.key||$&&$.visibleIndex+1<N.visibleIndex)&&($&&G.push($),$={key:ye,index:A[V]??A[V-1]+1,visibleIndex:N.visibleIndex,edge:N.edge,stroke:N.stroke,from:N.index,to:N.index+N.length-1,intersections:[],length:1}),$.to=N.index+N.length-1,$.visibleIndex=N.visibleIndex}$&&G.push($)}),G};S=S.sort(yl),D=D.sort(bl);const M=w(K,z,!1),O=w(y,W,!0);if(M.length===0&&O.length===0)return null;for(let F=0;F<O.length;F++){const A=O[F];let _=ue.CommonUtils.findEqualOrGreater(M,A.from,P=>P.index),G=!1;for(;!G;){const P=M[_++];P&&P.index>=A.from&&P.index<=A.to+1&&P.from<=A.index&&P.to+1>=A.index&&(A.intersections.push({stroke:P.stroke,range:{rowStart:P.from,rowEnd:P.to+1,colStart:P.index,colEnd:P.index}}),P.intersections.push({stroke:A.stroke,range:{rowStart:A.index,rowEnd:A.index,colStart:A.from,colEnd:A.to+1}})),G=!P||P.index>A.to+1}}for(let F=0;F<O.length;F++){const A=O[F];let _=A.stroke;const G=`rBorder:${A.index}:${A.from}:${A.to}:${A.edge}`,P={rowStart:A.index,rowEnd:A.index,colStart:A.from,colEnd:A.to+1},V=g.getLayout(),$=!1,te=V.getColOffset(P.colStart),N=V.getRowOffset(P.rowStart),x=[te,N,V.getColOffset(P.colEnd),N];B.push(t({key:G,points:x,stroke:_,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:A.intersections,layout:V,isVertical:$}))}for(let F=0;F<M.length;F++){const A=M[F];let _=A.stroke;const G=`cBorder:${A.index}:${A.from}:${A.to}:${A.edge}`,P={rowStart:A.from,rowEnd:A.to+1,colStart:A.index,colEnd:A.index},V=g.getLayout(),$=!0,te=V.getColOffset(P.colStart),N=[te,V.getRowOffset(P.rowStart),te,V.getRowOffset(P.rowEnd)];B.push(t({key:G,stroke:_,points:N,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:A.intersections,layout:V,isVertical:$}))}return c.jsx("svg",{width:`${q.width}`,height:`${q.height}`,viewBox:`0 0 ${q.width} ${q.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${q.width}px`,height:`${q.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:B},"borders")},[e,i])}},Fo=ue.AnchorLocation.Center,xl=Object.freeze({horizontal:!1,vertical:!1}),Ao=ue.TypesUtils.EmptyTopLeft,ql=(e,t)=>ue.CoordUtils.EmptyCell,Sl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Rl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:p,children:g,...q}=e,h=o.useRef(null),[f,{width:I,height:S}]=zt(),D=n??I,z=i??S,W=o.useMemo(()=>{const $=[];for(let te=0;te<l;te++)for(let N=0;N<d;N++){const x={colIndex:N,rowIndex:te};$.push({coords:x,value:x})}return $},[]),K=o.useCallback($=>W,[W]),{overlay:y}=po({getVisibleCells:K,getBorderAt:t,darkMode:m,forceThinBorder:p}),B=Math.floor(D/d),R=Math.floor(z/l),w={getColOffset:$=>Math.ceil($*B)+0,getRowOffset:$=>Math.ceil($*R)+0,getColIndex:$=>Math.floor(($-0)/B)-1,getRowIndex:$=>Math.floor(($-0)/R)-1},M={rowStart:0,colStart:0,rowEnd:l,colEnd:d},O={x:0,y:0,width:Math.max(0,D)+0,height:Math.max(0,z)+0},F=o.useMemo(()=>{const $={},te=Math.floor(D/d);for(let N=0;N<d;N++)$[N]={offset:N*te,size:te,spanIndex:N};return $},[D,z]),A=o.useMemo(()=>{const $={},te=Math.floor(z/l);for(let N=0;N<l;N++)$[N]={offset:N*te,size:te,spanIndex:N};return $},[D,z]);if(!y)return null;const _={width:D,height:z},G={width:D,height:z},P={getStage:()=>h.current,getTotalSize:()=>_,getViewportSize:()=>G,getLayout:()=>w,getCellCoordsAsRangeCoords:ue.CoordUtils.cellToRange,getVisibleRangeCoords:()=>M,getVisibleRows:()=>{const $=[];for(let te=0;te<l;te++)$.push(te);return $},getTotalRangeCoords:()=>M,getRelativePointFromClient:($,te)=>({x:$,y:te}),getVisibleColumns:()=>{const $=[];for(let te=0;te<d;te++)$.push(te);return $},toClipBounds:($,te)=>O,toViewBounds:$=>$,toAbsoluteBounds:$=>$,getBounds:()=>O,getInsets:()=>null,getRangeCoordsBounds:($,te)=>null,getVisibleColumnOffsets:()=>F,getVisibleRowOffsets:()=>A,allViews:()=>({[Fo]:P}),getAnchor:()=>Fo,getZoom:()=>1,scrollCellCoordsIntoView:Sl,getCellCoordsFromClient:ql,getScrollOrientation:()=>xl,getScrollTopLeft:()=>Ao,getFreezeTopLeft:()=>Ao},V=y(P);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...q,children:[c.jsx("div",{ref:Wt([h,f]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),V]})});function yr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=yr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function bt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=yr(e))&&(i&&(i+=" "),i+=t);return i}const kl="_sheetxl-sheet_1qeq6_5",Ml="_viewport-overlay_1qeq6_6",wr=e=>{const{style:t,...n}=e??{};return c.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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"})]})},Tl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:d,...m}=e??{},[p,g]=o.useState(null);o.useEffect(()=>{(async()=>{const R=await s.LicenseManager.getDetails();g(R)})()},[]);const[q,h]=o.useState(!1),f={opacity:.65},I=o.useMemo(()=>{const R=p?.exceptions(),w=R?.length??0;if(w===0)return null;const M=[];for(let O=0;O<w;O++){const F=R[O];M.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:F},O))}return M},[p,n]);if(p===null||p.isValidFor(l))return null;const S=p.type(),D=!I&&S.endsWith("ity"),z=p.licensee(),W=D?1.6:1,K=135/W,y=37/W;let B=null;return!S&&z?.length>0&&(B=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:z})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...m,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[q?c.jsx(wr,{style:f}):c.jsx("svg",{width:K,height:y,style:f,children:c.jsx("image",{style:{width:K,height:y},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),c.jsxs("div",{children:[B,I,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),tt=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),d={},m=l.length;for(let g=0;g<m;g++){const q=l[g];d[q]=(h,f)=>{i.current[q]?.(h,f)}}const p=e.addListeners(d,n);if(a)for(let g=0;g<m;g++)d[l[g]](e);return()=>{p?.()}},[e])},Rn=new s.Color("transparent");function xr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:p}=e,[g,q]=o.useState(null),[h,f]=o.useState(null),I=o.useRef(null),S=r.useCallbackRef(m,[m]),D=r.useCallbackRef(p,[p]),[z,W]=o.useState(),[K,y]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[B,R]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const M=r.useGlobalClipboard(),[O,F]=o.useState(ue.CommonUtils.EmptyArray),A=o.useCallback(()=>{if(I.current!==t)return;const u=t.getSelectedRanges();let T=null;O.length>0&&ue.CoordUtils.isCellWithinRange(g,O[0].getRange().getCoords())&&(T=O[0]);const E=t?.getSelectedCell(),b=E?.getCoords()??null;Dt.unstable_batchedUpdates(()=>{re(T),q(b),f(u)})},[t,O,h,g]),_=o.useCallback(ue.CommonUtils.debounce(A,210),[A]);o.useEffect(()=>{I.current=t,A()},[t]);const G=r.useCallbackRef(()=>t.getRange(g).getCell(),[t,g]),P=r.useCallbackRef(async(u,T,E=null,b=!1,L=!0)=>{const v=u?.label?.(),U=async()=>{const ie=await Promise.resolve(L&&d?.showBusy?.(v??"Busy..."));try{await t.doBatch(async()=>T(t),v),b&&w.setMode(null),ie&&ie()}catch(se){if(ie&&ie(),!se)return;d?.showError?.(se)}},Z=[];let ee=!1;const le=async()=>(Z.push(U),(async()=>{if(!ee){for(ee=!0;Z.length>0;){const ie=Z.shift();ie&&await ie()}ee=!1}})());if(n){let ie=null;if(E!==!1&&u){const se=E??v;ie=new r.SimpleCommand(u.key(),l,{label:se,description:se},le)}n(ie)}return le()},[t,n,d]),V=r.useCallbackRef((u,T,E=!1,b)=>P(u,L=>{const v=L.getSelectedRanges();E&&v.updateStyle(null,b),v.updateStyle(T,b),v.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),$=r.useCallbackRef((u,T,E)=>{P(u,b=>{let L=T;(E||T?.address)&&(L=L??{},!E&&T?.address?.startsWith("#")?E=T?.address.substring(1):E&&(L.displayText=E)),b.getSelectedRange().setHyperlink(L)})},[t]),te=r.useCallbackRef((u,T)=>{P(u,E=>{E.getSelectedRange().setComments(T)})},[t]),N=r.useCallbackRef((u,T)=>{P(u,E=>{E.getSelectedRanges().clear(T)})},[t]),x=r.useCallbackRef(async(u,T,E=!1,b=!1)=>P(u,async L=>{let v=L.getSelectedRanges();E&&(T===s.IRange.Orientation.Row?v=v.getEntireRows(b):T===s.IRange.Orientation.Column&&(v=v.getEntireColumns(b)));let U=null;const Z=w.getMode()?.key;if(Z==="copy"||Z==="cut"){const ee=await M.getClipboard().readReference();ee&&ee.getItemType()==="range"&&(U=ee.getItem(),U.getCoords()||(U=null))}if(U){const ee=await v.insertFrom(U,{...U.getMarkOptions(),orientation:T,autoSelect:!0});!ee||ee.isEntireRows()||ee.isEntireColumns()||ee.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else v.insert(T,{autoSelect:!0})},"Insert Cells",!1),[w]),[H,re]=o.useState(null),ye=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),ne=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),X=r.useCallbackRef((u,T)=>{P(u,async E=>{const b=E.getSelectedRange(),L=E.getSelectedCell().getCoords();let v=null,U=0;const Z=L.rowIndex>0?E.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex}).getExtended(s.IRange.Direction.Up):null;Z&&E.getRange({colStart:L.colIndex,rowStart:Z.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowStart}).isContentful()&&(v=s.IRange.Direction.Up,U=L.rowIndex-Z.getCoords().rowEnd);const ee=L.colIndex>0?E.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(ee&&E.getRange({colStart:ee.getCoords().colStart,rowStart:L.rowIndex,colEnd:ee.getCoords().colStart,rowEnd:L.rowIndex}).isContentful()){const ie=L.colIndex-ee.getCoords().colEnd;(ie<U||!v)&&(v=s.IRange.Direction.Left,U=ie)}let le=null;if(v===s.IRange.Direction.Up){if(le={...Z.getCoords()},(le.rowEnd===L.rowIndex||!E.getRange({colIndex:L.colIndex,rowIndex:L.rowIndex-1}).isContentful())&&le.rowStart>0&&E.getRange({colIndex:L.colIndex,rowIndex:le.rowStart-1}).isContentful()){const ie=Z.getExtended(s.IRange.Direction.Up);le={colStart:L.colIndex,rowStart:ie.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowEnd}}le.rowEnd=L.rowIndex-1}else if(v===s.IRange.Direction.Left){if(le={...ee.getCoords()},(le.colEnd===L.colIndex||!E.getRange({colIndex:L.colIndex-1,rowIndex:L.rowIndex}).isContentful())&&le.colStart>0&&E.getRange({colIndex:le.colStart-1,rowIndex:L.rowIndex}).isContentful()){const ie=ee.getExtended(s.IRange.Direction.Left);le={colStart:ie.getCoords().colStart,rowStart:L.rowIndex,colEnd:ie.getCoords().colEnd,rowEnd:L.rowIndex}}le.colEnd=L.colIndex-1}if(b.size!==1&&v){const ie=b.getCoords(),se=b.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),Ce={...le},he=ie.rowStart,me=ie.rowEnd,xe=ie.colStart,Le=ie.colEnd,De=v===s.IRange.Direction.Up;for(let We=xe;We<=Le;We++){Ce.colStart=De?We:le.colStart+(We-xe),Ce.colEnd=De?We:le.colEnd+(We-xe);for(let je=he;je<=me;je++){Ce.rowStart=De?le.rowStart+(je-he):je,Ce.rowEnd=De?le.rowEnd+(je-he):je;const Ge=E.getRange(Ce).toString();se.pushAt(je,We,`=${T}(${Ge})`)}}se.apply()}else{const ie=le?E.getRange(le).toString():"",se=`=${T}(`;S?.({text:`${se}${ie})`,editMode:!0,initialSelection:{start:se.length,end:se.length+ie.length}})}},!1)},[t]),ae=r.useCallbackRef((u,T,E=!1,b=!0)=>{P(u,async L=>{let v=null;if(H)return void H.updateStyleOptions(T);{const ee=L.getSelectedRanges().getFixed(!0),le=L.getSelectedRange().getDefaultSortCriteria();let ie={ranges:ee,hasHeader:le?.options?.hasHeader??!1};v=b?new Promise((se,Ce)=>{const he={tableOptions:ie,onCancel:()=>{Ce()},onDone:me=>{se(me)},context:{getNames:()=>L.getNames()}};d.showWindow?.("tableNew",he)}):{option:"Ok",tableOptions:ie}}const U=await Promise.resolve(v);if(U?.option!=="Ok")throw null;const Z=await Promise.resolve(d?.showBusy?.(u.label()));try{await L.getTables().add(U.tableOptions.ranges.at(0),{styleName:T?.name,clearFormatting:E,hasHeader:U.tableOptions.hasHeader}).getRange().select()}catch(ee){Z(),d?.showError?.(ee)}Z()},!1,!0,!1)},[H]),Me=r.useCallbackRef(()=>i,[i]),Te=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:Me,getNames:()=>t.getNames()}),[t]),fe=r.useCallbackRef(async(u,T,E,b=!0)=>{let L=null;if(!T){let v=t.getSelectedRange();v.size===1&&(v=v.getSurrounding());let U=t.getTables().search({address:t.getSelectedRange()});U.length>0&&(T=U[0]),await v.select()}if(T){if(b){try{E&&await T.select()}catch{}L=new Promise(async(v,U)=>{u.update({context:Te(T)});const Z={command:u,commands:C,notifier:d,onDone:le=>{v(le)}},ee=await d.showWindow?.("tableDetails",Z,{disableAutoDestroy:!0});setTimeout(()=>{ee.focus()},180)})}Promise.resolve(L).then(v=>{},v=>{d?.showError?.(v)})}},[d]),Be=r.useCallbackRef(async(u,T,E=!1)=>{let b=null;if(T)T.isITable?b=T:T.getValue()&&(b=T.getValue());else{const L=t.getTables().search({address:t.getSelectedRange()});L.length>0&&(b=L[0])}if(b){if(!E){const L=b.getRange().getCoords(),v=(L.colEnd-L.colStart+1)*(L.rowEnd-L.rowStart+1);if(v>1e4&&await d?.showOptions({title:"Confirm",description:`Converting a table to range with '${v}' cells will set a large number of cell styles and may affect performance.
|
|
10
|
+
Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}P(u,async()=>{E?b.delete():b.convertToRange()},!1,!0)}},[d]),pe=r.useCallbackRef((u,T,E)=>{P(u,async b=>{let L=b.getSelectedRanges();if(L.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let v=L.at(0);v.size===1&&(v=v.getSurrounding());const U=b.getSelection().getCoords().cell;let Z=v.getDefaultSortCriteria(s.IRange.Orientation.Row,U);if(!Z){if(E)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ee=Z.options;if(E&&(ee=new Promise((ie,se)=>{const Ce={range:v,options:Z.options,cell:U,onCancel:()=>{se()},onDone:he=>{he?ie(he.options):se()}};d.showWindow?.("sort",Ce)})),ee=await Promise.resolve(ee),!ee)return;const le=await Promise.resolve(d?.showBusy?.(u.label()));try{v.doBatch(()=>{const ie={...ee,...T};v.sort(ie),v.autoFit({orientations:ie?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.label?.())}catch(ie){le(),d?.showError?.(ie)}le()},!1,!1,!1)},[d]),Pe=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),T=t.getSelectedRanges().getFlattened().getCoords(),E=(v=>{const U=new Blob([v],{type:"application/javascript"}),Z=URL.createObjectURL(U),ee=new Worker(Z);return URL.revokeObjectURL(Z),ee})("console.log('hello from worker');");setTimeout(()=>{E.terminate(),console.log("Worker terminated")},5e3);let b=-1;for(let v=0;b===-1&&v<T.length;v++)ue.CoordUtils.isCellWithinRange(u.cell,T[v])&&(b=v);if(ue.CoordUtils.isEqualRangesArrays(u.ranges,T))return;const L={cell:u.cell,ranges:T,rangeIndex:b};t.getSelection().updateCoords(L)},[t]),Se=r.useCallbackRef(()=>{console.log("selectComments")},[t]),ge=r.useCallbackRef(async(u=!1,T=!1)=>{let E=null;if(T)E=t.getEntireRange();else{const b=t.getSelectedRange();if(b.isEntireRange()){const L=t.getSelection().getCoords().cell,v=t.getRange(L);E=v.getSurrounding(),E.isEntireRange()&&(E=v)}else E=b.getSurrounding({contentOnly:u})}E&&await E.select()},[t]),ce=r.useCallbackRef((u,T,E)=>{P(u,async b=>{let L=b.getSelectedRanges();E&&(T===s.IRange.Orientation.Row?L=L.getEntireRows():T===s.IRange.Orientation.Column&&(L=L.getEntireColumns())),L.delete(T)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let T=null;const E=D(),b=Math.min(E.width-8,480),L=Math.min(E.height-8,288);try{t.getSelectedRanges(),T=await t.getMovables().add({bounds:{x:E.left+(E.width-b)/2,y:E.top+(E.height-L)/2,width:b,height:L},type:"chart",json:u.template}),T.select(),w.setMode(null)}catch(v){d?.showError?.(v)}return T},[t,d]);const we=r.useCallbackRef(async(u,T,E)=>{const b=await d?.showBusy?.(u.label());try{const L=await t.getMovables().addImage(T,{autoSelect:!0,...E});return b(),w.setMode(null),L}catch(L){b();let v=L;typeof v!="string"&&(console.warn(L),v="Unable to resolve image."),d?.showMessage?.(v,{type:r.NotificationType.Error})}},[t,d]),de=r.useCallbackRef((u,T)=>{P(u,async E=>{const b=E.getSelectedRanges();b.doBatch(()=>{const L=T===s.IRange.Direction.Up||T===s.IRange.Direction.Down,v=b.getCoords().slice().sort(ue.CoordUtils.createRangeComparator(L?s.IRange.Orientation.Row:s.IRange.Orientation.Column));for(let U=0;U<v.length;U++){const Z=v[U];let ee=Z;const le=E.getRange(ee).getMerges();let ie=0,se=0;if(le.length>0){const Ce=le[0];ie=Ce.rowEnd-Ce.rowStart,se=Ce.colEnd-Ce.colStart}T===s.IRange.Direction.Left?ee={...Z,colStart:Z.colEnd+se}:T===s.IRange.Direction.Right?ee={...Z,colEnd:Z.colStart+se}:T===s.IRange.Direction.Up?ee={...Z,rowStart:Z.rowEnd+ie}:T===s.IRange.Direction.Down&&(ee={...Z,rowEnd:Z.rowStart+ie}),E.getRange(ee).autoFill(Z,{filler:s.AutoFill.Types.Copy}),E.getRange(Z).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.label()})})},[d]),be=r.useCallbackRef(()=>{let u=null;const T=t.getSelectedCell().getCoords();if(T?.rowIndex>0){const E=t.getRange({rowIndex:T.rowIndex-1,colIndex:T.colIndex}).getCell();E&&(u=E.toTextUnformatted(!0))}S?.({text:u})},[t]),[Fe,ve]=o.useReducer(u=>u+1,0),[Ee,Oe]=o.useReducer(u=>u+1,0),He=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Se()),new r.Command("selectAll",l,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[r.KeyModifiers.Ctrl]},{key:"Space",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},(u=!1)=>ge(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>ge(!0,!1)),new r.SimpleCommand("breakSelection",l,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>Pe()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation."}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically."}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){pe(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){pe(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){pe(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
|
|
11
11
|
For example, you can prevent people from editing locked cells or making formatting changes.`}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(u){V(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(u){ae(this,u)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(u){ae(this,u,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){ae(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",l,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ye),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},ne),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){V(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){V(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){V(this,{font:{fill:u}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top."}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells."}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom."}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically."}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left."}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content."}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right."}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content."}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells."}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,u=>({font:{size:ao(u.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,u=>({font:{size:ao(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){V(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){V(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,T){const E=this,b={initialValue:u??T.state(),context:T.context(),onInputOption:(L,v)=>{V(E,{numberFormat:L})}};d.showWindow?.("numberFormat",b)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){V(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:s.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",l,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",l,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",l,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(u){V(this,{numberFormat:u??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",l,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){V(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){V(this,u=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){V(this,u=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("quickFormulaSum",l,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){X(this,"SUM")}),new r.Command("quickFormulaAverage",l,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){X(this,"AVERAGE")}),new r.Command("quickFormulaCount",l,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){X(this,"COUNT")}),new r.Command("quickFormulaMax",l,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){X(this,"MAX")}),new r.Command("quickFormulaMin",l,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){X(this,"MIN")}),new r.Command("startEditCurrentTime",l,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){S?.({text:t.createTemporaryCell({value:cn(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){S?.({text:t.createTemporaryCell({value:cn(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(u,T){console.log("insertFunction")}),new r.Command("updateHyperlink",l,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>G,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,T){const E=this,b={context:T.context(),onUpdateHyperlink:(L,v)=>{$(E,L,v)}};d.showWindow?.("hyperlink",b)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>G},async(u,T)=>{const E=T.context()();if(!E)return;const b=E.getHyperlink();if(b)try{await b.open()}catch(L){d?.showError?.(L)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>G},function(u,T){$(this,null,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(u,T)=>{((E,b)=>{E?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[b," is not yet implemented.",c.jsx("br",{}),c.jsx("br",{}),"Please see the ",c.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(d,T.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>G},async function(u,T){const E=this,b={context:T.context(),onUpdateComments:L=>{te(E,L)}};d.showWindow?.("comments",b)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>G},function(u,T){te(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(u=null){let T=null,E=null;typeof u=="string"?E=u:T=u?.file?u.file:u,(T||(T=await ue.CommonUtils.openFileDialog(E??"image/*"),T))&&await we(this,{file:T},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(u){if(!u){const T=await d?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(T.option!=="Insert")return;u=T.input}u&&we(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){ae(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(u){let T=null,E=!1;u.isITable?T=u:u.getValue()&&(T=u.getValue(),E=!0),fe(this,T,E)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
|
|
12
12
|
|
|
13
13
|
The table and table specific styling will be removed but the values will be preserved.`},function(u){Be(this,u,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
|
|
@@ -16,18 +16,18 @@ The values and the formatting are preserved.`},function(u){Be(this,u,!1)}),new r
|
|
|
16
16
|
|
|
17
17
|
The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){N(this,s.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){N(this,s.ICell.Content.Formats)}),new r.SimpleCommand("clearHyperlinks",l,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){N(this,s.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){N(this,s.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},description:`Clears everything from the cells.
|
|
18
18
|
|
|
19
|
-
All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){N(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),C=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(He,!0),u},[a,He]),[Ue,Qe]=o.useState(!1),[$e,J]=o.useState(!1);o.useEffect(()=>{if(I.current!==t||!h)return;const u=h.getCoords(),T=t.getTables().search({address:u[0]});F(U=>ue.CommonUtils.isEqualArrays(U,T)?U:T),g&&T[0]&&ue.CoordUtils.isCellWithinRange(g,T[0].getRange().getCoords())?re(T[0]??null):re(null);const E=t.getSelectedRanges(),b=E.getMerges().length>0,L=E.isOverlapping();let v=!0;for(let U=0;v&&U<u.length;U++)v=ue.CoordUtils.isSingleCell(u[U]);J(L),Qe(T.length===0&&!L&&(b||!v))},[Ee,h,t]),r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),T=y.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>T}).updateCallback(()=>T?void y.setMode(null):C.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",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`}}))}},[y,Fe,a]),tt(t.getView(),{onFreezeSplitChange:()=>{Oe()}}),tt(t.getSelection(),{onChange:()=>{_()}});const Ie=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??Rn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:Rn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Ve=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{W(u)},darkMode:i.darkMode,quickBorder:z,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Ve()},[z]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!G().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:u||!G().getHyperlink()});const T=G().getHyperlink()?"Edit":"Insert",E="Link";C.getCommand("updateHyperlink").update({label:()=>(G().getHyperlink(),`${T} ${E}`),scopedLabels:{contextMenu:`${T} ${E}…`,insert:`${E}…`,hyperlink:`${T}…`},disabled:u})},[G()?.getHyperlink(),Fe]),o.useEffect(()=>{const u=G().getComments(),T=()=>u?"Edit":"Insert",E=()=>u?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${T()} ${E()}`,scopedLabels:{contextMenu:`${T()} ${E()}…`,insert:`${E()}…`}})},[G()?.getComments(),Fe]),tt(t,{onViewChange:()=>{const u=t.getView();C.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),Ie()},onTabColorChange:()=>{Ie()},onMergesChange:()=>{Oe()},onMovablesChange:()=>{Oe()},onTablesChange:()=>{Oe()},onProtectionChange:()=>{Oe(),ve()},onStyleChange:()=>{Ie(),Ve(),Oe()}}),o.useEffect(()=>{Ie(),Ve()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),T=B.length>0&&!H||u,E=Te(H),b={context:E};C.getCommand("editTable").update(b),C.getCommand("deleteTable").update(b),C.getCommand("convertTableToRange").update(b);const L={context:E,disabled:T};C.getCommand("formatTableStyle").update({label:H?"Apply Table Style":"Format As Table",...L}),C.getCommand("formatTableStyleClearCellStyles").update(L),C.getCommand("deleteTableStyle").update(L),C.getCommand("convertTableToRange").update(L),C.getCommand("insertTable").update({disabled:T||B.length>0});const v={context:E,disabled:T||B.length===0};C.getCommand("tableHeaderRowToggle").update(v),C.getCommand("tableTotalRowToggle").update(v),C.getCommand("autoFilterToggle").update(v),C.getCommand("formatTableStyleClearTableStyle").update({...v,disabled:v.disabled||!H||H.getStyleOptions().name===null})},[H,B,Fe]),o.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),C.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),C.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),C.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),C.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),C.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),C.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),C.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),C.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})})},[t]),o.useEffect(()=>{const u=t.getView().getFreezePanes(),T=()=>u.coords.rowIndex!==0,E=()=>u.coords.colIndex!==0,b=()=>u.coords.rowIndex!==0||u.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{b()?t.getView().setFreezePanes(null):b()?E()?t.getView().setFreezePanes({coords:{rowIndex:g.rowIndex}}):T()&&t.getView().setFreezePanes({coords:{colIndex:g.colIndex}}):t.getView().setFreezePanes({coords:g})}).update({state:b,disabled:()=>!g||!b()&&g.rowIndex===0&&g.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:T()?0:g.rowIndex}})}).update({state:T,disabled:()=>!g||!T()&&g.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:E()?0:g.colIndex}})}).update({state:E,disabled:()=>!g||!E()&&g.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!b()})},[Ee,g,t,i]);const ke=G().getStyle(),ze=ke.getFont(),Ae=ke.getAlignment(),k=Ae.getHorizontal(),oe=Ae.getVertical(),O=Ae.getOverflow(),Y=Ae.getRotation();return o.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>G().getStyle(!0).getNamed(),bodyStyle:Me,createTemporaryCell:Ne=>t.createTemporaryCell(Ne)})}),C.getCommand("formatFillColor").update({state:()=>{let Ne=null;const Xe=ke.getFill();return Xe?.getType()===s.IFill.Type.Solid?Ne=Xe.getColor():Xe?.getType()===s.IFill.Type.Gradient?Ne=Xe.getStops()?.[0]?.getColor():Xe?.getType()===s.IFill.Type.Pattern&&(Ne=Xe.getBackground()),Ne},context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{w(Xe??Rn)},darkMode:i.darkMode,quickColor:K,autoColor:Rn,schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>ze.toJSON()?.fill?ze.getFill():null,context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{R(Xe)},darkMode:i.darkMode,quickColor:j,autoColor:Ne.getNormal().getFont().getFill(),schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>ke.getNumberFormat(),context:()=>G}),C.getCommand("formatNumberDialog").update({state:()=>ke.getNumberFormat(),context:()=>G}),C.getCommand("formatFontFamily").update({state:()=>ze.getFamily()}),C.getCommand("formatFontSize").update({state:()=>ze.getSize()});const u=function(){const Ne=ze.getWeight()||0;return!isNaN(Ne)&&Ne>500};C.getCommand("formatBoldToggle").updateCallback(function(){V(this,{font:{weight:u()?400:700}})}).update({state:u});const T=function(){return ze.getStyle()===s.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){V(this,{font:{style:T()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:T}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){V(this,{font:{strike:!ze.getStrike()}})}).update({state:ze.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const E=()=>O===s.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){V(this,{alignment:{overflow:(E(),s.ITextFrame.Overflow.Visible)}})}).update({state:E});const b=()=>O===s.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){V(this,{alignment:{overflow:b()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:b});const L=function(){return O===s.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){V(this,{alignment:{overflow:L()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:L});const v=function(){return O===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){V(this,{alignment:{overflow:v()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:v});const U=function(){return O===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){V(this,{alignment:{overflow:U()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:U,disabled:!0});const Z=function(){return oe===s.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){V(this,{alignment:{vertical:Z()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:Z});const ee=function(){return oe===s.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){V(this,{alignment:{vertical:ee()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:ee});const le=function(){return oe===s.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){V(this,{alignment:{vertical:(le(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:le});const ie=function(){return oe===s.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:ie()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:ie});const se=function(){return oe===s.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:se()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:se});const Ce=function(){return k===s.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){V(this,{alignment:{horizontal:Ce()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:Ce});const he=function(){return k===s.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){V(this,{alignment:{horizontal:he()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:he});const me=function(){return k===s.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Ne={alignment:{horizontal:me()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};V(this,Ne)}).update({state:me});const xe=function(){return k===s.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const Ne={alignment:{horizontal:xe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};V(this,Ne)}).update({state:xe});const Le=function(){return k===s.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){V(this,{alignment:{horizontal:Le()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Le});const De=function(){return k===s.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){V(this,{alignment:{horizontal:De()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:De});const We=function(){return k===s.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){V(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const je=!t.getProtection().isFormatCellsAllowed(),Ge=k===s.ITextFrame.HorizontalAlignment.CenterContinuous||k===s.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(Ne){V(this,{alignment:{rotation:0}})}).update({disabled:je||Ge,state:Y===0}),C.getCommand("formatTextRotate45").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?45:0}})}).update({disabled:je||Ge,state:Y===45}),C.getCommand("formatTextRotate90").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?90:0}})}).update({disabled:je||Ge,state:Y===90}),C.getCommand("formatTextRotate270").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?270:0}})}).update({disabled:je||Ge,state:Y===270}),C.getCommand("formatTextRotate315").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?315:0}})}).update({disabled:je||Ge,state:Y===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne}})}).update({disabled:je||Ge,state:Y??0})},[ke,t,i,K,j]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),T=t.getSelectedRanges().getMerges().length>0,E=async(_e,rt)=>{P(rt,async vt=>{const yt=async(gt=!1)=>{const lt=await Promise.resolve(d?.showBusy?.(rt.label()));try{const Tt=vt.getSelectedRanges();if(Tt.merge({orientations:_e,discardMultipleValues:gt}),_e===s.IRange.Orientations.Both){const Lt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};Tt.updateStyle(Lt)}}catch(Tt){throw Tt}finally{lt?.()}};let Ct;try{await yt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;Ct=!0}if(Ct&&d?.showOptions){if(await d?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await yt(!0)}},void 0,void 0,!1)},b=_e=>{P(_e,async rt=>{try{const vt=rt.getSelectedRanges();vt.unmerge();const yt={alignment:{horizontal:null}};vt.updateStyle(yt)}catch(vt){throw vt}})};C.getCommand("mergeToggle").updateCallback(function(){ue.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(T?b(this):E(s.IRange.Orientations.Both,this))}).update({state:T,disabled:!Ue||u}),C.getCommand("mergeHorizontal").updateCallback(function(){E(s.IRange.Orientations.Column,this)}).update({disabled:!Ue||u}),C.getCommand("mergeVertical").updateCallback(function(){E(s.IRange.Orientations.Row,this)}).update({disabled:!Ue}),C.getCommand("unmerge").updateCallback(function(){b(this)}).update({disabled:!T||!Ue||u});const L={disabled:u};C.getCommand("hideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(L),C.getCommand("hideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(L),C.getCommand("unhideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(L),C.getCommand("unhideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(L),C.getCommand("autoFitRows").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(L),C.getCommand("autoFitColumns").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(L);let v=!1,U=0,Z=!1,ee=!1,le=0,ie=!1;!h||u||$e||(v=h.isEntireColumnsAny(),v&&!h.isEntireColumns()?Z=!0:U=h.getColumnCount(),ee=h.isEntireRowsAny(),ee&&!h.isEntireRows()?ie=!0:le=h.getRowCount());const se={disabled:u||h&&h.getCount()!==1};C.getCommand("sortAscending").update(se),C.getCommand("sortDescending").update(se);const Ce={disabled:v||ee||u||$e},he=v||u||$e||ie;he&&(U=1);const me=ee||u||$e||Z;me&&(le=1);let xe="",Le="",De="",We="",je="",Ge="",Ne="",Xe="",it="";U>1&&(Ge=Le=U+" ",Ne=De="s"),le>1&&(Xe=We=le+" ",it=je="s"),y.getMode()?.key==="copy"?(xe=We=Le="Copied ",De=je="s"):y.getMode()?.key==="cut"&&(xe=We=Le="Cut ",De=je="s");let pt="",wt="";if(h){const _e=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;pt=` (${_e?"Shift Right":"Shift Down"})`,wt=` (${_e?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${wt}`})}C.getCommand("insertCells").update({label:`Insert ${xe}Cells${pt}`,scopedLabels:{insertCells:`${xe}At Selection`}}),C.getCommand("insertCellsShiftRight").update(Ce),C.getCommand("insertCellsShiftDown").update(Ce),C.getCommand("deleteCellsShiftUp").update(Ce),C.getCommand("deleteCellsShiftLeft").update(Ce),C.getCommand("insertRows").update({label:`Insert ${We}Row${je}`,scopedLabels:{insertCells:`${We}Row${je}`},disabled:me}),C.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${je} Below`,disabled:me}),C.getCommand("insertColumns").update({label:`Insert ${Le}Column${De}`,scopedLabels:{insertCells:`${Le}Column${De}`},disabled:he}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Le}Column${De} After`,disabled:he}),C.getCommand("deleteRows").update({label:`Delete ${Xe}Row${it}`,scopedLabels:{deleteCells:`${Xe}Row${it}`},disabled:me}),C.getCommand("deleteColumns").update({label:`Delete ${Ge}Column${Ne}`,scopedLabels:{deleteCells:`${Ge}Column${Ne}`},disabled:he})},[Ee,Ue,$e,h,y,d,Fe]),o.useEffect(()=>{const u=t.getProtection(),T=t.getProtection().isLocked(),E=!u.isFormatCellsAllowed(),b={disabled:E};C.getCommand("protectionSheetToggle").updateCallback(async(U,Z)=>{let ee=null;try{if(T){let le=null;if(u.hasPassword()){const ie=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ie.option!=="Unprotect")return;le=ie.input}ee=await Promise.resolve(d?.showBusy?.(Z.label())),await u.unlock(le)}else ee=await Promise.resolve(d?.showBusy?.(Z.label())),await u.lock();ee?.()}catch(le){ee?.(),d?.showError?.(le)}}).update({state:T,label:()=>T?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:T?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(b),C.getCommand("sortAscending").update(b),C.getCommand("sortDescending").update(b),C.getCommand("sortCustom")?.update(b),C.getCommand("updateComments").update(b),C.getCommand("deleteComments").update(b),C.getCommand("insertChart")?.update(b),C.getCommand("insertImageFromFile").update(b),C.getCommand("insertImageFromURL").update(b),C.getCommand("formatBorder").update(b),C.getCommand("formatFillColor").update(b),C.getCommand("formatFontColor").update(b),C.getCommand("formatBoldToggle").update(b),C.getCommand("formatItalicToggle").update(b),C.getCommand("formatUnderlinedToggle").update(b),C.getCommand("formatStrikeThroughToggle").update(b),C.getCommand("formatSuperscriptToggle").update(b),C.getCommand("formatSubscriptToggle").update(b),C.getCommand("formatAlignTopToggle").update(b),C.getCommand("formatTextOverflowVisibleToggle").update(b),C.getCommand("formatTextOverflowWrapToggle").update(b),C.getCommand("formatTextOverflowClipToggle").update(b),C.getCommand("formatTextOverflowShrinkToggle").update(b),C.getCommand("formatAlignMiddleToggle").update(b),C.getCommand("formatAlignBottomToggle").update(b),C.getCommand("formatAlignDistributedVerticalToggle").update(b),C.getCommand("formatAlignJustifyVerticalToggle").update(b),C.getCommand("formatAlignLeftToggle").update(b),C.getCommand("formatAlignCenterToggle").update(b),C.getCommand("formatAlignRightToggle").update(b),C.getCommand("formatAlignJustifyToggle").update(b),C.getCommand("formatAlignCenterContinuousToggle").update(b),C.getCommand("formatAlignDistributedHorizontalToggle").update(b),C.getCommand("formatAlignFillToggle").update(b),C.getCommand("formatFontSizeIncrease").update(b),C.getCommand("formatFontSizeDecrease").update(b),C.getCommand("formatFontFamily").update(b),C.getCommand("formatFontSize").update(b),C.getCommand("formatNumberFormat").update(b),C.getCommand("formatNumberFormatGeneralStyle").update(b),C.getCommand("formatNumberFormatNumberStyle").update(b),C.getCommand("formatNumberFormatTimeStyle").update(b),C.getCommand("formatNumberFormatDateStyle").update(b),C.getCommand("formatNumberFormatAccountingStyle").update(b),C.getCommand("formatNumberFormatPercentStyle").update(b),C.getCommand("formatNumberFormatScientificStyle").update(b),C.getCommand("formatNumberFormatCommaStyle").update(b),C.getCommand("formatNumberFormatIncreaseDecimal").update(b),C.getCommand("formatNumberFormatDecreaseDecimal").update(b),C.getCommand("hideColumns").update(b),C.getCommand("unhideColumns").update(b),C.getCommand("hideRows").update(b),C.getCommand("unhideRows").update(b),C.getCommand("quickFormulaSum").update(b),C.getCommand("quickFormulaAverage").update(b),C.getCommand("quickFormulaCount").update(b),C.getCommand("quickFormulaMax").update(b),C.getCommand("quickFormulaMin").update(b),C.getCommand("startEditCurrentTime").update(b),C.getCommand("startEditCurrentDate").update(b),C.getCommand("startEditValueAbove").update(b),C.getCommand("fillDown").update(b),C.getCommand("fillRight").update(b),C.getCommand("fillUp").update(b),C.getCommand("fillLeft").update(b),C.getCommand("formatCellStyle").update(b),C.getCommand("formatTableStyle").update(b),C.getCommand("formatPainterToggle").update(b),C.getCommand("formatBorderAddOutline").update(b),C.getCommand("formatBorderClearOutline").update(b),C.getCommand("formatIndentDecrease").update(b),C.getCommand("formatIndentIncrease").update(b),C.getCommand("clearContents").update(b),C.getCommand("clearFormats").update(b),C.getCommand("clearAll").update(b),C.getCommand("clearComments").update(b),C.getCommand("clearHyperlinks").update(b),C.getCommand("autoFilterClear").update(b),C.getCommand("autoFilterReapply").update(b);const L=k===s.ITextFrame.HorizontalAlignment.CenterContinuous||k===s.ITextFrame.HorizontalAlignment.Fill,v={disabled:E||L};C.getCommand("formatTextRotate0").update(v),C.getCommand("formatTextRotate45").update(v),C.getCommand("formatTextRotate90").update(v),C.getCommand("formatTextRotate270").update(v),C.getCommand("formatTextRotate315").update(v),C.getCommand("formatTextRotateCustom").update(v),C.getCommand("formatTextRotateVertical").update(v)},[Ee]),C}var Do,zo;(function(){if(zo)return Do;zo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof rn=="object"&&rn&&rn.Object===Object&&rn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),p=Object.prototype.toString,g=Math.max,q=Math.min,h=function(){return m.Date.now()};function f(S){var D=typeof S;return!!S&&(D=="object"||D=="function")}function I(S){if(typeof S=="number")return S;if(function(W){return typeof W=="symbol"||function(K){return!!K&&typeof K=="object"}(W)&&p.call(W)=="[object Symbol]"}(S))return NaN;if(f(S)){var D=typeof S.valueOf=="function"?S.valueOf():S;S=f(D)?D+"":D}if(typeof S!="string")return S===0?S:+S;S=S.replace(e,"");var z=n.test(S);return z||i.test(S)?a(S.slice(2),z?2:8):t.test(S)?NaN:+S}Do=function(S,D,z){var W,K,w,j,R,y,M=0,B=!1,F=!1,A=!0;if(typeof S!="function")throw new TypeError("Expected a function");function _(te){var N=W,x=K;return W=K=void 0,M=te,j=S.apply(x,N)}function G(te){var N=te-y;return y===void 0||N>=D||N<0||F&&te-M>=w}function P(){var te=h();if(G(te))return V(te);R=setTimeout(P,function(N){var x=D-(N-y);return F?q(x,w-(N-M)):x}(te))}function V(te){return R=void 0,A&&W?_(te):(W=K=void 0,j)}function $(){var te=h(),N=G(te);if(W=arguments,K=this,y=te,N){if(R===void 0)return function(x){return M=x,R=setTimeout(P,D),B?_(x):j}(y);if(F)return R=setTimeout(P,D),_(y)}return R===void 0&&(R=setTimeout(P,D)),j}return D=I(D)||0,f(z)&&(B=!!z.leading,w=(F="maxWait"in z)?g(I(z.maxWait)||0,D):w,A="trailing"in z?!!z.trailing:A),$.cancel=function(){R!==void 0&&clearTimeout(R),M=0,W=y=K=R=void 0},$.flush=function(){return R===void 0?j:V(h())},$}})();var No,Lo,Oo={exports:{}},eo={};Lo||(Lo=1,Oo.exports=function(){if(No)return eo;No=1;var e=o,t=typeof Object.is=="function"?Object.is:function(p,g){return p===g&&(p!==0||1/p==1/g)||p!=p&&g!=g},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(p){var g=p.getSnapshot;p=p.value;try{var q=g();return!t(p,q)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(p,g){return g()}:function(p,g){var q=g(),h=n({inst:{value:q,getSnapshot:g}}),f=h[0].inst,I=h[1];return a(function(){f.value=q,f.getSnapshot=g,d(f)&&I({inst:f})},[p,q,g]),i(function(){return d(f)&&I({inst:f}),p(function(){d(f)&&I({inst:f})})},[p]),l(q),q};return eo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,eo}()),Oo.exports;var jo,Bo,on={exports:{}},Ut={exports:{}},Il=Ut.exports;function Vo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Bo)return on.exports;Bo=1;for(var e=(jo||(jo=1,function(){var h,f,I,S,D,z;typeof performance<"u"&&performance!==null&&performance.now?Ut.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Ut.exports=function(){return(h()-D)/1e6},f=process.hrtime,S=(h=function(){var W;return 1e9*(W=f())[0]+W[1]})(),z=1e9*process.uptime(),D=S-z):Date.now?(Ut.exports=function(){return Date.now()-I},I=Date.now()):(Ut.exports=function(){return new Date().getTime()-I},I=new Date().getTime())}.call(Il)),Ut.exports),t=typeof window>"u"?rn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],d=0;!a&&d<n.length;d++)a=t[n[d]+"Request"+i],l=t[n[d]+"Cancel"+i]||t[n[d]+"CancelRequest"+i];if(!a||!l){var m=0,p=0,g=[],q=1e3/60;a=function(h){if(g.length===0){var f=e(),I=Math.max(0,q-(f-m));m=I+f,setTimeout(function(){var S=g.slice(0);g.length=0;for(var D=0;D<S.length;D++)if(!S[D].cancelled)try{S[D].callback(m)}catch(z){setTimeout(function(){throw z},0)}},Math.round(I))}return g.push({handle:++p,callback:h,cancelled:!1}),p},l=function(h){for(var f=0;f<g.length;f++)g[f].handle===h&&(g[f].cancelled=!0)}}on.exports=function(h){return a.call(t,h)},on.exports.cancel=function(){l.apply(t,arguments)},on.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},on.exports})();const vo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:p=!1,offset:g=0,totalSize:q=0,viewportSize:h=0,...f}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[I]=zt(),S=r.useCallbackRef(l,[l]),D=r.useCallbackRef(d,[d]),z=(W=I,K=t,o.useMemo(()=>W===null&&K===null?null:X=>{Vo(W,X),Vo(K,X)},[W,K]));var W,K;const[w,j]=o.useState(()=>{const X=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?X.top:X.left}),R=()=>{const X=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?X.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(X.coords.rowIndex)-X.topLeft.top,scroll:X.topLeft.top}:X.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(X.coords.colIndex)-X.topLeft.left,scroll:X.topLeft.left}},[y,M]=o.useState(R),[B,F]=o.useState(null),[A,_]=o.useState(!1),G=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),P=()=>{const X=a.getUsedRange()?.getCoords()??ue.CoordUtils.EmptyRange,ae=a.getSelection().getCoords().cell;return{colIndex:Math.max(X.colEnd,ae.colIndex),rowIndex:Math.max(X.rowEnd,ae.rowIndex)}},[V,$]=o.useState(P),te=V?(i===r.ScrollbarOrientation.Vertical?V.rowIndex:V.colIndex)+1:0,N=()=>{const X=P();ue.CoordUtils.isEqualCells(V,X)||$(X)};tt(a.getView(),{onFreezeSplitChange:()=>{M(R)}}),tt(a.getSelection(),{onChange:N}),tt(a,{onUsedRangeChange:N}),o.useEffect(()=>{$(P())},[a]),o.useEffect(()=>{if(!B)return A&&D?.(),void _(!1);const X=G.getTextAt(G.findIndex(w/(a.getView().getZoomScale()/100)+y.scroll+y.shift));_(!0),S?.({...B,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+X})},[g,w,y,i,B,G,A,a]);const x=r.useCallbackRef((X,ae,Me)=>{j(X);const Te=X+y.scroll,fe=ae+y.shift,Be=Me+y.shift+y.scroll;m?.(Te,fe,Be)},[m,y]),H=g-y.scroll,re=h-y.shift,ye=q-(y.shift+y.scroll),ne=G.findOffset(te)*(a.getView().getZoomScale()/100)-(y.scroll+y.shift);return c.jsx(r.VirtualScrollbar,{ref:z,style:n,offset:H,viewportSize:re,totalSize:ye,orientation:i,showCustomScrollButtons:p,onMouseDown:X=>{F({anchor:{x:X.clientX,y:X.clientY}}),X.preventDefault()},onScrollOffset:x,onMouseOut:()=>{F(null)},onMouseUp:()=>{F(null)},minSize:ne,...f})}));vo.displayName="SheetScrollbar";const Po=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},Ho=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:p,headerText:g,freezeStart:q,gridStyle:h,verticalPadding:f,horizontalPadding:I,onSheetContextMenu:S,onResizeHeadersStart:D,onResizeHeaders:z,onResizeHeadersEnd:W,onResizeHeadersDown:K,onResizeHeadersUp:w,scrollPoint:j,onSelectionStart:R,onSelectionEnd:y}=e,M=o.useMemo(()=>n.getOrientation(),[n]),B=o.useRef(null),[F,A]=o.useReducer(O=>O+1,0),[_,G]=o.useReducer(O=>O+1,0),P=n?.getSheet(),V=o.useRef(!1);o.useLayoutEffect(()=>{V.current=!0},[n]);const $=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),te=o.useMemo(()=>{const O=M===s.IRange.Orientation.Column;return{left:O?j.left:0,top:O?0:j.top}},[j]),[N,x]=o.useState(P?.getView().getZoomScale()/100),[H,re]=o.useState(null);tt(n,{onSizesChange:O=>{x(P?.getView().getZoomScale()/100),Fe(de())}});const ye=o.useCallback(()=>{B.current?.invalidate(),G()},[]),ne=o.useCallback(ue.CommonUtils.debounce(()=>{ye()},10),[]),[X,ae]=o.useState(null);tt(n.getSheet(),{onSelectionChange(){ae(P?.getSelection().getCoords()),ne()},onProtectionChange(){ye()},onViewChange(){ne()}}),o.useLayoutEffect(()=>{Fe(de())},[M,N,d]),o.useLayoutEffect(()=>{re(null),x(n?.getSheet().getView().getZoomScale()/100),Fe(de())},[n]);const Me=o.useCallback(O=>n.at(O)?.isHidden()||n.at(O)?.getSize()===0,[n]),Te=o.useCallback((O,Y)=>n.hiddenHeadersAt(O,Y),[Me]),fe=r.useCallbackRef(O=>n.isSelected(O),[n]),Be=r.useCallbackRef(O=>n.isSelectedAll(O),[n]),pe=o.useCallback(()=>n.getMinSize(),[n]),Pe=o.useCallback(()=>n.getMaxSize(),[n]),Se=r.useCallbackRef((O,Y,u)=>{Y/=N;const T={size:Y=Math.max(pe(),Math.min(ue.CommonUtils.roundAccurately(Y,pe()),Pe())),hidden:!1},E=[];if(Y<=0&&(T.hidden=!0,T.size=u),E.push({address:{min:O,max:O},update:T}),Y<0){const b=M===s.IRange.Orientation.Column,L=b?be.getColOffset:be.getRowOffset,v=b?be.getColIndex:be.getRowIndex,U=L(O);let Z=v(U+Y);const ee=L(Z);ee===U+Y?Z--:E.push({address:{min:Z,max:Z},update:{size:U-ee+Y}}),O-Z>1&&E.push({address:{min:Z+1,max:O-1},update:{hidden:!0}})}n.updateHeaderPairs(E),z?.(O,Y,u)},[F,n,N,z]),ge=r.useCallbackRef((O,Y,u)=>{const T=M===s.IRange.Orientation.Column;let E=null,b={min:O,max:O};if(n.isSelectedAll(O)){const L=n.getSelectedRuns();L.length>1?E="Resize "+(T?"Columns":"Rows"):b=L[0];const v={hidden:Y<=0,size:(Y<=0?u:Y)/N};n.updateHeaderPairs(Po(L,v,O))}if(b){const L=b.max-b.min+1;let v;v=L===1?n.getRange(b).at(0).getDisplayText():n.getRange(b).toString(),E=`Resize ${T?"Column":"Row"}${L>1?"s":""} '${v}'`}W?.(O,Y,E)},[F,n,W]),ce=r.useCallbackRef((O,Y)=>{const u=M===s.IRange.Orientation.Column;D(O,Y,`Resize ${u?"Column":"Row"}(s)`)},[D]),we=r.useCallbackRef(O=>{let Y=!1;const u=M===s.IRange.Orientation.Column,T=n.getSheet().getEntireRange().getCoords(),E=[],b=n.getSelectedRuns(),L=v=>{let U;U=u?{colStart:v.min,rowStart:T.rowStart,colEnd:v.max,rowEnd:T.rowEnd}:{colStart:T.colStart,rowStart:v.min,colEnd:T.colEnd,rowEnd:v.max},E.push(U)};for(let v=0;v<b.length;v++){const U=b[v];U.value.isSelectedAll&&(U.min<=O&&U.max>=O&&(Y=!0),L(U))}if(Y||L({min:O,max:O}),n.getSheet().getRanges(E).autoFit({orientations:u?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),Me(O)){const v={hidden:null},U=Po(b,v);Y||U.push({address:O,update:v}),n.updateHeaderPairs(U)}W?.(O,null,"Resize Column(s)")},[F,n,W,Me]),de=()=>{const O=M===s.IRange.Orientation.Column;return{getColOffset:Y=>O?n.findOffset(Y):Y===0?0:d/N,getColIndex:Y=>O?n.findIndex(Y):0,getRowOffset:Y=>O?Y===0?0:d/N:n.findOffset(Y),getRowIndex:Y=>O?0:n.findIndex(Y)}},[be,Fe]=o.useState(()=>de()),ve=o.useCallback((O,Y)=>O.nativeEvent.which!==r.MouseButtonCodes.Right||!Be(M===s.IRange.Orientation.Column?Y.colIndex:Y.rowIndex),[M,Be]),Ee=r.useCallbackRef(O=>{a.focusSheet()},[a]),Oe=r.useCallbackRef(O=>{P?.getSelection().updateCoords(O)},[P]),{...He}=dt.useSelection({gridRef:i,commands:null,layout:be,selection:X,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Oe,canSelectionSpanMergedCells:O=>{const Y=P.getRange(O);return Y.isEntireColumns()||Y.isEntireRows()}}),C=r.useCallbackRef(()=>{R?.();const O=P?.getSelection();O&&O.setAdjusting(O.getCoords())},[P,R]),Ue=r.useCallbackRef(async()=>{P?.getSelection().setAdjusting(null),y?.()},[P,y]),{...Qe}=dt.useHeaderSelection({orientation:M,headerCount:$,gridRef:B,gridMainRef:i,newSelection:He?.newSelection,modifySelection:He?.modifySelection,appendSelection:He?.appendSelection,clearSelections:He?.clearSelections,pointerDownInterceptor:ve,onPointerUp:Ee,onDragStart:C,onDragEnd:Ue}),$e=h.selection?.strokeFill;o.useEffect(()=>{if(!B.current)return void re(null);const O=M===s.IRange.Orientation.Column,Y=n.getSelectedRuns(),u=n.isProtected()?null:Se,T=(b,L,v)=>{if(v)return O?c.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(v.x-h.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(v.width+h.headerSelection.strokeWidth+1,!0)}px`,height:d+h.headerSelection.strokeWidth-.5+"px"}},b):c.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(v.y-h.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,width:d+h.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(v.height+h.headerSelection.strokeWidth+1,!0)}px`}},b)},E=(b,L,v)=>{const U={x:0,y:0,width:0,height:0};if(O){const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:b,colEnd:Math.min($,L)}),dt.SELECTION_CLIP_INSETS);if(!Z)return;U.x=Z.x,U.width=Z.width}else{const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:b,rowEnd:Math.min($,L),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!Z)return;U.y=Z.y,U.height=Z.height}return{x:U.x,y:U.y,width:U.width,height:U.height}};re([b=>{const L=[];let v=null,U=O?b.getVisibleColumns():b.getVisibleRows();const Z=O?b.getTotalRangeCoords().colStart:b.getTotalRangeCoords().rowStart;U.length>0&&U[0]>Z&&(U=[U[0]-1,...U]);let ee=[];const le=[];for(let me=0;me<U.length;me++){const xe=U[me],Le=me<U.length-1?U[me+1]:xe+Te(xe+1,!1)+1,De=xe+1!==Le;if(!v||v.max<xe)if(Y.length>0&&Y[Y.length-1].max>=xe){const Ge=ue.CommonUtils.findEqualOrGreater(Y,xe,Ne=>Ne.max);v=Y[Ge]}else v=null;let We=!1,je=!1;if(v?.value&&(v.min<=xe||v.min<=Le&&!De)&&(We=!0,je=v.value.isSelectedAll),xe===Z){let Ge=!1,Ne=!1;v?.value&&v.min<=xe&&(Ge=!0,Ne=v.value.isSelectedAll),xe>0&&le.push({index:xe-1,isNextHidden:De,isSelected:Ge,isSelectedAll:Ne,disabledResize:!0})}if(je&&ee.push(le.length),le.push({index:xe,isHidden:me===0&&Te(xe,!1)>0,isNextHidden:De,isSelected:We,isSelectedAll:je,onDividerMouseDown:K,onDividerResizeStart:ce,onDividerResize:u,onDividerMouseUp:w,onDividerResizeEnd:ge,onDividerAutoFit:we}),De){let Ge=!1,Ne=!1;if(v&&v.min>=xe&&v.max<=Le-1&&v.value.isSelectedAll&&ee.push(le.length),!(v?.value&&v.max>=Le))if(Y.length>0&&Y[Y.length-1].max>=Le){const Xe=ue.CommonUtils.findEqualOrGreater(Y,Le,it=>it.max);v=Y[Xe]}else v=null;v?.value&&v.min<=Le&&(Ge=v.value.isSelected,Ne=v.value.isSelectedAll),Le>0&&le.push({index:Le-1,isHidden:!0,isSelected:Ge,isSelectedAll:Ne,onDividerMouseDown:K,onDividerResizeStart:ce,onDividerResize:u,onDividerMouseUp:w,onDividerResizeEnd:ge,onDividerAutoFit:we})}}if(ee.length>0){let me=ee.length-1;if(ee.length>0){const De=le[ee[me]].index;let We=null;O?(We=b.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:De,colEnd:De}),We.x+We.width>b.getBounds().width&&(me-=1,me===0&&(me=-1))):(We=b.getRangeCoordsBounds({rowStart:De,rowEnd:De,colStart:0,colEnd:0}),We.y+We.height>b.getBounds().height&&(me-=1,me===0&&(me=-1)))}const xe=Y?.[Y.length-1],Le=b.getAnchor();if(Le==="t"||Le==="l"){const De=le[ee[Math.max(0,ee.length-1)]];De.showTouchDivider=xe&&xe.max<=De.index}else me>=0&&(le[ee[me]].showTouchDivider=!0)}const{header:ie,headerSelect:se,headerSelectAll:Ce,headerHover:he}=h??{};for(let me=0;me<le.length;me++)L.push(c.jsx(dt.HeaderDivider,{orientation:M,view:b,headerStyle:ie,headerStyleSelect:se,headerStyleSelectAll:Ce,headerStyleHover:he,disabled:n.isProtected(),...le[me]},`divider${me}`));return L},b=>{const L=[];for(let v=0;Y&&v<Y.length;v++)L.push(T(`selection:${b.getAnchor()}:${v}`,0,E(Y[v].min,Y[v].max,b)));return L}])},[_,!0,$e,h,be,$,q,F,N]),o.useEffect(()=>{B.current?.invalidate()},[F]);const J=r.useCallbackRef(O=>g?g(O):n.getTextAt(O),[g,n]),Ie=r.useCallbackRef(O=>{const{header:Y,headerSelect:u,headerSelectAll:T,headerHover:E}=h??{},{range:b,key:L,...v}=O;return c.jsx(dt.HeaderRenderer,{orientation:M,index:M===s.IRange.Orientation.Column?b.colStart:b.rowStart,isSelected:fe,isSelectedAll:Be,zoomScale:100*N,headerText:J,headerStyle:Y,headerStyleSelect:u,headerStyleSelectAll:T,headerStyleHover:E,verticalPadding:f,horizontalPadding:I,...v},L)},[F,$,h,N,n]),Ve=r.useEditMode(),ke=o.useMemo(()=>{const O="white",Y="black",u={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let T=M===s.IRange.Orientation.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='${Y}' fill='${O}'/%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='${Y}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Ve.getMode()?.key==="formatPainter"&&(T=`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='${Y}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),u.cursor=T}return u.backgroundColor=h?.header?.fill||"transparent",u},[M,F,Ve,h]),ze=r.useImperativeElement(t,()=>({scrollTo:O=>{B.current?.scrollTo(O)},forceRender:()=>{A()},getGridElement:()=>B.current}),[]),Ae=o.useCallback(O=>{Qe.onPointerDown(O)},[Qe]),k=o.useCallback(O=>{const Y=Qe.getCellCoordsFromClient(O.clientX,O.clientY);if(!Y||!S)return;const u=M===s.IRange.Orientation.Column;S({originalEvent:O,clientX:O.clientX,clientY:O.clientY,rowIndex:u?-1:Y.rowIndex,colIndex:u?Y.colIndex:-1}),O.stopPropagation(),O.preventDefault()},[Qe,S]),oe=o.useMemo(()=>{const O=M===s.IRange.Orientation.Column;return c.jsx("div",{ref:ze,children:c.jsx(dt.Grid,{className:"sheet-header",style:ke,ref:B,scrollPoint:te,columnCount:O?$:1,rowCount:O?1:$,width:O?m:d,height:O?d:p,freezeLeft:O?q:void 0,freezeTop:O?void 0:q,hiddenColumnsAt:O?Te:void 0,hiddenRowsAt:O?void 0:Te,showGridLines:!1,layout:be,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:k,onPointerDown:Ae,zoom:N,cellRenderer:Ie,overlays:H})})},[H,be,m,p,te,ke,_]);return o.useEffect(()=>{V.current=!1,B.current?.invalidate(),G()},[n,h]),oe})),El=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((g,q)=>g.getStyle().getBorder(),[]),{overlay:m}=po({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),p=m(n);return p&&n?p:null})),Fl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Al={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Dl={type:s.ICell.Content.Values},zl={fitDestination:!0,type:s.ICell.Content.Formats},Nl={fitDestination:!0,type:s.ICell.Content.Formulas},Ll={transpose:!0},Ol={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},qr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:p="rgb(33, 115, 70)",copyBackgroundColor:g="white",cutBackgroundColor:q="white",notifier:h,...f})=>{const I=r.useCallbackRef(d,[d]),S=o.useRef(null),D=r.useEditMode(),z=D.getMode(),W=o.useMemo(()=>({element:e,doCopy:y=>{const M=t.getSelectedRanges().getSnapshot(y);return new s.RangeClipboardItem(M)}}),[t,n,e]),K=o.useMemo(()=>({element:e,importFromExternal:async(y,M)=>{const B=new s.ExternalRangeClipboardItem(y,M,t.getStyles(),t.isDate1904());return await B.parse()?B:null},doPaste:async(y,M)=>{if(y?.getItemType()!=="range")return;M?.contentsOnly&&delete(M={...M,type:s.ICell.Content.Values}).contentsOnly;const B=t.getSelectedRange(),F=y.getItem(),A=F.getName();return await B.doBatch(async()=>{const _=await B.copyFrom(F,M);!_||_.isEntireRows()||_.isEntireColumns()||_.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(A?` ${A}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:w,...j}=r.useCopyPaste({...f,source:W,commands:i,target:K,notifier:h,onClipboardUpdate:y=>{const M=y?.getItemType()==="range"?y:null;if(M){const B=y.editMode?.(),F={...y?.isCut?.()?Al:Fl,...B,args:{isClipboard:!0,...B?.args},onModeChange:A=>{A?.args?.isClipboard||w.clear(!0),B?.onModeChange?.(A)}};D.setMode(F)}S.current=M,a?.(M)},onPaste:(y,M)=>{if(y?.getItemType()!=="range")return;let B=D.getMode()?.key==="cut"||y.isCut?.();if(!B&&D.getMode()?.key==="copy"){const F=y.getItem().getCoords(),A=t.getSelectedRanges().getCoords();let _=!1;if(!_&&F&&A&&y.getItem().getSource?.()===t)for(let G=0;!_&&G<A.length;G++)_=ue.CoordUtils.isRangesIntersect(F,A[G]);B=_}B&&D.setMode(null),e?.()?.focus(),l?.(y,M)}});o.useMemo(()=>{const y=e;if(!i)return;const M=[new r.Command("pasteValues",y,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
|
|
19
|
+
All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){N(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),C=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(He,!0),u},[a,He]),[Ue,Qe]=o.useState(!1),[$e,J]=o.useState(!1);o.useEffect(()=>{if(I.current!==t||!h)return;const u=h.getCoords(),T=t.getTables().search({address:u[0]});F(U=>ue.CommonUtils.isEqualArrays(U,T)?U:T),g&&T[0]&&ue.CoordUtils.isCellWithinRange(g,T[0].getRange().getCoords())?re(T[0]??null):re(null);const E=t.getSelectedRanges(),b=E.getMerges().length>0,L=E.isOverlapping();let v=!0;for(let U=0;v&&U<u.length;U++)v=ue.CoordUtils.isSingleCell(u[U]);J(L),Qe(T.length===0&&!L&&(b||!v))},[Ee,h,t]),r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),T=w.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>T}).updateCallback(()=>T?void w.setMode(null):C.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",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`}}))}},[w,Fe,a]),tt(t.getView(),{onFreezeSplitChange:()=>{Oe()}}),tt(t.getSelection(),{onChange:()=>{_()}});const Ie=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??Rn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:Rn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Ve=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{W(u)},darkMode:i.darkMode,quickBorder:z,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Ve()},[z]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!G().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:u||!G().getHyperlink()});const T=G().getHyperlink()?"Edit":"Insert",E="Link";C.getCommand("updateHyperlink").update({label:()=>(G().getHyperlink(),`${T} ${E}`),scopedLabels:{contextMenu:`${T} ${E}…`,insert:`${E}…`,hyperlink:`${T}…`},disabled:u})},[G()?.getHyperlink(),Fe]),o.useEffect(()=>{const u=G().getComments(),T=()=>u?"Edit":"Insert",E=()=>u?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${T()} ${E()}`,scopedLabels:{contextMenu:`${T()} ${E()}…`,insert:`${E()}…`}})},[G()?.getComments(),Fe]),tt(t,{onViewChange:()=>{const u=t.getView();C.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),Ie()},onTabColorChange:()=>{Ie()},onMergesChange:()=>{Oe()},onMovablesChange:()=>{Oe()},onTablesChange:()=>{Oe()},onProtectionChange:()=>{Oe(),ve()},onStyleChange:()=>{Ie(),Ve(),Oe()}}),o.useEffect(()=>{Ie(),Ve()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),T=O.length>0&&!H||u,E=Te(H),b={context:E};C.getCommand("editTable").update(b),C.getCommand("deleteTable").update(b),C.getCommand("convertTableToRange").update(b);const L={context:E,disabled:T};C.getCommand("formatTableStyle").update({label:H?"Apply Table Style":"Format As Table",...L}),C.getCommand("formatTableStyleClearCellStyles").update(L),C.getCommand("deleteTableStyle").update(L),C.getCommand("convertTableToRange").update(L),C.getCommand("insertTable").update({disabled:T||O.length>0});const v={context:E,disabled:T||O.length===0};C.getCommand("tableHeaderRowToggle").update(v),C.getCommand("tableTotalRowToggle").update(v),C.getCommand("autoFilterToggle").update(v),C.getCommand("formatTableStyleClearTableStyle").update({...v,disabled:v.disabled||!H||H.getStyleOptions().name===null})},[H,O,Fe]),o.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),C.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),C.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),C.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),C.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),C.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),C.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),C.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),C.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})})},[t]),o.useEffect(()=>{const u=t.getView().getFreezePanes(),T=()=>u.coords.rowIndex!==0,E=()=>u.coords.colIndex!==0,b=()=>u.coords.rowIndex!==0||u.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{b()?t.getView().setFreezePanes(null):b()?E()?t.getView().setFreezePanes({coords:{rowIndex:g.rowIndex}}):T()&&t.getView().setFreezePanes({coords:{colIndex:g.colIndex}}):t.getView().setFreezePanes({coords:g})}).update({state:b,disabled:()=>!g||!b()&&g.rowIndex===0&&g.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:T()?0:g.rowIndex}})}).update({state:T,disabled:()=>!g||!T()&&g.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:E()?0:g.colIndex}})}).update({state:E,disabled:()=>!g||!E()&&g.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!b()})},[Ee,g,t,i]);const ke=G().getStyle(),ze=ke.getFont(),Ae=ke.getAlignment(),k=Ae.getHorizontal(),oe=Ae.getVertical(),j=Ae.getOverflow(),Y=Ae.getRotation();return o.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>G().getStyle(!0).getNamed(),bodyStyle:Me,createTemporaryCell:Ne=>t.createTemporaryCell(Ne)})}),C.getCommand("formatFillColor").update({state:()=>{let Ne=null;const Xe=ke.getFill();return Xe?.getType()===s.IFill.Type.Solid?Ne=Xe.getColor():Xe?.getType()===s.IFill.Type.Gradient?Ne=Xe.getStops()?.[0]?.getColor():Xe?.getType()===s.IFill.Type.Pattern&&(Ne=Xe.getBackground()),Ne},context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{y(Xe??Rn)},darkMode:i.darkMode,quickColor:K,autoColor:Rn,schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>ze.toJSON()?.fill?ze.getFill():null,context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{R(Xe)},darkMode:i.darkMode,quickColor:B,autoColor:Ne.getNormal().getFont().getFill(),schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>ke.getNumberFormat(),context:()=>G}),C.getCommand("formatNumberDialog").update({state:()=>ke.getNumberFormat(),context:()=>G}),C.getCommand("formatFontFamily").update({state:()=>ze.getFamily()}),C.getCommand("formatFontSize").update({state:()=>ze.getSize()});const u=function(){const Ne=ze.getWeight()||0;return!isNaN(Ne)&&Ne>500};C.getCommand("formatBoldToggle").updateCallback(function(){V(this,{font:{weight:u()?400:700}})}).update({state:u});const T=function(){return ze.getStyle()===s.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){V(this,{font:{style:T()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:T}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){V(this,{font:{strike:!ze.getStrike()}})}).update({state:ze.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const E=()=>j===s.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){V(this,{alignment:{overflow:(E(),s.ITextFrame.Overflow.Visible)}})}).update({state:E});const b=()=>j===s.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){V(this,{alignment:{overflow:b()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:b});const L=function(){return j===s.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){V(this,{alignment:{overflow:L()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:L});const v=function(){return j===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){V(this,{alignment:{overflow:v()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:v});const U=function(){return j===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){V(this,{alignment:{overflow:U()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:U,disabled:!0});const Z=function(){return oe===s.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){V(this,{alignment:{vertical:Z()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:Z});const ee=function(){return oe===s.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){V(this,{alignment:{vertical:ee()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:ee});const le=function(){return oe===s.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){V(this,{alignment:{vertical:(le(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:le});const ie=function(){return oe===s.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:ie()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:ie});const se=function(){return oe===s.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:se()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:se});const Ce=function(){return k===s.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){V(this,{alignment:{horizontal:Ce()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:Ce});const he=function(){return k===s.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){V(this,{alignment:{horizontal:he()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:he});const me=function(){return k===s.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Ne={alignment:{horizontal:me()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};V(this,Ne)}).update({state:me});const xe=function(){return k===s.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const Ne={alignment:{horizontal:xe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};V(this,Ne)}).update({state:xe});const Le=function(){return k===s.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){V(this,{alignment:{horizontal:Le()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Le});const De=function(){return k===s.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){V(this,{alignment:{horizontal:De()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:De});const We=function(){return k===s.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){V(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const je=!t.getProtection().isFormatCellsAllowed(),Ge=k===s.ITextFrame.HorizontalAlignment.CenterContinuous||k===s.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(Ne){V(this,{alignment:{rotation:0}})}).update({disabled:je||Ge,state:Y===0}),C.getCommand("formatTextRotate45").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?45:0}})}).update({disabled:je||Ge,state:Y===45}),C.getCommand("formatTextRotate90").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?90:0}})}).update({disabled:je||Ge,state:Y===90}),C.getCommand("formatTextRotate270").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?270:0}})}).update({disabled:je||Ge,state:Y===270}),C.getCommand("formatTextRotate315").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?315:0}})}).update({disabled:je||Ge,state:Y===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne}})}).update({disabled:je||Ge,state:Y??0})},[ke,t,i,K,B]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),T=t.getSelectedRanges().getMerges().length>0,E=async(_e,rt)=>{P(rt,async vt=>{const yt=async(gt=!1)=>{const lt=await Promise.resolve(d?.showBusy?.(rt.label()));try{const Tt=vt.getSelectedRanges();if(Tt.merge({orientations:_e,discardMultipleValues:gt}),_e===s.IRange.Orientations.Both){const Lt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};Tt.updateStyle(Lt)}}catch(Tt){throw Tt}finally{lt?.()}};let Ct;try{await yt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;Ct=!0}if(Ct&&d?.showOptions){if(await d?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await yt(!0)}},void 0,void 0,!1)},b=_e=>{P(_e,async rt=>{try{const vt=rt.getSelectedRanges();vt.unmerge();const yt={alignment:{horizontal:null}};vt.updateStyle(yt)}catch(vt){throw vt}})};C.getCommand("mergeToggle").updateCallback(function(){ue.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(T?b(this):E(s.IRange.Orientations.Both,this))}).update({state:T,disabled:!Ue||u}),C.getCommand("mergeHorizontal").updateCallback(function(){E(s.IRange.Orientations.Column,this)}).update({disabled:!Ue||u}),C.getCommand("mergeVertical").updateCallback(function(){E(s.IRange.Orientations.Row,this)}).update({disabled:!Ue}),C.getCommand("unmerge").updateCallback(function(){b(this)}).update({disabled:!T||!Ue||u});const L={disabled:u};C.getCommand("hideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(L),C.getCommand("hideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(L),C.getCommand("unhideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(L),C.getCommand("unhideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(L),C.getCommand("autoFitRows").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(L),C.getCommand("autoFitColumns").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(L);let v=!1,U=0,Z=!1,ee=!1,le=0,ie=!1;!h||u||$e||(v=h.isEntireColumnsAny(),v&&!h.isEntireColumns()?Z=!0:U=h.getColumnCount(),ee=h.isEntireRowsAny(),ee&&!h.isEntireRows()?ie=!0:le=h.getRowCount());const se={disabled:u||h&&h.getCount()!==1};C.getCommand("sortAscending").update(se),C.getCommand("sortDescending").update(se);const Ce={disabled:v||ee||u||$e},he=v||u||$e||ie;he&&(U=1);const me=ee||u||$e||Z;me&&(le=1);let xe="",Le="",De="",We="",je="",Ge="",Ne="",Xe="",it="";U>1&&(Ge=Le=U+" ",Ne=De="s"),le>1&&(Xe=We=le+" ",it=je="s"),w.getMode()?.key==="copy"?(xe=We=Le="Copied ",De=je="s"):w.getMode()?.key==="cut"&&(xe=We=Le="Cut ",De=je="s");let pt="",wt="";if(h){const _e=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;pt=` (${_e?"Shift Right":"Shift Down"})`,wt=` (${_e?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${wt}`})}C.getCommand("insertCells").update({label:`Insert ${xe}Cells${pt}`,scopedLabels:{insertCells:`${xe}At Selection`}}),C.getCommand("insertCellsShiftRight").update(Ce),C.getCommand("insertCellsShiftDown").update(Ce),C.getCommand("deleteCellsShiftUp").update(Ce),C.getCommand("deleteCellsShiftLeft").update(Ce),C.getCommand("insertRows").update({label:`Insert ${We}Row${je}`,scopedLabels:{insertCells:`${We}Row${je}`},disabled:me}),C.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${je} Below`,disabled:me}),C.getCommand("insertColumns").update({label:`Insert ${Le}Column${De}`,scopedLabels:{insertCells:`${Le}Column${De}`},disabled:he}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Le}Column${De} After`,disabled:he}),C.getCommand("deleteRows").update({label:`Delete ${Xe}Row${it}`,scopedLabels:{deleteCells:`${Xe}Row${it}`},disabled:me}),C.getCommand("deleteColumns").update({label:`Delete ${Ge}Column${Ne}`,scopedLabels:{deleteCells:`${Ge}Column${Ne}`},disabled:he})},[Ee,Ue,$e,h,w,d,Fe]),o.useEffect(()=>{const u=t.getProtection(),T=t.getProtection().isLocked(),E=!u.isFormatCellsAllowed(),b={disabled:E};C.getCommand("protectionSheetToggle").updateCallback(async(U,Z)=>{let ee=null;try{if(T){let le=null;if(u.hasPassword()){const ie=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ie.option!=="Unprotect")return;le=ie.input}ee=await Promise.resolve(d?.showBusy?.(Z.label())),await u.unlock(le)}else ee=await Promise.resolve(d?.showBusy?.(Z.label())),await u.lock();ee?.()}catch(le){ee?.(),d?.showError?.(le)}}).update({state:T,label:()=>T?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:T?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(b),C.getCommand("sortAscending").update(b),C.getCommand("sortDescending").update(b),C.getCommand("sortCustom")?.update(b),C.getCommand("updateComments").update(b),C.getCommand("deleteComments").update(b),C.getCommand("insertChart")?.update(b),C.getCommand("insertImageFromFile").update(b),C.getCommand("insertImageFromURL").update(b),C.getCommand("formatBorder").update(b),C.getCommand("formatFillColor").update(b),C.getCommand("formatFontColor").update(b),C.getCommand("formatBoldToggle").update(b),C.getCommand("formatItalicToggle").update(b),C.getCommand("formatUnderlinedToggle").update(b),C.getCommand("formatStrikeThroughToggle").update(b),C.getCommand("formatSuperscriptToggle").update(b),C.getCommand("formatSubscriptToggle").update(b),C.getCommand("formatAlignTopToggle").update(b),C.getCommand("formatTextOverflowVisibleToggle").update(b),C.getCommand("formatTextOverflowWrapToggle").update(b),C.getCommand("formatTextOverflowClipToggle").update(b),C.getCommand("formatTextOverflowShrinkToggle").update(b),C.getCommand("formatAlignMiddleToggle").update(b),C.getCommand("formatAlignBottomToggle").update(b),C.getCommand("formatAlignDistributedVerticalToggle").update(b),C.getCommand("formatAlignJustifyVerticalToggle").update(b),C.getCommand("formatAlignLeftToggle").update(b),C.getCommand("formatAlignCenterToggle").update(b),C.getCommand("formatAlignRightToggle").update(b),C.getCommand("formatAlignJustifyToggle").update(b),C.getCommand("formatAlignCenterContinuousToggle").update(b),C.getCommand("formatAlignDistributedHorizontalToggle").update(b),C.getCommand("formatAlignFillToggle").update(b),C.getCommand("formatFontSizeIncrease").update(b),C.getCommand("formatFontSizeDecrease").update(b),C.getCommand("formatFontFamily").update(b),C.getCommand("formatFontSize").update(b),C.getCommand("formatNumberFormat").update(b),C.getCommand("formatNumberFormatGeneralStyle").update(b),C.getCommand("formatNumberFormatNumberStyle").update(b),C.getCommand("formatNumberFormatTimeStyle").update(b),C.getCommand("formatNumberFormatDateStyle").update(b),C.getCommand("formatNumberFormatAccountingStyle").update(b),C.getCommand("formatNumberFormatPercentStyle").update(b),C.getCommand("formatNumberFormatScientificStyle").update(b),C.getCommand("formatNumberFormatCommaStyle").update(b),C.getCommand("formatNumberFormatIncreaseDecimal").update(b),C.getCommand("formatNumberFormatDecreaseDecimal").update(b),C.getCommand("hideColumns").update(b),C.getCommand("unhideColumns").update(b),C.getCommand("hideRows").update(b),C.getCommand("unhideRows").update(b),C.getCommand("quickFormulaSum").update(b),C.getCommand("quickFormulaAverage").update(b),C.getCommand("quickFormulaCount").update(b),C.getCommand("quickFormulaMax").update(b),C.getCommand("quickFormulaMin").update(b),C.getCommand("startEditCurrentTime").update(b),C.getCommand("startEditCurrentDate").update(b),C.getCommand("startEditValueAbove").update(b),C.getCommand("fillDown").update(b),C.getCommand("fillRight").update(b),C.getCommand("fillUp").update(b),C.getCommand("fillLeft").update(b),C.getCommand("formatCellStyle").update(b),C.getCommand("formatTableStyle").update(b),C.getCommand("formatPainterToggle").update(b),C.getCommand("formatBorderAddOutline").update(b),C.getCommand("formatBorderClearOutline").update(b),C.getCommand("formatIndentDecrease").update(b),C.getCommand("formatIndentIncrease").update(b),C.getCommand("clearContents").update(b),C.getCommand("clearFormats").update(b),C.getCommand("clearAll").update(b),C.getCommand("clearComments").update(b),C.getCommand("clearHyperlinks").update(b),C.getCommand("autoFilterClear").update(b),C.getCommand("autoFilterReapply").update(b);const L=k===s.ITextFrame.HorizontalAlignment.CenterContinuous||k===s.ITextFrame.HorizontalAlignment.Fill,v={disabled:E||L};C.getCommand("formatTextRotate0").update(v),C.getCommand("formatTextRotate45").update(v),C.getCommand("formatTextRotate90").update(v),C.getCommand("formatTextRotate270").update(v),C.getCommand("formatTextRotate315").update(v),C.getCommand("formatTextRotateCustom").update(v),C.getCommand("formatTextRotateVertical").update(v)},[Ee]),C}var Do,zo;(function(){if(zo)return Do;zo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof rn=="object"&&rn&&rn.Object===Object&&rn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),p=Object.prototype.toString,g=Math.max,q=Math.min,h=function(){return m.Date.now()};function f(S){var D=typeof S;return!!S&&(D=="object"||D=="function")}function I(S){if(typeof S=="number")return S;if(function(W){return typeof W=="symbol"||function(K){return!!K&&typeof K=="object"}(W)&&p.call(W)=="[object Symbol]"}(S))return NaN;if(f(S)){var D=typeof S.valueOf=="function"?S.valueOf():S;S=f(D)?D+"":D}if(typeof S!="string")return S===0?S:+S;S=S.replace(e,"");var z=n.test(S);return z||i.test(S)?a(S.slice(2),z?2:8):t.test(S)?NaN:+S}Do=function(S,D,z){var W,K,y,B,R,w,M=0,O=!1,F=!1,A=!0;if(typeof S!="function")throw new TypeError("Expected a function");function _(te){var N=W,x=K;return W=K=void 0,M=te,B=S.apply(x,N)}function G(te){var N=te-w;return w===void 0||N>=D||N<0||F&&te-M>=y}function P(){var te=h();if(G(te))return V(te);R=setTimeout(P,function(N){var x=D-(N-w);return F?q(x,y-(N-M)):x}(te))}function V(te){return R=void 0,A&&W?_(te):(W=K=void 0,B)}function $(){var te=h(),N=G(te);if(W=arguments,K=this,w=te,N){if(R===void 0)return function(x){return M=x,R=setTimeout(P,D),O?_(x):B}(w);if(F)return R=setTimeout(P,D),_(w)}return R===void 0&&(R=setTimeout(P,D)),B}return D=I(D)||0,f(z)&&(O=!!z.leading,y=(F="maxWait"in z)?g(I(z.maxWait)||0,D):y,A="trailing"in z?!!z.trailing:A),$.cancel=function(){R!==void 0&&clearTimeout(R),M=0,W=w=K=R=void 0},$.flush=function(){return R===void 0?B:V(h())},$}})();var No,Lo,Oo={exports:{}},eo={};Lo||(Lo=1,Oo.exports=function(){if(No)return eo;No=1;var e=o,t=typeof Object.is=="function"?Object.is:function(p,g){return p===g&&(p!==0||1/p==1/g)||p!=p&&g!=g},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(p){var g=p.getSnapshot;p=p.value;try{var q=g();return!t(p,q)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(p,g){return g()}:function(p,g){var q=g(),h=n({inst:{value:q,getSnapshot:g}}),f=h[0].inst,I=h[1];return a(function(){f.value=q,f.getSnapshot=g,d(f)&&I({inst:f})},[p,q,g]),i(function(){return d(f)&&I({inst:f}),p(function(){d(f)&&I({inst:f})})},[p]),l(q),q};return eo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,eo}()),Oo.exports;var jo,Bo,on={exports:{}},Ut={exports:{}},Il=Ut.exports;function Vo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Bo)return on.exports;Bo=1;for(var e=(jo||(jo=1,function(){var h,f,I,S,D,z;typeof performance<"u"&&performance!==null&&performance.now?Ut.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Ut.exports=function(){return(h()-D)/1e6},f=process.hrtime,S=(h=function(){var W;return 1e9*(W=f())[0]+W[1]})(),z=1e9*process.uptime(),D=S-z):Date.now?(Ut.exports=function(){return Date.now()-I},I=Date.now()):(Ut.exports=function(){return new Date().getTime()-I},I=new Date().getTime())}.call(Il)),Ut.exports),t=typeof window>"u"?rn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],d=0;!a&&d<n.length;d++)a=t[n[d]+"Request"+i],l=t[n[d]+"Cancel"+i]||t[n[d]+"CancelRequest"+i];if(!a||!l){var m=0,p=0,g=[],q=1e3/60;a=function(h){if(g.length===0){var f=e(),I=Math.max(0,q-(f-m));m=I+f,setTimeout(function(){var S=g.slice(0);g.length=0;for(var D=0;D<S.length;D++)if(!S[D].cancelled)try{S[D].callback(m)}catch(z){setTimeout(function(){throw z},0)}},Math.round(I))}return g.push({handle:++p,callback:h,cancelled:!1}),p},l=function(h){for(var f=0;f<g.length;f++)g[f].handle===h&&(g[f].cancelled=!0)}}on.exports=function(h){return a.call(t,h)},on.exports.cancel=function(){l.apply(t,arguments)},on.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},on.exports})();const vo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:p=!1,offset:g=0,totalSize:q=0,viewportSize:h=0,...f}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[I]=zt(),S=r.useCallbackRef(l,[l]),D=r.useCallbackRef(d,[d]),z=(W=I,K=t,o.useMemo(()=>W===null&&K===null?null:X=>{Vo(W,X),Vo(K,X)},[W,K]));var W,K;const[y,B]=o.useState(()=>{const X=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?X.top:X.left}),R=()=>{const X=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?X.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(X.coords.rowIndex)-X.topLeft.top,scroll:X.topLeft.top}:X.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(X.coords.colIndex)-X.topLeft.left,scroll:X.topLeft.left}},[w,M]=o.useState(R),[O,F]=o.useState(null),[A,_]=o.useState(!1),G=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),P=()=>{const X=a.getUsedRange()?.getCoords()??ue.CoordUtils.EmptyRange,ae=a.getSelection().getCoords().cell;return{colIndex:Math.max(X.colEnd,ae.colIndex),rowIndex:Math.max(X.rowEnd,ae.rowIndex)}},[V,$]=o.useState(P),te=V?(i===r.ScrollbarOrientation.Vertical?V.rowIndex:V.colIndex)+1:0,N=()=>{const X=P();ue.CoordUtils.isEqualCells(V,X)||$(X)};tt(a.getView(),{onFreezeSplitChange:()=>{M(R)}}),tt(a.getSelection(),{onChange:N}),tt(a,{onUsedRangeChange:N}),o.useEffect(()=>{$(P())},[a]),o.useEffect(()=>{if(!O)return A&&D?.(),void _(!1);const X=G.getTextAt(G.findIndex(y/(a.getView().getZoomScale()/100)+w.scroll+w.shift));_(!0),S?.({...O,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+X})},[g,y,w,i,O,G,A,a]);const x=r.useCallbackRef((X,ae,Me)=>{B(X);const Te=X+w.scroll,fe=ae+w.shift,Be=Me+w.shift+w.scroll;m?.(Te,fe,Be)},[m,w]),H=g-w.scroll,re=h-w.shift,ye=q-(w.shift+w.scroll),ne=G.findOffset(te)*(a.getView().getZoomScale()/100)-(w.scroll+w.shift);return c.jsx(r.VirtualScrollbar,{ref:z,style:n,offset:H,viewportSize:re,totalSize:ye,orientation:i,showCustomScrollButtons:p,onMouseDown:X=>{F({anchor:{x:X.clientX,y:X.clientY}}),X.preventDefault()},onScrollOffset:x,onMouseOut:()=>{F(null)},onMouseUp:()=>{F(null)},minSize:ne,...f})}));vo.displayName="SheetScrollbar";const Po=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},Ho=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:p,headerText:g,freezeStart:q,gridStyle:h,verticalPadding:f,horizontalPadding:I,onSheetContextMenu:S,onResizeHeadersStart:D,onResizeHeaders:z,onResizeHeadersEnd:W,onResizeHeadersDown:K,onResizeHeadersUp:y,scrollPoint:B,onSelectionStart:R,onSelectionEnd:w}=e,M=o.useMemo(()=>n.getOrientation(),[n]),O=o.useRef(null),[F,A]=o.useReducer(j=>j+1,0),[_,G]=o.useReducer(j=>j+1,0),P=n?.getSheet(),V=o.useRef(!1);o.useLayoutEffect(()=>{V.current=!0},[n]);const $=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),te=o.useMemo(()=>{const j=M===s.IRange.Orientation.Column;return{left:j?B.left:0,top:j?0:B.top}},[B]),[N,x]=o.useState(P?.getView().getZoomScale()/100),[H,re]=o.useState(null);tt(n,{onSizesChange:j=>{x(P?.getView().getZoomScale()/100),Fe(de())}});const ye=o.useCallback(()=>{O.current?.invalidate(),G()},[]),ne=o.useCallback(ue.CommonUtils.debounce(()=>{ye()},10),[]),[X,ae]=o.useState(null);tt(n.getSheet(),{onSelectionChange(){ae(P?.getSelection().getCoords()),ne()},onProtectionChange(){ye()},onViewChange(){ne()}}),o.useLayoutEffect(()=>{Fe(de())},[M,N,d]),o.useLayoutEffect(()=>{re(null),x(n?.getSheet().getView().getZoomScale()/100),Fe(de())},[n]);const Me=o.useCallback(j=>n.at(j)?.isHidden()||n.at(j)?.getSize()===0,[n]),Te=o.useCallback((j,Y)=>n.hiddenHeadersAt(j,Y),[Me]),fe=r.useCallbackRef(j=>n.isSelected(j),[n]),Be=r.useCallbackRef(j=>n.isSelectedAll(j),[n]),pe=o.useCallback(()=>n.getMinSize(),[n]),Pe=o.useCallback(()=>n.getMaxSize(),[n]),Se=r.useCallbackRef((j,Y,u)=>{Y/=N;const T={size:Y=Math.max(pe(),Math.min(ue.CommonUtils.roundAccurately(Y,pe()),Pe())),hidden:!1},E=[];if(Y<=0&&(T.hidden=!0,T.size=u),E.push({address:{min:j,max:j},update:T}),Y<0){const b=M===s.IRange.Orientation.Column,L=b?be.getColOffset:be.getRowOffset,v=b?be.getColIndex:be.getRowIndex,U=L(j);let Z=v(U+Y);const ee=L(Z);ee===U+Y?Z--:E.push({address:{min:Z,max:Z},update:{size:U-ee+Y}}),j-Z>1&&E.push({address:{min:Z+1,max:j-1},update:{hidden:!0}})}n.updateHeaderPairs(E),z?.(j,Y,u)},[F,n,N,z]),ge=r.useCallbackRef((j,Y,u)=>{const T=M===s.IRange.Orientation.Column;let E=null,b={min:j,max:j};if(n.isSelectedAll(j)){const L=n.getSelectedRuns();L.length>1?E="Resize "+(T?"Columns":"Rows"):b=L[0];const v={hidden:Y<=0,size:(Y<=0?u:Y)/N};n.updateHeaderPairs(Po(L,v,j))}if(b){const L=b.max-b.min+1;let v;v=L===1?n.getRange(b).at(0).getDisplayText():n.getRange(b).toString(),E=`Resize ${T?"Column":"Row"}${L>1?"s":""} '${v}'`}W?.(j,Y,E)},[F,n,W]),ce=r.useCallbackRef((j,Y)=>{const u=M===s.IRange.Orientation.Column;D(j,Y,`Resize ${u?"Column":"Row"}(s)`)},[D]),we=r.useCallbackRef(j=>{let Y=!1;const u=M===s.IRange.Orientation.Column,T=n.getSheet().getEntireRange().getCoords(),E=[],b=n.getSelectedRuns(),L=v=>{let U;U=u?{colStart:v.min,rowStart:T.rowStart,colEnd:v.max,rowEnd:T.rowEnd}:{colStart:T.colStart,rowStart:v.min,colEnd:T.colEnd,rowEnd:v.max},E.push(U)};for(let v=0;v<b.length;v++){const U=b[v];U.value.isSelectedAll&&(U.min<=j&&U.max>=j&&(Y=!0),L(U))}if(Y||L({min:j,max:j}),n.getSheet().getRanges(E).autoFit({orientations:u?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),Me(j)){const v={hidden:null},U=Po(b,v);Y||U.push({address:j,update:v}),n.updateHeaderPairs(U)}W?.(j,null,"Resize Column(s)")},[F,n,W,Me]),de=()=>{const j=M===s.IRange.Orientation.Column;return{getColOffset:Y=>j?n.findOffset(Y):Y===0?0:d/N,getColIndex:Y=>j?n.findIndex(Y):0,getRowOffset:Y=>j?Y===0?0:d/N:n.findOffset(Y),getRowIndex:Y=>j?0:n.findIndex(Y)}},[be,Fe]=o.useState(()=>de()),ve=o.useCallback((j,Y)=>j.nativeEvent.which!==r.MouseButtonCodes.Right||!Be(M===s.IRange.Orientation.Column?Y.colIndex:Y.rowIndex),[M,Be]),Ee=r.useCallbackRef(j=>{a.focusSheet()},[a]),Oe=r.useCallbackRef(j=>{P?.getSelection().updateCoords(j)},[P]),{...He}=dt.useSelection({gridRef:i,commands:null,layout:be,selection:X,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Oe,canSelectionSpanMergedCells:j=>{const Y=P.getRange(j);return Y.isEntireColumns()||Y.isEntireRows()}}),C=r.useCallbackRef(()=>{R?.();const j=P?.getSelection();j&&j.setAdjusting(j.getCoords())},[P,R]),Ue=r.useCallbackRef(async()=>{P?.getSelection().setAdjusting(null),w?.()},[P,w]),{...Qe}=dt.useHeaderSelection({orientation:M,headerCount:$,gridRef:O,gridMainRef:i,newSelection:He?.newSelection,modifySelection:He?.modifySelection,appendSelection:He?.appendSelection,clearSelections:He?.clearSelections,pointerDownInterceptor:ve,onPointerUp:Ee,onDragStart:C,onDragEnd:Ue}),$e=h.selection?.strokeFill;o.useEffect(()=>{if(!O.current)return void re(null);const j=M===s.IRange.Orientation.Column,Y=n.getSelectedRuns(),u=n.isProtected()?null:Se,T=(b,L,v)=>{if(v)return j?c.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(v.x-h.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(v.width+h.headerSelection.strokeWidth+1,!0)}px`,height:d+h.headerSelection.strokeWidth-.5+"px"}},b):c.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(v.y-h.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,width:d+h.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(v.height+h.headerSelection.strokeWidth+1,!0)}px`}},b)},E=(b,L,v)=>{const U={x:0,y:0,width:0,height:0};if(j){const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:b,colEnd:Math.min($,L)}),dt.SELECTION_CLIP_INSETS);if(!Z)return;U.x=Z.x,U.width=Z.width}else{const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:b,rowEnd:Math.min($,L),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!Z)return;U.y=Z.y,U.height=Z.height}return{x:U.x,y:U.y,width:U.width,height:U.height}};re([b=>{const L=[];let v=null,U=j?b.getVisibleColumns():b.getVisibleRows();const Z=j?b.getTotalRangeCoords().colStart:b.getTotalRangeCoords().rowStart;U.length>0&&U[0]>Z&&(U=[U[0]-1,...U]);let ee=[];const le=[];for(let me=0;me<U.length;me++){const xe=U[me],Le=me<U.length-1?U[me+1]:xe+Te(xe+1,!1)+1,De=xe+1!==Le;if(!v||v.max<xe)if(Y.length>0&&Y[Y.length-1].max>=xe){const Ge=ue.CommonUtils.findEqualOrGreater(Y,xe,Ne=>Ne.max);v=Y[Ge]}else v=null;let We=!1,je=!1;if(v?.value&&(v.min<=xe||v.min<=Le&&!De)&&(We=!0,je=v.value.isSelectedAll),xe===Z){let Ge=!1,Ne=!1;v?.value&&v.min<=xe&&(Ge=!0,Ne=v.value.isSelectedAll),xe>0&&le.push({index:xe-1,isNextHidden:De,isSelected:Ge,isSelectedAll:Ne,disabledResize:!0})}if(je&&ee.push(le.length),le.push({index:xe,isHidden:me===0&&Te(xe,!1)>0,isNextHidden:De,isSelected:We,isSelectedAll:je,onDividerMouseDown:K,onDividerResizeStart:ce,onDividerResize:u,onDividerMouseUp:y,onDividerResizeEnd:ge,onDividerAutoFit:we}),De){let Ge=!1,Ne=!1;if(v&&v.min>=xe&&v.max<=Le-1&&v.value.isSelectedAll&&ee.push(le.length),!(v?.value&&v.max>=Le))if(Y.length>0&&Y[Y.length-1].max>=Le){const Xe=ue.CommonUtils.findEqualOrGreater(Y,Le,it=>it.max);v=Y[Xe]}else v=null;v?.value&&v.min<=Le&&(Ge=v.value.isSelected,Ne=v.value.isSelectedAll),Le>0&&le.push({index:Le-1,isHidden:!0,isSelected:Ge,isSelectedAll:Ne,onDividerMouseDown:K,onDividerResizeStart:ce,onDividerResize:u,onDividerMouseUp:y,onDividerResizeEnd:ge,onDividerAutoFit:we})}}if(ee.length>0){let me=ee.length-1;if(ee.length>0){const De=le[ee[me]].index;let We=null;j?(We=b.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:De,colEnd:De}),We.x+We.width>b.getBounds().width&&(me-=1,me===0&&(me=-1))):(We=b.getRangeCoordsBounds({rowStart:De,rowEnd:De,colStart:0,colEnd:0}),We.y+We.height>b.getBounds().height&&(me-=1,me===0&&(me=-1)))}const xe=Y?.[Y.length-1],Le=b.getAnchor();if(Le==="t"||Le==="l"){const De=le[ee[Math.max(0,ee.length-1)]];De.showTouchDivider=xe&&xe.max<=De.index}else me>=0&&(le[ee[me]].showTouchDivider=!0)}const{header:ie,headerSelect:se,headerSelectAll:Ce,headerHover:he}=h??{};for(let me=0;me<le.length;me++)L.push(c.jsx(dt.HeaderDivider,{orientation:M,view:b,headerStyle:ie,headerStyleSelect:se,headerStyleSelectAll:Ce,headerStyleHover:he,disabled:n.isProtected(),...le[me]},`divider${me}`));return L},b=>{const L=[];for(let v=0;Y&&v<Y.length;v++)L.push(T(`selection:${b.getAnchor()}:${v}`,0,E(Y[v].min,Y[v].max,b)));return L}])},[_,!0,$e,h,be,$,q,F,N]),o.useEffect(()=>{O.current?.invalidate()},[F]);const J=r.useCallbackRef(j=>g?g(j):n.getTextAt(j),[g,n]),Ie=r.useCallbackRef(j=>{const{header:Y,headerSelect:u,headerSelectAll:T,headerHover:E}=h??{},{range:b,key:L,...v}=j;return c.jsx(dt.HeaderRenderer,{orientation:M,index:M===s.IRange.Orientation.Column?b.colStart:b.rowStart,isSelected:fe,isSelectedAll:Be,zoomScale:100*N,headerText:J,headerStyle:Y,headerStyleSelect:u,headerStyleSelectAll:T,headerStyleHover:E,verticalPadding:f,horizontalPadding:I,...v},L)},[F,$,h,N,n]),Ve=r.useEditMode(),ke=o.useMemo(()=>{const j="white",Y="black",u={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let T=M===s.IRange.Orientation.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='${Y}' fill='${j}'/%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='${Y}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Ve.getMode()?.key==="formatPainter"&&(T=`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='${Y}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),u.cursor=T}return u.backgroundColor=h?.header?.fill||"transparent",u},[M,F,Ve,h]),ze=r.useImperativeElement(t,()=>({scrollTo:j=>{O.current?.scrollTo(j)},forceRender:()=>{A()},getGridElement:()=>O.current}),[]),Ae=o.useCallback(j=>{Qe.onPointerDown(j)},[Qe]),k=o.useCallback(j=>{const Y=Qe.getCellCoordsFromClient(j.clientX,j.clientY);if(!Y||!S)return;const u=M===s.IRange.Orientation.Column;S({originalEvent:j,clientX:j.clientX,clientY:j.clientY,rowIndex:u?-1:Y.rowIndex,colIndex:u?Y.colIndex:-1}),j.stopPropagation(),j.preventDefault()},[Qe,S]),oe=o.useMemo(()=>{const j=M===s.IRange.Orientation.Column;return c.jsx("div",{ref:ze,children:c.jsx(dt.Grid,{className:"sheet-header",style:ke,ref:O,scrollPoint:te,columnCount:j?$:1,rowCount:j?1:$,width:j?m:d,height:j?d:p,freezeLeft:j?q:void 0,freezeTop:j?void 0:q,hiddenColumnsAt:j?Te:void 0,hiddenRowsAt:j?void 0:Te,showGridLines:!1,layout:be,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:k,onPointerDown:Ae,zoom:N,cellRenderer:Ie,overlays:H})})},[H,be,m,p,te,ke,_]);return o.useEffect(()=>{V.current=!1,O.current?.invalidate(),G()},[n,h]),oe})),El=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((g,q)=>g.getStyle().getBorder(),[]),{overlay:m}=po({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),p=m(n);return p&&n?p:null})),Fl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Al={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Dl={type:s.ICell.Content.Values},zl={fitDestination:!0,type:s.ICell.Content.Formats},Nl={fitDestination:!0,type:s.ICell.Content.Formulas},Ll={transpose:!0},Ol={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},qr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:p="rgb(33, 115, 70)",copyBackgroundColor:g="white",cutBackgroundColor:q="white",notifier:h,...f})=>{const I=r.useCallbackRef(d,[d]),S=o.useRef(null),D=r.useEditMode(),z=D.getMode(),W=o.useMemo(()=>({element:e,doCopy:w=>{const M=t.getSelectedRanges().getSnapshot(w);return new s.RangeClipboardItem(M)}}),[t,n,e]),K=o.useMemo(()=>({element:e,importFromExternal:async(w,M)=>{const O=new s.ExternalRangeClipboardItem(w,M,t.getStyles(),t.isDate1904());return await O.parse()?O:null},doPaste:async(w,M)=>{if(w?.getItemType()!=="range")return;M?.contentsOnly&&delete(M={...M,type:s.ICell.Content.Values}).contentsOnly;const O=t.getSelectedRange(),F=w.getItem(),A=F.getName();return await O.doBatch(async()=>{const _=await O.copyFrom(F,M);!_||_.isEntireRows()||_.isEntireColumns()||_.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(A?` ${A}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:y,...B}=r.useCopyPaste({...f,source:W,commands:i,target:K,notifier:h,onClipboardUpdate:w=>{const M=w?.getItemType()==="range"?w:null;if(M){const O=w.editMode?.(),F={...w?.isCut?.()?Al:Fl,...O,args:{isClipboard:!0,...O?.args},onModeChange:A=>{A?.args?.isClipboard||y.clear(!0),O?.onModeChange?.(A)}};D.setMode(F)}S.current=M,a?.(M)},onPaste:(w,M)=>{if(w?.getItemType()!=="range")return;let O=D.getMode()?.key==="cut"||w.isCut?.();if(!O&&D.getMode()?.key==="copy"){const F=w.getItem().getCoords(),A=t.getSelectedRanges().getCoords();let _=!1;if(!_&&F&&A&&w.getItem().getSource?.()===t)for(let G=0;!_&&G<A.length;G++)_=ue.CoordUtils.isRangesIntersect(F,A[G]);O=_}O&&D.setMode(null),e?.()?.focus(),l?.(w,M)}});o.useMemo(()=>{const w=e;if(!i)return;const M=[new r.Command("pasteValues",w,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
|
|
20
20
|
|
|
21
|
-
The formatting is not applied.`,shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",
|
|
21
|
+
The formatting is not applied.`,shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",w,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
|
|
22
22
|
|
|
23
|
-
The content is not applied.`}),new r.Command("pasteFormulas",y,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",y,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",y,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(M,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const y={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(M=>j.paste({...Dl,...M})).update(y),i.getCommand("pasteFormats").updateCallback((M,B)=>j.paste({...zl,description:B.label(),...M})).update(y),i.getCommand("pasteFormulas").updateCallback((M,B)=>j.paste({...Nl,description:B.label(),...M})).update(y),i.getCommand("pasteTranspose").updateCallback((M,B)=>j.paste({...Ll,description:B.label(),...M})).update(y),i.getCommand("pasteLinks").updateCallback((M,B)=>j.paste({...Ol,description:B.label(),...M})).update(y),i.getCommand("cut").update(y),i.getCommand("paste").update(y)},[t,i]);const R=o.useMemo(()=>{if(!z||!S.current)return;const y=z.key;if(y!=="copy"&&y!=="cut"&&y!=="formatPainter")return;const M=S.current.getItem();if(M.getSource()!==t)return;const B=S.current.isCut?.(),F=B?q:g,A=B?p:m,_=M.getCoords(),G=_?[_]:null;return G&&G.length!==0?P=>{const V=[];for(let $=0;$<G.length;$++){const te=G[$],N=P.toClipBounds(P.getRangeCoordsBounds(te,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);N&&(V.push(I({range:te,key:`copy-selection-background-${$}`,x:N.x,y:N.y,width:Math.max(N.width,0),height:Math.max(N.height,0),stroke:F,strokeWidth:2})),V.push(I({range:te,key:`copy-selection-foreground-${$}`,x:N.x+(N.width<=2?-1:0),y:N.y,width:Math.max(N.width,3),height:Math.max(N.height,3),stroke:A,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[z,t,n,m,g,p,q]);return{...j,clipboard:w,overlays:R}},jl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,p=l.body??{},g=a.getView(),{overlays:q}=qr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:p.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:p.fill,notifier:m});return tt(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),q&&n?q(n):null})),Bl="_sheet-selection_12wyx_5",Vl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Pl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Hl={key:"dragCopy",description:"Drag selection to copy cell contents."},Ul={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Uo=(e,t)=>t.ctrlKey&&t.shiftKey?Ul:t.ctrlKey?Hl:t.shiftKey?Pl:Vl,Kl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},$l=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:p,sheet:g,gridRef:q,gridStyle:h,isActive:f,editingCoords:I,...S}=e,D=n?.getBounds(),z=r.useCallbackRef(m,[m]),W=r.useCallbackRef(p,[p]),[K,w]=o.useState(()=>g?.getSelection().getCoords()),j=r.useCallbackRef(ge=>{ue.CoordUtils.isEqualSelectionCoords(ge,K)||g&&g.getSelection().updateCoords(ge)},[g,K]),R=r.useEditMode(),y=o.useRef(null),[M,B]=o.useState(g?.getProtection().isLocked()),[F,A]=o.useState(g?.getView().getMovableSelection().length>0),_=r.ReactUtils.detectIt().primaryInput==="touch",G=!_&&f,P=I!==null||F,V=r.useCallbackRef(ge=>{const ce=ue.CoordUtils.cellToRange(ge);if(g.isClosed())return ce;const we=g.getRange(ce,{excludeHidden:!0}).getMerges();return we.length===0?ce:we[0]},[g]),$=r.useCallbackRef((ge,ce,we,de,be,Fe)=>{const ve=g.getSelectedRange().getExtended(de,ge).getCoords();switch(de){case s.IRange.Direction.Up:return ve.rowStart;case s.IRange.Direction.Down:return ve.rowEnd;case s.IRange.Direction.Left:return ve.colStart;case s.IRange.Direction.Right:return ve.colEnd}},[g]),te=r.useCallbackRef(()=>{const ge=g.getUsedRange()?.getCoords(),ce=g.getRowHeaders().getUsedRange()?.getCoords(),we=g.getColumnHeaders().getUsedRange()?.getCoords();return{...ge,colEnd:Math.max(ge?.colEnd??0,we?.max??0),rowEnd:Math.max(ge?.rowEnd??0,ce?.max??0)}},[g]),N=r.useCallbackRef((ge,ce)=>g.getRowHeaders().hiddenHeadersAt(ge,ce),[g]),x=r.useCallbackRef((ge,ce)=>g.getColumnHeaders().hiddenHeadersAt(ge,ce),[g]),H=r.useCallbackRef(ge=>g.getRange(ge,{excludeHidden:!0}).getMerges(),[g]),re=r.useCallbackRef(ge=>{g?.getSelection().setAdjusting(ge)},[g]),ye=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),R.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),R.setMode(null))},[R,K,g,i]),ne=o.useMemo(()=>{const ge=R.getMode();return ge?.key==="cut"||ge?.key==="copy"},[R]);tt(g?.getView(),{onMovableSelectionChange:()=>{A(g.getView().getMovableSelection().length>0)}}),tt(g?.getSelection(),{onChange(ge){const ce=g.getSelection().getCoords();w(ce)}}),tt(g,{onProtectionChange:()=>{B(g.getProtection().isLocked())}});const{body:X={}}=h||{},ae=n.getLayout(),Me=!(G&&K.ranges.length<=1&&I===null&&!M&&(!R.getMode()||ne)),{cursor:Te,overlay:fe,onPointerDown:Be}=dt.useSelection({gridRef:q,commands:i,layout:ae,getCellCoordsAsRangeCoords:V,selection:K,fillHandleBorderColor:X.fill,selectionBackgroundColor:f?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:f?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:f?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:f?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Me,disableMoveDrag:_||!(f&&K.ranges.length<=1&&I===null&&!M),disableTouchSelection:P,onSelectionChange:j,onSelectionDragStart:re,onSelectionDragEnd:ye,onMoveDragStart:(ge,ce,we)=>{R.setMode(Uo(0,we))},onMoveDragUpdate:(ge,ce,we)=>{R.setMode(Uo(0,we))},onMoveDragEnd:(ge,ce)=>{R.setMode(null)},onMoveDragDone:async(ge,ce,we)=>{if(ue.CoordUtils.isEqualRanges(ge,ce))return;const de=g.getRange(ce);if(d?.showOptions){const Oe=de.getDifferences(ge);let He=!1;for(let C=0;!He&&C<Oe.getCount();C++)He=Oe.at(C).isContentful();if(He&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const be=!we.ctrlKey,Fe=we.shiftKey,ve=Fe?be?"Insert Moved Cells":"Insert Copied Cells":be?"Move Cells":"Copy Cells",Ee=await d?.showBusy?.(ve);try{const Oe=g.getRange(ge);await de.doBatch(async()=>{Fe?await de.insertFrom(ge,{isCut:be,undoRange:Oe}):await de.copyFrom(ge,{isCut:be,undoRange:Oe}),Oe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),de.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:ve,autoSelect:!0})}catch(Oe){d?.showError?.(Oe)}finally{Ee?.()}},contentfulCellFinder:$,hiddenRowsAt:N,hiddenColumnsAt:x,mergedRanges:H,getDataCoords:te,canSelectionSpanMergedCells:ge=>{const ce=g.getRange(ge);return ce.isEntireColumns()||ce.isEntireRows()},onFill:async(ge,ce)=>{const we="Auto Fill",de=await d?.showBusy?.(we);try{await g.doBatch(()=>{g.getRange(ge).autoFill(ce),g.getRange(ce).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:we,autoSelect:!0})}catch(be){d?.showError?.(be)}finally{y.current=null,de?.()}},onFillPreview:(ge,ce,we)=>{if(q.current&&z){R.setMode(Kl);try{y.current?.direction!==we&&(y.current=null,g.getRange(ge).autoFill(ce,{previewOnly:C=>{y.current={callback:C,direction:we}}}));const de=y.current?.callback?.(ce);if(!de||de.isEmpty())return;const be=de.toText();if(!be)return;const Fe=ue.CoordUtils.cellToRange(de.getCoords()),ve=n.getRelativePointFromClient(0,0);let Ee=0,Oe=0,He=r.ToolTipPlacement.Bottom;if(we===s.IRange.Direction.Down){Ee=ae.getColOffset(Fe.colEnd+1)-ve.x;const C=ae.getRowOffset(Fe.rowEnd),Ue=ae.getRowOffset(Fe.rowEnd+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Right){Oe=ae.getRowOffset(Fe.rowEnd+1)-ve.y;const C=ae.getColOffset(Fe.colEnd),Ue=ae.getColOffset(Fe.colEnd+1);Ee=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}else if(we===s.IRange.Direction.Up){Ee=ae.getColOffset(Fe.colEnd+1)-ve.x;const C=ae.getRowOffset(Fe.rowStart),Ue=ae.getRowOffset(Fe.rowStart+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Left){Oe=ae.getRowOffset(Fe.rowEnd+1)-ve.y;const C=ae.getColOffset(Fe.colStart),Ue=ae.getColOffset(Fe.colStart+1);Ee=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}z({anchor:{x:Ee,y:Oe},display:be,placement:He})}catch(de){d?.showError?.(de)}}},onFillDone:()=>{y.current=null,R.setMode(null),W?.()}}),pe=r.useCallbackRef(ge=>{Be(r.ReactUtils.createSyntheticEvent(ge))},[Be,I]);o.useEffect(()=>{const ge=n?.getStage();if(ge)return ge.addEventListener("pointerdown",pe),()=>{ge.removeEventListener("pointerdown",pe)}},[n?.getStage()]);const Pe=r.useImperativeElement(t,()=>({}),[]),Se=o.useRef(null);return c.jsx("div",{className:bt(a,"sheet-selection",Bl),style:{position:"absolute",width:D?.width,height:D?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Wt([Pe,Se]),...S,children:fe(n)})})),kn=Object.freeze({x:0,y:0,width:0,height:0}),Wl={fireOnModelChange:!1},Gl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:p,onUnFocus:g,isDragging:q,updateFrameBounds:h,dragStart:f,style:I,disabled:S,renderMovable:D,...z}=e,[W,K]=o.useState(kn),[w,j]=o.useState(null),[R,y]=o.useState(!1),M=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const F=a.getBounds();if(!F)return;const A=i.toViewBounds(F);K(A??kn),h(A??kn)},[i?.getBounds()]),tt(a,{onBoundsChange:F=>{const A=F.getBounds();if(!A)return;const _=i.toViewBounds(A);K(_??kn),h(_)},onSelectionChange:()=>{const F=ue.CommonUtils.hasFocus(M.current,!0);!R&&!F||a.isSelected()||g()}}),tt(a,{onRequestFocus:()=>ue.CommonUtils.whenFocus(M.current,!0)},Wl),o.useEffect(()=>{const F=M.current;return l(F),()=>{d(F)}},[]);const B=o.useMemo(()=>{if(!W)return null;let{width:F,height:A}=W;return D({view:i,movable:a,disabled:S,isDragging:q,style:{position:"relative",left:0,top:0,width:F,height:A},onHide:m,onShow:p})},[i,a,W.width,W.height,S,q]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Wt([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:W.x,top:W.y,width:W.width,height:W.height,...I},onMouseDown:async F=>{const A=F.shiftKey||F.ctrlKey,_=a.isSelected(),G=F.currentTarget;A&&_?a.unselect():(_&&!A||await a.select({addToSelection:A}),f(F.nativeEvent,G),G.focus())},onFocus:F=>{F.relatedTarget&&!w&&j(F.relatedTarget),y(!0)},onBlur:F=>{w&&!M?.current?.contains(F.relatedTarget)&&j(null),F.relatedTarget&&y(!1)},...z,children:B})})),_l="_movable-area_314c6_5",Sr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:p,disabled:g=!1,disableDrag:q=!1,disableResize:h=!1,className:f,style:I,renderDirections:S=["nw","n","ne","w","e","sw","s","se"],onFirstRender:D,...z}=e,W=n.getBounds(),K=r.useCallbackRef(D,[D]),w=r.useCallbackRef(m,[m]),j=r.useCallbackRef(p,[p]),[R,y]=o.useState([]),[M,B]=o.useState(!1),[F,A]=o.useState(!1),_=o.useRef(!0),G=o.useRef(new Map),P=o.useRef(new Map),V=o.useRef(new Map),$=o.useRef(new Map),te=o.useRef(new Map),N=o.useRef({onRequestFocus:J=>(ce(J),null)}),x=o.useRef(null),H=o.useRef(null),re=o.useRef(null),[ye,ne]=o.useReducer(J=>J+1,0);o.useLayoutEffect(()=>{ne()},[n,i]),tt(i,{onCollectionChange:()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Ie=te.current;Ie.forEach(ke=>{ke()}),Ie.clear();const Ve=N.current;for(let ke=0;ke<J.length;ke++){const ze=J[ke];if(ze.isClosed())continue;const Ae=ze.addListeners(Ve);Ie.set(ze,Ae)}ne()},onInvalidated:()=>{ne()}}),tt(a,{onMovableSelectionChange(J){ae(),ne()}});const X=o.useCallback((J,Ie)=>{const Ve=V.current.get(J);re.current&&(re.current.getTargets().forEach(ke=>{if(ke===Ve)return ke.style.left=Ie.x+"px",ke.style.top=Ie.y+"px",ke.style.width=Ie.width+"px",void(ke.style.height=Ie.height+"px")}),re.current.updateRect())},[]),ae=()=>{const J=[],Ie=a.getMovableSelection();Ie.forEach(Ve=>{const ke=V.current.get(Ve);ke&&Ie.indexOf(Ve)!==-1&&J.push(ke)}),y(Ve=>ue.CommonUtils.isEqualArrays(Ve,J)?Ve:J)},Me=o.useRef(null),Te=o.useMemo(()=>new Promise(J=>{Me.current=J}),[]),fe=o.useRef(null),Be=r.useCallbackRef(async(J,Ie)=>{fe.current=Ie,await(async()=>!(!await Te.then()||!re.current))()&&fe.current===Ie&&re.current.dragStart(J,Ie)},[R]),[pe,Pe]=o.useState(!1),Se=o.useRef(null),ge=o.useRef(null),ce=r.useCallbackRef(async(J=null)=>{if(J||(J=a.getMovableSelection()[0]),!J)return w?.(),!1;const Ie=V.current.get(J);Ie?(await ue.CommonUtils.whenFocus(Ie),Ie.focus(),ge.current=Ie,Se.current=null):Se.current=J},[a]);o.useEffect(()=>{pe&&R.length>0&&ge.current!==R[0]&&ce(),_.current&&(K?.(),_.current=!1)},[R]);const we=o.useMemo(()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(J.length===0&&G.current.size===0)return null;const Ie=(k,oe,O,Y=!0)=>{const u=k.isSelected(),T={tabIndex:O,view:n,movable:k,onRefLoad:E=>{Se.current===k&&(E.focus(),ge.current=E,Se.current=null),V.current.set(k,E),P.current.set(E,k),oe.rendered=!0,ae()},onRefUnload:E=>{V.current.delete(k),P.current.delete(E),oe.rendered=!1,ae()},onUnFocus:w,onHide:E=>{oe.onHide=E},onShow:E=>{oe.onShow=E},isDragging:u&&(F||M),disabled:g,renderMovable:l,updateFrameBounds:E=>{X(k,E)},dragStart:Be,onMouseUp:()=>{if(fe.current=null,H.current){B(!1),A(!1);let E=!1;$.current?.forEach(b=>{ue.CommonUtils.isEqualBounds(b.movable.getBounds(),b.startBounds)||(E=!0)}),E?be():Fe()}},style:{opacity:Y?M&&u?.7:void 0:0,zIndex:M&&u?k.getZIndex()+J.length:void 0,pointerEvents:Y?void 0:"none",cursor:F&&u?"grabbing":g||q?"initial":"move",boxShadow:!u||F&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Gl,{...T},`movable-${k.getUUID()}`)},Ve=G.current,ke=new Map,ze=[];for(let k=0;k<J.length;k++){const oe=J[k];if(oe.isClosed())continue;let O=Ve.get(oe);O||(O={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Y,u)=>{if(!u||u.shown===!0)return;u.shown=!0;const T=++u.visibilityRequestId;requestAnimationFrame(()=>{const E=G.current.get(Y);E&&T===u.visibilityRequestId&&(u.onShow?.(Y),E.shown=!0)})},doHide:async(Y,u)=>{if(!u||u?.shown===!1)return;u.shown=!1;const T=++u.visibilityRequestId,E=await Promise.resolve(u.onHide?.(Y));T===u.visibilityRequestId&&E!==!1&&(u.shown=!1,G.current.delete(Y),ne())},visibilityRequestId:0}),O.frame=Ie(oe,O,k,!0),ze.push(O.frame),O.doShow(oe,O),Ve.delete(oe),ke.set(oe,O)}const Ae=[];return a.getMovableSelection().forEach(k=>{const oe=Ve.get(k);oe&&(oe.frame=Ie(k,oe,-1,!1),Ae.push(oe.frame),Ve.delete(k),ke.set(k,oe))}),Ve.forEach((k,oe)=>{k.frame=Ie(oe,k,-1,!1),Ae.push(k.frame),k.doHide(oe,k),Ve.delete(oe),ke.set(oe,k)}),G.current=ke,ae(),[...Ae,...ze]},[ye,n,l,g,q,h,M,F]),de=r.useCallbackRef((J,Ie)=>{const Ve=`${Ie} ${R.length===1?s.TextUtils.capitalize(P.current?.get(R[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${Ve}`),H.current.rollback(),H.current=null),H.current=d.beginCommit({description:Ve}),$.current.clear();for(let ke=0;ke<R.length;ke++){const ze=R[ke],Ae=P.current?.get(ze);Ae?$.current.set(ze,{movable:Ae,startBounds:n.toViewBounds(Ae.getBounds())}):console.warn("invalid element",Ae)}},[d,n,R]),be=o.useCallback(()=>{if(!H.current)return;const J=[];$.current?.forEach(Ie=>{J.push(Ie.movable)}),H.current.commit({viewAfter:{view:a,movableSelection:J}}),$.current.clear(),H.current=null},[]),Fe=o.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),ve=o.useRef(null);o.useEffect(()=>{ve.current&&(ve.current.onscroll=J=>{J.preventDefault(),J.srcElement.scrollTop=0,J.srcElement.scrollLeft=0})},[ve.current]);const Ee=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ce,focus:()=>{ce()}}),[a]),[Oe,He]=o.useState(null),C=o.useRef(!1),Ue=o.useRef(!1),Qe=o.useRef(!1);o.useEffect(()=>{if(g||R.length===0||Qe.current||C.current)return;if(Ue.current)return void requestAnimationFrame(()=>{re.current&&x.current&&re.current.refTargets.length>0&&(Qe.current=!0,Me.current?.(!0)),y([...R])});C.current=!0;const J=o.lazy(async()=>{try{const Ie=await Promise.resolve().then(()=>require("./DLL4A5aF_1HuWIr5.cjs"));return C.current=!1,Ue.current=!0,y([...R]),Ie}catch(Ie){return console.warn(Ie),Me.current?.(!1),null}});He(J)},[R,g,q,h]);const $e=o.useMemo(()=>!Oe||g?null:c.jsx(o.Suspense,{children:c.jsx(Oe,{className:bt({dragging:M||F,resizing:M,moving:F}),container:null,ref:re,target:re.current?R:[],draggable:!g&&!q,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:S,onResizeStart:J=>{de(J.target,"Resize")},onResize:J=>{if(!H.current)return J.stopDrag(),void ne();B(!0);const Ie=J.direction[0]!==0&&J.direction[1]!==0;let Ve=0,ke=0;for(let ze=0;ze<R.length;ze++){const Ae=R[ze],k=$.current.get(Ae),oe=P.current.get(Ae);if(!k||!oe){console.warn("invalid element");continue}let O=J.dist[0],Y=J.dist[1],u=J.drag.dist[0],T=J.drag.dist[1],E=k.startBounds.width,b=k.startBounds.height;ze===0?(Ve=E,ke=b):(O*=E/Ve,u*=E/Ve,Y*=b/ke,T*=b/ke);const L={...k.startBounds};if(L.width=Math.max(0,E+O),L.height=Math.max(0,b+Y),J.direction[0]===-1&&(L.width=Math.max(0,Math.min(k.startBounds.x+E,E-u))),J.direction[1]===-1&&(L.height=Math.max(0,Math.min(k.startBounds.y+b,b-T))),Ie&&(oe.isLockAspectRatio()||J.inputEvent?.shiftKey)){const v=E/b,U=L.width/L.height;U>v?L.height=L.width/v:U<v&&(L.width=L.height*v)}J.direction[0]===-1&&(L.x=Math.max(0,Math.min(k.startBounds.x+E,k.startBounds.x+E-L.width))),J.direction[1]===-1&&(L.y=Math.min(k.startBounds.y+b,k.startBounds.y+b-L.height)),k.movable.setBounds(n.toAbsoluteBounds(L))}},onResizeEnd:J=>{B(!1),be()},onDragStart:J=>{de(J.target,"Move")},onDrag:J=>{if(!H.current)return J.stopDrag(),void ne();A(!0);for(let Ie=0;Ie<R.length;Ie++){const Ve=R[Ie],ke=$.current.get(Ve);ke?ke.movable.setBounds(n.toAbsoluteBounds({...ke.startBounds,x:ke.startBounds.x+J.translate[0],y:ke.startBounds.y+J.translate[1]})):console.warn("invalid element")}},onDragEnd:J=>{},onMouseUp:J=>{}})}),[ye,Oe,R,n,g,q,h,M,F]);return c.jsx("div",{className:bt(f,"movable-area",_l),style:{width:W.width,height:W.height,...I,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Wt([Ee,ve]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:W.width,height:W.height},...z,children:c.jsxs("div",{ref:x,style:{position:"absolute",pointerEvents:"auto"},onFocus:J=>{j?.(),Pe(!0)},onBlur:J=>{Pe(!1)},onKeyDownCapture:J=>{if(J.isDefaultPrevented())return;const Ie=J.nativeEvent.ctrlKey,Ve=J.nativeEvent.altKey,ke=J.nativeEvent.shiftKey;if(J.which===r.KeyCodes.Escape){const O=a.getMovableSelection();let Y=[...O];return R.forEach(u=>{if(Y.length===0)return;const T=P.current.get(u);let E=Y.indexOf(T);Y.splice(E,1)}),Y.length!==O.length&&a.selectMovables(Y),Y.length===0&&w?.(),void J.preventDefault()}const ze=.1,Ae=O=>{i.updateSelected(Y=>{Y.setRotation(Y.getRotation()+O)},"Rotate")},k=(O,Y=!0)=>{i.updateSelected(u=>{const T=u.getBounds();let E=1+O;Y||(E=1/E);const b=Math.sqrt(Math.pow(T.width,2)+Math.pow(T.height,2)),L=Math.atan2(T.height,T.width),v=E*b;if(v<10)return;const U=v*Math.cos(L),Z=v*Math.sin(L),ee={x:T.x+(T.width-U)/2,y:T.y+(T.height-Z)/2,width:U,height:Z};u.setBounds(ee)},"Resize")},oe=O=>{i.updateSelected(Y=>{const u=Y.getBounds(),T={x:u.x+(O.x??0),y:u.y+(O.y??0),width:u.width+(O.width??0),height:u.height+(O.height??0)};Y.setBounds(T)},"Nudge")};if(J.which===r.KeyCodes.Delete)i.updateSelected(O=>{O.delete()},"Delete"),J.preventDefault();else if(J.key==="a"&&Ie){const O=a.getMovableSelection();a.selectMovables(i.search(),!0),a.selectMovables(O,!0),J.preventDefault()}else J.key==="ArrowLeft"?(ke?k(ze,!1):Ve?Ae(-10):oe({x:Ie?-10:-1}),J.preventDefault()):J.key==="ArrowRight"?(ke?k(ze,!0):Ve?Ae(10):oe({x:Ie?10:1}),J.preventDefault()):J.key==="ArrowUp"?(ke?k(ze,!0):oe({y:Ie?-10:-1}),J.preventDefault()):J.key==="ArrowDown"&&(ke?k(ze,!1):oe({y:Ie?10:1}),J.preventDefault())},children:[we,$e]})})})})),Ht=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ko=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,p=0;for(let h=0;h<e.length;h++){const f=e[h],I=f.getBounds();d+=I[l],m=Math.min(I[i],m),p=Math.max(I[i]+I[l],p),n.push({bounds:I,movable:f})}const g=(p-m-d)/(e.length-1);n.sort((h,f)=>{const I=h.bounds[i],S=f.bounds[i];return I!==S?I-S:h.bounds[a]-f.bounds[a]});const q=new Map;q.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const f=n[h-1].bounds,I={...n[h].bounds};I[i]=f[i]+f[l]+g,n[h].bounds=I,q.set(n[h].movable,I)}return q.set(n[n.length-1].movable,n[n.length-1].bounds),q};function Rr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,p=r.useEditMode();o.useRef(p.getMode()).current=p.getMode();const g=r.useCallbackRef(async(w,j,R=null,y=!0)=>{const M=async()=>{const B=await Promise.resolve(m?.showBusy?.(w.label()));try{await j();const F=R??w?.label?.();if(d){let A=null;w&&F!==!1&&(A=new r.SimpleCommand(w.key(),l,{label:F,description:F},M)),d(A)}B?.(),y&&p.setMode(null)}catch(F){B?.(),m?.showError?.(F)}};await M()},[d,m]),[q,h]=o.useReducer(w=>w+1,0),f=r.useCallbackRef((w,j,R)=>{if(!n)return;const y=n.getMovableSelection();if(y.length===0)return;let M="Drawings";if(y.length===1){const F=y[0];M=s.TextUtils.capitalize(F.getContent().getType())??"Drawing"}const B=`${w.label()} ${M}`;g(w,()=>{let F=null;i&&(F=i.beginCommit(B));const A=n.getMovableSelection();if(A.length===0)return;const _=R?.(A);for(let G=0;G<A.length;G++){const P=A[G];j(P,_)}F?.commit()})},[n,i]),[I,S]=o.useState(n.getMovableSelection()[0]??null),[D,z]=o.useState(!I||I?.isProtected()),W=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,w=>{w.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,w=>{w.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,w=>{w.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,w=>{w.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){f(this,w=>{w.setLockAspectRatio(!w.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){f(this,w=>{w.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){f(this,w=>{w.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){f(this,w=>{w.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){f(this,(w,j)=>{w.setBounds({x:j.x})},Ht)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){f(this,(w,j)=>{w.setBounds({x:(j.width-w.getBounds().width)/2+j.x})},Ht)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){f(this,(w,j)=>{w.setBounds({x:j.width-w.getBounds().width+j.x})},Ht)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){f(this,(w,j)=>{w.setBounds({y:j.y})},Ht)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){f(this,(w,j)=>{w.setBounds({y:(j.height-w.getBounds().height)/2+j.y})},Ht)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){f(this,(w,j)=>{w.setBounds({y:j.height-w.getBounds().height+j.y})},Ht)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){f(this,(w,j)=>{w.setBounds(j.get(w))},w=>Ko(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){f(this,(w,j)=>{w.setBounds(j.get(w))},w=>Ko(w,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,I]);o.useEffect(()=>{},[p]);const K=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(W,!0),w},[a,W]);return tt(I,{onAnyChange:()=>{K.getCommand("formatAnchorTypeTwoCell").update({state:I?.getAnchorType()===s.IAnchored.Type.TwoCell}),K.getCommand("formatAnchorTypeOneCell").update({state:I?.getAnchorType()===s.IAnchored.Type.OneCell}),K.getCommand("formatAnchorTypeAbsolute").update({state:I?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("formatAnchorTypeAbsolute").update({state:I?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("toggleLockAspectRatio").update({state:I?.isLockAspectRatio()})},onProtectedChange:w=>{z(w.isProtected())},onDelete:()=>{}}),tt(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;S(w),z(!w||w.isProtected()),h()}}),tt(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const w={disabled:D};K.getCommand("formatAnchorTypeTwoCell").update(w),K.getCommand("formatAnchorTypeOneCell").update(w),K.getCommand("formatAnchorTypeAbsolute").update(w),K.getCommand("toggleLockAspectRatio").update(w);const j=t.getCount(),R=n.getMovableSelection(),y=D||j<=1||R.length===0;let M={disabled:y},B=M;if(!y&&R.length===1){const _=R[0];_.getZIndex()===0&&(M={disabled:!0}),_.getZIndex()===j-1&&(B={disabled:!0})}K.getCommand("moveToFront").update(B),K.getCommand("moveForward").update(B),K.getCommand("moveToBack").update(M),K.getCommand("moveBackward").update(M);const F={disabled:D||R.length<=1};K.getCommand("formatDrawAlignLeft").update(F),K.getCommand("formatDrawAlignCenter").update(F),K.getCommand("formatDrawAlignRight").update(F),K.getCommand("formatDrawAlignTop").update(F),K.getCommand("formatDrawAlignMiddle").update(F),K.getCommand("formatDrawAlignBottom").update(F),K.getCommand("formatDrawFlipHorz").update(F),K.getCommand("formatDrawFlipVert").update(F),K.getCommand("formatDrawGroup").update(F),K.getCommand("formatDrawUngroup").update(F),K.getCommand("formatDrawSwapShapes").update(F),K.getCommand("formatDrawSwapShapesHorz").update(F),K.getCommand("formatDrawSwapShapesVert").update(F);const A={disabled:D||R.length<=2};K.getCommand("formatDrawDistributeHorz").update(A),K.getCommand("formatDrawDistributeVert").update(A)},[q,D,q]),K}const Zl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const q=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:f,width:I}]=zt();return c.jsx("div",{...g,ref:Wt([q,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),Xl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:p,onRepeatCommandChange:g}=e,q=Rr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:p});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Sr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{q.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,q]);return h&&n?h:null})),Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:p,notifier:g=r.DefaultNotifier}=e,q=r.useEditMode(),[h,f]=o.useState(null),[I,S]=o.useState(null),[D,z]=o.useState(null),[W,K]=o.useState(null),[w,j]=o.useState(null);o.useLayoutEffect(()=>{if(D===null)return K(null),void j(null);const x=()=>{const H=i.getRange(D).getCell(),re=H.getStyle();let ye,ne=re.getFill()?.toCSS(a.body.darkMode);ne.background!=="none"&&ne.background!=="transparent"||(ne=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),ne.background!=="none"&&ne.background!=="transparent"||(ne={background:a.body.fill}),K({style:ne}),H&&!H.getFormula()&&(ye=H?.getRenderHorizontalAlignment()),j(ye??r.HorizontalAlignment.Left)};return x(),i.getRange(D).addListener(()=>{x()})},[i,D,a?.body]);const R=r.useCallbackRef(()=>{let x=I.editState.dirty??"";if(I.editState.dirty!==void 0){const H=s.TextUtils.clampString(x);try{const re=I.sheet.getRange(I.coords),ye=`Typing '${H}' into ${re.toString()}`;return re.setValue(x,{description:ye,autoFit:!0}),z(null),S(null),q.setMode(null),m(null),!0}catch(re){throw g.showError(new Error(`Unable to enter '${H}'.`,{cause:re})),re}}},[i,I,g]),y=r.useCallbackRef(x=>i.getRange(x).getCell().getExtrusions()??ue.CoordUtils.cellToRange(x),[i]),M=r.useCallbackRef(x=>{let H=s.IRange.Orientation.Row,re=!1;x!==s.IRange.Direction.Up&&x!==s.IRange.Direction.Down||(H=s.IRange.Orientation.Column),x!==s.IRange.Direction.Left&&x!==s.IRange.Direction.Up||(re=!0),i.getSelection().traverse(H,re)},[i]),B=o.useCallback((x,H)=>{if(l)return l(x,H);if(!i)return null;const{ref:re,...ye}=x;return c.jsx(pr,{ref:re,...ye,sheet:i,bodyStyle:a?.body,activeCoords:H,commands:p,onChangeEdit:ne=>{const X={sheet:i,coords:H,editState:ne};q.setMode(ae=>({...ae,description:X.editState.editMode?"Edit":"Enter",args:{...ae?.args,stateAndCoords:X}}))},editState:I.editState})},[i,W,l,I,D]),{overlay:F,startEdit:A,submitEdit:_,cancelEdit:G,onKeyboardEventNative:P,onPointerEventNative:V}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:B,canEdit:()=>{const x=i.getProtection();if(x.isReadOnly())return!1;const H=x.isLocked();return H&&d(),!H},onBeforeStartEdit:x=>{const H=vr(()=>i.getRange(x).getCell()),re={sheet:i,coords:x,editState:Object.freeze(H)};q.setMode({key:"edit",args:{stateAndCoords:re}}),S(re)},onStartEdit:x=>{z(x),m(x)},onSubmitEdit:R,onCancelEdit:x=>{z(null),S(null),q.setMode(null),m(null)},onDoneEdit:x=>{q.setMode(null)},onNavigate:M,containerProps:W,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:w,getRangeCoords:y});tt(i.getSelection(),{onChange(x){f(i.getSelection().getCoords().cell)}});const $=r.useCallbackRef(x=>{V(x),D&&_()},[V,G,D]),te=o.useCallback(x=>{V(x)},[V]),N=o.useCallback(x=>{P(x)},[P]);return o.useEffect(()=>{const x=n?.getStage();if(x)return x.addEventListener("pointerdown",$),x.addEventListener("dblclick",te),x.addEventListener("keydown",N),()=>{x.removeEventListener("pointerdown",$),x.removeEventListener("dblclick",te),x.removeEventListener("keydown",N)}},[n?.getStage()]),o.useEffect(()=>{const x=q.getMode(),H=x?.key;H==="edit"||H==="enter"?I?x.args?.cancel?G():x.args?.submit?_():S(x.args?.stateAndCoords):A(x.args?.start):D&&G()},[q]),F(n,t)})),kr="white",Mr="black",Jl=`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='${Mr}' fill='${kr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Ql=`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='${Mr}' fill='${kr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[p,g]=o.useState(null),[q,h]=o.useState(null),[f,I]=o.useState(null),S=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const R=i.getTables().search({address:n.getVisibleRangeCoords()});m(R.length>0?R:null)}else l(!1),m(null)},[i,n]),D=r.useCallbackRef(R=>{R.preventDefault(),R.stopPropagation();const y=n.getCellCoordsFromClient(R.clientX,R.clientY),M=i.getTables().search({address:y});M.length===1&&M[0].select()},[n,i]),z=r.useCallbackRef(R=>{R.preventDefault(),R.stopPropagation();const y=n.getCellCoordsFromClient(R.clientX,R.clientY),M=i.getTables().search({address:y});if(M.length===1){const B=M[0].getRange().getCoords(),F={colStart:B.colStart,rowStart:y.rowIndex,colEnd:B.colEnd,rowEnd:y.rowIndex};i.getRange(F).select()}},[n,i]),W=r.useCallbackRef(()=>{if(!a)return;const R=i.getTables().search({address:n.getVisibleRangeCoords()});m(R.length>0?R:null)},[i,a,n]);tt(i?.getSelection(),{onChange(R){g(i.getSelection().getCoords().cell)}}),tt(q,{onAnyChange(R){S(),W()}}),tt(f,{onAnyChange(R){W()}}),tt(i,{onTablesChange(R){S(),W()},onInvalidated(R){S(),W()}});const K=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(W,300),300),[]);o.useEffect(()=>{K()},[n]),o.useEffect(()=>{let R=null;if(d)for(let y=0;y<d.length&&!R;y++){const M=d[y],B=M.getRange().getCoords();s.CoordUtils.isCellWithinRange(p,B)&&(R=M)}h(R)},[p,d]);const w=r.useCallbackRef(R=>{let y=null;if(d)for(let M=0;M<d.length;M++){const B=d[M],F=B.getRange().getCoords();let A=n.getRangeCoordsBounds(F);const _=n.getRelativePointFromClient(R.clientX,R.clientY),G=_.x,P=_.y;if(G>=A.x&&G<=A.x+A.width&&P>=A.y&&P<=A.y+A.height){const V=n.getViewportSize();G<=0||P<=0||G>=V.width||P>=V.height||(y=B)}}I(y)},[n,d]);if(o.useEffect(()=>{const R=n?.getStage();if(R&&d)return R.addEventListener("mousemove",w),R.addEventListener("mouseleave",w),()=>{R.removeEventListener("mousemove",w),R.removeEventListener("mouseleave",w)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const j=[];for(let R=0;R<d.length;R++){const y=d[R];if(y.isClosed())continue;const M=y===f,B=y===q,F=y.getRange().getCoords(),A=n.getRangeCoordsBounds(F);let _;if(M||B){const G=y.getStyle().getProperties(),P=G.headerRow?.fill?.background??G.wholeTable?.border?.top?.color?.toString();if(P&&i){const V=i.getStyles().parseColor(P);V&&(_=V.toCSS())}_||(_="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}j.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:A.height,pointerEvents:"all",cursor:Jl},onMouseDown:z},`table-select-row-${y.getName()}`)),j.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:Math.min(16,A.height),pointerEvents:"all",cursor:Ql},onMouseDown:D},`table-select-${y.getName()}`)),j.push(c.jsx(dt.Selection,{x:A.x,y:A.y,width:A.width,height:A.height,range:F,strokeWidth:B?.5:0,stroke:_??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:M?`${_} 0px 0px 1px 1px`:void 0}},`table-outline-${y.getName()}`))}return j})),ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,p]=o.useState(null),g=o.useRef(null),q=r.useCallbackRef(()=>{const z=i.getSelectedCell(),W=z.getSpill()?.getCoords()??null;ue.CoordUtils.isEqualRanges(W,l)||(p(W?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(W),coords:W}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(W))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{p(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(q,80),80),[]);if(tt(i?.getSelection(),{onChange(z){h()}}),tt(i,{onSpillsChange(z){q()},onInvalidated(z){q()}}),!n||!l&&!m)return null;const f=i.getRange(l).getValue()instanceof s.FormulaError.Spill,I=[];let S=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ue.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&p(null),S=n.toClipBounds(S,-10),!S)return;const D="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return I.push(c.jsx(dt.Selection,{x:S.x,y:S.y,width:S.width,height:S.height,range:l,strokeWidth:1,stroke:D,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:f?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${D} 0px 0px 4px 0px`}},"spill-outline}")),I})),ni={position:"absolute",top:0,left:0,bottom:0,right:0},$o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ue.CommonUtils.mergeContentful(e.body,l);return n.body=ue.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ue.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ue.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ue.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ue.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ue.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelectAll,l),n},oi={fireOnModelChange:!1},Wo={},Tr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Wo,headersStyle:a=Wo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:p,rowHeaderProps:g,showScrollbars:q=!0,scrollPaneProps:h,onViewportChange:f,commands:I,onRepeatCommandChange:S,onMoveCell:D,overlays:z,renderMovable:W,viewportComponent:K,onElementLoad:w,getCellEditor:j,onFocus:R,onBlur:y,style:M=r.ReactUtils.EmptyCssProperties,notifier:B,onShowTooltip:F,onShowColumnTooltip:A,onShowRowTooltip:_,onCloseTooltip:G,gridProps:P,cellRenderProps:V,...$}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[te,N]=o.useReducer(Q=>Q+1,0),[x,{width:H,height:re}]=zt(),ye=r.useCallbackRef(F,[F]),ne=r.useCallbackRef(A,[A]),X=r.useCallbackRef(_,[_]),ae=r.useCallbackRef(G,[G]),Me=o.useRef(!1);o.useLayoutEffect(()=>{Me.current=!0},[n]);const Te=n?.getStyles(),fe=o.useMemo(()=>$o(i,Te),[i,Te]),Be=o.useMemo(()=>$o(a,Te),[a,Te]),{body:pe={},buttonSurface:Pe={}}=fe,{header:Se={},headerSelect:ge={},headerSelectAll:ce={}}=Be,we=o.useRef(null),[de,be]=o.useState(()=>n?.getView()),Fe=(de?.getZoomScale()??100)/100,ve=o.useMemo(()=>({vertical:de.isShowColumnGridlines()&&Fe>=.4,horizontal:de.isShowRowGridlines()&&Fe>=.4}),[de?.isShowColumnGridlines(),de?.isShowRowGridlines(),Fe]),Ee=o.useMemo(()=>{if(de?.getGridLineColor())return{strokeDasharray:"1,1"}},[de?.getGridLineColor(),fe]),Oe=d??de?.isShowColumnHeaders(),He=p??de?.isShowRowHeaders(),[C,Ue]=o.useState({width:0,height:0}),Qe=o.useMemo(()=>{let Q=40,qe=20;const Re=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ke=Re?.toCSS()?.fontFamily??fe.header.text.fontFamily,Ze=Re?.getSize()??fe.header.text.fontSize,et=s.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Ze*s.IFont.getDeviceScale()),Ke);Q=et.width,qe=et.lineHeight}return{width:Math.round(Q+5),height:Math.round(qe+3)}},[C,fe?.header.text,n]),$e=He?Fe*Qe.width:Se.edgeStrokeWidth,J=Oe?Fe*Qe.height:Se.edgeStrokeWidth,Ie=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??Qe.width)+$e+1),Ve=Math.max(re,(n?.getRowHeaders().getDefaultSize()??Qe.height)+J+1),ke=o.useRef(new Map),ze=o.useRef(null),Ae=()=>({getColOffset:Q=>n.getColumnHeaders().findOffset(Q),getColIndex:Q=>n.getColumnHeaders().findIndex(Q),getRowOffset:Q=>n.getRowHeaders().findOffset(Q),getRowIndex:Q=>n.getRowHeaders().findIndex(Q)}),[k,oe]=o.useState(()=>Ae()),[O,Y]=o.useState(!1),[u,T]=o.useState(null),E=!0,b=fe.selection?.strokeFill,L=o.useCallback(()=>kt.current,[]),[v,U]=o.useState(),Z=r.useCallbackRef(Q=>{U(Q),n&&n.getView()&&n.getView().setTopLeft(Q?{left:Q.left,top:Q.top}:null),f?.(Q)},[n,f]),ee=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const Q=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ee.current?.(),ee.current=Q.addListener(()=>{const qe=Q.getCoords();we?.current?.invalidate(qe)})},[v,n]);const[le,ie]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(Q=>{const qe=ue.CoordUtils.cellToRange(Q);if(n.isClosed())return qe;const Re=n.getRange(qe,{excludeHidden:!0}).getMerges();return Re.length===0?qe:Re[0]},[n]),Ce=Q=>{if(!Q||Q.coords.colIndex===0&&Q.coords.rowIndex===0)return null;const qe={};return Q.coords.colIndex>0&&(qe[ue.AnchorLocation.Left]={index:Q.coords.colIndex,scrollOffset:Q.topLeft.left}),Q.coords.rowIndex>0&&(qe[ue.AnchorLocation.Top]={index:Q.coords.rowIndex,scrollOffset:Q.topLeft.top}),qe},[he,me]=o.useState(()=>Ce(n.getView().getFreezePanes())),xe=r.useEditMode(),Le=o.useCallback(()=>we.current,[]),De=r.useCallbackRef(Q=>{xe.setMode(qe=>qe?.key==="edit"?{...qe,args:{...qe.args}}:{key:"edit",args:{stateAndCoords:null,start:Q}})},[]),We=r.useCallbackRef(()=>v,[v]),je=xr({sheet:n,commands:I,target:Le,onRepeatCommandChange:S,bodyStyle:pe,notifier:B,onStartEdit:De,getViewport:We}),[Ge,Ne]=o.useState(n.getSelection().isEntire()),[Xe,it]=o.useState(de?.getMovableSelection().length>0),pt=u!==null||Xe,wt=null,[_e,rt]=o.useState(!1);o.useEffect(()=>{rt(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{_e||(rt(!0),B.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[B,_e]),yt=o.useMemo(()=>{const Q=xe.getMode();return Q?.cursor?Q.cursor:null},[wt,xe]),[Ct,gt]=o.useState(null),lt=o.useRef(!1),[Tt,Lt]=o.useState([]),Zt=o.useRef(null),[Ft,Xt]=o.useState(ue.TypesUtils.EmptyTopLeft),[Mt,vn]=o.useState(ue.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Xt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{vn({left:0,top:le?.top})},[le?.top]),tt(n?.getView(),{onFreezeSplitChange:()=>{me(Ce(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ie(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),tt(n?.getSelection(),{onChange:()=>{Ne(n.getSelection().isEntire())}}),tt(n,{onViewChange(){be(n.getView()),oe(Ae())},onLayoutChange:()=>{const Q=n.getEntireRange();Ue({height:Q.getRowCount(),width:Q.getColumnCount()}),oe(Ae())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),tt(n,{onRequestScrollIntoView:async(Q,qe)=>{if(!qe)return;const Re={colIndex:qe?.coords.colStart,rowIndex:qe?.coords.rowStart};return await we.current?.scrollCellCoordsIntoView(Re,qe?.scroll),!0},onRequestFocus:()=>ue.CommonUtils.whenFocus(kt.current)},oi);const Cn=o.useMemo(()=>{const Q=(Re,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:Re,colEnd:Re})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getColOffset(Re)),Je=Ze.getBounds(),st=Math.min(Je.x+Je.width,et.getColOffset(Re+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Left||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Right)){const Xn=ue.CommonUtils.roundAccurately(Ke*ue.CommonUtils.getDPI(),0),qn=ue.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ke/Fe),2).toFixed(2),Yn="Width: "+(Ke?qn+" ("+Xn+" pixels)":"Hidden"),nn=Vt.current.getGridElement().getRelativePointFromClient(0,0),Pt=0-nn.y,Sn=0-nn.y+J,Jn={x:ot-(nn.x-Je.x),y:Pt,width:st-ot,height:Sn-Pt};requestAnimationFrame(()=>{lt.current&&ne?.({anchor:Jn,display:Yn})})}const It=[0,0,0,Je.height],tn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Gn={x:ot-1,y:0,width:1,height:Je.height},_n={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Zn={x:st-1,y:0,width:1,height:Je.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:It,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:It,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(Re,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(Re,Ke)},onResizeHeaders:(Re,Ke,Ze)=>{Q(Re,Ke)},onResizeHeadersDown:(Re,Ke)=>{Q(Re,Ke)},onResizeHeadersEnd:(Re,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Re=>{requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},...m}},[n,m,J,Ct]),Ot=o.useMemo(()=>{const Q=(Re,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:Re,rowEnd:Re,colStart:0,colEnd:C.width})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getRowOffset(Re)),Je=Ze.getBounds(),st=Math.min(Je.y+Je.height,et.getRowOffset(Re+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Top||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Bottom)){const Xn=Math.floor(10*ue.CommonUtils.getDPI())/10,qn=ue.CommonUtils.roundAccurately(Ke*Xn,0),Yn=ue.CommonUtils.roundAccurately(qn/Fe/(n?.getRowHeaders().getScaleFactor()*ue.CommonUtils.getDPI()),2).toFixed(2),nn="Height: "+(Ke?Yn+" ("+qn+" pixels)":"Hidden"),Pt=en.current.getGridElement().getRelativePointFromClient(0,0),Sn=0-Pt.x,Jn=0-Pt.x+$e,hl={x:Sn,y:ot-(Pt.y-Je.y),width:Jn-Sn,height:st-ot};requestAnimationFrame(()=>{lt.current&&X?.({anchor:hl,display:nn})})}const It=[0,0,Je.width,0],tn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Gn={x:0,y:ot-1,width:Je.width,height:1},_n={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Zn={x:0,y:st-1,width:Je.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:It,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:It,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(Re,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(Re,Ke)},onResizeHeaders:(Re,Ke,Ze)=>{Q(Re,Ke)},onResizeHeadersDown:(Re,Ke)=>{Q(Re,Ke)},onResizeHeadersEnd:(Re,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Re=>{requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},...g}},[n,g,$e]),kt=r.useImperativeElement(t,()=>{const Q=Re=>{n?.getView()&&n.getView().selectMovables([]),ze.current=null,we?.current?.focus(Re)},qe=async(Re=null)=>{if(Re||(Re=n?.getView().getMovableSelection()[0]),!Re)return!1;const Ke=Re.getAnchorCoords();if(!Ke)return!1;const Ze=we.current?.getViewFromCellCoords({colIndex:Ke.colStart,rowIndex:Ke.rowStart});if(!Ze)return!1;const et=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Re)===-1&&n?.getView().selectMovables([Re]);let ot=ke.current?.get(et);return ot?.current?(await ot.current.focusMovable(Re),!0):(ze.current={movable:Re,anchor:et},!0)};return{getGridElement:()=>we.current,getRowHeaderElement:()=>en.current,getColumnHeaderElement:()=>Vt.current,rowHeaderHeight:()=>J,colHeaderWidth:()=>$e,startEdit:De,submitEdit:()=>{xe.setMode(Re=>Re?.key!=="edit"?Re:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{xe.setMode(Re=>Re?.key!=="edit"?Re:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:u!==null,focus:Re=>{n?.getView().getMovableSelection().length>0&&qe()||Q(Re)},focusSheet:Q,focusMovable:qe,contains:Re=>we?.current?.contains?.(Re),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(Q=>{Me.current||(we?.current?.invalidate(Q),N?.())},[]);o.useEffect(()=>{At()},[fe]);const Yt=Ge?ce.edgeStrokeFill:Se.fill,Hn=Ge?ge.fill:typeof fe.headerHover=="function"?fe.headerHover(Se)?.fill:Se.fill,nt=o.useMemo(()=>K?c.jsx("div",{className:bt("sheetxl-viewport-overlay",Ml),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:K}):c.jsx(c.Fragment,{}),[K]);let Jt=null;Oe&&He&&(Jt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${J}px`,width:`${$e}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:Q=>{let qe=!Q.ctrlKey;je?.getCommand("selectAll")?.execute(!qe||Q.button!==0),Q.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:-1,colIndex:-1}):we.current?.focus()},children:[c.jsx("div",{style:{height:J-5+"px",width:J-5+"px",clipPath:`path('M${J-5} 0 L0 ${J-5} L${J-5} ${J-5} L${J-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Hn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${J}px`,width:`${$e}px`,boxSizing:"border-box",borderRight:`solid 1px ${Se.strokeFill}`,borderBottom:`solid 1px ${Se.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const jt=r.useCallbackRef(({_left:Q,_top:qe})=>{},[]),bn=r.useCallbackRef(Q=>{if(!l)return;const qe=we.current.getViewFromClient(Q.clientX,Q.clientY)?.getCellCoordsFromClient(Q.clientX,Q.clientY);qe&&(l({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:qe.rowIndex,colIndex:qe.colIndex}),Q.stopPropagation(),Q.preventDefault())},[l]),at=r.useCallbackRef(Q=>{if(!(!Q.shiftKey&&(Q.ctrlKey||Q.metaKey)))return;const{deltaY:qe}=Q;return qe>0?je.getCommand("sheetZoomOut")?.execute():qe<0&&je.getCommand("sheetZoomIn")?.execute(),qe===0},[je]);o.useEffect(()=>{Lt(null),Zt.current=null,lt.current=!1,gt(null);const Q=n?.getView().getTopLeft();jt(Q),we.current?.scrollTo(Q),ie(Q),be(n.getView()),me(Ce(n.getView().getFreezePanes())),oe(Ae()),N()},[n?.getView()]);const ht=r.useCallbackRef(Q=>{const qe=Q.getVisibleRangeCoords();if(!qe)return null;const Re=[];return n.getRange(qe).forEach((Ke,Ze)=>{const et=Ze.getCoords(),ot=Ze.getCell();(Je=>{if(Je.isEmpty())return!1;const st=Je.getSpans();if(st.width>1||st.height>1||Je.getStyle().hasVisibleStyling()||de.isShowFormulas()&&Je.getFormula()!==null)return!0;const mt=Je.getValue();return mt!==null&&!(!de.isShowZeros()&&mt===0&&Je.getType()===s.ScalarType.Number)})(ot)&&Re.push({coords:et,value:ot,range:de.isShowFormulas()?null:ot.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Re},[n,de.isShowZeros(),de.isShowFormulas(),u]);o.useEffect(()=>{const Q=[];z&&Q.push(...z),Ct&&Q.push(...Ct),ue.CommonUtils.isEqualArrays(Q,Zt.current)||(Zt.current=Q,Lt(Q))},[z,Ct,fe]);const Qt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[fe?.header?.edgeStrokeFill]),yn=r.useCallbackRef(Q=>{Q.isDefaultPrevented()||Q.isPropagationStopped()||(ze.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Bt=o.useMemo(()=>{const Q=xe.getMode();return Q?.key==="cut"||Q?.key==="copy"},[xe]),Un=r.useCallbackRef(async Q=>{const qe=xe.getMode();return Q.keyCode===r.KeyCodes.Escape&&qe?(Q.preventDefault(),void xe.setMode(null)):Q.keyCode===r.KeyCodes.Enter&&Bt?(Q.preventDefault(),await je?.getCommand("paste")?.execute(),void xe.setMode(null)):void je?.dispatchToFocusedCommand(Q)},[je,xe]),en=o.useRef(null),wn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Ho,{ref:en,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Top],oppositeSize:$e,containerWidth:$e,containerHeight:Ve,sheetHeader:n.getRowHeaders(),gridStyle:Be,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Mt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2",...Ot?.style},...Ot})}),[$e,J,Ve,n,Mt,he?.[ue.AnchorLocation.Top],fe,E,l,Se.fill,g]),Vt=o.useRef(null),xn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Ho,{ref:Vt,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Left],oppositeSize:J,containerWidth:Ie,containerHeight:J,sheetHeader:n.getColumnHeaders(),gridStyle:Be,scrollPoint:Ft,onSheetContextMenu:l,...Cn,style:{...Cn?.style,position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[J,Ie,n,Ft,he?.[ue.AnchorLocation.Left],fe,Se.fill,E,l,m]),al=r.useCallbackRef(Q=>{const{value:qe,key:Re,...Ke}=Q;let Ze=qe,et=u;if(!et||et.colIndex===Q.coords.colIndex&&et.rowIndex===Q.coords.rowIndex||(et=null),!Ze){const st=Q.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let ot=null;Ze.getHyperlink()&&(ot=async st=>{if(V?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(mt){B?.showError?.(mt)}}}),et&&et.colIndex===Q.range.colStart&&et.rowIndex===Q.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Je=n.getStyles();return o.createElement(fr,{...Ke,key:Re,bodyStyle:pe,docTheme:Je.getTheme(),normalStyle:Je.getNormal(),showFormulas:de.isShowFormulas(),showZeros:de.isShowZeros(),onLinkMouseDown:ot,...V,value:Ze})},[n,k,pe,u,de?.isShowFormulas(),de.isShowZeros()]),sl=o.useCallback((Q,qe)=>{const{key:Re,...Ke}=Q;return[c.jsx(El,{ref:qe,getVisibleCells:ht,sheet:n,gridStyle:fe,...Ke},`border-${Re}`),c.jsx(ei,{ref:qe,sheet:n,commands:je,...Ke},`table-${Re}`),c.jsx(ti,{ref:qe,sheet:n,...Ke},`spill-${Re}`),c.jsx($l,{ref:qe,sheet:n,commands:je,notifier:B,onShowTooltip:ye,onCloseTooltip:ae,gridStyle:fe,gridRef:we,editingCoords:u,isActive:E,...Ke},`selection-${Re}`),c.jsx(jl,{ref:qe,sheet:n,commands:je,gridStyle:fe,element:L,notifier:B,...Ke},`copy-paste-${Re}`),c.jsx(Xl,{ref:qe,sheet:n,commands:je,target:Le,notifier:B,renderMovable:W,movableProps:{onUnFocus:()=>{kt.current.focus()}},...Ke},`movable-${Re}`),c.jsx(Yl,{ref:qe,sheet:n,commands:je,notifier:B,gridStyle:fe,getCellEditor:j,showProtectedError:vt,setEditingCoords:T,...Ke},`editor-${Re}`)]},[n,we.current,fe,j,je,B]),[ko,dl]=o.useState(!1),cl=o.useMemo(()=>{if(Ie===0||Ve===0)return null;const Q=n.getStyles().getNormal(),qe=Q.getFont(),Re=Q.getFill(),Ke=Q.getBorder(),Ze=Q.getFill().getType()===s.IFill.Type.None;let et=Ee,ot=Ee;const Je=(mt,It,tn)=>tn?{stroke:Ke.getBottom().isNone()?"none":mt.getColor().toRGBA(pe.darkMode).toString(),...It}:It;ot=Je(Ke.getBottom(),ot,!Ke.getBottom().isNone()),ot=Je(Ke.getTop(),ot,!Ke.getTop().isNone()),et=Je(Ke.getRight(),et,!Ke.getRight().isNone()),et=Je(Ke.getLeft(),et,!Ke.getLeft().isNone());let st=de?.getGridLineColor()?.toRGBA(pe.darkMode).toString()??pe.strokeFill;return Ze||(ot=Je(Ke.getBottom(),ot,!0),ot=Je(Ke.getTop(),ot,!0),et=Je(Ke.getRight(),et,!0),et=Je(Ke.getLeft(),et,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...ni,...Re.toCSS(pe.darkMode),...qe.toCSS(pe.darkMode,Fe),"--sxl-app-color-background":pe.fill,"--sxl-app-color-shadow":fe.colorShadow,"--sxl-app-color-grey":fe.colorGrey,"--sxl-app-color-button-fill":Pe.fill,"--sxl-app-color-button-text":Pe.text?.fill,"--sxl-app-color-button-border":Pe.edgeStrokeFill,"--sxl-app-color-primary-dark":fe.selection.strokeFill},ref:we,zoom:Fe,...P,onFirstRender:mt=>{dl(!0),P?.onFirstRender?.(mt),je?.activate()},showGridLines:ve,gridLineColor:st,gridLineColumnsProps:et,gridLineRowsProps:ot,freezeLeft:he?.[ue.AnchorLocation.Left],freezeLeftProps:Qt,freezeTop:he?.[ue.AnchorLocation.Top],freezeTopProps:Qt,width:Ie,height:Ve,columnCount:C.width,rowCount:C.height,cursor:yt??wt??"cell",clipCells:!0,layout:k,cellRenderer:al,overlayRenderer:sl,getCellCoordsAsRangeCoords:se,getVisibleCells:ht,onWheelScroll:at,onPointerDown:yn,onKeyDown:Un,onViewportChange:Z,onImmediateScroll:jt,scrollPoint:le,stageProps:{onFocus:()=>{je?.activate()}},overlays:Tt})},[te]);o.useEffect(()=>{Me.current||N()},[k,he,Fe,je,le?.left,le?.top,pe,P,Ie,Ve,yt,Tt,E,wt]);let Kn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};q||(Kn={...Kn,...M});const ul=o.useMemo(()=>{const Q=n.getStyles().getTheme(),qe=Q.getColorScheme(),Re=Q.getFontScheme();return{"--sxl-doc-color-dk1":qe.getDk1().toCSS(pe.darkMode),"--sxl-doc-color-dk2":qe.getDk2().toCSS(pe.darkMode),"--sxl-doc-color-lt1":qe.getLt1().toCSS(pe.darkMode),"--sxl-doc-color-lt2":qe.getLt2().toCSS(pe.darkMode),"--sxl-doc-color-accent1":qe.getAccent1().toCSS(pe.darkMode),"--sxl-doc-color-accent2":qe.getAccent2().toCSS(pe.darkMode),"--sxl-doc-color-accent3":qe.getAccent3().toCSS(pe.darkMode),"--sxl-doc-color-accent4":qe.getAccent4().toCSS(pe.darkMode),"--sxl-doc-color-accent5":qe.getAccent5().toCSS(pe.darkMode),"--sxl-doc-color-accent6":qe.getAccent6().toCSS(pe.darkMode),"--sxl-doc-color-hlink":qe.getHlink().toCSS(pe.darkMode),"--sxl-doc-color-fol-hlink":qe.getFolHlink().toCSS(pe.darkMode),"--sxl-doc-font-major":Re.getMajorFont(),"--sxl-doc-font-minor":Re.getMinorFont()}},[n.getStyles().getTheme()]);let $n=c.jsx("div",{style:Kn,onTouchStart:()=>{Mo()},onFocus:Q=>{Y(!0),R?.(Q)},onBlur:Q=>{Y(!1),y?.(Q)},ref:kt,...$,children:c.jsx("div",{className:bt("sheetxl-sheet",kl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...ul},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Jt,wn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[xn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,backgroundColor:pe.fill},ref:x,onContextMenu:bn,children:[cl,nt,c.jsx(Tl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:fe?.selection?.strokeFill,colorCredits:fe?.body?.text?.fill})]})]})]})})});if(q){const Q=qe=>c.jsx(vo,{...qe,sheet:n});$n=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Se.fill}`,minHeight:2*Qe.height,minWidth:2*Qe.width,...M},viewport:v,touchElement:we.current?.stage,disableTouch:pt,onScrollViewport:qe=>{we.current?.scrollTo(qe)},createHorizontalScrollbar:Q,createVerticalScrollbar:Q,...h,children:$n})}o.useEffect(()=>{Me.current=!1,N?.(),O&&kt.current?.focus()},[n]);const[Wn,gl]=o.useState(!1),Mo=r.useCallbackRef(()=>{Wn||gl(!0)},[Wn]);return o.useEffect(()=>{if(ko)return typeof w=="function"&&w(),r.ReactUtils.detectIt().primaryInput==="touch"&&Mo(),()=>{}},[w,ko,Wn]),$n}));Tr.displayName="SheetElement";const ri=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Go="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Ir=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:p,onHide:g,onShow:q,onKeyDownCapture:h,onFocus:f,onBlur:I,loadingPanel:S,...D}=e,[z,W]=o.useState(!1),[K,w]=o.useState(null),[j,R]=o.useState(null),[y,M]=o.useState(null);o.useEffect(()=>{R(null),l.getDetails().then(A=>{W(!1),R(A.asUrl()),A.asSVGText?.()&&M(A.asSVGText())}).catch(A=>{console.warn(A),W(!0),R(Go),M(null)})},[l]);const B=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),F=o.useMemo(()=>{if(j||y)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:z?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:z?"var(--sxl-app-color-background, white)":void 0,boxShadow:z?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:z?"contain":void 0,opacity:K?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:j,onLoad:()=>{w(!0)},onError:({currentTarget:A})=>{console.log("error"),A.onerror=null,R(Go),W(!0)},alt:d??`${l.getType()}`})},[K,l,j,y,m]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...D,onKeyDownCapture:A=>{h?.(A)},ref:B,children:[K||z?void 0:S,F]})}));Ir.displayName="PictureEditor";const li=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const q=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:f,width:I}]=zt();if(!a.isClosed())return c.jsx("div",{...g,ref:Wt([q,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ii="_editable-input_1bqx6_6",ai=e=>c.jsx("input",{...e}),Er=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:p=ai,notifier:g,styleHover:q={},dragging:h,maxLength:f,disabled:I=!1,readOnly:S=!1,...D}=e,[z,W]=o.useState(!1),[K,w]=o.useState(!1),[j,R]=o.useState(a);o.useEffect(()=>{R(a)},[a]);const y=o.useRef(null),[M,B]=o.useState(null),F=o.useCallback(function(te){const N=te.message;M!==N&&(g?.showMessage?.(N,{type:r.NotificationType.Error}),B(N))},[g,M]),A=o.useCallback(te=>{let N=!1;try{N=l?.(te)??!0}catch(x){F(x)}return N?(y.current=null,w(!1),R(te),N):(setTimeout(()=>{y.current?.focus()},0),N)},[l]),_=r.useCallbackRef(()=>{R(a),y.current=null,w(!1),m?.()},[m,a]),G=o.useMemo(()=>{if(!K)return null;const te={className:bt(ii),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:f,type:"text",value:j,onFocus:N=>{y.current||(y.current=N.target,setTimeout(()=>{N.target?.select()},0))},onBlur:N=>{y.current&&A(j)},onChange:N=>{K&&R(N.target.value)},onMouseDown:N=>N.stopPropagation(),onKeyDown:N=>N.code==="Escape"?(N.preventDefault(),void _()):N.code==="Enter"?(N.preventDefault(),void A(N.target.value)):void(N.code!=="Tab"?N.stopPropagation():A(N.target.value))};return c.jsx(c.Fragment,{children:p(te)})},[K,j,A,_,p,I]),[P,V]=o.useState();o.useLayoutEffect(()=>{let te=Object.assign({},n);(h||z)&&(te=Object.assign(te,q)),V(te)},[h,z,q,n]),o.useEffect(()=>{G&&d?.(j)},[G,d,j]);const $=r.useImperativeElement(t,()=>({startEdit(){I||S||w(!0)},cancel(){_()}}),[]);return c.jsxs("div",{...D,ref:$,style:{flexDirection:"column",display:"flex",...P},className:bt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{I||S||w(!0)},onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:K?0:1},children:j}),G]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...q},children:j})]})})),On=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Co(e){return"nodeType"in e}function ft(e){var t,n;return e?Gt(e)?e:Co(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bo(e){const{Document:t}=ft(e);return e instanceof t}function mn(e){return!Gt(e)&&e instanceof ft(e).HTMLElement}function Fr(e){return e instanceof ft(e).SVGElement}function $t(e){return e?Gt(e)?e.document:Co(e)?bo(e)?e:mn(e)||Fr(e)?e.ownerDocument:document:document:document}const St=On?o.useLayoutEffect:o.useEffect;function jn(e){const t=o.useRef(e);return St(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function un(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return St(()=>{n.current!==e&&(n.current=e)},t),n}function ln(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function En(e){const t=jn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Fn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let to={};function fn(e,t){return o.useMemo(()=>{if(t)return t;const n=to[e]==null?0:to[e]+1;return to[e]=n,e+"-"+n},[e,t])}function Ar(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[p,g]of m){const q=l[p];q!=null&&(l[p]=q+e*g)}return l},{...t})}}const Kt=Ar(1),gn=Ar(-1);function Bn(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function An(e){if(function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(t){return"clientX"in t&&"clientY"in t}(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{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;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),_o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function si(e){return e.matches(_o)?e:e.querySelector(_o)}const di={display:"none"};function ci(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:di},n)}function ui(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.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":i,"aria-atomic":!0},n)}const Dr=o.createContext(null),gi={draggable:`
|
|
23
|
+
The content is not applied.`}),new r.Command("pasteFormulas",w,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",w,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",w,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(M,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const w={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(M=>B.paste({...Dl,...M})).update(w),i.getCommand("pasteFormats").updateCallback((M,O)=>B.paste({...zl,description:O.label(),...M})).update(w),i.getCommand("pasteFormulas").updateCallback((M,O)=>B.paste({...Nl,description:O.label(),...M})).update(w),i.getCommand("pasteTranspose").updateCallback((M,O)=>B.paste({...Ll,description:O.label(),...M})).update(w),i.getCommand("pasteLinks").updateCallback((M,O)=>B.paste({...Ol,description:O.label(),...M})).update(w),i.getCommand("cut").update(w),i.getCommand("paste").update(w)},[t,i]);const R=o.useMemo(()=>{if(!z||!S.current)return;const w=z.key;if(w!=="copy"&&w!=="cut"&&w!=="formatPainter")return;const M=S.current.getItem();if(M.getSource()!==t)return;const O=S.current.isCut?.(),F=O?q:g,A=O?p:m,_=M.getCoords(),G=_?[_]:null;return G&&G.length!==0?P=>{const V=[];for(let $=0;$<G.length;$++){const te=G[$],N=P.toClipBounds(P.getRangeCoordsBounds(te,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);N&&(V.push(I({range:te,key:`copy-selection-background-${$}`,x:N.x,y:N.y,width:Math.max(N.width,0),height:Math.max(N.height,0),stroke:F,strokeWidth:2})),V.push(I({range:te,key:`copy-selection-foreground-${$}`,x:N.x+(N.width<=2?-1:0),y:N.y,width:Math.max(N.width,3),height:Math.max(N.height,3),stroke:A,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[z,t,n,m,g,p,q]);return{...B,clipboard:y,overlays:R}},jl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,p=l.body??{},g=a.getView(),{overlays:q}=qr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:p.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:p.fill,notifier:m});return tt(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),q&&n?q(n):null})),Bl="_sheet-selection_12wyx_5",Vl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Pl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Hl={key:"dragCopy",description:"Drag selection to copy cell contents."},Ul={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Uo=(e,t)=>t.ctrlKey&&t.shiftKey?Ul:t.ctrlKey?Hl:t.shiftKey?Pl:Vl,Kl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},$l=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:p,sheet:g,gridRef:q,gridStyle:h,isActive:f,editingCoords:I,...S}=e,D=n?.getBounds(),z=r.useCallbackRef(m,[m]),W=r.useCallbackRef(p,[p]),[K,y]=o.useState(()=>g?.getSelection().getCoords()),B=r.useCallbackRef(ge=>{ue.CoordUtils.isEqualSelectionCoords(ge,K)||g&&g.getSelection().updateCoords(ge)},[g,K]),R=r.useEditMode(),w=o.useRef(null),[M,O]=o.useState(g?.getProtection().isLocked()),[F,A]=o.useState(g?.getView().getMovableSelection().length>0),_=r.ReactUtils.detectIt().primaryInput==="touch",G=!_&&f,P=I!==null||F,V=r.useCallbackRef(ge=>{const ce=ue.CoordUtils.cellToRange(ge);if(g.isClosed())return ce;const we=g.getRange(ce,{excludeHidden:!0}).getMerges();return we.length===0?ce:we[0]},[g]),$=r.useCallbackRef((ge,ce,we,de,be,Fe)=>{const ve=g.getSelectedRange().getExtended(de,ge).getCoords();switch(de){case s.IRange.Direction.Up:return ve.rowStart;case s.IRange.Direction.Down:return ve.rowEnd;case s.IRange.Direction.Left:return ve.colStart;case s.IRange.Direction.Right:return ve.colEnd}},[g]),te=r.useCallbackRef(()=>{const ge=g.getUsedRange()?.getCoords(),ce=g.getRowHeaders().getUsedRange()?.getCoords(),we=g.getColumnHeaders().getUsedRange()?.getCoords();return{...ge,colEnd:Math.max(ge?.colEnd??0,we?.max??0),rowEnd:Math.max(ge?.rowEnd??0,ce?.max??0)}},[g]),N=r.useCallbackRef((ge,ce)=>g.getRowHeaders().hiddenHeadersAt(ge,ce),[g]),x=r.useCallbackRef((ge,ce)=>g.getColumnHeaders().hiddenHeadersAt(ge,ce),[g]),H=r.useCallbackRef(ge=>g.getRange(ge,{excludeHidden:!0}).getMerges(),[g]),re=r.useCallbackRef(ge=>{g?.getSelection().setAdjusting(ge)},[g]),ye=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),R.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),R.setMode(null))},[R,K,g,i]),ne=o.useMemo(()=>{const ge=R.getMode();return ge?.key==="cut"||ge?.key==="copy"},[R]);tt(g?.getView(),{onMovableSelectionChange:()=>{A(g.getView().getMovableSelection().length>0)}}),tt(g?.getSelection(),{onChange(ge){const ce=g.getSelection().getCoords();y(ce)}}),tt(g,{onProtectionChange:()=>{O(g.getProtection().isLocked())}});const{body:X={}}=h||{},ae=n.getLayout(),Me=!(G&&K.ranges.length<=1&&I===null&&!M&&(!R.getMode()||ne)),{cursor:Te,overlay:fe,onPointerDown:Be}=dt.useSelection({gridRef:q,commands:i,layout:ae,getCellCoordsAsRangeCoords:V,selection:K,fillHandleBorderColor:X.fill,selectionBackgroundColor:f?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:f?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:f?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:f?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Me,disableMoveDrag:_||!(f&&K.ranges.length<=1&&I===null&&!M),disableTouchSelection:P,onSelectionChange:B,onSelectionDragStart:re,onSelectionDragEnd:ye,onMoveDragStart:(ge,ce,we)=>{R.setMode(Uo(0,we))},onMoveDragUpdate:(ge,ce,we)=>{R.setMode(Uo(0,we))},onMoveDragEnd:(ge,ce)=>{R.setMode(null)},onMoveDragDone:async(ge,ce,we)=>{if(ue.CoordUtils.isEqualRanges(ge,ce))return;const de=g.getRange(ce);if(d?.showOptions){const Oe=de.getDifferences(ge);let He=!1;for(let C=0;!He&&C<Oe.getCount();C++)He=Oe.at(C).isContentful();if(He&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const be=!we.ctrlKey,Fe=we.shiftKey,ve=Fe?be?"Insert Moved Cells":"Insert Copied Cells":be?"Move Cells":"Copy Cells",Ee=await d?.showBusy?.(ve);try{const Oe=g.getRange(ge);await de.doBatch(async()=>{Fe?await de.insertFrom(ge,{isCut:be,undoRange:Oe}):await de.copyFrom(ge,{isCut:be,undoRange:Oe}),Oe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),de.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:ve,autoSelect:!0})}catch(Oe){d?.showError?.(Oe)}finally{Ee?.()}},contentfulCellFinder:$,hiddenRowsAt:N,hiddenColumnsAt:x,mergedRanges:H,getDataCoords:te,canSelectionSpanMergedCells:ge=>{const ce=g.getRange(ge);return ce.isEntireColumns()||ce.isEntireRows()},onFill:async(ge,ce)=>{const we="Auto Fill",de=await d?.showBusy?.(we);try{await g.doBatch(()=>{g.getRange(ge).autoFill(ce),g.getRange(ce).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:we,autoSelect:!0})}catch(be){d?.showError?.(be)}finally{w.current=null,de?.()}},onFillPreview:(ge,ce,we)=>{if(q.current&&z){R.setMode(Kl);try{w.current?.direction!==we&&(w.current=null,g.getRange(ge).autoFill(ce,{previewOnly:C=>{w.current={callback:C,direction:we}}}));const de=w.current?.callback?.(ce);if(!de||de.isEmpty())return;const be=de.toText();if(!be)return;const Fe=ue.CoordUtils.cellToRange(de.getCoords()),ve=n.getRelativePointFromClient(0,0);let Ee=0,Oe=0,He=r.ToolTipPlacement.Bottom;if(we===s.IRange.Direction.Down){Ee=ae.getColOffset(Fe.colEnd+1)-ve.x;const C=ae.getRowOffset(Fe.rowEnd),Ue=ae.getRowOffset(Fe.rowEnd+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Right){Oe=ae.getRowOffset(Fe.rowEnd+1)-ve.y;const C=ae.getColOffset(Fe.colEnd),Ue=ae.getColOffset(Fe.colEnd+1);Ee=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}else if(we===s.IRange.Direction.Up){Ee=ae.getColOffset(Fe.colEnd+1)-ve.x;const C=ae.getRowOffset(Fe.rowStart),Ue=ae.getRowOffset(Fe.rowStart+1);Oe=Ue-(Ue-C)/2-ve.y,He=r.ToolTipPlacement.Right}else if(we===s.IRange.Direction.Left){Oe=ae.getRowOffset(Fe.rowEnd+1)-ve.y;const C=ae.getColOffset(Fe.colStart),Ue=ae.getColOffset(Fe.colStart+1);Ee=Ue-(Ue-C)/2-ve.x,He=r.ToolTipPlacement.Bottom}z({anchor:{x:Ee,y:Oe},display:be,placement:He})}catch(de){d?.showError?.(de)}}},onFillDone:()=>{w.current=null,R.setMode(null),W?.()}}),pe=r.useCallbackRef(ge=>{Be(r.ReactUtils.createSyntheticEvent(ge))},[Be,I]);o.useEffect(()=>{const ge=n?.getStage();if(ge)return ge.addEventListener("pointerdown",pe),()=>{ge.removeEventListener("pointerdown",pe)}},[n?.getStage()]);const Pe=r.useImperativeElement(t,()=>({}),[]),Se=o.useRef(null);return c.jsx("div",{className:bt(a,"sheet-selection",Bl),style:{position:"absolute",width:D?.width,height:D?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Wt([Pe,Se]),...S,children:fe(n)})})),kn=Object.freeze({x:0,y:0,width:0,height:0}),Wl={fireOnModelChange:!1},Gl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:p,onUnFocus:g,isDragging:q,updateFrameBounds:h,dragStart:f,style:I,disabled:S,renderMovable:D,...z}=e,[W,K]=o.useState(kn),[y,B]=o.useState(null),[R,w]=o.useState(!1),M=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const F=a.getBounds();if(!F)return;const A=i.toViewBounds(F);K(A??kn),h(A??kn)},[i?.getBounds()]),tt(a,{onBoundsChange:F=>{const A=F.getBounds();if(!A)return;const _=i.toViewBounds(A);K(_??kn),h(_)},onSelectionChange:()=>{const F=ue.CommonUtils.hasFocus(M.current,!0);!R&&!F||a.isSelected()||g()}}),tt(a,{onRequestFocus:()=>ue.CommonUtils.whenFocus(M.current,!0)},Wl),o.useEffect(()=>{const F=M.current;return l(F),()=>{d(F)}},[]);const O=o.useMemo(()=>{if(!W)return null;let{width:F,height:A}=W;return D({view:i,movable:a,disabled:S,isDragging:q,style:{position:"relative",left:0,top:0,width:F,height:A},onHide:m,onShow:p})},[i,a,W.width,W.height,S,q]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Wt([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:W.x,top:W.y,width:W.width,height:W.height,...I},onMouseDown:async F=>{const A=F.shiftKey||F.ctrlKey,_=a.isSelected(),G=F.currentTarget;A&&_?a.unselect():(_&&!A||await a.select({addToSelection:A}),f(F.nativeEvent,G),G.focus())},onFocus:F=>{F.relatedTarget&&!y&&B(F.relatedTarget),w(!0)},onBlur:F=>{y&&!M?.current?.contains(F.relatedTarget)&&B(null),F.relatedTarget&&w(!1)},...z,children:O})})),_l="_movable-area_314c6_5",Sr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:p,disabled:g=!1,disableDrag:q=!1,disableResize:h=!1,className:f,style:I,renderDirections:S=["nw","n","ne","w","e","sw","s","se"],onFirstRender:D,...z}=e,W=n.getBounds(),K=r.useCallbackRef(D,[D]),y=r.useCallbackRef(m,[m]),B=r.useCallbackRef(p,[p]),[R,w]=o.useState([]),[M,O]=o.useState(!1),[F,A]=o.useState(!1),_=o.useRef(!0),G=o.useRef(new Map),P=o.useRef(new Map),V=o.useRef(new Map),$=o.useRef(new Map),te=o.useRef(new Map),N=o.useRef({onRequestFocus:J=>(ce(J),null)}),x=o.useRef(null),H=o.useRef(null),re=o.useRef(null),[ye,ne]=o.useReducer(J=>J+1,0);o.useLayoutEffect(()=>{ne()},[n,i]),tt(i,{onCollectionChange:()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Ie=te.current;Ie.forEach(ke=>{ke()}),Ie.clear();const Ve=N.current;for(let ke=0;ke<J.length;ke++){const ze=J[ke];if(ze.isClosed())continue;const Ae=ze.addListeners(Ve);Ie.set(ze,Ae)}ne()},onInvalidated:()=>{ne()}}),tt(a,{onMovableSelectionChange(J){ae(),ne()}});const X=o.useCallback((J,Ie)=>{const Ve=V.current.get(J);re.current&&(re.current.getTargets().forEach(ke=>{if(ke===Ve)return ke.style.left=Ie.x+"px",ke.style.top=Ie.y+"px",ke.style.width=Ie.width+"px",void(ke.style.height=Ie.height+"px")}),re.current.updateRect())},[]),ae=()=>{const J=[],Ie=a.getMovableSelection();Ie.forEach(Ve=>{const ke=V.current.get(Ve);ke&&Ie.indexOf(Ve)!==-1&&J.push(ke)}),w(Ve=>ue.CommonUtils.isEqualArrays(Ve,J)?Ve:J)},Me=o.useRef(null),Te=o.useMemo(()=>new Promise(J=>{Me.current=J}),[]),fe=o.useRef(null),Be=r.useCallbackRef(async(J,Ie)=>{fe.current=Ie,await(async()=>!(!await Te.then()||!re.current))()&&fe.current===Ie&&re.current.dragStart(J,Ie)},[R]),[pe,Pe]=o.useState(!1),Se=o.useRef(null),ge=o.useRef(null),ce=r.useCallbackRef(async(J=null)=>{if(J||(J=a.getMovableSelection()[0]),!J)return y?.(),!1;const Ie=V.current.get(J);Ie?(await ue.CommonUtils.whenFocus(Ie),Ie.focus(),ge.current=Ie,Se.current=null):Se.current=J},[a]);o.useEffect(()=>{pe&&R.length>0&&ge.current!==R[0]&&ce(),_.current&&(K?.(),_.current=!1)},[R]);const we=o.useMemo(()=>{const J=i.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(J.length===0&&G.current.size===0)return null;const Ie=(k,oe,j,Y=!0)=>{const u=k.isSelected(),T={tabIndex:j,view:n,movable:k,onRefLoad:E=>{Se.current===k&&(E.focus(),ge.current=E,Se.current=null),V.current.set(k,E),P.current.set(E,k),oe.rendered=!0,ae()},onRefUnload:E=>{V.current.delete(k),P.current.delete(E),oe.rendered=!1,ae()},onUnFocus:y,onHide:E=>{oe.onHide=E},onShow:E=>{oe.onShow=E},isDragging:u&&(F||M),disabled:g,renderMovable:l,updateFrameBounds:E=>{X(k,E)},dragStart:Be,onMouseUp:()=>{if(fe.current=null,H.current){O(!1),A(!1);let E=!1;$.current?.forEach(b=>{ue.CommonUtils.isEqualBounds(b.movable.getBounds(),b.startBounds)||(E=!0)}),E?be():Fe()}},style:{opacity:Y?M&&u?.7:void 0:0,zIndex:M&&u?k.getZIndex()+J.length:void 0,pointerEvents:Y?void 0:"none",cursor:F&&u?"grabbing":g||q?"initial":"move",boxShadow:!u||F&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Gl,{...T},`movable-${k.getUUID()}`)},Ve=G.current,ke=new Map,ze=[];for(let k=0;k<J.length;k++){const oe=J[k];if(oe.isClosed())continue;let j=Ve.get(oe);j||(j={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Y,u)=>{if(!u||u.shown===!0)return;u.shown=!0;const T=++u.visibilityRequestId;requestAnimationFrame(()=>{const E=G.current.get(Y);E&&T===u.visibilityRequestId&&(u.onShow?.(Y),E.shown=!0)})},doHide:async(Y,u)=>{if(!u||u?.shown===!1)return;u.shown=!1;const T=++u.visibilityRequestId,E=await Promise.resolve(u.onHide?.(Y));T===u.visibilityRequestId&&E!==!1&&(u.shown=!1,G.current.delete(Y),ne())},visibilityRequestId:0}),j.frame=Ie(oe,j,k,!0),ze.push(j.frame),j.doShow(oe,j),Ve.delete(oe),ke.set(oe,j)}const Ae=[];return a.getMovableSelection().forEach(k=>{const oe=Ve.get(k);oe&&(oe.frame=Ie(k,oe,-1,!1),Ae.push(oe.frame),Ve.delete(k),ke.set(k,oe))}),Ve.forEach((k,oe)=>{k.frame=Ie(oe,k,-1,!1),Ae.push(k.frame),k.doHide(oe,k),Ve.delete(oe),ke.set(oe,k)}),G.current=ke,ae(),[...Ae,...ze]},[ye,n,l,g,q,h,M,F]),de=r.useCallbackRef((J,Ie)=>{const Ve=`${Ie} ${R.length===1?s.TextUtils.capitalize(P.current?.get(R[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${Ve}`),H.current.rollback(),H.current=null),H.current=d.beginCommit({description:Ve}),$.current.clear();for(let ke=0;ke<R.length;ke++){const ze=R[ke],Ae=P.current?.get(ze);Ae?$.current.set(ze,{movable:Ae,startBounds:n.toViewBounds(Ae.getBounds())}):console.warn("invalid element",Ae)}},[d,n,R]),be=o.useCallback(()=>{if(!H.current)return;const J=[];$.current?.forEach(Ie=>{J.push(Ie.movable)}),H.current.commit({viewAfter:{view:a,movableSelection:J}}),$.current.clear(),H.current=null},[]),Fe=o.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),ve=o.useRef(null);o.useEffect(()=>{ve.current&&(ve.current.onscroll=J=>{J.preventDefault(),J.srcElement.scrollTop=0,J.srcElement.scrollLeft=0})},[ve.current]);const Ee=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ce,focus:()=>{ce()}}),[a]),[Oe,He]=o.useState(null),C=o.useRef(!1),Ue=o.useRef(!1),Qe=o.useRef(!1);o.useEffect(()=>{if(g||R.length===0||Qe.current||C.current)return;if(Ue.current)return void requestAnimationFrame(()=>{re.current&&x.current&&re.current.refTargets.length>0&&(Qe.current=!0,Me.current?.(!0)),w([...R])});C.current=!0;const J=o.lazy(async()=>{try{const Ie=await Promise.resolve().then(()=>require("./BkuITQ2sNHxvsmB0.cjs"));return C.current=!1,Ue.current=!0,w([...R]),Ie}catch(Ie){return console.warn(Ie),Me.current?.(!1),null}});He(J)},[R,g,q,h]);const $e=o.useMemo(()=>!Oe||g?null:c.jsx(o.Suspense,{children:c.jsx(Oe,{className:bt({dragging:M||F,resizing:M,moving:F}),container:null,ref:re,target:re.current?R:[],draggable:!g&&!q,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:S,onResizeStart:J=>{de(J.target,"Resize")},onResize:J=>{if(!H.current)return J.stopDrag(),void ne();O(!0);const Ie=J.direction[0]!==0&&J.direction[1]!==0;let Ve=0,ke=0;for(let ze=0;ze<R.length;ze++){const Ae=R[ze],k=$.current.get(Ae),oe=P.current.get(Ae);if(!k||!oe){console.warn("invalid element");continue}let j=J.dist[0],Y=J.dist[1],u=J.drag.dist[0],T=J.drag.dist[1],E=k.startBounds.width,b=k.startBounds.height;ze===0?(Ve=E,ke=b):(j*=E/Ve,u*=E/Ve,Y*=b/ke,T*=b/ke);const L={...k.startBounds};if(L.width=Math.max(0,E+j),L.height=Math.max(0,b+Y),J.direction[0]===-1&&(L.width=Math.max(0,Math.min(k.startBounds.x+E,E-u))),J.direction[1]===-1&&(L.height=Math.max(0,Math.min(k.startBounds.y+b,b-T))),Ie&&(oe.isLockAspectRatio()||J.inputEvent?.shiftKey)){const v=E/b,U=L.width/L.height;U>v?L.height=L.width/v:U<v&&(L.width=L.height*v)}J.direction[0]===-1&&(L.x=Math.max(0,Math.min(k.startBounds.x+E,k.startBounds.x+E-L.width))),J.direction[1]===-1&&(L.y=Math.min(k.startBounds.y+b,k.startBounds.y+b-L.height)),k.movable.setBounds(n.toAbsoluteBounds(L))}},onResizeEnd:J=>{O(!1),be()},onDragStart:J=>{de(J.target,"Move")},onDrag:J=>{if(!H.current)return J.stopDrag(),void ne();A(!0);for(let Ie=0;Ie<R.length;Ie++){const Ve=R[Ie],ke=$.current.get(Ve);ke?ke.movable.setBounds(n.toAbsoluteBounds({...ke.startBounds,x:ke.startBounds.x+J.translate[0],y:ke.startBounds.y+J.translate[1]})):console.warn("invalid element")}},onDragEnd:J=>{},onMouseUp:J=>{}})}),[ye,Oe,R,n,g,q,h,M,F]);return c.jsx("div",{className:bt(f,"movable-area",_l),style:{width:W.width,height:W.height,...I,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Wt([Ee,ve]),...z,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:W.width,height:W.height},...z,children:c.jsxs("div",{ref:x,style:{position:"absolute",pointerEvents:"auto"},onFocus:J=>{B?.(),Pe(!0)},onBlur:J=>{Pe(!1)},onKeyDownCapture:J=>{if(J.isDefaultPrevented())return;const Ie=J.nativeEvent.ctrlKey,Ve=J.nativeEvent.altKey,ke=J.nativeEvent.shiftKey;if(J.which===r.KeyCodes.Escape){const j=a.getMovableSelection();let Y=[...j];return R.forEach(u=>{if(Y.length===0)return;const T=P.current.get(u);let E=Y.indexOf(T);Y.splice(E,1)}),Y.length!==j.length&&a.selectMovables(Y),Y.length===0&&y?.(),void J.preventDefault()}const ze=.1,Ae=j=>{i.updateSelected(Y=>{Y.setRotation(Y.getRotation()+j)},"Rotate")},k=(j,Y=!0)=>{i.updateSelected(u=>{const T=u.getBounds();let E=1+j;Y||(E=1/E);const b=Math.sqrt(Math.pow(T.width,2)+Math.pow(T.height,2)),L=Math.atan2(T.height,T.width),v=E*b;if(v<10)return;const U=v*Math.cos(L),Z=v*Math.sin(L),ee={x:T.x+(T.width-U)/2,y:T.y+(T.height-Z)/2,width:U,height:Z};u.setBounds(ee)},"Resize")},oe=j=>{i.updateSelected(Y=>{const u=Y.getBounds(),T={x:u.x+(j.x??0),y:u.y+(j.y??0),width:u.width+(j.width??0),height:u.height+(j.height??0)};Y.setBounds(T)},"Nudge")};if(J.which===r.KeyCodes.Delete)i.updateSelected(j=>{j.delete()},"Delete"),J.preventDefault();else if(J.key==="a"&&Ie){const j=a.getMovableSelection();a.selectMovables(i.search(),!0),a.selectMovables(j,!0),J.preventDefault()}else J.key==="ArrowLeft"?(ke?k(ze,!1):Ve?Ae(-10):oe({x:Ie?-10:-1}),J.preventDefault()):J.key==="ArrowRight"?(ke?k(ze,!0):Ve?Ae(10):oe({x:Ie?10:1}),J.preventDefault()):J.key==="ArrowUp"?(ke?k(ze,!0):oe({y:Ie?-10:-1}),J.preventDefault()):J.key==="ArrowDown"&&(ke?k(ze,!1):oe({y:Ie?10:1}),J.preventDefault())},children:[we,$e]})})})})),Ht=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Ko=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,p=0;for(let h=0;h<e.length;h++){const f=e[h],I=f.getBounds();d+=I[l],m=Math.min(I[i],m),p=Math.max(I[i]+I[l],p),n.push({bounds:I,movable:f})}const g=(p-m-d)/(e.length-1);n.sort((h,f)=>{const I=h.bounds[i],S=f.bounds[i];return I!==S?I-S:h.bounds[a]-f.bounds[a]});const q=new Map;q.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const f=n[h-1].bounds,I={...n[h].bounds};I[i]=f[i]+f[l]+g,n[h].bounds=I,q.set(n[h].movable,I)}return q.set(n[n.length-1].movable,n[n.length-1].bounds),q};function Rr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,p=r.useEditMode();o.useRef(p.getMode()).current=p.getMode();const g=r.useCallbackRef(async(y,B,R=null,w=!0)=>{const M=async()=>{const O=await Promise.resolve(m?.showBusy?.(y.label()));try{await B();const F=R??y?.label?.();if(d){let A=null;y&&F!==!1&&(A=new r.SimpleCommand(y.key(),l,{label:F,description:F},M)),d(A)}O?.(),w&&p.setMode(null)}catch(F){O?.(),m?.showError?.(F)}};await M()},[d,m]),[q,h]=o.useReducer(y=>y+1,0),f=r.useCallbackRef((y,B,R)=>{if(!n)return;const w=n.getMovableSelection();if(w.length===0)return;let M="Drawings";if(w.length===1){const F=w[0];M=s.TextUtils.capitalize(F.getContent().getType())??"Drawing"}const O=`${y.label()} ${M}`;g(y,()=>{let F=null;i&&(F=i.beginCommit(O));const A=n.getMovableSelection();if(A.length===0)return;const _=R?.(A);for(let G=0;G<A.length;G++){const P=A[G];B(P,_)}F?.commit()})},[n,i]),[I,S]=o.useState(n.getMovableSelection()[0]??null),[D,z]=o.useState(!I||I?.isProtected()),W=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,y=>{y.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,y=>{y.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,y=>{y.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,y=>{y.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){f(this,y=>{y.setLockAspectRatio(!y.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){f(this,(y,B)=>{y.setBounds({x:B.x})},Ht)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){f(this,(y,B)=>{y.setBounds({x:(B.width-y.getBounds().width)/2+B.x})},Ht)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){f(this,(y,B)=>{y.setBounds({x:B.width-y.getBounds().width+B.x})},Ht)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){f(this,(y,B)=>{y.setBounds({y:B.y})},Ht)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){f(this,(y,B)=>{y.setBounds({y:(B.height-y.getBounds().height)/2+B.y})},Ht)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){f(this,(y,B)=>{y.setBounds({y:B.height-y.getBounds().height+B.y})},Ht)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){f(this,(y,B)=>{y.setBounds(B.get(y))},y=>Ko(y))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){f(this,(y,B)=>{y.setBounds(B.get(y))},y=>Ko(y,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,I]);o.useEffect(()=>{},[p]);const K=o.useMemo(()=>{let y=null;return y=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),y.addCommands(W,!0),y},[a,W]);return tt(I,{onAnyChange:()=>{K.getCommand("formatAnchorTypeTwoCell").update({state:I?.getAnchorType()===s.IAnchored.Type.TwoCell}),K.getCommand("formatAnchorTypeOneCell").update({state:I?.getAnchorType()===s.IAnchored.Type.OneCell}),K.getCommand("formatAnchorTypeAbsolute").update({state:I?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("formatAnchorTypeAbsolute").update({state:I?.getAnchorType()===s.IAnchored.Type.Absolute}),K.getCommand("toggleLockAspectRatio").update({state:I?.isLockAspectRatio()})},onProtectedChange:y=>{z(y.isProtected())},onDelete:()=>{}}),tt(n,{onMovableSelectionChange:()=>{const y=n.getMovableSelection()[0]??null;S(y),z(!y||y.isProtected()),h()}}),tt(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const y={disabled:D};K.getCommand("formatAnchorTypeTwoCell").update(y),K.getCommand("formatAnchorTypeOneCell").update(y),K.getCommand("formatAnchorTypeAbsolute").update(y),K.getCommand("toggleLockAspectRatio").update(y);const B=t.getCount(),R=n.getMovableSelection(),w=D||B<=1||R.length===0;let M={disabled:w},O=M;if(!w&&R.length===1){const _=R[0];_.getZIndex()===0&&(M={disabled:!0}),_.getZIndex()===B-1&&(O={disabled:!0})}K.getCommand("moveToFront").update(O),K.getCommand("moveForward").update(O),K.getCommand("moveToBack").update(M),K.getCommand("moveBackward").update(M);const F={disabled:D||R.length<=1};K.getCommand("formatDrawAlignLeft").update(F),K.getCommand("formatDrawAlignCenter").update(F),K.getCommand("formatDrawAlignRight").update(F),K.getCommand("formatDrawAlignTop").update(F),K.getCommand("formatDrawAlignMiddle").update(F),K.getCommand("formatDrawAlignBottom").update(F),K.getCommand("formatDrawFlipHorz").update(F),K.getCommand("formatDrawFlipVert").update(F),K.getCommand("formatDrawGroup").update(F),K.getCommand("formatDrawUngroup").update(F),K.getCommand("formatDrawSwapShapes").update(F),K.getCommand("formatDrawSwapShapesHorz").update(F),K.getCommand("formatDrawSwapShapesVert").update(F);const A={disabled:D||R.length<=2};K.getCommand("formatDrawDistributeHorz").update(A),K.getCommand("formatDrawDistributeVert").update(A)},[q,D,q]),K}const Zl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const q=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:f,width:I}]=zt();return c.jsx("div",{...g,ref:Wt([q,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),Xl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:p,onRepeatCommandChange:g}=e,q=Rr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:p});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Sr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{q.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,q]);return h&&n?h:null})),Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:p,notifier:g=r.DefaultNotifier}=e,q=r.useEditMode(),[h,f]=o.useState(null),[I,S]=o.useState(null),[D,z]=o.useState(null),[W,K]=o.useState(null),[y,B]=o.useState(null);o.useLayoutEffect(()=>{if(D===null)return K(null),void B(null);const x=()=>{const H=i.getRange(D).getCell(),re=H.getStyle();let ye,ne=re.getFill()?.toCSS(a.body.darkMode);ne.background!=="none"&&ne.background!=="transparent"||(ne=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),ne.background!=="none"&&ne.background!=="transparent"||(ne={background:a.body.fill}),K({style:ne}),H&&!H.getFormula()&&(ye=H?.getRenderHorizontalAlignment()),B(ye??r.HorizontalAlignment.Left)};return x(),i.getRange(D).addListener(()=>{x()})},[i,D,a?.body]);const R=r.useCallbackRef(()=>{let x=I.editState.dirty??"";if(I.editState.dirty!==void 0){const H=s.TextUtils.clampString(x);try{const re=I.sheet.getRange(I.coords),ye=`Typing '${H}' into ${re.toString()}`;return re.setValue(x,{description:ye,autoFit:!0}),z(null),S(null),q.setMode(null),m(null),!0}catch(re){throw g.showError(new Error(`Unable to enter '${H}'.`,{cause:re})),re}}},[i,I,g]),w=r.useCallbackRef(x=>i.getRange(x).getCell().getExtrusions()??ue.CoordUtils.cellToRange(x),[i]),M=r.useCallbackRef(x=>{let H=s.IRange.Orientation.Row,re=!1;x!==s.IRange.Direction.Up&&x!==s.IRange.Direction.Down||(H=s.IRange.Orientation.Column),x!==s.IRange.Direction.Left&&x!==s.IRange.Direction.Up||(re=!0),i.getSelection().traverse(H,re)},[i]),O=o.useCallback((x,H)=>{if(l)return l(x,H);if(!i)return null;const{ref:re,...ye}=x;return c.jsx(pr,{ref:re,...ye,sheet:i,bodyStyle:a?.body,activeCoords:H,commands:p,onChangeEdit:ne=>{const X={sheet:i,coords:H,editState:ne};q.setMode(ae=>({...ae,description:X.editState.editMode?"Edit":"Enter",args:{...ae?.args,stateAndCoords:X}}))},editState:I.editState})},[i,W,l,I,D]),{overlay:F,startEdit:A,submitEdit:_,cancelEdit:G,onKeyboardEventNative:P,onPointerEventNative:V}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:O,canEdit:()=>{const x=i.getProtection();if(x.isReadOnly())return!1;const H=x.isLocked();return H&&d(),!H},onBeforeStartEdit:x=>{const H=vr(()=>i.getRange(x).getCell()),re={sheet:i,coords:x,editState:Object.freeze(H)};q.setMode({key:"edit",args:{stateAndCoords:re}}),S(re)},onStartEdit:x=>{z(x),m(x)},onSubmitEdit:R,onCancelEdit:x=>{z(null),S(null),q.setMode(null),m(null)},onDoneEdit:x=>{q.setMode(null)},onNavigate:M,containerProps:W,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:y,getRangeCoords:w});tt(i.getSelection(),{onChange(x){f(i.getSelection().getCoords().cell)}});const $=r.useCallbackRef(x=>{V(x),D&&_()},[V,G,D]),te=o.useCallback(x=>{V(x)},[V]),N=o.useCallback(x=>{P(x)},[P]);return o.useEffect(()=>{const x=n?.getStage();if(x)return x.addEventListener("pointerdown",$),x.addEventListener("dblclick",te),x.addEventListener("keydown",N),()=>{x.removeEventListener("pointerdown",$),x.removeEventListener("dblclick",te),x.removeEventListener("keydown",N)}},[n?.getStage()]),o.useEffect(()=>{const x=q.getMode(),H=x?.key;H==="edit"||H==="enter"?I?x.args?.cancel?G():x.args?.submit?_():S(x.args?.stateAndCoords):A(x.args?.start):D&&G()},[q]),F(n,t)})),kr="white",Mr="black",Jl=`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='${Mr}' fill='${kr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Ql=`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='${Mr}' fill='${kr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[p,g]=o.useState(null),[q,h]=o.useState(null),[f,I]=o.useState(null),S=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const R=i.getTables().search({address:n.getVisibleRangeCoords()});m(R.length>0?R:null)}else l(!1),m(null)},[i,n]),D=r.useCallbackRef(R=>{R.preventDefault(),R.stopPropagation();const w=n.getCellCoordsFromClient(R.clientX,R.clientY),M=i.getTables().search({address:w});M.length===1&&M[0].select()},[n,i]),z=r.useCallbackRef(R=>{R.preventDefault(),R.stopPropagation();const w=n.getCellCoordsFromClient(R.clientX,R.clientY),M=i.getTables().search({address:w});if(M.length===1){const O=M[0].getRange().getCoords(),F={colStart:O.colStart,rowStart:w.rowIndex,colEnd:O.colEnd,rowEnd:w.rowIndex};i.getRange(F).select()}},[n,i]),W=r.useCallbackRef(()=>{if(!a)return;const R=i.getTables().search({address:n.getVisibleRangeCoords()});m(R.length>0?R:null)},[i,a,n]);tt(i?.getSelection(),{onChange(R){g(i.getSelection().getCoords().cell)}}),tt(q,{onAnyChange(R){S(),W()}}),tt(f,{onAnyChange(R){W()}}),tt(i,{onTablesChange(R){S(),W()},onInvalidated(R){S(),W()}});const K=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(W,300),300),[]);o.useEffect(()=>{K()},[n]),o.useEffect(()=>{let R=null;if(d)for(let w=0;w<d.length&&!R;w++){const M=d[w],O=M.getRange().getCoords();s.CoordUtils.isCellWithinRange(p,O)&&(R=M)}h(R)},[p,d]);const y=r.useCallbackRef(R=>{let w=null;if(d)for(let M=0;M<d.length;M++){const O=d[M],F=O.getRange().getCoords();let A=n.getRangeCoordsBounds(F);const _=n.getRelativePointFromClient(R.clientX,R.clientY),G=_.x,P=_.y;if(G>=A.x&&G<=A.x+A.width&&P>=A.y&&P<=A.y+A.height){const V=n.getViewportSize();G<=0||P<=0||G>=V.width||P>=V.height||(w=O)}}I(w)},[n,d]);if(o.useEffect(()=>{const R=n?.getStage();if(R&&d)return R.addEventListener("mousemove",y),R.addEventListener("mouseleave",y),()=>{R.removeEventListener("mousemove",y),R.removeEventListener("mouseleave",y)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const B=[];for(let R=0;R<d.length;R++){const w=d[R];if(w.isClosed())continue;const M=w===f,O=w===q,F=w.getRange().getCoords(),A=n.getRangeCoordsBounds(F);let _;if(M||O){const G=w.getStyle().getProperties(),P=G.headerRow?.fill?.background??G.wholeTable?.border?.top?.color?.toString();if(P&&i){const V=i.getStyles().parseColor(P);V&&(_=V.toCSS())}_||(_="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}B.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:A.height,pointerEvents:"all",cursor:Jl},onMouseDown:z},`table-select-row-${w.getName()}`)),B.push(c.jsx("div",{style:{position:"absolute",left:A.x,top:A.y,width:Math.min(16,A.width),height:Math.min(16,A.height),pointerEvents:"all",cursor:Ql},onMouseDown:D},`table-select-${w.getName()}`)),B.push(c.jsx(dt.Selection,{x:A.x,y:A.y,width:A.width,height:A.height,range:F,strokeWidth:O?.5:0,stroke:_??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:M?`${_} 0px 0px 1px 1px`:void 0}},`table-outline-${w.getName()}`))}return B})),ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,p]=o.useState(null),g=o.useRef(null),q=r.useCallbackRef(()=>{const z=i.getSelectedCell(),W=z.getSpill()?.getCoords()??null;ue.CoordUtils.isEqualRanges(W,l)||(p(W?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(W),coords:W}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(W))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{p(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(q,80),80),[]);if(tt(i?.getSelection(),{onChange(z){h()}}),tt(i,{onSpillsChange(z){q()},onInvalidated(z){q()}}),!n||!l&&!m)return null;const f=i.getRange(l).getValue()instanceof s.FormulaError.Spill,I=[];let S=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ue.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&p(null),S=n.toClipBounds(S,-10),!S)return;const D="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return I.push(c.jsx(dt.Selection,{x:S.x,y:S.y,width:S.width,height:S.height,range:l,strokeWidth:1,stroke:D,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:f?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${D} 0px 0px 4px 0px`}},"spill-outline}")),I})),ni={position:"absolute",top:0,left:0,bottom:0,right:0},$o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ue.CommonUtils.mergeContentful(e.body,l);return n.body=ue.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ue.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ue.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ue.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ue.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ue.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelectAll,l),n},oi={fireOnModelChange:!1},Wo={},Tr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Wo,headersStyle:a=Wo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:p,rowHeaderProps:g,showScrollbars:q=!0,scrollPaneProps:h,onViewportChange:f,commands:I,onRepeatCommandChange:S,onMoveCell:D,overlays:z,renderMovable:W,viewportComponent:K,onElementLoad:y,getCellEditor:B,onFocus:R,onBlur:w,style:M=r.ReactUtils.EmptyCssProperties,notifier:O,onShowTooltip:F,onShowColumnTooltip:A,onShowRowTooltip:_,onCloseTooltip:G,gridProps:P,cellRenderProps:V,...$}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[te,N]=o.useReducer(Q=>Q+1,0),[x,{width:H,height:re}]=zt(),ye=r.useCallbackRef(F,[F]),ne=r.useCallbackRef(A,[A]),X=r.useCallbackRef(_,[_]),ae=r.useCallbackRef(G,[G]),Me=o.useRef(!1);o.useLayoutEffect(()=>{Me.current=!0},[n]);const Te=n?.getStyles(),fe=o.useMemo(()=>$o(i,Te),[i,Te]),Be=o.useMemo(()=>$o(a,Te),[a,Te]),{body:pe={},buttonSurface:Pe={}}=fe,{header:Se={},headerSelect:ge={},headerSelectAll:ce={}}=Be,we=o.useRef(null),[de,be]=o.useState(()=>n?.getView()),Fe=(de?.getZoomScale()??100)/100,ve=o.useMemo(()=>({vertical:de.isShowColumnGridlines()&&Fe>=.4,horizontal:de.isShowRowGridlines()&&Fe>=.4}),[de?.isShowColumnGridlines(),de?.isShowRowGridlines(),Fe]),Ee=o.useMemo(()=>{if(de?.getGridLineColor())return{strokeDasharray:"1,1"}},[de?.getGridLineColor(),fe]),Oe=d??de?.isShowColumnHeaders(),He=p??de?.isShowRowHeaders(),[C,Ue]=o.useState({width:0,height:0}),Qe=o.useMemo(()=>{let Q=40,qe=20;const Re=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ke=Re?.toCSS()?.fontFamily??fe.header.text.fontFamily,Ze=Re?.getSize()??fe.header.text.fontSize,et=s.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Ze*s.IFont.getDeviceScale()),Ke);Q=et.width,qe=et.lineHeight}return{width:Math.round(Q+5),height:Math.round(qe+3)}},[C,fe?.header.text,n]),$e=He?Fe*Qe.width:Se.edgeStrokeWidth,J=Oe?Fe*Qe.height:Se.edgeStrokeWidth,Ie=Math.max(H,(n?.getColumnHeaders().getDefaultSize()??Qe.width)+$e+1),Ve=Math.max(re,(n?.getRowHeaders().getDefaultSize()??Qe.height)+J+1),ke=o.useRef(new Map),ze=o.useRef(null),Ae=()=>({getColOffset:Q=>n.getColumnHeaders().findOffset(Q),getColIndex:Q=>n.getColumnHeaders().findIndex(Q),getRowOffset:Q=>n.getRowHeaders().findOffset(Q),getRowIndex:Q=>n.getRowHeaders().findIndex(Q)}),[k,oe]=o.useState(()=>Ae()),[j,Y]=o.useState(!1),[u,T]=o.useState(null),E=!0,b=fe.selection?.strokeFill,L=o.useCallback(()=>kt.current,[]),[v,U]=o.useState(),Z=r.useCallbackRef(Q=>{U(Q),n&&n.getView()&&n.getView().setTopLeft(Q?{left:Q.left,top:Q.top}:null),f?.(Q)},[n,f]),ee=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const Q=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ee.current?.(),ee.current=Q.addListener(()=>{const qe=Q.getCoords();we?.current?.invalidate(qe)})},[v,n]);const[le,ie]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(Q=>{const qe=ue.CoordUtils.cellToRange(Q);if(n.isClosed())return qe;const Re=n.getRange(qe,{excludeHidden:!0}).getMerges();return Re.length===0?qe:Re[0]},[n]),Ce=Q=>{if(!Q||Q.coords.colIndex===0&&Q.coords.rowIndex===0)return null;const qe={};return Q.coords.colIndex>0&&(qe[ue.AnchorLocation.Left]={index:Q.coords.colIndex,scrollOffset:Q.topLeft.left}),Q.coords.rowIndex>0&&(qe[ue.AnchorLocation.Top]={index:Q.coords.rowIndex,scrollOffset:Q.topLeft.top}),qe},[he,me]=o.useState(()=>Ce(n.getView().getFreezePanes())),xe=r.useEditMode(),Le=o.useCallback(()=>we.current,[]),De=r.useCallbackRef(Q=>{xe.setMode(qe=>qe?.key==="edit"?{...qe,args:{...qe.args}}:{key:"edit",args:{stateAndCoords:null,start:Q}})},[]),We=r.useCallbackRef(()=>v,[v]),je=xr({sheet:n,commands:I,target:Le,onRepeatCommandChange:S,bodyStyle:pe,notifier:O,onStartEdit:De,getViewport:We}),[Ge,Ne]=o.useState(n.getSelection().isEntire()),[Xe,it]=o.useState(de?.getMovableSelection().length>0),pt=u!==null||Xe,wt=null,[_e,rt]=o.useState(!1);o.useEffect(()=>{rt(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{_e||(rt(!0),O.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[O,_e]),yt=o.useMemo(()=>{const Q=xe.getMode();return Q?.cursor?Q.cursor:null},[wt,xe]),[Ct,gt]=o.useState(null),lt=o.useRef(!1),[Tt,Lt]=o.useState([]),Zt=o.useRef(null),[Ft,Xt]=o.useState(ue.TypesUtils.EmptyTopLeft),[Mt,vn]=o.useState(ue.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Xt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{vn({left:0,top:le?.top})},[le?.top]),tt(n?.getView(),{onFreezeSplitChange:()=>{me(Ce(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ie(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),tt(n?.getSelection(),{onChange:()=>{Ne(n.getSelection().isEntire())}}),tt(n,{onViewChange(){be(n.getView()),oe(Ae())},onLayoutChange:()=>{const Q=n.getEntireRange();Ue({height:Q.getRowCount(),width:Q.getColumnCount()}),oe(Ae())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),tt(n,{onRequestScrollIntoView:async(Q,qe)=>{if(!qe)return;const Re={colIndex:qe?.coords.colStart,rowIndex:qe?.coords.rowStart};return await we.current?.scrollCellCoordsIntoView(Re,qe?.scroll),!0},onRequestFocus:()=>ue.CommonUtils.whenFocus(kt.current)},oi);const Cn=o.useMemo(()=>{const Q=(Re,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:Re,colEnd:Re})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getColOffset(Re)),Je=Ze.getBounds(),st=Math.min(Je.x+Je.width,et.getColOffset(Re+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Left||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Right)){const Xn=ue.CommonUtils.roundAccurately(Ke*ue.CommonUtils.getDPI(),0),qn=ue.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ke/Fe),2).toFixed(2),Yn="Width: "+(Ke?qn+" ("+Xn+" pixels)":"Hidden"),nn=Vt.current.getGridElement().getRelativePointFromClient(0,0),Pt=0-nn.y,Sn=0-nn.y+J,Jn={x:ot-(nn.x-Je.x),y:Pt,width:st-ot,height:Sn-Pt};requestAnimationFrame(()=>{lt.current&&ne?.({anchor:Jn,display:Yn})})}const It=[0,0,0,Je.height],tn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Gn={x:ot-1,y:0,width:1,height:Je.height},_n={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Zn={x:st-1,y:0,width:1,height:Je.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:It,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:It,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(Re,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(Re,Ke)},onResizeHeaders:(Re,Ke,Ze)=>{Q(Re,Ke)},onResizeHeadersDown:(Re,Ke)=>{Q(Re,Ke)},onResizeHeadersEnd:(Re,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Re=>{requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},...m}},[n,m,J,Ct]),Ot=o.useMemo(()=>{const Q=(Re,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:Re,rowEnd:Re,colStart:0,colEnd:C.width})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getRowOffset(Re)),Je=Ze.getBounds(),st=Math.min(Je.y+Je.height,et.getRowOffset(Re+1)),mt=Ze.getAnchor();if(Ke!==null&&(mt===ue.AnchorLocation.Top||mt===ue.AnchorLocation.Center||mt===ue.AnchorLocation.Bottom)){const Xn=Math.floor(10*ue.CommonUtils.getDPI())/10,qn=ue.CommonUtils.roundAccurately(Ke*Xn,0),Yn=ue.CommonUtils.roundAccurately(qn/Fe/(n?.getRowHeaders().getScaleFactor()*ue.CommonUtils.getDPI()),2).toFixed(2),nn="Height: "+(Ke?Yn+" ("+qn+" pixels)":"Hidden"),Pt=en.current.getGridElement().getRelativePointFromClient(0,0),Sn=0-Pt.x,Jn=0-Pt.x+$e,hl={x:Sn,y:ot-(Pt.y-Je.y),width:Jn-Sn,height:st-ot};requestAnimationFrame(()=>{lt.current&&X?.({anchor:hl,display:nn})})}const It=[0,0,Je.width,0],tn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Gn={x:0,y:ot-1,width:Je.width,height:1},_n={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Zn={x:0,y:st-1,width:Je.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:It,bounds:Gn,...tn}),c.jsx(dt.SVGLine,{linePoints:It,bounds:Zn,..._n})]},"resize-dividers")}])};let qe=null;return{onResizeHeadersStart:(Re,Ke,Ze)=>{qe=n.beginCommit(Ze),Q(Re,Ke)},onResizeHeaders:(Re,Ke,Ze)=>{Q(Re,Ke)},onResizeHeadersDown:(Re,Ke)=>{Q(Re,Ke)},onResizeHeadersEnd:(Re,Ke,Ze)=>{qe?.commit({description:Ze}),qe=null,requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Re=>{requestAnimationFrame(()=>ae?.()),lt.current=!1,gt(null)},...g}},[n,g,$e]),kt=r.useImperativeElement(t,()=>{const Q=Re=>{n?.getView()&&n.getView().selectMovables([]),ze.current=null,we?.current?.focus(Re)},qe=async(Re=null)=>{if(Re||(Re=n?.getView().getMovableSelection()[0]),!Re)return!1;const Ke=Re.getAnchorCoords();if(!Ke)return!1;const Ze=we.current?.getViewFromCellCoords({colIndex:Ke.colStart,rowIndex:Ke.rowStart});if(!Ze)return!1;const et=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Re)===-1&&n?.getView().selectMovables([Re]);let ot=ke.current?.get(et);return ot?.current?(await ot.current.focusMovable(Re),!0):(ze.current={movable:Re,anchor:et},!0)};return{getGridElement:()=>we.current,getRowHeaderElement:()=>en.current,getColumnHeaderElement:()=>Vt.current,rowHeaderHeight:()=>J,colHeaderWidth:()=>$e,startEdit:De,submitEdit:()=>{xe.setMode(Re=>Re?.key!=="edit"?Re:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{xe.setMode(Re=>Re?.key!=="edit"?Re:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:u!==null,focus:Re=>{n?.getView().getMovableSelection().length>0&&qe()||Q(Re)},focusSheet:Q,focusMovable:qe,contains:Re=>we?.current?.contains?.(Re),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(Q=>{Me.current||(we?.current?.invalidate(Q),N?.())},[]);o.useEffect(()=>{At()},[fe]);const Yt=Ge?ce.edgeStrokeFill:Se.fill,Hn=Ge?ge.fill:typeof fe.headerHover=="function"?fe.headerHover(Se)?.fill:Se.fill,nt=o.useMemo(()=>K?c.jsx("div",{className:bt("sheetxl-viewport-overlay",Ml),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:K}):c.jsx(c.Fragment,{}),[K]);let Jt=null;Oe&&He&&(Jt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${J}px`,width:`${$e}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:Q=>{let qe=!Q.ctrlKey;je?.getCommand("selectAll")?.execute(!qe||Q.button!==0),Q.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:-1,colIndex:-1}):we.current?.focus()},children:[c.jsx("div",{style:{height:J-5+"px",width:J-5+"px",clipPath:`path('M${J-5} 0 L0 ${J-5} L${J-5} ${J-5} L${J-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Hn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${J}px`,width:`${$e}px`,boxSizing:"border-box",borderRight:`solid 1px ${Se.strokeFill}`,borderBottom:`solid 1px ${Se.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const jt=r.useCallbackRef(({_left:Q,_top:qe})=>{},[]),bn=r.useCallbackRef(Q=>{if(!l)return;const qe=we.current.getViewFromClient(Q.clientX,Q.clientY)?.getCellCoordsFromClient(Q.clientX,Q.clientY);qe&&(l({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:qe.rowIndex,colIndex:qe.colIndex}),Q.stopPropagation(),Q.preventDefault())},[l]),at=r.useCallbackRef(Q=>{if(!(!Q.shiftKey&&(Q.ctrlKey||Q.metaKey)))return;const{deltaY:qe}=Q;return qe>0?je.getCommand("sheetZoomOut")?.execute():qe<0&&je.getCommand("sheetZoomIn")?.execute(),qe===0},[je]);o.useEffect(()=>{Lt(null),Zt.current=null,lt.current=!1,gt(null);const Q=n?.getView().getTopLeft();jt(Q),we.current?.scrollTo(Q),ie(Q),be(n.getView()),me(Ce(n.getView().getFreezePanes())),oe(Ae()),N()},[n?.getView()]);const ht=r.useCallbackRef(Q=>{const qe=Q.getVisibleRangeCoords();if(!qe)return null;const Re=[];return n.getRange(qe).forEach((Ke,Ze)=>{const et=Ze.getCoords(),ot=Ze.getCell();(Je=>{if(Je.isEmpty())return!1;const st=Je.getSpans();if(st.width>1||st.height>1||Je.getStyle().hasVisibleStyling()||de.isShowFormulas()&&Je.getFormula()!==null)return!0;const mt=Je.getValue();return mt!==null&&!(!de.isShowZeros()&&mt===0&&Je.getType()===s.ScalarType.Number)})(ot)&&Re.push({coords:et,value:ot,range:de.isShowFormulas()?null:ot.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Re},[n,de.isShowZeros(),de.isShowFormulas(),u]);o.useEffect(()=>{const Q=[];z&&Q.push(...z),Ct&&Q.push(...Ct),ue.CommonUtils.isEqualArrays(Q,Zt.current)||(Zt.current=Q,Lt(Q))},[z,Ct,fe]);const Qt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[fe?.header?.edgeStrokeFill]),yn=r.useCallbackRef(Q=>{Q.isDefaultPrevented()||Q.isPropagationStopped()||(ze.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Bt=o.useMemo(()=>{const Q=xe.getMode();return Q?.key==="cut"||Q?.key==="copy"},[xe]),Un=r.useCallbackRef(async Q=>{const qe=xe.getMode();return Q.keyCode===r.KeyCodes.Escape&&qe?(Q.preventDefault(),void xe.setMode(null)):Q.keyCode===r.KeyCodes.Enter&&Bt?(Q.preventDefault(),await je?.getCommand("paste")?.execute(),void xe.setMode(null)):void je?.dispatchToFocusedCommand(Q)},[je,xe]),en=o.useRef(null),wn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Ho,{ref:en,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Top],oppositeSize:$e,containerWidth:$e,containerHeight:Ve,sheetHeader:n.getRowHeaders(),gridStyle:Be,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Mt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${J+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${J}px)`,boxSizing:"border-box",zIndex:"2",...Ot?.style},...Ot})}),[$e,J,Ve,n,Mt,he?.[ue.AnchorLocation.Top],fe,E,l,Se.fill,g]),Vt=o.useRef(null),xn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Ho,{ref:Vt,sheetElement:kt.current,gridRef:we,freezeStart:he?.[ue.AnchorLocation.Left],oppositeSize:J,containerWidth:Ie,containerHeight:J,sheetHeader:n.getColumnHeaders(),gridStyle:Be,scrollPoint:Ft,onSheetContextMenu:l,...Cn,style:{...Cn?.style,position:"relative",left:"0px",width:"100%",height:`${J+Se.edgeStrokeWidth}px`,minHeight:`${J+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[J,Ie,n,Ft,he?.[ue.AnchorLocation.Left],fe,Se.fill,E,l,m]),al=r.useCallbackRef(Q=>{const{value:qe,key:Re,...Ke}=Q;let Ze=qe,et=u;if(!et||et.colIndex===Q.coords.colIndex&&et.rowIndex===Q.coords.rowIndex||(et=null),!Ze){const st=Q.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let ot=null;Ze.getHyperlink()&&(ot=async st=>{if(V?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(mt){O?.showError?.(mt)}}}),et&&et.colIndex===Q.range.colStart&&et.rowIndex===Q.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Je=n.getStyles();return o.createElement(fr,{...Ke,key:Re,bodyStyle:pe,docTheme:Je.getTheme(),normalStyle:Je.getNormal(),showFormulas:de.isShowFormulas(),showZeros:de.isShowZeros(),onLinkMouseDown:ot,...V,value:Ze})},[n,k,pe,u,de?.isShowFormulas(),de.isShowZeros()]),sl=o.useCallback((Q,qe)=>{const{key:Re,...Ke}=Q;return[c.jsx(El,{ref:qe,getVisibleCells:ht,sheet:n,gridStyle:fe,...Ke},`border-${Re}`),c.jsx(ei,{ref:qe,sheet:n,commands:je,...Ke},`table-${Re}`),c.jsx(ti,{ref:qe,sheet:n,...Ke},`spill-${Re}`),c.jsx($l,{ref:qe,sheet:n,commands:je,notifier:O,onShowTooltip:ye,onCloseTooltip:ae,gridStyle:fe,gridRef:we,editingCoords:u,isActive:E,...Ke},`selection-${Re}`),c.jsx(jl,{ref:qe,sheet:n,commands:je,gridStyle:fe,element:L,notifier:O,...Ke},`copy-paste-${Re}`),c.jsx(Xl,{ref:qe,sheet:n,commands:je,target:Le,notifier:O,renderMovable:W,movableProps:{onUnFocus:()=>{kt.current.focus()}},...Ke},`movable-${Re}`),c.jsx(Yl,{ref:qe,sheet:n,commands:je,notifier:O,gridStyle:fe,getCellEditor:B,showProtectedError:vt,setEditingCoords:T,...Ke},`editor-${Re}`)]},[n,we.current,fe,B,je,O]),[ko,dl]=o.useState(!1),cl=o.useMemo(()=>{if(Ie===0||Ve===0)return null;const Q=n.getStyles().getNormal(),qe=Q.getFont(),Re=Q.getFill(),Ke=Q.getBorder(),Ze=Q.getFill().getType()===s.IFill.Type.None;let et=Ee,ot=Ee;const Je=(mt,It,tn)=>tn?{stroke:Ke.getBottom().isNone()?"none":mt.getColor().toRGBA(pe.darkMode).toString(),...It}:It;ot=Je(Ke.getBottom(),ot,!Ke.getBottom().isNone()),ot=Je(Ke.getTop(),ot,!Ke.getTop().isNone()),et=Je(Ke.getRight(),et,!Ke.getRight().isNone()),et=Je(Ke.getLeft(),et,!Ke.getLeft().isNone());let st=de?.getGridLineColor()?.toRGBA(pe.darkMode).toString()??pe.strokeFill;return Ze||(ot=Je(Ke.getBottom(),ot,!0),ot=Je(Ke.getTop(),ot,!0),et=Je(Ke.getRight(),et,!0),et=Je(Ke.getLeft(),et,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...ni,...Re.toCSS(pe.darkMode),...qe.toCSS(pe.darkMode,Fe),"--sxl-app-color-background":pe.fill,"--sxl-app-color-shadow":fe.colorShadow,"--sxl-app-color-grey":fe.colorGrey,"--sxl-app-color-button-fill":Pe.fill,"--sxl-app-color-button-text":Pe.text?.fill,"--sxl-app-color-button-border":Pe.edgeStrokeFill,"--sxl-app-color-primary-dark":fe.selection.strokeFill},ref:we,zoom:Fe,...P,onFirstRender:mt=>{dl(!0),P?.onFirstRender?.(mt),je?.activate()},showGridLines:ve,gridLineColor:st,gridLineColumnsProps:et,gridLineRowsProps:ot,freezeLeft:he?.[ue.AnchorLocation.Left],freezeLeftProps:Qt,freezeTop:he?.[ue.AnchorLocation.Top],freezeTopProps:Qt,width:Ie,height:Ve,columnCount:C.width,rowCount:C.height,cursor:yt??wt??"cell",clipCells:!0,layout:k,cellRenderer:al,overlayRenderer:sl,getCellCoordsAsRangeCoords:se,getVisibleCells:ht,onWheelScroll:at,onPointerDown:yn,onKeyDown:Un,onViewportChange:Z,onImmediateScroll:jt,scrollPoint:le,stageProps:{onFocus:()=>{je?.activate()}},overlays:Tt})},[te]);o.useEffect(()=>{Me.current||N()},[k,he,Fe,je,le?.left,le?.top,pe,P,Ie,Ve,yt,Tt,E,wt]);let Kn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};q||(Kn={...Kn,...M});const ul=o.useMemo(()=>{const Q=n.getStyles().getTheme(),qe=Q.getColorScheme(),Re=Q.getFontScheme();return{"--sxl-doc-color-dk1":qe.getDk1().toCSS(pe.darkMode),"--sxl-doc-color-dk2":qe.getDk2().toCSS(pe.darkMode),"--sxl-doc-color-lt1":qe.getLt1().toCSS(pe.darkMode),"--sxl-doc-color-lt2":qe.getLt2().toCSS(pe.darkMode),"--sxl-doc-color-accent1":qe.getAccent1().toCSS(pe.darkMode),"--sxl-doc-color-accent2":qe.getAccent2().toCSS(pe.darkMode),"--sxl-doc-color-accent3":qe.getAccent3().toCSS(pe.darkMode),"--sxl-doc-color-accent4":qe.getAccent4().toCSS(pe.darkMode),"--sxl-doc-color-accent5":qe.getAccent5().toCSS(pe.darkMode),"--sxl-doc-color-accent6":qe.getAccent6().toCSS(pe.darkMode),"--sxl-doc-color-hlink":qe.getHlink().toCSS(pe.darkMode),"--sxl-doc-color-fol-hlink":qe.getFolHlink().toCSS(pe.darkMode),"--sxl-doc-font-major":Re.getMajorFont(),"--sxl-doc-font-minor":Re.getMinorFont()}},[n.getStyles().getTheme()]);let $n=c.jsx("div",{style:Kn,onTouchStart:()=>{Mo()},onFocus:Q=>{Y(!0),R?.(Q)},onBlur:Q=>{Y(!1),w?.(Q)},ref:kt,...$,children:c.jsx("div",{className:bt("sheetxl-sheet",kl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...ul},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Jt,wn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[xn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,backgroundColor:pe.fill},ref:x,onContextMenu:bn,children:[cl,nt,c.jsx(Tl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:fe?.selection?.strokeFill,colorCredits:fe?.body?.text?.fill})]})]})]})})});if(q){const Q=qe=>c.jsx(vo,{...qe,sheet:n});$n=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Se.fill}`,minHeight:2*Qe.height,minWidth:2*Qe.width,...M},viewport:v,touchElement:we.current?.stage,disableTouch:pt,onScrollViewport:qe=>{we.current?.scrollTo(qe)},createHorizontalScrollbar:Q,createVerticalScrollbar:Q,...h,children:$n})}o.useEffect(()=>{Me.current=!1,N?.(),j&&kt.current?.focus()},[n]);const[Wn,gl]=o.useState(!1),Mo=r.useCallbackRef(()=>{Wn||gl(!0)},[Wn]);return o.useEffect(()=>{if(ko)return typeof y=="function"&&y(),r.ReactUtils.detectIt().primaryInput==="touch"&&Mo(),()=>{}},[y,ko,Wn]),$n}));Tr.displayName="SheetElement";const ri=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Go="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Ir=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:p,onHide:g,onShow:q,onKeyDownCapture:h,onFocus:f,onBlur:I,loadingPanel:S,...D}=e,[z,W]=o.useState(!1),[K,y]=o.useState(null),[B,R]=o.useState(null),[w,M]=o.useState(null);o.useEffect(()=>{R(null),l.getDetails().then(A=>{W(!1),R(A.asUrl()),A.asSVGText?.()&&M(A.asSVGText())}).catch(A=>{console.warn(A),W(!0),R(Go),M(null)})},[l]);const O=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),F=o.useMemo(()=>{if(B||w)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:z?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:z?"var(--sxl-app-color-background, white)":void 0,boxShadow:z?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:z?"contain":void 0,opacity:K?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:B,onLoad:()=>{y(!0)},onError:({currentTarget:A})=>{console.log("error"),A.onerror=null,R(Go),W(!0)},alt:d??`${l.getType()}`})},[K,l,B,w,m]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...D,onKeyDownCapture:A=>{h?.(A)},ref:O,children:[K||z?void 0:S,F]})}));Ir.displayName="PictureEditor";const li=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const q=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:f,width:I}]=zt();if(!a.isClosed())return c.jsx("div",{...g,ref:Wt([q,h]),children:c.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ii="_editable-input_1bqx6_6",ai=e=>c.jsx("input",{...e}),Er=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:p=ai,notifier:g,styleHover:q={},dragging:h,maxLength:f,disabled:I=!1,readOnly:S=!1,...D}=e,[z,W]=o.useState(!1),[K,y]=o.useState(!1),[B,R]=o.useState(a);o.useEffect(()=>{R(a)},[a]);const w=o.useRef(null),[M,O]=o.useState(null),F=o.useCallback(function(te){const N=te.message;M!==N&&(g?.showMessage?.(N,{type:r.NotificationType.Error}),O(N))},[g,M]),A=o.useCallback(te=>{let N=!1;try{N=l?.(te)??!0}catch(x){F(x)}return N?(w.current=null,y(!1),R(te),N):(setTimeout(()=>{w.current?.focus()},0),N)},[l]),_=r.useCallbackRef(()=>{R(a),w.current=null,y(!1),m?.()},[m,a]),G=o.useMemo(()=>{if(!K)return null;const te={className:bt(ii),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:f,type:"text",value:B,onFocus:N=>{w.current||(w.current=N.target,setTimeout(()=>{N.target?.select()},0))},onBlur:N=>{w.current&&A(B)},onChange:N=>{K&&R(N.target.value)},onMouseDown:N=>N.stopPropagation(),onKeyDown:N=>N.code==="Escape"?(N.preventDefault(),void _()):N.code==="Enter"?(N.preventDefault(),void A(N.target.value)):void(N.code!=="Tab"?N.stopPropagation():A(N.target.value))};return c.jsx(c.Fragment,{children:p(te)})},[K,B,A,_,p,I]),[P,V]=o.useState();o.useLayoutEffect(()=>{let te=Object.assign({},n);(h||z)&&(te=Object.assign(te,q)),V(te)},[h,z,q,n]),o.useEffect(()=>{G&&d?.(B)},[G,d,B]);const $=r.useImperativeElement(t,()=>({startEdit(){I||S||y(!0)},cancel(){_()}}),[]);return c.jsxs("div",{...D,ref:$,style:{flexDirection:"column",display:"flex",...P},className:bt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{I||S||y(!0)},onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:K?0:1},children:B}),G]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...q},children:B})]})})),On=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Co(e){return"nodeType"in e}function ft(e){var t,n;return e?Gt(e)?e:Co(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bo(e){const{Document:t}=ft(e);return e instanceof t}function mn(e){return!Gt(e)&&e instanceof ft(e).HTMLElement}function Fr(e){return e instanceof ft(e).SVGElement}function $t(e){return e?Gt(e)?e.document:Co(e)?bo(e)?e:mn(e)||Fr(e)?e.ownerDocument:document:document:document}const St=On?o.useLayoutEffect:o.useEffect;function jn(e){const t=o.useRef(e);return St(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function un(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return St(()=>{n.current!==e&&(n.current=e)},t),n}function ln(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function En(e){const t=jn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Fn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let to={};function fn(e,t){return o.useMemo(()=>{if(t)return t;const n=to[e]==null?0:to[e]+1;return to[e]=n,e+"-"+n},[e,t])}function Ar(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[p,g]of m){const q=l[p];q!=null&&(l[p]=q+e*g)}return l},{...t})}}const Kt=Ar(1),gn=Ar(-1);function Bn(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function An(e){if(function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(t){return"clientX"in t&&"clientY"in t}(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{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;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),_o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function si(e){return e.matches(_o)?e:e.querySelector(_o)}const di={display:"none"};function ci(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:di},n)}function ui(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.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":i,"aria-atomic":!0},n)}const Dr=o.createContext(null),gi={draggable:`
|
|
24
24
|
To pick up a draggable item, press the space bar.
|
|
25
25
|
While dragging, use the arrow keys to move the item.
|
|
26
26
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
27
|
-
`},hi={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 mi(e){let{announcements:t=hi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=gi}=e;const{announce:l,announcement:d}=function(){const[h,f]=o.useState("");return{announce:o.useCallback(I=>{I!=null&&f(I)},[]),announcement:h}}(),m=fn("DndLiveRegion"),[p,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),function(h){const f=o.useContext(Dr);o.useEffect(()=>{if(!f)throw new Error("useDndMonitor must be used within a children of <DndContext>");return f(h)},[h,f])}(o.useMemo(()=>({onDragStart(h){let{active:f}=h;l(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:I}=h;t.onDragMove&&l(t.onDragMove({active:f,over:I}))},onDragOver(h){let{active:f,over:I}=h;l(t.onDragOver({active:f,over:I}))},onDragEnd(h){let{active:f,over:I}=h;l(t.onDragEnd({active:f,over:I}))},onDragCancel(h){let{active:f,over:I}=h;l(t.onDragCancel({active:f,over:I}))}}),[l,t])),!p)return null;const q=o.createElement(o.Fragment,null,o.createElement(ci,{id:i,value:a.draggable}),o.createElement(ui,{id:m,announcement:d}));return n?Dt.createPortal(q,n):q}var ct;function Dn(){}function no(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(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"})(ct||(ct={}));const Rt=Object.freeze({x:0,y:0});function zr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fi(e,t){const n=An(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Nr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function pi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Zo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Lr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Xo(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}}const vi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Xo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,p=n.get(m);if(p){const g=zr(Xo(p),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(Nr)};function Ci(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const p=t.width*t.height,g=e.width*e.height,q=d*m;return Number((q/(p+g-q)).toFixed(4))}return 0}const bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const p=Ci(m,t);p>0&&a.push({id:d,data:{droppableContainer:l,value:p}})}}return a.sort(pi)};function Yo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Rt}function yi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const wi=yi(1);function Or(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const xi={ignoreTransform:!1};function _t(e,t){t===void 0&&(t=xi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:q}=ft(e).getComputedStyle(e);g&&(n=function(h,f,I){const S=Or(f);if(!S)return h;const{scaleX:D,scaleY:z,x:W,y:K}=S,w=h.left-W-(1-D)*parseFloat(I),j=h.top-K-(1-z)*parseFloat(I.slice(I.indexOf(" ")+1)),R=D?h.width/D:h.width,y=z?h.height/z:h.height;return{width:R,height:y,top:j,right:w+R,bottom:j+y,left:w}}(n,g,q))}const{top:i,left:a,width:l,height:d,bottom:m,right:p}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:p}}function Jo(e){return _t(e,{ignoreTransform:!0})}function Vn(e,t){const n=[];return e?function i(a){if(t!=null&&n.length>=t||!a)return n;if(bo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!mn(a)||Fr(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const q=m[g];return typeof q=="string"&&p.test(q)})}(a,l)&&n.push(a),function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"}(a,l)?n:i(a.parentNode)}(e):n}function jr(e){const[t]=Vn(e,1);return t??null}function oo(e){return On&&e?Gt(e)?e:Co(e)?bo(e)||e===$t(e).scrollingElement?window:mn(e)?e:null:null:null}function Br(e){return Gt(e)?e.scrollX:e.scrollLeft}function Vr(e){return Gt(e)?e.scrollY:e.scrollTop}function co(e){return{x:Br(e),y:Vr(e)}}var ut;function Pr(e){return!(!On||!e)&&e===document.scrollingElement}function Hr(e){const t={x:0,y:0},n=Pr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const qi={x:.2,y:.2};function Si(e,t,n,i,a){let{top:l,left:d,right:m,bottom:p}=n;i===void 0&&(i=10),a===void 0&&(a=qi);const{isTop:g,isBottom:q,isLeft:h,isRight:f}=Hr(e),I={x:0,y:0},S={x:0,y:0},D=t.height*a.y,z=t.width*a.x;return!g&&l<=t.top+D?(I.y=ut.Backward,S.y=i*Math.abs((t.top+D-l)/D)):!q&&p>=t.bottom-D&&(I.y=ut.Forward,S.y=i*Math.abs((t.bottom-D-p)/D)),!f&&m>=t.right-z?(I.x=ut.Forward,S.x=i*Math.abs((t.right-z-m)/z)):!h&&d<=t.left+z&&(I.x=ut.Backward,S.x=i*Math.abs((t.left+z-d)/z)),{direction:I,speed:S}}function Ri(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Ur(e){return e.reduce((t,n)=>Kt(t,co(n)),Rt)}function Kr(e,t){if(t===void 0&&(t=_t),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);jr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ki=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Br(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Vr(n),0)}]];class uo{constructor(t,n){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;const i=Vn(n),a=Ur(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of ki)for(const p of d)Object.defineProperty(this,p,{get:()=>{const g=m(i),q=a[l]-g;return this.rect[p]+q},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function ro(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var xt,Ye;function Qo(e){e.preventDefault()}function Mi(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"})(xt||(xt={})),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"}(Ye||(Ye={}));const $r={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class yo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new an($t(n)),this.windowListeners=new an(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Kr(i),n(Rt)}handleKeyDown(t){if(Bn(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=$r,coordinateGetter:d=Ti,scrollBehavior:m="smooth"}=a,{code:p}=t;if(l.end.includes(p))return void this.handleEnd(t);if(l.cancel.includes(p))return void this.handleCancel(t);const{collisionRect:g}=i.current,q=g?{x:g.left,y:g.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=q);const h=d(t,{active:n,context:i.current,currentCoordinates:q});if(h){const f=gn(h,q),I={x:0,y:0},{scrollableAncestors:S}=i.current;for(const D of S){const z=t.code,{isTop:W,isRight:K,isLeft:w,isBottom:j,maxScroll:R,minScroll:y}=Hr(D),M=Ri(D),B={x:Math.min(z===Ye.Right?M.right-M.width/2:M.right,Math.max(z===Ye.Right?M.left:M.left+M.width/2,h.x)),y:Math.min(z===Ye.Down?M.bottom-M.height/2:M.bottom,Math.max(z===Ye.Down?M.top:M.top+M.height/2,h.y))},F=z===Ye.Right&&!K||z===Ye.Left&&!w,A=z===Ye.Down&&!j||z===Ye.Up&&!W;if(F&&B.x!==h.x){const _=D.scrollLeft+f.x,G=z===Ye.Right&&_<=R.x||z===Ye.Left&&_>=y.x;if(G&&!f.y)return void D.scrollTo({left:_,behavior:m});I.x=G?D.scrollLeft-_:z===Ye.Right?D.scrollLeft-R.x:D.scrollLeft-y.x,I.x&&D.scrollBy({left:-I.x,behavior:m});break}if(A&&B.y!==h.y){const _=D.scrollTop+f.y,G=z===Ye.Down&&_<=R.y||z===Ye.Up&&_>=y.y;if(G&&!f.x)return void D.scrollTo({top:_,behavior:m});I.y=G?D.scrollTop-_:z===Ye.Down?D.scrollTop-R.y:D.scrollTop-y.y,I.y&&D.scrollBy({top:-I.y,behavior:m});break}}this.handleMove(t,Kt(gn(h,this.referenceCoordinates),I))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function er(e){return!!(e&&"distance"in e)}function tr(e){return!!(e&&"delay"in e)}yo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=$r,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class wo{constructor(t,n,i){var a;i===void 0&&(i=function(m){const{EventTarget:p}=ft(m);return m instanceof p?m:$t(m)}(t.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=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=$t(d),this.documentListeners=new an(this.document),this.listeners=new an(i),this.windowListeners=new an(ft(d)),this.initialCoordinates=(a=An(l))!=null?a:Rt,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(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,Qo),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,Qo),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(er(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Mi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const p=(n=An(t))!=null?n:Rt,g=gn(a,p);if(!i&&m){if(er(m)){if(m.tolerance!=null&&ro(g,m.tolerance))return this.handleCancel();if(ro(g,m.distance))return this.handleStart()}return tr(m)&&ro(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(p)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ii={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wr extends wo{constructor(t){const{event:n}=t,i=$t(n.target);super(t,Ii,i)}}Wr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Ei={move:{name:"mousemove"},end:{name:"mouseup"}};var go;(function(e){e[e.RightClick=2]="RightClick"})(go||(go={}));class Gr extends wo{constructor(t){super(t,Ei,$t(t.event.target))}}Gr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==go.RightClick&&(i?.({event:n}),!0)}}];const lo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _r extends wo{constructor(t){super(t,lo)}static setup(){return window.addEventListener(lo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(lo.move.name,t)};function t(){}}}var sn,zn;function Fi(e){let{acceleration:t,activator:n=sn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=zn.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:q,delta:h,threshold:f}=e;const I=function(y){let{delta:M,disabled:B}=y;const F=Fn(M);return ln(A=>{if(B||!F||!A)return Ai;const _={x:Math.sign(M.x-F.x),y:Math.sign(M.y-F.y)};return{x:{[ut.Backward]:A.x[ut.Backward]||_.x===-1,[ut.Forward]:A.x[ut.Forward]||_.x===1},y:{[ut.Backward]:A.y[ut.Backward]||_.y===-1,[ut.Forward]:A.y[ut.Forward]||_.y===1}}},[B,M,F])}({delta:h,disabled:!l}),[S,D]=function(){const y=o.useRef(null);return[o.useCallback((M,B)=>{y.current=setInterval(M,B)},[]),o.useCallback(()=>{y.current!==null&&(clearInterval(y.current),y.current=null)},[])]}(),z=o.useRef({x:0,y:0}),W=o.useRef({x:0,y:0}),K=o.useMemo(()=>{switch(n){case sn.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case sn.DraggableRect:return a}},[n,a,p]),w=o.useRef(null),j=o.useCallback(()=>{const y=w.current;if(!y)return;const M=z.current.x*W.current.x,B=z.current.y*W.current.y;y.scrollBy(M,B)},[]),R=o.useMemo(()=>m===zn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&K){for(const y of R){if(i?.(y)===!1)continue;const M=g.indexOf(y),B=q[M];if(!B)continue;const{direction:F,speed:A}=Si(y,B,K,t,f);for(const _ of["x","y"])I[_][F[_]]||(A[_]=0,F[_]=0);if(A.x>0||A.y>0)return D(),w.current=y,S(j,d),z.current=A,void(W.current=F)}z.current={x:0,y:0},W.current={x:0,y:0},D()}else D()},[t,j,i,D,l,d,JSON.stringify(K),JSON.stringify(I),S,g,R,q,JSON.stringify(f)])}_r.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(sn||(sn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zn||(zn={}));const Ai={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var hn,ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hn||(hn={})),function(e){e.Optimized="optimized"}(ho||(ho={}));const nr=new Map;function mo(e,t){return ln(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=jn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function Di(e){return new uo(_t(e),e)}function or(e,t,n){t===void 0&&(t=Di);const[i,a]=o.useState(null);function l(){a(p=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=p??n)!=null?g:null;const q=t(e);return JSON.stringify(p)===JSON.stringify(q)?p:q})}const d=function(p){let{callback:g,disabled:q}=p;const h=jn(g),f=o.useMemo(()=>{if(q||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:I}=window;return new I(h)},[h,q]);return o.useEffect(()=>()=>f?.disconnect(),[f]),f}({callback(p){if(e)for(const g of p){const{type:q,target:h}=g;if(q==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Nn({callback:l});return St(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const rr=[];function lr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Rt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?gn(e,n.current):Rt}function ir(e){return o.useMemo(()=>e?function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}}(e):null,[e])}const ar=[];function Zr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mn(t)?t:e}const zi=[{sensor:Wr,options:{}},{sensor:yo,options:{}}],Ni={current:{}},In={draggable:{measure:Jo},droppable:{measure:Jo,strategy:hn.WhileDragging,frequency:ho.Optimized},dragOverlay:{measure:_t}};class dn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Li={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Dn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:In,measureDroppableContainers:Dn,windowRect:null,measuringScheduled:!1},Xr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Dn,draggableNodes:new Map,over:null,measureDroppableContainers:Dn},pn=o.createContext(Xr),Yr=o.createContext(Li);function Oi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dn}}}function ji(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.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 ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new dn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new dn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new dn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Bi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(pn),l=Fn(i),d=Fn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Bn(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const q of[p.current,g.current]){if(!q)continue;const h=si(q);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function Jr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Pn=o.createContext({...Rt,scaleX:1,scaleY:1});var Et;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Et||(Et={}));const Vi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:p,sensors:g=zi,collisionDetection:q=bi,measuring:h,modifiers:f,...I}=e;const S=o.useReducer(ji,void 0,Oi),[D,z]=S,[W,K]=function(){const[v]=o.useState(()=>new Set),U=o.useCallback(Z=>(v.add(Z),()=>v.delete(Z)),[v]);return[o.useCallback(Z=>{let{type:ee,event:le}=Z;v.forEach(ie=>{var se;return(se=ie[ee])==null?void 0:se.call(ie,le)})},[v]),U]}(),[w,j]=o.useState(Et.Uninitialized),R=w===Et.Initialized,{draggable:{active:y,nodes:M,translate:B},droppable:{containers:F}}=D,A=y!=null?M.get(y):null,_=o.useRef({initial:null,translated:null}),G=o.useMemo(()=>{var v;return y!=null?{id:y,data:(v=A?.data)!=null?v:Ni,rect:_}:null},[y,A]),P=o.useRef(null),[V,$]=o.useState(null),[te,N]=o.useState(null),x=un(I,Object.values(I)),H=fn("DndDescribedBy",l),re=o.useMemo(()=>F.getEnabled(),[F]),ye=(ne=h,o.useMemo(()=>({draggable:{...In.draggable,...ne?.draggable},droppable:{...In.droppable,...ne?.droppable},dragOverlay:{...In.dragOverlay,...ne?.dragOverlay}}),[ne?.draggable,ne?.droppable,ne?.dragOverlay]));var ne;const{droppableRects:X,measureDroppableContainers:ae,measuringScheduled:Me}=function(v,U){let{dragging:Z,dependencies:ee,config:le}=U;const[ie,se]=o.useState(null),{frequency:Ce,measure:he,strategy:me}=le,xe=o.useRef(v),Le=function(){switch(me){case hn.Always:return!1;case hn.BeforeDragging:return Z;default:return!Z}}(),De=un(Le),We=o.useCallback(function(Ne){Ne===void 0&&(Ne=[]),De.current||se(Xe=>Xe===null?Ne:Xe.concat(Ne.filter(it=>!Xe.includes(it))))},[De]),je=o.useRef(null),Ge=ln(Ne=>{if(Le&&!Z)return nr;if(!Ne||Ne===nr||xe.current!==v||ie!=null){const Xe=new Map;for(let it of v){if(!it)continue;if(ie&&ie.length>0&&!ie.includes(it.id)&&it.rect.current){Xe.set(it.id,it.rect.current);continue}const pt=it.node.current,wt=pt?new uo(he(pt),pt):null;it.rect.current=wt,wt&&Xe.set(it.id,wt)}return Xe}return Ne},[v,ie,Z,Le,he]);return o.useEffect(()=>{xe.current=v},[v]),o.useEffect(()=>{Le||We()},[Z,Le]),o.useEffect(()=>{ie&&ie.length>0&&se(null)},[JSON.stringify(ie)]),o.useEffect(()=>{Le||typeof Ce!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},Ce))},[Ce,Le,We,...ee]),{droppableRects:Ge,measureDroppableContainers:We,measuringScheduled:ie!=null}}(re,{dragging:R,dependencies:[B.x,B.y],config:ye.droppable}),Te=function(v,U){const Z=U!=null?v.get(U):void 0,ee=Z?Z.node.current:null;return ln(le=>{var ie;return U==null?null:(ie=ee??le)!=null?ie:null},[ee,U])}(M,y),fe=o.useMemo(()=>te?An(te):null,[te]),Be=function(){const v=V?.autoScrollEnabled===!1,U=typeof m=="object"?m.enabled===!1:m===!1,Z=R&&!v&&!U;return typeof m=="object"?{...m,enabled:Z}:{enabled:Z}}(),pe=function(v,U){return mo(v,U)}(Te,ye.draggable.measure);(function(v){let{activeNode:U,measure:Z,initialRect:ee,config:le=!0}=v;const ie=o.useRef(!1),{x:se,y:Ce}=typeof le=="boolean"?{x:le,y:le}:le;St(()=>{if(!se&&!Ce||!U)return void(ie.current=!1);if(ie.current||!ee)return;const he=U?.node.current;if(!he||he.isConnected===!1)return;const me=Yo(Z(he),ee);if(se||(me.x=0),Ce||(me.y=0),ie.current=!0,Math.abs(me.x)>0||Math.abs(me.y)>0){const xe=jr(he);xe&&xe.scrollBy({top:me.y,left:me.x})}},[U,se,Ce,ee,Z])})({activeNode:y!=null?M.get(y):null,config:Be.layoutShiftCompensation,initialRect:pe,measure:ye.draggable.measure});const Pe=or(Te,ye.draggable.measure,pe),Se=or(Te?Te.parentElement:null),ge=o.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ce=F.getNodeFor((t=ge.current.over)==null?void 0:t.id),we=function(v){let{measure:U}=v;const[Z,ee]=o.useState(null),le=Nn({callback:o.useCallback(he=>{for(const{target:me}of he)if(mn(me)){ee(xe=>{const Le=U(me);return xe?{...xe,width:Le.width,height:Le.height}:Le});break}},[U])}),ie=o.useCallback(he=>{const me=Zr(he);le?.disconnect(),me&&le?.observe(me),ee(me?U(me):null)},[U,le]),[se,Ce]=En(ie);return o.useMemo(()=>({nodeRef:se,rect:Z,setRef:Ce}),[Z,se,Ce])}({measure:ye.dragOverlay.measure}),de=(n=we.nodeRef.current)!=null?n:Te,be=R?(i=we.rect)!=null?i:Pe:null,Fe=!!(we.nodeRef.current&&we.rect),ve=Yo(Ee=Fe?null:Pe,mo(Ee));var Ee;const Oe=ir(de?ft(de):null),He=function(v){const U=o.useRef(v),Z=ln(ee=>v?ee&&ee!==rr&&v&&U.current&&v.parentNode===U.current.parentNode?ee:Vn(v):rr,[v]);return o.useEffect(()=>{U.current=v},[v]),Z}(R?ce??Te:null),C=function(v,U){U===void 0&&(U=_t);const[Z]=v,ee=ir(Z?ft(Z):null),[le,ie]=o.useState(ar);function se(){ie(()=>v.length?v.map(he=>Pr(he)?ee:new uo(U(he),he)):ar)}const Ce=Nn({callback:se});return St(()=>{Ce?.disconnect(),se(),v.forEach(he=>Ce?.observe(he))},[v]),le}(He),Ue=Jr(f,{transform:{x:B.x-ve.x,y:B.y-ve.y,scaleX:1,scaleY:1},activatorEvent:te,active:G,activeNodeRect:Pe,containerNodeRect:Se,draggingNodeRect:be,over:ge.current.over,overlayNodeRect:we.rect,scrollableAncestors:He,scrollableAncestorRects:C,windowRect:Oe}),Qe=fe?Kt(fe,B):null,$e=function(v){const[U,Z]=o.useState(null),ee=o.useRef(v),le=o.useCallback(ie=>{const se=oo(ie.target);se&&Z(Ce=>Ce?(Ce.set(se,co(se)),new Map(Ce)):null)},[]);return o.useEffect(()=>{const ie=ee.current;if(v!==ie){se(ie);const Ce=v.map(he=>{const me=oo(he);return me?(me.addEventListener("scroll",le,{passive:!0}),[me,co(me)]):null}).filter(he=>he!=null);Z(Ce.length?new Map(Ce):null),ee.current=v}return()=>{se(v),se(ie)};function se(Ce){Ce.forEach(he=>{const me=oo(he);me?.removeEventListener("scroll",le)})}},[le,v]),o.useMemo(()=>v.length?U?Array.from(U.values()).reduce((ie,se)=>Kt(ie,se),Rt):Ur(v):Rt,[v,U])}(He),J=lr($e),Ie=lr($e,[Pe]),Ve=Kt(Ue,J),ke=be?wi(be,Ue):null,ze=G&&ke?q({active:G,collisionRect:ke,droppableRects:X,droppableContainers:re,pointerCoordinates:Qe}):null,Ae=Lr(ze,"id"),[k,oe]=o.useState(null),O=function(v,U,Z){return{...v,scaleX:U&&Z?U.width/Z.width:1,scaleY:U&&Z?U.height/Z.height:1}}(Fe?Ue:Kt(Ue,Ie),(a=k?.rect)!=null?a:null,Pe),Y=o.useRef(null),u=o.useCallback((v,U)=>{let{sensor:Z,options:ee}=U;if(P.current==null)return;const le=M.get(P.current);if(!le)return;const ie=v.nativeEvent,se=new Z({active:P.current,activeNode:le,event:ie,options:ee,context:ge,onAbort(he){if(!M.get(he))return;const{onDragAbort:me}=x.current,xe={id:he};me?.(xe),W({type:"onDragAbort",event:xe})},onPending(he,me,xe,Le){if(!M.get(he))return;const{onDragPending:De}=x.current,We={id:he,constraint:me,initialCoordinates:xe,offset:Le};De?.(We),W({type:"onDragPending",event:We})},onStart(he){const me=P.current;if(me==null)return;const xe=M.get(me);if(!xe)return;const{onDragStart:Le}=x.current,De={activatorEvent:ie,active:{id:me,data:xe.data,rect:_}};Dt.unstable_batchedUpdates(()=>{Le?.(De),j(Et.Initializing),z({type:ct.DragStart,initialCoordinates:he,active:me}),W({type:"onDragStart",event:De}),$(Y.current),N(ie)})},onMove(he){z({type:ct.DragMove,coordinates:he})},onEnd:Ce(ct.DragEnd),onCancel:Ce(ct.DragCancel)});function Ce(he){return async function(){const{active:me,collisions:xe,over:Le,scrollAdjustedTranslate:De}=ge.current;let We=null;if(me&&De){const{cancelDrop:je}=x.current;We={activatorEvent:ie,active:me,collisions:xe,delta:De,over:Le},he===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(he=ct.DragCancel)}P.current=null,Dt.unstable_batchedUpdates(()=>{z({type:he}),j(Et.Uninitialized),oe(null),$(null),N(null),Y.current=null;const je=he===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Ge=x.current[je];Ge?.(We),W({type:je,event:We})}})}}Y.current=se},[M]),T=o.useCallback((v,U)=>(Z,ee)=>{const le=Z.nativeEvent,ie=M.get(ee);if(P.current!==null||!ie||le.dndKit||le.defaultPrevented)return;const se={active:ie};v(Z,U.options,se)===!0&&(le.dndKit={capturedBy:U.sensor},P.current=ee,u(Z,U))},[M,u]),E=function(v,U){return o.useMemo(()=>v.reduce((Z,ee)=>{const{sensor:le}=ee;return[...Z,...le.activators.map(ie=>({eventName:ie.eventName,handler:U(ie.handler,ee)}))]},[]),[v,U])}(g,T);(function(v){o.useEffect(()=>{if(!On)return;const U=v.map(Z=>{let{sensor:ee}=Z;return ee.setup==null?void 0:ee.setup()});return()=>{for(const Z of U)Z?.()}},v.map(U=>{let{sensor:Z}=U;return Z}))})(g),St(()=>{Pe&&w===Et.Initializing&&j(Et.Initialized)},[Pe,w]),o.useEffect(()=>{const{onDragMove:v}=x.current,{active:U,activatorEvent:Z,collisions:ee,over:le}=ge.current;if(!U||!Z)return;const ie={active:U,activatorEvent:Z,collisions:ee,delta:{x:Ve.x,y:Ve.y},over:le};Dt.unstable_batchedUpdates(()=>{v?.(ie),W({type:"onDragMove",event:ie})})},[Ve.x,Ve.y]),o.useEffect(()=>{const{active:v,activatorEvent:U,collisions:Z,droppableContainers:ee,scrollAdjustedTranslate:le}=ge.current;if(!v||P.current==null||!U||!le)return;const{onDragOver:ie}=x.current,se=ee.get(Ae),Ce=se&&se.rect.current?{id:se.id,rect:se.rect.current,data:se.data,disabled:se.disabled}:null,he={active:v,activatorEvent:U,collisions:Z,delta:{x:le.x,y:le.y},over:Ce};Dt.unstable_batchedUpdates(()=>{oe(Ce),ie?.(he),W({type:"onDragOver",event:he})})},[Ae]),St(()=>{ge.current={activatorEvent:te,active:G,activeNode:Te,collisionRect:ke,collisions:ze,droppableRects:X,draggableNodes:M,draggingNode:de,draggingNodeRect:be,droppableContainers:F,over:k,scrollableAncestors:He,scrollAdjustedTranslate:Ve},_.current={initial:be,translated:ke}},[G,Te,ze,ke,M,de,be,X,F,k,He,Ve]),Fi({...Be,delta:B,draggingRect:ke,pointerCoordinates:Qe,scrollableAncestors:He,scrollableAncestorRects:C});const b=o.useMemo(()=>({active:G,activeNode:Te,activeNodeRect:Pe,activatorEvent:te,collisions:ze,containerNodeRect:Se,dragOverlay:we,draggableNodes:M,droppableContainers:F,droppableRects:X,over:k,measureDroppableContainers:ae,scrollableAncestors:He,scrollableAncestorRects:C,measuringConfiguration:ye,measuringScheduled:Me,windowRect:Oe}),[G,Te,Pe,te,ze,Se,we,M,F,X,k,ae,He,C,ye,Me,Oe]),L=o.useMemo(()=>({activatorEvent:te,activators:E,active:G,activeNodeRect:Pe,ariaDescribedById:{draggable:H},dispatch:z,draggableNodes:M,over:k,measureDroppableContainers:ae}),[te,E,G,Pe,z,H,M,k,ae]);return o.createElement(Dr.Provider,{value:K},o.createElement(pn.Provider,{value:L},o.createElement(Yr.Provider,{value:b},o.createElement(Pn.Provider,{value:O},p)),o.createElement(Bi,{disabled:d?.restoreFocus===!1})),o.createElement(mi,{...d,hiddenTextDescribedById:H}))}),Pi=o.createContext(null),sr="button";function Hi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=fn("Draggable"),{activators:d,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:q,draggableNodes:h,over:f}=o.useContext(pn),{role:I=sr,roleDescription:S="draggable",tabIndex:D=0}=a??{},z=p?.id===t,W=o.useContext(z?Pn:Pi),[K,w]=En(),[j,R]=En(),y=function(B,F){return o.useMemo(()=>B.reduce((A,_)=>{let{eventName:G,handler:P}=_;return A[G]=V=>{P(V,F)},A},{}),[B,F])}(d,t),M=un(n);return St(()=>(h.set(t,{id:t,key:l,node:K,activatorNode:j,data:M}),()=>{const B=h.get(t);B&&B.key===l&&h.delete(t)}),[h,t]),{active:p,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:I,tabIndex:D,"aria-disabled":i,"aria-pressed":!(!z||I!==sr)||void 0,"aria-roledescription":S,"aria-describedby":q.draggable}),[i,I,D,z,S,q.draggable]),isDragging:z,listeners:i?void 0:y,node:K,over:f,setNodeRef:w,setActivatorNodeRef:R,transform:W}}function Qr(){return o.useContext(Yr)}const Ui={timeout:25};function Ki(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Fn(n);return n||i||!m||a(m),St(()=>{if(!l)return;const p=i?.key,g=i?.props.id;p!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const $i={x:0,y:0,scaleX:1,scaleY:1};function Wi(e){let{children:t}=e;return o.createElement(pn.Provider,{value:Xr},o.createElement(Pn.Provider,{value:$i},t))}const Gi={position:"fixed",touchAction:"none"},_i=e=>Bn(e)?"transform 250ms ease":void 0,Zi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:p,transform:g,transition:q=_i}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},f={...Gi,width:m.width,height:m.height,top:m.top,left:m.left,transform:Nt.Transform.toString(h),transformOrigin:a&&i?fi(i,m):void 0,transition:typeof q=="function"?q(i):q,...p};return o.createElement(n,{className:d,style:f,ref:t},l)}),Xi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,p]of Object.entries(l.active))p!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,p));if(l!=null&&l.dragOverlay)for(const[m,p]of Object.entries(l.dragOverlay))p!==void 0&&i.node.style.setProperty(m,p);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,p]of Object.entries(a))n.node.style.setProperty(m,p);d!=null&&d.active&&n.node.classList.remove(d.active)}},el={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nt.Transform.toString(t)},{transform:Nt.Transform.toString(n)}]},sideEffects:Xi({styles:{active:{opacity:"0"}}})};function Yi(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return jn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const p=m.node.current;if(!p)return;const g=Zr(d);if(!g)return;const{transform:q}=ft(d).getComputedStyle(d),h=Or(q);if(!h)return;const f=typeof t=="function"?t:function(I){const{duration:S,easing:D,sideEffects:z,keyframes:W}={...el,...I};return K=>{let{active:w,dragOverlay:j,transform:R,...y}=K;if(!S)return;const M={x:j.rect.left-w.rect.left,y:j.rect.top-w.rect.top},B={scaleX:R.scaleX!==1?w.rect.width*R.scaleX/j.rect.width:1,scaleY:R.scaleY!==1?w.rect.height*R.scaleY/j.rect.height:1},F={x:R.x-M.x,y:R.y-M.y,...B},A=W({...y,active:w,dragOverlay:j,transform:{initial:R,final:F}}),[_]=A,G=A[A.length-1];if(JSON.stringify(_)===JSON.stringify(G))return;const P=z?.({active:w,dragOverlay:j,...y}),V=j.node.animate(A,{duration:S,easing:D,fill:"forwards"});return new Promise($=>{V.onfinish=()=>{P?.(),$()}})}}(t);return Kr(p,a.draggable.measure),f({active:{id:l,data:m.data,node:p,rect:a.draggable.measure(p)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let dr=0;function Ji(e){return o.useMemo(()=>{if(e!=null)return dr++,dr},[e])}const Qi=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:p,zIndex:g=999}=e;const{activatorEvent:q,active:h,activeNodeRect:f,containerNodeRect:I,draggableNodes:S,droppableContainers:D,dragOverlay:z,over:W,measuringConfiguration:K,scrollableAncestors:w,scrollableAncestorRects:j,windowRect:R}=Qr(),y=o.useContext(Pn),M=Ji(h?.id),B=Jr(d,{activatorEvent:q,active:h,activeNodeRect:f,containerNodeRect:I,draggingNodeRect:z.rect,over:W,overlayNodeRect:z.rect,scrollableAncestors:w,scrollableAncestorRects:j,transform:y,windowRect:R}),F=mo(f),A=Yi({config:i,draggableNodes:S,droppableContainers:D,measuringConfiguration:K}),_=F?z.setRef:void 0;return o.createElement(Wi,null,o.createElement(Ki,{animation:A},h&&M?o.createElement(Zi,{key:M,id:h.id,ref:_,as:m,activatorEvent:q,adjustScale:t,className:p,transition:l,rect:F,style:{zIndex:g,...a},transform:B},n):null))});function xo(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ea(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Mn(e){return e!==null&&e>=0}const Tn={scaleX:1,scaleY:1},ta=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const p=function(g,q,h){const f=g[q],I=g[q-1],S=g[q+1];return!f||!I&&!S?0:h<q?I?f.left-(I.left+I.width):S.left-(f.left+f.width):S?S.left-(f.left+f.width):f.left-(I.left+I.width)}(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...Tn}:null}return d>a&&d<=l?{x:-m.width-p,y:0,...Tn}:d<a&&d>=l?{x:m.width+p,y:0,...Tn}:{x:0,y:0,...Tn}},qo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=xo(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},tl="Sortable",nl=o.createContext({activeIndex:-1,containerId:tl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qo,disabled:{draggable:!1,droppable:!1}});function na(e){let{children:t,id:n,items:i,strategy:a=qo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:q}=Qr(),h=fn(tl,n),f=m.rect!==null,I=o.useMemo(()=>i.map(y=>typeof y=="object"&&"id"in y?y.id:y),[i]),S=d!=null,D=d?I.indexOf(d.id):-1,z=g?I.indexOf(g.id):-1,W=o.useRef(I),K=!function(y,M){if(y===M)return!0;if(y.length!==M.length)return!1;for(let B=0;B<y.length;B++)if(y[B]!==M[B])return!1;return!0}(I,W.current),w=z!==-1&&D===-1||K,j=function(y){return typeof y=="boolean"?{draggable:y,droppable:y}:y}(l);St(()=>{K&&S&&q(I)},[K,I,S,q]),o.useEffect(()=>{W.current=I},[I]);const R=o.useMemo(()=>({activeIndex:D,containerId:h,disabled:j,disableTransforms:w,items:I,overIndex:z,useDragOverlay:f,sortedRects:ea(I,p),strategy:a}),[D,h,j.draggable,j.droppable,w,I,z,p,f,a]);return o.createElement(nl.Provider,{value:R},t)}const oa=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return xo(n,i,a).indexOf(t)},ra=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:p,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===p)},la={duration:200,easing:"ease"},ol="transform",ia=Nt.Transition.toString({property:ol,duration:0,easing:"linear"}),aa={roleDescription:"sortable"};function sa(e){let{animateLayoutChanges:t=ra,attributes:n,disabled:i,data:a,getNewIndex:l=oa,id:d,strategy:m,resizeObserverConfig:p,transition:g=la}=e;const{items:q,containerId:h,activeIndex:f,disabled:I,disableTransforms:S,sortedRects:D,overIndex:z,useDragOverlay:W,strategy:K}=o.useContext(nl),w=function(ce,we){var de,be;return typeof ce=="boolean"?{draggable:ce,droppable:!1}:{draggable:(de=ce?.draggable)!=null?de:we.draggable,droppable:(be=ce?.droppable)!=null?be:we.droppable}}(i,I),j=q.indexOf(d),R=o.useMemo(()=>({sortable:{containerId:h,index:j,items:q},...a}),[h,a,j,q]),y=o.useMemo(()=>q.slice(q.indexOf(d)),[q,d]),{rect:M,node:B,isOver:F,setNodeRef:A}=function(ce){let{data:we,disabled:de=!1,id:be,resizeObserverConfig:Fe}=ce;const ve=fn("Droppable"),{active:Ee,dispatch:Oe,over:He,measureDroppableContainers:C}=o.useContext(pn),Ue=o.useRef({disabled:de}),Qe=o.useRef(!1),$e=o.useRef(null),J=o.useRef(null),{disabled:Ie,updateMeasurementsFor:Ve,timeout:ke}={...Ui,...Fe},ze=un(Ve??be),Ae=Nn({callback:o.useCallback(()=>{Qe.current?(J.current!=null&&clearTimeout(J.current),J.current=setTimeout(()=>{C(Array.isArray(ze.current)?ze.current:[ze.current]),J.current=null},ke)):Qe.current=!0},[ke]),disabled:Ie||!Ee}),k=o.useCallback((u,T)=>{Ae&&(T&&(Ae.unobserve(T),Qe.current=!1),u&&Ae.observe(u))},[Ae]),[oe,O]=En(k),Y=un(we);return o.useEffect(()=>{Ae&&oe.current&&(Ae.disconnect(),Qe.current=!1,Ae.observe(oe.current))},[oe,Ae]),o.useEffect(()=>(Oe({type:ct.RegisterDroppable,element:{id:be,key:ve,disabled:de,node:oe,rect:$e,data:Y}}),()=>Oe({type:ct.UnregisterDroppable,key:ve,id:be})),[be]),o.useEffect(()=>{de!==Ue.current.disabled&&(Oe({type:ct.SetDroppableDisabled,id:be,key:ve,disabled:de}),Ue.current.disabled=de)},[be,ve,de,Oe]),{active:Ee,rect:$e,isOver:He?.id===be,node:oe,over:He,setNodeRef:O}}({id:d,data:R,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:y,...p}}),{active:_,activatorEvent:G,activeNodeRect:P,attributes:V,setNodeRef:$,listeners:te,isDragging:N,over:x,setActivatorNodeRef:H,transform:re}=Hi({id:d,data:R,attributes:{...aa,...n},disabled:w.draggable}),ye=function(){for(var ce=arguments.length,we=new Array(ce),de=0;de<ce;de++)we[de]=arguments[de];return o.useMemo(()=>be=>{we.forEach(Fe=>Fe(be))},we)}(A,$),ne=!!_,X=ne&&!S&&Mn(f)&&Mn(z),ae=!W&&N,Me=ae&&X?re:null,Te=X?Me??(m??K)({rects:D,activeNodeRect:P,activeIndex:f,overIndex:z,index:j}):null,fe=Mn(f)&&Mn(z)?l({id:d,items:q,activeIndex:f,overIndex:z}):j,Be=_?.id,pe=o.useRef({activeId:Be,items:q,newIndex:fe,containerId:h}),Pe=q!==pe.current.items,Se=t({active:_,containerId:h,isDragging:N,isSorting:ne,id:d,index:j,items:q,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:g,wasDragging:pe.current.activeId!=null}),ge=function(ce){let{disabled:we,index:de,node:be,rect:Fe}=ce;const[ve,Ee]=o.useState(null),Oe=o.useRef(de);return St(()=>{if(!we&&de!==Oe.current&&be.current){const He=Fe.current;if(He){const C=_t(be.current,{ignoreTransform:!0}),Ue={x:He.left-C.left,y:He.top-C.top,scaleX:He.width/C.width,scaleY:He.height/C.height};(Ue.x||Ue.y)&&Ee(Ue)}}de!==Oe.current&&(Oe.current=de)},[we,de,be,Fe]),o.useEffect(()=>{ve&&Ee(null)},[ve]),ve}({disabled:!Se,index:j,node:B,rect:M});return o.useEffect(()=>{ne&&pe.current.newIndex!==fe&&(pe.current.newIndex=fe),h!==pe.current.containerId&&(pe.current.containerId=h),q!==pe.current.items&&(pe.current.items=q)},[ne,fe,h,q]),o.useEffect(()=>{if(Be===pe.current.activeId)return;if(Be!=null&&pe.current.activeId==null)return void(pe.current.activeId=Be);const ce=setTimeout(()=>{pe.current.activeId=Be},50);return()=>clearTimeout(ce)},[Be]),{active:_,activeIndex:f,attributes:V,data:R,rect:M,index:j,newIndex:fe,items:q,isOver:F,isSorting:ne,isDragging:N,listeners:te,node:B,overIndex:z,over:x,setNodeRef:ye,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:$,transform:ge??Te,transition:function(){if(ge||Pe&&pe.current.newIndex===j)return ia;if(!(ae&&!Bn(G)||!g)&&(ne||Se))return Nt.Transition.toString({...g,property:ol})}()}}function Ln(e){if(!e)return!1;const 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)}const da=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ca=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(da.includes(e.code)){if(e.preventDefault(),!n||!i)return;const p=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=a.get(h.id);if(f)switch(e.code){case Ye.Down:i.top<f.top&&p.push(h);break;case Ye.Up:i.top>f.top&&p.push(h);break;case Ye.Left:i.left>f.left&&p.push(h);break;case Ye.Right:i.left<f.left&&p.push(h)}});const g=(h=>{let{collisionRect:f,droppableRects:I,droppableContainers:S}=h;const D=Zo(f),z=[];for(const W of S){const{id:K}=W,w=I.get(K);if(w){const j=Zo(w),R=D.reduce((M,B,F)=>M+zr(j[F],B),0),y=Number((R/4).toFixed(4));z.push({id:K,data:{droppableContainer:W,value:y}})}}return z.sort(Nr)})({collisionRect:i,droppableRects:a,droppableContainers:p});let q=Lr(g,"id");if(q===d?.id&&g.length>1&&(q=g[1].id),q!=null){const h=l.get(n.id),f=l.get(q),I=f?a.get(f.id):null,S=f?.node.current;if(S&&I&&h&&f){const D=Vn(S).some((j,R)=>m[R]!==j),z=cr(h,f),W=function(j,R){return!Ln(j)||!Ln(R)||!cr(j,R)?!1:j.data.current.sortable.index<R.data.current.sortable.index}(h,f),K=D||!z?{x:0,y:0}:{x:W?i.width-I.width:0,y:W?i.height-I.height:0},w={x:I.left,y:I.top};return K.x&&K.y?w:gn(w,K)}}}};function cr(e,t){return!(!Ln(e)||!Ln(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ua=e=>{let{transform:t}=e;return{...t,y:0}},rl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:p,background:g,activeColor:q,borderColor:h,borderWidth:f,dragging:I,...S}=e;return c.jsxs("div",{ref:t,className:bt(a),style:{...i,display:"flex",flexDirection:"column",background:p===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:p===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...S,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:p===l?"0px":"-1px",marginTop:p===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,p===l?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:p===l&&q?q?.toCSS():"none",minHeight:"2px"}})]})})),qt={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},So=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:p,onRemove:g,renderItem:q,sorting:h,style:f,transition:I,transform:S,value:D,wrapperStyle:z,...W},K)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=q?q({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:p,ref:K,style:f,transform:S,transition:I,value:D}):c.jsx(c.Fragment,{children:D});return c.jsx("div",{className:bt("tab-item",qt.Wrapper,a&&qt.fadeIn,h&&qt.sorting,t&&qt.dragOverlay),style:{...z,transition:[I,z?.transition].filter(Boolean).join(", "),"--translate-x":S?`${Math.round(S.x)}px`:void 0,"--translate-y":S?`${Math.round(S.y)}px`:void 0,"--scale-x":S?.scaleX?`${S.scaleX}`:void 0,"--scale-y":S?.scaleY?`${S.scaleY}`:void 0,"--index":m},ref:K,children:c.jsx("div",{className:bt(qt.Item,n&&qt.dragging,l&&qt.withHandle,t&&qt.dragOverlay,i&&qt.disabled,e&&qt.color,"dragging"),style:f,"data-cypress":"draggable-item",...l?void 0:p,...W,tabIndex:l?void 0:-1,children:w})})})),ur={Row:"_Row_1kr10_1"},ll=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:bt(ur.Row,t&&ur.horizontal),children:e}))),ga={...el},ha=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=vi,coordinateGetter:m=ca,dropAnimation:p=ga,getItemStyles:g=()=>({}),getNewIndex:q,handle:h=!1,items:f,onMove:I,isDisabled:S=()=>!1,measuring:D,modifiers:z,renderItem:W,renderDivider:K,reorderItems:w=xo,strategy:j=qo,style:R,useDragOverlay:y=!0,onDragStart:M,wrapperStyle:B=()=>({})}=e,[F,A]=o.useState(()=>f);o.useEffect(()=>{A(f)},[f]);const[_,G]=o.useState(null),P=function(){for(var x=arguments.length,H=new Array(x),re=0;re<x;re++)H[re]=arguments[re];return o.useMemo(()=>[...H].filter(ye=>ye!=null),[...H])}(no(Gr,{activationConstraint:i}),no(_r,{activationConstraint:i}),no(yo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),V=F.indexOf.bind(F),$=_?V(_):-1,te=[];F.map((x,H)=>{te.push(c.jsx(ma,{id:x,handle:h,index:H,style:g,wrapperStyle:B,disabled:S(x),renderItem:W,animateLayoutChanges:a,useDragOverlay:y,getNewIndex:q},x+"-"+H));const re=K?.({key:"divider-"+H});re&&te.push(re)});const{getPortalContainer:N}=r.useFullscreenPortal();return c.jsxs(Vi,{sensors:P,collisionDetection:d,onDragStart:x=>{const{active:H}=x;H&&(M?.(x),G(H.id))},autoScroll:{canScroll:x=>!0},onDragEnd:x=>{if(G(null),x.over){const H=V(x.over.id);$!==H&&(A(re=>w(re,$,H)),I?.($,H))}},onDragCancel:()=>{G(null)},measuring:D,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...R},className:bt(n,qt.Wrapper),children:c.jsx(na,{items:F,strategy:j,children:c.jsx(ll,{ref:t,children:te})})}),y?Dt.createPortal(c.jsx(Qi,{adjustScale:l,dropAnimation:p,children:_?c.jsx(So,{value:F[$],handle:h,renderItem:W,wrapperStyle:B({index:$,isDragging:!0,id:F[$]}),index:$,dragging:!0,style:g({id:F[$],index:$,isSorting:_!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),N()):null]})}));function ma({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:p,useDragOverlay:g,wrapperStyle:q}){const{attributes:h,isDragging:f,isSorting:I,listeners:S,overIndex:D,setNodeRef:z,transform:W,transition:K}=sa({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(So,{ref:z,value:a,disabled:e,dragging:f,sorting:I,handle:i,renderItem:p,index:l,style:m({index:l,id:a,isDragging:f,isSorting:I,overIndex:D}),onRemove:d?()=>d(a):void 0,transform:W,transition:K,wrapperStyle:q({index:l,isDragging:f,id:a}),listeners:S,"data-index":l,"data-id":a,dragOverlay:!g&&f,...h})}const fa="_TabStrip_3x0dp_1",pa=new s.Color("rgb(33, 115, 70)"),va="#eee",Ca=e=>c.jsx(rl,{...e}),il=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:p,onTabMove:g,createScrollStartButton:q=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:f=r.defaultCreateScrollEdgeButton,createTabButton:I=Ca,createTabDivider:S,editLabelProps:D,disabled:z=!1,disableDrag:W=!1,background:K="white",activeColor:w=pa,borderColor:j=va,borderWidth:R=1}=e,[y,M]=o.useState(l),[B,F]=o.useState(d),A=o.useCallback(ve=>{const Ee=N.current?.[ve]?.closest(".tab-item")??N.current?.[ve];Ee&&ae.current?.scrollTo({top:Ee.offsetTop,left:Ee.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{A(l)},[l]);const _=o.useCallback((ve,Ee)=>{Ee!==y&&(M(Ee),m?.(Ee)),A(Ee)},[m,y]),G=o.useCallback((ve,Ee)=>{g?.(ve,Ee)},[g]),P=o.useRef(null),[V,$]=o.useState(-1),te=o.useCallback((ve,Ee)=>{p?.(ve,Ee)},[p]);o.useLayoutEffect(()=>{M(l)},[l]),o.useLayoutEffect(()=>{F(d)},[d]);const N=o.useRef([]),x=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ve){N.current?.[ve]?.startEdit()},cancel(ve){N.current?.[ve]?.cancel()}},x.current),[y,V]);const H=o.useCallback(({value:ve,index:Ee,dragging:Oe})=>{const{style:He,maxLength:C,...Ue}=D||{},Qe=c.jsx(Er,{ref:$e=>{N.current[Ee]=$e},value:ve,disabled:z,maxLength:C,style:{color:y===Ee&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...He},styleHover:{},onSubmit:$e=>(P.current=!1,$(-1),te(Ee,$e)),onCancel:()=>{P.current=!1,$(-1)},onChange:$e=>{P.current=!0,$(Ee)},...Ue});return I({onClick:$e=>_($e,Ee),value:ve,index:Ee,editing:V===Ee&&P.current,editable:!0,disabled:z,selectedIndex:y,background:K,activeColor:w,borderColor:j,borderWidth:R,dragging:Oe,children:Qe})},[y,te,_,D,z,V,I]),[re,{width:ye}]=zt(),[ne,{width:X}]=zt(),ae=o.useRef(null),[Me,Te]=o.useState({left:0,top:0,width:0,height:0}),[fe,Be]=o.useState(null);o.useEffect(()=>{fe!==null&&ae.current&&ae.current.scrollTo({left:fe,behavior:"smooth"})},[fe]);const pe=o.useCallback((ve,Ee=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;return C=Ee?0:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!0,Math.max(0,ve-200)),Be(C),Math.max(0,C)},[]),Pe=o.useCallback((ve,Ee=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;const Ue=Math.ceil(X-ye);return C=Ee?Ue:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!1,Math.max(0,ve+200)),Be(C),Math.min(Ue,C)},[X,ye]),Se=o.useRef(null),ge=o.useRef(null),ce=o.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Se.current=null)},[]),we=o.useCallback((ve,Ee,Oe=260)=>{Se.current=ve,ge.current=setTimeout(()=>{const He=Ee?pe(Se.current||ve):Pe(Se.current||ve);He!==Se.current?we(He,Ee,120):ce()},Oe)},[pe,Pe,ce]);o.useEffect(()=>()=>ce(),[ce]);const de=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Me.left)<=0||Math.floor(X-ye)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!0),onClick:ve=>pe(Math.min(ae.current.scrollLeft,fe??Number.MAX_SAFE_INTEGER),ve.ctrlKey)}),[Me,fe,X,ye]),be=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(X-ye)<=Math.ceil(Me.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!1),onClick:ve=>Pe(Math.max(ae.current.scrollLeft,fe??0),ve.ctrlKey)}),[Me,fe,X,ye]),Fe=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,f?.(de)]}),[de,be,q,h,n,f]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:bt(fa,a),ref:x,children:[c.jsx("div",{style:{borderTop:`solid ${j} ${R}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Fe}),c.jsx("div",{className:"Tabs",ref:re,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:c.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:ae,onScroll:ve=>{Te({left:ve.target.scrollLeft,top:ve.target.scrollTop,width:ve.target.scrollWidth,height:ve.target.scrollHeight})},children:c.jsx(ha,{isDisabled:ve=>z||W,items:B,strategy:ta,modifiers:[ua],ref:ne,renderItem:H,renderDivider:S,onMove:G,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:f(be)})]})}));il.displayName="TabStrip";const io=o.createContext(null),ba="_script-editor_iy654_5",ya=o.lazy(()=>Promise.resolve().then(()=>require("./C9n_wMqHvH0dL8n6.cjs"))),wa={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},gr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),d=await l.getNavigationTree(i.uri.toString()),m=e.getPosition();let p={...m};p.lineNumber=1,p.column=1;let g=!1;for(let D=m.lineNumber;D>=1;D--)if(i.getLineContent(D).trim()===""){const z=Ro(d,i.getOffsetAt({lineNumber:D,column:1}),"function");if(!z||qa(z)){g=!0,p.lineNumber=D+1;break}{const W=z.spans[0].start;D=i.getPositionAt(W).lineNumber,p.lineNumber=D}}let q=n,h=!1;!g&&!q.startsWith(`
|
|
27
|
+
`},hi={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 mi(e){let{announcements:t=hi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=gi}=e;const{announce:l,announcement:d}=function(){const[h,f]=o.useState("");return{announce:o.useCallback(I=>{I!=null&&f(I)},[]),announcement:h}}(),m=fn("DndLiveRegion"),[p,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),function(h){const f=o.useContext(Dr);o.useEffect(()=>{if(!f)throw new Error("useDndMonitor must be used within a children of <DndContext>");return f(h)},[h,f])}(o.useMemo(()=>({onDragStart(h){let{active:f}=h;l(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:I}=h;t.onDragMove&&l(t.onDragMove({active:f,over:I}))},onDragOver(h){let{active:f,over:I}=h;l(t.onDragOver({active:f,over:I}))},onDragEnd(h){let{active:f,over:I}=h;l(t.onDragEnd({active:f,over:I}))},onDragCancel(h){let{active:f,over:I}=h;l(t.onDragCancel({active:f,over:I}))}}),[l,t])),!p)return null;const q=o.createElement(o.Fragment,null,o.createElement(ci,{id:i,value:a.draggable}),o.createElement(ui,{id:m,announcement:d}));return n?Dt.createPortal(q,n):q}var ct;function Dn(){}function no(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(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"})(ct||(ct={}));const Rt=Object.freeze({x:0,y:0});function zr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fi(e,t){const n=An(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Nr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function pi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Zo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Lr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Xo(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}}const vi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Xo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,p=n.get(m);if(p){const g=zr(Xo(p),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(Nr)};function Ci(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const p=t.width*t.height,g=e.width*e.height,q=d*m;return Number((q/(p+g-q)).toFixed(4))}return 0}const bi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const p=Ci(m,t);p>0&&a.push({id:d,data:{droppableContainer:l,value:p}})}}return a.sort(pi)};function Yo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Rt}function yi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const wi=yi(1);function Or(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const xi={ignoreTransform:!1};function _t(e,t){t===void 0&&(t=xi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:q}=ft(e).getComputedStyle(e);g&&(n=function(h,f,I){const S=Or(f);if(!S)return h;const{scaleX:D,scaleY:z,x:W,y:K}=S,y=h.left-W-(1-D)*parseFloat(I),B=h.top-K-(1-z)*parseFloat(I.slice(I.indexOf(" ")+1)),R=D?h.width/D:h.width,w=z?h.height/z:h.height;return{width:R,height:w,top:B,right:y+R,bottom:B+w,left:y}}(n,g,q))}const{top:i,left:a,width:l,height:d,bottom:m,right:p}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:p}}function Jo(e){return _t(e,{ignoreTransform:!0})}function Vn(e,t){const n=[];return e?function i(a){if(t!=null&&n.length>=t||!a)return n;if(bo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!mn(a)||Fr(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const q=m[g];return typeof q=="string"&&p.test(q)})}(a,l)&&n.push(a),function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"}(a,l)?n:i(a.parentNode)}(e):n}function jr(e){const[t]=Vn(e,1);return t??null}function oo(e){return On&&e?Gt(e)?e:Co(e)?bo(e)||e===$t(e).scrollingElement?window:mn(e)?e:null:null:null}function Br(e){return Gt(e)?e.scrollX:e.scrollLeft}function Vr(e){return Gt(e)?e.scrollY:e.scrollTop}function co(e){return{x:Br(e),y:Vr(e)}}var ut;function Pr(e){return!(!On||!e)&&e===document.scrollingElement}function Hr(e){const t={x:0,y:0},n=Pr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const qi={x:.2,y:.2};function Si(e,t,n,i,a){let{top:l,left:d,right:m,bottom:p}=n;i===void 0&&(i=10),a===void 0&&(a=qi);const{isTop:g,isBottom:q,isLeft:h,isRight:f}=Hr(e),I={x:0,y:0},S={x:0,y:0},D=t.height*a.y,z=t.width*a.x;return!g&&l<=t.top+D?(I.y=ut.Backward,S.y=i*Math.abs((t.top+D-l)/D)):!q&&p>=t.bottom-D&&(I.y=ut.Forward,S.y=i*Math.abs((t.bottom-D-p)/D)),!f&&m>=t.right-z?(I.x=ut.Forward,S.x=i*Math.abs((t.right-z-m)/z)):!h&&d<=t.left+z&&(I.x=ut.Backward,S.x=i*Math.abs((t.left+z-d)/z)),{direction:I,speed:S}}function Ri(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Ur(e){return e.reduce((t,n)=>Kt(t,co(n)),Rt)}function Kr(e,t){if(t===void 0&&(t=_t),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);jr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ki=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Br(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Vr(n),0)}]];class uo{constructor(t,n){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;const i=Vn(n),a=Ur(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of ki)for(const p of d)Object.defineProperty(this,p,{get:()=>{const g=m(i),q=a[l]-g;return this.rect[p]+q},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function ro(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var xt,Ye;function Qo(e){e.preventDefault()}function Mi(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"})(xt||(xt={})),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"}(Ye||(Ye={}));const $r={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class yo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new an($t(n)),this.windowListeners=new an(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Kr(i),n(Rt)}handleKeyDown(t){if(Bn(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=$r,coordinateGetter:d=Ti,scrollBehavior:m="smooth"}=a,{code:p}=t;if(l.end.includes(p))return void this.handleEnd(t);if(l.cancel.includes(p))return void this.handleCancel(t);const{collisionRect:g}=i.current,q=g?{x:g.left,y:g.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=q);const h=d(t,{active:n,context:i.current,currentCoordinates:q});if(h){const f=gn(h,q),I={x:0,y:0},{scrollableAncestors:S}=i.current;for(const D of S){const z=t.code,{isTop:W,isRight:K,isLeft:y,isBottom:B,maxScroll:R,minScroll:w}=Hr(D),M=Ri(D),O={x:Math.min(z===Ye.Right?M.right-M.width/2:M.right,Math.max(z===Ye.Right?M.left:M.left+M.width/2,h.x)),y:Math.min(z===Ye.Down?M.bottom-M.height/2:M.bottom,Math.max(z===Ye.Down?M.top:M.top+M.height/2,h.y))},F=z===Ye.Right&&!K||z===Ye.Left&&!y,A=z===Ye.Down&&!B||z===Ye.Up&&!W;if(F&&O.x!==h.x){const _=D.scrollLeft+f.x,G=z===Ye.Right&&_<=R.x||z===Ye.Left&&_>=w.x;if(G&&!f.y)return void D.scrollTo({left:_,behavior:m});I.x=G?D.scrollLeft-_:z===Ye.Right?D.scrollLeft-R.x:D.scrollLeft-w.x,I.x&&D.scrollBy({left:-I.x,behavior:m});break}if(A&&O.y!==h.y){const _=D.scrollTop+f.y,G=z===Ye.Down&&_<=R.y||z===Ye.Up&&_>=w.y;if(G&&!f.x)return void D.scrollTo({top:_,behavior:m});I.y=G?D.scrollTop-_:z===Ye.Down?D.scrollTop-R.y:D.scrollTop-w.y,I.y&&D.scrollBy({top:-I.y,behavior:m});break}}this.handleMove(t,Kt(gn(h,this.referenceCoordinates),I))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function er(e){return!!(e&&"distance"in e)}function tr(e){return!!(e&&"delay"in e)}yo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=$r,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class wo{constructor(t,n,i){var a;i===void 0&&(i=function(m){const{EventTarget:p}=ft(m);return m instanceof p?m:$t(m)}(t.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=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=$t(d),this.documentListeners=new an(this.document),this.listeners=new an(i),this.windowListeners=new an(ft(d)),this.initialCoordinates=(a=An(l))!=null?a:Rt,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(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,Qo),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,Qo),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(er(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xt.Click,Mi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const p=(n=An(t))!=null?n:Rt,g=gn(a,p);if(!i&&m){if(er(m)){if(m.tolerance!=null&&ro(g,m.tolerance))return this.handleCancel();if(ro(g,m.distance))return this.handleStart()}return tr(m)&&ro(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(p)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ii={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wr extends wo{constructor(t){const{event:n}=t,i=$t(n.target);super(t,Ii,i)}}Wr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Ei={move:{name:"mousemove"},end:{name:"mouseup"}};var go;(function(e){e[e.RightClick=2]="RightClick"})(go||(go={}));class Gr extends wo{constructor(t){super(t,Ei,$t(t.event.target))}}Gr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==go.RightClick&&(i?.({event:n}),!0)}}];const lo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _r extends wo{constructor(t){super(t,lo)}static setup(){return window.addEventListener(lo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(lo.move.name,t)};function t(){}}}var sn,zn;function Fi(e){let{acceleration:t,activator:n=sn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=zn.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:q,delta:h,threshold:f}=e;const I=function(w){let{delta:M,disabled:O}=w;const F=Fn(M);return ln(A=>{if(O||!F||!A)return Ai;const _={x:Math.sign(M.x-F.x),y:Math.sign(M.y-F.y)};return{x:{[ut.Backward]:A.x[ut.Backward]||_.x===-1,[ut.Forward]:A.x[ut.Forward]||_.x===1},y:{[ut.Backward]:A.y[ut.Backward]||_.y===-1,[ut.Forward]:A.y[ut.Forward]||_.y===1}}},[O,M,F])}({delta:h,disabled:!l}),[S,D]=function(){const w=o.useRef(null);return[o.useCallback((M,O)=>{w.current=setInterval(M,O)},[]),o.useCallback(()=>{w.current!==null&&(clearInterval(w.current),w.current=null)},[])]}(),z=o.useRef({x:0,y:0}),W=o.useRef({x:0,y:0}),K=o.useMemo(()=>{switch(n){case sn.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case sn.DraggableRect:return a}},[n,a,p]),y=o.useRef(null),B=o.useCallback(()=>{const w=y.current;if(!w)return;const M=z.current.x*W.current.x,O=z.current.y*W.current.y;w.scrollBy(M,O)},[]),R=o.useMemo(()=>m===zn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&K){for(const w of R){if(i?.(w)===!1)continue;const M=g.indexOf(w),O=q[M];if(!O)continue;const{direction:F,speed:A}=Si(w,O,K,t,f);for(const _ of["x","y"])I[_][F[_]]||(A[_]=0,F[_]=0);if(A.x>0||A.y>0)return D(),y.current=w,S(B,d),z.current=A,void(W.current=F)}z.current={x:0,y:0},W.current={x:0,y:0},D()}else D()},[t,B,i,D,l,d,JSON.stringify(K),JSON.stringify(I),S,g,R,q,JSON.stringify(f)])}_r.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(sn||(sn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zn||(zn={}));const Ai={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var hn,ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(hn||(hn={})),function(e){e.Optimized="optimized"}(ho||(ho={}));const nr=new Map;function mo(e,t){return ln(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=jn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function Di(e){return new uo(_t(e),e)}function or(e,t,n){t===void 0&&(t=Di);const[i,a]=o.useState(null);function l(){a(p=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=p??n)!=null?g:null;const q=t(e);return JSON.stringify(p)===JSON.stringify(q)?p:q})}const d=function(p){let{callback:g,disabled:q}=p;const h=jn(g),f=o.useMemo(()=>{if(q||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:I}=window;return new I(h)},[h,q]);return o.useEffect(()=>()=>f?.disconnect(),[f]),f}({callback(p){if(e)for(const g of p){const{type:q,target:h}=g;if(q==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Nn({callback:l});return St(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const rr=[];function lr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==Rt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?gn(e,n.current):Rt}function ir(e){return o.useMemo(()=>e?function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}}(e):null,[e])}const ar=[];function Zr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mn(t)?t:e}const zi=[{sensor:Wr,options:{}},{sensor:yo,options:{}}],Ni={current:{}},In={draggable:{measure:Jo},droppable:{measure:Jo,strategy:hn.WhileDragging,frequency:ho.Optimized},dragOverlay:{measure:_t}};class dn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Li={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Dn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:In,measureDroppableContainers:Dn,windowRect:null,measuringScheduled:!1},Xr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Dn,draggableNodes:new Map,over:null,measureDroppableContainers:Dn},pn=o.createContext(Xr),Yr=o.createContext(Li);function Oi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dn}}}function ji(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.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 ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new dn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new dn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new dn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Bi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(pn),l=Fn(i),d=Fn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Bn(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const q of[p.current,g.current]){if(!q)continue;const h=si(q);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function Jr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Pn=o.createContext({...Rt,scaleX:1,scaleY:1});var Et;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Et||(Et={}));const Vi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:p,sensors:g=zi,collisionDetection:q=bi,measuring:h,modifiers:f,...I}=e;const S=o.useReducer(ji,void 0,Oi),[D,z]=S,[W,K]=function(){const[v]=o.useState(()=>new Set),U=o.useCallback(Z=>(v.add(Z),()=>v.delete(Z)),[v]);return[o.useCallback(Z=>{let{type:ee,event:le}=Z;v.forEach(ie=>{var se;return(se=ie[ee])==null?void 0:se.call(ie,le)})},[v]),U]}(),[y,B]=o.useState(Et.Uninitialized),R=y===Et.Initialized,{draggable:{active:w,nodes:M,translate:O},droppable:{containers:F}}=D,A=w!=null?M.get(w):null,_=o.useRef({initial:null,translated:null}),G=o.useMemo(()=>{var v;return w!=null?{id:w,data:(v=A?.data)!=null?v:Ni,rect:_}:null},[w,A]),P=o.useRef(null),[V,$]=o.useState(null),[te,N]=o.useState(null),x=un(I,Object.values(I)),H=fn("DndDescribedBy",l),re=o.useMemo(()=>F.getEnabled(),[F]),ye=(ne=h,o.useMemo(()=>({draggable:{...In.draggable,...ne?.draggable},droppable:{...In.droppable,...ne?.droppable},dragOverlay:{...In.dragOverlay,...ne?.dragOverlay}}),[ne?.draggable,ne?.droppable,ne?.dragOverlay]));var ne;const{droppableRects:X,measureDroppableContainers:ae,measuringScheduled:Me}=function(v,U){let{dragging:Z,dependencies:ee,config:le}=U;const[ie,se]=o.useState(null),{frequency:Ce,measure:he,strategy:me}=le,xe=o.useRef(v),Le=function(){switch(me){case hn.Always:return!1;case hn.BeforeDragging:return Z;default:return!Z}}(),De=un(Le),We=o.useCallback(function(Ne){Ne===void 0&&(Ne=[]),De.current||se(Xe=>Xe===null?Ne:Xe.concat(Ne.filter(it=>!Xe.includes(it))))},[De]),je=o.useRef(null),Ge=ln(Ne=>{if(Le&&!Z)return nr;if(!Ne||Ne===nr||xe.current!==v||ie!=null){const Xe=new Map;for(let it of v){if(!it)continue;if(ie&&ie.length>0&&!ie.includes(it.id)&&it.rect.current){Xe.set(it.id,it.rect.current);continue}const pt=it.node.current,wt=pt?new uo(he(pt),pt):null;it.rect.current=wt,wt&&Xe.set(it.id,wt)}return Xe}return Ne},[v,ie,Z,Le,he]);return o.useEffect(()=>{xe.current=v},[v]),o.useEffect(()=>{Le||We()},[Z,Le]),o.useEffect(()=>{ie&&ie.length>0&&se(null)},[JSON.stringify(ie)]),o.useEffect(()=>{Le||typeof Ce!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},Ce))},[Ce,Le,We,...ee]),{droppableRects:Ge,measureDroppableContainers:We,measuringScheduled:ie!=null}}(re,{dragging:R,dependencies:[O.x,O.y],config:ye.droppable}),Te=function(v,U){const Z=U!=null?v.get(U):void 0,ee=Z?Z.node.current:null;return ln(le=>{var ie;return U==null?null:(ie=ee??le)!=null?ie:null},[ee,U])}(M,w),fe=o.useMemo(()=>te?An(te):null,[te]),Be=function(){const v=V?.autoScrollEnabled===!1,U=typeof m=="object"?m.enabled===!1:m===!1,Z=R&&!v&&!U;return typeof m=="object"?{...m,enabled:Z}:{enabled:Z}}(),pe=function(v,U){return mo(v,U)}(Te,ye.draggable.measure);(function(v){let{activeNode:U,measure:Z,initialRect:ee,config:le=!0}=v;const ie=o.useRef(!1),{x:se,y:Ce}=typeof le=="boolean"?{x:le,y:le}:le;St(()=>{if(!se&&!Ce||!U)return void(ie.current=!1);if(ie.current||!ee)return;const he=U?.node.current;if(!he||he.isConnected===!1)return;const me=Yo(Z(he),ee);if(se||(me.x=0),Ce||(me.y=0),ie.current=!0,Math.abs(me.x)>0||Math.abs(me.y)>0){const xe=jr(he);xe&&xe.scrollBy({top:me.y,left:me.x})}},[U,se,Ce,ee,Z])})({activeNode:w!=null?M.get(w):null,config:Be.layoutShiftCompensation,initialRect:pe,measure:ye.draggable.measure});const Pe=or(Te,ye.draggable.measure,pe),Se=or(Te?Te.parentElement:null),ge=o.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ce=F.getNodeFor((t=ge.current.over)==null?void 0:t.id),we=function(v){let{measure:U}=v;const[Z,ee]=o.useState(null),le=Nn({callback:o.useCallback(he=>{for(const{target:me}of he)if(mn(me)){ee(xe=>{const Le=U(me);return xe?{...xe,width:Le.width,height:Le.height}:Le});break}},[U])}),ie=o.useCallback(he=>{const me=Zr(he);le?.disconnect(),me&&le?.observe(me),ee(me?U(me):null)},[U,le]),[se,Ce]=En(ie);return o.useMemo(()=>({nodeRef:se,rect:Z,setRef:Ce}),[Z,se,Ce])}({measure:ye.dragOverlay.measure}),de=(n=we.nodeRef.current)!=null?n:Te,be=R?(i=we.rect)!=null?i:Pe:null,Fe=!!(we.nodeRef.current&&we.rect),ve=Yo(Ee=Fe?null:Pe,mo(Ee));var Ee;const Oe=ir(de?ft(de):null),He=function(v){const U=o.useRef(v),Z=ln(ee=>v?ee&&ee!==rr&&v&&U.current&&v.parentNode===U.current.parentNode?ee:Vn(v):rr,[v]);return o.useEffect(()=>{U.current=v},[v]),Z}(R?ce??Te:null),C=function(v,U){U===void 0&&(U=_t);const[Z]=v,ee=ir(Z?ft(Z):null),[le,ie]=o.useState(ar);function se(){ie(()=>v.length?v.map(he=>Pr(he)?ee:new uo(U(he),he)):ar)}const Ce=Nn({callback:se});return St(()=>{Ce?.disconnect(),se(),v.forEach(he=>Ce?.observe(he))},[v]),le}(He),Ue=Jr(f,{transform:{x:O.x-ve.x,y:O.y-ve.y,scaleX:1,scaleY:1},activatorEvent:te,active:G,activeNodeRect:Pe,containerNodeRect:Se,draggingNodeRect:be,over:ge.current.over,overlayNodeRect:we.rect,scrollableAncestors:He,scrollableAncestorRects:C,windowRect:Oe}),Qe=fe?Kt(fe,O):null,$e=function(v){const[U,Z]=o.useState(null),ee=o.useRef(v),le=o.useCallback(ie=>{const se=oo(ie.target);se&&Z(Ce=>Ce?(Ce.set(se,co(se)),new Map(Ce)):null)},[]);return o.useEffect(()=>{const ie=ee.current;if(v!==ie){se(ie);const Ce=v.map(he=>{const me=oo(he);return me?(me.addEventListener("scroll",le,{passive:!0}),[me,co(me)]):null}).filter(he=>he!=null);Z(Ce.length?new Map(Ce):null),ee.current=v}return()=>{se(v),se(ie)};function se(Ce){Ce.forEach(he=>{const me=oo(he);me?.removeEventListener("scroll",le)})}},[le,v]),o.useMemo(()=>v.length?U?Array.from(U.values()).reduce((ie,se)=>Kt(ie,se),Rt):Ur(v):Rt,[v,U])}(He),J=lr($e),Ie=lr($e,[Pe]),Ve=Kt(Ue,J),ke=be?wi(be,Ue):null,ze=G&&ke?q({active:G,collisionRect:ke,droppableRects:X,droppableContainers:re,pointerCoordinates:Qe}):null,Ae=Lr(ze,"id"),[k,oe]=o.useState(null),j=function(v,U,Z){return{...v,scaleX:U&&Z?U.width/Z.width:1,scaleY:U&&Z?U.height/Z.height:1}}(Fe?Ue:Kt(Ue,Ie),(a=k?.rect)!=null?a:null,Pe),Y=o.useRef(null),u=o.useCallback((v,U)=>{let{sensor:Z,options:ee}=U;if(P.current==null)return;const le=M.get(P.current);if(!le)return;const ie=v.nativeEvent,se=new Z({active:P.current,activeNode:le,event:ie,options:ee,context:ge,onAbort(he){if(!M.get(he))return;const{onDragAbort:me}=x.current,xe={id:he};me?.(xe),W({type:"onDragAbort",event:xe})},onPending(he,me,xe,Le){if(!M.get(he))return;const{onDragPending:De}=x.current,We={id:he,constraint:me,initialCoordinates:xe,offset:Le};De?.(We),W({type:"onDragPending",event:We})},onStart(he){const me=P.current;if(me==null)return;const xe=M.get(me);if(!xe)return;const{onDragStart:Le}=x.current,De={activatorEvent:ie,active:{id:me,data:xe.data,rect:_}};Dt.unstable_batchedUpdates(()=>{Le?.(De),B(Et.Initializing),z({type:ct.DragStart,initialCoordinates:he,active:me}),W({type:"onDragStart",event:De}),$(Y.current),N(ie)})},onMove(he){z({type:ct.DragMove,coordinates:he})},onEnd:Ce(ct.DragEnd),onCancel:Ce(ct.DragCancel)});function Ce(he){return async function(){const{active:me,collisions:xe,over:Le,scrollAdjustedTranslate:De}=ge.current;let We=null;if(me&&De){const{cancelDrop:je}=x.current;We={activatorEvent:ie,active:me,collisions:xe,delta:De,over:Le},he===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(he=ct.DragCancel)}P.current=null,Dt.unstable_batchedUpdates(()=>{z({type:he}),B(Et.Uninitialized),oe(null),$(null),N(null),Y.current=null;const je=he===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Ge=x.current[je];Ge?.(We),W({type:je,event:We})}})}}Y.current=se},[M]),T=o.useCallback((v,U)=>(Z,ee)=>{const le=Z.nativeEvent,ie=M.get(ee);if(P.current!==null||!ie||le.dndKit||le.defaultPrevented)return;const se={active:ie};v(Z,U.options,se)===!0&&(le.dndKit={capturedBy:U.sensor},P.current=ee,u(Z,U))},[M,u]),E=function(v,U){return o.useMemo(()=>v.reduce((Z,ee)=>{const{sensor:le}=ee;return[...Z,...le.activators.map(ie=>({eventName:ie.eventName,handler:U(ie.handler,ee)}))]},[]),[v,U])}(g,T);(function(v){o.useEffect(()=>{if(!On)return;const U=v.map(Z=>{let{sensor:ee}=Z;return ee.setup==null?void 0:ee.setup()});return()=>{for(const Z of U)Z?.()}},v.map(U=>{let{sensor:Z}=U;return Z}))})(g),St(()=>{Pe&&y===Et.Initializing&&B(Et.Initialized)},[Pe,y]),o.useEffect(()=>{const{onDragMove:v}=x.current,{active:U,activatorEvent:Z,collisions:ee,over:le}=ge.current;if(!U||!Z)return;const ie={active:U,activatorEvent:Z,collisions:ee,delta:{x:Ve.x,y:Ve.y},over:le};Dt.unstable_batchedUpdates(()=>{v?.(ie),W({type:"onDragMove",event:ie})})},[Ve.x,Ve.y]),o.useEffect(()=>{const{active:v,activatorEvent:U,collisions:Z,droppableContainers:ee,scrollAdjustedTranslate:le}=ge.current;if(!v||P.current==null||!U||!le)return;const{onDragOver:ie}=x.current,se=ee.get(Ae),Ce=se&&se.rect.current?{id:se.id,rect:se.rect.current,data:se.data,disabled:se.disabled}:null,he={active:v,activatorEvent:U,collisions:Z,delta:{x:le.x,y:le.y},over:Ce};Dt.unstable_batchedUpdates(()=>{oe(Ce),ie?.(he),W({type:"onDragOver",event:he})})},[Ae]),St(()=>{ge.current={activatorEvent:te,active:G,activeNode:Te,collisionRect:ke,collisions:ze,droppableRects:X,draggableNodes:M,draggingNode:de,draggingNodeRect:be,droppableContainers:F,over:k,scrollableAncestors:He,scrollAdjustedTranslate:Ve},_.current={initial:be,translated:ke}},[G,Te,ze,ke,M,de,be,X,F,k,He,Ve]),Fi({...Be,delta:O,draggingRect:ke,pointerCoordinates:Qe,scrollableAncestors:He,scrollableAncestorRects:C});const b=o.useMemo(()=>({active:G,activeNode:Te,activeNodeRect:Pe,activatorEvent:te,collisions:ze,containerNodeRect:Se,dragOverlay:we,draggableNodes:M,droppableContainers:F,droppableRects:X,over:k,measureDroppableContainers:ae,scrollableAncestors:He,scrollableAncestorRects:C,measuringConfiguration:ye,measuringScheduled:Me,windowRect:Oe}),[G,Te,Pe,te,ze,Se,we,M,F,X,k,ae,He,C,ye,Me,Oe]),L=o.useMemo(()=>({activatorEvent:te,activators:E,active:G,activeNodeRect:Pe,ariaDescribedById:{draggable:H},dispatch:z,draggableNodes:M,over:k,measureDroppableContainers:ae}),[te,E,G,Pe,z,H,M,k,ae]);return o.createElement(Dr.Provider,{value:K},o.createElement(pn.Provider,{value:L},o.createElement(Yr.Provider,{value:b},o.createElement(Pn.Provider,{value:j},p)),o.createElement(Bi,{disabled:d?.restoreFocus===!1})),o.createElement(mi,{...d,hiddenTextDescribedById:H}))}),Pi=o.createContext(null),sr="button";function Hi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=fn("Draggable"),{activators:d,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:q,draggableNodes:h,over:f}=o.useContext(pn),{role:I=sr,roleDescription:S="draggable",tabIndex:D=0}=a??{},z=p?.id===t,W=o.useContext(z?Pn:Pi),[K,y]=En(),[B,R]=En(),w=function(O,F){return o.useMemo(()=>O.reduce((A,_)=>{let{eventName:G,handler:P}=_;return A[G]=V=>{P(V,F)},A},{}),[O,F])}(d,t),M=un(n);return St(()=>(h.set(t,{id:t,key:l,node:K,activatorNode:B,data:M}),()=>{const O=h.get(t);O&&O.key===l&&h.delete(t)}),[h,t]),{active:p,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:I,tabIndex:D,"aria-disabled":i,"aria-pressed":!(!z||I!==sr)||void 0,"aria-roledescription":S,"aria-describedby":q.draggable}),[i,I,D,z,S,q.draggable]),isDragging:z,listeners:i?void 0:w,node:K,over:f,setNodeRef:y,setActivatorNodeRef:R,transform:W}}function Qr(){return o.useContext(Yr)}const Ui={timeout:25};function Ki(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Fn(n);return n||i||!m||a(m),St(()=>{if(!l)return;const p=i?.key,g=i?.props.id;p!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const $i={x:0,y:0,scaleX:1,scaleY:1};function Wi(e){let{children:t}=e;return o.createElement(pn.Provider,{value:Xr},o.createElement(Pn.Provider,{value:$i},t))}const Gi={position:"fixed",touchAction:"none"},_i=e=>Bn(e)?"transform 250ms ease":void 0,Zi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:p,transform:g,transition:q=_i}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},f={...Gi,width:m.width,height:m.height,top:m.top,left:m.left,transform:Nt.Transform.toString(h),transformOrigin:a&&i?fi(i,m):void 0,transition:typeof q=="function"?q(i):q,...p};return o.createElement(n,{className:d,style:f,ref:t},l)}),Xi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,p]of Object.entries(l.active))p!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,p));if(l!=null&&l.dragOverlay)for(const[m,p]of Object.entries(l.dragOverlay))p!==void 0&&i.node.style.setProperty(m,p);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,p]of Object.entries(a))n.node.style.setProperty(m,p);d!=null&&d.active&&n.node.classList.remove(d.active)}},el={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nt.Transform.toString(t)},{transform:Nt.Transform.toString(n)}]},sideEffects:Xi({styles:{active:{opacity:"0"}}})};function Yi(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return jn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const p=m.node.current;if(!p)return;const g=Zr(d);if(!g)return;const{transform:q}=ft(d).getComputedStyle(d),h=Or(q);if(!h)return;const f=typeof t=="function"?t:function(I){const{duration:S,easing:D,sideEffects:z,keyframes:W}={...el,...I};return K=>{let{active:y,dragOverlay:B,transform:R,...w}=K;if(!S)return;const M={x:B.rect.left-y.rect.left,y:B.rect.top-y.rect.top},O={scaleX:R.scaleX!==1?y.rect.width*R.scaleX/B.rect.width:1,scaleY:R.scaleY!==1?y.rect.height*R.scaleY/B.rect.height:1},F={x:R.x-M.x,y:R.y-M.y,...O},A=W({...w,active:y,dragOverlay:B,transform:{initial:R,final:F}}),[_]=A,G=A[A.length-1];if(JSON.stringify(_)===JSON.stringify(G))return;const P=z?.({active:y,dragOverlay:B,...w}),V=B.node.animate(A,{duration:S,easing:D,fill:"forwards"});return new Promise($=>{V.onfinish=()=>{P?.(),$()}})}}(t);return Kr(p,a.draggable.measure),f({active:{id:l,data:m.data,node:p,rect:a.draggable.measure(p)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let dr=0;function Ji(e){return o.useMemo(()=>{if(e!=null)return dr++,dr},[e])}const Qi=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:p,zIndex:g=999}=e;const{activatorEvent:q,active:h,activeNodeRect:f,containerNodeRect:I,draggableNodes:S,droppableContainers:D,dragOverlay:z,over:W,measuringConfiguration:K,scrollableAncestors:y,scrollableAncestorRects:B,windowRect:R}=Qr(),w=o.useContext(Pn),M=Ji(h?.id),O=Jr(d,{activatorEvent:q,active:h,activeNodeRect:f,containerNodeRect:I,draggingNodeRect:z.rect,over:W,overlayNodeRect:z.rect,scrollableAncestors:y,scrollableAncestorRects:B,transform:w,windowRect:R}),F=mo(f),A=Yi({config:i,draggableNodes:S,droppableContainers:D,measuringConfiguration:K}),_=F?z.setRef:void 0;return o.createElement(Wi,null,o.createElement(Ki,{animation:A},h&&M?o.createElement(Zi,{key:M,id:h.id,ref:_,as:m,activatorEvent:q,adjustScale:t,className:p,transition:l,rect:F,style:{zIndex:g,...a},transform:O},n):null))});function xo(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ea(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Mn(e){return e!==null&&e>=0}const Tn={scaleX:1,scaleY:1},ta=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const p=function(g,q,h){const f=g[q],I=g[q-1],S=g[q+1];return!f||!I&&!S?0:h<q?I?f.left-(I.left+I.width):S.left-(f.left+f.width):S?S.left-(f.left+f.width):f.left-(I.left+I.width)}(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...Tn}:null}return d>a&&d<=l?{x:-m.width-p,y:0,...Tn}:d<a&&d>=l?{x:m.width+p,y:0,...Tn}:{x:0,y:0,...Tn}},qo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=xo(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},tl="Sortable",nl=o.createContext({activeIndex:-1,containerId:tl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qo,disabled:{draggable:!1,droppable:!1}});function na(e){let{children:t,id:n,items:i,strategy:a=qo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:q}=Qr(),h=fn(tl,n),f=m.rect!==null,I=o.useMemo(()=>i.map(w=>typeof w=="object"&&"id"in w?w.id:w),[i]),S=d!=null,D=d?I.indexOf(d.id):-1,z=g?I.indexOf(g.id):-1,W=o.useRef(I),K=!function(w,M){if(w===M)return!0;if(w.length!==M.length)return!1;for(let O=0;O<w.length;O++)if(w[O]!==M[O])return!1;return!0}(I,W.current),y=z!==-1&&D===-1||K,B=function(w){return typeof w=="boolean"?{draggable:w,droppable:w}:w}(l);St(()=>{K&&S&&q(I)},[K,I,S,q]),o.useEffect(()=>{W.current=I},[I]);const R=o.useMemo(()=>({activeIndex:D,containerId:h,disabled:B,disableTransforms:y,items:I,overIndex:z,useDragOverlay:f,sortedRects:ea(I,p),strategy:a}),[D,h,B.draggable,B.droppable,y,I,z,p,f,a]);return o.createElement(nl.Provider,{value:R},t)}const oa=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return xo(n,i,a).indexOf(t)},ra=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:p,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===p)},la={duration:200,easing:"ease"},ol="transform",ia=Nt.Transition.toString({property:ol,duration:0,easing:"linear"}),aa={roleDescription:"sortable"};function sa(e){let{animateLayoutChanges:t=ra,attributes:n,disabled:i,data:a,getNewIndex:l=oa,id:d,strategy:m,resizeObserverConfig:p,transition:g=la}=e;const{items:q,containerId:h,activeIndex:f,disabled:I,disableTransforms:S,sortedRects:D,overIndex:z,useDragOverlay:W,strategy:K}=o.useContext(nl),y=function(ce,we){var de,be;return typeof ce=="boolean"?{draggable:ce,droppable:!1}:{draggable:(de=ce?.draggable)!=null?de:we.draggable,droppable:(be=ce?.droppable)!=null?be:we.droppable}}(i,I),B=q.indexOf(d),R=o.useMemo(()=>({sortable:{containerId:h,index:B,items:q},...a}),[h,a,B,q]),w=o.useMemo(()=>q.slice(q.indexOf(d)),[q,d]),{rect:M,node:O,isOver:F,setNodeRef:A}=function(ce){let{data:we,disabled:de=!1,id:be,resizeObserverConfig:Fe}=ce;const ve=fn("Droppable"),{active:Ee,dispatch:Oe,over:He,measureDroppableContainers:C}=o.useContext(pn),Ue=o.useRef({disabled:de}),Qe=o.useRef(!1),$e=o.useRef(null),J=o.useRef(null),{disabled:Ie,updateMeasurementsFor:Ve,timeout:ke}={...Ui,...Fe},ze=un(Ve??be),Ae=Nn({callback:o.useCallback(()=>{Qe.current?(J.current!=null&&clearTimeout(J.current),J.current=setTimeout(()=>{C(Array.isArray(ze.current)?ze.current:[ze.current]),J.current=null},ke)):Qe.current=!0},[ke]),disabled:Ie||!Ee}),k=o.useCallback((u,T)=>{Ae&&(T&&(Ae.unobserve(T),Qe.current=!1),u&&Ae.observe(u))},[Ae]),[oe,j]=En(k),Y=un(we);return o.useEffect(()=>{Ae&&oe.current&&(Ae.disconnect(),Qe.current=!1,Ae.observe(oe.current))},[oe,Ae]),o.useEffect(()=>(Oe({type:ct.RegisterDroppable,element:{id:be,key:ve,disabled:de,node:oe,rect:$e,data:Y}}),()=>Oe({type:ct.UnregisterDroppable,key:ve,id:be})),[be]),o.useEffect(()=>{de!==Ue.current.disabled&&(Oe({type:ct.SetDroppableDisabled,id:be,key:ve,disabled:de}),Ue.current.disabled=de)},[be,ve,de,Oe]),{active:Ee,rect:$e,isOver:He?.id===be,node:oe,over:He,setNodeRef:j}}({id:d,data:R,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...p}}),{active:_,activatorEvent:G,activeNodeRect:P,attributes:V,setNodeRef:$,listeners:te,isDragging:N,over:x,setActivatorNodeRef:H,transform:re}=Hi({id:d,data:R,attributes:{...aa,...n},disabled:y.draggable}),ye=function(){for(var ce=arguments.length,we=new Array(ce),de=0;de<ce;de++)we[de]=arguments[de];return o.useMemo(()=>be=>{we.forEach(Fe=>Fe(be))},we)}(A,$),ne=!!_,X=ne&&!S&&Mn(f)&&Mn(z),ae=!W&&N,Me=ae&&X?re:null,Te=X?Me??(m??K)({rects:D,activeNodeRect:P,activeIndex:f,overIndex:z,index:B}):null,fe=Mn(f)&&Mn(z)?l({id:d,items:q,activeIndex:f,overIndex:z}):B,Be=_?.id,pe=o.useRef({activeId:Be,items:q,newIndex:fe,containerId:h}),Pe=q!==pe.current.items,Se=t({active:_,containerId:h,isDragging:N,isSorting:ne,id:d,index:B,items:q,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:g,wasDragging:pe.current.activeId!=null}),ge=function(ce){let{disabled:we,index:de,node:be,rect:Fe}=ce;const[ve,Ee]=o.useState(null),Oe=o.useRef(de);return St(()=>{if(!we&&de!==Oe.current&&be.current){const He=Fe.current;if(He){const C=_t(be.current,{ignoreTransform:!0}),Ue={x:He.left-C.left,y:He.top-C.top,scaleX:He.width/C.width,scaleY:He.height/C.height};(Ue.x||Ue.y)&&Ee(Ue)}}de!==Oe.current&&(Oe.current=de)},[we,de,be,Fe]),o.useEffect(()=>{ve&&Ee(null)},[ve]),ve}({disabled:!Se,index:B,node:O,rect:M});return o.useEffect(()=>{ne&&pe.current.newIndex!==fe&&(pe.current.newIndex=fe),h!==pe.current.containerId&&(pe.current.containerId=h),q!==pe.current.items&&(pe.current.items=q)},[ne,fe,h,q]),o.useEffect(()=>{if(Be===pe.current.activeId)return;if(Be!=null&&pe.current.activeId==null)return void(pe.current.activeId=Be);const ce=setTimeout(()=>{pe.current.activeId=Be},50);return()=>clearTimeout(ce)},[Be]),{active:_,activeIndex:f,attributes:V,data:R,rect:M,index:B,newIndex:fe,items:q,isOver:F,isSorting:ne,isDragging:N,listeners:te,node:O,overIndex:z,over:x,setNodeRef:ye,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:$,transform:ge??Te,transition:function(){if(ge||Pe&&pe.current.newIndex===B)return ia;if(!(ae&&!Bn(G)||!g)&&(ne||Se))return Nt.Transition.toString({...g,property:ol})}()}}function Ln(e){if(!e)return!1;const 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)}const da=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ca=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(da.includes(e.code)){if(e.preventDefault(),!n||!i)return;const p=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=a.get(h.id);if(f)switch(e.code){case Ye.Down:i.top<f.top&&p.push(h);break;case Ye.Up:i.top>f.top&&p.push(h);break;case Ye.Left:i.left>f.left&&p.push(h);break;case Ye.Right:i.left<f.left&&p.push(h)}});const g=(h=>{let{collisionRect:f,droppableRects:I,droppableContainers:S}=h;const D=Zo(f),z=[];for(const W of S){const{id:K}=W,y=I.get(K);if(y){const B=Zo(y),R=D.reduce((M,O,F)=>M+zr(B[F],O),0),w=Number((R/4).toFixed(4));z.push({id:K,data:{droppableContainer:W,value:w}})}}return z.sort(Nr)})({collisionRect:i,droppableRects:a,droppableContainers:p});let q=Lr(g,"id");if(q===d?.id&&g.length>1&&(q=g[1].id),q!=null){const h=l.get(n.id),f=l.get(q),I=f?a.get(f.id):null,S=f?.node.current;if(S&&I&&h&&f){const D=Vn(S).some((B,R)=>m[R]!==B),z=cr(h,f),W=function(B,R){return!Ln(B)||!Ln(R)||!cr(B,R)?!1:B.data.current.sortable.index<R.data.current.sortable.index}(h,f),K=D||!z?{x:0,y:0}:{x:W?i.width-I.width:0,y:W?i.height-I.height:0},y={x:I.left,y:I.top};return K.x&&K.y?y:gn(y,K)}}}};function cr(e,t){return!(!Ln(e)||!Ln(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ua=e=>{let{transform:t}=e;return{...t,y:0}},rl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:p,background:g,activeColor:q,borderColor:h,borderWidth:f,dragging:I,...S}=e;return c.jsxs("div",{ref:t,className:bt(a),style:{...i,display:"flex",flexDirection:"column",background:p===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:p===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...S,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:p===l?"0px":"-1px",marginTop:p===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,p===l?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:p===l&&q?q?.toCSS():"none",minHeight:"2px"}})]})})),qt={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},So=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:p,onRemove:g,renderItem:q,sorting:h,style:f,transition:I,transform:S,value:D,wrapperStyle:z,...W},K)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=q?q({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:p,ref:K,style:f,transform:S,transition:I,value:D}):c.jsx(c.Fragment,{children:D});return c.jsx("div",{className:bt("tab-item",qt.Wrapper,a&&qt.fadeIn,h&&qt.sorting,t&&qt.dragOverlay),style:{...z,transition:[I,z?.transition].filter(Boolean).join(", "),"--translate-x":S?`${Math.round(S.x)}px`:void 0,"--translate-y":S?`${Math.round(S.y)}px`:void 0,"--scale-x":S?.scaleX?`${S.scaleX}`:void 0,"--scale-y":S?.scaleY?`${S.scaleY}`:void 0,"--index":m},ref:K,children:c.jsx("div",{className:bt(qt.Item,n&&qt.dragging,l&&qt.withHandle,t&&qt.dragOverlay,i&&qt.disabled,e&&qt.color,"dragging"),style:f,"data-cypress":"draggable-item",...l?void 0:p,...W,tabIndex:l?void 0:-1,children:y})})})),ur={Row:"_Row_1kr10_1"},ll=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:bt(ur.Row,t&&ur.horizontal),children:e}))),ga={...el},ha=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=vi,coordinateGetter:m=ca,dropAnimation:p=ga,getItemStyles:g=()=>({}),getNewIndex:q,handle:h=!1,items:f,onMove:I,isDisabled:S=()=>!1,measuring:D,modifiers:z,renderItem:W,renderDivider:K,reorderItems:y=xo,strategy:B=qo,style:R,useDragOverlay:w=!0,onDragStart:M,wrapperStyle:O=()=>({})}=e,[F,A]=o.useState(()=>f);o.useEffect(()=>{A(f)},[f]);const[_,G]=o.useState(null),P=function(){for(var x=arguments.length,H=new Array(x),re=0;re<x;re++)H[re]=arguments[re];return o.useMemo(()=>[...H].filter(ye=>ye!=null),[...H])}(no(Gr,{activationConstraint:i}),no(_r,{activationConstraint:i}),no(yo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),V=F.indexOf.bind(F),$=_?V(_):-1,te=[];F.map((x,H)=>{te.push(c.jsx(ma,{id:x,handle:h,index:H,style:g,wrapperStyle:O,disabled:S(x),renderItem:W,animateLayoutChanges:a,useDragOverlay:w,getNewIndex:q},x+"-"+H));const re=K?.({key:"divider-"+H});re&&te.push(re)});const{getPortalContainer:N}=r.useFullscreenPortal();return c.jsxs(Vi,{sensors:P,collisionDetection:d,onDragStart:x=>{const{active:H}=x;H&&(M?.(x),G(H.id))},autoScroll:{canScroll:x=>!0},onDragEnd:x=>{if(G(null),x.over){const H=V(x.over.id);$!==H&&(A(re=>y(re,$,H)),I?.($,H))}},onDragCancel:()=>{G(null)},measuring:D,modifiers:z,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...R},className:bt(n,qt.Wrapper),children:c.jsx(na,{items:F,strategy:B,children:c.jsx(ll,{ref:t,children:te})})}),w?Dt.createPortal(c.jsx(Qi,{adjustScale:l,dropAnimation:p,children:_?c.jsx(So,{value:F[$],handle:h,renderItem:W,wrapperStyle:O({index:$,isDragging:!0,id:F[$]}),index:$,dragging:!0,style:g({id:F[$],index:$,isSorting:_!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),N()):null]})}));function ma({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:p,useDragOverlay:g,wrapperStyle:q}){const{attributes:h,isDragging:f,isSorting:I,listeners:S,overIndex:D,setNodeRef:z,transform:W,transition:K}=sa({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(So,{ref:z,value:a,disabled:e,dragging:f,sorting:I,handle:i,renderItem:p,index:l,style:m({index:l,id:a,isDragging:f,isSorting:I,overIndex:D}),onRemove:d?()=>d(a):void 0,transform:W,transition:K,wrapperStyle:q({index:l,isDragging:f,id:a}),listeners:S,"data-index":l,"data-id":a,dragOverlay:!g&&f,...h})}const fa="_TabStrip_3x0dp_1",pa=new s.Color("rgb(33, 115, 70)"),va="#eee",Ca=e=>c.jsx(rl,{...e}),il=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:p,onTabMove:g,createScrollStartButton:q=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:f=r.defaultCreateScrollEdgeButton,createTabButton:I=Ca,createTabDivider:S,editLabelProps:D,disabled:z=!1,disableDrag:W=!1,background:K="white",activeColor:y=pa,borderColor:B=va,borderWidth:R=1}=e,[w,M]=o.useState(l),[O,F]=o.useState(d),A=o.useCallback(ve=>{const Ee=N.current?.[ve]?.closest(".tab-item")??N.current?.[ve];Ee&&ae.current?.scrollTo({top:Ee.offsetTop,left:Ee.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{A(l)},[l]);const _=o.useCallback((ve,Ee)=>{Ee!==w&&(M(Ee),m?.(Ee)),A(Ee)},[m,w]),G=o.useCallback((ve,Ee)=>{g?.(ve,Ee)},[g]),P=o.useRef(null),[V,$]=o.useState(-1),te=o.useCallback((ve,Ee)=>{p?.(ve,Ee)},[p]);o.useLayoutEffect(()=>{M(l)},[l]),o.useLayoutEffect(()=>{F(d)},[d]);const N=o.useRef([]),x=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ve){N.current?.[ve]?.startEdit()},cancel(ve){N.current?.[ve]?.cancel()}},x.current),[w,V]);const H=o.useCallback(({value:ve,index:Ee,dragging:Oe})=>{const{style:He,maxLength:C,...Ue}=D||{},Qe=c.jsx(Er,{ref:$e=>{N.current[Ee]=$e},value:ve,disabled:z,maxLength:C,style:{color:w===Ee&&y?y?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...He},styleHover:{},onSubmit:$e=>(P.current=!1,$(-1),te(Ee,$e)),onCancel:()=>{P.current=!1,$(-1)},onChange:$e=>{P.current=!0,$(Ee)},...Ue});return I({onClick:$e=>_($e,Ee),value:ve,index:Ee,editing:V===Ee&&P.current,editable:!0,disabled:z,selectedIndex:w,background:K,activeColor:y,borderColor:B,borderWidth:R,dragging:Oe,children:Qe})},[w,te,_,D,z,V,I]),[re,{width:ye}]=zt(),[ne,{width:X}]=zt(),ae=o.useRef(null),[Me,Te]=o.useState({left:0,top:0,width:0,height:0}),[fe,Be]=o.useState(null);o.useEffect(()=>{fe!==null&&ae.current&&ae.current.scrollTo({left:fe,behavior:"smooth"})},[fe]);const pe=o.useCallback((ve,Ee=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;return C=Ee?0:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!0,Math.max(0,ve-200)),Be(C),Math.max(0,C)},[]),Pe=o.useCallback((ve,Ee=!1)=>{if(!ae.current)return 0;let Oe=ae.current.firstChild.getBoundingClientRect(),He=ae.current.firstChild.firstChild.children,C=0;const Ue=Math.ceil(X-ye);return C=Ee?Ue:r.ScrollUtils.getScrollTo(ve,Oe.left,He,!1,Math.max(0,ve+200)),Be(C),Math.min(Ue,C)},[X,ye]),Se=o.useRef(null),ge=o.useRef(null),ce=o.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Se.current=null)},[]),we=o.useCallback((ve,Ee,Oe=260)=>{Se.current=ve,ge.current=setTimeout(()=>{const He=Ee?pe(Se.current||ve):Pe(Se.current||ve);He!==Se.current?we(He,Ee,120):ce()},Oe)},[pe,Pe,ce]);o.useEffect(()=>()=>ce(),[ce]);const de=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Me.left)<=0||Math.floor(X-ye)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!0),onClick:ve=>pe(Math.min(ae.current.scrollLeft,fe??Number.MAX_SAFE_INTEGER),ve.ctrlKey)}),[Me,fe,X,ye]),be=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(X-ye)<=Math.ceil(Me.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:ce,onMouseLeave:ce,onMouseDown:()=>we(ae.current.scrollLeft,!1),onClick:ve=>Pe(Math.max(ae.current.scrollLeft,fe??0),ve.ctrlKey)}),[Me,fe,X,ye]),Fe=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,f?.(de)]}),[de,be,q,h,n,f]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:bt(fa,a),ref:x,children:[c.jsx("div",{style:{borderTop:`solid ${B} ${R}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Fe}),c.jsx("div",{className:"Tabs",ref:re,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:c.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:ae,onScroll:ve=>{Te({left:ve.target.scrollLeft,top:ve.target.scrollTop,width:ve.target.scrollWidth,height:ve.target.scrollHeight})},children:c.jsx(ha,{isDisabled:ve=>z||W,items:O,strategy:ta,modifiers:[ua],ref:ne,renderItem:H,renderDivider:S,onMove:G,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:f(be)})]})}));il.displayName="TabStrip";const io=o.createContext(null),ba="_script-editor_iy654_5",ya=o.lazy(()=>Promise.resolve().then(()=>require("./DNo5c_VFRpVYlOmp.cjs"))),wa={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},gr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),d=await l.getNavigationTree(i.uri.toString()),m=e.getPosition();let p={...m};p.lineNumber=1,p.column=1;let g=!1;for(let D=m.lineNumber;D>=1;D--)if(i.getLineContent(D).trim()===""){const z=Ro(d,i.getOffsetAt({lineNumber:D,column:1}),"function");if(!z||qa(z)){g=!0,p.lineNumber=D+1;break}{const W=z.spans[0].start;D=i.getPositionAt(W).lineNumber,p.lineNumber=D}}let q=n,h=!1;!g&&!q.startsWith(`
|
|
28
28
|
`)&&p.lineNumber>1&&(q=`
|
|
29
29
|
`+q,h=!0);let f=!1;i.getLineCount()>1&&(q.endsWith(`
|
|
30
30
|
|
|
31
31
|
`)||(q+=`
|
|
32
32
|
|
|
33
|
-
`,f=!0));const I=[{range:new t.Range(p.lineNumber,p.column,p.lineNumber,p.column),text:`${q}`}];let S=null;i.pushEditOperations([],I,D=>(S=D[0].range,h&&S.startLineNumber++,f&&S.endLineNumber--,[new t.Selection(S.startLineNumber,S.startColumn,S.endLineNumber,S.endColumn)])),e.setSelection({startLineNumber:S.endLineNumber,startColumn:S.endColumn,endLineNumber:S.startLineNumber,endColumn:S.startColumn})};function xa(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function fo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:xa(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)fo(e,t,n,l,a);return a}function Ro(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const p=Ro(m,t,n,i);if(p)return p}}return null}}function qa(e){return e.kind==="comment"}const Sa=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:p,autoFocus:g=!0,onStatusChange:q,...h}=e,f=o.useRef(null),I=r.useCallbackRef(d,[d]),S=o.useRef(!1),D=o.useMemo(()=>({contains(x){if(!f.current)return;const H=f.current.editor;return H&&H.getDomNode()?.contains(x)},focus(){if(!f.current)return;const x=f.current.editor;return x&&x.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",D,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),W=o.useMemo(()=>{let x=null;const H=()=>D;return x=a?a.createChildGroup(H,"scriptEditor",!1):new r.CommandGroup(H,"scriptEditor"),x.addCommands(z,!0),x},[a,z]),K=r.useCommands(W,["executeSelectedScript"])[0],w=K?.context(),j=r.useCallbackRef(x=>{K?.execute(x)},[K]),R=o.useRef(""),[y,M]=o.useState(!1),B=r.useCallbackRef(async()=>{if(!f.current)return null;const x=f.current,H=x.editor;if(!H)return null;const re=x.monaco,ye=await(async(ne,X,ae="export")=>{const Me=ne.getModel();if(!Me)return null;const Te=await X.languages.typescript.getTypeScriptWorker(),fe=await Te(Me.uri),Be=await fe.getNavigationTree(Me.uri.toString());let pe=null,Pe=ne.getSelection();const Se=Pe.startLineNumber===Pe.endLineNumber&&Pe.startColumn===Pe.endColumn?Me.getLineCount():Math.min(Pe.endLineNumber,Me.getLineCount());for(let ge=Pe.startLineNumber;!pe&&ge<=Se;ge++){const ce=Ro(Be,Me.getOffsetAt({lineNumber:ge,column:1}),"function",ae);ce&&(pe=ce.text)}return pe})(H,re);return q?.({message:(ye??"").toUpperCase()}),ye?{source:H.getValue(),name:ye}:null},[q]),F=r.useCallbackRef(async(x,H,re)=>{const ye=await w.getScripts().createModule({source:re?.getValue(),declarationsOnly:!0}),ne=ye?ye.getFunctions().search():ue.CommonUtils.EmptyArray;ye&&(async function(X,ae){const Me=[];for(let Te=1;Te<X.getLineCount()+1;Te++){const fe={startLineNumber:Te,startColumn:1,endLineNumber:Te,endColumn:X.getLineLength(Te)+1},Be=X.getValueInRange(fe).indexOf("modelt");Be!==-1&&Me.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:ae.MarkerSeverity.Hint,startLineNumber:fe.startLineNumber,startColumn:Be+1,endLineNumber:fe.startLineNumber,endColumn:Be+5})}ae.editor.setModelMarkers(X,"owner",Me)}(x,H),async function(X,ae,Me,Te){const fe=await ae.languages.typescript.getTypeScriptWorker(),Be=await fe(X.uri),pe=await Be.getNavigationTree(X.uri.toString()),Pe=fo(X,ae,Te,pe).map(Se=>{let ge=null,ce=null;return Se.type==="formula"?(ge="formula.margin-icon",ce="Formula"):Se.type==="macro"?(ge="macro.margin-icon",ce="Macro"):Se.type==="autoRun"&&(ge="autorun.margin-icon",ce="Auto Run"),{range:new ae.Range(Se.lineNumber,1,Se.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:ge,glyphMarginHoverMessage:ce,stickiness:ae.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});P.current&&P.current.clear(),P.current=Me.createDecorationsCollection(Pe)}(x,H,re,ne))},[w]),A=r.useCallbackRef(ue.CommonUtils.debounce(F,580),[]),_=r.useCallbackRef(async(x=void 0)=>{if(!f.current||!w)return;const H=f.current.editor.getPosition(),re={cursor:H?H.toString():""};x!==void 0&&(re.message=x),q?.(re);const ye=B();w.setSelectedFunction(ye)},[w,q]);o.useEffect(()=>{if(!w)return;const x={insertSnippet:re=>{f.current?.editor&&(y?gr(f.current.editor,f.current.monaco,re):R.current=re)}};w.setEditor(x),w.setSelectedFunction(B());const H=w.addContainerListener({onBeforeSave:async()=>{if(!f.current?.editor||!w)return;const re=f.current.editor,ye=w?.getScripts().getModules().getByName("scripting"),ne=ye?.getSource(),X=re.getValue();if(!((ne?.length??0)!==X.length||ne!==X))return;await w.saveSource(re.getValue());const ae=(ne?.length??0)!==X.length||ne!==X;q?.({dirty:ae})},onReadonlyChange(){},onScriptChange:async()=>{if(!f.current?.editor||!w)return;const re=f.current.editor,ye=w.getScripts().getModules().search()[0]?.getSource()??"";re.setValue(ye)}});return()=>{H(),w.setSelectedFunction(null),w.setEditor(null)}},[w,y]),o.useEffect(()=>()=>{if(!f.current?.editor)return;const x=f.current.editor;w?.saveSource(x.getValue())},[]);const G=r.useCallbackRef(x=>{const H=f.current;if(!H)return!1;const re=H.editor;return!!re&&(re.focus(),!0)},[]),P=o.useRef(null),V=r.useCallbackRef((x,H)=>{f.current={monaco:H,editor:x},M(!0),_("Loading Types");const re=w.getScripts().getModules().search()[0]?.getSource()??"";x.setValue(re),Promise.resolve().then(()=>require("./CHwSaAIUkspCiH6o.cjs")).then(ne=>ne.customEditor).then(ne=>{_(""),ne.AutoTypings.create(x,{shareCache:!0,monaco:H,onError:X=>{X==="Not implemented yet"&&(X="Compile Errors"),console.warn("Error compiling types",X)}}).then(async X=>{const ae=x.getModel();A(ae,H,x)})}),x.addCommand("executeScript",function(ne,...X){X?.[0]&&j({functionName:X?.[0]})},""),x.addAction({id:"executeScript",label:"Execute",keybindings:[H.KeyCode.F8],run:async ne=>{const X=B();w.setSelectedFunction(X);const ae=await X;j(ae)}}),x.addAction({id:"saveScript",label:"Save Script",keybindings:[H.KeyMod.CtrlCmd|H.KeyCode.KeyS],run:ne=>{w?.saveSource(x.getValue()).then(()=>{const X=w?.getScripts().getModules().getByName("scripting"),ae=X?.getSource(),Me=x.getValue(),Te=(ae?.length??0)!==Me.length||ae!==Me;q?.({dirty:Te})})}}),x.onMouseDown(async ne=>{if(ne.target.type===H.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const X=ne.target.position.lineNumber,ae=await H.languages.typescript.getTypeScriptWorker(),Me=await ae(ye.uri),Te=await Me.getNavigationTree(ye.uri.toString()),fe=x?.getValue(),Be=(await w?.saveSource(fe)).getFunctions().search(),pe=fo(ye,H,Be,Te).find(Pe=>Pe.lineNumber===X);if(pe){const Pe=ne.event.browserEvent.button;Pe===0?pe.type==="macro"||pe.type==="autoRun"?j({functionName:pe.name}):pe.type==="formula"&&w.quickInsertFunction?.(pe.name):Pe===2&&(console.log("Context menu for function:",pe.name),ne.event.browserEvent.preventDefault())}}}),x.onDidChangeModelContent(()=>{const ne=x.getModel();A(ne,H,x)});const ye=x.getModel();(function(ne,X){X.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ae,Me,Te){const fe=[];for(let Be=1;Be<ae.getLineCount()+1;Be++){const pe={startLineNumber:Be,startColumn:1,endLineNumber:Be,endColumn:ae.getLineLength(Be)+1},Pe="hint",Se=ae.getValueInRange(pe).indexOf("hint");Se!==-1&&fe.push({kind:X.languages.InlayHintKind.Type,position:{lineNumber:pe.startLineNumber,column:Se+Pe.length+1},label:"[hint]"})}return{hints:fe,dispose:()=>{}}}})})(0,H),ye.onDidChangeContent(ne=>{const X=w?.getScripts().getModules().getByName("scripting"),ae=X?.getSource(),Me=x.getValue(),Te=(ae?.length??0)!==Me.length||ae!==Me;q?.({dirty:Te})}),x.onDidChangeCursorPosition(ne=>{_()})},[w,q]),$=o.useMemo(()=>y?null:p||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[y,p]),te=o.useMemo(()=>{const x=w?.getScripts().getModules().getByName("scripting")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(ya,{theme:m?"extended-dark":"extended",options:{...wa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:x,onValidate:H=>{let re=!1;for(let ye=0;!re&&ye<H?.length;ye++)H[ye].severity===8&&(re=!0)},beforeMount:H=>{H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),H.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),H.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),H.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let re=!1;try{const ne=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),X=H.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),ae=H.editor.createModel(ne,"typescript",X);H.editor.setModelMarkers(ae,"default",[]),re=!0}catch(ne){console.warn("cant load types",ne)}H.languages.registerLinkProvider("*",{provideLinks:(ne,X)=>{const ae=[],Me={links:ae},Te=ne.getLinesContent();for(let fe=1;fe<=Te.length;fe++){const Be=Te[fe-1],pe=H.editor.tokenize(Be,"typescript");for(let Pe=0;Pe<pe[0].length;Pe++){const Se=pe[0]?.[Pe];if(Se&&Se.type.startsWith("string")){let ge=Se.offset,ce=pe[0]?.[Pe+1]?.offset??Be.length,we=new H.Range(fe,ge+1,fe,ce+1),de=ne.getValueInRange(we);const be=de[0];be!=="`"&&be!=="'"&&be!=='"'||(ge++,de=de.substring(1));const Fe=de[de.length-1];Fe!=="`"&&Fe!=="'"&&Fe!=='"'||(ge++,de=de.substring(0,de.length-1));try{w.getRanges(de)&&ae.push({range:{endColumn:ce,endLineNumber:fe,startColumn:ge,startLineNumber:fe},tooltip:`Goto range '${de}'`,url:`/range/${de}`})}catch(ve){console.warn(ve)}}}}return Me}}),H.editor.registerLinkOpener({open(ne){if(ne?.path?.startsWith("/range/")){try{w.getRanges(ne.path.substring(7))?.select()}catch(X){console.warn("invalid range",X)}return!0}return!1}});const ye=H.languages.typescript.typescriptDefaults.getCompilerOptions();H.languages.typescript.typescriptDefaults.setCompilerOptions({...ye,target:H.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:H.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),R.current&&(await gr(f.current.editor,f.current.monaco,R.current),R.current=null),S.current&&requestAnimationFrame(async()=>{S.current&&H.editor.focus()}),H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),M(!0)})()},onMount:V})}),$]})},[w,W,l,$,m]),N=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:x=>{G(x)},close:()=>{I?.()},getEditor:()=>w?.getEditor()}),[w]);return o.useEffect(()=>(g&&requestAnimationFrame(()=>{G()}),()=>{f.current?.editor&&requestAnimationFrame(()=>{N.current?.contains(document.activeElement)&&G()})}),[]),c.jsx("div",{className:bt("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:N,...h,children:te})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>s.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),c.jsx("path",{className:"styled info_dark",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"}),c.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"})]}),exports.ChartAreaStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.jsx("path",{className:"styled info_light",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"}),c.jsx("path",{className:"styled info_dark",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"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.jsx("path",{className:"styled info_dark",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"})]}),exports.ChartBarIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.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"})]}),exports.ChartBarStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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"})]}),exports.ChartBubbleIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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"})]}),exports.ChartColumnIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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"})]}),exports.ChartColumnStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=li,exports.ChartLineIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineStackedMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),c.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"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartPieDoughnutIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",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"}),c.jsx("path",{className:"styled info_dark",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"})]}),exports.ChartPieIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",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"}),c.jsx("path",{className:"styled info_dark",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"})]}),exports.ChartScatterLinesIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartScatterLinesMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"})]}),exports.ChartScatterLinesSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartScatterMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"})]}),exports.CommandContext=ri,exports.CornerTriangle=so,exports.DateUtils=ml,exports.DocThemesContext=io,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(io.Provider,{value:t,children:n})},exports.EditableLabel=Er,exports.EmptyFrame=Zl,exports.FilterButton=mr,exports.FontUtils=fl,exports.Item=So,exports.LogoNoPaddingIcon=e=>c.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[c.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),c.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),c.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),c.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=wr,exports.MovableArea=Sr,exports.PictureEditor=Ir,exports.Row=ll,exports.ScriptEditor=Sa,exports.SheetCellEditor=pr,exports.SheetCellRenderer=fr,exports.SheetElement=Tr,exports.SheetScrollbar=vo,exports.StaticBorderRenderer=Rl,exports.StyledStrokePath=Cr,exports.Tab=rl,exports.TabStrip=il,exports.createCellEditStateFromCell=vr,exports.useBordersOverlay=po,exports.useDocThemes=()=>{const e=o.useContext(io),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=tt,exports.useMovableCommands=Rr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const p={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(p)}const d=p=>{a.current?.(p)},m=e.getRange(t).addListener(d,i);if(l){const p=e.getRange(t);d({getSource:()=>p,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=xr,exports.useSheetCopyPaste=qr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|
|
33
|
+
`,f=!0));const I=[{range:new t.Range(p.lineNumber,p.column,p.lineNumber,p.column),text:`${q}`}];let S=null;i.pushEditOperations([],I,D=>(S=D[0].range,h&&S.startLineNumber++,f&&S.endLineNumber--,[new t.Selection(S.startLineNumber,S.startColumn,S.endLineNumber,S.endColumn)])),e.setSelection({startLineNumber:S.endLineNumber,startColumn:S.endColumn,endLineNumber:S.startLineNumber,endColumn:S.startColumn})};function xa(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function fo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:xa(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)fo(e,t,n,l,a);return a}function Ro(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const p=Ro(m,t,n,i);if(p)return p}}return null}}function qa(e){return e.kind==="comment"}const Sa=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:p,autoFocus:g=!0,onStatusChange:q,...h}=e,f=o.useRef(null),I=r.useCallbackRef(d,[d]),S=o.useRef(!1),D=o.useMemo(()=>({contains(x){if(!f.current)return;const H=f.current.editor;return H&&H.getDomNode()?.contains(x)},focus(){if(!f.current)return;const x=f.current.editor;return x&&x.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",D,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),W=o.useMemo(()=>{let x=null;const H=()=>D;return x=a?a.createChildGroup(H,"scriptEditor",!1):new r.CommandGroup(H,"scriptEditor"),x.addCommands(z,!0),x},[a,z]),K=r.useCommands(W,["executeSelectedScript"])[0],y=K?.context(),B=r.useCallbackRef(x=>{K?.execute(x)},[K]),R=o.useRef(""),[w,M]=o.useState(!1),O=r.useCallbackRef(async()=>{if(!f.current)return null;const x=f.current,H=x.editor;if(!H)return null;const re=x.monaco,ye=await(async(ne,X,ae="export")=>{const Me=ne.getModel();if(!Me)return null;const Te=await X.languages.typescript.getTypeScriptWorker(),fe=await Te(Me.uri),Be=await fe.getNavigationTree(Me.uri.toString());let pe=null,Pe=ne.getSelection();const Se=Pe.startLineNumber===Pe.endLineNumber&&Pe.startColumn===Pe.endColumn?Me.getLineCount():Math.min(Pe.endLineNumber,Me.getLineCount());for(let ge=Pe.startLineNumber;!pe&&ge<=Se;ge++){const ce=Ro(Be,Me.getOffsetAt({lineNumber:ge,column:1}),"function",ae);ce&&(pe=ce.text)}return pe})(H,re);return q?.({message:(ye??"").toUpperCase()}),ye?{source:H.getValue(),name:ye}:null},[q]),F=r.useCallbackRef(async(x,H,re)=>{const ye=await y.getScripts().createModule({source:re?.getValue(),declarationsOnly:!0}),ne=ye?ye.getFunctions().search():ue.CommonUtils.EmptyArray;ye&&(async function(X,ae){const Me=[];for(let Te=1;Te<X.getLineCount()+1;Te++){const fe={startLineNumber:Te,startColumn:1,endLineNumber:Te,endColumn:X.getLineLength(Te)+1},Be=X.getValueInRange(fe).indexOf("modelt");Be!==-1&&Me.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:ae.MarkerSeverity.Hint,startLineNumber:fe.startLineNumber,startColumn:Be+1,endLineNumber:fe.startLineNumber,endColumn:Be+5})}ae.editor.setModelMarkers(X,"owner",Me)}(x,H),async function(X,ae,Me,Te){const fe=await ae.languages.typescript.getTypeScriptWorker(),Be=await fe(X.uri),pe=await Be.getNavigationTree(X.uri.toString()),Pe=fo(X,ae,Te,pe).map(Se=>{let ge=null,ce=null;return Se.type==="formula"?(ge="formula.margin-icon",ce="Formula"):Se.type==="macro"?(ge="macro.margin-icon",ce="Macro"):Se.type==="autoRun"&&(ge="autorun.margin-icon",ce="Auto Run"),{range:new ae.Range(Se.lineNumber,1,Se.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:ge,glyphMarginHoverMessage:ce,stickiness:ae.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});P.current&&P.current.clear(),P.current=Me.createDecorationsCollection(Pe)}(x,H,re,ne))},[y]),A=r.useCallbackRef(ue.CommonUtils.debounce(F,580),[]),_=r.useCallbackRef(async(x=void 0)=>{if(!f.current||!y)return;const H=f.current.editor.getPosition(),re={cursor:H?H.toString():""};x!==void 0&&(re.message=x),q?.(re);const ye=O();y.setSelectedFunction(ye)},[y,q]);o.useEffect(()=>{if(!y)return;const x={insertSnippet:re=>{f.current?.editor&&(w?gr(f.current.editor,f.current.monaco,re):R.current=re)}};y.setEditor(x),y.setSelectedFunction(O());const H=y.addContainerListener({onBeforeSave:async()=>{if(!f.current?.editor||!y)return;const re=f.current.editor,ye=y?.getScripts().getModules().getByName("scripting"),ne=ye?.getSource(),X=re.getValue();if(!((ne?.length??0)!==X.length||ne!==X))return;await y.saveSource(re.getValue());const ae=(ne?.length??0)!==X.length||ne!==X;q?.({dirty:ae})},onReadonlyChange(){},onScriptChange:async()=>{if(!f.current?.editor||!y)return;const re=f.current.editor,ye=y.getScripts().getModules().search()[0]?.getSource()??"";re.setValue(ye)}});return()=>{H(),y.setSelectedFunction(null),y.setEditor(null)}},[y,w]),o.useEffect(()=>()=>{if(!f.current?.editor)return;const x=f.current.editor;y?.saveSource(x.getValue())},[]);const G=r.useCallbackRef(x=>{const H=f.current;if(!H)return!1;const re=H.editor;return!!re&&(re.focus(),!0)},[]),P=o.useRef(null),V=r.useCallbackRef((x,H)=>{f.current={monaco:H,editor:x},M(!0),_("Loading Types");const re=y.getScripts().getModules().search()[0]?.getSource()??"";x.setValue(re),Promise.resolve().then(()=>require("./wDNFYRRXgRT9EMu2.cjs")).then(ne=>ne.customEditor).then(ne=>{_(""),ne.AutoTypings.create(x,{shareCache:!0,monaco:H,onError:X=>{X==="Not implemented yet"&&(X="Compile Errors"),console.warn("Error compiling types",X)}}).then(async X=>{const ae=x.getModel();A(ae,H,x)})}),x.addCommand("executeScript",function(ne,...X){X?.[0]&&B({functionName:X?.[0]})},""),x.addAction({id:"executeScript",label:"Execute",keybindings:[H.KeyCode.F8],run:async ne=>{const X=O();y.setSelectedFunction(X);const ae=await X;B(ae)}}),x.addAction({id:"saveScript",label:"Save Script",keybindings:[H.KeyMod.CtrlCmd|H.KeyCode.KeyS],run:ne=>{y?.saveSource(x.getValue()).then(()=>{const X=y?.getScripts().getModules().getByName("scripting"),ae=X?.getSource(),Me=x.getValue(),Te=(ae?.length??0)!==Me.length||ae!==Me;q?.({dirty:Te})})}}),x.onMouseDown(async ne=>{if(ne.target.type===H.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const X=ne.target.position.lineNumber,ae=await H.languages.typescript.getTypeScriptWorker(),Me=await ae(ye.uri),Te=await Me.getNavigationTree(ye.uri.toString()),fe=x?.getValue(),Be=(await y?.saveSource(fe)).getFunctions().search(),pe=fo(ye,H,Be,Te).find(Pe=>Pe.lineNumber===X);if(pe){const Pe=ne.event.browserEvent.button;Pe===0?pe.type==="macro"||pe.type==="autoRun"?B({functionName:pe.name}):pe.type==="formula"&&y.quickInsertFunction?.(pe.name):Pe===2&&(console.log("Context menu for function:",pe.name),ne.event.browserEvent.preventDefault())}}}),x.onDidChangeModelContent(()=>{const ne=x.getModel();A(ne,H,x)});const ye=x.getModel();(function(ne,X){X.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ae,Me,Te){const fe=[];for(let Be=1;Be<ae.getLineCount()+1;Be++){const pe={startLineNumber:Be,startColumn:1,endLineNumber:Be,endColumn:ae.getLineLength(Be)+1},Pe="hint",Se=ae.getValueInRange(pe).indexOf("hint");Se!==-1&&fe.push({kind:X.languages.InlayHintKind.Type,position:{lineNumber:pe.startLineNumber,column:Se+Pe.length+1},label:"[hint]"})}return{hints:fe,dispose:()=>{}}}})})(0,H),ye.onDidChangeContent(ne=>{const X=y?.getScripts().getModules().getByName("scripting"),ae=X?.getSource(),Me=x.getValue(),Te=(ae?.length??0)!==Me.length||ae!==Me;q?.({dirty:Te})}),x.onDidChangeCursorPosition(ne=>{_()})},[y,q]),$=o.useMemo(()=>w?null:p||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[w,p]),te=o.useMemo(()=>{const x=y?.getScripts().getModules().getByName("scripting")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(ya,{theme:m?"extended-dark":"extended",options:{...wa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:x,onValidate:H=>{let re=!1;for(let ye=0;!re&&ye<H?.length;ye++)H[ye].severity===8&&(re=!0)},beforeMount:H=>{H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),H.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),H.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),H.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let re=!1;try{const ne=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),X=H.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),ae=H.editor.createModel(ne,"typescript",X);H.editor.setModelMarkers(ae,"default",[]),re=!0}catch(ne){console.warn("cant load types",ne)}H.languages.registerLinkProvider("*",{provideLinks:(ne,X)=>{const ae=[],Me={links:ae},Te=ne.getLinesContent();for(let fe=1;fe<=Te.length;fe++){const Be=Te[fe-1],pe=H.editor.tokenize(Be,"typescript");for(let Pe=0;Pe<pe[0].length;Pe++){const Se=pe[0]?.[Pe];if(Se&&Se.type.startsWith("string")){let ge=Se.offset,ce=pe[0]?.[Pe+1]?.offset??Be.length,we=new H.Range(fe,ge+1,fe,ce+1),de=ne.getValueInRange(we);const be=de[0];be!=="`"&&be!=="'"&&be!=='"'||(ge++,de=de.substring(1));const Fe=de[de.length-1];Fe!=="`"&&Fe!=="'"&&Fe!=='"'||(ge++,de=de.substring(0,de.length-1));try{y.getRanges(de)&&ae.push({range:{endColumn:ce,endLineNumber:fe,startColumn:ge,startLineNumber:fe},tooltip:`Goto range '${de}'`,url:`/range/${de}`})}catch(ve){console.warn(ve)}}}}return Me}}),H.editor.registerLinkOpener({open(ne){if(ne?.path?.startsWith("/range/")){try{y.getRanges(ne.path.substring(7))?.select()}catch(X){console.warn("invalid range",X)}return!0}return!1}});const ye=H.languages.typescript.typescriptDefaults.getCompilerOptions();H.languages.typescript.typescriptDefaults.setCompilerOptions({...ye,target:H.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:H.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),R.current&&(await gr(f.current.editor,f.current.monaco,R.current),R.current=null),S.current&&requestAnimationFrame(async()=>{S.current&&H.editor.focus()}),H.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),M(!0)})()},onMount:V})}),$]})},[y,W,l,$,m]),N=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:x=>{G(x)},close:()=>{I?.()},getEditor:()=>y?.getEditor()}),[y]);return o.useEffect(()=>(g&&requestAnimationFrame(()=>{G()}),()=>{f.current?.editor&&requestAnimationFrame(()=>{N.current?.contains(document.activeElement)&&G()})}),[]),c.jsx("div",{className:bt("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:N,...h,children:te})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>s.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),c.jsx("path",{className:"styled info_dark",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"}),c.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"})]}),exports.ChartAreaStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.jsx("path",{className:"styled info_light",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"}),c.jsx("path",{className:"styled info_dark",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"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.jsx("path",{className:"styled info_dark",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"})]}),exports.ChartBarIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.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"})]}),exports.ChartBarStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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"})]}),exports.ChartBubbleIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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"})]}),exports.ChartColumnIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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"})]}),exports.ChartColumnStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=li,exports.ChartLineIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineStackedIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineStackedMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartLineStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),c.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"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartPieDoughnutIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",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"}),c.jsx("path",{className:"styled info_dark",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"})]}),exports.ChartPieIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",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"}),c.jsx("path",{className:"styled info_dark",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"})]}),exports.ChartScatterLinesIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartScatterLinesMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"})]}),exports.ChartScatterLinesSmoothIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"})]}),exports.ChartScatterMarkersIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"})]}),exports.CommandContext=ri,exports.CornerTriangle=so,exports.DateUtils=ml,exports.DocThemesContext=io,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(io.Provider,{value:t,children:n})},exports.EditableLabel=Er,exports.EmptyFrame=Zl,exports.FilterButton=mr,exports.FontUtils=fl,exports.Item=So,exports.LogoNoPaddingIcon=e=>c.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[c.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),c.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),c.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),c.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=wr,exports.MovableArea=Sr,exports.PictureEditor=Ir,exports.Row=ll,exports.ScriptEditor=Sa,exports.SheetCellEditor=pr,exports.SheetCellRenderer=fr,exports.SheetElement=Tr,exports.SheetScrollbar=vo,exports.StaticBorderRenderer=Rl,exports.StyledStrokePath=Cr,exports.Tab=rl,exports.TabStrip=il,exports.createCellEditStateFromCell=vr,exports.useBordersOverlay=po,exports.useDocThemes=()=>{const e=o.useContext(io),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=tt,exports.useMovableCommands=Rr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const p={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(p)}const d=p=>{a.current?.(p)},m=e.getRange(t).addListener(d,i);if(l){const p=e.getRange(t);d({getSource:()=>p,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=xr,exports.useSheetCopyPaste=qr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|