@sheetxl/react 0.6.16 → 0.6.18

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.
@@ -1,14 +1,14 @@
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.6.16
3
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.18
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"),ge=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Lt=require("react-dom"),fn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),yl=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:fn},Symbol.toStringTag,{value:"Module"})),Cr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),go=(e,t=!0,n=Cr)=>{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=ge.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},wl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Cr,findNextFontSize:go},Symbol.toStringTag,{value:"Module"})),ho=o.memo(e=>{const{anchorLocation:t=ge.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:b,style:u,...R}=e,h=a,C=l;let k="red",q=[],E=[];return t===ge.AnchorLocation.TopLeft?(k=d?"rgb(255, 198, 246)":"green",q.push(C),E.push(C),q.push(C+h),E.push(C),q.push(C),E.push(C+h)):t===ge.AnchorLocation.TopRight?(k=d?"rgb(0, 255, 255)":"red",q.push(n-C),E.push(C),q.push(n-(C+h)),E.push(C),q.push(n-C),E.push(C+h)):t===ge.AnchorLocation.BottomRight?(k=d?"rgb(236, 252, 211)":"purple",q.push(n-C),E.push(i-C),q.push(n-(C+h)),E.push(i-C),q.push(n-C),E.push(i-(C+h))):t===ge.AnchorLocation.BottomLeft&&(k=d?"rgb(255, 236, 183)":"blue",q.push(C),E.push(i-C),q.push(C+h),E.push(i-C),q.push(C),E.push(i-(C+h))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...u},...R,children:c.jsx("path",{d:`M ${q[0]} ${E[0]} L ${q[1]} ${E[1]} L ${q[2]} ${E[2]} L ${q[0]} ${E[0]} Z`,fill:m??k,...b})})}),br=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...b}=e,u=o.useMemo(()=>{let k=null;const q=l.getSortField();q&&(k=q.reverse);const E=l.getField(),D=E&&E.criteria&&E.criteria.length>0;return k===!0?D?"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":k===!1?D?"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":D?"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 7.4533523,10.606423 2.2001838,4.9460198 2.966932,4.1188401 7.4533523,8.9589099 11.933438,4.1188401 12.700184,4.9460198"},[l]),[R,h]=o.useState(!1),C=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${C}px`,height:`${C}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${R&&!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:(C>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:k=>{d?.(k,l),k.preventDefault()},...b,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${R&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:u})})})},yr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:b,bodyStyle:u,normalStyle:R,showFormulas:h,showZeros:C,docTheme:k,onLinkMouseDown:q,onFilterButtonMouseDown:E,filterButtonProps:D,createFilterButton:G=br,...U}=e,T=i.height/m,V=i.width/m,y=t,w=y.getValue(),S=t.getStyle(),j=u?.darkMode??!1;let M,I;const $=w&&w.isFormulaError,_=$&&w instanceof s.FormulaError.Parse;let H,B=h||_;if(B)if(y.isSpillOverflow())I="";else{const Ae=y.getFormulaText();Ae?I=Ae:M=y.getNumberFormat(s.NumberFormat.Type.General)}else M=y.getNumberFormat();B||(H=y.getTextOverflow());const K=H?H.colBounds.width+H.leftOffset+H.rightOffset:V,oe=H?H.anchorBounds.x-H.leftOffset:0,N=H?H.anchorBounds.width:V,z=H?H.anchorBounds.x:0;let ae,ve=y.getRenderHorizontalAlignment();M&&(ae=M?.formattedRuns,I=ae?.runs[0]?.text??M.displayText);const Ve=y.getCalcStatus()===s.ICell.CalcStatus.Pending;let qe=null,ue=S.getFill().toCSS(j,i),ke=0,Ke=0;if(!S.getBorder().isEmpty()){const Ae=S.getBorder().getRight();!Ae.isNone()&&s.IBorder.BuiltInDefinitions.get(Ae.getStyle()).width>1&&(ke=1);const A=S.getBorder().getBottom();!A.isNone()&&s.IBorder.BuiltInDefinitions.get(A.getStyle()).width>1&&(Ke=1)}let Ue=null;if(V!==N||ke||Ke||typeof ue?.backgroundPosition=="number"){const{backgroundPosition:Ae,...A}=ue,Q=Ae??0,O=b?.getScrollTopLeft(),X=Q?-(i.x+(O.left??0))%Q:0,g=Q?-(i.y+(O.top??0))%Q:0;(Ae!==void 0||ke||Ke||V!==N)&&(Object.keys(A).length===1&&A.background==="none"||(ue=null,Ue=c.jsx("div",{className:"fill",style:{marginLeft:`${X}px`,marginTop:`${g}px`,left:z*m,width:r.ReactUtils.boundPixel(N*m-X+1+ke),height:r.ReactUtils.boundPixel(i.height-g+1+Ke),...A}},"background")))}let Te=null;const he=y.getComments(),W=y.getWarnings(),Fe=y.getErrors();if(he||$||Fe.length>0||W.length>0){const Ae={size:7*m,darkMode:j,cellWidth:N*m+2,cellHeight:T*m+2,style:{top:-1,left:z*m-1}};Te=Te??[],(W.length>0||Fe.length>0||$)&&Te.push(c.jsx(ho,{anchorLocation:ge.AnchorLocation.TopLeft,...Ae},`indicator-${Te.length}`)),he&&Te.push(c.jsx(ho,{anchorLocation:ge.AnchorLocation.TopRight,...Ae},`indicator-${Te.length}`))}const Ce=S.getFont();let Y=M?.conditionalColor;const J=S.getAlignment(),ne=J.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,le=J.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||ne,me=le||B?0:J.getRotation(),Se=y.getInsets(),de=Se.top+Se.bottom;let be=Se.left,Me=Se.right;const Ee={...l,left:l.left-1,top:l.top-1,width:l.width+1+ke,height:l.height+1+Ke},f=y.getColumnFilter(),De=f&&!f?.hasHiddenButton();let Ye=null;Ve&&(Ye=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const He=!(Ve||De||Ue||a||Te||ae?.runs.length>1||H||me%360!=0);ue?.background==="none"&&(ue=null);let $e=le||!(!H||!(H.rightIndex>0||H.leftIndex>0||H.colSpan>1));if(!$e){const Ae=y.getSpans();(Ae.width>1||Ae.height>1)&&($e=!0)}const re={...ue,...Ee,pointerEvents:q?"auto":void 0};if(!ge.CommonUtils.isEmpty(I)||!ge.CommonUtils.isEmpty(M?.repeatPlaceholder)){const Ae=M?.canWrap??!1;let A=null,Q=null,O=null,X=[],g=!0;C||B||w!==0||(g=!1);const x=y.getTextFrame(B);if(g&&x){let F=K-1-(be+Me);if(me){A=x.layout().bounds;const we={x:0,y:0,width:K-1,height:T};if(ae){let fe=ae.width;if(M.repeatPlaceholder||M.repeatChars.length>0){const pe=s.GeomUtils.boundsToPoints(we),xe=s.GeomUtils.rotatePoints(pe,-me);fe=s.GeomUtils.minBoundingRect(xe).width}A={...A,width:fe}}O=s.GeomUtils.clipToOuterRect({...A,width:A.width+1+be+Me},we,me),F=O.width-1-(be+Me)+.01}let p=null;Ae&&(p={width:F});let L=null,v=M?.repeatPlaceholder;const P=x.layout(p);if(A=P.bounds,B?A={...A,width:0}:ae&&(A={...A,width:M.repeatPlaceholder||M.repeatChars.length>0?F:ae.width}),me&&Ae){let ce=null;P.visitLines({visitTextLine:(we,fe)=>{let pe=we.bounds;const xe=s.GeomUtils.boundsToPoints(pe),Oe=s.GeomUtils.rotatePoints(xe,me),Ne=s.GeomUtils.minBoundingRect(Oe);pe={...pe,x:(Ne.width-pe.width)/2,y:(Ne.height-pe.height)/2},ce=ce?s.GeomUtils.unionBounds(ce,pe):pe}}),A={...ce,width:ce.width+be+Me}}if(!v&&y.getType()!==s.ScalarType.String&&Math.floor(A.width)>F){if(S.getNumberFormat()==="General"&&y.getType()===s.ScalarType.Number){const ce=S.measureText("0"),we=Math.floor(F/ce.width),fe=w,pe=ge.CommonUtils.splitNumber(fe),xe=Math.min(10,we-(Math.max(1,pe.ipLength)+1)-(fe<0?1:0));if(xe>=-1){const Oe=`0${xe>0?".":""}${"#".repeat(Math.max(0,xe))}`;L=y.getNumberFormat(Oe).displayText,L==="0"&&fe<0&&(L="-0")}else if(Math.abs(fe)>=Math.pow(10,5)||Math.abs(fe)<=Math.pow(10,-5)){const Oe=we-5-(fe<0?1:0);if(Oe>=0){const Ne=`0.${"0".repeat(Math.max(0,Oe-1))}E+00`;L=y.getNumberFormat(Ne).displayText}}}L||(v="#")}if(!v&&ae?.lastRepeatIndex>=0&&ae?.width>F&&(v="#"),v&&F>0){const ce=S.measureText(v),we=Math.floor((F||1)/(ce?.width||1));L=we>0?v.repeat(we):"",ve=s.ITextFrame.HorizontalAlignment.Center}if(B&&(ve=s.ITextFrame.HorizontalAlignment.Left),L){const ce=S.measureText(L).width;ce&&(A={...A,width:ce})}if(Q={...A,width:A.width+be+Me,height:A.height},me&&!Ae){const ce=s.GeomUtils.boundsToPoints(Q),we=s.GeomUtils.rotatePoints(ce,me),fe=s.GeomUtils.minBoundingRect(we);Q.width=fe.width,Q.height=fe.height}ve===s.ITextFrame.HorizontalAlignment.Center||ve===s.ITextFrame.HorizontalAlignment.CenterContinuous?Q.x=(K-Q.width)/2:ve===s.ITextFrame.HorizontalAlignment.Right?Q.x=K-Q.width-.5:Q.x=.5,J.getVertical()===s.ITextFrame.VerticalAlignment.Center?Q.y=(T-Q.height)/2:J.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?Q.y=T-Q.height-de:Q.y=de;const Z=He?{...U}:void 0,ee={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:me?`rotate(${me}deg)`:void 0,cursor:q?"pointer":void 0,pointerEvents:q?"auto":void 0,zIndex:$e?1:void 0,...ue},onMouseDown:q,onDoubleClick:q?ce=>{ce.stopPropagation(),ce.preventDefault()}:null,...Z};_&&(ee.style.textDecorationStyle="wavy",ee.style.textDecorationColor=j?"rgb(0, 255, 255)":"red",ee.style.textDecorationLine="underline");const ie=Ce.getSize(),se=(ce,we,fe,pe,xe,Oe,Ne,We=null)=>{let je=ie*m,_e=fe,Le=Ne?.runs?Ne.runs:[{type:s.NumberFormat.ParseRunType.Text,text:ce,width:S.measureText(ce,je).width}];Ne&&Ne?.width!==A.width&&(A={...A,width:Ne?.width});let Je=be;if(Ne?.lastRepeatIndex>=0&&F>Ne?.width){const Ze=Ne.runs[Ne.lastRepeatIndex];if(Ze){const lt=[...Le],pt=Math.max(0,F-1-Ne.width);let wt=0,vt="";if(pt>0){const gt=Math.floor(pt/Ze.width);vt=gt>0?Ze.text.repeat(gt):"",wt=pt}lt[Ne.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:vt,width:wt},Le=lt,A={...A,width:Ne.width+wt}}}const at=(Ze,lt,pt,wt,vt,gt,it,Et,Bt,Qt=null)=>{let Dt,en=_e.width;xe===s.ITextFrame.HorizontalAlignment.Justify?(en=vt,Oe||(Dt="justify")):xe===s.ITextFrame.HorizontalAlignment.Distributed&&(en=vt,Dt=Oe||Ze.text.split(" ").length-1==0?"center":"justify");const{style:Tt,className:xn,...Ct}=Qt;let Vt=Ze.text;if(xe===s.ITextFrame.HorizontalAlignment.Fill&&M?.repeatChars.length===0){const st=Math.max(1,Math.floor((_e?.width??0)/(it?.width??1)));Vt=Vt.repeat(st)}let tn=_e.height;const Mt=Ce.getVerticalAlignment(),zt=Mt===s.IFont.VerticalAlignment.Sub,qn=Mt===s.IFont.VerticalAlignment.Super;if(zt||qn){const st=Ce.getSuperSubScale();je*=st,tn*=st}const tt={textAlign:Dt,textAlignLast:Dt,...Tt,...Ce.toCSS(j,m,!0),fontSize:je*s.IFont.getDeviceScale()};He||(tt.background=void 0),Y&&(tt.color=Y.toCSS(j));const Sn=Je+lt;let Pt=Se.top+_e.y+0;if(zt&&(Pt+=Bt-je),gt){const st=(it.x+Sn)*m+1,ht=(it.y+Pt)*m+1;ht<0?tt.marginTop=ht:tt.paddingTop=ht,st<0?(tt.width=(Tt?.width??0)-st,tt.left=(Tt?.left??0)+st):tt.paddingLeft=st,tt.paddingRight=Math.max(0,(Tt?.width??0)-en*m-st),tt.paddingBottom=Math.max(0,(Tt?.height??0)-_e.height*m-ht),tt.height=(Tt?.height??0)+(ht<0?-ht:0),(ht<0||st<0)&&(tt.clipPath=`inset(${ht<0?-ht:0}px 0px 0px ${st<0?1-st:0}px)`)}else if(tt.left=(it.x+Sn)*m+1,tt.top=(it.y+Pt)*m+1,tt.width=it.width*m,tt.height=it.height*m,me&&!Ae){tt.left=(it.x+lt)*m+1,tt.top=(it.y+(_e.y+0))*m+1;const st=s.GeomUtils.centerPoint({x:Je+lt,y:0,width:Ze.width,height:_e.height}),ht=s.GeomUtils.centerPoint({x:Je,y:0,width:vt,height:_e.height}),on=s.GeomUtils.rotatePoints([st],me,ht),rn={x:on[0].x-st.x,y:on[0].y-st.y};tt.left=tt.left+rn.x*m,tt.top=tt.top+rn.y*m;const Ht={..._e,x:Je,y:Se.top,width:_e.width+(be+Me)},Wn=s.GeomUtils.boundsToPoints(Ht),Gn=s.GeomUtils.rotatePoints(Wn,me),Ut=s.GeomUtils.minBoundingRect(Gn);Ht.width=Ut.width,Ht.height=Ut.height;const Rn=s.GeomUtils.centerPoint(Ht),Kt={x:Rn.x-ht.x,y:Rn.y-ht.y};tt.left=tt.left+Kt.x*m,tt.top=tt.top+Kt.y*m}tt.lineHeight=tn*m+"px";const nn=He?void 0:"text-line";X.push(c.jsx("div",{className:xn?`${xn} ${nn}`:nn,style:tt,...Ct,children:Vt},`text-${_e.y}-${wt}-${pt}`))};if(J.getOverflow()===s.ITextFrame.Overflow.Shrink&&F>0){let Ze=A?.width??0,lt=0;for(;Ze>1&&Ze>F&&je>2&&lt<100;)je*=F/Ze,Ze=S.measureText(ce,je).width,lt++;A={...A,width:Ze}}let ft=_e.x;xe===s.ITextFrame.HorizontalAlignment.Right?ft+=A.width-_e.width:xe!==s.ITextFrame.HorizontalAlignment.Center&&xe!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(ft+=(A.width-_e.width)/2),Ne?.lastRepeatIndex>=0&&(ft=_e.x);const xt=Le.length;for(let Ze=0;Ze<xt;Ze++){const lt=Le[Ze];(lt.type===s.NumberFormat.ParseRunType.Text||lt.type===s.NumberFormat.ParseRunType.Repeat)&&(lt.type,s.NumberFormat.ParseRunType.Repeat,at(lt,ft,Ze,we,xe===s.ITextFrame.HorizontalAlignment.Justify||xe===s.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?F:_e.width,He,{x:Q.x+oe,y:Q.y,width:lt.width,height:A.height},0,pe,We)),ft+=lt.width}};L?se(L,0,{x:0,y:0,...A},P.lines[0].baseline,ve,!0,null,ee):P.visitLines({visitTextLine:(ce,we,fe)=>{const pe=ce.runs[0].text.replace(/\s+$/,""),xe=we===fe-1;let Oe=ve===s.ITextFrame.HorizontalAlignment.Justify&&(xe||ce.runs[0].text.endsWith(`
8
- `))?s.ITextFrame.HorizontalAlignment.Left:ve,Ne=0;we>0&&(J.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||J.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(T-(de+3)-ce.bounds.height*fe)/(fe-1)*we)),J.getVertical()===s.ITextFrame.VerticalAlignment.Distributed&&me&&me%90==0&&me%180!=0&&(Oe=s.ITextFrame.HorizontalAlignment.Distributed),Oe!==s.ITextFrame.HorizontalAlignment.Justify&&Oe!==s.ITextFrame.HorizontalAlignment.Distributed&&Oe!==s.ITextFrame.HorizontalAlignment.Fill||(A={...A,width:F});let We=ne||M&&(M.repeatChars.length>0||M.spacingChars.length>0)?A.width:ce.bounds.width;const je={...ce.bounds,y:ce.bounds.y+Ne+0,width:We};se(pe,we,je,x.lines[0].baseline,Oe,xe,fe===1?ae:null,He&&we>0?{...ee,style:{...ee.style,background:void 0}}:ee)}})}X.length>0&&(qe=X)}if(He)return qe&&qe.length>0?qe:c.jsx("div",{style:re,...U});let Re=q?"auto":Ee.pointerEvents,ze=null;if(De){const Ae={x:z*m-1,y:-1,width:N*m+1,height:T*m+1};Re="auto",ze=G({renderBounds:Ae,darkMode:j,className:"filter-button",disabled:!y.isEditAllowed(),zoom:m,filter:y.getColumnFilter(),onFilterButtonMouseDown:E,...D}),ze&&(ze=c.jsx("div",{style:{...Ae,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:A=>{A.stopPropagation(),A.preventDefault()},children:ze},"filterButton"))}Ve&&!qe&&(qe=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 ye=[Ue,qe,a,Te,Ye,ze];return c.jsx("div",{style:{...ue,...Ee,pointerEvents:Re},...U,children:ye})},Ao={text:"",placeholder:""},Do=(e,t)=>{if(e.clean().getStyle().getNumberFormat().indexOf("%")===-1)return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},xl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),wr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:d,onDoneEdit:m,defaultTextStyle:b,useRichStyling:u=!0,bodyStyle:R,activeCoords:h,sheet:C,commands:k,containerBounds:q,setNaturalDimensions:E,onFocus:D,disabled:G,style:U,zoom:T=1,linesVisible:V,autoFocus:y=!1,...w}=e,{height:S=0,width:j=0}=q??{},M=R?.darkMode??!1,I=o.useRef(null),[$,_]=o.useState(!1),[H,B]=o.useState(null),[K,oe]=o.useState(()=>n);o.useEffect(()=>{Ke.current=!1,oe(n)},[n]);const N=o.useMemo(()=>{const A=K.clean();let Q=A.getStyle();u||(Q=Q.createTemporaryStyle({font:{size:b?.fontSize}}));const O=A.getFormula(),X=Q.getAlignment(),g=O?s.ITextFrame.HorizontalAlignment.Left:X.getHorizontal(),x=X.getVertical(),F=X.getOverflow()===s.ITextFrame.Overflow.Wrap||A.getType()===s.ScalarType.String&&(g===s.ITextFrame.HorizontalAlignment.Justify||g===s.ITextFrame.HorizontalAlignment.Distributed||x===s.ITextFrame.VerticalAlignment.Justify||x===s.ITextFrame.VerticalAlignment.Distributed),p=(P=>{if(!P)return Ao;const Z=P.clean();if(!Z)return Ao;let ee=Z.getStyle()?.getQuotePrefix();if(P.dirty===void 0||P.dirty===null){let ie="",se=Z.getFormulaText();se&&(ie=se,ee=!1),ie||(ie=Z.toTextUnformatted(!0)??"");let ce="";if(!P.editMode&&Z.isSpillOverflow()){const we=Z.getSpill();if(we){const fe=we.getCell(),pe=fe.getFormulaText();fe.isEqual(Z)||(ce=pe)}}return ee&&(ie="'"+ie),{text:ie,placeholder:ce}}return{text:P.dirty??"",placeholder:""}})(K),L=p.text,v=s.ITextFrame.toCSSHorizontalTextAlign(u&&!O?K.clean()?.getRenderHorizontalAlignment():s.ITextFrame.HorizontalAlignment.Left);return{style:Q,isWrapped:F,textValue:L,formula:O,frameVertAlign:x,placeholder:p.placeholder,insets:u?A.getInsets():ge.TypesUtils.EmptyRect,textAlign:v}},[K,b,M,T,u]),z=o.useRef(null),ae=r.useImperativeElement(t,()=>({startEdit:A=>{I.current=A?.initialSelection;const Q={...n,editMode:A?.editMode??!1};A?.text!==void 0&&(Q.dirty=A.text),Q.editMode===n.editMode&&Q.dirty===n.dirty||(oe(Q),qe?.(Q))},submitEdit:()=>Ue(),cancelEdit(){Te()},autoFocus(){z.current.focus()},dispatchEvent:A=>z.current.dispatchEvent(A),focus(){z.current.focus()},getLineHeight:Ve}),[i,n]);o.useLayoutEffect(()=>{if(!H||!$)return;const A=z.current;N.textValue,A&&A.setSelectionRange(H.start,H.end,H.direction)},[z.current,H,N.textValue]);const ve=o.useMemo(()=>{const A=K?.clean(),Q=N.style.createTemporaryTextFrame(N.textValue,A?.getType()===s.ScalarType.String),O=u?A.getInsets().right+A.getInsets().left:0;let X=null;return N.isWrapped&&(X={width:j-O}),Q.layout(X)},[N,j,K,u]),Ve=r.useCallbackRef(()=>Math.ceil(ve?.lines[0]?.bounds.height),[ve]);o.useLayoutEffect(()=>{if(!ve)return;const A=N.style,Q=A.getInsets()??ge.TypesUtils.EmptyRect,O=u?Q.left+Q.right:0,X=u?.04*A.getFont().getSize():1,g=Math.round(N.isWrapped?void 0:ve.bounds.width+O+X),x=Math.round(ve.bounds.height);E?.({width:g,height:x})},[ve,E,N,u,K]);const qe=r.useCallbackRef(a,[a]),ue=r.useCallbackRef(A=>{if(K.dirty===A)return;const Q={...K};Q.dirty=A,z.current,oe(Q),qe?.(Q)},[K]),ke=r.useCallbackRef(A=>{if(K.editMode===A)return;const Q={...K};Q.editMode=A,oe(Q),qe?.(Q)},[K]),Ke=o.useRef(!1),Ue=r.useCallbackRef(()=>{if(Ke.current)return!1;try{l?.(K),m?.(),Ke.current=!0}catch{return!1}return!0},[l,K]),Te=r.useCallbackRef(()=>{Ke.current=!0,oe(n),d?.(),m?.()},[d,n]),he=r.useCallbackRef(A=>{if(!z.current)return;if(A.key,A.isDefaultPrevented(),!(A.isTrusted||A.nativeEvent.ctrlKey||A.nativeEvent.metaKey||A.nativeEvent.altKey||A.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(A.nativeEvent.key)===-1&&A.nativeEvent.key!=="Backspace")){const p={...K};let L=0;return Do(p,p.dirty)&&!isNaN(parseFloat(A.key))?(p.dirty?.endsWith("%")?p.dirty=(p.dirty.substring(0,p.dirty.length-1)??"")+A.key+"%":p.dirty=(p.dirty??"")+A.key+"%",L=p.dirty.length-1):A.nativeEvent.key==="Backspace"?(p.dirty="",L=p.dirty.length):(p.dirty=(p.dirty??"")+A.key,L=p.dirty.length),z.current.value=p?.dirty,I.current={start:L,end:L,direction:"forward"},z.current?.setSelectionRange(L,L,"forward"),oe(p),qe?.(p),void A.preventDefault()}const Q=A.nativeEvent.ctrlKey,O=A.nativeEvent.shiftKey,X=A.nativeEvent.altKey,g=A.nativeEvent.metaKey;if(Q&&A.key==="z"&&A.stopPropagation(),A.which===r.KeyCodes.Escape)return A.preventDefault(),void Te();if(A.which===r.KeyCodes.F2)return ke(!0),void A.preventDefault();const x=A.target;if(A.key==="%"&&x.selectionStart===x.selectionEnd&&x.value[x.selectionStart]==="%"&&K?.clean().getStyle().numberFormat.includes("%"))return B({start:x.selectionStart+1,end:x.selectionEnd+1,direction:x.selectionDirection}),void A.preventDefault();if(A.which===r.KeyCodes.Enter){if(A.preventDefault(),g||X){const p=N.textValue.substring(0,x.selectionStart)+`
9
- `+N.textValue.substring(x.selectionEnd);return ue(p),void B({start:x.selectionStart+1,end:x.selectionStart+1,direction:x.selectionDirection})}return void(Ue()&&C.getSelection().traverse(s.IRange.Orientation.Column,O))}if(A.which===r.KeyCodes.Tab)return A.preventDefault(),void(Ue()&&C.getSelection().traverse(s.IRange.Orientation.Row,O));let F=null;switch(A.which){case r.KeyCodes.Left:F=s.IRange.Direction.Left;break;case r.KeyCodes.Right:F=s.IRange.Direction.Right;break;case r.KeyCodes.Up:F=s.IRange.Direction.Up;break;case r.KeyCodes.Down:F=s.IRange.Direction.Down}if(F&&!(Q||O||X||g)&&!K.editMode)return void Ue();K.editMode&&(F||xl.includes(A.which))&&A.stopPropagation()},[K,C,N]),W=o.useCallback(()=>{z.current?.focus(),setTimeout(()=>{z.current?.select()},0)},[]),Fe=o.useCallback(()=>{z.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Ce=r.useCallbackRef(()=>{const A=z.current?.value;let Q="";if(h.rowIndex>0){const O=C.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();O&&(Q=O.toTextUnformatted(!0))}ue(A+Q)},[h,C]);o.useEffect(()=>C.getRange(h).addListener(()=>{const A={...K,clean:()=>C.getRange(h).getCell()};oe(A),qe?.(A)}),[h,C,K]);const Y=o.useCallback(()=>{const A=K.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText();ue((z.current?.value??"")+A)},[C]),J=o.useCallback(()=>{const A=K.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText();ue((z.current?.value??"")+A)},[C]),ne=o.useMemo(()=>({element:()=>z.current,doCopy:A=>{const Q=z.current.value.substring(z.current.selectionStart,z.current.selectionEnd);if(A?.isCut){const O=z.current.value.substring(0,z.current.selectionStart)+z.current.value.substring(z.current.selectionEnd,z.current.value.length);ue(O)}return Q}}),[z.current]),le=o.useMemo(()=>({element:()=>z.current,doPaste:async(A,Q)=>{const O=await A.toText?.();if(!O)return!0;const X=z.current.value.substring(0,z.current.selectionStart)+O+z.current.value.substring(z.current.selectionEnd,z.current.value.length);return ue(X),B({start:z.current.selectionStart+O.length,end:z.current.selectionStart+O.length,direction:"forward"}),!0}}),[z.current]),me=o.useMemo(()=>({contains:A=>z.current?.contains(A)||!1,focus(){z.current.focus()}}),[]),Se=o.useMemo(()=>[new r.SimpleCommand("selectAll",me,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},W),new r.SimpleCommand("startEditValueAbove",me,{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]}]},Ce),new r.SimpleCommand("startEditCurrentTime",me,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},Y),new r.SimpleCommand("startEditCurrentDate",me,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},J),new r.Command("relativeReferencesToggle",me,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Fe),new r.Command("toggleEditorFocus",me,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),de=o.useMemo(()=>{let A=null;const Q=()=>({contains:O=>z.current?.contains(O)||!1,focus(){z.current.focus()}});return A=k?k.createChildGroup(Q,"editor",!1):new r.CommandGroup(Q,"editor"),A.addCommands(Se,!0),A},[k,Se]),be=o.useMemo(()=>({notifier:null,source:ne,target:le,commands:de}),[ne,le,de]);r.useCopyPaste(be);const[Me,Ee]=o.useState(!y);o.useEffect(()=>{Ee(!1)},[]);const f=r.useCallbackRef(A=>{_(!0),de?.activate();const Q=I.current;if(Q!==!1){let O,X;const g=z.current.value;Do(K,g)&&(O=g.length-1,X=g.length-1),O=Q?.start??O??g.length,X=Q?.end??X??g.length,I.current=!1,B({start:O,end:X,direction:"forward"})}D?.(A)},[D,K]),De=N.insets;let Ye=De.left+1;const He=De.left+De.right+2-1,$e=ve?.bounds.height??0;let re,Re=De.top;N.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?Re=Math.max(0,(S-(De.top+De.bottom)-$e)/2):N.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(Re=Math.max(0,S-(De.top+De.bottom)-$e)),V!==void 0&&ve?.lines[0]?.bounds&&(re=ve?.lines[0]?.bounds.height*V);const ze=N.style.getFont();let ye=ze.getSize();ze.isSuperSub()&&(ye*=ze.getSuperSubScale()),ye*=s.IFont.getDeviceScale()*T;const Ae=u?ze.toCSS(M,T):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:A=>{z.current&&document.activeElement!==z.current&&requestAnimationFrame(()=>{z.current.focus()})},ref:ae,...w,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...U},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Re*T+1,left:Ye*T,width:`calc(100% - ${He*T}px)`,maxWidth:`calc(100% - ${He*T}px)`,height:(re??$e)*T,maxHeight:(re??$e)*T},children:c.jsx("textarea",{spellCheck:"false",placeholder:N.placeholder,ref:z,value:N.textValue,disabled:Me,readOnly:G||C.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ae,fontSize:ye?`${ye}px`:"inherit",textAlign:N.textAlign,lineHeight:(ve?.lines[0]?.bounds.height??0)*T+"px",height:(ve?.bounds.height??0)*T,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:f,onBlur:()=>{_(!1)},onSelect:A=>{},onChange:A=>{z.current&&!Ke.current&&(I.current=!1,ue(A.target.value),N.textValue,A.target.value,A.target.selectionStart,A.target.selectionEnd,A.target.selectionDirection,B({start:A.target.selectionStart,end:A.target.selectionEnd,direction:A.target.selectionDirection}))},onMouseDown:A=>{$&&ke(!0)},onKeyDown:he})})})})),xr=(e,t)=>({clean:e,dirty:t,editMode:!1}),qr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:b=0,isVertical:u=!1,...R}=e,h=U=>{let T=null;if(U&&n>0){T="";for(let V=0;V<U.length;V++)T+=U[V],V<U.length-1&&(T+=",")}return T},C=h(i);let k=C;a&&(k=h(a));let q=n,E=t,D=null;if(l){q=Math.floor(n/2);const U=q+q/2+1;let T=null;T=u?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(b+U)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(b+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:k,d:T,...R})}if(d){q=n/2;const U=q+q/2;let T=k,V=null;V=u?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(b+U)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(b+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:T,strokeDashoffset:"1",shapeRendering:"crispEdges",d:V,...R})}let G=null;return G=u?`M ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(b)} L ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(b+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(b+q/2)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(b+q/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:q,strokeDasharray:C,d:G,...R}),D]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Xt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=ro(i,t),l=typeof a=="function";n.push(l?a:()=>ro(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)ro(n,t)}},ql=function(){},Sr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Sl=Sr?o.useLayoutEffect:o.useEffect,zo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ot=Sr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(zo),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var b=m[0].contentRect,u=b.x,R=b.y,h=b.width,C=b.height,k=b.top,q=b.left,E=b.bottom,D=b.right;l({x:u,y:R,width:h,height:C,top:k,left:q,bottom:E,right:D})}})},[]);return Sl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[ql,zo]},Rl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,kl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Ml=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:b=!1,intersections:u,layout:R}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const C=n[0],k=n[1],q=n[2],E=n[3];let D=1+(b?E-k:q-C),G=0;const U=a.getColor().toRGBA(l).toString(),T=h.description.toLowerCase().includes("double");let V,y;const w=b?"rowStart":"colStart",S=b?"rowEnd":"colEnd",j=b?k:C;if(u?.length>0){const _=u[0];if(_?.range[w]===i[w]){const B=s.IBorder.BuiltInDefinitions.get(_.stroke.getStyle());G=Math.floor(B.width/2)}if(u[u.length-1]?.range[S]===i[S]){const B=s.IBorder.BuiltInDefinitions.get(u[u.length-1].stroke.getStyle());D=Math.floor(D+(B.width===2?0:B.width/2))}if(T){const B=b?"colStart":"rowStart",K=b?"colEnd":"rowEnd",oe=b?R?.getRowOffset:R?.getColOffset;let N=0,z=0;V=[],y=[];for(let ae=0;ae<u.length;ae++){const ve=u[ae];if(ve.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&oe){const Ve=oe(ve.range[w])-(j-G);ve.range[B]<i[B]&&(V.push(Ve-N),N=Ve,V.push(1),N++),ve.range[K]>i[K]&&(y.push(Ve-z),z=Ve,y.push(1),z++)}}V.length>0&&N<D&&V.push(D-N),y.length>0&&z<D&&y.push(D-z)}}let M=b?-Math.floor(h.width/2):-G,I=b?-G:-Math.floor(h.width/2);const $=m&&h.width>2?-1:0;return c.jsx(qr,{offsetX:C+M+$,offsetY:k+I+$,length:D+G,isVertical:b,stroke:U,width:h.width,dashArray:V??h.pattern,dashArrayAdditional:y,isDouble:T,isAngled:h.description.toLowerCase().includes("slant")},t)},yo=({getBorderAt:e,borderRenderer:t=Ml,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>u=>{const R=u.toClipBounds(u.getRangeCoordsBounds(),-3);if(!R)return;const h=m(u);if(h.length===0)return;const C=u.getVisibleColumnOffsets(),k=u.getVisibleRowOffsets();let q=[],E=[];const D=u.getVisibleColumns(),G=u.getVisibleRows(),U=[],T=[],V=[],y=(M,I,$,_,H,B,K)=>{const oe={index:_,stroke:H,visibleIndex:$,edge:B,length:K};M[I]||(M[I]=[]),M[I].length>0&&M[I][M[I].length-1]?.index===_?M[I][M[I].length-1]=oe:M[I].push(oe)};for(let M=0;M<h.length;M++){const I=h[M],$=I.coords;if(!$)continue;const _=I?.range??{rowStart:$.rowIndex,colStart:$.colIndex,rowEnd:$.rowIndex,colEnd:$.colIndex},H=u.getVisibleRangeCoords();if(!ge.CoordUtils.isRangesIntersect(_,H)&&!ge.CoordUtils.isRangeWithinRange(_,H))continue;const B=$.colIndex,K=$.rowIndex,oe=C[B],N=k[K];if(_.rowEnd!==_.rowStart){const he=k[_.rowStart]?.spanIndex??-1,W=k[_.rowEnd]?.spanIndex??k[G[G.length-1]].spanIndex+1;q.push({..._,rowStart:he,rowEnd:W})}if(_.colEnd!==_.colStart){const he=C[_.colStart]?.spanIndex??-1,W=C[_.colEnd]?.spanIndex??C[D[D.length-1]].spanIndex+1;E.push({..._,colStart:he,colEnd:W})}const z=I.value,ae=e(z,M);if(!ae||ae.isEmpty())continue;const ve=ae.getLeft(),Ve=ae.getTop(),qe=ae.getRight(),ue=ae.getBottom();let ke=1,Ke=1;if(!oe||!N)continue;const Ue=oe.spanIndex,Te=N.spanIndex;ve.isNone()||y(U,Ue,Te,K,ve,s.IBorder.Edge.Left,ke),Ve.isNone()||y(T,Te,Ue,B,Ve,s.IBorder.Edge.Top,Ke),qe.isNone()||y(U,Ue+Ke,Te,K,qe,s.IBorder.Edge.Right,ke),ue.isNone()||y(T,Te+ke,Ue,B,ue,s.IBorder.Edge.Bottom,Ke)}const w=(M,I,$)=>{const _=[];return M.forEach((H,B)=>{let K=null;H.sort((oe,N)=>oe.visibleIndex-N.visibleIndex);for(let oe=0;oe<H.length;oe++){const N=H[oe];if(!N?.stroke||I[B]===void 0&&I[B-1]===void 0)continue;let z=!1;if($)for(let qe=0;!z&&qe<q.length;qe++){let ue=q[qe];ue.colStart<=N.index&&ue.colEnd>=N.index&&ue.rowStart<B&&ue.rowEnd>=B&&(z=!0)}else for(let qe=0;!z&&qe<E.length;qe++){let ue=E[qe];ue.rowStart<=N.index&&ue.rowEnd>=N.index&&ue.colStart<B&&ue.colEnd>=B&&(z=!0)}if(z)continue;const ae=N.stroke?.getColor(),ve=ae?ae.toRGBA().toString():l,Ve=N.stroke.getStyle()+":"+ve;(Ve!==K?.key||K&&K.visibleIndex+1<N.visibleIndex)&&(K&&_.push(K),K={key:Ve,index:I[B]??I[B-1]+1,visibleIndex:N.visibleIndex,edge:N.edge,stroke:N.stroke,from:N.index,to:N.index+N.length-1,intersections:[],length:1}),K.to=N.index+N.length-1,K.visibleIndex=N.visibleIndex}K&&_.push(K)}),_};q=q.sort(kl),E=E.sort(Rl);const S=w(U,D,!1),j=w(T,G,!0);if(S.length===0&&j.length===0)return null;for(let M=0;M<j.length;M++){const I=j[M];let $=ge.CommonUtils.findEqualOrGreater(S,I.from,H=>H.index),_=!1;for(;!_;){const H=S[$++];H&&H.index>=I.from&&H.index<=I.to+1&&H.from<=I.index&&H.to+1>=I.index&&(I.intersections.push({stroke:H.stroke,range:{rowStart:H.from,rowEnd:H.to+1,colStart:H.index,colEnd:H.index}}),H.intersections.push({stroke:I.stroke,range:{rowStart:I.index,rowEnd:I.index,colStart:I.from,colEnd:I.to+1}})),_=!H||H.index>I.to+1}}for(let M=0;M<j.length;M++){const I=j[M];let $=I.stroke;const _=`rBorder:${I.index}:${I.from}:${I.to}:${I.edge}`,H={rowStart:I.index,rowEnd:I.index,colStart:I.from,colEnd:I.to+1},B=u.getLayout(),K=!1,oe=B.getColOffset(H.colStart),N=B.getRowOffset(H.rowStart),z=[oe,N,B.getColOffset(H.colEnd),N];V.push(t({key:_,points:z,stroke:$,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:H,intersections:I.intersections,layout:B,isVertical:K}))}for(let M=0;M<S.length;M++){const I=S[M];let $=I.stroke;const _=`cBorder:${I.index}:${I.from}:${I.to}:${I.edge}`,H={rowStart:I.from,rowEnd:I.to+1,colStart:I.index,colEnd:I.index},B=u.getLayout(),K=!0,oe=B.getColOffset(H.colStart),N=[oe,B.getRowOffset(H.rowStart),oe,B.getRowOffset(H.rowEnd)];V.push(t({key:_,stroke:$,points:N,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:H,intersections:I.intersections,layout:B,isVertical:K}))}return c.jsx("svg",{width:`${R.width}`,height:`${R.height}`,viewBox:`0 0 ${R.width} ${R.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${R.width}px`,height:`${R.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:V},"borders")},[e,i])}},No=ge.AnchorLocation.Center,Il=Object.freeze({horizontal:!1,vertical:!1}),Lo=ge.TypesUtils.EmptyTopLeft,Tl=(e,t)=>ge.CoordUtils.EmptyCell,El=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Fl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:b,children:u,...R}=e,h=o.useRef(null),[C,{width:k,height:q}]=Ot(),E=n??k,D=i??q,G=o.useMemo(()=>{const K=[];for(let oe=0;oe<l;oe++)for(let N=0;N<d;N++){const z={colIndex:N,rowIndex:oe};K.push({coords:z,value:z})}return K},[]),U=o.useCallback(K=>G,[G]),{overlay:T}=yo({getVisibleCells:U,getBorderAt:t,darkMode:m,forceThinBorder:b}),V=Math.floor(E/d),y=Math.floor(D/l),w={getColOffset:K=>Math.ceil(K*V)+0,getRowOffset:K=>Math.ceil(K*y)+0,getColIndex:K=>Math.floor((K-0)/V)-1,getRowIndex:K=>Math.floor((K-0)/y)-1},S={rowStart:0,colStart:0,rowEnd:l,colEnd:d},j={x:0,y:0,width:Math.max(0,E)+0,height:Math.max(0,D)+0},M=o.useMemo(()=>{const K={},oe=Math.floor(E/d);for(let N=0;N<d;N++)K[N]={offset:N*oe,size:oe,spanIndex:N};return K},[E,D]),I=o.useMemo(()=>{const K={},oe=Math.floor(D/l);for(let N=0;N<l;N++)K[N]={offset:N*oe,size:oe,spanIndex:N};return K},[E,D]);if(!T)return null;const $={width:E,height:D},_={width:E,height:D},H={getStage:()=>h.current,getTotalSize:()=>$,getViewportSize:()=>_,getLayout:()=>w,getCellCoordsAsRangeCoords:ge.CoordUtils.cellToRange,getVisibleRangeCoords:()=>S,getVisibleRows:()=>{const K=[];for(let oe=0;oe<l;oe++)K.push(oe);return K},getTotalRangeCoords:()=>S,getRelativePointFromClient:(K,oe)=>({x:K,y:oe}),getVisibleColumns:()=>{const K=[];for(let oe=0;oe<d;oe++)K.push(oe);return K},toClipBounds:(K,oe)=>j,toViewBounds:K=>K,toAbsoluteBounds:K=>K,getBounds:()=>j,getInsets:()=>null,getRangeCoordsBounds:(K,oe)=>null,getVisibleColumnOffsets:()=>M,getVisibleRowOffsets:()=>I,allViews:()=>({[No]:H}),getAnchor:()=>No,getZoom:()=>1,scrollCellCoordsIntoView:El,getCellCoordsFromClient:Tl,getScrollOrientation:()=>Il,getScrollTopLeft:()=>Lo,getFreezeTopLeft:()=>Lo},B=T(H);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...R,children:[c.jsx("div",{ref:Xt([h,C]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:u}),B]})});function Rr(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=Rr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function yt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Rr(e))&&(i&&(i+=" "),i+=t);return i}const Al="_sheetxl-sheet_1qeq6_5",Dl="_viewport-overlay_1qeq6_6",kr=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"})]})},zl=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??{},[b,u]=o.useState(null);o.useEffect(()=>{(async()=>{const y=await s.LicenseManager.getDetails();u(y)})()},[]);const[R,h]=o.useState(!1),C={opacity:.65},k=o.useMemo(()=>{const y=b?.exceptions(),w=y?.length??0;if(w===0)return null;const S=[];for(let j=0;j<w;j++){const M=y[j];S.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:M},j))}return S},[b,n]);if(b===null||b.isValidFor(l))return null;const q=b.type(),E=!k&&q.endsWith("ity"),D=b.licensee(),G=E?1.6:1,U=135/G,T=37/G;let V=null;return!q&&D?.length>0&&(V=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),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:[R?c.jsx(kr,{style:C}):c.jsx("svg",{width:U,height:T,style:C,children:c.jsx("image",{style:{width:U,height:T},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),c.jsxs("div",{children:[V,k,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),et=(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 u=0;u<m;u++){const R=l[u];d[R]=(h,C)=>{i.current[R]?.(h,C)}}const b=e.addListeners(d,n);if(a)for(let u=0;u<m;u++)d[l[u]](e);return()=>{b?.()}},[e])},In=new s.Color("transparent");function Mr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:b}=e,[u,R]=o.useState(null),[h,C]=o.useState(null),k=o.useRef(null),q=r.useCallbackRef(m,[m]),E=r.useCallbackRef(b,[b]),[D,G]=o.useState(),[U,T]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[V,y]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const S=r.useGlobalClipboard(),[j,M]=o.useState(ge.CommonUtils.EmptyArray),I=o.useCallback(()=>{if(k.current!==t)return;const g=t.getSelectedRanges();let x=null;j.length>0&&ge.CoordUtils.isCellWithinRange(u,j[0].getRange().getCoords())&&(x=j[0]);const F=t?.getSelectedCell(),p=F?.getCoords()??null;Lt.unstable_batchedUpdates(()=>{ve(x),R(p),C(g)})},[t,j,h,u]),$=o.useCallback(ge.CommonUtils.debounce(I,210),[I]);o.useEffect(()=>{k.current=t,I()},[t]);const _=r.useCallbackRef(()=>t.getRange(u).getCell(),[t,u]),H=r.useCallbackRef(async(g,x,F=null,p=!1,L=!0)=>{const v=g?.label?.(),P=async()=>{const se=await Promise.resolve(L&&d?.showBusy?.(v??"Busy..."));try{await t.doBatch(async()=>x(t),v),p&&w.setMode(null),se&&se()}catch(ce){if(se&&se(),!ce)return;d?.showError?.(ce)}},Z=[];let ee=!1;const ie=async()=>(Z.push(P),(async()=>{if(!ee){for(ee=!0;Z.length>0;){const se=Z.shift();se&&await se()}ee=!1}})());if(n){let se=null;if(F!==!1&&g){const ce=F??v;se=new r.SimpleCommand(g.key(),l,{label:ce,description:ce},ie)}n(se)}return ie()},[t,n,d]),B=r.useCallbackRef((g,x,F=!1,p)=>H(g,L=>{const v=L.getSelectedRanges();F&&v.updateStyle(null,p),v.updateStyle(x,p),v.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),K=r.useCallbackRef((g,x,F)=>{H(g,p=>{let L=x;(F||x?.address)&&(L=L??{},!F&&x?.address?.startsWith("#")?F=x?.address.substring(1):F&&(L.displayText=F)),p.getSelectedRange().setHyperlink(L)})},[t]),oe=r.useCallbackRef((g,x)=>{H(g,F=>{F.getSelectedRange().setComments(x)})},[t]),N=r.useCallbackRef((g,x)=>{H(g,F=>{F.getSelectedRanges().clear(x)})},[t]),z=r.useCallbackRef(async(g,x,F=!1,p=!1)=>H(g,async L=>{let v=L.getSelectedRanges();F&&(x===s.IRange.Orientation.Row?v=v.getEntireRows(p):x===s.IRange.Orientation.Column&&(v=v.getEntireColumns(p)));let P=null;const Z=w.getMode()?.key;if(Z==="copy"||Z==="cut"){const ee=await S.getClipboard().readReference();ee&&ee.getItemType()==="range"&&(P=ee.getItem(),P.getCoords()||(P=null))}if(P){const ee=await v.insertFrom(P,{...P.getMarkOptions(),orientation:x,autoSelect:!0});!ee||ee.isEntireRows()||ee.isEntireColumns()||ee.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else v.insert(x,{autoSelect:!0})},"Insert Cells",!1),[w]),[ae,ve]=o.useState(null),Ve=r.useCallbackRef(g=>t.getStyles().setDefaultTableStyle(g),[t]),qe=r.useCallbackRef(g=>{t.getStyles().getTableStyle(g)?.delete()},[t]),ue=r.useCallbackRef((g,x)=>{H(g,async F=>{const p=F.getSelectedRange(),L=F.getSelectedCell().getCoords();let v=null,P=0;const Z=L.rowIndex>0?F.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex}).getExtended(s.IRange.Direction.Up):null;Z&&F.getRange({colStart:L.colIndex,rowStart:Z.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowStart}).isContentful()&&(v=s.IRange.Direction.Up,P=L.rowIndex-Z.getCoords().rowEnd);const ee=L.colIndex>0?F.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(ee&&F.getRange({colStart:ee.getCoords().colStart,rowStart:L.rowIndex,colEnd:ee.getCoords().colStart,rowEnd:L.rowIndex}).isContentful()){const se=L.colIndex-ee.getCoords().colEnd;(se<P||!v)&&(v=s.IRange.Direction.Left,P=se)}let ie=null;if(v===s.IRange.Direction.Up){if(ie={...Z.getCoords()},(ie.rowEnd===L.rowIndex||!F.getRange({colIndex:L.colIndex,rowIndex:L.rowIndex-1}).isContentful())&&ie.rowStart>0&&F.getRange({colIndex:L.colIndex,rowIndex:ie.rowStart-1}).isContentful()){const se=Z.getExtended(s.IRange.Direction.Up);ie={colStart:L.colIndex,rowStart:se.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowEnd}}ie.rowEnd=L.rowIndex-1}else if(v===s.IRange.Direction.Left){if(ie={...ee.getCoords()},(ie.colEnd===L.colIndex||!F.getRange({colIndex:L.colIndex-1,rowIndex:L.rowIndex}).isContentful())&&ie.colStart>0&&F.getRange({colIndex:ie.colStart-1,rowIndex:L.rowIndex}).isContentful()){const se=ee.getExtended(s.IRange.Direction.Left);ie={colStart:se.getCoords().colStart,rowStart:L.rowIndex,colEnd:se.getCoords().colEnd,rowEnd:L.rowIndex}}ie.colEnd=L.colIndex-1}if(p.size!==1&&v){const se=p.getCoords(),ce=p.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),we={...ie},fe=se.rowStart,pe=se.rowEnd,xe=se.colStart,Oe=se.colEnd,Ne=v===s.IRange.Direction.Up;for(let We=xe;We<=Oe;We++){we.colStart=Ne?We:ie.colStart+(We-xe),we.colEnd=Ne?We:ie.colEnd+(We-xe);for(let je=fe;je<=pe;je++){we.rowStart=Ne?ie.rowStart+(je-fe):je,we.rowEnd=Ne?ie.rowEnd+(je-fe):je;const _e=F.getRange(we).toString();ce.pushAt(je,We,`=${x}(${_e})`)}}ce.apply()}else{const se=ie?F.getRange(ie).toString():"",ce=`=${x}(`;q?.({text:`${ce}${se})`,editMode:!0,initialSelection:{start:ce.length,end:ce.length+se.length}})}},!1)},[t]),ke=r.useCallbackRef((g,x,F=!1,p=!0)=>{H(g,async L=>{let v=null;if(ae)return void ae.updateStyleOptions(x);{const ee=L.getSelectedRanges().getFixed(!0),ie=L.getSelectedRange().getDefaultSortCriteria();let se={ranges:ee,hasHeader:ie?.options?.hasHeader??!1};v=p?new Promise((ce,we)=>{const fe={tableOptions:se,onCancel:()=>{we()},onDone:pe=>{ce(pe)},context:{getNames:()=>L.getNames()}};d.showWindow?.("tableNew",fe)}):{option:"Ok",tableOptions:se}}const P=await Promise.resolve(v);if(P?.option!=="Ok")throw null;const Z=await Promise.resolve(d?.showBusy?.(g.label()));try{await L.getTables().add(P.tableOptions.ranges.at(0),{styleName:x?.name,clearFormatting:F,hasHeader:P.tableOptions.hasHeader}).getRange().select()}catch(ee){Z(),d?.showError?.(ee)}Z()},!1,!0,!1)},[ae]),Ke=r.useCallbackRef(()=>i,[i]),Ue=r.useCallbackRef(g=>({styles:()=>t.getStyles(),table:()=>g,bodyStyle:Ke,getNames:()=>t.getNames()}),[t]),Te=r.useCallbackRef(async(g,x,F,p=!0)=>{let L=null;if(!x){let v=t.getSelectedRange();v.size===1&&(v=v.getSurrounding());let P=t.getTables().getItems({address:t.getSelectedRange()});P.length>0&&(x=P[0]),await v.select()}if(x){if(p){try{F&&await x.select()}catch{}L=new Promise(async(v,P)=>{g.update({context:Ue(x)});const Z={command:g,commands:f,notifier:d,onDone:ie=>{v(ie)}},ee=await d.showWindow?.("tableDetails",Z,{disableAutoDestroy:!0});setTimeout(()=>{ee.focus()},180)})}Promise.resolve(L).then(v=>{},v=>{d?.showError?.(v)})}},[d]),he=r.useCallbackRef(async(g,x,F=!1)=>{let p=null;if(x)x.isITable?p=x:x.getValue()&&(p=x.getValue());else{const L=t.getTables().getItems({address:t.getSelectedRange()});L.length>0&&(p=L[0])}if(p){if(!F){const L=p.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}H(g,async()=>{F?p.delete():p.convertToRange()},!1,!0)}},[d]),W=r.useCallbackRef((g,x,F)=>{H(g,async p=>{let L=p.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 P=p.getSelection().getCoords().cell;let Z=v.getDefaultSortCriteria(s.IRange.Orientation.Row,P);if(!Z){if(F)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ee=Z.options;if(F&&(ee=new Promise((se,ce)=>{const we={range:v,options:Z.options,cell:P,onCancel:()=>{ce()},onDone:fe=>{fe?se(fe.options):ce()}};d.showWindow?.("sort",we)})),ee=await Promise.resolve(ee),!ee)return;const ie=await Promise.resolve(d?.showBusy?.(g.label()));try{v.doBatch(()=>{const se={...ee,...x};v.sort(se),v.autoFit({orientations:se?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},g?.label?.())}catch(se){ie(),d?.showError?.(se)}ie()},!1,!1,!1)},[d]),Fe=r.useCallbackRef(()=>{console.log("compactedSelection");const g=t.getSelection().getCoords(),x=t.getSelectedRanges().getFlattened().getCoords(),F=(v=>{const P=new Blob([v],{type:"application/javascript"}),Z=URL.createObjectURL(P),ee=new Worker(Z);return URL.revokeObjectURL(Z),ee})("console.log('hello from worker');");setTimeout(()=>{F.terminate(),console.log("Worker terminated")},5e3);let p=-1;for(let v=0;p===-1&&v<x.length;v++)ge.CoordUtils.isCellWithinRange(g.cell,x[v])&&(p=v);if(ge.CoordUtils.isEqualRangesArrays(g.ranges,x))return;const L={cell:g.cell,ranges:x,rangeIndex:p};t.getSelection().updateCoords(L)},[t]),Ce=r.useCallbackRef(()=>{console.log("selectComments")},[t]),Y=r.useCallbackRef(async(g=!1,x=!1)=>{let F=null;if(x)F=t.getEntireRange();else{const p=t.getSelectedRange();if(p.isEntireRange()){const L=t.getSelection().getCoords().cell,v=t.getRange(L);F=v.getSurrounding(),F.isEntireRange()&&(F=v)}else F=p.getSurrounding({contentOnly:g})}F&&await F.select()},[t]),J=r.useCallbackRef((g,x,F)=>{H(g,async p=>{let L=p.getSelectedRanges();F&&(x===s.IRange.Orientation.Row?L=L.getEntireRows():x===s.IRange.Orientation.Column&&(L=L.getEntireColumns())),L.delete(x)},"Delete Cells")},[t]);r.useCallbackRef(async g=>{let x=null;const F=E(),p=Math.min(F.width-8,480),L=Math.min(F.height-8,288);try{t.getSelectedRanges(),x=await t.getMovables().add({bounds:{x:F.left+(F.width-p)/2,y:F.top+(F.height-L)/2,width:p,height:L},type:"chart",json:g.template}),x.select(),w.setMode(null)}catch(v){d?.showError?.(v)}return x},[t,d]);const ne=r.useCallbackRef(async(g,x,F)=>{const p=await d?.showBusy?.(g.label());try{const L=await t.getMovables().addImage(x,{autoSelect:!0,...F});return p(),w.setMode(null),L}catch(L){p();let v=L;typeof v!="string"&&(console.warn(L),v="Unable to resolve image."),d?.showMessage?.(v,{type:r.NotificationType.Error})}},[t,d]),le=r.useCallbackRef((g,x)=>{H(g,async F=>{const p=F.getSelectedRanges();p.doBatch(()=>{const L=x===s.IRange.Direction.Up||x===s.IRange.Direction.Down,v=p.getCoords().slice().sort(ge.CoordUtils.createRangeComparator(L?s.IRange.Orientation.Row:s.IRange.Orientation.Column));for(let P=0;P<v.length;P++){const Z=v[P];let ee=Z;const ie=F.getRange(ee).getMerges();let se=0,ce=0;if(ie.length>0){const we=ie[0];se=we.rowEnd-we.rowStart,ce=we.colEnd-we.colStart}x===s.IRange.Direction.Left?ee={...Z,colStart:Z.colEnd+ce}:x===s.IRange.Direction.Right?ee={...Z,colEnd:Z.colStart+ce}:x===s.IRange.Direction.Up?ee={...Z,rowStart:Z.rowEnd+se}:x===s.IRange.Direction.Down&&(ee={...Z,rowEnd:Z.rowStart+se}),F.getRange(ee).autoFill(Z,{filler:s.AutoFill.Types.Copy}),F.getRange(Z).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:g.label()})})},[d]),me=r.useCallbackRef(()=>{let g=null;const x=t.getSelectedCell().getCoords();if(x?.rowIndex>0){const F=t.getRange({rowIndex:x.rowIndex-1,colIndex:x.colIndex}).getCell();F&&(g=F.toTextUnformatted(!0))}q?.({text:g})},[t]),[Se,de]=o.useReducer(g=>g+1,0),[be,Me]=o.useReducer(g=>g+1,0),Ee=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]}},()=>Ce()),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]}]},(g=!1)=>Y(!1,g)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Y(!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]}},()=>Fe()),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(){W(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){W(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(){W(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
- 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(g){B(this,{named:g.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(g){ke(this,g)}),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(g){ke(this,g,!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(){ke(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."},Ve),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},qe),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(g){B(this,{border:g})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(g){B(this,{fill:g})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(g){B(this,{font:{fill:g}})}),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(){B(this,g=>({font:{size:go(g.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(){B(this,g=>({font:{size:go(g.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(g){B(this,{font:{family:g}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(g){B(this,{font:{size:g}})}),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(g,x){const F=this,p={initialValue:g??x.state(),context:x.context(),onInputOption:(L,v)=>{B(F,{numberFormat:L})}};d.showWindow?.("numberFormat",p)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(g){B(this,{numberFormat:g})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(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(){B(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(){B(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(){B(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(g){B(this,{numberFormat:g??'_($* #,##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(){B(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(){B(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(){B(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(){B(this,g=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(g.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){B(this,g=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(g.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.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(g){g&&ue(this,g.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ue(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ue(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ue(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ue(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ue(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(){q?.({text:t.createTemporaryCell({value:fn(),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(){q?.({text:t.createTemporaryCell({value:fn(),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("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:()=>_,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(g,x){const F=this,p={context:x.context(),onUpdateHyperlink:(L,v)=>{K(F,L,v)}};d.showWindow?.("hyperlink",p)}),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:()=>_},async(g,x)=>{const F=x.context()();if(!F)return;const p=F.getHyperlink();if(p)try{await p.open()}catch(L){d?.showError?.(L)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>_},function(g,x){K(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."},(g,x)=>{((F,p)=>{F?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[p," 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/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(d,x.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:()=>_},async function(g,x){const F=this,p={context:x.context(),onUpdateComments:L=>{oe(F,L)}};d.showWindow?.("comments",p)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>_},function(g,x){oe(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(g=null){let x=null,F=null;typeof g=="string"?F=g:x=g?.file?g.file:g,(x||(x=await ge.CommonUtils.openFileDialog(F??"image/*"),x))&&await ne(this,{file:x},g?.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(g){if(!g){const x=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(x.option!=="Insert")return;g=x.input}g&&ne(this,{fetch:g})}),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(){ke(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(g){let x=null,F=!1;g.isITable?x=g:g.getValue()&&(x=g.getValue(),F=!0),Te(this,x,F)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
7
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),ge=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Lt=require("react-dom"),fn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),wl=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:fn},Symbol.toStringTag,{value:"Module"})),Cr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),go=(e,t=!0,n=Cr)=>{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=ge.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},xl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Cr,findNextFontSize:go},Symbol.toStringTag,{value:"Module"})),ho=o.memo(e=>{const{anchorLocation:t=ge.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:b,style:u,...R}=e,h=a,C=l;let k="red",q=[],E=[];return t===ge.AnchorLocation.TopLeft?(k=d?"rgb(255, 198, 246)":"green",q.push(C),E.push(C),q.push(C+h),E.push(C),q.push(C),E.push(C+h)):t===ge.AnchorLocation.TopRight?(k=d?"rgb(0, 255, 255)":"red",q.push(n-C),E.push(C),q.push(n-(C+h)),E.push(C),q.push(n-C),E.push(C+h)):t===ge.AnchorLocation.BottomRight?(k=d?"rgb(236, 252, 211)":"purple",q.push(n-C),E.push(i-C),q.push(n-(C+h)),E.push(i-C),q.push(n-C),E.push(i-(C+h))):t===ge.AnchorLocation.BottomLeft&&(k=d?"rgb(255, 236, 183)":"blue",q.push(C),E.push(i-C),q.push(C+h),E.push(i-C),q.push(C),E.push(i-(C+h))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...u},...R,children:c.jsx("path",{d:`M ${q[0]} ${E[0]} L ${q[1]} ${E[1]} L ${q[2]} ${E[2]} L ${q[0]} ${E[0]} Z`,fill:m??k,...b})})}),br=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...b}=e,u=o.useMemo(()=>{let k=null;const q=l.getSortField();q&&(k=q.reverse);const E=l.getField(),D=E&&E.criteria&&E.criteria.length>0;return k===!0?D?"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":k===!1?D?"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":D?"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 7.4533523,10.606423 2.2001838,4.9460198 2.966932,4.1188401 7.4533523,8.9589099 11.933438,4.1188401 12.700184,4.9460198"},[l]),[R,h]=o.useState(!1),C=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${C}px`,height:`${C}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${R&&!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:(C>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:k=>{d?.(k,l),k.preventDefault()},...b,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${R&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:u})})})},yr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:b,bodyStyle:u,normalStyle:R,showFormulas:h,showZeros:C,docTheme:k,onLinkMouseDown:q,onFilterButtonMouseDown:E,filterButtonProps:D,createFilterButton:G=br,...U}=e,T=i.height/m,V=i.width/m,y=t,w=y.getValue(),S=t.getStyle(),j=u?.darkMode??!1;let M,I;const $=w&&w.isFormulaError,_=$&&w instanceof s.FormulaError.Parse;let H,B=h||_;if(B)if(y.isSpillOverflow())I="";else{const Ae=y.getFormulaText();Ae?I=Ae:M=y.getNumberFormat(s.NumberFormat.Type.General)}else M=y.getNumberFormat();B||(H=y.getTextOverflow());const K=H?H.colBounds.width+H.leftOffset+H.rightOffset:V,ne=H?H.anchorBounds.x-H.leftOffset:0,N=H?H.anchorBounds.width:V,z=H?H.anchorBounds.x:0;let se,ve=y.getRenderHorizontalAlignment();M&&(se=M?.formattedRuns,I=se?.runs[0]?.text??M.displayText);const Ve=y.getCalcStatus()===s.ICell.CalcStatus.Pending;let Se=null,ue=S.getFill().toCSS(j,i),Me=0,Ke=0;if(!S.getBorder().isEmpty()){const Ae=S.getBorder().getRight();!Ae.isNone()&&s.IBorder.BuiltInDefinitions.get(Ae.getStyle()).width>1&&(Me=1);const A=S.getBorder().getBottom();!A.isNone()&&s.IBorder.BuiltInDefinitions.get(A.getStyle()).width>1&&(Ke=1)}let Ue=null;if(V!==N||Me||Ke||typeof ue?.backgroundPosition=="number"){const{backgroundPosition:Ae,...A}=ue,Q=Ae??0,O=b?.getScrollTopLeft(),X=Q?-(i.x+(O.left??0))%Q:0,g=Q?-(i.y+(O.top??0))%Q:0;(Ae!==void 0||Me||Ke||V!==N)&&(Object.keys(A).length===1&&A.background==="none"||(ue=null,Ue=c.jsx("div",{className:"fill",style:{marginLeft:`${X}px`,marginTop:`${g}px`,left:z*m,width:r.ReactUtils.boundPixel(N*m-X+1+Me),height:r.ReactUtils.boundPixel(i.height-g+1+Ke),...A}},"background")))}let Te=null;const he=y.getComments(),W=y.getWarnings(),Fe=y.getErrors();if(he||$||Fe.length>0||W.length>0){const Ae={size:7*m,darkMode:j,cellWidth:N*m+2,cellHeight:T*m+2,style:{top:-1,left:z*m-1}};Te=Te??[],(W.length>0||Fe.length>0||$)&&Te.push(c.jsx(ho,{anchorLocation:ge.AnchorLocation.TopLeft,...Ae},`indicator-${Te.length}`)),he&&Te.push(c.jsx(ho,{anchorLocation:ge.AnchorLocation.TopRight,...Ae},`indicator-${Te.length}`))}const Ce=S.getFont();let Y=M?.conditionalColor;const J=S.getAlignment(),re=J.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,le=J.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||re,me=le||B?0:J.getRotation(),ye=y.getInsets(),ae=ye.top+ye.bottom;let be=ye.left,Re=ye.right;const Ee={...l,left:l.left-1,top:l.top-1,width:l.width+1+Me,height:l.height+1+Ke},f=y.getColumnFilter(),De=f&&!f?.hasHiddenButton();let Ye=null;Ve&&(Ye=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const He=!(Ve||De||Ue||a||Te||se?.runs.length>1||H||me%360!=0);ue?.background==="none"&&(ue=null);let $e=le||!(!H||!(H.rightIndex>0||H.leftIndex>0||H.colSpan>1));if(!$e){const Ae=y.getSpans();(Ae.width>1||Ae.height>1)&&($e=!0)}const oe={...ue,...Ee,pointerEvents:q?"auto":void 0};if(!ge.CommonUtils.isEmpty(I)||!ge.CommonUtils.isEmpty(M?.repeatPlaceholder)){const Ae=M?.canWrap??!1;let A=null,Q=null,O=null,X=[],g=!0;C||B||w!==0||(g=!1);const x=y.getTextFrame(B);if(g&&x){let F=K-1-(be+Re);if(me){A=x.layout().bounds;const xe={x:0,y:0,width:K-1,height:T};if(se){let fe=se.width;if(M.repeatPlaceholder||M.repeatChars.length>0){const pe=s.GeomUtils.boundsToPoints(xe),qe=s.GeomUtils.rotatePoints(pe,-me);fe=s.GeomUtils.minBoundingRect(qe).width}A={...A,width:fe}}O=s.GeomUtils.clipToOuterRect({...A,width:A.width+1+be+Re},xe,me),F=O.width-1-(be+Re)+.01}let p=null;Ae&&(p={width:F});let L=null,v=M?.repeatPlaceholder;const P=x.layout(p);if(A=P.bounds,B?A={...A,width:0}:se&&(A={...A,width:M.repeatPlaceholder||M.repeatChars.length>0?F:se.width}),me&&Ae){let ce=null;P.visitLines({visitTextLine:(xe,fe)=>{let pe=xe.bounds;const qe=s.GeomUtils.boundsToPoints(pe),Oe=s.GeomUtils.rotatePoints(qe,me),Ne=s.GeomUtils.minBoundingRect(Oe);pe={...pe,x:(Ne.width-pe.width)/2,y:(Ne.height-pe.height)/2},ce=ce?s.GeomUtils.unionBounds(ce,pe):pe}}),A={...ce,width:ce.width+be+Re}}if(!v&&y.getType()!==s.ScalarType.String&&Math.floor(A.width)>F){if(S.getNumberFormat()==="General"&&y.getType()===s.ScalarType.Number){const ce=S.measureText("0"),xe=Math.floor(F/ce.width),fe=w,pe=ge.CommonUtils.splitNumber(fe),qe=Math.min(10,xe-(Math.max(1,pe.ipLength)+1)-(fe<0?1:0));if(qe>=-1){const Oe=`0${qe>0?".":""}${"#".repeat(Math.max(0,qe))}`;L=y.getNumberFormat(Oe).displayText,L==="0"&&fe<0&&(L="-0")}else if(Math.abs(fe)>=Math.pow(10,5)||Math.abs(fe)<=Math.pow(10,-5)){const Oe=xe-5-(fe<0?1:0);if(Oe>=0){const Ne=`0.${"0".repeat(Math.max(0,Oe-1))}E+00`;L=y.getNumberFormat(Ne).displayText}}}L||(v="#")}if(!v&&se?.lastRepeatIndex>=0&&se?.width>F&&(v="#"),v&&F>0){const ce=S.measureText(v),xe=Math.floor((F||1)/(ce?.width||1));L=xe>0?v.repeat(xe):"",ve=s.ITextFrame.HorizontalAlignment.Center}if(B&&(ve=s.ITextFrame.HorizontalAlignment.Left),L){const ce=S.measureText(L).width;ce&&(A={...A,width:ce})}if(Q={...A,width:A.width+be+Re,height:A.height},me&&!Ae){const ce=s.GeomUtils.boundsToPoints(Q),xe=s.GeomUtils.rotatePoints(ce,me),fe=s.GeomUtils.minBoundingRect(xe);Q.width=fe.width,Q.height=fe.height}ve===s.ITextFrame.HorizontalAlignment.Center||ve===s.ITextFrame.HorizontalAlignment.CenterContinuous?Q.x=(K-Q.width)/2:ve===s.ITextFrame.HorizontalAlignment.Right?Q.x=K-Q.width-.5:Q.x=.5,J.getVertical()===s.ITextFrame.VerticalAlignment.Center?Q.y=(T-Q.height)/2:J.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?Q.y=T-Q.height-ae:Q.y=ae;const Z=He?{...U}:void 0,ee={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:me?`rotate(${me}deg)`:void 0,cursor:q?"pointer":void 0,pointerEvents:q?"auto":void 0,zIndex:$e?1:void 0,...ue},onMouseDown:q,onDoubleClick:q?ce=>{ce.stopPropagation(),ce.preventDefault()}:null,...Z};_&&(ee.style.textDecorationStyle="wavy",ee.style.textDecorationColor=j?"rgb(0, 255, 255)":"red",ee.style.textDecorationLine="underline");const ie=Ce.getSize(),de=(ce,xe,fe,pe,qe,Oe,Ne,We=null)=>{let je=ie*m,_e=fe,Le=Ne?.runs?Ne.runs:[{type:s.NumberFormat.ParseRunType.Text,text:ce,width:S.measureText(ce,je).width}];Ne&&Ne?.width!==A.width&&(A={...A,width:Ne?.width});let Je=be;if(Ne?.lastRepeatIndex>=0&&F>Ne?.width){const Ze=Ne.runs[Ne.lastRepeatIndex];if(Ze){const lt=[...Le],pt=Math.max(0,F-1-Ne.width);let wt=0,vt="";if(pt>0){const gt=Math.floor(pt/Ze.width);vt=gt>0?Ze.text.repeat(gt):"",wt=pt}lt[Ne.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:vt,width:wt},Le=lt,A={...A,width:Ne.width+wt}}}const at=(Ze,lt,pt,wt,vt,gt,it,Et,Bt,Qt=null)=>{let Dt,en=_e.width;qe===s.ITextFrame.HorizontalAlignment.Justify?(en=vt,Oe||(Dt="justify")):qe===s.ITextFrame.HorizontalAlignment.Distributed&&(en=vt,Dt=Oe||Ze.text.split(" ").length-1==0?"center":"justify");const{style:Tt,className:xn,...Ct}=Qt;let Vt=Ze.text;if(qe===s.ITextFrame.HorizontalAlignment.Fill&&M?.repeatChars.length===0){const st=Math.max(1,Math.floor((_e?.width??0)/(it?.width??1)));Vt=Vt.repeat(st)}let tn=_e.height;const Mt=Ce.getVerticalAlignment(),zt=Mt===s.IFont.VerticalAlignment.Sub,qn=Mt===s.IFont.VerticalAlignment.Super;if(zt||qn){const st=Ce.getSuperSubScale();je*=st,tn*=st}const tt={textAlign:Dt,textAlignLast:Dt,...Tt,...Ce.toCSS(j,m,!0),fontSize:je*s.IFont.getDeviceScale()};He||(tt.background=void 0),Y&&(tt.color=Y.toCSS(j));const Sn=Je+lt;let Pt=ye.top+_e.y+0;if(zt&&(Pt+=Bt-je),gt){const st=(it.x+Sn)*m+1,ht=(it.y+Pt)*m+1;ht<0?tt.marginTop=ht:tt.paddingTop=ht,st<0?(tt.width=(Tt?.width??0)-st,tt.left=(Tt?.left??0)+st):tt.paddingLeft=st,tt.paddingRight=Math.max(0,(Tt?.width??0)-en*m-st),tt.paddingBottom=Math.max(0,(Tt?.height??0)-_e.height*m-ht),tt.height=(Tt?.height??0)+(ht<0?-ht:0),(ht<0||st<0)&&(tt.clipPath=`inset(${ht<0?-ht:0}px 0px 0px ${st<0?1-st:0}px)`)}else if(tt.left=(it.x+Sn)*m+1,tt.top=(it.y+Pt)*m+1,tt.width=it.width*m,tt.height=it.height*m,me&&!Ae){tt.left=(it.x+lt)*m+1,tt.top=(it.y+(_e.y+0))*m+1;const st=s.GeomUtils.centerPoint({x:Je+lt,y:0,width:Ze.width,height:_e.height}),ht=s.GeomUtils.centerPoint({x:Je,y:0,width:vt,height:_e.height}),on=s.GeomUtils.rotatePoints([st],me,ht),rn={x:on[0].x-st.x,y:on[0].y-st.y};tt.left=tt.left+rn.x*m,tt.top=tt.top+rn.y*m;const Ht={..._e,x:Je,y:ye.top,width:_e.width+(be+Re)},Wn=s.GeomUtils.boundsToPoints(Ht),Gn=s.GeomUtils.rotatePoints(Wn,me),Ut=s.GeomUtils.minBoundingRect(Gn);Ht.width=Ut.width,Ht.height=Ut.height;const Rn=s.GeomUtils.centerPoint(Ht),Kt={x:Rn.x-ht.x,y:Rn.y-ht.y};tt.left=tt.left+Kt.x*m,tt.top=tt.top+Kt.y*m}tt.lineHeight=tn*m+"px";const nn=He?void 0:"text-line";X.push(c.jsx("div",{className:xn?`${xn} ${nn}`:nn,style:tt,...Ct,children:Vt},`text-${_e.y}-${wt}-${pt}`))};if(J.getOverflow()===s.ITextFrame.Overflow.Shrink&&F>0){let Ze=A?.width??0,lt=0;for(;Ze>1&&Ze>F&&je>2&&lt<100;)je*=F/Ze,Ze=S.measureText(ce,je).width,lt++;A={...A,width:Ze}}let ft=_e.x;qe===s.ITextFrame.HorizontalAlignment.Right?ft+=A.width-_e.width:qe!==s.ITextFrame.HorizontalAlignment.Center&&qe!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(ft+=(A.width-_e.width)/2),Ne?.lastRepeatIndex>=0&&(ft=_e.x);const xt=Le.length;for(let Ze=0;Ze<xt;Ze++){const lt=Le[Ze];(lt.type===s.NumberFormat.ParseRunType.Text||lt.type===s.NumberFormat.ParseRunType.Repeat)&&(lt.type,s.NumberFormat.ParseRunType.Repeat,at(lt,ft,Ze,xe,qe===s.ITextFrame.HorizontalAlignment.Justify||qe===s.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?F:_e.width,He,{x:Q.x+ne,y:Q.y,width:lt.width,height:A.height},0,pe,We)),ft+=lt.width}};L?de(L,0,{x:0,y:0,...A},P.lines[0].baseline,ve,!0,null,ee):P.visitLines({visitTextLine:(ce,xe,fe)=>{const pe=ce.runs[0].text.replace(/\s+$/,""),qe=xe===fe-1;let Oe=ve===s.ITextFrame.HorizontalAlignment.Justify&&(qe||ce.runs[0].text.endsWith(`
8
+ `))?s.ITextFrame.HorizontalAlignment.Left:ve,Ne=0;xe>0&&(J.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||J.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(T-(ae+3)-ce.bounds.height*fe)/(fe-1)*xe)),J.getVertical()===s.ITextFrame.VerticalAlignment.Distributed&&me&&me%90==0&&me%180!=0&&(Oe=s.ITextFrame.HorizontalAlignment.Distributed),Oe!==s.ITextFrame.HorizontalAlignment.Justify&&Oe!==s.ITextFrame.HorizontalAlignment.Distributed&&Oe!==s.ITextFrame.HorizontalAlignment.Fill||(A={...A,width:F});let We=re||M&&(M.repeatChars.length>0||M.spacingChars.length>0)?A.width:ce.bounds.width;const je={...ce.bounds,y:ce.bounds.y+Ne+0,width:We};de(pe,xe,je,x.lines[0].baseline,Oe,qe,fe===1?se:null,He&&xe>0?{...ee,style:{...ee.style,background:void 0}}:ee)}})}X.length>0&&(Se=X)}if(He)return Se&&Se.length>0?Se:c.jsx("div",{style:oe,...U});let ke=q?"auto":Ee.pointerEvents,ze=null;if(De){const Ae={x:z*m-1,y:-1,width:N*m+1,height:T*m+1};ke="auto",ze=G({renderBounds:Ae,darkMode:j,className:"filter-button",disabled:!y.isEditAllowed(),zoom:m,filter:y.getColumnFilter(),onFilterButtonMouseDown:E,...D}),ze&&(ze=c.jsx("div",{style:{...Ae,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:A=>{A.stopPropagation(),A.preventDefault()},children:ze},"filterButton"))}Ve&&!Se&&(Se=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 we=[Ue,Se,a,Te,Ye,ze];return c.jsx("div",{style:{...ue,...Ee,pointerEvents:ke},...U,children:we})},Ao={text:"",placeholder:""},Do=(e,t)=>{if(e.clean().getStyle().getNumberFormat().indexOf("%")===-1)return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},ql=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),wr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:d,onDoneEdit:m,defaultTextStyle:b,useRichStyling:u=!0,bodyStyle:R,activeCoords:h,sheet:C,commands:k,containerBounds:q,setNaturalDimensions:E,onFocus:D,disabled:G,style:U,zoom:T=1,linesVisible:V,autoFocus:y=!1,...w}=e,{height:S=0,width:j=0}=q??{},M=R?.darkMode??!1,I=o.useRef(null),[$,_]=o.useState(!1),[H,B]=o.useState(null),[K,ne]=o.useState(()=>n);o.useEffect(()=>{Ke.current=!1,ne(n)},[n]);const N=o.useMemo(()=>{const A=K.clean();let Q=A.getStyle();u||(Q=Q.createTemporaryStyle({font:{size:b?.fontSize}}));const O=A.getFormula(),X=Q.getAlignment(),g=O?s.ITextFrame.HorizontalAlignment.Left:X.getHorizontal(),x=X.getVertical(),F=X.getOverflow()===s.ITextFrame.Overflow.Wrap||A.getType()===s.ScalarType.String&&(g===s.ITextFrame.HorizontalAlignment.Justify||g===s.ITextFrame.HorizontalAlignment.Distributed||x===s.ITextFrame.VerticalAlignment.Justify||x===s.ITextFrame.VerticalAlignment.Distributed),p=(P=>{if(!P)return Ao;const Z=P.clean();if(!Z)return Ao;let ee=Z.getStyle()?.getQuotePrefix();if(P.dirty===void 0||P.dirty===null){let ie="",de=Z.getFormulaText();de&&(ie=de,ee=!1),ie||(ie=Z.toTextUnformatted(!0)??"");let ce="";if(!P.editMode&&Z.isSpillOverflow()){const xe=Z.getSpill();if(xe){const fe=xe.getCell(),pe=fe.getFormulaText();fe.isEqual(Z)||(ce=pe)}}return ee&&(ie="'"+ie),{text:ie,placeholder:ce}}return{text:P.dirty??"",placeholder:""}})(K),L=p.text,v=s.ITextFrame.toCSSHorizontalTextAlign(u&&!O?K.clean()?.getRenderHorizontalAlignment():s.ITextFrame.HorizontalAlignment.Left);return{style:Q,isWrapped:F,textValue:L,formula:O,frameVertAlign:x,placeholder:p.placeholder,insets:u?A.getInsets():ge.TypesUtils.EmptyRect,textAlign:v}},[K,b,M,T,u]),z=o.useRef(null),se=r.useImperativeElement(t,()=>({startEdit:A=>{I.current=A?.initialSelection;const Q={...n,editMode:A?.editMode??!1};A?.text!==void 0&&(Q.dirty=A.text),Q.editMode===n.editMode&&Q.dirty===n.dirty||(ne(Q),Se?.(Q))},submitEdit:()=>Ue(),cancelEdit(){Te()},autoFocus(){z.current.focus()},dispatchEvent:A=>z.current.dispatchEvent(A),focus(){z.current.focus()},getLineHeight:Ve}),[i,n]);o.useLayoutEffect(()=>{if(!H||!$)return;const A=z.current;N.textValue,A&&A.setSelectionRange(H.start,H.end,H.direction)},[z.current,H,N.textValue]);const ve=o.useMemo(()=>{const A=K?.clean(),Q=N.style.createTemporaryTextFrame(N.textValue,A?.getType()===s.ScalarType.String),O=u?A.getInsets().right+A.getInsets().left:0;let X=null;return N.isWrapped&&(X={width:j-O}),Q.layout(X)},[N,j,K,u]),Ve=r.useCallbackRef(()=>Math.ceil(ve?.lines[0]?.bounds.height),[ve]);o.useLayoutEffect(()=>{if(!ve)return;const A=N.style,Q=A.getInsets()??ge.TypesUtils.EmptyRect,O=u?Q.left+Q.right:0,X=u?.04*A.getFont().getSize():1,g=Math.round(N.isWrapped?void 0:ve.bounds.width+O+X),x=Math.round(ve.bounds.height);E?.({width:g,height:x})},[ve,E,N,u,K]);const Se=r.useCallbackRef(a,[a]),ue=r.useCallbackRef(A=>{if(K.dirty===A)return;const Q={...K};Q.dirty=A,z.current,ne(Q),Se?.(Q)},[K]),Me=r.useCallbackRef(A=>{if(K.editMode===A)return;const Q={...K};Q.editMode=A,ne(Q),Se?.(Q)},[K]),Ke=o.useRef(!1),Ue=r.useCallbackRef(()=>{if(Ke.current)return!1;try{l?.(K),m?.(),Ke.current=!0}catch{return!1}return!0},[l,K]),Te=r.useCallbackRef(()=>{Ke.current=!0,ne(n),d?.(),m?.()},[d,n]),he=r.useCallbackRef(A=>{if(!z.current)return;if(A.key,A.isDefaultPrevented(),!(A.isTrusted||A.nativeEvent.ctrlKey||A.nativeEvent.metaKey||A.nativeEvent.altKey||A.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(A.nativeEvent.key)===-1&&A.nativeEvent.key!=="Backspace")){const p={...K};let L=0;return Do(p,p.dirty)&&!isNaN(parseFloat(A.key))?(p.dirty?.endsWith("%")?p.dirty=(p.dirty.substring(0,p.dirty.length-1)??"")+A.key+"%":p.dirty=(p.dirty??"")+A.key+"%",L=p.dirty.length-1):A.nativeEvent.key==="Backspace"?(p.dirty="",L=p.dirty.length):(p.dirty=(p.dirty??"")+A.key,L=p.dirty.length),z.current.value=p?.dirty,I.current={start:L,end:L,direction:"forward"},z.current?.setSelectionRange(L,L,"forward"),ne(p),Se?.(p),void A.preventDefault()}const Q=A.nativeEvent.ctrlKey,O=A.nativeEvent.shiftKey,X=A.nativeEvent.altKey,g=A.nativeEvent.metaKey;if(Q&&A.key==="z"&&A.stopPropagation(),A.which===r.KeyCodes.Escape)return A.preventDefault(),void Te();if(A.which===r.KeyCodes.F2)return Me(!0),void A.preventDefault();const x=A.target;if(A.key==="%"&&x.selectionStart===x.selectionEnd&&x.value[x.selectionStart]==="%"&&K?.clean().getStyle().numberFormat.includes("%"))return B({start:x.selectionStart+1,end:x.selectionEnd+1,direction:x.selectionDirection}),void A.preventDefault();if(A.which===r.KeyCodes.Enter){if(A.preventDefault(),g||X){const p=N.textValue.substring(0,x.selectionStart)+`
9
+ `+N.textValue.substring(x.selectionEnd);return ue(p),void B({start:x.selectionStart+1,end:x.selectionStart+1,direction:x.selectionDirection})}return void(Ue()&&C.getSelection().traverse(s.IRange.Orientation.Column,O))}if(A.which===r.KeyCodes.Tab)return A.preventDefault(),void(Ue()&&C.getSelection().traverse(s.IRange.Orientation.Row,O));let F=null;switch(A.which){case r.KeyCodes.Left:F=s.IRange.Direction.Left;break;case r.KeyCodes.Right:F=s.IRange.Direction.Right;break;case r.KeyCodes.Up:F=s.IRange.Direction.Up;break;case r.KeyCodes.Down:F=s.IRange.Direction.Down}if(F&&!(Q||O||X||g)&&!K.editMode)return void Ue();K.editMode&&(F||ql.includes(A.which))&&A.stopPropagation()},[K,C,N]),W=o.useCallback(()=>{z.current?.focus(),setTimeout(()=>{z.current?.select()},0)},[]),Fe=o.useCallback(()=>{z.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Ce=r.useCallbackRef(()=>{const A=z.current?.value;let Q="";if(h.rowIndex>0){const O=C.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();O&&(Q=O.toTextUnformatted(!0))}ue(A+Q)},[h,C]);o.useEffect(()=>C.getRange(h).addListener(()=>{const A={...K,clean:()=>C.getRange(h).getCell()};ne(A),Se?.(A)}),[h,C,K]);const Y=o.useCallback(()=>{const A=K.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText();ue((z.current?.value??"")+A)},[C]),J=o.useCallback(()=>{const A=K.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText();ue((z.current?.value??"")+A)},[C]),re=o.useMemo(()=>({element:()=>z.current,doCopy:A=>{const Q=z.current.value.substring(z.current.selectionStart,z.current.selectionEnd);if(A?.isCut){const O=z.current.value.substring(0,z.current.selectionStart)+z.current.value.substring(z.current.selectionEnd,z.current.value.length);ue(O)}return Q}}),[z.current]),le=o.useMemo(()=>({element:()=>z.current,doPaste:async(A,Q)=>{const O=await A.toText?.();if(!O)return!0;const X=z.current.value.substring(0,z.current.selectionStart)+O+z.current.value.substring(z.current.selectionEnd,z.current.value.length);return ue(X),B({start:z.current.selectionStart+O.length,end:z.current.selectionStart+O.length,direction:"forward"}),!0}}),[z.current]),me=o.useMemo(()=>({contains:A=>z.current?.contains(A)||!1,focus(){z.current.focus()}}),[]),ye=o.useMemo(()=>[new r.SimpleCommand("selectAll",me,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},W),new r.SimpleCommand("startEditValueAbove",me,{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]}]},Ce),new r.SimpleCommand("startEditCurrentTime",me,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},Y),new r.SimpleCommand("startEditCurrentDate",me,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},J),new r.Command("relativeReferencesToggle",me,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Fe),new r.Command("toggleEditorFocus",me,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ae=o.useMemo(()=>{let A=null;const Q=()=>({contains:O=>z.current?.contains(O)||!1,focus(){z.current.focus()}});return A=k?k.createChildGroup(Q,"editor",!1):new r.CommandGroup(Q,"editor"),A.addCommands(ye,!0),A},[k,ye]),be=o.useMemo(()=>({notifier:null,source:re,target:le,commands:ae}),[re,le,ae]);r.useCopyPaste(be);const[Re,Ee]=o.useState(!y);o.useEffect(()=>{Ee(!1)},[]);const f=r.useCallbackRef(A=>{_(!0),ae?.activate();const Q=I.current;if(Q!==!1){let O,X;const g=z.current.value;Do(K,g)&&(O=g.length-1,X=g.length-1),O=Q?.start??O??g.length,X=Q?.end??X??g.length,I.current=!1,B({start:O,end:X,direction:"forward"})}D?.(A)},[D,K]),De=N.insets;let Ye=De.left+1;const He=De.left+De.right+2-1,$e=ve?.bounds.height??0;let oe,ke=De.top;N.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?ke=Math.max(0,(S-(De.top+De.bottom)-$e)/2):N.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(ke=Math.max(0,S-(De.top+De.bottom)-$e)),V!==void 0&&ve?.lines[0]?.bounds&&(oe=ve?.lines[0]?.bounds.height*V);const ze=N.style.getFont();let we=ze.getSize();ze.isSuperSub()&&(we*=ze.getSuperSubScale()),we*=s.IFont.getDeviceScale()*T;const Ae=u?ze.toCSS(M,T):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:A=>{z.current&&document.activeElement!==z.current&&requestAnimationFrame(()=>{z.current.focus()})},ref:se,...w,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...U},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:ke*T+1,left:Ye*T,width:`calc(100% - ${He*T}px)`,maxWidth:`calc(100% - ${He*T}px)`,height:(oe??$e)*T,maxHeight:(oe??$e)*T},children:c.jsx("textarea",{spellCheck:"false",placeholder:N.placeholder,ref:z,value:N.textValue,disabled:Re,readOnly:G||C.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ae,fontSize:we?`${we}px`:"inherit",textAlign:N.textAlign,lineHeight:(ve?.lines[0]?.bounds.height??0)*T+"px",height:(ve?.bounds.height??0)*T,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:f,onBlur:()=>{_(!1)},onSelect:A=>{},onChange:A=>{z.current&&!Ke.current&&(I.current=!1,ue(A.target.value),N.textValue,A.target.value,A.target.selectionStart,A.target.selectionEnd,A.target.selectionDirection,B({start:A.target.selectionStart,end:A.target.selectionEnd,direction:A.target.selectionDirection}))},onMouseDown:A=>{$&&Me(!0)},onKeyDown:he})})})})),xr=(e,t)=>({clean:e,dirty:t,editMode:!1}),qr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:b=0,isVertical:u=!1,...R}=e,h=U=>{let T=null;if(U&&n>0){T="";for(let V=0;V<U.length;V++)T+=U[V],V<U.length-1&&(T+=",")}return T},C=h(i);let k=C;a&&(k=h(a));let q=n,E=t,D=null;if(l){q=Math.floor(n/2);const U=q+q/2+1;let T=null;T=u?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(b+U)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(b+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:k,d:T,...R})}if(d){q=n/2;const U=q+q/2;let T=k,V=null;V=u?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(b+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(b+U)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(b+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:T,strokeDashoffset:"1",shapeRendering:"crispEdges",d:V,...R})}let G=null;return G=u?`M ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(b)} L ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(b+E)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(b+q/2)} L ${r.ReactUtils.boundPixel(m+E)} ${r.ReactUtils.boundPixel(b+q/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:q,strokeDasharray:C,d:G,...R}),D]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Xt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=ro(i,t),l=typeof a=="function";n.push(l?a:()=>ro(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)ro(n,t)}},Sl=function(){},Sr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rl=Sr?o.useLayoutEffect:o.useEffect,zo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ot=Sr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(zo),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var b=m[0].contentRect,u=b.x,R=b.y,h=b.width,C=b.height,k=b.top,q=b.left,E=b.bottom,D=b.right;l({x:u,y:R,width:h,height:C,top:k,left:q,bottom:E,right:D})}})},[]);return Rl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[Sl,zo]},kl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Ml=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Il=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:b=!1,intersections:u,layout:R}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const C=n[0],k=n[1],q=n[2],E=n[3];let D=1+(b?E-k:q-C),G=0;const U=a.getColor().toRGBA(l).toString(),T=h.description.toLowerCase().includes("double");let V,y;const w=b?"rowStart":"colStart",S=b?"rowEnd":"colEnd",j=b?k:C;if(u?.length>0){const _=u[0];if(_?.range[w]===i[w]){const B=s.IBorder.BuiltInDefinitions.get(_.stroke.getStyle());G=Math.floor(B.width/2)}if(u[u.length-1]?.range[S]===i[S]){const B=s.IBorder.BuiltInDefinitions.get(u[u.length-1].stroke.getStyle());D=Math.floor(D+(B.width===2?0:B.width/2))}if(T){const B=b?"colStart":"rowStart",K=b?"colEnd":"rowEnd",ne=b?R?.getRowOffset:R?.getColOffset;let N=0,z=0;V=[],y=[];for(let se=0;se<u.length;se++){const ve=u[se];if(ve.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&ne){const Ve=ne(ve.range[w])-(j-G);ve.range[B]<i[B]&&(V.push(Ve-N),N=Ve,V.push(1),N++),ve.range[K]>i[K]&&(y.push(Ve-z),z=Ve,y.push(1),z++)}}V.length>0&&N<D&&V.push(D-N),y.length>0&&z<D&&y.push(D-z)}}let M=b?-Math.floor(h.width/2):-G,I=b?-G:-Math.floor(h.width/2);const $=m&&h.width>2?-1:0;return c.jsx(qr,{offsetX:C+M+$,offsetY:k+I+$,length:D+G,isVertical:b,stroke:U,width:h.width,dashArray:V??h.pattern,dashArrayAdditional:y,isDouble:T,isAngled:h.description.toLowerCase().includes("slant")},t)},yo=({getBorderAt:e,borderRenderer:t=Il,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>u=>{const R=u.toClipBounds(u.getRangeCoordsBounds(),-3);if(!R)return;const h=m(u);if(h.length===0)return;const C=u.getVisibleColumnOffsets(),k=u.getVisibleRowOffsets();let q=[],E=[];const D=u.getVisibleColumns(),G=u.getVisibleRows(),U=[],T=[],V=[],y=(M,I,$,_,H,B,K)=>{const ne={index:_,stroke:H,visibleIndex:$,edge:B,length:K};M[I]||(M[I]=[]),M[I].length>0&&M[I][M[I].length-1]?.index===_?M[I][M[I].length-1]=ne:M[I].push(ne)};for(let M=0;M<h.length;M++){const I=h[M],$=I.coords;if(!$)continue;const _=I?.range??{rowStart:$.rowIndex,colStart:$.colIndex,rowEnd:$.rowIndex,colEnd:$.colIndex},H=u.getVisibleRangeCoords();if(!ge.CoordUtils.isRangesIntersect(_,H)&&!ge.CoordUtils.isRangeWithinRange(_,H))continue;const B=$.colIndex,K=$.rowIndex,ne=C[B],N=k[K];if(_.rowEnd!==_.rowStart){const he=k[_.rowStart]?.spanIndex??-1,W=k[_.rowEnd]?.spanIndex??k[G[G.length-1]].spanIndex+1;q.push({..._,rowStart:he,rowEnd:W})}if(_.colEnd!==_.colStart){const he=C[_.colStart]?.spanIndex??-1,W=C[_.colEnd]?.spanIndex??C[D[D.length-1]].spanIndex+1;E.push({..._,colStart:he,colEnd:W})}const z=I.value,se=e(z,M);if(!se||se.isEmpty())continue;const ve=se.getLeft(),Ve=se.getTop(),Se=se.getRight(),ue=se.getBottom();let Me=1,Ke=1;if(!ne||!N)continue;const Ue=ne.spanIndex,Te=N.spanIndex;ve.isNone()||y(U,Ue,Te,K,ve,s.IBorder.Edge.Left,Me),Ve.isNone()||y(T,Te,Ue,B,Ve,s.IBorder.Edge.Top,Ke),Se.isNone()||y(U,Ue+Ke,Te,K,Se,s.IBorder.Edge.Right,Me),ue.isNone()||y(T,Te+Me,Ue,B,ue,s.IBorder.Edge.Bottom,Ke)}const w=(M,I,$)=>{const _=[];return M.forEach((H,B)=>{let K=null;H.sort((ne,N)=>ne.visibleIndex-N.visibleIndex);for(let ne=0;ne<H.length;ne++){const N=H[ne];if(!N?.stroke||I[B]===void 0&&I[B-1]===void 0)continue;let z=!1;if($)for(let Se=0;!z&&Se<q.length;Se++){let ue=q[Se];ue.colStart<=N.index&&ue.colEnd>=N.index&&ue.rowStart<B&&ue.rowEnd>=B&&(z=!0)}else for(let Se=0;!z&&Se<E.length;Se++){let ue=E[Se];ue.rowStart<=N.index&&ue.rowEnd>=N.index&&ue.colStart<B&&ue.colEnd>=B&&(z=!0)}if(z)continue;const se=N.stroke?.getColor(),ve=se?se.toRGBA().toString():l,Ve=N.stroke.getStyle()+":"+ve;(Ve!==K?.key||K&&K.visibleIndex+1<N.visibleIndex)&&(K&&_.push(K),K={key:Ve,index:I[B]??I[B-1]+1,visibleIndex:N.visibleIndex,edge:N.edge,stroke:N.stroke,from:N.index,to:N.index+N.length-1,intersections:[],length:1}),K.to=N.index+N.length-1,K.visibleIndex=N.visibleIndex}K&&_.push(K)}),_};q=q.sort(Ml),E=E.sort(kl);const S=w(U,D,!1),j=w(T,G,!0);if(S.length===0&&j.length===0)return null;for(let M=0;M<j.length;M++){const I=j[M];let $=ge.CommonUtils.findEqualOrGreater(S,I.from,H=>H.index),_=!1;for(;!_;){const H=S[$++];H&&H.index>=I.from&&H.index<=I.to+1&&H.from<=I.index&&H.to+1>=I.index&&(I.intersections.push({stroke:H.stroke,range:{rowStart:H.from,rowEnd:H.to+1,colStart:H.index,colEnd:H.index}}),H.intersections.push({stroke:I.stroke,range:{rowStart:I.index,rowEnd:I.index,colStart:I.from,colEnd:I.to+1}})),_=!H||H.index>I.to+1}}for(let M=0;M<j.length;M++){const I=j[M];let $=I.stroke;const _=`rBorder:${I.index}:${I.from}:${I.to}:${I.edge}`,H={rowStart:I.index,rowEnd:I.index,colStart:I.from,colEnd:I.to+1},B=u.getLayout(),K=!1,ne=B.getColOffset(H.colStart),N=B.getRowOffset(H.rowStart),z=[ne,N,B.getColOffset(H.colEnd),N];V.push(t({key:_,points:z,stroke:$,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:H,intersections:I.intersections,layout:B,isVertical:K}))}for(let M=0;M<S.length;M++){const I=S[M];let $=I.stroke;const _=`cBorder:${I.index}:${I.from}:${I.to}:${I.edge}`,H={rowStart:I.from,rowEnd:I.to+1,colStart:I.index,colEnd:I.index},B=u.getLayout(),K=!0,ne=B.getColOffset(H.colStart),N=[ne,B.getRowOffset(H.rowStart),ne,B.getRowOffset(H.rowEnd)];V.push(t({key:_,stroke:$,points:N,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:H,intersections:I.intersections,layout:B,isVertical:K}))}return c.jsx("svg",{width:`${R.width}`,height:`${R.height}`,viewBox:`0 0 ${R.width} ${R.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${R.width}px`,height:`${R.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:V},"borders")},[e,i])}},No=ge.AnchorLocation.Center,Tl=Object.freeze({horizontal:!1,vertical:!1}),Lo=ge.TypesUtils.EmptyTopLeft,El=(e,t)=>ge.CoordUtils.EmptyCell,Fl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Al=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:b,children:u,...R}=e,h=o.useRef(null),[C,{width:k,height:q}]=Ot(),E=n??k,D=i??q,G=o.useMemo(()=>{const K=[];for(let ne=0;ne<l;ne++)for(let N=0;N<d;N++){const z={colIndex:N,rowIndex:ne};K.push({coords:z,value:z})}return K},[]),U=o.useCallback(K=>G,[G]),{overlay:T}=yo({getVisibleCells:U,getBorderAt:t,darkMode:m,forceThinBorder:b}),V=Math.floor(E/d),y=Math.floor(D/l),w={getColOffset:K=>Math.ceil(K*V)+0,getRowOffset:K=>Math.ceil(K*y)+0,getColIndex:K=>Math.floor((K-0)/V)-1,getRowIndex:K=>Math.floor((K-0)/y)-1},S={rowStart:0,colStart:0,rowEnd:l,colEnd:d},j={x:0,y:0,width:Math.max(0,E)+0,height:Math.max(0,D)+0},M=o.useMemo(()=>{const K={},ne=Math.floor(E/d);for(let N=0;N<d;N++)K[N]={offset:N*ne,size:ne,spanIndex:N};return K},[E,D]),I=o.useMemo(()=>{const K={},ne=Math.floor(D/l);for(let N=0;N<l;N++)K[N]={offset:N*ne,size:ne,spanIndex:N};return K},[E,D]);if(!T)return null;const $={width:E,height:D},_={width:E,height:D},H={getStage:()=>h.current,getTotalSize:()=>$,getViewportSize:()=>_,getLayout:()=>w,getCellCoordsAsRangeCoords:ge.CoordUtils.cellToRange,getVisibleRangeCoords:()=>S,getVisibleRows:()=>{const K=[];for(let ne=0;ne<l;ne++)K.push(ne);return K},getTotalRangeCoords:()=>S,getRelativePointFromClient:(K,ne)=>({x:K,y:ne}),getVisibleColumns:()=>{const K=[];for(let ne=0;ne<d;ne++)K.push(ne);return K},toClipBounds:(K,ne)=>j,toViewBounds:K=>K,toAbsoluteBounds:K=>K,getBounds:()=>j,getInsets:()=>null,getRangeCoordsBounds:(K,ne)=>null,getVisibleColumnOffsets:()=>M,getVisibleRowOffsets:()=>I,allViews:()=>({[No]:H}),getAnchor:()=>No,getZoom:()=>1,scrollCellCoordsIntoView:Fl,getCellCoordsFromClient:El,getScrollOrientation:()=>Tl,getScrollTopLeft:()=>Lo,getFreezeTopLeft:()=>Lo},B=T(H);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...R,children:[c.jsx("div",{ref:Xt([h,C]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:u}),B]})});function Rr(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=Rr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function yt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Rr(e))&&(i&&(i+=" "),i+=t);return i}const Dl="_sheetxl-sheet_1qeq6_5",zl="_viewport-overlay_1qeq6_6",kr=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"})]})},Nl=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??{},[b,u]=o.useState(null);o.useEffect(()=>{(async()=>{const y=await s.LicenseManager.getDetails();u(y)})()},[]);const[R,h]=o.useState(!1),C={opacity:.65},k=o.useMemo(()=>{const y=b?.exceptions(),w=y?.length??0;if(w===0)return null;const S=[];for(let j=0;j<w;j++){const M=y[j];S.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:M},j))}return S},[b,n]);if(b===null||b.isValidFor(l))return null;const q=b.type(),E=!k&&q.endsWith("ity"),D=b.licensee(),G=E?1.6:1,U=135/G,T=37/G;let V=null;return!q&&D?.length>0&&(V=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),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:[R?c.jsx(kr,{style:C}):c.jsx("svg",{width:U,height:T,style:C,children:c.jsx("image",{style:{width:U,height:T},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),c.jsxs("div",{children:[V,k,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),et=(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 u=0;u<m;u++){const R=l[u];d[R]=(h,C)=>{i.current[R]?.(h,C)}}const b=e.addListeners(d,n);if(a)for(let u=0;u<m;u++)d[l[u]](e);return()=>{b?.()}},[e])},In=new s.Color("transparent");function Mr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:b}=e,[u,R]=o.useState(null),[h,C]=o.useState(null),k=o.useRef(null),q=r.useCallbackRef(m,[m]),E=r.useCallbackRef(b,[b]),[D,G]=o.useState(),[U,T]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[V,y]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const S=r.useGlobalClipboard(),[j,M]=o.useState(ge.CommonUtils.EmptyArray),I=o.useCallback(()=>{if(k.current!==t)return;const g=t.getSelectedRanges();let x=null;j.length>0&&ge.CoordUtils.isCellWithinRange(u,j[0].getRange().getCoords())&&(x=j[0]);const F=t?.getSelectedCell(),p=F?.getCoords()??null;Lt.unstable_batchedUpdates(()=>{ve(x),R(p),C(g)})},[t,j,h,u]),$=o.useCallback(ge.CommonUtils.debounce(I,210),[I]);o.useEffect(()=>{k.current=t,I()},[t]);const _=r.useCallbackRef(()=>t.getRange(u).getCell(),[t,u]),H=r.useCallbackRef(async(g,x,F=null,p=!1,L=!0)=>{const v=g?.label?.(),P=async()=>{const de=await Promise.resolve(L&&d?.showBusy?.(v??"Busy..."));try{await t.doBatch(async()=>x(t),v),p&&w.setMode(null),de&&de()}catch(ce){if(de&&de(),!ce)return;d?.showError?.(ce)}},Z=[];let ee=!1;const ie=async()=>(Z.push(P),(async()=>{if(!ee){for(ee=!0;Z.length>0;){const de=Z.shift();de&&await de()}ee=!1}})());if(n){let de=null;if(F!==!1&&g){const ce=F??v;de=new r.SimpleCommand(g.key(),l,{label:ce,description:ce},ie)}n(de)}return ie()},[t,n,d]),B=r.useCallbackRef((g,x,F=!1,p)=>H(g,L=>{const v=L.getSelectedRanges();F&&v.getStyle().update(null,p),v.getStyle().update(x,p),v.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),K=r.useCallbackRef((g,x,F)=>{H(g,p=>{let L=x;(F||x?.address)&&(L=L??{},!F&&x?.address?.startsWith("#")?F=x?.address.substring(1):F&&(L.displayText=F)),p.getSelectedRange().setHyperlink(L)})},[t]),ne=r.useCallbackRef((g,x)=>{H(g,F=>{F.getSelectedRange().setComments(x)})},[t]),N=r.useCallbackRef((g,x)=>{H(g,F=>{F.getSelectedRanges().clear(x)})},[t]),z=r.useCallbackRef(async(g,x,F=!1,p=!1)=>H(g,async L=>{let v=L.getSelectedRanges();F&&(x===s.IRange.Orientation.Row?v=v.getEntireRows(p):x===s.IRange.Orientation.Column&&(v=v.getEntireColumns(p)));let P=null;const Z=w.getMode()?.key;if(Z==="copy"||Z==="cut"){const ee=await S.getClipboard().readReference();ee&&ee.getItemType()==="range"&&(P=ee.getItem(),P.getCoords()||(P=null))}if(P){const ee=await v.insertFrom(P,{...P.getMarkOptions(),orientation:x,autoSelect:!0});!ee||ee.isEntireRows()||ee.isEntireColumns()||ee.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else v.insert(x,{autoSelect:!0})},"Insert Cells",!1),[w]),[se,ve]=o.useState(null),Ve=r.useCallbackRef(g=>t.getStyles().setDefaultTableStyle(g),[t]),Se=r.useCallbackRef(g=>{t.getStyles().getTableStyle(g)?.delete()},[t]),ue=r.useCallbackRef((g,x)=>{H(g,async F=>{const p=F.getSelectedRange(),L=F.getSelectedCell().getCoords();let v=null,P=0;const Z=L.rowIndex>0?F.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex}).getExtended(s.IRange.Direction.Up):null;Z&&F.getRange({colStart:L.colIndex,rowStart:Z.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowStart}).isContentful()&&(v=s.IRange.Direction.Up,P=L.rowIndex-Z.getCoords().rowEnd);const ee=L.colIndex>0?F.getRange({rowIndex:L.rowIndex,colIndex:L.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(ee&&F.getRange({colStart:ee.getCoords().colStart,rowStart:L.rowIndex,colEnd:ee.getCoords().colStart,rowEnd:L.rowIndex}).isContentful()){const de=L.colIndex-ee.getCoords().colEnd;(de<P||!v)&&(v=s.IRange.Direction.Left,P=de)}let ie=null;if(v===s.IRange.Direction.Up){if(ie={...Z.getCoords()},(ie.rowEnd===L.rowIndex||!F.getRange({colIndex:L.colIndex,rowIndex:L.rowIndex-1}).isContentful())&&ie.rowStart>0&&F.getRange({colIndex:L.colIndex,rowIndex:ie.rowStart-1}).isContentful()){const de=Z.getExtended(s.IRange.Direction.Up);ie={colStart:L.colIndex,rowStart:de.getCoords().rowStart,colEnd:L.colIndex,rowEnd:Z.getCoords().rowEnd}}ie.rowEnd=L.rowIndex-1}else if(v===s.IRange.Direction.Left){if(ie={...ee.getCoords()},(ie.colEnd===L.colIndex||!F.getRange({colIndex:L.colIndex-1,rowIndex:L.rowIndex}).isContentful())&&ie.colStart>0&&F.getRange({colIndex:ie.colStart-1,rowIndex:L.rowIndex}).isContentful()){const de=ee.getExtended(s.IRange.Direction.Left);ie={colStart:de.getCoords().colStart,rowStart:L.rowIndex,colEnd:de.getCoords().colEnd,rowEnd:L.rowIndex}}ie.colEnd=L.colIndex-1}if(p.size!==1&&v){const de=p.getCoords(),ce=p.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),xe={...ie},fe=de.rowStart,pe=de.rowEnd,qe=de.colStart,Oe=de.colEnd,Ne=v===s.IRange.Direction.Up;for(let We=qe;We<=Oe;We++){xe.colStart=Ne?We:ie.colStart+(We-qe),xe.colEnd=Ne?We:ie.colEnd+(We-qe);for(let je=fe;je<=pe;je++){xe.rowStart=Ne?ie.rowStart+(je-fe):je,xe.rowEnd=Ne?ie.rowEnd+(je-fe):je;const _e=F.getRange(xe).toString();ce.pushAt(je,We,`=${x}(${_e})`)}}ce.apply()}else{const de=ie?F.getRange(ie).toString():"",ce=`=${x}(`;q?.({text:`${ce}${de})`,editMode:!0,initialSelection:{start:ce.length,end:ce.length+de.length}})}},!1)},[t]),Me=r.useCallbackRef((g,x,F=!1,p=!0)=>{H(g,async L=>{let v=null;if(se)return void se.updateStyleOptions(x);{const ee=L.getSelectedRanges().getFixed(!0),ie=L.getSelectedRange().getDefaultSortCriteria();let de={ranges:ee,hasHeader:ie?.options?.hasHeader??!1};v=p?new Promise((ce,xe)=>{const fe={tableOptions:de,onCancel:()=>{xe()},onDone:pe=>{ce(pe)},context:{getNames:()=>L.getNames()}};d.showWindow?.("tableNew",fe)}):{option:"Ok",tableOptions:de}}const P=await Promise.resolve(v);if(P?.option!=="Ok")throw null;const Z=await Promise.resolve(d?.showBusy?.(g.label()));try{await L.getTables().add(P.tableOptions.ranges.at(0),{styleName:x?.name,clearFormatting:F,hasHeader:P.tableOptions.hasHeader}).getRange().select()}catch(ee){Z(),d?.showError?.(ee)}Z()},!1,!0,!1)},[se]),Ke=r.useCallbackRef(()=>i,[i]),Ue=r.useCallbackRef(g=>({styles:()=>t.getStyles(),table:()=>g,bodyStyle:Ke,getNames:()=>t.getNames()}),[t]),Te=r.useCallbackRef(async(g,x,F,p=!0)=>{let L=null;if(!x){let v=t.getSelectedRange();v.size===1&&(v=v.getSurrounding());let P=t.getTables().getItems({address:t.getSelectedRange()});P.length>0&&(x=P[0]),await v.select()}if(x){if(p){try{F&&await x.select()}catch{}L=new Promise(async(v,P)=>{g.update({context:Ue(x)});const Z={command:g,commands:f,notifier:d,onDone:ie=>{v(ie)}},ee=await d.showWindow?.("tableDetails",Z,{disableAutoDestroy:!0});setTimeout(()=>{ee.focus()},180)})}Promise.resolve(L).then(v=>{},v=>{d?.showError?.(v)})}},[d]),he=r.useCallbackRef(async(g,x,F=!1)=>{let p=null;if(x)x.isITable?p=x:x.getValue()&&(p=x.getValue());else{const L=t.getTables().getItems({address:t.getSelectedRange()});L.length>0&&(p=L[0])}if(p){if(!F){const L=p.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}H(g,async()=>{F?p.delete():p.convertToRange()},!1,!0)}},[d]),W=r.useCallbackRef((g,x,F)=>{H(g,async p=>{let L=p.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 P=p.getSelection().getCoords().cell;let Z=v.getDefaultSortCriteria(s.IRange.Orientation.Row,P);if(!Z){if(F)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ee=Z.options;if(F&&(ee=new Promise((de,ce)=>{const xe={range:v,options:Z.options,cell:P,onCancel:()=>{ce()},onDone:fe=>{fe?de(fe.options):ce()}};d.showWindow?.("sort",xe)})),ee=await Promise.resolve(ee),!ee)return;const ie=await Promise.resolve(d?.showBusy?.(g.label()));try{v.doBatch(()=>{const de={...ee,...x};v.sort(de),v.autoFit({orientations:de?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},g?.label?.())}catch(de){ie(),d?.showError?.(de)}ie()},!1,!1,!1)},[d]),Fe=r.useCallbackRef(()=>{console.log("compactedSelection");const g=t.getSelection().getCoords(),x=t.getSelectedRanges().getFlattened().getCoords(),F=(v=>{const P=new Blob([v],{type:"application/javascript"}),Z=URL.createObjectURL(P),ee=new Worker(Z);return URL.revokeObjectURL(Z),ee})("console.log('hello from worker');");setTimeout(()=>{F.terminate(),console.log("Worker terminated")},5e3);let p=-1;for(let v=0;p===-1&&v<x.length;v++)ge.CoordUtils.isCellWithinRange(g.cell,x[v])&&(p=v);if(ge.CoordUtils.isEqualRangesArrays(g.ranges,x))return;const L={cell:g.cell,ranges:x,rangeIndex:p};t.getSelection().updateCoords(L)},[t]),Ce=r.useCallbackRef(()=>{console.log("selectComments")},[t]),Y=r.useCallbackRef(async(g=!1,x=!1)=>{let F=null;if(x)F=t.getEntireRange();else{const p=t.getSelectedRange();if(p.isEntireRange()){const L=t.getSelection().getCoords().cell,v=t.getRange(L);F=v.getSurrounding(),F.isEntireRange()&&(F=v)}else F=p.getSurrounding({contentOnly:g})}F&&await F.select()},[t]),J=r.useCallbackRef((g,x,F)=>{H(g,async p=>{let L=p.getSelectedRanges();F&&(x===s.IRange.Orientation.Row?L=L.getEntireRows():x===s.IRange.Orientation.Column&&(L=L.getEntireColumns())),L.delete(x)},"Delete Cells")},[t]);r.useCallbackRef(async g=>{let x=null;const F=E(),p=Math.min(F.width-8,480),L=Math.min(F.height-8,288);try{t.getSelectedRanges(),x=await t.getMovables().add({bounds:{x:F.left+(F.width-p)/2,y:F.top+(F.height-L)/2,width:p,height:L},type:"chart",json:g.template}),x.select(),w.setMode(null)}catch(v){d?.showError?.(v)}return x},[t,d]);const re=r.useCallbackRef(async(g,x,F)=>{const p=await d?.showBusy?.(g.label());try{const L=await t.getMovables().addImage(x,{autoSelect:!0,...F});return p(),w.setMode(null),L}catch(L){p();let v=L;typeof v!="string"&&(console.warn(L),v="Unable to resolve image."),d?.showMessage?.(v,{type:r.NotificationType.Error})}},[t,d]),le=r.useCallbackRef((g,x)=>{H(g,async F=>{const p=F.getSelectedRanges();p.doBatch(()=>{const L=x===s.IRange.Direction.Up||x===s.IRange.Direction.Down,v=p.getCoords().slice().sort(ge.CoordUtils.createRangeComparator(L?s.IRange.Orientation.Row:s.IRange.Orientation.Column));for(let P=0;P<v.length;P++){const Z=v[P];let ee=Z;const ie=F.getRange(ee).getMerges();let de=0,ce=0;if(ie.length>0){const xe=ie[0];de=xe.rowEnd-xe.rowStart,ce=xe.colEnd-xe.colStart}x===s.IRange.Direction.Left?ee={...Z,colStart:Z.colEnd+ce}:x===s.IRange.Direction.Right?ee={...Z,colEnd:Z.colStart+ce}:x===s.IRange.Direction.Up?ee={...Z,rowStart:Z.rowEnd+de}:x===s.IRange.Direction.Down&&(ee={...Z,rowEnd:Z.rowStart+de}),F.getRange(ee).autoFill(Z,{filler:s.AutoFill.Types.Copy}),F.getRange(Z).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:g.label()})})},[d]),me=r.useCallbackRef(()=>{let g=null;const x=t.getSelectedCell().getCoords();if(x?.rowIndex>0){const F=t.getRange({rowIndex:x.rowIndex-1,colIndex:x.colIndex}).getCell();F&&(g=F.toTextUnformatted(!0))}q?.({text:g})},[t]),[ye,ae]=o.useReducer(g=>g+1,0),[be,Re]=o.useReducer(g=>g+1,0),Ee=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]}},()=>Ce()),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]}]},(g=!1)=>Y(!1,g)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Y(!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]}},()=>Fe()),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(){W(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){W(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(){W(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
+ 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(g){B(this,{named:g.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(g){Me(this,g)}),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(g){Me(this,g,!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(){Me(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."},Ve),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Se),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(g){B(this,{border:g})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(g){B(this,{fill:g})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(g){B(this,{font:{fill:g}})}),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(){B(this,g=>({font:{size:go(g.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(){B(this,g=>({font:{size:go(g.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(g){B(this,{font:{family:g}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(g){B(this,{font:{size:g}})}),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(g,x){const F=this,p={initialValue:g??x.state(),context:x.context(),onInputOption:(L,v)=>{B(F,{numberFormat:L})}};d.showWindow?.("numberFormat",p)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(g){B(this,{numberFormat:g})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(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(){B(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(){B(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(){B(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(g){B(this,{numberFormat:g??'_($* #,##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(){B(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(){B(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(){B(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(){B(this,g=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(g.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){B(this,g=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(g.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.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(g){g&&ue(this,g.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ue(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ue(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ue(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ue(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ue(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(){q?.({text:t.createTemporaryCell({value:fn(),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(){q?.({text:t.createTemporaryCell({value:fn(),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("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:()=>_,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(g,x){const F=this,p={context:x.context(),onUpdateHyperlink:(L,v)=>{K(F,L,v)}};d.showWindow?.("hyperlink",p)}),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:()=>_},async(g,x)=>{const F=x.context()();if(!F)return;const p=F.getHyperlink();if(p)try{await p.open()}catch(L){d?.showError?.(L)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>_},function(g,x){K(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."},(g,x)=>{((F,p)=>{F?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[p," 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/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(d,x.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:()=>_},async function(g,x){const F=this,p={context:x.context(),onUpdateComments:L=>{ne(F,L)}};d.showWindow?.("comments",p)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>_},function(g,x){ne(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(g=null){let x=null,F=null;typeof g=="string"?F=g:x=g?.file?g.file:g,(x||(x=await ge.CommonUtils.openFileDialog(F??"image/*"),x))&&await re(this,{file:x},g?.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(g){if(!g){const x=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(x.option!=="Insert")return;g=x.input}g&&re(this,{fetch:g})}),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(){Me(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(g){let x=null,F=!1;g.isITable?x=g:g.getValue()&&(x=g.getValue(),F=!0),Te(this,x,F)}),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(g){he(this,g,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
14
14
 
@@ -16,18 +16,18 @@ The values and the formatting are preserved.`},function(g){he(this,g,!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."})],[]),f=o.useMemo(()=>{let g=null;return g=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),g.addCommands(Ee,!0),g},[a,Ee]),[De,Ye]=o.useState(!1),[He,$e]=o.useState(!1);o.useEffect(()=>{if(k.current!==t||!h)return;const g=h.getCoords(),x=t.getTables().getItems({address:g[0]});M(P=>ge.CommonUtils.isEqualArrays(P,x)?P:x),u&&x[0]&&ge.CoordUtils.isCellWithinRange(u,x[0].getRange().getCoords())?ve(x[0]??null):ve(null);const F=t.getSelectedRanges(),p=F.getMerges().length>0,L=F.isOverlapping();let v=!0;for(let P=0;v&&P<g.length;P++)v=ge.CoordUtils.isSingleCell(g[P]);$e(L),Ye(x.length===0&&!L&&(p||!v))},[be,h,t]),r.useCommands(a,null,{onChange:()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=w.getMode()?.key==="formatPainter";f.getCommand("formatPainterToggle").update({disabled:g||!a?.getCommand("copy"),state:()=>x}).updateCallback(()=>x?void w.setMode(null):f.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,Se,a]),et(t.getView(),{onFreezeSplitChange:()=>{Me()}}),et(t.getSelection(),{onChange:()=>{$()}});const re=()=>{f.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:g=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),f.getCommand("formatSheetTabColor").updateCallback(g=>{t.setTabColor(g)}).update({state:()=>t?.getTabColor()??In,context:()=>({onColorSelect:g=>{},darkMode:i.darkMode,autoColor:In,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Re=()=>{f.getCommand("formatBorder").update({context:()=>({onBorderSelect:g=>{G(g)},darkMode:i.darkMode,quickBorder:D,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:g=>t.getStyles().getNormal().createTemporaryStyle({border:g}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Re()},[D]),o.useEffect(()=>{const g=!t.getProtection().isInsertHyperlinksAllowed();f.getCommand("openHyperlink").update({disabled:!_().getHyperlink()}),f.getCommand("deleteHyperlink").update({disabled:g||!_().getHyperlink()});const x=_().getHyperlink()?"Edit":"Insert",F="Link";f.getCommand("updateHyperlink").update({label:()=>(_().getHyperlink(),`${x} ${F}`),scopedLabels:{contextMenu:`${x} ${F}…`,insert:`${F}…`,hyperlink:`${x}…`},disabled:g})},[_()?.getHyperlink(),Se]),o.useEffect(()=>{const g=_().getComments(),x=()=>g?"Edit":"Insert",F=()=>g?"Comments":"Comment";f.getCommand("updateComments").update({label:()=>`${x()} ${F()}`,scopedLabels:{contextMenu:`${x()} ${F()}…`,insert:`${F()}…`}})},[_()?.getComments(),Se]),et(t,{onViewChange:()=>{const g=t.getView();f.getCommand("sheetViewToggleFormulaView").update({state:g.isShowFormulas()}),f.getCommand("sheetViewToggleShowZeros").update({state:g.isShowZeros()}),f.getCommand("gridlinesToggle").update({state:g.isShowColumnGridlines()||g.isShowRowGridlines()}),f.getCommand("sheetViewToggleGridlinesColumns").update({state:g.isShowColumnGridlines()}),f.getCommand("sheetViewToggleGridlinesRows").update({state:g.isShowRowGridlines()}),f.getCommand("sheetViewToggleShowHeadings").update({state:g.isShowColumnHeaders()||g.isShowRowHeaders()}),f.getCommand("sheetViewToggleShowHeadingColumns").update({state:g.isShowColumnHeaders()}),f.getCommand("sheetViewToggleShowHeadingRows").update({state:g.isShowRowHeaders()}),f.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),re()},onTabColorChange:()=>{re()},onMergesChange:()=>{Me()},onMovablesChange:()=>{Me()},onTablesChange:()=>{Me()},onProtectionChange:()=>{Me(),de()},onStyleChange:()=>{re(),Re(),Me()}}),o.useEffect(()=>{re(),Re()},[i]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=j.length>0&&!ae||g,F=Ue(ae),p={context:F};f.getCommand("editTable").update(p),f.getCommand("deleteTable").update(p),f.getCommand("convertTableToRange").update(p);const L={context:F,disabled:x};f.getCommand("formatTableStyle").update({label:ae?"Apply Table Style":"Format As Table",...L}),f.getCommand("formatTableStyleClearCellStyles").update(L),f.getCommand("deleteTableStyle").update(L),f.getCommand("convertTableToRange").update(L),f.getCommand("insertTable").update({disabled:x||j.length>0});const v={context:F,disabled:x||j.length===0};f.getCommand("tableHeaderRowToggle").update(v),f.getCommand("tableTotalRowToggle").update(v),f.getCommand("autoFilterToggle").update(v),f.getCommand("formatTableStyleClearTableStyle").update({...v,disabled:v.disabled||!ae||ae.getStyleOptions().name===null})},[ae,j,Se]),o.useEffect(()=>{f.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),f.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale())})}),f.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),f.getCommand("gridlinesToggle").updateCallback(()=>{const g=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!g,showRowGridlines:!g})}),f.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),f.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),f.getCommand("sheetViewFormatGridlinesColor").updateCallback(g=>{t.getView().update({gridLineColor:g})}),f.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const g=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!g,showRowHeaders:!g})}),f.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),f.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),f.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const g=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:g?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:g?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),f.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),f.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),f.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),f.getCommand("insertFunction").update({context:()=>({searchByCategory:async g=>{const x=t.getWorkbook();if(!x)return ge.CommonUtils.EmptyArray;const F=await x.getScripts().searchFunctions({category:g,includeBuiltIn:!0});return F.sort((p,L)=>p.getName().localeCompare(L.getName())),F}})})},[t]),o.useEffect(()=>{const g=t.getView().getFreezePanes(),x=()=>g.coords.rowIndex!==0,F=()=>g.coords.colIndex!==0,p=()=>g.coords.rowIndex!==0||g.coords.colIndex!==0;f.getCommand("freezeToggle").updateCallback(()=>{p()?t.getView().setFreezePanes(null):p()?F()?t.getView().setFreezePanes({coords:{rowIndex:u.rowIndex}}):x()&&t.getView().setFreezePanes({coords:{colIndex:u.colIndex}}):t.getView().setFreezePanes({coords:u})}).update({state:p,disabled:()=>!u||!p()&&u.rowIndex===0&&u.colIndex===0}),f.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:x()?0:u.rowIndex}})}).update({state:x,disabled:()=>!u||!x()&&u.rowIndex===0}),f.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:F()?0:u.colIndex}})}).update({state:F,disabled:()=>!u||!F()&&u.colIndex===0}),f.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!p()})},[be,u,t,i]);const ze=_().getStyle(),ye=ze.getFont(),Ae=ze.getAlignment(),A=Ae.getHorizontal(),Q=Ae.getVertical(),O=Ae.getOverflow(),X=Ae.getRotation();return o.useEffect(()=>{f.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>_().getStyle(!0).getNamed(),bodyStyle:Ke,createTemporaryCell:Le=>t.createTemporaryCell(Le)})}),f.getCommand("formatFillColor").update({state:()=>{let Le=null;const Je=ze.getFill();return Je?.getType()===s.IFill.Type.Solid?Le=Je.getColor():Je?.getType()===s.IFill.Type.Gradient?Le=Je.getStops()?.[0]?.getColor():Je?.getType()===s.IFill.Type.Pattern&&(Le=Je.getBackground()),Le},context:()=>{const Le=t.getStyles();return{onColorSelect:Je=>{T(Je??In)},darkMode:i.darkMode,quickColor:U,autoColor:In,schemeLookup:Le.schemeLookup(),recentColors:Le.recentColors(),addRecentColor:Je=>Le.addRecentColor(Je),clearRecentColors:()=>Le.clearRecentColors()}}}),f.getCommand("formatFontColor").update({state:()=>ye.toJSON()?.fill?ye.getFill():null,context:()=>{const Le=t.getStyles();return{onColorSelect:Je=>{y(Je)},darkMode:i.darkMode,quickColor:V,autoColor:Le.getNormal().getFont().getFill(),schemeLookup:Le.schemeLookup(),recentColors:Le.recentColors(),addRecentColor:Je=>Le.addRecentColor(Je),clearRecentColors:()=>Le.clearRecentColors()}}}),f.getCommand("formatNumberFormat").update({state:()=>ze.getNumberFormat(),context:()=>_}),f.getCommand("formatNumberDialog").update({state:()=>ze.getNumberFormat(),context:()=>_}),f.getCommand("formatFontFamily").update({state:()=>ye.getFamily()}),f.getCommand("formatFontSize").update({state:()=>ye.getSize()});const g=function(){const Le=ye.getWeight()||0;return!isNaN(Le)&&Le>500};f.getCommand("formatBoldToggle").updateCallback(function(){B(this,{font:{weight:g()?400:700}})}).update({state:g});const x=function(){return ye.getStyle()===s.IFont.Style.Italic};f.getCommand("formatItalicToggle").updateCallback(function(){B(this,{font:{style:x()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:x}),f.getCommand("formatStrikeThroughToggle").updateCallback(function(){B(this,{font:{strike:!ye.getStrike()}})}).update({state:ye.getStrike()}),f.getCommand("formatUnderlinedToggle").updateCallback(function(){B(this,{font:{underline:ye.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===s.IFont.UnderlineStyle.Single}),f.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){B(this,{font:{underline:ye.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===s.IFont.UnderlineStyle.Double}),f.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){B(this,{font:{underline:ye.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),f.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){B(this,{font:{underline:ye.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ye.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),f.getCommand("formatSuperscriptToggle").updateCallback(function(){B(this,{font:{verticalAlign:ye.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:ye.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),f.getCommand("formatSubscriptToggle").updateCallback(function(){B(this,{font:{verticalAlign:ye.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:ye.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const F=()=>O===s.ITextFrame.Overflow.Visible;f.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){B(this,{alignment:{overflow:(F(),s.ITextFrame.Overflow.Visible)}})}).update({state:F});const p=()=>O===s.ITextFrame.Overflow.Wrap;f.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){B(this,{alignment:{overflow:p()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:p});const L=function(){return O===s.ITextFrame.Overflow.Clip};f.getCommand("formatTextOverflowClipToggle").updateCallback(function(){B(this,{alignment:{overflow:L()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:L});const v=function(){return O===s.ITextFrame.Overflow.Shrink};f.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){B(this,{alignment:{overflow:v()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:v});const P=function(){return O===s.ITextFrame.Overflow.Shrink};f.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){B(this,{alignment:{overflow:P()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:P,disabled:!0});const Z=function(){return Q===s.ITextFrame.VerticalAlignment.Top};f.getCommand("formatAlignTopToggle").updateCallback(function(){B(this,{alignment:{vertical:Z()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:Z});const ee=function(){return Q===s.ITextFrame.VerticalAlignment.Center};f.getCommand("formatAlignMiddleToggle").updateCallback(function(){B(this,{alignment:{vertical:ee()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:ee});const ie=function(){return Q===s.ITextFrame.VerticalAlignment.Bottom};f.getCommand("formatAlignBottomToggle").updateCallback(function(){B(this,{alignment:{vertical:(ie(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ie});const se=function(){return Q===s.ITextFrame.VerticalAlignment.Justify};f.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){B(this,{alignment:{vertical:se()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:se});const ce=function(){return Q===s.ITextFrame.VerticalAlignment.Distributed};f.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){B(this,{alignment:{vertical:ce()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ce});const we=function(){return A===s.ITextFrame.HorizontalAlignment.Left};f.getCommand("formatAlignLeftToggle").updateCallback(function(){B(this,{alignment:{horizontal:we()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:we});const fe=function(){return A===s.ITextFrame.HorizontalAlignment.Center};f.getCommand("formatAlignCenterToggle").updateCallback(function(){B(this,{alignment:{horizontal:fe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:fe});const pe=function(){return A===s.ITextFrame.HorizontalAlignment.CenterContinuous};f.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Le={alignment:{horizontal:pe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};B(this,Le)}).update({state:pe});const xe=function(){return A===s.ITextFrame.HorizontalAlignment.Fill};f.getCommand("formatAlignFillToggle").updateCallback(function(){const Le={alignment:{horizontal:xe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};B(this,Le)}).update({state:xe});const Oe=function(){return A===s.ITextFrame.HorizontalAlignment.Distributed};f.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){B(this,{alignment:{horizontal:Oe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const Ne=function(){return A===s.ITextFrame.HorizontalAlignment.Right};f.getCommand("formatAlignRightToggle").updateCallback(function(){B(this,{alignment:{horizontal:Ne()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:Ne});const We=function(){return A===s.ITextFrame.HorizontalAlignment.Justify};f.getCommand("formatAlignJustifyToggle").updateCallback(function(){B(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const je=!t.getProtection().isFormatCellsAllowed(),_e=A===s.ITextFrame.HorizontalAlignment.CenterContinuous||A===s.ITextFrame.HorizontalAlignment.Fill;f.getCommand("formatTextRotate0").updateCallback(function(Le){B(this,{alignment:{rotation:0}})}).update({disabled:je||_e,state:X===0}),f.getCommand("formatTextRotate45").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?45:0}})}).update({disabled:je||_e,state:X===45}),f.getCommand("formatTextRotate90").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?90:0}})}).update({disabled:je||_e,state:X===90}),f.getCommand("formatTextRotate270").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?270:0}})}).update({disabled:je||_e,state:X===270}),f.getCommand("formatTextRotate315").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?315:0}})}).update({disabled:je||_e,state:X===315}),f.getCommand("formatTextRotateCustom").updateCallback(function(Le){B(this,{alignment:{rotation:Le}})}).update({disabled:je||_e,state:X??0})},[ze,t,i,U,V]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=t.getSelectedRanges().getMerges().length>0,F=async(Ze,lt)=>{H(lt,async pt=>{const wt=async(gt=!1)=>{const it=await Promise.resolve(d?.showBusy?.(lt.label()));try{const Et=pt.getSelectedRanges();if(Et.merge({orientations:Ze,discardMultipleValues:gt}),Ze===s.IRange.Orientations.Both){const Bt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};Et.updateStyle(Bt)}}catch(Et){throw Et}finally{it?.()}};let vt;try{await wt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;vt=!0}if(vt&&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 wt(!0)}},void 0,void 0,!1)},p=Ze=>{H(Ze,async lt=>{try{const pt=lt.getSelectedRanges();pt.unmerge();const wt={alignment:{horizontal:null}};pt.updateStyle(wt)}catch(pt){throw pt}})};f.getCommand("mergeToggle").updateCallback(function(){ge.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(x?p(this):F(s.IRange.Orientations.Both,this))}).update({state:x,disabled:!De||g}),f.getCommand("mergeHorizontal").updateCallback(function(){F(s.IRange.Orientations.Column,this)}).update({disabled:!De||g}),f.getCommand("mergeVertical").updateCallback(function(){F(s.IRange.Orientations.Row,this)}).update({disabled:!De}),f.getCommand("unmerge").updateCallback(function(){p(this)}).update({disabled:!x||!De||g});const L={disabled:g};f.getCommand("hideRows").updateCallback(function(){H(this,Ze=>{Ze.getRowHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!0)})}).update(L),f.getCommand("hideColumns").updateCallback(function(){H(this,Ze=>{Ze.getColumnHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!0)})}).update(L),f.getCommand("unhideRows").updateCallback(function(){H(this,Ze=>{Ze.getRowHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!1)})}).update(L),f.getCommand("unhideColumns").updateCallback(function(){H(this,Ze=>{Ze.getColumnHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!1)})}).update(L),f.getCommand("autoFitRows").updateCallback(function(){H(this,Ze=>{Ze.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(L),f.getCommand("autoFitColumns").updateCallback(function(){H(this,Ze=>{Ze.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(L);let v=!1,P=0,Z=!1,ee=!1,ie=0,se=!1;!h||g||He||(v=h.isEntireColumnsAny(),v&&!h.isEntireColumns()?Z=!0:P=h.getColumnCount(),ee=h.isEntireRowsAny(),ee&&!h.isEntireRows()?se=!0:ie=h.getRowCount());const ce={disabled:g||h&&h.getCount()!==1};f.getCommand("sortAscending").update(ce),f.getCommand("sortDescending").update(ce);const we={disabled:v||ee||g||He},fe=v||g||He||se;fe&&(P=1);const pe=ee||g||He||Z;pe&&(ie=1);let xe="",Oe="",Ne="",We="",je="",_e="",Le="",Je="",at="";P>1&&(_e=Oe=P+" ",Le=Ne="s"),ie>1&&(Je=We=ie+" ",at=je="s"),w.getMode()?.key==="copy"?(xe=We=Oe="Copied ",Ne=je="s"):w.getMode()?.key==="cut"&&(xe=We=Oe="Cut ",Ne=je="s");let ft="",xt="";if(h){const Ze=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;ft=` (${Ze?"Shift Right":"Shift Down"})`,xt=` (${Ze?"Shift Left":"Shift up"})`,f.getCommand("deleteCells").update({label:`Delete Cells${xt}`})}f.getCommand("insertCells").update({label:`Insert ${xe}Cells${ft}`,scopedLabels:{insertCells:`${xe}At Selection`}}),f.getCommand("insertCellsShiftRight").update(we),f.getCommand("insertCellsShiftDown").update(we),f.getCommand("deleteCellsShiftUp").update(we),f.getCommand("deleteCellsShiftLeft").update(we),f.getCommand("insertRows").update({label:`Insert ${We}Row${je}`,scopedLabels:{insertCells:`${We}Row${je}`},disabled:pe}),f.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${je} Below`,disabled:pe}),f.getCommand("insertColumns").update({label:`Insert ${Oe}Column${Ne}`,scopedLabels:{insertCells:`${Oe}Column${Ne}`},disabled:fe}),f.getCommand("insertColumnsAfter").update({label:`Insert ${Oe}Column${Ne} After`,disabled:fe}),f.getCommand("deleteRows").update({label:`Delete ${Je}Row${at}`,scopedLabels:{deleteCells:`${Je}Row${at}`},disabled:pe}),f.getCommand("deleteColumns").update({label:`Delete ${_e}Column${Le}`,scopedLabels:{deleteCells:`${_e}Column${Le}`},disabled:fe})},[be,De,He,h,w,d,Se]),o.useEffect(()=>{const g=t.getProtection(),x=t.getProtection().isLocked(),F=!g.isFormatCellsAllowed(),p={disabled:F};f.getCommand("protectionSheetToggle").updateCallback(async(P,Z)=>{let ee=null;try{if(x){let ie=null;if(g.hasPassword()){const se=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(se.option!=="Unprotect")return;ie=se.input}ee=await Promise.resolve(d?.showBusy?.(Z.label())),await g.unlock(ie)}else ee=await Promise.resolve(d?.showBusy?.(Z.label())),await g.lock();ee?.()}catch(ie){ee?.(),d?.showError?.(ie)}}).update({state:x,label:()=>x?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:x?"Unprotect":"Protect"}}),f.getCommand("deleteTable").update(p),f.getCommand("sortAscending").update(p),f.getCommand("sortDescending").update(p),f.getCommand("sortCustom")?.update(p),f.getCommand("updateComments").update(p),f.getCommand("deleteComments").update(p),f.getCommand("insertChart")?.update(p),f.getCommand("insertImageFromFile").update(p),f.getCommand("insertImageFromURL").update(p),f.getCommand("formatBorder").update(p),f.getCommand("formatFillColor").update(p),f.getCommand("formatFontColor").update(p),f.getCommand("formatBoldToggle").update(p),f.getCommand("formatItalicToggle").update(p),f.getCommand("formatUnderlinedToggle").update(p),f.getCommand("formatStrikeThroughToggle").update(p),f.getCommand("formatSuperscriptToggle").update(p),f.getCommand("formatSubscriptToggle").update(p),f.getCommand("formatAlignTopToggle").update(p),f.getCommand("formatTextOverflowVisibleToggle").update(p),f.getCommand("formatTextOverflowWrapToggle").update(p),f.getCommand("formatTextOverflowClipToggle").update(p),f.getCommand("formatTextOverflowShrinkToggle").update(p),f.getCommand("formatAlignMiddleToggle").update(p),f.getCommand("formatAlignBottomToggle").update(p),f.getCommand("formatAlignDistributedVerticalToggle").update(p),f.getCommand("formatAlignJustifyVerticalToggle").update(p),f.getCommand("formatAlignLeftToggle").update(p),f.getCommand("formatAlignCenterToggle").update(p),f.getCommand("formatAlignRightToggle").update(p),f.getCommand("formatAlignJustifyToggle").update(p),f.getCommand("formatAlignCenterContinuousToggle").update(p),f.getCommand("formatAlignDistributedHorizontalToggle").update(p),f.getCommand("formatAlignFillToggle").update(p),f.getCommand("formatFontSizeIncrease").update(p),f.getCommand("formatFontSizeDecrease").update(p),f.getCommand("formatFontFamily").update(p),f.getCommand("formatFontSize").update(p),f.getCommand("formatNumberFormat").update(p),f.getCommand("formatNumberFormatGeneralStyle").update(p),f.getCommand("formatNumberFormatNumberStyle").update(p),f.getCommand("formatNumberFormatTimeStyle").update(p),f.getCommand("formatNumberFormatDateStyle").update(p),f.getCommand("formatNumberFormatAccountingStyle").update(p),f.getCommand("formatNumberFormatPercentStyle").update(p),f.getCommand("formatNumberFormatScientificStyle").update(p),f.getCommand("formatNumberFormatCommaStyle").update(p),f.getCommand("formatNumberFormatIncreaseDecimal").update(p),f.getCommand("formatNumberFormatDecreaseDecimal").update(p),f.getCommand("hideColumns").update(p),f.getCommand("unhideColumns").update(p),f.getCommand("hideRows").update(p),f.getCommand("unhideRows").update(p),f.getCommand("insertFunctionSum").update(p),f.getCommand("insertFunctionAverage").update(p),f.getCommand("insertFunctionCount").update(p),f.getCommand("insertFunctionMax").update(p),f.getCommand("insertFunctionMin").update(p),f.getCommand("insertFunction").update(p),f.getCommand("startEditCurrentTime").update(p),f.getCommand("startEditCurrentDate").update(p),f.getCommand("startEditValueAbove").update(p),f.getCommand("fillDown").update(p),f.getCommand("fillRight").update(p),f.getCommand("fillUp").update(p),f.getCommand("fillLeft").update(p),f.getCommand("formatCellStyle").update(p),f.getCommand("formatTableStyle").update(p),f.getCommand("formatPainterToggle").update(p),f.getCommand("formatBorderAddOutline").update(p),f.getCommand("formatBorderClearOutline").update(p),f.getCommand("formatIndentDecrease").update(p),f.getCommand("formatIndentIncrease").update(p),f.getCommand("clearContents").update(p),f.getCommand("clearFormats").update(p),f.getCommand("clearAll").update(p),f.getCommand("clearComments").update(p),f.getCommand("clearHyperlinks").update(p),f.getCommand("autoFilterClear").update(p),f.getCommand("autoFilterReapply").update(p);const L=A===s.ITextFrame.HorizontalAlignment.CenterContinuous||A===s.ITextFrame.HorizontalAlignment.Fill,v={disabled:F||L};f.getCommand("formatTextRotate0").update(v),f.getCommand("formatTextRotate45").update(v),f.getCommand("formatTextRotate90").update(v),f.getCommand("formatTextRotate270").update(v),f.getCommand("formatTextRotate315").update(v),f.getCommand("formatTextRotateCustom").update(v),f.getCommand("formatTextRotateVertical").update(v)},[be]),f}var Oo,jo;(function(){if(jo)return Oo;jo=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 cn=="object"&&cn&&cn.Object===Object&&cn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),b=Object.prototype.toString,u=Math.max,R=Math.min,h=function(){return m.Date.now()};function C(q){var E=typeof q;return!!q&&(E=="object"||E=="function")}function k(q){if(typeof q=="number")return q;if((function(G){return typeof G=="symbol"||(function(U){return!!U&&typeof U=="object"})(G)&&b.call(G)=="[object Symbol]"})(q))return NaN;if(C(q)){var E=typeof q.valueOf=="function"?q.valueOf():q;q=C(E)?E+"":E}if(typeof q!="string")return q===0?q:+q;q=q.replace(e,"");var D=n.test(q);return D||i.test(q)?a(q.slice(2),D?2:8):t.test(q)?NaN:+q}Oo=function(q,E,D){var G,U,T,V,y,w,S=0,j=!1,M=!1,I=!0;if(typeof q!="function")throw new TypeError("Expected a function");function $(oe){var N=G,z=U;return G=U=void 0,S=oe,V=q.apply(z,N)}function _(oe){var N=oe-w;return w===void 0||N>=E||N<0||M&&oe-S>=T}function H(){var oe=h();if(_(oe))return B(oe);y=setTimeout(H,(function(N){var z=E-(N-w);return M?R(z,T-(N-S)):z})(oe))}function B(oe){return y=void 0,I&&G?$(oe):(G=U=void 0,V)}function K(){var oe=h(),N=_(oe);if(G=arguments,U=this,w=oe,N){if(y===void 0)return(function(z){return S=z,y=setTimeout(H,E),j?$(z):V})(w);if(M)return y=setTimeout(H,E),$(w)}return y===void 0&&(y=setTimeout(H,E)),V}return E=k(E)||0,C(D)&&(j=!!D.leading,T=(M="maxWait"in D)?u(k(D.maxWait)||0,E):T,I="trailing"in D?!!D.trailing:I),K.cancel=function(){y!==void 0&&clearTimeout(y),S=0,G=w=U=y=void 0},K.flush=function(){return y===void 0?V:B(h())},K}})();var Bo,Vo,Po={exports:{}},lo={};Vo||(Vo=1,Po.exports=(function(){if(Bo)return lo;Bo=1;var e=o,t=typeof Object.is=="function"?Object.is:function(b,u){return b===u&&(b!==0||1/b==1/u)||b!=b&&u!=u},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(b){var u=b.getSnapshot;b=b.value;try{var R=u();return!t(b,R)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(b,u){return u()}:function(b,u){var R=u(),h=n({inst:{value:R,getSnapshot:u}}),C=h[0].inst,k=h[1];return a(function(){C.value=R,C.getSnapshot=u,d(C)&&k({inst:C})},[b,R,u]),i(function(){return d(C)&&k({inst:C}),b(function(){d(C)&&k({inst:C})})},[b]),l(R),R};return lo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,lo})()),Po.exports;var Ho,Uo,an={exports:{}},Gt={exports:{}},Nl=Gt.exports;function Ko(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Uo)return an.exports;Uo=1;for(var e=(Ho||(Ho=1,function(){var h,C,k,q,E,D;typeof performance<"u"&&performance!==null&&performance.now?Gt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Gt.exports=function(){return(h()-E)/1e6},C=process.hrtime,q=(h=function(){var G;return 1e9*(G=C())[0]+G[1]})(),D=1e9*process.uptime(),E=q-D):Date.now?(Gt.exports=function(){return Date.now()-k},k=Date.now()):(Gt.exports=function(){return new Date().getTime()-k},k=new Date().getTime())}.call(Nl)),Gt.exports),t=typeof window>"u"?cn: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,b=0,u=[],R=1e3/60;a=function(h){if(u.length===0){var C=e(),k=Math.max(0,R-(C-m));m=k+C,setTimeout(function(){var q=u.slice(0);u.length=0;for(var E=0;E<q.length;E++)if(!q[E].cancelled)try{q[E].callback(m)}catch(D){setTimeout(function(){throw D},0)}},Math.round(k))}return u.push({handle:++b,callback:h,cancelled:!1}),b},l=function(h){for(var C=0;C<u.length;C++)u[C].handle===h&&(u[C].cancelled=!0)}}an.exports=function(h){return a.call(t,h)},an.exports.cancel=function(){l.apply(t,arguments)},an.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},an.exports})();const wo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:b=!1,offset:u=0,totalSize:R=0,viewportSize:h=0,...C}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[k]=Ot(),q=r.useCallbackRef(l,[l]),E=r.useCallbackRef(d,[d]),D=(G=k,U=t,o.useMemo(()=>G===null&&U===null?null:ue=>{Ko(G,ue),Ko(U,ue)},[G,U]));var G,U;const[T,V]=o.useState(()=>{const ue=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?ue.top:ue.left}),y=()=>{const ue=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?ue.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(ue.coords.rowIndex)-ue.topLeft.top,scroll:ue.topLeft.top}:ue.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(ue.coords.colIndex)-ue.topLeft.left,scroll:ue.topLeft.left}},[w,S]=o.useState(y),[j,M]=o.useState(null),[I,$]=o.useState(!1),_=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),H=()=>{const ue=a.getUsedRange()?.getCoords()??ge.CoordUtils.EmptyRange,ke=a.getSelection().getCoords().cell;return{colIndex:Math.max(ue.colEnd,ke.colIndex),rowIndex:Math.max(ue.rowEnd,ke.rowIndex)}},[B,K]=o.useState(H),oe=B?(i===r.ScrollbarOrientation.Vertical?B.rowIndex:B.colIndex)+1:0,N=()=>{const ue=H();ge.CoordUtils.isEqualCells(B,ue)||K(ue)};et(a.getView(),{onFreezeSplitChange:()=>{S(y)}}),et(a.getSelection(),{onChange:N}),et(a,{onUsedRangeChange:N}),o.useEffect(()=>{K(H())},[a]),o.useEffect(()=>{if(!j)return I&&E?.(),void $(!1);const ue=_.getTextAt(_.findIndex(T/(a.getView().getZoomScale()/100)+w.scroll+w.shift));$(!0),q?.({...j,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+ue})},[u,T,w,i,j,_,I,a]);const z=r.useCallbackRef((ue,ke,Ke)=>{V(ue);const Ue=ue+w.scroll,Te=ke+w.shift,he=Ke+w.shift+w.scroll;m?.(Ue,Te,he)},[m,w]),ae=u-w.scroll,ve=h-w.shift,Ve=R-(w.shift+w.scroll),qe=_.findOffset(oe)*(a.getView().getZoomScale()/100)-(w.scroll+w.shift);return c.jsx(r.VirtualScrollbar,{ref:D,style:n,offset:ae,viewportSize:ve,totalSize:Ve,orientation:i,showCustomScrollButtons:b,onMouseDown:ue=>{M({anchor:{x:ue.clientX,y:ue.clientY}}),ue.preventDefault()},onScrollOffset:z,onMouseOut:()=>{M(null)},onMouseUp:()=>{M(null)},minSize:qe,...C})}));wo.displayName="SheetScrollbar";const $o=(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},Wo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:b,headerText:u,freezeStart:R,gridStyle:h,verticalPadding:C,horizontalPadding:k,onSheetContextMenu:q,onResizeHeadersStart:E,onResizeHeaders:D,onResizeHeadersEnd:G,onResizeHeadersDown:U,onResizeHeadersUp:T,scrollPoint:V,onSelectionStart:y,onSelectionEnd:w}=e,S=o.useMemo(()=>n.getOrientation(),[n]),j=o.useRef(null),[M,I]=o.useReducer(O=>O+1,0),[$,_]=o.useReducer(O=>O+1,0),H=n?.getSheet(),B=o.useRef(!1);o.useLayoutEffect(()=>{B.current=!0},[n]);const K=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),oe=o.useMemo(()=>{const O=S===s.IRange.Orientation.Column;return{left:O?V.left:0,top:O?0:V.top}},[V]),[N,z]=o.useState(H?.getView().getZoomScale()/100),[ae,ve]=o.useState(null);et(n,{onSizesChange:O=>{z(H?.getView().getZoomScale()/100),Se(le())}});const Ve=o.useCallback(()=>{j.current?.invalidate(),_()},[]),qe=o.useCallback(ge.CommonUtils.debounce(()=>{Ve()},10),[]),[ue,ke]=o.useState(null);et(n.getSheet(),{onSelectionChange(){ke(H?.getSelection().getCoords()),qe()},onProtectionChange(){Ve()},onViewChange(){qe()}}),o.useLayoutEffect(()=>{Se(le())},[S,N,d]),o.useLayoutEffect(()=>{ve(null),z(n?.getSheet().getView().getZoomScale()/100),Se(le())},[n]);const Ke=o.useCallback(O=>n.at(O)?.isHidden()||n.at(O)?.getSize()===0,[n]),Ue=o.useCallback((O,X)=>n.hiddenHeadersAt(O,X),[Ke]),Te=r.useCallbackRef(O=>n.isSelected(O),[n]),he=r.useCallbackRef(O=>n.isSelectedAll(O),[n]),W=o.useCallback(()=>n.getMinSize(),[n]),Fe=o.useCallback(()=>n.getMaxSize(),[n]),Ce=r.useCallbackRef((O,X,g)=>{X/=N;const x={size:X=Math.max(W(),Math.min(ge.CommonUtils.roundAccurately(X,W()),Fe())),hidden:!1},F=[];if(X<=0&&(x.hidden=!0,x.size=g),F.push({address:{min:O,max:O},update:x}),X<0){const p=S===s.IRange.Orientation.Column,L=p?me.getColOffset:me.getRowOffset,v=p?me.getColIndex:me.getRowIndex,P=L(O);let Z=v(P+X);const ee=L(Z);ee===P+X?Z--:F.push({address:{min:Z,max:Z},update:{size:P-ee+X}}),O-Z>1&&F.push({address:{min:Z+1,max:O-1},update:{hidden:!0}})}n.updateHeaderPairs(F),D?.(O,X,g)},[M,n,N,D]),Y=r.useCallbackRef((O,X,g)=>{const x=S===s.IRange.Orientation.Column;let F=null,p={min:O,max:O};if(n.isSelectedAll(O)){const L=n.getSelectedRuns();L.length>1?F="Resize "+(x?"Columns":"Rows"):p=L[0];const v={hidden:X<=0,size:(X<=0?g:X)/N};n.updateHeaderPairs($o(L,v,O))}if(p){const L=p.max-p.min+1;let v;v=L===1?n.getRange(p).at(0).getDisplayText():n.getRange(p).toString(),F=`Resize ${x?"Column":"Row"}${L>1?"s":""} '${v}'`}G?.(O,X,F)},[M,n,G]),J=r.useCallbackRef((O,X)=>{const g=S===s.IRange.Orientation.Column;E(O,X,`Resize ${g?"Column":"Row"}(s)`)},[E]),ne=r.useCallbackRef(O=>{let X=!1;const g=S===s.IRange.Orientation.Column,x=n.getSheet().getEntireRange().getCoords(),F=[],p=n.getSelectedRuns(),L=v=>{let P;P=g?{colStart:v.min,rowStart:x.rowStart,colEnd:v.max,rowEnd:x.rowEnd}:{colStart:x.colStart,rowStart:v.min,colEnd:x.colEnd,rowEnd:v.max},F.push(P)};for(let v=0;v<p.length;v++){const P=p[v];P.value.isSelectedAll&&(P.min<=O&&P.max>=O&&(X=!0),L(P))}if(X||L({min:O,max:O}),n.getSheet().getRanges(F).autoFit({orientations:g?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),Ke(O)){const v={hidden:null},P=$o(p,v);X||P.push({address:O,update:v}),n.updateHeaderPairs(P)}G?.(O,null,"Resize Column(s)")},[M,n,G,Ke]),le=()=>{const O=S===s.IRange.Orientation.Column;return{getColOffset:X=>O?n.findOffset(X):X===0?0:d/N,getColIndex:X=>O?n.findIndex(X):0,getRowOffset:X=>O?X===0?0:d/N:n.findOffset(X),getRowIndex:X=>O?0:n.findIndex(X)}},[me,Se]=o.useState(()=>le()),de=o.useCallback((O,X)=>O.nativeEvent.which!==r.MouseButtonCodes.Right||!he(S===s.IRange.Orientation.Column?X.colIndex:X.rowIndex),[S,he]),be=r.useCallbackRef(O=>{a.focusSheet()},[a]),Me=r.useCallbackRef(O=>{H?.getSelection().updateCoords(O)},[H]),{...Ee}=dt.useSelection({gridRef:i,commands:null,layout:me,selection:ue,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Me,canSelectionSpanMergedCells:O=>{const X=H.getRange(O);return X.isEntireColumns()||X.isEntireRows()}}),f=r.useCallbackRef(()=>{y?.();const O=H?.getSelection();O&&O.setAdjusting(O.getCoords())},[H,y]),De=r.useCallbackRef(async()=>{H?.getSelection().setAdjusting(null),w?.()},[H,w]),{...Ye}=dt.useHeaderSelection({orientation:S,headerCount:K,gridRef:j,gridMainRef:i,newSelection:Ee?.newSelection,modifySelection:Ee?.modifySelection,appendSelection:Ee?.appendSelection,clearSelections:Ee?.clearSelections,pointerDownInterceptor:de,onPointerUp:be,onDragStart:f,onDragEnd:De}),He=h.selection?.strokeFill;o.useEffect(()=>{if(!j.current)return void ve(null);const O=S===s.IRange.Orientation.Column,X=n.getSelectedRuns(),g=n.isProtected()?null:Ce,x=(p,L,v)=>{if(v)return O?c.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${He}`,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"}},p):c.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${He}`,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`}},p)},F=(p,L,v)=>{const P={x:0,y:0,width:0,height:0};if(O){const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:p,colEnd:Math.min(K,L)}),dt.SELECTION_CLIP_INSETS);if(!Z)return;P.x=Z.x,P.width=Z.width}else{const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:p,rowEnd:Math.min(K,L),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!Z)return;P.y=Z.y,P.height=Z.height}return{x:P.x,y:P.y,width:P.width,height:P.height}};ve([p=>{const L=[];let v=null,P=O?p.getVisibleColumns():p.getVisibleRows();const Z=O?p.getTotalRangeCoords().colStart:p.getTotalRangeCoords().rowStart;P.length>0&&P[0]>Z&&(P=[P[0]-1,...P]);let ee=[];const ie=[];for(let pe=0;pe<P.length;pe++){const xe=P[pe],Oe=pe<P.length-1?P[pe+1]:xe+Ue(xe+1,!1)+1,Ne=xe+1!==Oe;if(!v||v.max<xe)if(X.length>0&&X[X.length-1].max>=xe){const _e=ge.CommonUtils.findEqualOrGreater(X,xe,Le=>Le.max);v=X[_e]}else v=null;let We=!1,je=!1;if(v?.value&&(v.min<=xe||v.min<=Oe&&!Ne)&&(We=!0,je=v.value.isSelectedAll),xe===Z){let _e=!1,Le=!1;v?.value&&v.min<=xe&&(_e=!0,Le=v.value.isSelectedAll),xe>0&&ie.push({index:xe-1,isNextHidden:Ne,isSelected:_e,isSelectedAll:Le,disabledResize:!0})}if(je&&ee.push(ie.length),ie.push({index:xe,isHidden:pe===0&&Ue(xe,!1)>0,isNextHidden:Ne,isSelected:We,isSelectedAll:je,onDividerMouseDown:U,onDividerResizeStart:J,onDividerResize:g,onDividerMouseUp:T,onDividerResizeEnd:Y,onDividerAutoFit:ne}),Ne){let _e=!1,Le=!1;if(v&&v.min>=xe&&v.max<=Oe-1&&v.value.isSelectedAll&&ee.push(ie.length),!(v?.value&&v.max>=Oe))if(X.length>0&&X[X.length-1].max>=Oe){const Je=ge.CommonUtils.findEqualOrGreater(X,Oe,at=>at.max);v=X[Je]}else v=null;v?.value&&v.min<=Oe&&(_e=v.value.isSelected,Le=v.value.isSelectedAll),Oe>0&&ie.push({index:Oe-1,isHidden:!0,isSelected:_e,isSelectedAll:Le,onDividerMouseDown:U,onDividerResizeStart:J,onDividerResize:g,onDividerMouseUp:T,onDividerResizeEnd:Y,onDividerAutoFit:ne})}}if(ee.length>0){let pe=ee.length-1;if(ee.length>0){const Ne=ie[ee[pe]].index;let We=null;O?(We=p.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Ne,colEnd:Ne}),We.x+We.width>p.getBounds().width&&(pe-=1,pe===0&&(pe=-1))):(We=p.getRangeCoordsBounds({rowStart:Ne,rowEnd:Ne,colStart:0,colEnd:0}),We.y+We.height>p.getBounds().height&&(pe-=1,pe===0&&(pe=-1)))}const xe=X?.[X.length-1],Oe=p.getAnchor();if(Oe==="t"||Oe==="l"){const Ne=ie[ee[Math.max(0,ee.length-1)]];Ne.showTouchDivider=xe&&xe.max<=Ne.index}else pe>=0&&(ie[ee[pe]].showTouchDivider=!0)}const{header:se,headerSelect:ce,headerSelectAll:we,headerHover:fe}=h??{};for(let pe=0;pe<ie.length;pe++)L.push(c.jsx(dt.HeaderDivider,{orientation:S,view:p,headerStyle:se,headerStyleSelect:ce,headerStyleSelectAll:we,headerStyleHover:fe,disabled:n.isProtected(),...ie[pe]},`divider${pe}`));return L},p=>{const L=[];for(let v=0;X&&v<X.length;v++)L.push(x(`selection:${p.getAnchor()}:${v}`,0,F(X[v].min,X[v].max,p)));return L}])},[$,!0,He,h,me,K,R,M,N]),o.useEffect(()=>{j.current?.invalidate()},[M]);const $e=r.useCallbackRef(O=>u?u(O):n.getTextAt(O),[u,n]),re=r.useCallbackRef(O=>{const{header:X,headerSelect:g,headerSelectAll:x,headerHover:F}=h??{},{range:p,key:L,...v}=O;return c.jsx(dt.HeaderRenderer,{orientation:S,index:S===s.IRange.Orientation.Column?p.colStart:p.rowStart,isSelected:Te,isSelectedAll:he,zoomScale:100*N,headerText:$e,headerStyle:X,headerStyleSelect:g,headerStyleSelectAll:x,headerStyleHover:F,verticalPadding:C,horizontalPadding:k,...v},L)},[M,K,h,N,n]),Re=r.useEditMode(),ze=o.useMemo(()=>{const O="white",X="black",g={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let x=S===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='${X}' 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='${X}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Re.getMode()?.key==="formatPainter"&&(x=`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='${X}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),g.cursor=x}return g.backgroundColor=h?.header?.fill||"transparent",g},[S,M,Re,h]),ye=r.useImperativeElement(t,()=>({scrollTo:O=>{j.current?.scrollTo(O)},forceRender:()=>{I()},getGridElement:()=>j.current}),[]),Ae=o.useCallback(O=>{Ye.onPointerDown(O)},[Ye]),A=o.useCallback(O=>{const X=Ye.getCellCoordsFromClient(O.clientX,O.clientY);if(!X||!q)return;const g=S===s.IRange.Orientation.Column;q({originalEvent:O,clientX:O.clientX,clientY:O.clientY,rowIndex:g?-1:X.rowIndex,colIndex:g?X.colIndex:-1}),O.stopPropagation(),O.preventDefault()},[Ye,q]),Q=o.useMemo(()=>{const O=S===s.IRange.Orientation.Column;return c.jsx("div",{ref:ye,children:c.jsx(dt.Grid,{className:"sheet-header",style:ze,ref:j,scrollPoint:oe,columnCount:O?K:1,rowCount:O?1:K,width:O?m:d,height:O?d:b,freezeLeft:O?R:void 0,freezeTop:O?void 0:R,hiddenColumnsAt:O?Ue:void 0,hiddenRowsAt:O?void 0:Ue,showGridLines:!1,layout:me,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:A,onPointerDown:Ae,zoom:N,cellRenderer:re,overlays:ae})})},[ae,me,m,b,oe,ze,$]);return o.useEffect(()=>{B.current=!1,j.current?.invalidate(),_()},[n,h]),Q})),Ll=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((u,R)=>u.getStyle().getBorder(),[]),{overlay:m}=yo({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),b=m(n);return b&&n?b:null})),Ol={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},jl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Bl={type:s.ICell.Content.Values},Vl={fitDestination:!0,type:s.ICell.Content.Formats},Pl={fitDestination:!0,type:s.ICell.Content.Formulas},Hl={transpose:!0},Ul={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},Ir=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:b="rgb(33, 115, 70)",copyBackgroundColor:u="white",cutBackgroundColor:R="white",notifier:h,...C})=>{const k=r.useCallbackRef(d,[d]),q=o.useRef(null),E=r.useEditMode(),D=E.getMode(),G=o.useMemo(()=>({element:e,doCopy:w=>{const S=t.getSelectedRanges().getSnapshot(w);return new s.RangeClipboardItem(S)}}),[t,n,e]),U=o.useMemo(()=>({element:e,importFromExternal:async(w,S)=>{const j=new s.ExternalRangeClipboardItem(w,S,t.getStyles(),t.isDate1904());return await j.parse()?j:null},doPaste:async(w,S)=>{if(w?.getItemType()!=="range")return;S?.contentsOnly&&delete(S={...S,type:s.ICell.Content.Values}).contentsOnly;const j=t.getSelectedRange(),M=w.getItem(),I=M.getName();return await j.doBatch(async()=>{const $=await j.copyFrom(M,S);!$||$.isEntireRows()||$.isEntireColumns()||$.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(I?` ${I}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:T,...V}=r.useCopyPaste({...C,source:G,commands:i,target:U,notifier:h,onClipboardUpdate:w=>{const S=w?.getItemType()==="range"?w:null;if(S){const j=w.editMode?.(),M={...w?.isCut?.()?jl:Ol,...j,args:{isClipboard:!0,...j?.args},onModeChange:I=>{I?.args?.isClipboard||T.clear(!0),j?.onModeChange?.(I)}};E.setMode(M)}q.current=S,a?.(S)},onPaste:(w,S)=>{if(w?.getItemType()!=="range")return;let j=E.getMode()?.key==="cut"||w.isCut?.();if(!j&&E.getMode()?.key==="copy"){const M=w.getItem().getCoords(),I=t.getSelectedRanges().getCoords();let $=!1;if(!$&&M&&I&&w.getItem().getSource?.()===t)for(let _=0;!$&&_<I.length;_++)$=ge.CoordUtils.isRangesIntersect(M,I[_]);j=$}j&&E.setMode(null),e?.()?.focus(),l?.(w,S)}});o.useMemo(()=>{const w=e;if(!i)return;const S=[new r.Command("pasteValues",w,{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."})],[]),f=o.useMemo(()=>{let g=null;return g=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),g.addCommands(Ee,!0),g},[a,Ee]),[De,Ye]=o.useState(!1),[He,$e]=o.useState(!1);o.useEffect(()=>{if(k.current!==t||!h)return;const g=h.getCoords(),x=t.getTables().getItems({address:g[0]});M(P=>ge.CommonUtils.isEqualArrays(P,x)?P:x),u&&x[0]&&ge.CoordUtils.isCellWithinRange(u,x[0].getRange().getCoords())?ve(x[0]??null):ve(null);const F=t.getSelectedRanges(),p=F.getMerges().length>0,L=F.isOverlapping();let v=!0;for(let P=0;v&&P<g.length;P++)v=ge.CoordUtils.isSingleCell(g[P]);$e(L),Ye(x.length===0&&!L&&(p||!v))},[be,h,t]),r.useCommands(a,null,{onChange:()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=w.getMode()?.key==="formatPainter";f.getCommand("formatPainterToggle").update({disabled:g||!a?.getCommand("copy"),state:()=>x}).updateCallback(()=>x?void w.setMode(null):f.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,ye,a]),et(t.getView(),{onFreezeSplitChange:()=>{Re()}}),et(t.getSelection(),{onChange:()=>{$()}});const oe=()=>{f.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:g=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),f.getCommand("formatSheetTabColor").updateCallback(g=>{t.setTabColor(g)}).update({state:()=>t?.getTabColor()??In,context:()=>({onColorSelect:g=>{},darkMode:i.darkMode,autoColor:In,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:g=>t.getStyles().addRecentColor(g),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},ke=()=>{f.getCommand("formatBorder").update({context:()=>({onBorderSelect:g=>{G(g)},darkMode:i.darkMode,quickBorder:D,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:g=>t.getStyles().getNormal().createTemporaryStyle({border:g}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{ke()},[D]),o.useEffect(()=>{const g=!t.getProtection().isInsertHyperlinksAllowed();f.getCommand("openHyperlink").update({disabled:!_().getHyperlink()}),f.getCommand("deleteHyperlink").update({disabled:g||!_().getHyperlink()});const x=_().getHyperlink()?"Edit":"Insert",F="Link";f.getCommand("updateHyperlink").update({label:()=>(_().getHyperlink(),`${x} ${F}`),scopedLabels:{contextMenu:`${x} ${F}…`,insert:`${F}…`,hyperlink:`${x}…`},disabled:g})},[_()?.getHyperlink(),ye]),o.useEffect(()=>{const g=_().getComments(),x=()=>g?"Edit":"Insert",F=()=>g?"Comments":"Comment";f.getCommand("updateComments").update({label:()=>`${x()} ${F()}`,scopedLabels:{contextMenu:`${x()} ${F()}…`,insert:`${F()}…`}})},[_()?.getComments(),ye]),et(t,{onViewChange:()=>{const g=t.getView();f.getCommand("sheetViewToggleFormulaView").update({state:g.isShowFormulas()}),f.getCommand("sheetViewToggleShowZeros").update({state:g.isShowZeros()}),f.getCommand("gridlinesToggle").update({state:g.isShowColumnGridlines()||g.isShowRowGridlines()}),f.getCommand("sheetViewToggleGridlinesColumns").update({state:g.isShowColumnGridlines()}),f.getCommand("sheetViewToggleGridlinesRows").update({state:g.isShowRowGridlines()}),f.getCommand("sheetViewToggleShowHeadings").update({state:g.isShowColumnHeaders()||g.isShowRowHeaders()}),f.getCommand("sheetViewToggleShowHeadingColumns").update({state:g.isShowColumnHeaders()}),f.getCommand("sheetViewToggleShowHeadingRows").update({state:g.isShowRowHeaders()}),f.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),oe()},onTabColorChange:()=>{oe()},onMergesChange:()=>{Re()},onMovablesChange:()=>{Re()},onTablesChange:()=>{Re()},onProtectionChange:()=>{Re(),ae()},onStyleChange:()=>{oe(),ke(),Re()}}),o.useEffect(()=>{oe(),ke()},[i]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=j.length>0&&!se||g,F=Ue(se),p={context:F};f.getCommand("editTable").update(p),f.getCommand("deleteTable").update(p),f.getCommand("convertTableToRange").update(p);const L={context:F,disabled:x};f.getCommand("formatTableStyle").update({label:se?"Apply Table Style":"Format As Table",...L}),f.getCommand("formatTableStyleClearCellStyles").update(L),f.getCommand("deleteTableStyle").update(L),f.getCommand("convertTableToRange").update(L),f.getCommand("insertTable").update({disabled:x||j.length>0});const v={context:F,disabled:x||j.length===0};f.getCommand("tableHeaderRowToggle").update(v),f.getCommand("tableTotalRowToggle").update(v),f.getCommand("autoFilterToggle").update(v),f.getCommand("formatTableStyleClearTableStyle").update({...v,disabled:v.disabled||!se||se.getStyleOptions().name===null})},[se,j,ye]),o.useEffect(()=>{f.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),f.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale())})}),f.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),f.getCommand("gridlinesToggle").updateCallback(()=>{const g=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!g,showRowGridlines:!g})}),f.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),f.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),f.getCommand("sheetViewFormatGridlinesColor").updateCallback(g=>{t.getView().update({gridLineColor:g})}),f.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const g=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!g,showRowHeaders:!g})}),f.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),f.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),f.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const g=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:g?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:g?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),f.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),f.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),f.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),f.getCommand("insertFunction").update({context:()=>({searchByCategory:async g=>{const x=t.getWorkbook();if(!x)return ge.CommonUtils.EmptyArray;const F=await x.getScripts().searchFunctions({category:g,includeBuiltIn:!0});return F.sort((p,L)=>p.getName().localeCompare(L.getName())),F}})})},[t]),o.useEffect(()=>{const g=t.getView().getFreezePanes(),x=()=>g.coords.rowIndex!==0,F=()=>g.coords.colIndex!==0,p=()=>g.coords.rowIndex!==0||g.coords.colIndex!==0;f.getCommand("freezeToggle").updateCallback(()=>{p()?t.getView().setFreezePanes(null):p()?F()?t.getView().setFreezePanes({coords:{rowIndex:u.rowIndex}}):x()&&t.getView().setFreezePanes({coords:{colIndex:u.colIndex}}):t.getView().setFreezePanes({coords:u})}).update({state:p,disabled:()=>!u||!p()&&u.rowIndex===0&&u.colIndex===0}),f.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:x()?0:u.rowIndex}})}).update({state:x,disabled:()=>!u||!x()&&u.rowIndex===0}),f.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:F()?0:u.colIndex}})}).update({state:F,disabled:()=>!u||!F()&&u.colIndex===0}),f.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!p()})},[be,u,t,i]);const ze=_().getStyle(),we=ze.getFont(),Ae=ze.getAlignment(),A=Ae.getHorizontal(),Q=Ae.getVertical(),O=Ae.getOverflow(),X=Ae.getRotation();return o.useEffect(()=>{f.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>_().getStyle(!0).getNamed(),bodyStyle:Ke,createTemporaryCell:Le=>t.createTemporaryCell(Le)})}),f.getCommand("formatFillColor").update({state:()=>{let Le=null;const Je=ze.getFill();return Je?.getType()===s.IFill.Type.Solid?Le=Je.getColor():Je?.getType()===s.IFill.Type.Gradient?Le=Je.getStops()?.[0]?.getColor():Je?.getType()===s.IFill.Type.Pattern&&(Le=Je.getBackground()),Le},context:()=>{const Le=t.getStyles();return{onColorSelect:Je=>{T(Je??In)},darkMode:i.darkMode,quickColor:U,autoColor:In,schemeLookup:Le.schemeLookup(),recentColors:Le.recentColors(),addRecentColor:Je=>Le.addRecentColor(Je),clearRecentColors:()=>Le.clearRecentColors()}}}),f.getCommand("formatFontColor").update({state:()=>we.toJSON()?.fill?we.getFill():null,context:()=>{const Le=t.getStyles();return{onColorSelect:Je=>{y(Je)},darkMode:i.darkMode,quickColor:V,autoColor:Le.getNormal().getFont().getFill(),schemeLookup:Le.schemeLookup(),recentColors:Le.recentColors(),addRecentColor:Je=>Le.addRecentColor(Je),clearRecentColors:()=>Le.clearRecentColors()}}}),f.getCommand("formatNumberFormat").update({state:()=>ze.getNumberFormat(),context:()=>_}),f.getCommand("formatNumberDialog").update({state:()=>ze.getNumberFormat(),context:()=>_}),f.getCommand("formatFontFamily").update({state:()=>we.getFamily()}),f.getCommand("formatFontSize").update({state:()=>we.getSize()});const g=function(){const Le=we.getWeight()||0;return!isNaN(Le)&&Le>500};f.getCommand("formatBoldToggle").updateCallback(function(){B(this,{font:{weight:g()?400:700}})}).update({state:g});const x=function(){return we.getStyle()===s.IFont.Style.Italic};f.getCommand("formatItalicToggle").updateCallback(function(){B(this,{font:{style:x()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:x}),f.getCommand("formatStrikeThroughToggle").updateCallback(function(){B(this,{font:{strike:!we.getStrike()}})}).update({state:we.getStrike()}),f.getCommand("formatUnderlinedToggle").updateCallback(function(){B(this,{font:{underline:we.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:we.getUnderline()===s.IFont.UnderlineStyle.Single}),f.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){B(this,{font:{underline:we.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:we.getUnderline()===s.IFont.UnderlineStyle.Double}),f.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){B(this,{font:{underline:we.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:we.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),f.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){B(this,{font:{underline:we.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:we.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),f.getCommand("formatSuperscriptToggle").updateCallback(function(){B(this,{font:{verticalAlign:we.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:we.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),f.getCommand("formatSubscriptToggle").updateCallback(function(){B(this,{font:{verticalAlign:we.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:we.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const F=()=>O===s.ITextFrame.Overflow.Visible;f.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){B(this,{alignment:{overflow:(F(),s.ITextFrame.Overflow.Visible)}})}).update({state:F});const p=()=>O===s.ITextFrame.Overflow.Wrap;f.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){B(this,{alignment:{overflow:p()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:p});const L=function(){return O===s.ITextFrame.Overflow.Clip};f.getCommand("formatTextOverflowClipToggle").updateCallback(function(){B(this,{alignment:{overflow:L()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:L});const v=function(){return O===s.ITextFrame.Overflow.Shrink};f.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){B(this,{alignment:{overflow:v()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:v});const P=function(){return O===s.ITextFrame.Overflow.Shrink};f.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){B(this,{alignment:{overflow:P()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:P,disabled:!0});const Z=function(){return Q===s.ITextFrame.VerticalAlignment.Top};f.getCommand("formatAlignTopToggle").updateCallback(function(){B(this,{alignment:{vertical:Z()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:Z});const ee=function(){return Q===s.ITextFrame.VerticalAlignment.Center};f.getCommand("formatAlignMiddleToggle").updateCallback(function(){B(this,{alignment:{vertical:ee()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:ee});const ie=function(){return Q===s.ITextFrame.VerticalAlignment.Bottom};f.getCommand("formatAlignBottomToggle").updateCallback(function(){B(this,{alignment:{vertical:(ie(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ie});const de=function(){return Q===s.ITextFrame.VerticalAlignment.Justify};f.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){B(this,{alignment:{vertical:de()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:de});const ce=function(){return Q===s.ITextFrame.VerticalAlignment.Distributed};f.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){B(this,{alignment:{vertical:ce()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ce});const xe=function(){return A===s.ITextFrame.HorizontalAlignment.Left};f.getCommand("formatAlignLeftToggle").updateCallback(function(){B(this,{alignment:{horizontal:xe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:xe});const fe=function(){return A===s.ITextFrame.HorizontalAlignment.Center};f.getCommand("formatAlignCenterToggle").updateCallback(function(){B(this,{alignment:{horizontal:fe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:fe});const pe=function(){return A===s.ITextFrame.HorizontalAlignment.CenterContinuous};f.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Le={alignment:{horizontal:pe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};B(this,Le)}).update({state:pe});const qe=function(){return A===s.ITextFrame.HorizontalAlignment.Fill};f.getCommand("formatAlignFillToggle").updateCallback(function(){const Le={alignment:{horizontal:qe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};B(this,Le)}).update({state:qe});const Oe=function(){return A===s.ITextFrame.HorizontalAlignment.Distributed};f.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){B(this,{alignment:{horizontal:Oe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const Ne=function(){return A===s.ITextFrame.HorizontalAlignment.Right};f.getCommand("formatAlignRightToggle").updateCallback(function(){B(this,{alignment:{horizontal:Ne()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:Ne});const We=function(){return A===s.ITextFrame.HorizontalAlignment.Justify};f.getCommand("formatAlignJustifyToggle").updateCallback(function(){B(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const je=!t.getProtection().isFormatCellsAllowed(),_e=A===s.ITextFrame.HorizontalAlignment.CenterContinuous||A===s.ITextFrame.HorizontalAlignment.Fill;f.getCommand("formatTextRotate0").updateCallback(function(Le){B(this,{alignment:{rotation:0}})}).update({disabled:je||_e,state:X===0}),f.getCommand("formatTextRotate45").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?45:0}})}).update({disabled:je||_e,state:X===45}),f.getCommand("formatTextRotate90").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?90:0}})}).update({disabled:je||_e,state:X===90}),f.getCommand("formatTextRotate270").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?270:0}})}).update({disabled:je||_e,state:X===270}),f.getCommand("formatTextRotate315").updateCallback(function(Le){B(this,{alignment:{rotation:Le??1?315:0}})}).update({disabled:je||_e,state:X===315}),f.getCommand("formatTextRotateCustom").updateCallback(function(Le){B(this,{alignment:{rotation:Le}})}).update({disabled:je||_e,state:X??0})},[ze,t,i,U,V]),o.useEffect(()=>{const g=!t.getProtection().isFormatCellsAllowed(),x=t.getSelectedRanges().getMerges().length>0,F=async(Ze,lt)=>{H(lt,async pt=>{const wt=async(gt=!1)=>{const it=await Promise.resolve(d?.showBusy?.(lt.label()));try{const Et=pt.getSelectedRanges();if(Et.merge({orientations:Ze,discardMultipleValues:gt}),Ze===s.IRange.Orientations.Both){const Bt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};Et.getStyle().update(Bt)}}catch(Et){throw Et}finally{it?.()}};let vt;try{await wt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;vt=!0}if(vt&&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 wt(!0)}},void 0,void 0,!1)},p=Ze=>{H(Ze,async lt=>{try{const pt=lt.getSelectedRanges();pt.unmerge();const wt={alignment:{horizontal:null}};pt.getStyle().update(wt)}catch(pt){throw pt}})};f.getCommand("mergeToggle").updateCallback(function(){ge.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(x?p(this):F(s.IRange.Orientations.Both,this))}).update({state:x,disabled:!De||g}),f.getCommand("mergeHorizontal").updateCallback(function(){F(s.IRange.Orientations.Column,this)}).update({disabled:!De||g}),f.getCommand("mergeVertical").updateCallback(function(){F(s.IRange.Orientations.Row,this)}).update({disabled:!De}),f.getCommand("unmerge").updateCallback(function(){p(this)}).update({disabled:!x||!De||g});const L={disabled:g};f.getCommand("hideRows").updateCallback(function(){H(this,Ze=>{Ze.getRowHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!0)})}).update(L),f.getCommand("hideColumns").updateCallback(function(){H(this,Ze=>{Ze.getColumnHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!0)})}).update(L),f.getCommand("unhideRows").updateCallback(function(){H(this,Ze=>{Ze.getRowHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!1)})}).update(L),f.getCommand("unhideColumns").updateCallback(function(){H(this,Ze=>{Ze.getColumnHeaders().setHidden(Ze.getSelectedRanges().getCoords(),!1)})}).update(L),f.getCommand("autoFitRows").updateCallback(function(){H(this,Ze=>{Ze.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(L),f.getCommand("autoFitColumns").updateCallback(function(){H(this,Ze=>{Ze.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(L);let v=!1,P=0,Z=!1,ee=!1,ie=0,de=!1;!h||g||He||(v=h.isEntireColumnsAny(),v&&!h.isEntireColumns()?Z=!0:P=h.getColumnCount(),ee=h.isEntireRowsAny(),ee&&!h.isEntireRows()?de=!0:ie=h.getRowCount());const ce={disabled:g||h&&h.getCount()!==1};f.getCommand("sortAscending").update(ce),f.getCommand("sortDescending").update(ce);const xe={disabled:v||ee||g||He},fe=v||g||He||de;fe&&(P=1);const pe=ee||g||He||Z;pe&&(ie=1);let qe="",Oe="",Ne="",We="",je="",_e="",Le="",Je="",at="";P>1&&(_e=Oe=P+" ",Le=Ne="s"),ie>1&&(Je=We=ie+" ",at=je="s"),w.getMode()?.key==="copy"?(qe=We=Oe="Copied ",Ne=je="s"):w.getMode()?.key==="cut"&&(qe=We=Oe="Cut ",Ne=je="s");let ft="",xt="";if(h){const Ze=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;ft=` (${Ze?"Shift Right":"Shift Down"})`,xt=` (${Ze?"Shift Left":"Shift up"})`,f.getCommand("deleteCells").update({label:`Delete Cells${xt}`})}f.getCommand("insertCells").update({label:`Insert ${qe}Cells${ft}`,scopedLabels:{insertCells:`${qe}At Selection`}}),f.getCommand("insertCellsShiftRight").update(xe),f.getCommand("insertCellsShiftDown").update(xe),f.getCommand("deleteCellsShiftUp").update(xe),f.getCommand("deleteCellsShiftLeft").update(xe),f.getCommand("insertRows").update({label:`Insert ${We}Row${je}`,scopedLabels:{insertCells:`${We}Row${je}`},disabled:pe}),f.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${je} Below`,disabled:pe}),f.getCommand("insertColumns").update({label:`Insert ${Oe}Column${Ne}`,scopedLabels:{insertCells:`${Oe}Column${Ne}`},disabled:fe}),f.getCommand("insertColumnsAfter").update({label:`Insert ${Oe}Column${Ne} After`,disabled:fe}),f.getCommand("deleteRows").update({label:`Delete ${Je}Row${at}`,scopedLabels:{deleteCells:`${Je}Row${at}`},disabled:pe}),f.getCommand("deleteColumns").update({label:`Delete ${_e}Column${Le}`,scopedLabels:{deleteCells:`${_e}Column${Le}`},disabled:fe})},[be,De,He,h,w,d,ye]),o.useEffect(()=>{const g=t.getProtection(),x=t.getProtection().isLocked(),F=!g.isFormatCellsAllowed(),p={disabled:F};f.getCommand("protectionSheetToggle").updateCallback(async(P,Z)=>{let ee=null;try{if(x){let ie=null;if(g.hasPassword()){const de=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(de.option!=="Unprotect")return;ie=de.input}ee=await Promise.resolve(d?.showBusy?.(Z.label())),await g.unlock(ie)}else ee=await Promise.resolve(d?.showBusy?.(Z.label())),await g.lock();ee?.()}catch(ie){ee?.(),d?.showError?.(ie)}}).update({state:x,label:()=>x?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:x?"Unprotect":"Protect"}}),f.getCommand("deleteTable").update(p),f.getCommand("sortAscending").update(p),f.getCommand("sortDescending").update(p),f.getCommand("sortCustom")?.update(p),f.getCommand("updateComments").update(p),f.getCommand("deleteComments").update(p),f.getCommand("insertChart")?.update(p),f.getCommand("insertImageFromFile").update(p),f.getCommand("insertImageFromURL").update(p),f.getCommand("formatBorder").update(p),f.getCommand("formatFillColor").update(p),f.getCommand("formatFontColor").update(p),f.getCommand("formatBoldToggle").update(p),f.getCommand("formatItalicToggle").update(p),f.getCommand("formatUnderlinedToggle").update(p),f.getCommand("formatStrikeThroughToggle").update(p),f.getCommand("formatSuperscriptToggle").update(p),f.getCommand("formatSubscriptToggle").update(p),f.getCommand("formatAlignTopToggle").update(p),f.getCommand("formatTextOverflowVisibleToggle").update(p),f.getCommand("formatTextOverflowWrapToggle").update(p),f.getCommand("formatTextOverflowClipToggle").update(p),f.getCommand("formatTextOverflowShrinkToggle").update(p),f.getCommand("formatAlignMiddleToggle").update(p),f.getCommand("formatAlignBottomToggle").update(p),f.getCommand("formatAlignDistributedVerticalToggle").update(p),f.getCommand("formatAlignJustifyVerticalToggle").update(p),f.getCommand("formatAlignLeftToggle").update(p),f.getCommand("formatAlignCenterToggle").update(p),f.getCommand("formatAlignRightToggle").update(p),f.getCommand("formatAlignJustifyToggle").update(p),f.getCommand("formatAlignCenterContinuousToggle").update(p),f.getCommand("formatAlignDistributedHorizontalToggle").update(p),f.getCommand("formatAlignFillToggle").update(p),f.getCommand("formatFontSizeIncrease").update(p),f.getCommand("formatFontSizeDecrease").update(p),f.getCommand("formatFontFamily").update(p),f.getCommand("formatFontSize").update(p),f.getCommand("formatNumberFormat").update(p),f.getCommand("formatNumberFormatGeneralStyle").update(p),f.getCommand("formatNumberFormatNumberStyle").update(p),f.getCommand("formatNumberFormatTimeStyle").update(p),f.getCommand("formatNumberFormatDateStyle").update(p),f.getCommand("formatNumberFormatAccountingStyle").update(p),f.getCommand("formatNumberFormatPercentStyle").update(p),f.getCommand("formatNumberFormatScientificStyle").update(p),f.getCommand("formatNumberFormatCommaStyle").update(p),f.getCommand("formatNumberFormatIncreaseDecimal").update(p),f.getCommand("formatNumberFormatDecreaseDecimal").update(p),f.getCommand("hideColumns").update(p),f.getCommand("unhideColumns").update(p),f.getCommand("hideRows").update(p),f.getCommand("unhideRows").update(p),f.getCommand("insertFunctionSum").update(p),f.getCommand("insertFunctionAverage").update(p),f.getCommand("insertFunctionCount").update(p),f.getCommand("insertFunctionMax").update(p),f.getCommand("insertFunctionMin").update(p),f.getCommand("insertFunction").update(p),f.getCommand("startEditCurrentTime").update(p),f.getCommand("startEditCurrentDate").update(p),f.getCommand("startEditValueAbove").update(p),f.getCommand("fillDown").update(p),f.getCommand("fillRight").update(p),f.getCommand("fillUp").update(p),f.getCommand("fillLeft").update(p),f.getCommand("formatCellStyle").update(p),f.getCommand("formatTableStyle").update(p),f.getCommand("formatPainterToggle").update(p),f.getCommand("formatBorderAddOutline").update(p),f.getCommand("formatBorderClearOutline").update(p),f.getCommand("formatIndentDecrease").update(p),f.getCommand("formatIndentIncrease").update(p),f.getCommand("clearContents").update(p),f.getCommand("clearFormats").update(p),f.getCommand("clearAll").update(p),f.getCommand("clearComments").update(p),f.getCommand("clearHyperlinks").update(p),f.getCommand("autoFilterClear").update(p),f.getCommand("autoFilterReapply").update(p);const L=A===s.ITextFrame.HorizontalAlignment.CenterContinuous||A===s.ITextFrame.HorizontalAlignment.Fill,v={disabled:F||L};f.getCommand("formatTextRotate0").update(v),f.getCommand("formatTextRotate45").update(v),f.getCommand("formatTextRotate90").update(v),f.getCommand("formatTextRotate270").update(v),f.getCommand("formatTextRotate315").update(v),f.getCommand("formatTextRotateCustom").update(v),f.getCommand("formatTextRotateVertical").update(v)},[be]),f}var Oo,jo;(function(){if(jo)return Oo;jo=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 cn=="object"&&cn&&cn.Object===Object&&cn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),b=Object.prototype.toString,u=Math.max,R=Math.min,h=function(){return m.Date.now()};function C(q){var E=typeof q;return!!q&&(E=="object"||E=="function")}function k(q){if(typeof q=="number")return q;if((function(G){return typeof G=="symbol"||(function(U){return!!U&&typeof U=="object"})(G)&&b.call(G)=="[object Symbol]"})(q))return NaN;if(C(q)){var E=typeof q.valueOf=="function"?q.valueOf():q;q=C(E)?E+"":E}if(typeof q!="string")return q===0?q:+q;q=q.replace(e,"");var D=n.test(q);return D||i.test(q)?a(q.slice(2),D?2:8):t.test(q)?NaN:+q}Oo=function(q,E,D){var G,U,T,V,y,w,S=0,j=!1,M=!1,I=!0;if(typeof q!="function")throw new TypeError("Expected a function");function $(ne){var N=G,z=U;return G=U=void 0,S=ne,V=q.apply(z,N)}function _(ne){var N=ne-w;return w===void 0||N>=E||N<0||M&&ne-S>=T}function H(){var ne=h();if(_(ne))return B(ne);y=setTimeout(H,(function(N){var z=E-(N-w);return M?R(z,T-(N-S)):z})(ne))}function B(ne){return y=void 0,I&&G?$(ne):(G=U=void 0,V)}function K(){var ne=h(),N=_(ne);if(G=arguments,U=this,w=ne,N){if(y===void 0)return(function(z){return S=z,y=setTimeout(H,E),j?$(z):V})(w);if(M)return y=setTimeout(H,E),$(w)}return y===void 0&&(y=setTimeout(H,E)),V}return E=k(E)||0,C(D)&&(j=!!D.leading,T=(M="maxWait"in D)?u(k(D.maxWait)||0,E):T,I="trailing"in D?!!D.trailing:I),K.cancel=function(){y!==void 0&&clearTimeout(y),S=0,G=w=U=y=void 0},K.flush=function(){return y===void 0?V:B(h())},K}})();var Bo,Vo,Po={exports:{}},lo={};Vo||(Vo=1,Po.exports=(function(){if(Bo)return lo;Bo=1;var e=o,t=typeof Object.is=="function"?Object.is:function(b,u){return b===u&&(b!==0||1/b==1/u)||b!=b&&u!=u},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(b){var u=b.getSnapshot;b=b.value;try{var R=u();return!t(b,R)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(b,u){return u()}:function(b,u){var R=u(),h=n({inst:{value:R,getSnapshot:u}}),C=h[0].inst,k=h[1];return a(function(){C.value=R,C.getSnapshot=u,d(C)&&k({inst:C})},[b,R,u]),i(function(){return d(C)&&k({inst:C}),b(function(){d(C)&&k({inst:C})})},[b]),l(R),R};return lo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,lo})()),Po.exports;var Ho,Uo,an={exports:{}},Gt={exports:{}},Ll=Gt.exports;function Ko(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Uo)return an.exports;Uo=1;for(var e=(Ho||(Ho=1,function(){var h,C,k,q,E,D;typeof performance<"u"&&performance!==null&&performance.now?Gt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Gt.exports=function(){return(h()-E)/1e6},C=process.hrtime,q=(h=function(){var G;return 1e9*(G=C())[0]+G[1]})(),D=1e9*process.uptime(),E=q-D):Date.now?(Gt.exports=function(){return Date.now()-k},k=Date.now()):(Gt.exports=function(){return new Date().getTime()-k},k=new Date().getTime())}.call(Ll)),Gt.exports),t=typeof window>"u"?cn: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,b=0,u=[],R=1e3/60;a=function(h){if(u.length===0){var C=e(),k=Math.max(0,R-(C-m));m=k+C,setTimeout(function(){var q=u.slice(0);u.length=0;for(var E=0;E<q.length;E++)if(!q[E].cancelled)try{q[E].callback(m)}catch(D){setTimeout(function(){throw D},0)}},Math.round(k))}return u.push({handle:++b,callback:h,cancelled:!1}),b},l=function(h){for(var C=0;C<u.length;C++)u[C].handle===h&&(u[C].cancelled=!0)}}an.exports=function(h){return a.call(t,h)},an.exports.cancel=function(){l.apply(t,arguments)},an.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},an.exports})();const wo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:b=!1,offset:u=0,totalSize:R=0,viewportSize:h=0,...C}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[k]=Ot(),q=r.useCallbackRef(l,[l]),E=r.useCallbackRef(d,[d]),D=(G=k,U=t,o.useMemo(()=>G===null&&U===null?null:ue=>{Ko(G,ue),Ko(U,ue)},[G,U]));var G,U;const[T,V]=o.useState(()=>{const ue=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?ue.top:ue.left}),y=()=>{const ue=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?ue.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(ue.coords.rowIndex)-ue.topLeft.top,scroll:ue.topLeft.top}:ue.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(ue.coords.colIndex)-ue.topLeft.left,scroll:ue.topLeft.left}},[w,S]=o.useState(y),[j,M]=o.useState(null),[I,$]=o.useState(!1),_=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),H=()=>{const ue=a.getUsedRange()?.getCoords()??ge.CoordUtils.EmptyRange,Me=a.getSelection().getCoords().cell;return{colIndex:Math.max(ue.colEnd,Me.colIndex),rowIndex:Math.max(ue.rowEnd,Me.rowIndex)}},[B,K]=o.useState(H),ne=B?(i===r.ScrollbarOrientation.Vertical?B.rowIndex:B.colIndex)+1:0,N=()=>{const ue=H();ge.CoordUtils.isEqualCells(B,ue)||K(ue)};et(a.getView(),{onFreezeSplitChange:()=>{S(y)}}),et(a.getSelection(),{onChange:N}),et(a,{onUsedRangeChange:N}),o.useEffect(()=>{K(H())},[a]),o.useEffect(()=>{if(!j)return I&&E?.(),void $(!1);const ue=_.getTextAt(_.findIndex(T/(a.getView().getZoomScale()/100)+w.scroll+w.shift));$(!0),q?.({...j,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+ue})},[u,T,w,i,j,_,I,a]);const z=r.useCallbackRef((ue,Me,Ke)=>{V(ue);const Ue=ue+w.scroll,Te=Me+w.shift,he=Ke+w.shift+w.scroll;m?.(Ue,Te,he)},[m,w]),se=u-w.scroll,ve=h-w.shift,Ve=R-(w.shift+w.scroll),Se=_.findOffset(ne)*(a.getView().getZoomScale()/100)-(w.scroll+w.shift);return c.jsx(r.VirtualScrollbar,{ref:D,style:n,offset:se,viewportSize:ve,totalSize:Ve,orientation:i,showCustomScrollButtons:b,onMouseDown:ue=>{M({anchor:{x:ue.clientX,y:ue.clientY}}),ue.preventDefault()},onScrollOffset:z,onMouseOut:()=>{M(null)},onMouseUp:()=>{M(null)},minSize:Se,...C})}));wo.displayName="SheetScrollbar";const $o=(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},Wo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:b,headerText:u,freezeStart:R,gridStyle:h,verticalPadding:C,horizontalPadding:k,onSheetContextMenu:q,onResizeHeadersStart:E,onResizeHeaders:D,onResizeHeadersEnd:G,onResizeHeadersDown:U,onResizeHeadersUp:T,scrollPoint:V,onSelectionStart:y,onSelectionEnd:w}=e,S=o.useMemo(()=>n.getOrientation(),[n]),j=o.useRef(null),[M,I]=o.useReducer(O=>O+1,0),[$,_]=o.useReducer(O=>O+1,0),H=n?.getSheet(),B=o.useRef(!1);o.useLayoutEffect(()=>{B.current=!0},[n]);const K=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),ne=o.useMemo(()=>{const O=S===s.IRange.Orientation.Column;return{left:O?V.left:0,top:O?0:V.top}},[V]),[N,z]=o.useState(H?.getView().getZoomScale()/100),[se,ve]=o.useState(null);et(n,{onSizesChange:O=>{z(H?.getView().getZoomScale()/100),ye(le())}});const Ve=o.useCallback(()=>{j.current?.invalidate(),_()},[]),Se=o.useCallback(ge.CommonUtils.debounce(()=>{Ve()},10),[]),[ue,Me]=o.useState(null);et(n.getSheet(),{onSelectionChange(){Me(H?.getSelection().getCoords()),Se()},onProtectionChange(){Ve()},onViewChange(){Se()}}),o.useLayoutEffect(()=>{ye(le())},[S,N,d]),o.useLayoutEffect(()=>{ve(null),z(n?.getSheet().getView().getZoomScale()/100),ye(le())},[n]);const Ke=o.useCallback(O=>n.at(O)?.isHidden()||n.at(O)?.getSize()===0,[n]),Ue=o.useCallback((O,X)=>n.hiddenHeadersAt(O,X),[Ke]),Te=r.useCallbackRef(O=>n.isSelected(O),[n]),he=r.useCallbackRef(O=>n.isSelectedAll(O),[n]),W=o.useCallback(()=>n.getMinSize(),[n]),Fe=o.useCallback(()=>n.getMaxSize(),[n]),Ce=r.useCallbackRef((O,X,g)=>{X/=N;const x={size:X=Math.max(W(),Math.min(ge.CommonUtils.roundAccurately(X,W()),Fe())),hidden:!1},F=[];if(X<=0&&(x.hidden=!0,x.size=g),F.push({address:{min:O,max:O},update:x}),X<0){const p=S===s.IRange.Orientation.Column,L=p?me.getColOffset:me.getRowOffset,v=p?me.getColIndex:me.getRowIndex,P=L(O);let Z=v(P+X);const ee=L(Z);ee===P+X?Z--:F.push({address:{min:Z,max:Z},update:{size:P-ee+X}}),O-Z>1&&F.push({address:{min:Z+1,max:O-1},update:{hidden:!0}})}n.updateHeaderPairs(F),D?.(O,X,g)},[M,n,N,D]),Y=r.useCallbackRef((O,X,g)=>{const x=S===s.IRange.Orientation.Column;let F=null,p={min:O,max:O};if(n.isSelectedAll(O)){const L=n.getSelectedRuns();L.length>1?F="Resize "+(x?"Columns":"Rows"):p=L[0];const v={hidden:X<=0,size:(X<=0?g:X)/N};n.updateHeaderPairs($o(L,v,O))}if(p){const L=p.max-p.min+1;let v;v=L===1?n.getRange(p).at(0).getDisplayText():n.getRange(p).toString(),F=`Resize ${x?"Column":"Row"}${L>1?"s":""} '${v}'`}G?.(O,X,F)},[M,n,G]),J=r.useCallbackRef((O,X)=>{const g=S===s.IRange.Orientation.Column;E(O,X,`Resize ${g?"Column":"Row"}(s)`)},[E]),re=r.useCallbackRef(O=>{let X=!1;const g=S===s.IRange.Orientation.Column,x=n.getSheet().getEntireRange().getCoords(),F=[],p=n.getSelectedRuns(),L=v=>{let P;P=g?{colStart:v.min,rowStart:x.rowStart,colEnd:v.max,rowEnd:x.rowEnd}:{colStart:x.colStart,rowStart:v.min,colEnd:x.colEnd,rowEnd:v.max},F.push(P)};for(let v=0;v<p.length;v++){const P=p[v];P.value.isSelectedAll&&(P.min<=O&&P.max>=O&&(X=!0),L(P))}if(X||L({min:O,max:O}),n.getSheet().getRanges(F).autoFit({orientations:g?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),Ke(O)){const v={hidden:null},P=$o(p,v);X||P.push({address:O,update:v}),n.updateHeaderPairs(P)}G?.(O,null,"Resize Column(s)")},[M,n,G,Ke]),le=()=>{const O=S===s.IRange.Orientation.Column;return{getColOffset:X=>O?n.findOffset(X):X===0?0:d/N,getColIndex:X=>O?n.findIndex(X):0,getRowOffset:X=>O?X===0?0:d/N:n.findOffset(X),getRowIndex:X=>O?0:n.findIndex(X)}},[me,ye]=o.useState(()=>le()),ae=o.useCallback((O,X)=>O.nativeEvent.which!==r.MouseButtonCodes.Right||!he(S===s.IRange.Orientation.Column?X.colIndex:X.rowIndex),[S,he]),be=r.useCallbackRef(O=>{a.focusSheet()},[a]),Re=r.useCallbackRef(O=>{H?.getSelection().updateCoords(O)},[H]),{...Ee}=dt.useSelection({gridRef:i,commands:null,layout:me,selection:ue,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Re,canSelectionSpanMergedCells:O=>{const X=H.getRange(O);return X.isEntireColumns()||X.isEntireRows()}}),f=r.useCallbackRef(()=>{y?.();const O=H?.getSelection();O&&O.setAdjusting(O.getCoords())},[H,y]),De=r.useCallbackRef(async()=>{H?.getSelection().setAdjusting(null),w?.()},[H,w]),{...Ye}=dt.useHeaderSelection({orientation:S,headerCount:K,gridRef:j,gridMainRef:i,newSelection:Ee?.newSelection,modifySelection:Ee?.modifySelection,appendSelection:Ee?.appendSelection,clearSelections:Ee?.clearSelections,pointerDownInterceptor:ae,onPointerUp:be,onDragStart:f,onDragEnd:De}),He=h.selection?.strokeFill;o.useEffect(()=>{if(!j.current)return void ve(null);const O=S===s.IRange.Orientation.Column,X=n.getSelectedRuns(),g=n.isProtected()?null:Ce,x=(p,L,v)=>{if(v)return O?c.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${He}`,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"}},p):c.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${He}`,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`}},p)},F=(p,L,v)=>{const P={x:0,y:0,width:0,height:0};if(O){const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:p,colEnd:Math.min(K,L)}),dt.SELECTION_CLIP_INSETS);if(!Z)return;P.x=Z.x,P.width=Z.width}else{const Z=v.toClipBounds(v.getRangeCoordsBounds({rowStart:p,rowEnd:Math.min(K,L),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!Z)return;P.y=Z.y,P.height=Z.height}return{x:P.x,y:P.y,width:P.width,height:P.height}};ve([p=>{const L=[];let v=null,P=O?p.getVisibleColumns():p.getVisibleRows();const Z=O?p.getTotalRangeCoords().colStart:p.getTotalRangeCoords().rowStart;P.length>0&&P[0]>Z&&(P=[P[0]-1,...P]);let ee=[];const ie=[];for(let pe=0;pe<P.length;pe++){const qe=P[pe],Oe=pe<P.length-1?P[pe+1]:qe+Ue(qe+1,!1)+1,Ne=qe+1!==Oe;if(!v||v.max<qe)if(X.length>0&&X[X.length-1].max>=qe){const _e=ge.CommonUtils.findEqualOrGreater(X,qe,Le=>Le.max);v=X[_e]}else v=null;let We=!1,je=!1;if(v?.value&&(v.min<=qe||v.min<=Oe&&!Ne)&&(We=!0,je=v.value.isSelectedAll),qe===Z){let _e=!1,Le=!1;v?.value&&v.min<=qe&&(_e=!0,Le=v.value.isSelectedAll),qe>0&&ie.push({index:qe-1,isNextHidden:Ne,isSelected:_e,isSelectedAll:Le,disabledResize:!0})}if(je&&ee.push(ie.length),ie.push({index:qe,isHidden:pe===0&&Ue(qe,!1)>0,isNextHidden:Ne,isSelected:We,isSelectedAll:je,onDividerMouseDown:U,onDividerResizeStart:J,onDividerResize:g,onDividerMouseUp:T,onDividerResizeEnd:Y,onDividerAutoFit:re}),Ne){let _e=!1,Le=!1;if(v&&v.min>=qe&&v.max<=Oe-1&&v.value.isSelectedAll&&ee.push(ie.length),!(v?.value&&v.max>=Oe))if(X.length>0&&X[X.length-1].max>=Oe){const Je=ge.CommonUtils.findEqualOrGreater(X,Oe,at=>at.max);v=X[Je]}else v=null;v?.value&&v.min<=Oe&&(_e=v.value.isSelected,Le=v.value.isSelectedAll),Oe>0&&ie.push({index:Oe-1,isHidden:!0,isSelected:_e,isSelectedAll:Le,onDividerMouseDown:U,onDividerResizeStart:J,onDividerResize:g,onDividerMouseUp:T,onDividerResizeEnd:Y,onDividerAutoFit:re})}}if(ee.length>0){let pe=ee.length-1;if(ee.length>0){const Ne=ie[ee[pe]].index;let We=null;O?(We=p.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Ne,colEnd:Ne}),We.x+We.width>p.getBounds().width&&(pe-=1,pe===0&&(pe=-1))):(We=p.getRangeCoordsBounds({rowStart:Ne,rowEnd:Ne,colStart:0,colEnd:0}),We.y+We.height>p.getBounds().height&&(pe-=1,pe===0&&(pe=-1)))}const qe=X?.[X.length-1],Oe=p.getAnchor();if(Oe==="t"||Oe==="l"){const Ne=ie[ee[Math.max(0,ee.length-1)]];Ne.showTouchDivider=qe&&qe.max<=Ne.index}else pe>=0&&(ie[ee[pe]].showTouchDivider=!0)}const{header:de,headerSelect:ce,headerSelectAll:xe,headerHover:fe}=h??{};for(let pe=0;pe<ie.length;pe++)L.push(c.jsx(dt.HeaderDivider,{orientation:S,view:p,headerStyle:de,headerStyleSelect:ce,headerStyleSelectAll:xe,headerStyleHover:fe,disabled:n.isProtected(),...ie[pe]},`divider${pe}`));return L},p=>{const L=[];for(let v=0;X&&v<X.length;v++)L.push(x(`selection:${p.getAnchor()}:${v}`,0,F(X[v].min,X[v].max,p)));return L}])},[$,!0,He,h,me,K,R,M,N]),o.useEffect(()=>{j.current?.invalidate()},[M]);const $e=r.useCallbackRef(O=>u?u(O):n.getTextAt(O),[u,n]),oe=r.useCallbackRef(O=>{const{header:X,headerSelect:g,headerSelectAll:x,headerHover:F}=h??{},{range:p,key:L,...v}=O;return c.jsx(dt.HeaderRenderer,{orientation:S,index:S===s.IRange.Orientation.Column?p.colStart:p.rowStart,isSelected:Te,isSelectedAll:he,zoomScale:100*N,headerText:$e,headerStyle:X,headerStyleSelect:g,headerStyleSelectAll:x,headerStyleHover:F,verticalPadding:C,horizontalPadding:k,...v},L)},[M,K,h,N,n]),ke=r.useEditMode(),ze=o.useMemo(()=>{const O="white",X="black",g={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let x=S===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='${X}' 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='${X}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;ke.getMode()?.key==="formatPainter"&&(x=`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='${X}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),g.cursor=x}return g.backgroundColor=h?.header?.fill||"transparent",g},[S,M,ke,h]),we=r.useImperativeElement(t,()=>({scrollTo:O=>{j.current?.scrollTo(O)},forceRender:()=>{I()},getGridElement:()=>j.current}),[]),Ae=o.useCallback(O=>{Ye.onPointerDown(O)},[Ye]),A=o.useCallback(O=>{const X=Ye.getCellCoordsFromClient(O.clientX,O.clientY);if(!X||!q)return;const g=S===s.IRange.Orientation.Column;q({originalEvent:O,clientX:O.clientX,clientY:O.clientY,rowIndex:g?-1:X.rowIndex,colIndex:g?X.colIndex:-1}),O.stopPropagation(),O.preventDefault()},[Ye,q]),Q=o.useMemo(()=>{const O=S===s.IRange.Orientation.Column;return c.jsx("div",{ref:we,children:c.jsx(dt.Grid,{className:"sheet-header",style:ze,ref:j,scrollPoint:ne,columnCount:O?K:1,rowCount:O?1:K,width:O?m:d,height:O?d:b,freezeLeft:O?R:void 0,freezeTop:O?void 0:R,hiddenColumnsAt:O?Ue:void 0,hiddenRowsAt:O?void 0:Ue,showGridLines:!1,layout:me,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:A,onPointerDown:Ae,zoom:N,cellRenderer:oe,overlays:se})})},[se,me,m,b,ne,ze,$]);return o.useEffect(()=>{B.current=!1,j.current?.invalidate(),_()},[n,h]),Q})),Ol=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((u,R)=>u.getStyle().getBorder(),[]),{overlay:m}=yo({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),b=m(n);return b&&n?b:null})),jl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Bl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Vl={type:s.ICell.Content.Values},Pl={fitDestination:!0,type:s.ICell.Content.Formats},Hl={fitDestination:!0,type:s.ICell.Content.Formulas},Ul={transpose:!0},Kl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},Ir=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:b="rgb(33, 115, 70)",copyBackgroundColor:u="white",cutBackgroundColor:R="white",notifier:h,...C})=>{const k=r.useCallbackRef(d,[d]),q=o.useRef(null),E=r.useEditMode(),D=E.getMode(),G=o.useMemo(()=>({element:e,doCopy:w=>{const S=t.getSelectedRanges().getSnapshot(w);return new s.RangeClipboardItem(S)}}),[t,n,e]),U=o.useMemo(()=>({element:e,importFromExternal:async(w,S)=>{const j=new s.ExternalRangeClipboardItem(w,S,t.getStyles(),t.isDate1904());return await j.parse()?j:null},doPaste:async(w,S)=>{if(w?.getItemType()!=="range")return;S?.contentsOnly&&delete(S={...S,type:s.ICell.Content.Values}).contentsOnly;const j=t.getSelectedRange(),M=w.getItem(),I=M.getName();return await j.doBatch(async()=>{const $=await j.copyFrom(M,S);!$||$.isEntireRows()||$.isEntireColumns()||$.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(I?` ${I}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:T,...V}=r.useCopyPaste({...C,source:G,commands:i,target:U,notifier:h,onClipboardUpdate:w=>{const S=w?.getItemType()==="range"?w:null;if(S){const j=w.editMode?.(),M={...w?.isCut?.()?Bl:jl,...j,args:{isClipboard:!0,...j?.args},onModeChange:I=>{I?.args?.isClipboard||T.clear(!0),j?.onModeChange?.(I)}};E.setMode(M)}q.current=S,a?.(S)},onPaste:(w,S)=>{if(w?.getItemType()!=="range")return;let j=E.getMode()?.key==="cut"||w.isCut?.();if(!j&&E.getMode()?.key==="copy"){const M=w.getItem().getCoords(),I=t.getSelectedRanges().getCoords();let $=!1;if(!$&&M&&I&&w.getItem().getSource?.()===t)for(let _=0;!$&&_<I.length;_++)$=ge.CoordUtils.isRangesIntersect(M,I[_]);j=$}j&&E.setMode(null),e?.()?.focus(),l?.(w,S)}});o.useMemo(()=>{const w=e;if(!i)return;const S=[new r.Command("pasteValues",w,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
20
20
 
21
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",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(S,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const w={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(S=>V.paste({...Bl,...S})).update(w),i.getCommand("pasteFormats").updateCallback((S,j)=>V.paste({...Vl,description:j.label(),...S})).update(w),i.getCommand("pasteFormulas").updateCallback((S,j)=>V.paste({...Pl,description:j.label(),...S})).update(w),i.getCommand("pasteTranspose").updateCallback((S,j)=>V.paste({...Hl,description:j.label(),...S})).update(w),i.getCommand("pasteLinks").updateCallback((S,j)=>V.paste({...Ul,description:j.label(),...S})).update(w),i.getCommand("cut").update(w),i.getCommand("paste").update(w)},[t,i]);const y=o.useMemo(()=>{if(!D||!q.current)return;const w=D.key;if(w!=="copy"&&w!=="cut"&&w!=="formatPainter")return;const S=q.current.getItem();if(S.getSource()!==t)return;const j=q.current.isCut?.(),M=j?R:u,I=j?b:m,$=S.getCoords(),_=$?[$]:null;return _&&_.length!==0?H=>{const B=[];for(let K=0;K<_.length;K++){const oe=_[K],N=H.toClipBounds(H.getRangeCoordsBounds(oe,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);N&&(B.push(k({range:oe,key:`copy-selection-background-${K}`,x:N.x,y:N.y,width:Math.max(N.width,0),height:Math.max(N.height,0),stroke:M,strokeWidth:2})),B.push(k({range:oe,key:`copy-selection-foreground-${K}`,x:N.x+(N.width<=2?-1:0),y:N.y,width:Math.max(N.width,3),height:Math.max(N.height,3),stroke:I,strokeWidth:2,isAnimatedStroke:!0})))}return B}:null},[D,t,n,m,u,b,R]);return{...V,clipboard:T,overlays:y}},Kl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,b=l.body??{},u=a.getView(),{overlays:R}=Ir({element:i,sheet:a,sheetView:u,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:b.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:b.fill,notifier:m});return et(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),R&&n?R(n):null})),$l="_sheet-selection_12wyx_5",Wl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Gl={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},_l={key:"dragCopy",description:"Drag selection to copy cell contents."},Zl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Go=(e,t)=>t.ctrlKey&&t.shiftKey?Zl:t.ctrlKey?_l:t.shiftKey?Gl:Wl,Xl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Yl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:b,sheet:u,gridRef:R,gridStyle:h,isActive:C,editingCoords:k,...q}=e,E=n?.getBounds(),D=r.useCallbackRef(m,[m]),G=r.useCallbackRef(b,[b]),[U,T]=o.useState(()=>u?.getSelection().getCoords()),V=r.useCallbackRef(Y=>{ge.CoordUtils.isEqualSelectionCoords(Y,U)||u&&u.getSelection().updateCoords(Y)},[u,U]),y=r.useEditMode(),w=o.useRef(null),[S,j]=o.useState(u?.getProtection().isLocked()),[M,I]=o.useState(u?.getView().getMovableSelection().length>0),$=r.ReactUtils.detectIt().primaryInput==="touch",_=!$&&C,H=k!==null||M,B=r.useCallbackRef(Y=>{const J=ge.CoordUtils.cellToRange(Y);if(u.isClosed())return J;const ne=u.getRange(J,{excludeHidden:!0}).getMerges();return ne.length===0?J:ne[0]},[u]),K=r.useCallbackRef((Y,J,ne,le,me,Se)=>{const de=u.getSelectedRange().getExtended(le,Y).getCoords();switch(le){case s.IRange.Direction.Up:return de.rowStart;case s.IRange.Direction.Down:return de.rowEnd;case s.IRange.Direction.Left:return de.colStart;case s.IRange.Direction.Right:return de.colEnd}},[u]),oe=r.useCallbackRef(()=>{const Y=u.getUsedRange()?.getCoords(),J=u.getRowHeaders().getUsedRange()?.getCoords(),ne=u.getColumnHeaders().getUsedRange()?.getCoords();return{...Y,colEnd:Math.max(Y?.colEnd??0,ne?.max??0),rowEnd:Math.max(Y?.rowEnd??0,J?.max??0)}},[u]),N=r.useCallbackRef((Y,J)=>u.getRowHeaders().hiddenHeadersAt(Y,J),[u]),z=r.useCallbackRef((Y,J)=>u.getColumnHeaders().hiddenHeadersAt(Y,J),[u]),ae=r.useCallbackRef(Y=>u.getRange(Y,{excludeHidden:!0}).getMerges(),[u]),ve=r.useCallbackRef(Y=>{u?.getSelection().setAdjusting(Y)},[u]),Ve=r.useCallbackRef(async()=>{u?.getSelection().setAdjusting(null),y.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),y.setMode(null))},[y,U,u,i]),qe=o.useMemo(()=>{const Y=y.getMode();return Y?.key==="cut"||Y?.key==="copy"},[y]);et(u?.getView(),{onMovableSelectionChange:()=>{I(u.getView().getMovableSelection().length>0)}}),et(u?.getSelection(),{onChange(Y){const J=u.getSelection().getCoords();T(J)}}),et(u,{onProtectionChange:()=>{j(u.getProtection().isLocked())}});const{body:ue={}}=h||{},ke=n.getLayout(),Ke=!(_&&U.ranges.length<=1&&k===null&&!S&&(!y.getMode()||qe)),{cursor:Ue,overlay:Te,onPointerDown:he}=dt.useSelection({gridRef:R,commands:i,layout:ke,getCellCoordsAsRangeCoords:B,selection:U,fillHandleBorderColor:ue.fill,selectionBackgroundColor:C?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:C?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:C?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:C?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Ke,disableMoveDrag:$||!(C&&U.ranges.length<=1&&k===null&&!S),disableTouchSelection:H,onSelectionChange:V,onSelectionDragStart:ve,onSelectionDragEnd:Ve,onMoveDragStart:(Y,J,ne)=>{y.setMode(Go(0,ne))},onMoveDragUpdate:(Y,J,ne)=>{y.setMode(Go(0,ne))},onMoveDragEnd:(Y,J)=>{y.setMode(null)},onMoveDragDone:async(Y,J,ne)=>{if(ge.CoordUtils.isEqualRanges(Y,J))return;const le=u.getRange(J);if(d?.showOptions){const Me=le.getDifferences(Y);let Ee=!1;const f=Me.getCount();for(let De=0;!Ee&&De<f;De++)Ee=Me.at(De).isContentful();if(Ee&&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 me=!ne.ctrlKey,Se=ne.shiftKey,de=Se?me?"Insert Moved Cells":"Insert Copied Cells":me?"Move Cells":"Copy Cells",be=await d?.showBusy?.(de);try{const Me=u.getRange(Y);await le.doBatch(async()=>{Se?await le.insertFrom(Y,{isCut:me,undoRange:Me}):await le.copyFrom(Y,{isCut:me,undoRange:Me}),Me.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),le.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:de,autoSelect:!0})}catch(Me){d?.showError?.(Me)}finally{be?.()}},contentfulCellFinder:K,hiddenRowsAt:N,hiddenColumnsAt:z,mergedRanges:ae,getDataCoords:oe,canSelectionSpanMergedCells:Y=>{const J=u.getRange(Y);return J.isEntireColumns()||J.isEntireRows()},onFill:async(Y,J)=>{const ne="Auto Fill",le=await d?.showBusy?.(ne);try{await u.doBatch(()=>{u.getRange(Y).autoFill(J),u.getRange(J).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:ne,autoSelect:!0})}catch(me){d?.showError?.(me)}finally{w.current=null,le?.()}},onFillPreview:(Y,J,ne)=>{if(R.current&&D){y.setMode(Xl);try{w.current?.direction!==ne&&(w.current=null,u.getRange(Y).autoFill(J,{previewOnly:f=>{w.current={callback:f,direction:ne}}}));const le=w.current?.callback?.(J);if(!le||le.isEmpty())return;const me=le.toText();if(!me)return;const Se=ge.CoordUtils.cellToRange(le.getCoords()),de=n.getRelativePointFromClient(0,0);let be=0,Me=0,Ee=r.ToolTipPlacement.Bottom;if(ne===s.IRange.Direction.Down){be=ke.getColOffset(Se.colEnd+1)-de.x;const f=ke.getRowOffset(Se.rowEnd),De=ke.getRowOffset(Se.rowEnd+1);Me=De-(De-f)/2-de.y,Ee=r.ToolTipPlacement.Right}else if(ne===s.IRange.Direction.Right){Me=ke.getRowOffset(Se.rowEnd+1)-de.y;const f=ke.getColOffset(Se.colEnd),De=ke.getColOffset(Se.colEnd+1);be=De-(De-f)/2-de.x,Ee=r.ToolTipPlacement.Bottom}else if(ne===s.IRange.Direction.Up){be=ke.getColOffset(Se.colEnd+1)-de.x;const f=ke.getRowOffset(Se.rowStart),De=ke.getRowOffset(Se.rowStart+1);Me=De-(De-f)/2-de.y,Ee=r.ToolTipPlacement.Right}else if(ne===s.IRange.Direction.Left){Me=ke.getRowOffset(Se.rowEnd+1)-de.y;const f=ke.getColOffset(Se.colStart),De=ke.getColOffset(Se.colStart+1);be=De-(De-f)/2-de.x,Ee=r.ToolTipPlacement.Bottom}D({anchor:{x:be,y:Me},display:me,placement:Ee})}catch(le){d?.showError?.(le)}}},onFillDone:()=>{w.current=null,y.setMode(null),G?.()}}),W=r.useCallbackRef(Y=>{he(r.ReactUtils.createSyntheticEvent(Y))},[he,k]);o.useEffect(()=>{const Y=n?.getStage();if(Y)return Y.addEventListener("pointerdown",W),()=>{Y.removeEventListener("pointerdown",W)}},[n?.getStage()]);const Fe=r.useImperativeElement(t,()=>({}),[]),Ce=o.useRef(null);return c.jsx("div",{className:yt(a,"sheet-selection",$l),style:{position:"absolute",width:E?.width,height:E?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Xt([Fe,Ce]),...q,children:Te(n)})})),Tn=Object.freeze({x:0,y:0,width:0,height:0}),Jl={fireOnModelChange:!1},Ql=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:b,onUnFocus:u,isDragging:R,updateFrameBounds:h,dragStart:C,style:k,disabled:q,renderMovable:E,...D}=e,[G,U]=o.useState(Tn),[T,V]=o.useState(null),[y,w]=o.useState(!1),S=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const M=a.getBounds();if(!M)return;const I=i.toViewBounds(M);U(I??Tn),h(I??Tn)},[i?.getBounds()]),et(a,{onBoundsChange:M=>{const I=M.getBounds();if(!I)return;const $=i.toViewBounds(I);U($??Tn),h($)},onSelectionChange:()=>{const M=ge.CommonUtils.hasFocus(S.current,!0);!y&&!M||a.isSelected()||u()}}),et(a,{onRequestFocus:()=>ge.CommonUtils.whenFocus(S.current,!0)},Jl),o.useEffect(()=>{const M=S.current;return l(M),()=>{d(M)}},[]);const j=o.useMemo(()=>{if(!G)return null;let{width:M,height:I}=G;return E({view:i,movable:a,disabled:q,isDragging:R,style:{position:"relative",left:0,top:0,width:M,height:I},onHide:m,onShow:b})},[i,a,G.width,G.height,q,R]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Xt([S,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:G.x,top:G.y,width:G.width,height:G.height,...k},onMouseDown:async M=>{const I=M.shiftKey||M.ctrlKey,$=a.isSelected(),_=M.currentTarget;I&&$?a.unselect():($&&!I||await a.select({addToSelection:I}),C(M.nativeEvent,_),_.focus())},onFocus:M=>{M.relatedTarget&&!T&&V(M.relatedTarget),w(!0)},onBlur:M=>{T&&!S?.current?.contains(M.relatedTarget)&&V(null),M.relatedTarget&&w(!1)},...D,children:j})})),ei="_movable-area_314c6_5",Tr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:b,disabled:u=!1,disableDrag:R=!1,disableResize:h=!1,className:C,style:k,renderDirections:q=["nw","n","ne","w","e","sw","s","se"],onFirstRender:E,...D}=e,G=n.getBounds(),U=r.useCallbackRef(E,[E]),T=r.useCallbackRef(m,[m]),V=r.useCallbackRef(b,[b]),[y,w]=o.useState([]),[S,j]=o.useState(!1),[M,I]=o.useState(!1),$=o.useRef(!0),_=o.useRef(new Map),H=o.useRef(new Map),B=o.useRef(new Map),K=o.useRef(new Map),oe=o.useRef(new Map),N=o.useRef({onRequestFocus:re=>(ne(re),null)}),z=o.useRef(null),ae=o.useRef(null),ve=o.useRef(null),[Ve,qe]=o.useReducer(re=>re+1,0);o.useLayoutEffect(()=>{qe()},[n,i]),et(i,{onCollectionChange:()=>{const re=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Re=oe.current;Re.forEach(ye=>{ye()}),Re.clear();const ze=N.current;for(let ye=0;ye<re.length;ye++){const Ae=re[ye];if(Ae.isClosed())continue;const A=Ae.addListeners(ze);Re.set(Ae,A)}qe()},onInvalidated:()=>{qe()}}),et(a,{onMovableSelectionChange(re){ke(),qe()}});const ue=o.useCallback((re,Re)=>{const ze=B.current.get(re);ve.current&&(ve.current.getTargets().forEach(ye=>{if(ye===ze)return ye.style.left=Re.x+"px",ye.style.top=Re.y+"px",ye.style.width=Re.width+"px",void(ye.style.height=Re.height+"px")}),ve.current.updateRect())},[]),ke=()=>{const re=[],Re=a.getMovableSelection();Re.forEach(ze=>{const ye=B.current.get(ze);ye&&Re.indexOf(ze)!==-1&&re.push(ye)}),w(ze=>ge.CommonUtils.isEqualArrays(ze,re)?ze:re)},Ke=o.useRef(null),Ue=o.useRef(null),Te=o.useMemo(()=>(Ue.current||(Ue.current=new Promise(re=>{Ke.current=re})),Ue.current),[]),he=o.useRef(null),W=r.useCallbackRef(async(re,Re)=>{he.current=Re,await(async()=>!(!await Te.then()||!ve.current))()&&he.current===Re&&ve.current.dragStart(re,Re)},[y]),[Fe,Ce]=o.useState(!1),Y=o.useRef(null),J=o.useRef(null),ne=r.useCallbackRef(async(re=null)=>{if(re||(re=a.getMovableSelection()[0]),!re)return T?.(),!1;const Re=B.current.get(re);Re?(await ge.CommonUtils.whenFocus(Re),Re.focus(),J.current=Re,Y.current=null):Y.current=re},[a]);o.useEffect(()=>{Fe&&y.length>0&&J.current!==y[0]&&ne(),$.current&&(U?.(),$.current=!1)},[y]);const le=o.useMemo(()=>{const re=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(re.length===0&&_.current.size===0)return null;const Re=(Q,O,X,g=!0)=>{const x=Q.isSelected(),F={tabIndex:X,view:n,movable:Q,onRefLoad:p=>{Y.current===Q&&(p.focus(),J.current=p,Y.current=null),B.current.set(Q,p),H.current.set(p,Q),O.rendered=!0,ke()},onRefUnload:p=>{B.current.delete(Q),H.current.delete(p),O.rendered=!1,ke()},onUnFocus:T,onHide:p=>{O.onHide=p},onShow:p=>{O.onShow=p},isDragging:x&&(M||S),disabled:u,renderMovable:l,updateFrameBounds:p=>{ue(Q,p)},dragStart:W,onMouseUp:()=>{if(he.current=null,ae.current){j(!1),I(!1);let p=!1;K.current?.forEach(L=>{ge.CommonUtils.isEqualBounds(L.movable.getBounds(),L.startBounds)||(p=!0)}),p?Se():de()}},style:{opacity:g?S&&x?.7:void 0:0,zIndex:S&&x?Q.getZIndex()+re.length:void 0,pointerEvents:g?void 0:"none",cursor:M&&x?"grabbing":u||R?"initial":"move",boxShadow:!x||M&&!S?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Ql,{...F},`movable-${Q.getUUID()}`)},ze=_.current,ye=new Map,Ae=[];for(let Q=0;Q<re.length;Q++){const O=re[Q];if(O.isClosed())continue;let X=ze.get(O);X||(X={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(g,x)=>{if(!x||x.shown===!0)return;x.shown=!0;const F=++x.visibilityRequestId;requestAnimationFrame(()=>{const p=_.current.get(g);p&&F===x.visibilityRequestId&&(x.onShow?.(g),p.shown=!0)})},doHide:async(g,x)=>{if(!x||x?.shown===!1)return;x.shown=!1;const F=++x.visibilityRequestId,p=await Promise.resolve(x.onHide?.(g));F===x.visibilityRequestId&&p!==!1&&(x.shown=!1,_.current.delete(g),qe())},visibilityRequestId:0}),X.frame=Re(O,X,Q,!0),Ae.push(X.frame),X.doShow(O,X),ze.delete(O),ye.set(O,X)}const A=[];return a.getMovableSelection().forEach(Q=>{const O=ze.get(Q);O&&(O.frame=Re(Q,O,-1,!1),A.push(O.frame),ze.delete(Q),ye.set(Q,O))}),ze.forEach((Q,O)=>{Q.frame=Re(O,Q,-1,!1),A.push(Q.frame),Q.doHide(O,Q),ze.delete(O),ye.set(O,Q)}),_.current=ye,ke(),[...A,...Ae]},[Ve,n,l,u,R,h,S,M]),me=r.useCallbackRef((re,Re)=>{const ze=`${Re} ${y.length===1?s.TextUtils.capitalize(H.current?.get(y[0]).getContent().getType()):"Drawings"}`;ae.current&&(console.warn(`Transaction ${ae.current.getDescription()} is being replaced by ${ze}`),ae.current.rollback(),ae.current=null),ae.current=d.beginCommit({description:ze}),K.current.clear();for(let ye=0;ye<y.length;ye++){const Ae=y[ye],A=H.current?.get(Ae);A?K.current.set(Ae,{movable:A,startBounds:n.toViewBounds(A.getBounds())}):console.warn("invalid element",A)}},[d,n,y]),Se=o.useCallback(()=>{if(!ae.current)return;const re=[];K.current?.forEach(Re=>{re.push(Re.movable)}),ae.current.commit({viewAfter:{view:a,movableSelection:re}}),K.current.clear(),ae.current=null},[]),de=o.useCallback(()=>{ae.current&&(ae.current.rollback(),ae.current=null)},[]),be=o.useRef(null);o.useEffect(()=>{be.current&&(be.current.onscroll=re=>{re.preventDefault(),re.srcElement.scrollTop=0,re.srcElement.scrollLeft=0})},[be.current]);const Me=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:ne,focus:()=>{ne()}}),[a]),[Ee,f]=o.useState(null),De=o.useRef(!1),Ye=o.useRef(!1),He=o.useRef(!1);o.useEffect(()=>{if(u||y.length===0||He.current||De.current)return;if(Ye.current)return void requestAnimationFrame(()=>{ve.current&&z.current&&ve.current.refTargets.length>0&&(He.current=!0,Ke.current?.(!0)),w([...y])});De.current=!0;const re=o.lazy(async()=>{try{const Re=await Promise.resolve().then(()=>require("./QaJ17JzOP3OrKint.cjs"));return De.current=!1,Ye.current=!0,w([...y]),Re}catch(Re){return console.warn(Re),Ke.current?.(!1),null}});f(re)},[y,u,R,h]);const $e=o.useMemo(()=>!Ee||u?null:c.jsx(o.Suspense,{children:c.jsx(Ee,{className:yt({dragging:S||M,resizing:S,moving:M}),container:null,ref:ve,target:ve.current?y:[],draggable:!u&&!R,resizable:!u&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:q,onResizeStart:re=>{me(re.target,"Resize")},onResize:re=>{if(!ae.current)return re.stopDrag(),void qe();j(!0);const Re=re.direction[0]!==0&&re.direction[1]!==0;let ze=0,ye=0;for(let Ae=0;Ae<y.length;Ae++){const A=y[Ae],Q=K.current.get(A),O=H.current.get(A);if(!Q||!O){console.warn("invalid element");continue}let X=re.dist[0],g=re.dist[1],x=re.drag.dist[0],F=re.drag.dist[1],p=Q.startBounds.width,L=Q.startBounds.height;Ae===0?(ze=p,ye=L):(X*=p/ze,x*=p/ze,g*=L/ye,F*=L/ye);const v={...Q.startBounds};if(v.width=Math.max(0,p+X),v.height=Math.max(0,L+g),re.direction[0]===-1&&(v.width=Math.max(0,Math.min(Q.startBounds.x+p,p-x))),re.direction[1]===-1&&(v.height=Math.max(0,Math.min(Q.startBounds.y+L,L-F))),Re&&(O.isLockAspectRatio()||re.inputEvent?.shiftKey)){const P=p/L,Z=v.width/v.height;Z>P?v.height=v.width/P:Z<P&&(v.width=v.height*P)}re.direction[0]===-1&&(v.x=Math.max(0,Math.min(Q.startBounds.x+p,Q.startBounds.x+p-v.width))),re.direction[1]===-1&&(v.y=Math.min(Q.startBounds.y+L,Q.startBounds.y+L-v.height)),Q.movable.setBounds(n.toAbsoluteBounds(v))}},onResizeEnd:re=>{j(!1),Se()},onDragStart:re=>{me(re.target,"Move")},onDrag:re=>{if(!ae.current)return re.stopDrag(),void qe();I(!0);for(let Re=0;Re<y.length;Re++){const ze=y[Re],ye=K.current.get(ze);ye?ye.movable.setBounds(n.toAbsoluteBounds({...ye.startBounds,x:ye.startBounds.x+re.translate[0],y:ye.startBounds.y+re.translate[1]})):console.warn("invalid element")}},onDragEnd:re=>{},onMouseUp:re=>{}})}),[Ve,Ee,y,n,u,R,h,S,M]);return c.jsx("div",{className:yt(C,"movable-area",ei),style:{width:G.width,height:G.height,...k,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Xt([Me,be]),...D,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:G.width,height:G.height},...D,children:c.jsxs("div",{ref:z,style:{position:"absolute",pointerEvents:"auto"},onFocus:re=>{V?.(),Ce(!0)},onBlur:re=>{Ce(!1)},onKeyDownCapture:re=>{if(re.isDefaultPrevented())return;const Re=re.nativeEvent.ctrlKey,ze=re.nativeEvent.altKey,ye=re.nativeEvent.shiftKey;if(re.which===r.KeyCodes.Escape){const X=a.getMovableSelection();let g=[...X];return y.forEach(x=>{if(g.length===0)return;const F=H.current.get(x);let p=g.indexOf(F);g.splice(p,1)}),g.length!==X.length&&a.selectMovables(g),g.length===0&&T?.(),void re.preventDefault()}const Ae=.1,A=X=>{i.updateSelected(g=>{g.setRotation(g.getRotation()+X)},"Rotate")},Q=(X,g=!0)=>{i.updateSelected(x=>{const F=x.getBounds();let p=1+X;g||(p=1/p);const L=Math.sqrt(Math.pow(F.width,2)+Math.pow(F.height,2)),v=Math.atan2(F.height,F.width),P=p*L;if(P<10)return;const Z=P*Math.cos(v),ee=P*Math.sin(v),ie={x:F.x+(F.width-Z)/2,y:F.y+(F.height-ee)/2,width:Z,height:ee};x.setBounds(ie)},"Resize")},O=X=>{i.updateSelected(g=>{const x=g.getBounds(),F={x:x.x+(X.x??0),y:x.y+(X.y??0),width:x.width+(X.width??0),height:x.height+(X.height??0)};g.setBounds(F)},"Nudge")};if(re.which===r.KeyCodes.Delete)i.updateSelected(X=>{X.delete()},"Delete"),re.preventDefault();else if(re.key==="a"&&Re){const X=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(X,!0),re.preventDefault()}else re.key==="ArrowLeft"?(ye?Q(Ae,!1):ze?A(-10):O({x:Re?-10:-1}),re.preventDefault()):re.key==="ArrowRight"?(ye?Q(Ae,!0):ze?A(10):O({x:Re?10:1}),re.preventDefault()):re.key==="ArrowUp"?(ye?Q(Ae,!0):O({y:Re?-10:-1}),re.preventDefault()):re.key==="ArrowDown"&&(ye?Q(Ae,!1):O({y:Re?10:1}),re.preventDefault())},children:[le,$e]})})})})),Wt=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}},_o=(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,b=0;for(let h=0;h<e.length;h++){const C=e[h],k=C.getBounds();d+=k[l],m=Math.min(k[i],m),b=Math.max(k[i]+k[l],b),n.push({bounds:k,movable:C})}const u=(b-m-d)/(e.length-1);n.sort((h,C)=>{const k=h.bounds[i],q=C.bounds[i];return k!==q?k-q:h.bounds[a]-C.bounds[a]});const R=new Map;R.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const C=n[h-1].bounds,k={...n[h].bounds};k[i]=C[i]+C[l]+u,n[h].bounds=k,R.set(n[h].movable,k)}return R.set(n[n.length-1].movable,n[n.length-1].bounds),R};function Er(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,b=r.useEditMode();o.useRef(b.getMode()).current=b.getMode();const u=r.useCallbackRef(async(T,V,y=null,w=!0)=>{const S=async()=>{const j=await Promise.resolve(m?.showBusy?.(T.label()));try{await V();const M=y??T?.label?.();if(d){let I=null;T&&M!==!1&&(I=new r.SimpleCommand(T.key(),l,{label:M,description:M},S)),d(I)}j?.(),w&&b.setMode(null)}catch(M){j?.(),m?.showError?.(M)}};await S()},[d,m]),[R,h]=o.useReducer(T=>T+1,0),C=r.useCallbackRef((T,V,y)=>{if(!n)return;const w=n.getMovableSelection();if(w.length===0)return;let S="Drawings";if(w.length===1){const M=w[0];S=s.TextUtils.capitalize(M.getContent().getType())??"Drawing"}const j=`${T.label()} ${S}`;u(T,()=>{let M=null;i&&(M=i.beginCommit(j));const I=n.getMovableSelection();if(I.length===0)return;const $=y?.(I);for(let _=0;_<I.length;_++){const H=I[_];V(H,$)}M?.commit()})},[n,i]),[k,q]=o.useState(n.getMovableSelection()[0]??null),[E,D]=o.useState(!k||k?.isProtected()),G=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(){C(this,T=>{T.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(){C(this,T=>{T.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(){C(this,T=>{T.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(){C(this,T=>{T.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){C(this,T=>{T.setLockAspectRatio(!T.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(){C(this,T=>{T.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(){C(this,T=>{T.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(){C(this,T=>{T.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){C(this,(T,V)=>{T.setBounds({x:V.x})},Wt)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){C(this,(T,V)=>{T.setBounds({x:(V.width-T.getBounds().width)/2+V.x})},Wt)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){C(this,(T,V)=>{T.setBounds({x:V.width-T.getBounds().width+V.x})},Wt)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){C(this,(T,V)=>{T.setBounds({y:V.y})},Wt)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){C(this,(T,V)=>{T.setBounds({y:(V.height-T.getBounds().height)/2+V.y})},Wt)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){C(this,(T,V)=>{T.setBounds({y:V.height-T.getBounds().height+V.y})},Wt)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){C(this,(T,V)=>{T.setBounds(V.get(T))},T=>_o(T))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){C(this,(T,V)=>{T.setBounds(V.get(T))},T=>_o(T,!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,k]);o.useEffect(()=>{},[b]);const U=o.useMemo(()=>{let T=null;return T=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),T.addCommands(G,!0),T},[a,G]);return et(k,{onAnyChange:()=>{U.getCommand("formatAnchorTypeTwoCell").update({state:k?.getAnchorType()===s.IAnchored.Type.TwoCell}),U.getCommand("formatAnchorTypeOneCell").update({state:k?.getAnchorType()===s.IAnchored.Type.OneCell}),U.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("toggleLockAspectRatio").update({state:k?.isLockAspectRatio()})},onProtectedChange:T=>{D(T.isProtected())},onDelete:()=>{}}),et(n,{onMovableSelectionChange:()=>{const T=n.getMovableSelection()[0]??null;q(T),D(!T||T.isProtected()),h()}}),et(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const T={disabled:E};U.getCommand("formatAnchorTypeTwoCell").update(T),U.getCommand("formatAnchorTypeOneCell").update(T),U.getCommand("formatAnchorTypeAbsolute").update(T),U.getCommand("toggleLockAspectRatio").update(T);const V=t.getCount(),y=n.getMovableSelection(),w=E||V<=1||y.length===0;let S={disabled:w},j=S;if(!w&&y.length===1){const $=y[0];$.getZIndex()===0&&(S={disabled:!0}),$.getZIndex()===V-1&&(j={disabled:!0})}U.getCommand("moveToFront").update(j),U.getCommand("moveForward").update(j),U.getCommand("moveToBack").update(S),U.getCommand("moveBackward").update(S);const M={disabled:E||y.length<=1};U.getCommand("formatDrawAlignLeft").update(M),U.getCommand("formatDrawAlignCenter").update(M),U.getCommand("formatDrawAlignRight").update(M),U.getCommand("formatDrawAlignTop").update(M),U.getCommand("formatDrawAlignMiddle").update(M),U.getCommand("formatDrawAlignBottom").update(M),U.getCommand("formatDrawFlipHorz").update(M),U.getCommand("formatDrawFlipVert").update(M),U.getCommand("formatDrawGroup").update(M),U.getCommand("formatDrawUngroup").update(M),U.getCommand("formatDrawSwapShapes").update(M),U.getCommand("formatDrawSwapShapesHorz").update(M),U.getCommand("formatDrawSwapShapesVert").update(M);const I={disabled:E||y.length<=2};U.getCommand("formatDrawDistributeHorz").update(I),U.getCommand("formatDrawDistributeVert").update(I)},[R,E,R]),U}const ti=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:b,...u}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:C,width:k}]=Ot();return c.jsx("div",{...u,ref:Xt([R,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})})})})),ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:b,onRepeatCommandChange:u}=e,R=Er({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:u,commands:d,target:m,notifier:b});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Tr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{R.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,R]);return h&&n?h:null})),oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:b,notifier:u=r.DefaultNotifier}=e,R=r.useEditMode(),[h,C]=o.useState(null),[k,q]=o.useState(null),[E,D]=o.useState(null),[G,U]=o.useState(null),[T,V]=o.useState(null);o.useLayoutEffect(()=>{if(E===null)return U(null),void V(null);const z=()=>{const ae=i.getRange(E).getCell(),ve=ae.getStyle();let Ve,qe=ve.getFill()?.toCSS(a.body.darkMode);qe.background!=="none"&&qe.background!=="transparent"||(qe=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),qe.background!=="none"&&qe.background!=="transparent"||(qe={background:a.body.fill}),U({style:qe}),ae&&!ae.getFormula()&&(Ve=ae?.getRenderHorizontalAlignment()),V(Ve??r.HorizontalAlignment.Left)};return z(),i.getRange(E).addListener(()=>{z()})},[i,E,a?.body]);const y=r.useCallbackRef(()=>{let z=k.editState.dirty??"";if(k.editState.dirty!==void 0){const ae=s.TextUtils.clampString(z);try{const ve=k.sheet.getRange(k.coords),Ve=`Typing '${ae}' into ${ve.toString()}`;return ve.setValue(z,{description:Ve,autoFit:!0}),D(null),q(null),R.setMode(null),m(null),!0}catch(ve){throw u.showError(new Error(`Unable to enter '${ae}'.`,{cause:ve})),ve}}},[i,k,u]),w=r.useCallbackRef(z=>i.getRange(z).getCell().getExtrusions()??ge.CoordUtils.cellToRange(z),[i]),S=r.useCallbackRef(z=>{let ae=s.IRange.Orientation.Row,ve=!1;z!==s.IRange.Direction.Up&&z!==s.IRange.Direction.Down||(ae=s.IRange.Orientation.Column),z!==s.IRange.Direction.Left&&z!==s.IRange.Direction.Up||(ve=!0),i.getSelection().traverse(ae,ve)},[i]),j=o.useCallback((z,ae)=>{if(l)return l(z,ae);if(!i)return null;const{ref:ve,...Ve}=z;return c.jsx(wr,{ref:ve,...Ve,sheet:i,bodyStyle:a?.body,activeCoords:ae,commands:b,onChangeEdit:qe=>{const ue={sheet:i,coords:ae,editState:qe};R.setMode(ke=>({...ke,description:ue.editState.editMode?"Edit":"Enter",args:{...ke?.args,stateAndCoords:ue}}))},editState:k.editState})},[i,G,l,k,E]),{overlay:M,startEdit:I,submitEdit:$,cancelEdit:_,onKeyboardEventNative:H,onPointerEventNative:B}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:j,canEdit:()=>{const z=i.getProtection();if(z.isReadOnly())return!1;const ae=z.isLocked();return ae&&d(),!ae},onBeforeStartEdit:z=>{const ae=xr(()=>i.getRange(z).getCell()),ve={sheet:i,coords:z,editState:Object.freeze(ae)};R.setMode({key:"edit",args:{stateAndCoords:ve}}),q(ve)},onStartEdit:z=>{D(z),m(z)},onSubmitEdit:y,onCancelEdit:z=>{D(null),q(null),R.setMode(null),m(null)},onDoneEdit:z=>{R.setMode(null)},onNavigate:S,containerProps:G,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:T,getRangeCoords:w});et(i.getSelection(),{onChange(z){C(i.getSelection().getCoords().cell)}});const K=r.useCallbackRef(z=>{B(z),E&&$()},[B,_,E]),oe=o.useCallback(z=>{B(z)},[B]),N=o.useCallback(z=>{H(z)},[H]);return o.useEffect(()=>{const z=n?.getStage();if(z)return z.addEventListener("pointerdown",K),z.addEventListener("dblclick",oe),z.addEventListener("keydown",N),()=>{z.removeEventListener("pointerdown",K),z.removeEventListener("dblclick",oe),z.removeEventListener("keydown",N)}},[n?.getStage()]),o.useEffect(()=>{const z=R.getMode(),ae=z?.key;ae==="edit"||ae==="enter"?k?z.args?.cancel?_():z.args?.submit?$():q(z.args?.stateAndCoords):I(z.args?.start):E&&_()},[R]),M(n,t)})),Fr="white",Ar="black",ri=`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='${Ar}' fill='${Fr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,li=`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='${Ar}' fill='${Fr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ii=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),[b,u]=o.useState(null),[R,h]=o.useState(null),[C,k]=o.useState(null),q=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const y=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(y.length>0?y:null)}else l(!1),m(null)},[i,n]),E=r.useCallbackRef(y=>{y.preventDefault(),y.stopPropagation();const w=n.getCellCoordsFromClient(y.clientX,y.clientY),S=i.getTables().getItems({address:w});S.length===1&&S[0].select()},[n,i]),D=r.useCallbackRef(y=>{y.preventDefault(),y.stopPropagation();const w=n.getCellCoordsFromClient(y.clientX,y.clientY),S=i.getTables().getItems({address:w});if(S.length===1){const j=S[0].getRange().getCoords(),M={colStart:j.colStart,rowStart:w.rowIndex,colEnd:j.colEnd,rowEnd:w.rowIndex};i.getRange(M).select()}},[n,i]),G=r.useCallbackRef(()=>{if(!a)return;const y=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(y.length>0?y:null)},[i,a,n]);et(i?.getSelection(),{onChange(y){u(i.getSelection().getCoords().cell)}}),et(R,{onAnyChange(y){q(),G()}}),et(C,{onAnyChange(y){G()}}),et(i,{onTablesChange(y){q(),G()},onInvalidated(y){q(),G()}});const U=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(G,300),300),[]);o.useEffect(()=>{U()},[n]),o.useEffect(()=>{let y=null;if(d)for(let w=0;w<d.length&&!y;w++){const S=d[w],j=S.getRange().getCoords();s.CoordUtils.isCellWithinRange(b,j)&&(y=S)}h(y)},[b,d]);const T=r.useCallbackRef(y=>{let w=null;if(d)for(let S=0;S<d.length;S++){const j=d[S],M=j.getRange().getCoords();let I=n.getRangeCoordsBounds(M);const $=n.getRelativePointFromClient(y.clientX,y.clientY),_=$.x,H=$.y;if(_>=I.x&&_<=I.x+I.width&&H>=I.y&&H<=I.y+I.height){const B=n.getViewportSize();_<=0||H<=0||_>=B.width||H>=B.height||(w=j)}}k(w)},[n,d]);if(o.useEffect(()=>{const y=n?.getStage();if(y&&d)return y.addEventListener("mousemove",T),y.addEventListener("mouseleave",T),()=>{y.removeEventListener("mousemove",T),y.removeEventListener("mouseleave",T)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const V=[];for(let y=0;y<d.length;y++){const w=d[y];if(w.isClosed())continue;const S=w===C,j=w===R,M=w.getRange().getCoords(),I=n.getRangeCoordsBounds(M);let $;if(S||j){const _=w.getStyle().getProperties(),H=_.headerRow?.fill?.background??_.wholeTable?.border?.top?.color?.toString();if(H&&i){const B=i.getStyles().parseColor(H);B&&($=B.toCSS())}$||($="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}V.push(c.jsx("div",{style:{position:"absolute",left:I.x,top:I.y,width:Math.min(16,I.width),height:I.height,pointerEvents:"all",cursor:ri},onMouseDown:D},`table-select-row-${w.getName()}`)),V.push(c.jsx("div",{style:{position:"absolute",left:I.x,top:I.y,width:Math.min(16,I.width),height:Math.min(16,I.height),pointerEvents:"all",cursor:li},onMouseDown:E},`table-select-${w.getName()}`)),V.push(c.jsx(dt.Selection,{x:I.x,y:I.y,width:I.width,height:I.height,range:M,strokeWidth:j?.5:0,stroke:$??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:S?`${$} 0px 0px 1px 1px`:void 0}},`table-outline-${w.getName()}`))}return V})),ai=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,b]=o.useState(null),u=o.useRef(null),R=r.useCallbackRef(()=>{const D=i.getSelectedCell(),G=D.getSpill()?.getCoords()??null;ge.CoordUtils.isEqualRanges(G,l)||(b(G?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(G),coords:G}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(G))},[i,n,l]);o.useEffect(()=>(u.current&&(clearTimeout(u.current),u.current=null),m&&(u.current=setTimeout(()=>{b(null),u.current=null},a)),()=>{u.current&&(clearTimeout(u.current),u.current=null)}),[m,a]);const h=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(R,80),80),[]);if(et(i?.getSelection(),{onChange(D){h()}}),et(i,{onSpillsChange(D){R()},onInvalidated(D){R()}}),!n||!l&&!m)return null;const C=i.getRange(l).getValue()instanceof s.FormulaError.Spill,k=[];let q=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ge.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&b(null),q=n.toClipBounds(q,-10),!q)return;const E="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return k.push(c.jsx(dt.Selection,{x:q.x,y:q.y,width:q.width,height:q.height,range:l,strokeWidth:1,stroke:E,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:C?"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:`${E} 0px 0px 4px 0px`}},"spill-outline}")),k})),si={position:"absolute",top:0,left:0,bottom:0,right:0},Zo=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ge.CommonUtils.mergeContentful(e.body,l);return n.body=ge.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ge.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=ge.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ge.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ge.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ge.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelectAll,l),n},di={fireOnModelChange:!1},Xo={},Dr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Xo,headersStyle:a=Xo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:b,rowHeaderProps:u,showScrollbars:R=!0,scrollPaneProps:h,onViewportChange:C,commands:k,onRepeatCommandChange:q,onMoveCell:E,overlays:D,renderMovable:G,viewportComponent:U,onElementLoad:T,getCellEditor:V,onFocus:y,onBlur:w,style:S=r.ReactUtils.EmptyCssProperties,notifier:j,onShowTooltip:M,onShowColumnTooltip:I,onShowRowTooltip:$,onCloseTooltip:_,gridProps:H,cellRenderProps:B,...K}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[oe,N]=o.useReducer(te=>te+1,0),[z,{width:ae,height:ve}]=Ot(),Ve=r.useCallbackRef(M,[M]),qe=r.useCallbackRef(I,[I]),ue=r.useCallbackRef($,[$]),ke=r.useCallbackRef(_,[_]),Ke=o.useRef(!1);o.useLayoutEffect(()=>{Ke.current=!0},[n]);const Ue=n?.getStyles(),Te=o.useMemo(()=>Zo(i,Ue),[i,Ue]),he=o.useMemo(()=>Zo(a,Ue),[a,Ue]),{body:W={},buttonSurface:Fe={}}=Te,{header:Ce={},headerSelect:Y={},headerSelectAll:J={}}=he,ne=o.useRef(null),[le,me]=o.useState(()=>n?.getView()),Se=(le?.getZoomScale()??100)/100,de=o.useMemo(()=>({vertical:le.isShowColumnGridlines()&&Se>=.4,horizontal:le.isShowRowGridlines()&&Se>=.4}),[le?.isShowColumnGridlines(),le?.isShowRowGridlines(),Se]),be=o.useMemo(()=>{if(le?.getGridLineColor())return{strokeDasharray:"1,1"}},[le?.getGridLineColor(),Te]),Me=d??le?.isShowColumnHeaders(),Ee=b??le?.isShowRowHeaders(),[f,De]=o.useState({width:0,height:0}),Ye=o.useMemo(()=>{let te=40,Ie=20;const Pe=n?.getStyles().getNormal().getFont();if(f.width>0&&f.height>0){const Be=Pe?.toCSS()?.fontFamily??Te.header.text.fontFamily,Xe=Pe?.getSize()??Te.header.text.fontSize,Ge=s.IFont.getSharedMeasurer()(""+f.height,Math.ceil(Xe*s.IFont.getDeviceScale()),Be);te=Ge.width,Ie=Ge.lineHeight}return{width:Math.round(te+5),height:Math.round(Ie+3)}},[f,Te?.header.text,n]),He=Ee?Se*Ye.width:Ce.edgeStrokeWidth,$e=Me?Se*Ye.height:Ce.edgeStrokeWidth,re=Math.max(ae,(n?.getColumnHeaders().getDefaultSize()??Ye.width)+He+1),Re=Math.max(ve,(n?.getRowHeaders().getDefaultSize()??Ye.height)+$e+1),ze=o.useRef(new Map),ye=o.useRef(null),Ae=()=>({getColOffset:te=>n.getColumnHeaders().findOffset(te),getColIndex:te=>n.getColumnHeaders().findIndex(te),getRowOffset:te=>n.getRowHeaders().findOffset(te),getRowIndex:te=>n.getRowHeaders().findIndex(te)}),[A,Q]=o.useState(()=>Ae()),[O,X]=o.useState(!1),[g,x]=o.useState(null),F=!0,p=Te.selection?.strokeFill,L=o.useCallback(()=>Mt.current,[]),[v,P]=o.useState(),Z=r.useCallbackRef(te=>{P(te),n&&n.getView()&&n.getView().setTopLeft(te?{left:te.left,top:te.top}:null),C?.(te)},[n,C]),ee=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const te=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ee.current?.(),ee.current=te.addListener(()=>{const Ie=te.getCoords();ne?.current?.invalidate(Ie)})},[v,n]);const[ie,se]=o.useState(()=>n?.getView().getTopLeft()),ce=r.useCallbackRef(te=>{const Ie=ge.CoordUtils.cellToRange(te);if(n.isClosed())return Ie;const Pe=n.getRange(Ie,{excludeHidden:!0}).getMerges();return Pe.length===0?Ie:Pe[0]},[n]),we=te=>{if(!te||te.coords.colIndex===0&&te.coords.rowIndex===0)return null;const Ie={};return te.coords.colIndex>0&&(Ie[ge.AnchorLocation.Left]={index:te.coords.colIndex,scrollOffset:te.topLeft.left}),te.coords.rowIndex>0&&(Ie[ge.AnchorLocation.Top]={index:te.coords.rowIndex,scrollOffset:te.topLeft.top}),Ie},[fe,pe]=o.useState(()=>we(n.getView().getFreezePanes())),xe=r.useEditMode(),Oe=o.useCallback(()=>ne.current,[]),Ne=r.useCallbackRef(te=>{xe.setMode(Ie=>Ie?.key==="edit"?{...Ie,args:{...Ie.args}}:{key:"edit",args:{stateAndCoords:null,start:te}})},[]),We=r.useCallbackRef(()=>v,[v]),je=Mr({sheet:n,commands:k,target:Oe,onRepeatCommandChange:q,bodyStyle:W,notifier:j,onStartEdit:Ne,getViewport:We}),[_e,Le]=o.useState(n.getSelection().isEntire()),[Je,at]=o.useState(le?.getMovableSelection().length>0),ft=g!==null||Je,xt=null,[Ze,lt]=o.useState(!1);o.useEffect(()=>{lt(!1)},[n.getProtection()]);const pt=r.useCallbackRef(()=>{Ze||(lt(!0),j.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}))},[j,Ze]),wt=o.useMemo(()=>{const te=xe.getMode();return te?.cursor?te.cursor:null},[xt,xe]),[vt,gt]=o.useState(null),it=o.useRef(!1),[Et,Bt]=o.useState([]),Qt=o.useRef(null),[Dt,en]=o.useState(ge.TypesUtils.EmptyTopLeft),[Tt,xn]=o.useState(ge.TypesUtils.EmptyTopLeft);o.useEffect(()=>{en({left:ie?.left,top:0})},[ie?.left]),o.useEffect(()=>{xn({left:0,top:ie?.top})},[ie?.top]),et(n?.getView(),{onFreezeSplitChange:()=>{pe(we(n.getView().getFreezePanes()))},onTopLeftChange:()=>{se(n.getView().getTopLeft())},onMovableSelectionChange:()=>{at(n.getView().getMovableSelection().length>0)}}),et(n?.getSelection(),{onChange:()=>{Le(n.getSelection().isEntire())}}),et(n,{onViewChange(){me(n.getView()),Q(Ae())},onLayoutChange:()=>{const te=n.getEntireRange();De({height:te.getRowCount(),width:te.getColumnCount()}),Q(Ae())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),et(n,{onRequestScrollIntoView:async(te,Ie)=>{if(!Ie)return;const Pe={colIndex:Ie?.coords.colStart,rowIndex:Ie?.coords.rowStart};return await ne.current?.scrollCellCoordsIntoView(Pe,Ie?.scroll),!0},onRequestFocus:()=>ge.CommonUtils.whenFocus(Mt.current)},di);const Ct=o.useRef(!1),Vt=o.useMemo(()=>{const te=ge.CommonUtils.debounce(Be=>{requestAnimationFrame(()=>{it.current&&qe?.(Be)})},32),Ie=(Be,Xe)=>{it.current=!0,gt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:0,rowEnd:f.height,colStart:Be,colEnd:Be})))return;const rt=Ge.getLayout(),ot=Math.max(0,rt.getColOffset(Be)),nt=Ge.getBounds(),bt=Math.min(nt.x+nt.width,rt.getColOffset(Be+1)),It=Ge.getAnchor();if(Xe!==null&&(It===ge.AnchorLocation.Left||It===ge.AnchorLocation.Center||It===ge.AnchorLocation.Right)){const to=ge.CommonUtils.roundAccurately(Xe*ge.CommonUtils.getDPI(),0),kn=ge.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Xe/Se),2).toFixed(2),no="Width: "+(Xe?kn+" ("+to+" pixels)":"Hidden"),ln=Kt.current.getGridElement().getRelativePointFromClient(0,0),$t=0-ln.y,Mn=0-ln.y+$e,oo=ln.x-nt.x;te({anchor:{x:ot-oo,y:$t,width:bt-ot,height:Mn-$t},display:no})}const Nt=[0,0,0,nt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},Jn={x:ot-1,y:0,width:1,height:nt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},eo={x:bt-1,y:0,width:1,height:nt.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Nt,bounds:Jn,...Yn}),c.jsx(dt.SVGLine,{linePoints:Nt,bounds:eo,...Qn})]},"resize-dividers")}])};let Pe=null;return{onResizeHeadersStart:(Be,Xe,Ge)=>{Pe=n.beginCommit(Ge),Ct.current=!1,Ie(Be,Xe)},onResizeHeaders:(Be,Xe,Ge)=>{Ct.current=!1,Ie(Be,Xe)},onResizeHeadersDown:(Be,Xe)=>{Ct.current=!0,setTimeout(()=>{Ct.current&&Ie(Be,Xe)},360)},onResizeHeadersEnd:(Be,Xe,Ge)=>{Pe?.commit({description:Ge}),Pe=null,Ct.current=!1,requestAnimationFrame(()=>ke?.()),it.current=!1,gt(null)},onResizeHeadersUp:Be=>{Ct.current=!1,requestAnimationFrame(()=>ke?.()),it.current=!1,gt(null)},...m}},[n,m,$e,vt]),tn=o.useMemo(()=>{const te=ge.CommonUtils.debounce(Be=>{requestAnimationFrame(()=>{it.current&&ue?.(Be)})},32),Ie=(Be,Xe)=>{it.current=!0,gt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:Be,rowEnd:Be,colStart:0,colEnd:f.width})))return;const rt=Ge.getLayout(),ot=Math.max(0,rt.getRowOffset(Be)),nt=Ge.getBounds(),bt=Math.min(nt.y+nt.height,rt.getRowOffset(Be+1)),It=Ge.getAnchor();if(Xe!==null&&(It===ge.AnchorLocation.Top||It===ge.AnchorLocation.Center||It===ge.AnchorLocation.Bottom)){const to=Math.floor(10*ge.CommonUtils.getDPI())/10,kn=ge.CommonUtils.roundAccurately(Xe*to,0),no=ge.CommonUtils.roundAccurately(kn/Se/(n?.getRowHeaders().getScaleFactor()*ge.CommonUtils.getDPI()),2).toFixed(2),ln="Height: "+(Xe?no+" ("+kn+" pixels)":"Hidden"),$t=Ut.current.getGridElement().getRelativePointFromClient(0,0),Mn=0-$t.x,oo=0-$t.x+He,bl=$t.y-nt.y;te({anchor:{x:Mn,y:ot-bl,width:oo-Mn,height:bt-ot},display:ln})}const Nt=[0,0,nt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},Jn={x:0,y:ot-1,width:nt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},eo={x:0,y:bt-1,width:nt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Nt,bounds:Jn,...Yn}),c.jsx(dt.SVGLine,{linePoints:Nt,bounds:eo,...Qn})]},"resize-dividers")}])};let Pe=null;return{onResizeHeadersStart:(Be,Xe,Ge)=>{Pe=n.beginCommit(Ge),Ct.current=!1,Ie(Be,Xe)},onResizeHeaders:(Be,Xe,Ge)=>{Ct.current=!1,Ie(Be,Xe)},onResizeHeadersDown:(Be,Xe)=>{Ct.current=!0,setTimeout(()=>{Ct.current&&Ie(Be,Xe)},360)},onResizeHeadersEnd:(Be,Xe,Ge)=>{Pe?.commit({description:Ge}),Pe=null,Ct.current=!1,requestAnimationFrame(()=>ke?.()),it.current=!1,gt(null)},onResizeHeadersUp:Be=>{Ct.current=!1,requestAnimationFrame(()=>ke?.()),it.current=!1,gt(null)},...u}},[n,u,He]),Mt=r.useImperativeElement(t,()=>{const te=Pe=>{n?.getView()&&n.getView().selectMovables([]),ye.current=null,ne?.current?.focus(Pe)},Ie=async(Pe=null)=>{if(Pe||(Pe=n?.getView().getMovableSelection()[0]),!Pe)return!1;const Be=Pe.getAnchorCoords();if(!Be)return!1;const Xe=ne.current?.getViewFromCellCoords({colIndex:Be.colStart,rowIndex:Be.rowStart});if(!Xe)return!1;const Ge=Xe.getAnchor();n?.getView().getMovableSelection().indexOf(Pe)===-1&&n?.getView().selectMovables([Pe]);let rt=ze.current?.get(Ge);return rt?.current?(await rt.current.focusMovable(Pe),!0):(ye.current={movable:Pe,anchor:Ge},!0)};return{getGridElement:()=>ne.current,getRowHeaderElement:()=>Ut.current,getColumnHeaderElement:()=>Kt.current,rowHeaderHeight:()=>$e,colHeaderWidth:()=>He,startEdit:Ne,submitEdit:()=>{xe.setMode(Pe=>Pe?.key!=="edit"?Pe:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{xe.setMode(Pe=>Pe?.key!=="edit"?Pe:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:g!==null,focus:Pe=>{n?.getView().getMovableSelection().length>0&&Ie()||te(Pe)},focusSheet:te,focusMovable:Ie,contains:Pe=>ne?.current?.contains?.(Pe),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),zt=o.useCallback(te=>{Ke.current||(ne?.current?.invalidate(te),N?.())},[]);o.useEffect(()=>{zt()},[Te]);const qn=_e?J.edgeStrokeFill:Ce.fill,tt=_e?Y.fill:typeof Te.headerHover=="function"?Te.headerHover(Ce)?.fill:Ce.fill,Sn=o.useMemo(()=>U?c.jsx("div",{className:yt("sheetxl-viewport-overlay",Dl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:U}):c.jsx(c.Fragment,{}),[U]);let Pt=null;Me&&Ee&&(Pt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${$e}px`,width:`${He}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:te=>{let Ie=!te.ctrlKey;je?.getCommand("selectAll")?.execute(!Ie||te.button!==0),te.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:-1,colIndex:-1}):ne.current?.focus()},children:[c.jsx("div",{style:{height:$e-5+"px",width:$e-5+"px",clipPath:`path('M${$e-5} 0 L0 ${$e-5} L${$e-5} ${$e-5} L${$e-5} 0 Z')`,borderRight:`2px solid ${qn}`,borderBottom:`2px solid ${qn}`,background:`${tt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${$e}px`,width:`${He}px`,boxSizing:"border-box",borderRight:`solid 1px ${Ce.strokeFill}`,borderBottom:`solid 1px ${Ce.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const nn=r.useCallbackRef(({_left:te,_top:Ie})=>{},[]),st=r.useCallbackRef(te=>{if(!l)return;const Ie=ne.current.getViewFromClient(te.clientX,te.clientY)?.getCellCoordsFromClient(te.clientX,te.clientY);Ie&&(l({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:Ie.rowIndex,colIndex:Ie.colIndex}),te.stopPropagation(),te.preventDefault())},[l]),ht=r.useCallbackRef(te=>{if(!(!te.shiftKey&&(te.ctrlKey||te.metaKey)))return;const{deltaY:Ie}=te;return Ie>0?je.getCommand("sheetZoomOut")?.execute():Ie<0&&je.getCommand("sheetZoomIn")?.execute(),Ie===0},[je]);o.useEffect(()=>{Bt(null),Qt.current=null,it.current=!1,gt(null);const te=n?.getView().getTopLeft();nn(te),ne.current?.scrollTo(te),se(te),me(n.getView()),pe(we(n.getView().getFreezePanes())),Q(Ae()),N()},[n?.getView()]);const on=r.useCallbackRef(te=>{const Ie=te.getVisibleRangeCoords();if(!Ie)return null;const Pe=[];return n.getRange(Ie).forEach((Be,Xe)=>{const Ge=Xe.getCoords(),rt=Xe.getCell();(ot=>{if(ot.isEmpty())return!1;const nt=ot.getSpans();if(nt.width>1||nt.height>1||ot.getStyle().hasVisibleStyling()||le.isShowFormulas()&&ot.getFormula()!==null)return!0;const bt=ot.getValue();return bt!==null&&!(!le.isShowZeros()&&bt===0&&ot.getType()===s.ScalarType.Number)})(rt)&&Pe.push({coords:Ge,value:rt,range:le.isShowFormulas()?null:rt.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Pe},[n,le.isShowZeros(),le.isShowFormulas(),g]);o.useEffect(()=>{const te=[];D&&te.push(...D),vt&&te.push(...vt),ge.CommonUtils.isEqualArrays(te,Qt.current)||(Qt.current=te,Bt(te))},[D,vt,Te]);const rn=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[Te?.header?.edgeStrokeFill]),Ht=r.useCallbackRef(te=>{te.isDefaultPrevented()||te.isPropagationStopped()||(ye.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const te=xe.getMode();return te?.key==="cut"||te?.key==="copy"},[xe]),Gn=r.useCallbackRef(async te=>{const Ie=xe.getMode();return te.keyCode===r.KeyCodes.Escape&&Ie?(te.preventDefault(),void xe.setMode(null)):te.keyCode===r.KeyCodes.Enter&&Wn?(te.preventDefault(),await je?.getCommand("paste")?.execute(),void xe.setMode(null)):void je?.dispatchToFocusedCommand(te)},[je,xe]),Ut=o.useRef(null),Rn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${$e+1}px`,width:`${He+Ce.edgeStrokeWidth}px`,minWidth:`${He+Ce.edgeStrokeWidth}px`,borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,height:`calc(100% - ${$e}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Wo,{ref:Ut,sheetElement:Mt.current,gridRef:ne,freezeStart:fe?.[ge.AnchorLocation.Top],oppositeSize:He,containerWidth:He,containerHeight:Re,sheetHeader:n.getRowHeaders(),gridStyle:he,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Tt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${$e+1}px`,width:`${He+Ce.edgeStrokeWidth}px`,minWidth:`${He+Ce.edgeStrokeWidth}px`,borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,height:`calc(100% - ${$e}px)`,boxSizing:"border-box",zIndex:"2",...tn?.style},...tn})}),[He,$e,Re,n,Tt,fe?.[ge.AnchorLocation.Top],Te,F,l,Ce.fill,u]),Kt=o.useRef(null),gl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${$e+Ce.edgeStrokeWidth}px`,minHeight:`${$e+Ce.edgeStrokeWidth}px`,borderBottom:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Wo,{ref:Kt,sheetElement:Mt.current,gridRef:ne,freezeStart:fe?.[ge.AnchorLocation.Left],oppositeSize:$e,containerWidth:re,containerHeight:$e,sheetHeader:n.getColumnHeaders(),gridStyle:he,scrollPoint:Dt,onSheetContextMenu:l,...Vt,style:{...Vt?.style,position:"relative",left:"0px",width:"100%",height:`${$e+Ce.edgeStrokeWidth}px`,minHeight:`${$e+Ce.edgeStrokeWidth}px`,borderBottom:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[$e,re,n,Dt,fe?.[ge.AnchorLocation.Left],Te,Ce.fill,F,l,m]),hl=r.useCallbackRef(te=>{const{value:Ie,key:Pe,...Be}=te;let Xe=Ie,Ge=g;if(!Ge||Ge.colIndex===te.coords.colIndex&&Ge.rowIndex===te.coords.rowIndex||(Ge=null),!Xe){const nt=te.range;if(Xe=n.getRange({rowIndex:nt.rowStart,colIndex:nt.colStart}).getCell(),Xe.isEmpty())return null}let rt=null;Xe.getHyperlink()&&(rt=async nt=>{if(B?.onLinkMouseDown?.(nt),nt.button===0&&!nt.isDefaultPrevented()){nt.stopPropagation(),nt.preventDefault();try{await Xe.getHyperlink()?.open()}catch(bt){j?.showError?.(bt)}}}),Ge&&Ge.colIndex===te.range.colStart&&Ge.rowIndex===te.range.rowStart&&(Xe=Xe.createTemporaryCell({value:null}));const ot=n.getStyles();return o.createElement(yr,{...Be,key:Pe,bodyStyle:W,docTheme:ot.getTheme(),normalStyle:ot.getNormal(),showFormulas:le.isShowFormulas(),showZeros:le.isShowZeros(),onLinkMouseDown:rt,...B,value:Xe})},[n,A,W,g,le?.isShowFormulas(),le.isShowZeros()]),ml=o.useCallback((te,Ie)=>{const{key:Pe,...Be}=te;return[c.jsx(Ll,{ref:Ie,getVisibleCells:on,sheet:n,gridStyle:Te,...Be},`border-${Pe}`),c.jsx(ii,{ref:Ie,sheet:n,commands:je,...Be},`table-${Pe}`),c.jsx(ai,{ref:Ie,sheet:n,...Be},`spill-${Pe}`),c.jsx(Yl,{ref:Ie,sheet:n,commands:je,notifier:j,onShowTooltip:Ve,onCloseTooltip:ke,gridStyle:Te,gridRef:ne,editingCoords:g,isActive:F,...Be},`selection-${Pe}`),c.jsx(Kl,{ref:Ie,sheet:n,commands:je,gridStyle:Te,element:L,notifier:j,...Be},`copy-paste-${Pe}`),c.jsx(ni,{ref:Ie,sheet:n,commands:je,target:Oe,notifier:j,renderMovable:G,movableProps:{onUnFocus:()=>{Mt.current.focus()}},...Be},`movable-${Pe}`),c.jsx(oi,{ref:Ie,sheet:n,commands:je,notifier:j,gridStyle:Te,getCellEditor:V,showProtectedError:pt,setEditingCoords:x,...Be},`editor-${Pe}`)]},[n,ne.current,Te,V,je,j]),[Eo,fl]=o.useState(!1),pl=o.useMemo(()=>{if(re===0||Re===0)return null;const te=n.getStyles().getNormal(),Ie=te.getFont(),Pe=te.getFill(),Be=te.getBorder(),Xe=te.getFill().getType()===s.IFill.Type.None;let Ge=be,rt=be;const ot=(bt,It,Nt)=>Nt?{stroke:Be.getBottom().isNone()?"none":bt.getColor().toRGBA(W.darkMode).toString(),...It}:It;rt=ot(Be.getBottom(),rt,!Be.getBottom().isNone()),rt=ot(Be.getTop(),rt,!Be.getTop().isNone()),Ge=ot(Be.getRight(),Ge,!Be.getRight().isNone()),Ge=ot(Be.getLeft(),Ge,!Be.getLeft().isNone());let nt=le?.getGridLineColor()?.toRGBA(W.darkMode).toString()??W.strokeFill;return Xe||(rt=ot(Be.getBottom(),rt,!0),rt=ot(Be.getTop(),rt,!0),Ge=ot(Be.getRight(),Ge,!0),Ge=ot(Be.getLeft(),Ge,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...si,...Pe.toCSS(W.darkMode),...Ie.toCSS(W.darkMode,Se),"--sxl-app-color-background":W.fill,"--sxl-app-color-shadow":Te.colorShadow,"--sxl-app-color-grey":Te.colorGrey,"--sxl-app-color-button-fill":Fe.fill,"--sxl-app-color-button-text":Fe.text?.fill,"--sxl-app-color-button-border":Fe.edgeStrokeFill,"--sxl-app-color-primary-dark":Te.selection.strokeFill},ref:ne,zoom:Se,...H,onFirstRender:bt=>{fl(!0),H?.onFirstRender?.(bt),je?.activate()},showGridLines:de,gridLineColor:nt,gridLineColumnsProps:Ge,gridLineRowsProps:rt,freezeLeft:fe?.[ge.AnchorLocation.Left],freezeLeftProps:rn,freezeTop:fe?.[ge.AnchorLocation.Top],freezeTopProps:rn,width:re,height:Re,columnCount:f.width,rowCount:f.height,cursor:wt??xt??"cell",clipCells:!0,layout:A,cellRenderer:hl,overlayRenderer:ml,getCellCoordsAsRangeCoords:ce,getVisibleCells:on,onWheelScroll:ht,onPointerDown:Ht,onKeyDown:Gn,onViewportChange:Z,onImmediateScroll:nn,scrollPoint:ie,stageProps:{onFocus:()=>{je?.activate()}},overlays:Et})},[oe]);o.useEffect(()=>{Ke.current||N()},[A,fe,Se,je,ie?.left,ie?.top,W,H,re,Re,wt,Et,F,xt]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};R||(_n={..._n,...S});const vl=o.useMemo(()=>{const te=n.getStyles().getTheme(),Ie=te.getColorScheme(),Pe=te.getFontScheme();return{"--sxl-doc-color-dk1":Ie.getDk1().toCSS(W.darkMode),"--sxl-doc-color-dk2":Ie.getDk2().toCSS(W.darkMode),"--sxl-doc-color-lt1":Ie.getLt1().toCSS(W.darkMode),"--sxl-doc-color-lt2":Ie.getLt2().toCSS(W.darkMode),"--sxl-doc-color-accent1":Ie.getAccent1().toCSS(W.darkMode),"--sxl-doc-color-accent2":Ie.getAccent2().toCSS(W.darkMode),"--sxl-doc-color-accent3":Ie.getAccent3().toCSS(W.darkMode),"--sxl-doc-color-accent4":Ie.getAccent4().toCSS(W.darkMode),"--sxl-doc-color-accent5":Ie.getAccent5().toCSS(W.darkMode),"--sxl-doc-color-accent6":Ie.getAccent6().toCSS(W.darkMode),"--sxl-doc-color-hlink":Ie.getHlink().toCSS(W.darkMode),"--sxl-doc-color-fol-hlink":Ie.getFolHlink().toCSS(W.darkMode),"--sxl-doc-font-major":Pe.getMajorFont(),"--sxl-doc-font-minor":Pe.getMinorFont()}},[n.getStyles().getTheme()]);let Zn=c.jsx("div",{style:_n,onTouchStart:()=>{Fo()},onFocus:te=>{X(!0),y?.(te)},onBlur:te=>{X(!1),w?.(te)},ref:Mt,...K,children:c.jsx("div",{className:yt("sheetxl-sheet",Al),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...vl},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Pt,Rn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[gl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,backgroundColor:W.fill},ref:z,onContextMenu:st,children:[pl,Sn,c.jsx(zl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Te?.selection?.strokeFill,colorCredits:Te?.body?.text?.fill})]})]})]})})});if(R){const te=Ie=>c.jsx(wo,{...Ie,sheet:n});Zn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Ce.fill}`,minHeight:2*Ye.height,minWidth:2*Ye.width,...S},viewport:v,touchElement:ne.current?.stage,disableTouch:ft,onScrollViewport:Ie=>{ne.current?.scrollTo(Ie)},createHorizontalScrollbar:te,createVerticalScrollbar:te,...h,children:Zn})}o.useEffect(()=>{Ke.current=!1,N?.(),O&&Mt.current?.focus()},[n]);const[Xn,Cl]=o.useState(!1),Fo=r.useCallbackRef(()=>{Xn||Cl(!0)},[Xn]);return o.useEffect(()=>{if(Eo)return typeof T=="function"&&T(),r.ReactUtils.detectIt().primaryInput==="touch"&&Fo(),()=>{}},[T,Eo,Xn]),Zn}));Dr.displayName="SheetElement";const ci=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Yo="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=",zr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:b,onHide:u,onShow:R,onKeyDownCapture:h,onFocus:C,onBlur:k,loadingPanel:q,...E}=e,[D,G]=o.useState(!1),[U,T]=o.useState(null),[V,y]=o.useState(null),[w,S]=o.useState(null);o.useEffect(()=>{y(null),l.getDetails().then(I=>{G(!1),y(I.asUrl()),I.asSVGText?.()&&S(I.asSVGText())}).catch(I=>{console.warn(I),G(!0),y(Yo),S(null)})},[l]);const j=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),M=o.useMemo(()=>{if(V||w)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:U?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:V,onLoad:()=>{T(!0)},onError:({currentTarget:I})=>{console.log("error"),I.onerror=null,y(Yo),G(!0)},alt:d??`${l.getType()}`})},[U,l,V,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,...E,onKeyDownCapture:I=>{h?.(I)},ref:j,children:[U||D?void 0:q,M]})}));zr.displayName="PictureEditor";const ui=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:b,...u}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:C,width:k}]=Ot();if(!a.isClosed())return c.jsx("div",{...u,ref:Xt([R,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()})})})})),gi="_editable-input_1bqx6_6",hi=e=>c.jsx("input",{...e}),Nr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:b=hi,notifier:u,styleHover:R={},dragging:h,maxLength:C,disabled:k=!1,readOnly:q=!1,...E}=e,[D,G]=o.useState(!1),[U,T]=o.useState(!1),[V,y]=o.useState(a);o.useEffect(()=>{y(a)},[a]);const w=o.useRef(null),[S,j]=o.useState(null),M=o.useCallback(function(oe){const N=oe.message;S!==N&&(u?.showMessage?.(N,{type:r.NotificationType.Error}),j(N))},[u,S]),I=o.useCallback(oe=>{let N=!1;try{N=l?.(oe)??!0}catch(z){M(z)}return N?(w.current=null,T(!1),y(oe),N):(setTimeout(()=>{w.current?.focus()},0),N)},[l]),$=r.useCallbackRef(()=>{y(a),w.current=null,T(!1),m?.()},[m,a]),_=o.useMemo(()=>{if(!U)return null;const oe={className:yt(gi),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:C,type:"text",value:V,onFocus:N=>{w.current||(w.current=N.target,setTimeout(()=>{N.target?.select()},0))},onBlur:N=>{w.current&&I(V)},onChange:N=>{U&&y(N.target.value)},onMouseDown:N=>N.stopPropagation(),onKeyDown:N=>N.code==="Escape"?(N.preventDefault(),void $()):N.code==="Enter"?(N.preventDefault(),void I(N.target.value)):void(N.code!=="Tab"?N.stopPropagation():I(N.target.value))};return c.jsx(c.Fragment,{children:b(oe)})},[U,V,I,$,b,k]),[H,B]=o.useState();o.useLayoutEffect(()=>{let oe=Object.assign({},n);(h||D)&&(oe=Object.assign(oe,R)),B(oe)},[h,D,R,n]),o.useEffect(()=>{_&&d?.(V)},[_,d,V]);const K=r.useImperativeElement(t,()=>({startEdit(){k||q||T(!0)},cancel(){$()}}),[]);return c.jsxs("div",{...E,ref:K,style:{flexDirection:"column",display:"flex",...H},className:yt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{k||q||T(!0)},onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:U?0:1},children:V}),_]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...R},children:V})]})})),Pn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Yt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function mt(e){var t,n;return e?Yt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=mt(e);return e instanceof t}function bn(e){return!Yt(e)&&e instanceof mt(e).HTMLElement}function Lr(e){return e instanceof mt(e).SVGElement}function Zt(e){return e?Yt(e)?e.document:xo(e)?qo(e)?e:bn(e)||Lr(e)?e.ownerDocument:document:document:document}const Rt=Pn?o.useLayoutEffect:o.useEffect;function Hn(e){const t=o.useRef(e);return Rt(()=>{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 pn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function un(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function zn(e){const t=Hn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Nn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let io={};function yn(e,t){return o.useMemo(()=>{if(t)return t;const n=io[e]==null?0:io[e]+1;return io[e]=n,e+"-"+n},[e,t])}function Or(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[b,u]of m){const R=l[b];R!=null&&(l[b]=R+e*u)}return l},{...t})}}const _t=Or(1),vn=Or(-1);function Un(e){if(!e)return!1;const{KeyboardEvent:t}=mt(e.target);return t&&e instanceof t}function Ln(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=mt(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 jt=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[jt.Translate.toString(e),jt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Jo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function mi(e){return e.matches(Jo)?e:e.querySelector(Jo)}const fi={display:"none"};function pi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:fi},n)}function vi(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 jr=o.createContext(null),Ci={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(S,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const w={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(S=>V.paste({...Vl,...S})).update(w),i.getCommand("pasteFormats").updateCallback((S,j)=>V.paste({...Pl,description:j.label(),...S})).update(w),i.getCommand("pasteFormulas").updateCallback((S,j)=>V.paste({...Hl,description:j.label(),...S})).update(w),i.getCommand("pasteTranspose").updateCallback((S,j)=>V.paste({...Ul,description:j.label(),...S})).update(w),i.getCommand("pasteLinks").updateCallback((S,j)=>V.paste({...Kl,description:j.label(),...S})).update(w),i.getCommand("cut").update(w),i.getCommand("paste").update(w)},[t,i]);const y=o.useMemo(()=>{if(!D||!q.current)return;const w=D.key;if(w!=="copy"&&w!=="cut"&&w!=="formatPainter")return;const S=q.current.getItem();if(S.getSource()!==t)return;const j=q.current.isCut?.(),M=j?R:u,I=j?b:m,$=S.getCoords(),_=$?[$]:null;return _&&_.length!==0?H=>{const B=[];for(let K=0;K<_.length;K++){const ne=_[K],N=H.toClipBounds(H.getRangeCoordsBounds(ne,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);N&&(B.push(k({range:ne,key:`copy-selection-background-${K}`,x:N.x,y:N.y,width:Math.max(N.width,0),height:Math.max(N.height,0),stroke:M,strokeWidth:2})),B.push(k({range:ne,key:`copy-selection-foreground-${K}`,x:N.x+(N.width<=2?-1:0),y:N.y,width:Math.max(N.width,3),height:Math.max(N.height,3),stroke:I,strokeWidth:2,isAnimatedStroke:!0})))}return B}:null},[D,t,n,m,u,b,R]);return{...V,clipboard:T,overlays:y}},$l=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,b=l.body??{},u=a.getView(),{overlays:R}=Ir({element:i,sheet:a,sheetView:u,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:b.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:b.fill,notifier:m});return et(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),R&&n?R(n):null})),Wl="_sheet-selection_12wyx_5",Gl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},_l={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Zl={key:"dragCopy",description:"Drag selection to copy cell contents."},Xl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Go=(e,t)=>t.ctrlKey&&t.shiftKey?Xl:t.ctrlKey?Zl:t.shiftKey?_l:Gl,Yl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:b,sheet:u,gridRef:R,gridStyle:h,isActive:C,editingCoords:k,...q}=e,E=n?.getBounds(),D=r.useCallbackRef(m,[m]),G=r.useCallbackRef(b,[b]),[U,T]=o.useState(()=>u?.getSelection().getCoords()),V=r.useCallbackRef(Y=>{ge.CoordUtils.isEqualSelectionCoords(Y,U)||u&&u.getSelection().updateCoords(Y)},[u,U]),y=r.useEditMode(),w=o.useRef(null),[S,j]=o.useState(u?.getProtection().isLocked()),[M,I]=o.useState(u?.getView().getMovableSelection().length>0),$=r.ReactUtils.detectIt().primaryInput==="touch",_=!$&&C,H=k!==null||M,B=r.useCallbackRef(Y=>{const J=ge.CoordUtils.cellToRange(Y);if(u.isClosed())return J;const re=u.getRange(J,{excludeHidden:!0}).getMerges();return re.length===0?J:re[0]},[u]),K=r.useCallbackRef((Y,J,re,le,me,ye)=>{const ae=u.getSelectedRange().getExtended(le,Y).getCoords();switch(le){case s.IRange.Direction.Up:return ae.rowStart;case s.IRange.Direction.Down:return ae.rowEnd;case s.IRange.Direction.Left:return ae.colStart;case s.IRange.Direction.Right:return ae.colEnd}},[u]),ne=r.useCallbackRef(()=>{const Y=u.getUsedRange()?.getCoords(),J=u.getRowHeaders().getUsedRange()?.getCoords(),re=u.getColumnHeaders().getUsedRange()?.getCoords();return{...Y,colEnd:Math.max(Y?.colEnd??0,re?.max??0),rowEnd:Math.max(Y?.rowEnd??0,J?.max??0)}},[u]),N=r.useCallbackRef((Y,J)=>u.getRowHeaders().hiddenHeadersAt(Y,J),[u]),z=r.useCallbackRef((Y,J)=>u.getColumnHeaders().hiddenHeadersAt(Y,J),[u]),se=r.useCallbackRef(Y=>u.getRange(Y,{excludeHidden:!0}).getMerges(),[u]),ve=r.useCallbackRef(Y=>{u?.getSelection().setAdjusting(Y)},[u]),Ve=r.useCallbackRef(async()=>{u?.getSelection().setAdjusting(null),y.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),y.setMode(null))},[y,U,u,i]),Se=o.useMemo(()=>{const Y=y.getMode();return Y?.key==="cut"||Y?.key==="copy"},[y]);et(u?.getView(),{onMovableSelectionChange:()=>{I(u.getView().getMovableSelection().length>0)}}),et(u?.getSelection(),{onChange(Y){const J=u.getSelection().getCoords();T(J)}}),et(u,{onProtectionChange:()=>{j(u.getProtection().isLocked())}});const{body:ue={}}=h||{},Me=n.getLayout(),Ke=!(_&&U.ranges.length<=1&&k===null&&!S&&(!y.getMode()||Se)),{cursor:Ue,overlay:Te,onPointerDown:he}=dt.useSelection({gridRef:R,commands:i,layout:Me,getCellCoordsAsRangeCoords:B,selection:U,fillHandleBorderColor:ue.fill,selectionBackgroundColor:C?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:C?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:C?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:C?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Ke,disableMoveDrag:$||!(C&&U.ranges.length<=1&&k===null&&!S),disableTouchSelection:H,onSelectionChange:V,onSelectionDragStart:ve,onSelectionDragEnd:Ve,onMoveDragStart:(Y,J,re)=>{y.setMode(Go(0,re))},onMoveDragUpdate:(Y,J,re)=>{y.setMode(Go(0,re))},onMoveDragEnd:(Y,J)=>{y.setMode(null)},onMoveDragDone:async(Y,J,re)=>{if(ge.CoordUtils.isEqualRanges(Y,J))return;const le=u.getRange(J);if(d?.showOptions){const Re=le.getDifferences(Y);let Ee=!1;const f=Re.getCount();for(let De=0;!Ee&&De<f;De++)Ee=Re.at(De).isContentful();if(Ee&&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 me=!re.ctrlKey,ye=re.shiftKey,ae=ye?me?"Insert Moved Cells":"Insert Copied Cells":me?"Move Cells":"Copy Cells",be=await d?.showBusy?.(ae);try{const Re=u.getRange(Y);await le.doBatch(async()=>{ye?await le.insertFrom(Y,{isCut:me,undoRange:Re}):await le.copyFrom(Y,{isCut:me,undoRange:Re}),Re.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),le.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:ae,autoSelect:!0})}catch(Re){d?.showError?.(Re)}finally{be?.()}},contentfulCellFinder:K,hiddenRowsAt:N,hiddenColumnsAt:z,mergedRanges:se,getDataCoords:ne,canSelectionSpanMergedCells:Y=>{const J=u.getRange(Y);return J.isEntireColumns()||J.isEntireRows()},onFill:async(Y,J)=>{const re="Auto Fill",le=await d?.showBusy?.(re);try{await u.doBatch(()=>{u.getRange(Y).autoFill(J),u.getRange(J).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:re,autoSelect:!0})}catch(me){d?.showError?.(me)}finally{w.current=null,le?.()}},onFillPreview:(Y,J,re)=>{if(R.current&&D){y.setMode(Yl);try{w.current?.direction!==re&&(w.current=null,u.getRange(Y).autoFill(J,{previewOnly:f=>{w.current={callback:f,direction:re}}}));const le=w.current?.callback?.(J);if(!le||le.isEmpty())return;const me=le.toText();if(!me)return;const ye=ge.CoordUtils.cellToRange(le.getCoords()),ae=n.getRelativePointFromClient(0,0);let be=0,Re=0,Ee=r.ToolTipPlacement.Bottom;if(re===s.IRange.Direction.Down){be=Me.getColOffset(ye.colEnd+1)-ae.x;const f=Me.getRowOffset(ye.rowEnd),De=Me.getRowOffset(ye.rowEnd+1);Re=De-(De-f)/2-ae.y,Ee=r.ToolTipPlacement.Right}else if(re===s.IRange.Direction.Right){Re=Me.getRowOffset(ye.rowEnd+1)-ae.y;const f=Me.getColOffset(ye.colEnd),De=Me.getColOffset(ye.colEnd+1);be=De-(De-f)/2-ae.x,Ee=r.ToolTipPlacement.Bottom}else if(re===s.IRange.Direction.Up){be=Me.getColOffset(ye.colEnd+1)-ae.x;const f=Me.getRowOffset(ye.rowStart),De=Me.getRowOffset(ye.rowStart+1);Re=De-(De-f)/2-ae.y,Ee=r.ToolTipPlacement.Right}else if(re===s.IRange.Direction.Left){Re=Me.getRowOffset(ye.rowEnd+1)-ae.y;const f=Me.getColOffset(ye.colStart),De=Me.getColOffset(ye.colStart+1);be=De-(De-f)/2-ae.x,Ee=r.ToolTipPlacement.Bottom}D({anchor:{x:be,y:Re},display:me,placement:Ee})}catch(le){d?.showError?.(le)}}},onFillDone:()=>{w.current=null,y.setMode(null),G?.()}}),W=r.useCallbackRef(Y=>{he(r.ReactUtils.createSyntheticEvent(Y))},[he,k]);o.useEffect(()=>{const Y=n?.getStage();if(Y)return Y.addEventListener("pointerdown",W),()=>{Y.removeEventListener("pointerdown",W)}},[n?.getStage()]);const Fe=r.useImperativeElement(t,()=>({}),[]),Ce=o.useRef(null);return c.jsx("div",{className:yt(a,"sheet-selection",Wl),style:{position:"absolute",width:E?.width,height:E?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Xt([Fe,Ce]),...q,children:Te(n)})})),Tn=Object.freeze({x:0,y:0,width:0,height:0}),Ql={fireOnModelChange:!1},ei=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:b,onUnFocus:u,isDragging:R,updateFrameBounds:h,dragStart:C,style:k,disabled:q,renderMovable:E,...D}=e,[G,U]=o.useState(Tn),[T,V]=o.useState(null),[y,w]=o.useState(!1),S=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const M=a.getBounds();if(!M)return;const I=i.toViewBounds(M);U(I??Tn),h(I??Tn)},[i?.getBounds()]),et(a,{onBoundsChange:M=>{const I=M.getBounds();if(!I)return;const $=i.toViewBounds(I);U($??Tn),h($)},onSelectionChange:()=>{const M=ge.CommonUtils.hasFocus(S.current,!0);!y&&!M||a.isSelected()||u()}}),et(a,{onRequestFocus:()=>ge.CommonUtils.whenFocus(S.current,!0)},Ql),o.useEffect(()=>{const M=S.current;return l(M),()=>{d(M)}},[]);const j=o.useMemo(()=>{if(!G)return null;let{width:M,height:I}=G;return E({view:i,movable:a,disabled:q,isDragging:R,style:{position:"relative",left:0,top:0,width:M,height:I},onHide:m,onShow:b})},[i,a,G.width,G.height,q,R]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Xt([S,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:G.x,top:G.y,width:G.width,height:G.height,...k},onMouseDown:async M=>{const I=M.shiftKey||M.ctrlKey,$=a.isSelected(),_=M.currentTarget;I&&$?a.unselect():($&&!I||await a.select({addToSelection:I}),C(M.nativeEvent,_),_.focus())},onFocus:M=>{M.relatedTarget&&!T&&V(M.relatedTarget),w(!0)},onBlur:M=>{T&&!S?.current?.contains(M.relatedTarget)&&V(null),M.relatedTarget&&w(!1)},...D,children:j})})),ti="_movable-area_314c6_5",Tr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:b,disabled:u=!1,disableDrag:R=!1,disableResize:h=!1,className:C,style:k,renderDirections:q=["nw","n","ne","w","e","sw","s","se"],onFirstRender:E,...D}=e,G=n.getBounds(),U=r.useCallbackRef(E,[E]),T=r.useCallbackRef(m,[m]),V=r.useCallbackRef(b,[b]),[y,w]=o.useState([]),[S,j]=o.useState(!1),[M,I]=o.useState(!1),$=o.useRef(!0),_=o.useRef(new Map),H=o.useRef(new Map),B=o.useRef(new Map),K=o.useRef(new Map),ne=o.useRef(new Map),N=o.useRef({onRequestFocus:oe=>(re(oe),null)}),z=o.useRef(null),se=o.useRef(null),ve=o.useRef(null),[Ve,Se]=o.useReducer(oe=>oe+1,0);o.useLayoutEffect(()=>{Se()},[n,i]),et(i,{onCollectionChange:()=>{const oe=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0}),ke=ne.current;ke.forEach(we=>{we()}),ke.clear();const ze=N.current;for(let we=0;we<oe.length;we++){const Ae=oe[we];if(Ae.isClosed())continue;const A=Ae.addListeners(ze);ke.set(Ae,A)}Se()},onInvalidated:()=>{Se()}}),et(a,{onMovableSelectionChange(oe){Me(),Se()}});const ue=o.useCallback((oe,ke)=>{const ze=B.current.get(oe);ve.current&&(ve.current.getTargets().forEach(we=>{if(we===ze)return we.style.left=ke.x+"px",we.style.top=ke.y+"px",we.style.width=ke.width+"px",void(we.style.height=ke.height+"px")}),ve.current.updateRect())},[]),Me=()=>{const oe=[],ke=a.getMovableSelection();ke.forEach(ze=>{const we=B.current.get(ze);we&&ke.indexOf(ze)!==-1&&oe.push(we)}),w(ze=>ge.CommonUtils.isEqualArrays(ze,oe)?ze:oe)},Ke=o.useRef(null),Ue=o.useRef(null),Te=o.useMemo(()=>(Ue.current||(Ue.current=new Promise(oe=>{Ke.current=oe})),Ue.current),[]),he=o.useRef(null),W=r.useCallbackRef(async(oe,ke)=>{he.current=ke,await(async()=>!(!await Te.then()||!ve.current))()&&he.current===ke&&ve.current.dragStart(oe,ke)},[y]),[Fe,Ce]=o.useState(!1),Y=o.useRef(null),J=o.useRef(null),re=r.useCallbackRef(async(oe=null)=>{if(oe||(oe=a.getMovableSelection()[0]),!oe)return T?.(),!1;const ke=B.current.get(oe);ke?(await ge.CommonUtils.whenFocus(ke),ke.focus(),J.current=ke,Y.current=null):Y.current=oe},[a]);o.useEffect(()=>{Fe&&y.length>0&&J.current!==y[0]&&re(),$.current&&(U?.(),$.current=!1)},[y]);const le=o.useMemo(()=>{const oe=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(oe.length===0&&_.current.size===0)return null;const ke=(Q,O,X,g=!0)=>{const x=Q.isSelected(),F={tabIndex:X,view:n,movable:Q,onRefLoad:p=>{Y.current===Q&&(p.focus(),J.current=p,Y.current=null),B.current.set(Q,p),H.current.set(p,Q),O.rendered=!0,Me()},onRefUnload:p=>{B.current.delete(Q),H.current.delete(p),O.rendered=!1,Me()},onUnFocus:T,onHide:p=>{O.onHide=p},onShow:p=>{O.onShow=p},isDragging:x&&(M||S),disabled:u,renderMovable:l,updateFrameBounds:p=>{ue(Q,p)},dragStart:W,onMouseUp:()=>{if(he.current=null,se.current){j(!1),I(!1);let p=!1;K.current?.forEach(L=>{ge.CommonUtils.isEqualBounds(L.movable.getBounds(),L.startBounds)||(p=!0)}),p?ye():ae()}},style:{opacity:g?S&&x?.7:void 0:0,zIndex:S&&x?Q.getZIndex()+oe.length:void 0,pointerEvents:g?void 0:"none",cursor:M&&x?"grabbing":u||R?"initial":"move",boxShadow:!x||M&&!S?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(ei,{...F},`movable-${Q.getUUID()}`)},ze=_.current,we=new Map,Ae=[];for(let Q=0;Q<oe.length;Q++){const O=oe[Q];if(O.isClosed())continue;let X=ze.get(O);X||(X={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(g,x)=>{if(!x||x.shown===!0)return;x.shown=!0;const F=++x.visibilityRequestId;requestAnimationFrame(()=>{const p=_.current.get(g);p&&F===x.visibilityRequestId&&(x.onShow?.(g),p.shown=!0)})},doHide:async(g,x)=>{if(!x||x?.shown===!1)return;x.shown=!1;const F=++x.visibilityRequestId,p=await Promise.resolve(x.onHide?.(g));F===x.visibilityRequestId&&p!==!1&&(x.shown=!1,_.current.delete(g),Se())},visibilityRequestId:0}),X.frame=ke(O,X,Q,!0),Ae.push(X.frame),X.doShow(O,X),ze.delete(O),we.set(O,X)}const A=[];return a.getMovableSelection().forEach(Q=>{const O=ze.get(Q);O&&(O.frame=ke(Q,O,-1,!1),A.push(O.frame),ze.delete(Q),we.set(Q,O))}),ze.forEach((Q,O)=>{Q.frame=ke(O,Q,-1,!1),A.push(Q.frame),Q.doHide(O,Q),ze.delete(O),we.set(O,Q)}),_.current=we,Me(),[...A,...Ae]},[Ve,n,l,u,R,h,S,M]),me=r.useCallbackRef((oe,ke)=>{const ze=`${ke} ${y.length===1?s.TextUtils.capitalize(H.current?.get(y[0]).getContent().getType()):"Drawings"}`;se.current&&(console.warn(`Transaction ${se.current.getDescription()} is being replaced by ${ze}`),se.current.rollback(),se.current=null),se.current=d.beginCommit({description:ze}),K.current.clear();for(let we=0;we<y.length;we++){const Ae=y[we],A=H.current?.get(Ae);A?K.current.set(Ae,{movable:A,startBounds:n.toViewBounds(A.getBounds())}):console.warn("invalid element",A)}},[d,n,y]),ye=o.useCallback(()=>{if(!se.current)return;const oe=[];K.current?.forEach(ke=>{oe.push(ke.movable)}),se.current.commit({viewAfter:{view:a,movableSelection:oe}}),K.current.clear(),se.current=null},[]),ae=o.useCallback(()=>{se.current&&(se.current.rollback(),se.current=null)},[]),be=o.useRef(null);o.useEffect(()=>{be.current&&(be.current.onscroll=oe=>{oe.preventDefault(),oe.srcElement.scrollTop=0,oe.srcElement.scrollLeft=0})},[be.current]);const Re=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:re,focus:()=>{re()}}),[a]),[Ee,f]=o.useState(null),De=o.useRef(!1),Ye=o.useRef(!1),He=o.useRef(!1);o.useEffect(()=>{if(u||y.length===0||He.current||De.current)return;if(Ye.current)return void requestAnimationFrame(()=>{ve.current&&z.current&&ve.current.refTargets.length>0&&(He.current=!0,Ke.current?.(!0)),w([...y])});De.current=!0;const oe=o.lazy(async()=>{try{const ke=await Promise.resolve().then(()=>require("./t0FKf7ytJSklun3L.cjs"));return De.current=!1,Ye.current=!0,w([...y]),ke}catch(ke){return console.warn(ke),Ke.current?.(!1),null}});f(oe)},[y,u,R,h]);const $e=o.useMemo(()=>!Ee||u?null:c.jsx(o.Suspense,{children:c.jsx(Ee,{className:yt({dragging:S||M,resizing:S,moving:M}),container:null,ref:ve,target:ve.current?y:[],draggable:!u&&!R,resizable:!u&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:q,onResizeStart:oe=>{me(oe.target,"Resize")},onResize:oe=>{if(!se.current)return oe.stopDrag(),void Se();j(!0);const ke=oe.direction[0]!==0&&oe.direction[1]!==0;let ze=0,we=0;for(let Ae=0;Ae<y.length;Ae++){const A=y[Ae],Q=K.current.get(A),O=H.current.get(A);if(!Q||!O){console.warn("invalid element");continue}let X=oe.dist[0],g=oe.dist[1],x=oe.drag.dist[0],F=oe.drag.dist[1],p=Q.startBounds.width,L=Q.startBounds.height;Ae===0?(ze=p,we=L):(X*=p/ze,x*=p/ze,g*=L/we,F*=L/we);const v={...Q.startBounds};if(v.width=Math.max(0,p+X),v.height=Math.max(0,L+g),oe.direction[0]===-1&&(v.width=Math.max(0,Math.min(Q.startBounds.x+p,p-x))),oe.direction[1]===-1&&(v.height=Math.max(0,Math.min(Q.startBounds.y+L,L-F))),ke&&(O.isLockAspectRatio()||oe.inputEvent?.shiftKey)){const P=p/L,Z=v.width/v.height;Z>P?v.height=v.width/P:Z<P&&(v.width=v.height*P)}oe.direction[0]===-1&&(v.x=Math.max(0,Math.min(Q.startBounds.x+p,Q.startBounds.x+p-v.width))),oe.direction[1]===-1&&(v.y=Math.min(Q.startBounds.y+L,Q.startBounds.y+L-v.height)),Q.movable.setBounds(n.toAbsoluteBounds(v))}},onResizeEnd:oe=>{j(!1),ye()},onDragStart:oe=>{me(oe.target,"Move")},onDrag:oe=>{if(!se.current)return oe.stopDrag(),void Se();I(!0);for(let ke=0;ke<y.length;ke++){const ze=y[ke],we=K.current.get(ze);we?we.movable.setBounds(n.toAbsoluteBounds({...we.startBounds,x:we.startBounds.x+oe.translate[0],y:we.startBounds.y+oe.translate[1]})):console.warn("invalid element")}},onDragEnd:oe=>{},onMouseUp:oe=>{}})}),[Ve,Ee,y,n,u,R,h,S,M]);return c.jsx("div",{className:yt(C,"movable-area",ti),style:{width:G.width,height:G.height,...k,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Xt([Re,be]),...D,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:G.width,height:G.height},...D,children:c.jsxs("div",{ref:z,style:{position:"absolute",pointerEvents:"auto"},onFocus:oe=>{V?.(),Ce(!0)},onBlur:oe=>{Ce(!1)},onKeyDownCapture:oe=>{if(oe.isDefaultPrevented())return;const ke=oe.nativeEvent.ctrlKey,ze=oe.nativeEvent.altKey,we=oe.nativeEvent.shiftKey;if(oe.which===r.KeyCodes.Escape){const X=a.getMovableSelection();let g=[...X];return y.forEach(x=>{if(g.length===0)return;const F=H.current.get(x);let p=g.indexOf(F);g.splice(p,1)}),g.length!==X.length&&a.selectMovables(g),g.length===0&&T?.(),void oe.preventDefault()}const Ae=.1,A=X=>{i.updateSelected(g=>{g.setRotation(g.getRotation()+X)},"Rotate")},Q=(X,g=!0)=>{i.updateSelected(x=>{const F=x.getBounds();let p=1+X;g||(p=1/p);const L=Math.sqrt(Math.pow(F.width,2)+Math.pow(F.height,2)),v=Math.atan2(F.height,F.width),P=p*L;if(P<10)return;const Z=P*Math.cos(v),ee=P*Math.sin(v),ie={x:F.x+(F.width-Z)/2,y:F.y+(F.height-ee)/2,width:Z,height:ee};x.setBounds(ie)},"Resize")},O=X=>{i.updateSelected(g=>{const x=g.getBounds(),F={x:x.x+(X.x??0),y:x.y+(X.y??0),width:x.width+(X.width??0),height:x.height+(X.height??0)};g.setBounds(F)},"Nudge")};if(oe.which===r.KeyCodes.Delete)i.updateSelected(X=>{X.delete()},"Delete"),oe.preventDefault();else if(oe.key==="a"&&ke){const X=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(X,!0),oe.preventDefault()}else oe.key==="ArrowLeft"?(we?Q(Ae,!1):ze?A(-10):O({x:ke?-10:-1}),oe.preventDefault()):oe.key==="ArrowRight"?(we?Q(Ae,!0):ze?A(10):O({x:ke?10:1}),oe.preventDefault()):oe.key==="ArrowUp"?(we?Q(Ae,!0):O({y:ke?-10:-1}),oe.preventDefault()):oe.key==="ArrowDown"&&(we?Q(Ae,!1):O({y:ke?10:1}),oe.preventDefault())},children:[le,$e]})})})})),Wt=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}},_o=(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,b=0;for(let h=0;h<e.length;h++){const C=e[h],k=C.getBounds();d+=k[l],m=Math.min(k[i],m),b=Math.max(k[i]+k[l],b),n.push({bounds:k,movable:C})}const u=(b-m-d)/(e.length-1);n.sort((h,C)=>{const k=h.bounds[i],q=C.bounds[i];return k!==q?k-q:h.bounds[a]-C.bounds[a]});const R=new Map;R.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const C=n[h-1].bounds,k={...n[h].bounds};k[i]=C[i]+C[l]+u,n[h].bounds=k,R.set(n[h].movable,k)}return R.set(n[n.length-1].movable,n[n.length-1].bounds),R};function Er(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,b=r.useEditMode();o.useRef(b.getMode()).current=b.getMode();const u=r.useCallbackRef(async(T,V,y=null,w=!0)=>{const S=async()=>{const j=await Promise.resolve(m?.showBusy?.(T.label()));try{await V();const M=y??T?.label?.();if(d){let I=null;T&&M!==!1&&(I=new r.SimpleCommand(T.key(),l,{label:M,description:M},S)),d(I)}j?.(),w&&b.setMode(null)}catch(M){j?.(),m?.showError?.(M)}};await S()},[d,m]),[R,h]=o.useReducer(T=>T+1,0),C=r.useCallbackRef((T,V,y)=>{if(!n)return;const w=n.getMovableSelection();if(w.length===0)return;let S="Drawings";if(w.length===1){const M=w[0];S=s.TextUtils.capitalize(M.getContent().getType())??"Drawing"}const j=`${T.label()} ${S}`;u(T,()=>{let M=null;i&&(M=i.beginCommit(j));const I=n.getMovableSelection();if(I.length===0)return;const $=y?.(I);for(let _=0;_<I.length;_++){const H=I[_];V(H,$)}M?.commit()})},[n,i]),[k,q]=o.useState(n.getMovableSelection()[0]??null),[E,D]=o.useState(!k||k?.isProtected()),G=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(){C(this,T=>{T.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(){C(this,T=>{T.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(){C(this,T=>{T.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(){C(this,T=>{T.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){C(this,T=>{T.setLockAspectRatio(!T.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(){C(this,T=>{T.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(){C(this,T=>{T.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(){C(this,T=>{T.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){C(this,(T,V)=>{T.setBounds({x:V.x})},Wt)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){C(this,(T,V)=>{T.setBounds({x:(V.width-T.getBounds().width)/2+V.x})},Wt)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){C(this,(T,V)=>{T.setBounds({x:V.width-T.getBounds().width+V.x})},Wt)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){C(this,(T,V)=>{T.setBounds({y:V.y})},Wt)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){C(this,(T,V)=>{T.setBounds({y:(V.height-T.getBounds().height)/2+V.y})},Wt)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){C(this,(T,V)=>{T.setBounds({y:V.height-T.getBounds().height+V.y})},Wt)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){C(this,(T,V)=>{T.setBounds(V.get(T))},T=>_o(T))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){C(this,(T,V)=>{T.setBounds(V.get(T))},T=>_o(T,!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,k]);o.useEffect(()=>{},[b]);const U=o.useMemo(()=>{let T=null;return T=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),T.addCommands(G,!0),T},[a,G]);return et(k,{onAnyChange:()=>{U.getCommand("formatAnchorTypeTwoCell").update({state:k?.getAnchorType()===s.IAnchored.Type.TwoCell}),U.getCommand("formatAnchorTypeOneCell").update({state:k?.getAnchorType()===s.IAnchored.Type.OneCell}),U.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("formatAnchorTypeAbsolute").update({state:k?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("toggleLockAspectRatio").update({state:k?.isLockAspectRatio()})},onProtectedChange:T=>{D(T.isProtected())},onDelete:()=>{}}),et(n,{onMovableSelectionChange:()=>{const T=n.getMovableSelection()[0]??null;q(T),D(!T||T.isProtected()),h()}}),et(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const T={disabled:E};U.getCommand("formatAnchorTypeTwoCell").update(T),U.getCommand("formatAnchorTypeOneCell").update(T),U.getCommand("formatAnchorTypeAbsolute").update(T),U.getCommand("toggleLockAspectRatio").update(T);const V=t.getCount(),y=n.getMovableSelection(),w=E||V<=1||y.length===0;let S={disabled:w},j=S;if(!w&&y.length===1){const $=y[0];$.getZIndex()===0&&(S={disabled:!0}),$.getZIndex()===V-1&&(j={disabled:!0})}U.getCommand("moveToFront").update(j),U.getCommand("moveForward").update(j),U.getCommand("moveToBack").update(S),U.getCommand("moveBackward").update(S);const M={disabled:E||y.length<=1};U.getCommand("formatDrawAlignLeft").update(M),U.getCommand("formatDrawAlignCenter").update(M),U.getCommand("formatDrawAlignRight").update(M),U.getCommand("formatDrawAlignTop").update(M),U.getCommand("formatDrawAlignMiddle").update(M),U.getCommand("formatDrawAlignBottom").update(M),U.getCommand("formatDrawFlipHorz").update(M),U.getCommand("formatDrawFlipVert").update(M),U.getCommand("formatDrawGroup").update(M),U.getCommand("formatDrawUngroup").update(M),U.getCommand("formatDrawSwapShapes").update(M),U.getCommand("formatDrawSwapShapesHorz").update(M),U.getCommand("formatDrawSwapShapesVert").update(M);const I={disabled:E||y.length<=2};U.getCommand("formatDrawDistributeHorz").update(I),U.getCommand("formatDrawDistributeVert").update(I)},[R,E,R]),U}const ni=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:b,...u}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:C,width:k}]=Ot();return c.jsx("div",{...u,ref:Xt([R,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})})})})),oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:b,onRepeatCommandChange:u}=e,R=Er({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:u,commands:d,target:m,notifier:b});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Tr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{R.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,R]);return h&&n?h:null})),ri=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:b,notifier:u=r.DefaultNotifier}=e,R=r.useEditMode(),[h,C]=o.useState(null),[k,q]=o.useState(null),[E,D]=o.useState(null),[G,U]=o.useState(null),[T,V]=o.useState(null);o.useLayoutEffect(()=>{if(E===null)return U(null),void V(null);const z=()=>{const se=i.getRange(E).getCell(),ve=se.getStyle();let Ve,Se=ve.getFill()?.toCSS(a.body.darkMode);Se.background!=="none"&&Se.background!=="transparent"||(Se=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),Se.background!=="none"&&Se.background!=="transparent"||(Se={background:a.body.fill}),U({style:Se}),se&&!se.getFormula()&&(Ve=se?.getRenderHorizontalAlignment()),V(Ve??r.HorizontalAlignment.Left)};return z(),i.getRange(E).addListener(()=>{z()})},[i,E,a?.body]);const y=r.useCallbackRef(()=>{let z=k.editState.dirty??"";if(k.editState.dirty!==void 0){const se=s.TextUtils.clampString(z);try{const ve=k.sheet.getRange(k.coords),Ve=`Typing '${se}' into ${ve.toString()}`;return ve.setValue(z,{description:Ve,autoFit:!0}),D(null),q(null),R.setMode(null),m(null),!0}catch(ve){throw u.showError(new Error(`Unable to enter '${se}'.`,{cause:ve})),ve}}},[i,k,u]),w=r.useCallbackRef(z=>i.getRange(z).getCell().getExtrusions()??ge.CoordUtils.cellToRange(z),[i]),S=r.useCallbackRef(z=>{let se=s.IRange.Orientation.Row,ve=!1;z!==s.IRange.Direction.Up&&z!==s.IRange.Direction.Down||(se=s.IRange.Orientation.Column),z!==s.IRange.Direction.Left&&z!==s.IRange.Direction.Up||(ve=!0),i.getSelection().traverse(se,ve)},[i]),j=o.useCallback((z,se)=>{if(l)return l(z,se);if(!i)return null;const{ref:ve,...Ve}=z;return c.jsx(wr,{ref:ve,...Ve,sheet:i,bodyStyle:a?.body,activeCoords:se,commands:b,onChangeEdit:Se=>{const ue={sheet:i,coords:se,editState:Se};R.setMode(Me=>({...Me,description:ue.editState.editMode?"Edit":"Enter",args:{...Me?.args,stateAndCoords:ue}}))},editState:k.editState})},[i,G,l,k,E]),{overlay:M,startEdit:I,submitEdit:$,cancelEdit:_,onKeyboardEventNative:H,onPointerEventNative:B}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:j,canEdit:()=>{const z=i.getProtection();if(z.isReadOnly())return!1;const se=z.isLocked();return se&&d(),!se},onBeforeStartEdit:z=>{const se=xr(()=>i.getRange(z).getCell()),ve={sheet:i,coords:z,editState:Object.freeze(se)};R.setMode({key:"edit",args:{stateAndCoords:ve}}),q(ve)},onStartEdit:z=>{D(z),m(z)},onSubmitEdit:y,onCancelEdit:z=>{D(null),q(null),R.setMode(null),m(null)},onDoneEdit:z=>{R.setMode(null)},onNavigate:S,containerProps:G,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:T,getRangeCoords:w});et(i.getSelection(),{onChange(z){C(i.getSelection().getCoords().cell)}});const K=r.useCallbackRef(z=>{B(z),E&&$()},[B,_,E]),ne=o.useCallback(z=>{B(z)},[B]),N=o.useCallback(z=>{H(z)},[H]);return o.useEffect(()=>{const z=n?.getStage();if(z)return z.addEventListener("pointerdown",K),z.addEventListener("dblclick",ne),z.addEventListener("keydown",N),()=>{z.removeEventListener("pointerdown",K),z.removeEventListener("dblclick",ne),z.removeEventListener("keydown",N)}},[n?.getStage()]),o.useEffect(()=>{const z=R.getMode(),se=z?.key;se==="edit"||se==="enter"?k?z.args?.cancel?_():z.args?.submit?$():q(z.args?.stateAndCoords):I(z.args?.start):E&&_()},[R]),M(n,t)})),Fr="white",Ar="black",li=`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='${Ar}' fill='${Fr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ii=`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='${Ar}' fill='${Fr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ai=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),[b,u]=o.useState(null),[R,h]=o.useState(null),[C,k]=o.useState(null),q=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const y=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(y.length>0?y:null)}else l(!1),m(null)},[i,n]),E=r.useCallbackRef(y=>{y.preventDefault(),y.stopPropagation();const w=n.getCellCoordsFromClient(y.clientX,y.clientY),S=i.getTables().getItems({address:w});S.length===1&&S[0].select()},[n,i]),D=r.useCallbackRef(y=>{y.preventDefault(),y.stopPropagation();const w=n.getCellCoordsFromClient(y.clientX,y.clientY),S=i.getTables().getItems({address:w});if(S.length===1){const j=S[0].getRange().getCoords(),M={colStart:j.colStart,rowStart:w.rowIndex,colEnd:j.colEnd,rowEnd:w.rowIndex};i.getRange(M).select()}},[n,i]),G=r.useCallbackRef(()=>{if(!a)return;const y=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(y.length>0?y:null)},[i,a,n]);et(i?.getSelection(),{onChange(y){u(i.getSelection().getCoords().cell)}}),et(R,{onAnyChange(y){q(),G()}}),et(C,{onAnyChange(y){G()}}),et(i,{onTablesChange(y){q(),G()},onInvalidated(y){q(),G()}});const U=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(G,300),300),[]);o.useEffect(()=>{U()},[n]),o.useEffect(()=>{let y=null;if(d)for(let w=0;w<d.length&&!y;w++){const S=d[w],j=S.getRange().getCoords();s.CoordUtils.isCellWithinRange(b,j)&&(y=S)}h(y)},[b,d]);const T=r.useCallbackRef(y=>{let w=null;if(d)for(let S=0;S<d.length;S++){const j=d[S],M=j.getRange().getCoords();let I=n.getRangeCoordsBounds(M);const $=n.getRelativePointFromClient(y.clientX,y.clientY),_=$.x,H=$.y;if(_>=I.x&&_<=I.x+I.width&&H>=I.y&&H<=I.y+I.height){const B=n.getViewportSize();_<=0||H<=0||_>=B.width||H>=B.height||(w=j)}}k(w)},[n,d]);if(o.useEffect(()=>{const y=n?.getStage();if(y&&d)return y.addEventListener("mousemove",T),y.addEventListener("mouseleave",T),()=>{y.removeEventListener("mousemove",T),y.removeEventListener("mouseleave",T)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const V=[];for(let y=0;y<d.length;y++){const w=d[y];if(w.isClosed())continue;const S=w===C,j=w===R,M=w.getRange().getCoords(),I=n.getRangeCoordsBounds(M);let $;if(S||j){const _=w.getStyle().getProperties(),H=_.headerRow?.fill?.background??_.wholeTable?.border?.top?.color?.toString();if(H&&i){const B=i.getStyles().parseColor(H);B&&($=B.toCSS())}$||($="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}V.push(c.jsx("div",{style:{position:"absolute",left:I.x,top:I.y,width:Math.min(16,I.width),height:I.height,pointerEvents:"all",cursor:li},onMouseDown:D},`table-select-row-${w.getName()}`)),V.push(c.jsx("div",{style:{position:"absolute",left:I.x,top:I.y,width:Math.min(16,I.width),height:Math.min(16,I.height),pointerEvents:"all",cursor:ii},onMouseDown:E},`table-select-${w.getName()}`)),V.push(c.jsx(dt.Selection,{x:I.x,y:I.y,width:I.width,height:I.height,range:M,strokeWidth:j?.5:0,stroke:$??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:S?`${$} 0px 0px 1px 1px`:void 0}},`table-outline-${w.getName()}`))}return V})),si=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,b]=o.useState(null),u=o.useRef(null),R=r.useCallbackRef(()=>{const D=i.getSelectedCell(),G=D.getSpill()?.getCoords()??null;ge.CoordUtils.isEqualRanges(G,l)||(b(G?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(G),coords:G}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(G))},[i,n,l]);o.useEffect(()=>(u.current&&(clearTimeout(u.current),u.current=null),m&&(u.current=setTimeout(()=>{b(null),u.current=null},a)),()=>{u.current&&(clearTimeout(u.current),u.current=null)}),[m,a]);const h=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(R,80),80),[]);if(et(i?.getSelection(),{onChange(D){h()}}),et(i,{onSpillsChange(D){R()},onInvalidated(D){R()}}),!n||!l&&!m)return null;const C=i.getRange(l).getValue()instanceof s.FormulaError.Spill,k=[];let q=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ge.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&b(null),q=n.toClipBounds(q,-10),!q)return;const E="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return k.push(c.jsx(dt.Selection,{x:q.x,y:q.y,width:q.width,height:q.height,range:l,strokeWidth:1,stroke:E,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:C?"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:`${E} 0px 0px 4px 0px`}},"spill-outline}")),k})),di={position:"absolute",top:0,left:0,bottom:0,right:0},Zo=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ge.CommonUtils.mergeContentful(e.body,l);return n.body=ge.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ge.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=ge.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ge.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ge.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ge.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ci={fireOnModelChange:!1},Xo={},Dr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Xo,headersStyle:a=Xo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:b,rowHeaderProps:u,showScrollbars:R=!0,scrollPaneProps:h,onViewportChange:C,commands:k,onRepeatCommandChange:q,onMoveCell:E,overlays:D,renderMovable:G,viewportComponent:U,onElementLoad:T,getCellEditor:V,onFocus:y,onBlur:w,style:S=r.ReactUtils.EmptyCssProperties,notifier:j,onShowTooltip:M,onShowColumnTooltip:I,onShowRowTooltip:$,onCloseTooltip:_,gridProps:H,cellRenderProps:B,...K}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[ne,N]=o.useReducer(te=>te+1,0),[z,{width:se,height:ve}]=Ot(),Ve=r.useCallbackRef(M,[M]),Se=r.useCallbackRef(I,[I]),ue=r.useCallbackRef($,[$]),Me=r.useCallbackRef(_,[_]),Ke=o.useRef(!1);o.useLayoutEffect(()=>{Ke.current=!0},[n]);const Ue=n?.getStyles(),Te=o.useMemo(()=>Zo(i,Ue),[i,Ue]),he=o.useMemo(()=>Zo(a,Ue),[a,Ue]),{body:W={},buttonSurface:Fe={}}=Te,{header:Ce={},headerSelect:Y={},headerSelectAll:J={}}=he,re=o.useRef(null),[le,me]=o.useState(()=>n?.getView()),ye=(le?.getZoomScale()??100)/100,ae=o.useMemo(()=>({vertical:le.isShowColumnGridlines()&&ye>=.4,horizontal:le.isShowRowGridlines()&&ye>=.4}),[le?.isShowColumnGridlines(),le?.isShowRowGridlines(),ye]),be=o.useMemo(()=>{if(le?.getGridLineColor())return{strokeDasharray:"1,1"}},[le?.getGridLineColor(),Te]),Re=d??le?.isShowColumnHeaders(),Ee=b??le?.isShowRowHeaders(),[f,De]=o.useState({width:0,height:0}),Ye=o.useMemo(()=>{let te=40,Ie=20;const Pe=n?.getStyles().getNormal().getFont();if(f.width>0&&f.height>0){const Be=Pe?.toCSS()?.fontFamily??Te.header.text.fontFamily,Xe=Pe?.getSize()??Te.header.text.fontSize,Ge=s.IFont.getSharedMeasurer()(""+f.height,Math.ceil(Xe*s.IFont.getDeviceScale()),Be);te=Ge.width,Ie=Ge.lineHeight}return{width:Math.round(te+5),height:Math.round(Ie+3)}},[f,Te?.header.text,n]),He=Ee?ye*Ye.width:Ce.edgeStrokeWidth,$e=Re?ye*Ye.height:Ce.edgeStrokeWidth,oe=Math.max(se,(n?.getColumnHeaders().getDefaultSize()??Ye.width)+He+1),ke=Math.max(ve,(n?.getRowHeaders().getDefaultSize()??Ye.height)+$e+1),ze=o.useRef(new Map),we=o.useRef(null),Ae=()=>({getColOffset:te=>n.getColumnHeaders().findOffset(te),getColIndex:te=>n.getColumnHeaders().findIndex(te),getRowOffset:te=>n.getRowHeaders().findOffset(te),getRowIndex:te=>n.getRowHeaders().findIndex(te)}),[A,Q]=o.useState(()=>Ae()),[O,X]=o.useState(!1),[g,x]=o.useState(null),F=!0,p=Te.selection?.strokeFill,L=o.useCallback(()=>Mt.current,[]),[v,P]=o.useState(),Z=r.useCallbackRef(te=>{P(te),n&&n.getView()&&n.getView().setTopLeft(te?{left:te.left,top:te.top}:null),C?.(te)},[n,C]),ee=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const te=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ee.current?.(),ee.current=te.addListener(()=>{const Ie=te.getCoords();re?.current?.invalidate(Ie)})},[v,n]);const[ie,de]=o.useState(()=>n?.getView().getTopLeft()),ce=r.useCallbackRef(te=>{const Ie=ge.CoordUtils.cellToRange(te);if(n.isClosed())return Ie;const Pe=n.getRange(Ie,{excludeHidden:!0}).getMerges();return Pe.length===0?Ie:Pe[0]},[n]),xe=te=>{if(!te||te.coords.colIndex===0&&te.coords.rowIndex===0)return null;const Ie={};return te.coords.colIndex>0&&(Ie[ge.AnchorLocation.Left]={index:te.coords.colIndex,scrollOffset:te.topLeft.left}),te.coords.rowIndex>0&&(Ie[ge.AnchorLocation.Top]={index:te.coords.rowIndex,scrollOffset:te.topLeft.top}),Ie},[fe,pe]=o.useState(()=>xe(n.getView().getFreezePanes())),qe=r.useEditMode(),Oe=o.useCallback(()=>re.current,[]),Ne=r.useCallbackRef(te=>{qe.setMode(Ie=>Ie?.key==="edit"?{...Ie,args:{...Ie.args}}:{key:"edit",args:{stateAndCoords:null,start:te}})},[]),We=r.useCallbackRef(()=>v,[v]),je=Mr({sheet:n,commands:k,target:Oe,onRepeatCommandChange:q,bodyStyle:W,notifier:j,onStartEdit:Ne,getViewport:We}),[_e,Le]=o.useState(n.getSelection().isEntire()),[Je,at]=o.useState(le?.getMovableSelection().length>0),ft=g!==null||Je,xt=null,[Ze,lt]=o.useState(!1);o.useEffect(()=>{lt(!1)},[n.getProtection()]);const pt=r.useCallbackRef(()=>{Ze||(lt(!0),j.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}))},[j,Ze]),wt=o.useMemo(()=>{const te=qe.getMode();return te?.cursor?te.cursor:null},[xt,qe]),[vt,gt]=o.useState(null),it=o.useRef(!1),[Et,Bt]=o.useState([]),Qt=o.useRef(null),[Dt,en]=o.useState(ge.TypesUtils.EmptyTopLeft),[Tt,xn]=o.useState(ge.TypesUtils.EmptyTopLeft);o.useEffect(()=>{en({left:ie?.left,top:0})},[ie?.left]),o.useEffect(()=>{xn({left:0,top:ie?.top})},[ie?.top]),et(n?.getView(),{onFreezeSplitChange:()=>{pe(xe(n.getView().getFreezePanes()))},onTopLeftChange:()=>{de(n.getView().getTopLeft())},onMovableSelectionChange:()=>{at(n.getView().getMovableSelection().length>0)}}),et(n?.getSelection(),{onChange:()=>{Le(n.getSelection().isEntire())}}),et(n,{onViewChange(){me(n.getView()),Q(Ae())},onLayoutChange:()=>{const te=n.getEntireRange();De({height:te.getRowCount(),width:te.getColumnCount()}),Q(Ae())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),et(n,{onRequestScrollIntoView:async(te,Ie)=>{if(!Ie)return;const Pe={colIndex:Ie?.coords.colStart,rowIndex:Ie?.coords.rowStart};return await re.current?.scrollCellCoordsIntoView(Pe,Ie?.scroll),!0},onRequestFocus:()=>ge.CommonUtils.whenFocus(Mt.current)},ci);const Ct=o.useRef(!1),Vt=o.useMemo(()=>{const te=ge.CommonUtils.debounce(Be=>{requestAnimationFrame(()=>{it.current&&Se?.(Be)})},32),Ie=(Be,Xe)=>{it.current=!0,gt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:0,rowEnd:f.height,colStart:Be,colEnd:Be})))return;const rt=Ge.getLayout(),ot=Math.max(0,rt.getColOffset(Be)),nt=Ge.getBounds(),bt=Math.min(nt.x+nt.width,rt.getColOffset(Be+1)),It=Ge.getAnchor();if(Xe!==null&&(It===ge.AnchorLocation.Left||It===ge.AnchorLocation.Center||It===ge.AnchorLocation.Right)){const to=ge.CommonUtils.roundAccurately(Xe*ge.CommonUtils.getDPI(),0),kn=ge.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Xe/ye),2).toFixed(2),no="Width: "+(Xe?kn+" ("+to+" pixels)":"Hidden"),ln=Kt.current.getGridElement().getRelativePointFromClient(0,0),$t=0-ln.y,Mn=0-ln.y+$e,oo=ln.x-nt.x;te({anchor:{x:ot-oo,y:$t,width:bt-ot,height:Mn-$t},display:no})}const Nt=[0,0,0,nt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},Jn={x:ot-1,y:0,width:1,height:nt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},eo={x:bt-1,y:0,width:1,height:nt.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Nt,bounds:Jn,...Yn}),c.jsx(dt.SVGLine,{linePoints:Nt,bounds:eo,...Qn})]},"resize-dividers")}])};let Pe=null;return{onResizeHeadersStart:(Be,Xe,Ge)=>{Pe=n.beginCommit(Ge),Ct.current=!1,Ie(Be,Xe)},onResizeHeaders:(Be,Xe,Ge)=>{Ct.current=!1,Ie(Be,Xe)},onResizeHeadersDown:(Be,Xe)=>{Ct.current=!0,setTimeout(()=>{Ct.current&&Ie(Be,Xe)},360)},onResizeHeadersEnd:(Be,Xe,Ge)=>{Pe?.commit({description:Ge}),Pe=null,Ct.current=!1,requestAnimationFrame(()=>Me?.()),it.current=!1,gt(null)},onResizeHeadersUp:Be=>{Ct.current=!1,requestAnimationFrame(()=>Me?.()),it.current=!1,gt(null)},...m}},[n,m,$e,vt]),tn=o.useMemo(()=>{const te=ge.CommonUtils.debounce(Be=>{requestAnimationFrame(()=>{it.current&&ue?.(Be)})},32),Ie=(Be,Xe)=>{it.current=!0,gt([Ge=>{if(!Ge.toClipBounds(Ge.getRangeCoordsBounds({rowStart:Be,rowEnd:Be,colStart:0,colEnd:f.width})))return;const rt=Ge.getLayout(),ot=Math.max(0,rt.getRowOffset(Be)),nt=Ge.getBounds(),bt=Math.min(nt.y+nt.height,rt.getRowOffset(Be+1)),It=Ge.getAnchor();if(Xe!==null&&(It===ge.AnchorLocation.Top||It===ge.AnchorLocation.Center||It===ge.AnchorLocation.Bottom)){const to=Math.floor(10*ge.CommonUtils.getDPI())/10,kn=ge.CommonUtils.roundAccurately(Xe*to,0),no=ge.CommonUtils.roundAccurately(kn/ye/(n?.getRowHeaders().getScaleFactor()*ge.CommonUtils.getDPI()),2).toFixed(2),ln="Height: "+(Xe?no+" ("+kn+" pixels)":"Hidden"),$t=Ut.current.getGridElement().getRelativePointFromClient(0,0),Mn=0-$t.x,oo=0-$t.x+He,yl=$t.y-nt.y;te({anchor:{x:Mn,y:ot-yl,width:oo-Mn,height:bt-ot},display:ln})}const Nt=[0,0,nt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},Jn={x:0,y:ot-1,width:nt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:p}},eo={x:0,y:bt-1,width:nt.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Nt,bounds:Jn,...Yn}),c.jsx(dt.SVGLine,{linePoints:Nt,bounds:eo,...Qn})]},"resize-dividers")}])};let Pe=null;return{onResizeHeadersStart:(Be,Xe,Ge)=>{Pe=n.beginCommit(Ge),Ct.current=!1,Ie(Be,Xe)},onResizeHeaders:(Be,Xe,Ge)=>{Ct.current=!1,Ie(Be,Xe)},onResizeHeadersDown:(Be,Xe)=>{Ct.current=!0,setTimeout(()=>{Ct.current&&Ie(Be,Xe)},360)},onResizeHeadersEnd:(Be,Xe,Ge)=>{Pe?.commit({description:Ge}),Pe=null,Ct.current=!1,requestAnimationFrame(()=>Me?.()),it.current=!1,gt(null)},onResizeHeadersUp:Be=>{Ct.current=!1,requestAnimationFrame(()=>Me?.()),it.current=!1,gt(null)},...u}},[n,u,He]),Mt=r.useImperativeElement(t,()=>{const te=Pe=>{n?.getView()&&n.getView().selectMovables([]),we.current=null,re?.current?.focus(Pe)},Ie=async(Pe=null)=>{if(Pe||(Pe=n?.getView().getMovableSelection()[0]),!Pe)return!1;const Be=Pe.getAnchorCoords();if(!Be)return!1;const Xe=re.current?.getViewFromCellCoords({colIndex:Be.colStart,rowIndex:Be.rowStart});if(!Xe)return!1;const Ge=Xe.getAnchor();n?.getView().getMovableSelection().indexOf(Pe)===-1&&n?.getView().selectMovables([Pe]);let rt=ze.current?.get(Ge);return rt?.current?(await rt.current.focusMovable(Pe),!0):(we.current={movable:Pe,anchor:Ge},!0)};return{getGridElement:()=>re.current,getRowHeaderElement:()=>Ut.current,getColumnHeaderElement:()=>Kt.current,rowHeaderHeight:()=>$e,colHeaderWidth:()=>He,startEdit:Ne,submitEdit:()=>{qe.setMode(Pe=>Pe?.key!=="edit"?Pe:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{qe.setMode(Pe=>Pe?.key!=="edit"?Pe:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:g!==null,focus:Pe=>{n?.getView().getMovableSelection().length>0&&Ie()||te(Pe)},focusSheet:te,focusMovable:Ie,contains:Pe=>re?.current?.contains?.(Pe),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),zt=o.useCallback(te=>{Ke.current||(re?.current?.invalidate(te),N?.())},[]);o.useEffect(()=>{zt()},[Te]);const qn=_e?J.edgeStrokeFill:Ce.fill,tt=_e?Y.fill:typeof Te.headerHover=="function"?Te.headerHover(Ce)?.fill:Ce.fill,Sn=o.useMemo(()=>U?c.jsx("div",{className:yt("sheetxl-viewport-overlay",zl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:U}):c.jsx(c.Fragment,{}),[U]);let Pt=null;Re&&Ee&&(Pt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${$e}px`,width:`${He}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:te=>{let Ie=!te.ctrlKey;je?.getCommand("selectAll")?.execute(!Ie||te.button!==0),te.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:-1,colIndex:-1}):re.current?.focus()},children:[c.jsx("div",{style:{height:$e-5+"px",width:$e-5+"px",clipPath:`path('M${$e-5} 0 L0 ${$e-5} L${$e-5} ${$e-5} L${$e-5} 0 Z')`,borderRight:`2px solid ${qn}`,borderBottom:`2px solid ${qn}`,background:`${tt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${$e}px`,width:`${He}px`,boxSizing:"border-box",borderRight:`solid 1px ${Ce.strokeFill}`,borderBottom:`solid 1px ${Ce.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const nn=r.useCallbackRef(({_left:te,_top:Ie})=>{},[]),st=r.useCallbackRef(te=>{if(!l)return;const Ie=re.current.getViewFromClient(te.clientX,te.clientY)?.getCellCoordsFromClient(te.clientX,te.clientY);Ie&&(l({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:Ie.rowIndex,colIndex:Ie.colIndex}),te.stopPropagation(),te.preventDefault())},[l]),ht=r.useCallbackRef(te=>{if(!(!te.shiftKey&&(te.ctrlKey||te.metaKey)))return;const{deltaY:Ie}=te;return Ie>0?je.getCommand("sheetZoomOut")?.execute():Ie<0&&je.getCommand("sheetZoomIn")?.execute(),Ie===0},[je]);o.useEffect(()=>{Bt(null),Qt.current=null,it.current=!1,gt(null);const te=n?.getView().getTopLeft();nn(te),re.current?.scrollTo(te),de(te),me(n.getView()),pe(xe(n.getView().getFreezePanes())),Q(Ae()),N()},[n?.getView()]);const on=r.useCallbackRef(te=>{const Ie=te.getVisibleRangeCoords();if(!Ie)return null;const Pe=[];return n.getRange(Ie).forEach((Be,Xe)=>{const Ge=Xe.getCoords(),rt=Xe.getCell();(ot=>{if(ot.isEmpty())return!1;const nt=ot.getSpans();if(nt.width>1||nt.height>1||ot.getStyle().hasVisibleStyling()||le.isShowFormulas()&&ot.getFormula()!==null)return!0;const bt=ot.getValue();return bt!==null&&!(!le.isShowZeros()&&bt===0&&ot.getType()===s.ScalarType.Number)})(rt)&&Pe.push({coords:Ge,value:rt,range:le.isShowFormulas()?null:rt.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Pe},[n,le.isShowZeros(),le.isShowFormulas(),g]);o.useEffect(()=>{const te=[];D&&te.push(...D),vt&&te.push(...vt),ge.CommonUtils.isEqualArrays(te,Qt.current)||(Qt.current=te,Bt(te))},[D,vt,Te]);const rn=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[Te?.header?.edgeStrokeFill]),Ht=r.useCallbackRef(te=>{te.isDefaultPrevented()||te.isPropagationStopped()||(we.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const te=qe.getMode();return te?.key==="cut"||te?.key==="copy"},[qe]),Gn=r.useCallbackRef(async te=>{const Ie=qe.getMode();return te.keyCode===r.KeyCodes.Escape&&Ie?(te.preventDefault(),void qe.setMode(null)):te.keyCode===r.KeyCodes.Enter&&Wn?(te.preventDefault(),await je?.getCommand("paste")?.execute(),void qe.setMode(null)):void je?.dispatchToFocusedCommand(te)},[je,qe]),Ut=o.useRef(null),Rn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${$e+1}px`,width:`${He+Ce.edgeStrokeWidth}px`,minWidth:`${He+Ce.edgeStrokeWidth}px`,borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,height:`calc(100% - ${$e}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx(Wo,{ref:Ut,sheetElement:Mt.current,gridRef:re,freezeStart:fe?.[ge.AnchorLocation.Top],oppositeSize:He,containerWidth:He,containerHeight:ke,sheetHeader:n.getRowHeaders(),gridStyle:he,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Tt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${$e+1}px`,width:`${He+Ce.edgeStrokeWidth}px`,minWidth:`${He+Ce.edgeStrokeWidth}px`,borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,height:`calc(100% - ${$e}px)`,boxSizing:"border-box",zIndex:"2",...tn?.style},...tn})}),[He,$e,ke,n,Tt,fe?.[ge.AnchorLocation.Top],Te,F,l,Ce.fill,u]),Kt=o.useRef(null),hl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${$e+Ce.edgeStrokeWidth}px`,minHeight:`${$e+Ce.edgeStrokeWidth}px`,borderBottom:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx(Wo,{ref:Kt,sheetElement:Mt.current,gridRef:re,freezeStart:fe?.[ge.AnchorLocation.Left],oppositeSize:$e,containerWidth:oe,containerHeight:$e,sheetHeader:n.getColumnHeaders(),gridStyle:he,scrollPoint:Dt,onSheetContextMenu:l,...Vt,style:{...Vt?.style,position:"relative",left:"0px",width:"100%",height:`${$e+Ce.edgeStrokeWidth}px`,minHeight:`${$e+Ce.edgeStrokeWidth}px`,borderBottom:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[$e,oe,n,Dt,fe?.[ge.AnchorLocation.Left],Te,Ce.fill,F,l,m]),ml=r.useCallbackRef(te=>{const{value:Ie,key:Pe,...Be}=te;let Xe=Ie,Ge=g;if(!Ge||Ge.colIndex===te.coords.colIndex&&Ge.rowIndex===te.coords.rowIndex||(Ge=null),!Xe){const nt=te.range;if(Xe=n.getRange({rowIndex:nt.rowStart,colIndex:nt.colStart}).getCell(),Xe.isEmpty())return null}let rt=null;Xe.getHyperlink()&&(rt=async nt=>{if(B?.onLinkMouseDown?.(nt),nt.button===0&&!nt.isDefaultPrevented()){nt.stopPropagation(),nt.preventDefault();try{await Xe.getHyperlink()?.open()}catch(bt){j?.showError?.(bt)}}}),Ge&&Ge.colIndex===te.range.colStart&&Ge.rowIndex===te.range.rowStart&&(Xe=Xe.createTemporaryCell({value:null}));const ot=n.getStyles();return o.createElement(yr,{...Be,key:Pe,bodyStyle:W,docTheme:ot.getTheme(),normalStyle:ot.getNormal(),showFormulas:le.isShowFormulas(),showZeros:le.isShowZeros(),onLinkMouseDown:rt,...B,value:Xe})},[n,A,W,g,le?.isShowFormulas(),le.isShowZeros()]),fl=o.useCallback((te,Ie)=>{const{key:Pe,...Be}=te;return[c.jsx(Ol,{ref:Ie,getVisibleCells:on,sheet:n,gridStyle:Te,...Be},`border-${Pe}`),c.jsx(ai,{ref:Ie,sheet:n,commands:je,...Be},`table-${Pe}`),c.jsx(si,{ref:Ie,sheet:n,...Be},`spill-${Pe}`),c.jsx(Jl,{ref:Ie,sheet:n,commands:je,notifier:j,onShowTooltip:Ve,onCloseTooltip:Me,gridStyle:Te,gridRef:re,editingCoords:g,isActive:F,...Be},`selection-${Pe}`),c.jsx($l,{ref:Ie,sheet:n,commands:je,gridStyle:Te,element:L,notifier:j,...Be},`copy-paste-${Pe}`),c.jsx(oi,{ref:Ie,sheet:n,commands:je,target:Oe,notifier:j,renderMovable:G,movableProps:{onUnFocus:()=>{Mt.current.focus()}},...Be},`movable-${Pe}`),c.jsx(ri,{ref:Ie,sheet:n,commands:je,notifier:j,gridStyle:Te,getCellEditor:V,showProtectedError:pt,setEditingCoords:x,...Be},`editor-${Pe}`)]},[n,re.current,Te,V,je,j]),[Eo,pl]=o.useState(!1),vl=o.useMemo(()=>{if(oe===0||ke===0)return null;const te=n.getStyles().getNormal(),Ie=te.getFont(),Pe=te.getFill(),Be=te.getBorder(),Xe=te.getFill().getType()===s.IFill.Type.None;let Ge=be,rt=be;const ot=(bt,It,Nt)=>Nt?{stroke:Be.getBottom().isNone()?"none":bt.getColor().toRGBA(W.darkMode).toString(),...It}:It;rt=ot(Be.getBottom(),rt,!Be.getBottom().isNone()),rt=ot(Be.getTop(),rt,!Be.getTop().isNone()),Ge=ot(Be.getRight(),Ge,!Be.getRight().isNone()),Ge=ot(Be.getLeft(),Ge,!Be.getLeft().isNone());let nt=le?.getGridLineColor()?.toRGBA(W.darkMode).toString()??W.strokeFill;return Xe||(rt=ot(Be.getBottom(),rt,!0),rt=ot(Be.getTop(),rt,!0),Ge=ot(Be.getRight(),Ge,!0),Ge=ot(Be.getLeft(),Ge,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...di,...Pe.toCSS(W.darkMode),...Ie.toCSS(W.darkMode,ye),"--sxl-app-color-background":W.fill,"--sxl-app-color-shadow":Te.colorShadow,"--sxl-app-color-grey":Te.colorGrey,"--sxl-app-color-button-fill":Fe.fill,"--sxl-app-color-button-text":Fe.text?.fill,"--sxl-app-color-button-border":Fe.edgeStrokeFill,"--sxl-app-color-primary-dark":Te.selection.strokeFill},ref:re,zoom:ye,...H,onFirstRender:bt=>{pl(!0),H?.onFirstRender?.(bt),je?.activate()},showGridLines:ae,gridLineColor:nt,gridLineColumnsProps:Ge,gridLineRowsProps:rt,freezeLeft:fe?.[ge.AnchorLocation.Left],freezeLeftProps:rn,freezeTop:fe?.[ge.AnchorLocation.Top],freezeTopProps:rn,width:oe,height:ke,columnCount:f.width,rowCount:f.height,cursor:wt??xt??"cell",clipCells:!0,layout:A,cellRenderer:ml,overlayRenderer:fl,getCellCoordsAsRangeCoords:ce,getVisibleCells:on,onWheelScroll:ht,onPointerDown:Ht,onKeyDown:Gn,onViewportChange:Z,onImmediateScroll:nn,scrollPoint:ie,stageProps:{onFocus:()=>{je?.activate()}},overlays:Et})},[ne]);o.useEffect(()=>{Ke.current||N()},[A,fe,ye,je,ie?.left,ie?.top,W,H,oe,ke,wt,Et,F,xt]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};R||(_n={..._n,...S});const Cl=o.useMemo(()=>{const te=n.getStyles().getTheme(),Ie=te.getColorScheme(),Pe=te.getFontScheme();return{"--sxl-doc-color-dk1":Ie.getDk1().toCSS(W.darkMode),"--sxl-doc-color-dk2":Ie.getDk2().toCSS(W.darkMode),"--sxl-doc-color-lt1":Ie.getLt1().toCSS(W.darkMode),"--sxl-doc-color-lt2":Ie.getLt2().toCSS(W.darkMode),"--sxl-doc-color-accent1":Ie.getAccent1().toCSS(W.darkMode),"--sxl-doc-color-accent2":Ie.getAccent2().toCSS(W.darkMode),"--sxl-doc-color-accent3":Ie.getAccent3().toCSS(W.darkMode),"--sxl-doc-color-accent4":Ie.getAccent4().toCSS(W.darkMode),"--sxl-doc-color-accent5":Ie.getAccent5().toCSS(W.darkMode),"--sxl-doc-color-accent6":Ie.getAccent6().toCSS(W.darkMode),"--sxl-doc-color-hlink":Ie.getHlink().toCSS(W.darkMode),"--sxl-doc-color-fol-hlink":Ie.getFolHlink().toCSS(W.darkMode),"--sxl-doc-font-major":Pe.getMajorFont(),"--sxl-doc-font-minor":Pe.getMinorFont()}},[n.getStyles().getTheme()]);let Zn=c.jsx("div",{style:_n,onTouchStart:()=>{Fo()},onFocus:te=>{X(!0),y?.(te)},onBlur:te=>{X(!1),w?.(te)},ref:Mt,...K,children:c.jsx("div",{className:yt("sheetxl-sheet",Dl),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...Cl},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Pt,Rn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[hl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,backgroundColor:W.fill},ref:z,onContextMenu:st,children:[vl,Sn,c.jsx(Nl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Te?.selection?.strokeFill,colorCredits:Te?.body?.text?.fill})]})]})]})})});if(R){const te=Ie=>c.jsx(wo,{...Ie,sheet:n});Zn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Ce.fill}`,minHeight:2*Ye.height,minWidth:2*Ye.width,...S},viewport:v,touchElement:re.current?.stage,disableTouch:ft,onScrollViewport:Ie=>{re.current?.scrollTo(Ie)},createHorizontalScrollbar:te,createVerticalScrollbar:te,...h,children:Zn})}o.useEffect(()=>{Ke.current=!1,N?.(),O&&Mt.current?.focus()},[n]);const[Xn,bl]=o.useState(!1),Fo=r.useCallbackRef(()=>{Xn||bl(!0)},[Xn]);return o.useEffect(()=>{if(Eo)return typeof T=="function"&&T(),r.ReactUtils.detectIt().primaryInput==="touch"&&Fo(),()=>{}},[T,Eo,Xn]),Zn}));Dr.displayName="SheetElement";const ui=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Yo="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=",zr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:b,onHide:u,onShow:R,onKeyDownCapture:h,onFocus:C,onBlur:k,loadingPanel:q,...E}=e,[D,G]=o.useState(!1),[U,T]=o.useState(null),[V,y]=o.useState(null),[w,S]=o.useState(null);o.useEffect(()=>{y(null),l.getDetails().then(I=>{G(!1),y(I.asUrl()),I.asSVGText?.()&&S(I.asSVGText())}).catch(I=>{console.warn(I),G(!0),y(Yo),S(null)})},[l]);const j=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),M=o.useMemo(()=>{if(V||w)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:U?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:V,onLoad:()=>{T(!0)},onError:({currentTarget:I})=>{console.log("error"),I.onerror=null,y(Yo),G(!0)},alt:d??`${l.getType()}`})},[U,l,V,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,...E,onKeyDownCapture:I=>{h?.(I)},ref:j,children:[U||D?void 0:q,M]})}));zr.displayName="PictureEditor";const gi=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:b,...u}=e;o.useEffect(()=>{},[a]);const R=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:C,width:k}]=Ot();if(!a.isClosed())return c.jsx("div",{...u,ref:Xt([R,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()})})})})),hi="_editable-input_1bqx6_6",mi=e=>c.jsx("input",{...e}),Nr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:b=mi,notifier:u,styleHover:R={},dragging:h,maxLength:C,disabled:k=!1,readOnly:q=!1,...E}=e,[D,G]=o.useState(!1),[U,T]=o.useState(!1),[V,y]=o.useState(a);o.useEffect(()=>{y(a)},[a]);const w=o.useRef(null),[S,j]=o.useState(null),M=o.useCallback(function(ne){const N=ne.message;S!==N&&(u?.showMessage?.(N,{type:r.NotificationType.Error}),j(N))},[u,S]),I=o.useCallback(ne=>{let N=!1;try{N=l?.(ne)??!0}catch(z){M(z)}return N?(w.current=null,T(!1),y(ne),N):(setTimeout(()=>{w.current?.focus()},0),N)},[l]),$=r.useCallbackRef(()=>{y(a),w.current=null,T(!1),m?.()},[m,a]),_=o.useMemo(()=>{if(!U)return null;const ne={className:yt(hi),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:C,type:"text",value:V,onFocus:N=>{w.current||(w.current=N.target,setTimeout(()=>{N.target?.select()},0))},onBlur:N=>{w.current&&I(V)},onChange:N=>{U&&y(N.target.value)},onMouseDown:N=>N.stopPropagation(),onKeyDown:N=>N.code==="Escape"?(N.preventDefault(),void $()):N.code==="Enter"?(N.preventDefault(),void I(N.target.value)):void(N.code!=="Tab"?N.stopPropagation():I(N.target.value))};return c.jsx(c.Fragment,{children:b(ne)})},[U,V,I,$,b,k]),[H,B]=o.useState();o.useLayoutEffect(()=>{let ne=Object.assign({},n);(h||D)&&(ne=Object.assign(ne,R)),B(ne)},[h,D,R,n]),o.useEffect(()=>{_&&d?.(V)},[_,d,V]);const K=r.useImperativeElement(t,()=>({startEdit(){k||q||T(!0)},cancel(){$()}}),[]);return c.jsxs("div",{...E,ref:K,style:{flexDirection:"column",display:"flex",...H},className:yt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{k||q||T(!0)},onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:U?0:1},children:V}),_]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...R},children:V})]})})),Pn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Yt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function mt(e){var t,n;return e?Yt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=mt(e);return e instanceof t}function bn(e){return!Yt(e)&&e instanceof mt(e).HTMLElement}function Lr(e){return e instanceof mt(e).SVGElement}function Zt(e){return e?Yt(e)?e.document:xo(e)?qo(e)?e:bn(e)||Lr(e)?e.ownerDocument:document:document:document}const Rt=Pn?o.useLayoutEffect:o.useEffect;function Hn(e){const t=o.useRef(e);return Rt(()=>{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 pn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function un(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function zn(e){const t=Hn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Nn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let io={};function yn(e,t){return o.useMemo(()=>{if(t)return t;const n=io[e]==null?0:io[e]+1;return io[e]=n,e+"-"+n},[e,t])}function Or(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[b,u]of m){const R=l[b];R!=null&&(l[b]=R+e*u)}return l},{...t})}}const _t=Or(1),vn=Or(-1);function Un(e){if(!e)return!1;const{KeyboardEvent:t}=mt(e.target);return t&&e instanceof t}function Ln(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=mt(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 jt=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[jt.Translate.toString(e),jt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Jo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function fi(e){return e.matches(Jo)?e:e.querySelector(Jo)}const pi={display:"none"};function vi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:pi},n)}function Ci(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 jr=o.createContext(null),bi={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
- `},bi={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 yi(e){let{announcements:t=bi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=Ci}=e;const{announce:l,announcement:d}=(function(){const[h,C]=o.useState("");return{announce:o.useCallback(k=>{k!=null&&C(k)},[]),announcement:h}})(),m=yn("DndLiveRegion"),[b,u]=o.useState(!1);if(o.useEffect(()=>{u(!0)},[]),(function(h){const C=o.useContext(jr);o.useEffect(()=>{if(!C)throw new Error("useDndMonitor must be used within a children of <DndContext>");return C(h)},[h,C])})(o.useMemo(()=>({onDragStart(h){let{active:C}=h;l(t.onDragStart({active:C}))},onDragMove(h){let{active:C,over:k}=h;t.onDragMove&&l(t.onDragMove({active:C,over:k}))},onDragOver(h){let{active:C,over:k}=h;l(t.onDragOver({active:C,over:k}))},onDragEnd(h){let{active:C,over:k}=h;l(t.onDragEnd({active:C,over:k}))},onDragCancel(h){let{active:C,over:k}=h;l(t.onDragCancel({active:C,over:k}))}}),[l,t])),!b)return null;const R=o.createElement(o.Fragment,null,o.createElement(pi,{id:i,value:a.draggable}),o.createElement(vi,{id:m,announcement:d}));return n?Lt.createPortal(R,n):R}var ct;function On(){}function ao(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 kt=Object.freeze({x:0,y:0});function Br(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function wi(e,t){const n=Ln(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Vr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function xi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Qo(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 Pr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function er(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 qi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=er(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,b=n.get(m);if(b){const u=Br(er(b),a);l.push({id:m,data:{droppableContainer:d,value:u}})}}return l.sort(Vr)};function Si(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 b=t.width*t.height,u=e.width*e.height,R=d*m;return Number((R/(b+u-R)).toFixed(4))}return 0}const Ri=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 b=Si(m,t);b>0&&a.push({id:d,data:{droppableContainer:l,value:b}})}}return a.sort(xi)};function tr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function ki(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 Mi=ki(1);function Hr(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 Ii={ignoreTransform:!1};function Jt(e,t){t===void 0&&(t=Ii);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:R}=mt(e).getComputedStyle(e);u&&(n=(function(h,C,k){const q=Hr(C);if(!q)return h;const{scaleX:E,scaleY:D,x:G,y:U}=q,T=h.left-G-(1-E)*parseFloat(k),V=h.top-U-(1-D)*parseFloat(k.slice(k.indexOf(" ")+1)),y=E?h.width/E:h.width,w=D?h.height/D:h.height;return{width:y,height:w,top:V,right:T+y,bottom:V+w,left:T}})(n,u,R))}const{top:i,left:a,width:l,height:d,bottom:m,right:b}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:b}}function nr(e){return Jt(e,{ignoreTransform:!0})}function Kn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(qo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!bn(a)||Lr(a)||n.includes(a))return n;const l=mt(e).getComputedStyle(a);return a!==e&&(function(d,m){m===void 0&&(m=mt(d).getComputedStyle(d));const b=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const R=m[u];return typeof R=="string"&&b.test(R)})})(a,l)&&n.push(a),(function(d,m){return m===void 0&&(m=mt(d).getComputedStyle(d)),m.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Ur(e){const[t]=Kn(e,1);return t??null}function so(e){return Pn&&e?Yt(e)?e:xo(e)?qo(e)||e===Zt(e).scrollingElement?window:bn(e)?e:null:null:null}function Kr(e){return Yt(e)?e.scrollX:e.scrollLeft}function $r(e){return Yt(e)?e.scrollY:e.scrollTop}function mo(e){return{x:Kr(e),y:$r(e)}}var ut;function Wr(e){return!(!Pn||!e)&&e===document.scrollingElement}function Gr(e){const t={x:0,y:0},n=Wr(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 Ti={x:.2,y:.2};function Ei(e,t,n,i,a){let{top:l,left:d,right:m,bottom:b}=n;i===void 0&&(i=10),a===void 0&&(a=Ti);const{isTop:u,isBottom:R,isLeft:h,isRight:C}=Gr(e),k={x:0,y:0},q={x:0,y:0},E=t.height*a.y,D=t.width*a.x;return!u&&l<=t.top+E?(k.y=ut.Backward,q.y=i*Math.abs((t.top+E-l)/E)):!R&&b>=t.bottom-E&&(k.y=ut.Forward,q.y=i*Math.abs((t.bottom-E-b)/E)),!C&&m>=t.right-D?(k.x=ut.Forward,q.x=i*Math.abs((t.right-D-m)/D)):!h&&d<=t.left+D&&(k.x=ut.Backward,q.x=i*Math.abs((t.left+D-d)/D)),{direction:k,speed:q}}function Fi(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 _r(e){return e.reduce((t,n)=>_t(t,mo(n)),kt)}function Zr(e,t){if(t===void 0&&(t=Jt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Ur(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ai=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Kr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+$r(n),0)}]];class fo{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=Kn(n),a=_r(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of Ai)for(const b of d)Object.defineProperty(this,b,{get:()=>{const u=m(i),R=a[l]-u;return this.rect[b]+R},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gn{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 co(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 qt,Qe;function or(e){e.preventDefault()}function Di(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"})(qt||(qt={})),(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"})(Qe||(Qe={}));const Xr={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},zi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class So{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 gn(Zt(n)),this.windowListeners=new gn(mt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Zr(i),n(kt)}handleKeyDown(t){if(Un(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Xr,coordinateGetter:d=zi,scrollBehavior:m="smooth"}=a,{code:b}=t;if(l.end.includes(b))return void this.handleEnd(t);if(l.cancel.includes(b))return void this.handleCancel(t);const{collisionRect:u}=i.current,R=u?{x:u.left,y:u.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=R);const h=d(t,{active:n,context:i.current,currentCoordinates:R});if(h){const C=vn(h,R),k={x:0,y:0},{scrollableAncestors:q}=i.current;for(const E of q){const D=t.code,{isTop:G,isRight:U,isLeft:T,isBottom:V,maxScroll:y,minScroll:w}=Gr(E),S=Fi(E),j={x:Math.min(D===Qe.Right?S.right-S.width/2:S.right,Math.max(D===Qe.Right?S.left:S.left+S.width/2,h.x)),y:Math.min(D===Qe.Down?S.bottom-S.height/2:S.bottom,Math.max(D===Qe.Down?S.top:S.top+S.height/2,h.y))},M=D===Qe.Right&&!U||D===Qe.Left&&!T,I=D===Qe.Down&&!V||D===Qe.Up&&!G;if(M&&j.x!==h.x){const $=E.scrollLeft+C.x,_=D===Qe.Right&&$<=y.x||D===Qe.Left&&$>=w.x;if(_&&!C.y)return void E.scrollTo({left:$,behavior:m});k.x=_?E.scrollLeft-$:D===Qe.Right?E.scrollLeft-y.x:E.scrollLeft-w.x,k.x&&E.scrollBy({left:-k.x,behavior:m});break}if(I&&j.y!==h.y){const $=E.scrollTop+C.y,_=D===Qe.Down&&$<=y.y||D===Qe.Up&&$>=w.y;if(_&&!C.x)return void E.scrollTo({top:$,behavior:m});k.y=_?E.scrollTop-$:D===Qe.Down?E.scrollTop-y.y:E.scrollTop-w.y,k.y&&E.scrollBy({top:-k.y,behavior:m});break}}this.handleMove(t,_t(vn(h,this.referenceCoordinates),k))}}}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 rr(e){return!!(e&&"distance"in e)}function lr(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Xr,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 Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(m){const{EventTarget:b}=mt(m);return m instanceof b?m:Zt(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=Zt(d),this.documentListeners=new gn(this.document),this.listeners=new gn(i),this.windowListeners=new gn(mt(d)),this.initialCoordinates=(a=Ln(l))!=null?a:kt,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(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,or),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,or),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(rr(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(qt.Click,Di,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.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 b=(n=Ln(t))!=null?n:kt,u=vn(a,b);if(!i&&m){if(rr(m)){if(m.tolerance!=null&&co(u,m.tolerance))return this.handleCancel();if(co(u,m.distance))return this.handleStart()}return lr(m)&&co(u,m.tolerance)?this.handleCancel():void this.handlePending(m,u)}t.cancelable&&t.preventDefault(),d(b)}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===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ni={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yr extends Ro{constructor(t){const{event:n}=t,i=Zt(n.target);super(t,Ni,i)}}Yr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Li={move:{name:"mousemove"},end:{name:"mouseup"}};var po;(function(e){e[e.RightClick=2]="RightClick"})(po||(po={}));class Jr extends Ro{constructor(t){super(t,Li,Zt(t.event.target))}}Jr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==po.RightClick&&(i?.({event:n}),!0)}}];const uo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qr extends Ro{constructor(t){super(t,uo)}static setup(){return window.addEventListener(uo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(uo.move.name,t)};function t(){}}}var hn,jn;function Oi(e){let{acceleration:t,activator:n=hn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=jn.TreeOrder,pointerCoordinates:b,scrollableAncestors:u,scrollableAncestorRects:R,delta:h,threshold:C}=e;const k=(function(w){let{delta:S,disabled:j}=w;const M=Nn(S);return un(I=>{if(j||!M||!I)return ji;const $={x:Math.sign(S.x-M.x),y:Math.sign(S.y-M.y)};return{x:{[ut.Backward]:I.x[ut.Backward]||$.x===-1,[ut.Forward]:I.x[ut.Forward]||$.x===1},y:{[ut.Backward]:I.y[ut.Backward]||$.y===-1,[ut.Forward]:I.y[ut.Forward]||$.y===1}}},[j,S,M])})({delta:h,disabled:!l}),[q,E]=(function(){const w=o.useRef(null);return[o.useCallback((S,j)=>{w.current=setInterval(S,j)},[]),o.useCallback(()=>{w.current!==null&&(clearInterval(w.current),w.current=null)},[])]})(),D=o.useRef({x:0,y:0}),G=o.useRef({x:0,y:0}),U=o.useMemo(()=>{switch(n){case hn.Pointer:return b?{top:b.y,bottom:b.y,left:b.x,right:b.x}:null;case hn.DraggableRect:return a}},[n,a,b]),T=o.useRef(null),V=o.useCallback(()=>{const w=T.current;if(!w)return;const S=D.current.x*G.current.x,j=D.current.y*G.current.y;w.scrollBy(S,j)},[]),y=o.useMemo(()=>m===jn.TreeOrder?[...u].reverse():u,[m,u]);o.useEffect(()=>{if(l&&u.length&&U){for(const w of y){if(i?.(w)===!1)continue;const S=u.indexOf(w),j=R[S];if(!j)continue;const{direction:M,speed:I}=Ei(w,j,U,t,C);for(const $ of["x","y"])k[$][M[$]]||(I[$]=0,M[$]=0);if(I.x>0||I.y>0)return E(),T.current=w,q(V,d),D.current=I,void(G.current=M)}D.current={x:0,y:0},G.current={x:0,y:0},E()}else E()},[t,V,i,E,l,d,JSON.stringify(U),JSON.stringify(k),q,u,y,R,JSON.stringify(C)])}Qr.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"})(hn||(hn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jn||(jn={}));const ji={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var Cn,vo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Cn||(Cn={})),(function(e){e.Optimized="optimized"})(vo||(vo={}));const ir=new Map;function Co(e,t){return un(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Bn(e){let{callback:t,disabled:n}=e;const i=Hn(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 Bi(e){return new fo(Jt(e),e)}function ar(e,t,n){t===void 0&&(t=Bi);const[i,a]=o.useState(null);function l(){a(b=>{if(!e)return null;var u;if(e.isConnected===!1)return(u=b??n)!=null?u:null;const R=t(e);return JSON.stringify(b)===JSON.stringify(R)?b:R})}const d=(function(b){let{callback:u,disabled:R}=b;const h=Hn(u),C=o.useMemo(()=>{if(R||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:k}=window;return new k(h)},[h,R]);return o.useEffect(()=>()=>C?.disconnect(),[C]),C})({callback(b){if(e)for(const u of b){const{type:R,target:h}=u;if(R==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Bn({callback:l});return Rt(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const sr=[];function dr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?vn(e,n.current):kt}function cr(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 ur=[];function el(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bn(t)?t:e}const Vi=[{sensor:Yr,options:{}},{sensor:So,options:{}}],Pi={current:{}},An={draggable:{measure:nr},droppable:{measure:nr,strategy:Cn.WhileDragging,frequency:vo.Optimized},dragOverlay:{measure:Jt}};class mn 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 Hi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:On},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:An,measureDroppableContainers:On,windowRect:null,measuringScheduled:!1},tl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:On,draggableNodes:new Map,over:null,measureDroppableContainers:On},wn=o.createContext(tl),nl=o.createContext(Hi);function Ui(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mn}}}function Ki(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 mn(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 mn(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 mn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function $i(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(wn),l=Nn(i),d=Nn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Un(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:b,node:u}=m;if(!b.current&&!u.current)return;requestAnimationFrame(()=>{for(const R of[b.current,u.current]){if(!R)continue;const h=mi(R);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function ol(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const $n=o.createContext({...kt,scaleX:1,scaleY:1});var At;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(At||(At={}));const Wi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:b,sensors:u=Vi,collisionDetection:R=Ri,measuring:h,modifiers:C,...k}=e;const q=o.useReducer(Ki,void 0,Ui),[E,D]=q,[G,U]=(function(){const[v]=o.useState(()=>new Set),P=o.useCallback(Z=>(v.add(Z),()=>v.delete(Z)),[v]);return[o.useCallback(Z=>{let{type:ee,event:ie}=Z;v.forEach(se=>{var ce;return(ce=se[ee])==null?void 0:ce.call(se,ie)})},[v]),P]})(),[T,V]=o.useState(At.Uninitialized),y=T===At.Initialized,{draggable:{active:w,nodes:S,translate:j},droppable:{containers:M}}=E,I=w!=null?S.get(w):null,$=o.useRef({initial:null,translated:null}),_=o.useMemo(()=>{var v;return w!=null?{id:w,data:(v=I?.data)!=null?v:Pi,rect:$}:null},[w,I]),H=o.useRef(null),[B,K]=o.useState(null),[oe,N]=o.useState(null),z=pn(k,Object.values(k)),ae=yn("DndDescribedBy",l),ve=o.useMemo(()=>M.getEnabled(),[M]),Ve=(qe=h,o.useMemo(()=>({draggable:{...An.draggable,...qe?.draggable},droppable:{...An.droppable,...qe?.droppable},dragOverlay:{...An.dragOverlay,...qe?.dragOverlay}}),[qe?.draggable,qe?.droppable,qe?.dragOverlay]));var qe;const{droppableRects:ue,measureDroppableContainers:ke,measuringScheduled:Ke}=(function(v,P){let{dragging:Z,dependencies:ee,config:ie}=P;const[se,ce]=o.useState(null),{frequency:we,measure:fe,strategy:pe}=ie,xe=o.useRef(v),Oe=(function(){switch(pe){case Cn.Always:return!1;case Cn.BeforeDragging:return Z;default:return!Z}})(),Ne=pn(Oe),We=o.useCallback(function(Le){Le===void 0&&(Le=[]),Ne.current||ce(Je=>Je===null?Le:Je.concat(Le.filter(at=>!Je.includes(at))))},[Ne]),je=o.useRef(null),_e=un(Le=>{if(Oe&&!Z)return ir;if(!Le||Le===ir||xe.current!==v||se!=null){const Je=new Map;for(let at of v){if(!at)continue;if(se&&se.length>0&&!se.includes(at.id)&&at.rect.current){Je.set(at.id,at.rect.current);continue}const ft=at.node.current,xt=ft?new fo(fe(ft),ft):null;at.rect.current=xt,xt&&Je.set(at.id,xt)}return Je}return Le},[v,se,Z,Oe,fe]);return o.useEffect(()=>{xe.current=v},[v]),o.useEffect(()=>{Oe||We()},[Z,Oe]),o.useEffect(()=>{se&&se.length>0&&ce(null)},[JSON.stringify(se)]),o.useEffect(()=>{Oe||typeof we!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},we))},[we,Oe,We,...ee]),{droppableRects:_e,measureDroppableContainers:We,measuringScheduled:se!=null}})(ve,{dragging:y,dependencies:[j.x,j.y],config:Ve.droppable}),Ue=(function(v,P){const Z=P!=null?v.get(P):void 0,ee=Z?Z.node.current:null;return un(ie=>{var se;return P==null?null:(se=ee??ie)!=null?se:null},[ee,P])})(S,w),Te=o.useMemo(()=>oe?Ln(oe):null,[oe]),he=(function(){const v=B?.autoScrollEnabled===!1,P=typeof m=="object"?m.enabled===!1:m===!1,Z=y&&!v&&!P;return typeof m=="object"?{...m,enabled:Z}:{enabled:Z}})(),W=(function(v,P){return Co(v,P)})(Ue,Ve.draggable.measure);(function(v){let{activeNode:P,measure:Z,initialRect:ee,config:ie=!0}=v;const se=o.useRef(!1),{x:ce,y:we}=typeof ie=="boolean"?{x:ie,y:ie}:ie;Rt(()=>{if(!ce&&!we||!P)return void(se.current=!1);if(se.current||!ee)return;const fe=P?.node.current;if(!fe||fe.isConnected===!1)return;const pe=tr(Z(fe),ee);if(ce||(pe.x=0),we||(pe.y=0),se.current=!0,Math.abs(pe.x)>0||Math.abs(pe.y)>0){const xe=Ur(fe);xe&&xe.scrollBy({top:pe.y,left:pe.x})}},[P,ce,we,ee,Z])})({activeNode:w!=null?S.get(w):null,config:he.layoutShiftCompensation,initialRect:W,measure:Ve.draggable.measure});const Fe=ar(Ue,Ve.draggable.measure,W),Ce=ar(Ue?Ue.parentElement:null),Y=o.useRef({activatorEvent:null,active:null,activeNode:Ue,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=M.getNodeFor((t=Y.current.over)==null?void 0:t.id),ne=(function(v){let{measure:P}=v;const[Z,ee]=o.useState(null),ie=Bn({callback:o.useCallback(fe=>{for(const{target:pe}of fe)if(bn(pe)){ee(xe=>{const Oe=P(pe);return xe?{...xe,width:Oe.width,height:Oe.height}:Oe});break}},[P])}),se=o.useCallback(fe=>{const pe=el(fe);ie?.disconnect(),pe&&ie?.observe(pe),ee(pe?P(pe):null)},[P,ie]),[ce,we]=zn(se);return o.useMemo(()=>({nodeRef:ce,rect:Z,setRef:we}),[Z,ce,we])})({measure:Ve.dragOverlay.measure}),le=(n=ne.nodeRef.current)!=null?n:Ue,me=y?(i=ne.rect)!=null?i:Fe:null,Se=!!(ne.nodeRef.current&&ne.rect),de=tr(be=Se?null:Fe,Co(be));var be;const Me=cr(le?mt(le):null),Ee=(function(v){const P=o.useRef(v),Z=un(ee=>v?ee&&ee!==sr&&v&&P.current&&v.parentNode===P.current.parentNode?ee:Kn(v):sr,[v]);return o.useEffect(()=>{P.current=v},[v]),Z})(y?J??Ue:null),f=(function(v,P){P===void 0&&(P=Jt);const[Z]=v,ee=cr(Z?mt(Z):null),[ie,se]=o.useState(ur);function ce(){se(()=>v.length?v.map(fe=>Wr(fe)?ee:new fo(P(fe),fe)):ur)}const we=Bn({callback:ce});return Rt(()=>{we?.disconnect(),ce(),v.forEach(fe=>we?.observe(fe))},[v]),ie})(Ee),De=ol(C,{transform:{x:j.x-de.x,y:j.y-de.y,scaleX:1,scaleY:1},activatorEvent:oe,active:_,activeNodeRect:Fe,containerNodeRect:Ce,draggingNodeRect:me,over:Y.current.over,overlayNodeRect:ne.rect,scrollableAncestors:Ee,scrollableAncestorRects:f,windowRect:Me}),Ye=Te?_t(Te,j):null,He=(function(v){const[P,Z]=o.useState(null),ee=o.useRef(v),ie=o.useCallback(se=>{const ce=so(se.target);ce&&Z(we=>we?(we.set(ce,mo(ce)),new Map(we)):null)},[]);return o.useEffect(()=>{const se=ee.current;if(v!==se){ce(se);const we=v.map(fe=>{const pe=so(fe);return pe?(pe.addEventListener("scroll",ie,{passive:!0}),[pe,mo(pe)]):null}).filter(fe=>fe!=null);Z(we.length?new Map(we):null),ee.current=v}return()=>{ce(v),ce(se)};function ce(we){we.forEach(fe=>{const pe=so(fe);pe?.removeEventListener("scroll",ie)})}},[ie,v]),o.useMemo(()=>v.length?P?Array.from(P.values()).reduce((se,ce)=>_t(se,ce),kt):_r(v):kt,[v,P])})(Ee),$e=dr(He),re=dr(He,[Fe]),Re=_t(De,$e),ze=me?Mi(me,De):null,ye=_&&ze?R({active:_,collisionRect:ze,droppableRects:ue,droppableContainers:ve,pointerCoordinates:Ye}):null,Ae=Pr(ye,"id"),[A,Q]=o.useState(null),O=(function(v,P,Z){return{...v,scaleX:P&&Z?P.width/Z.width:1,scaleY:P&&Z?P.height/Z.height:1}})(Se?De:_t(De,re),(a=A?.rect)!=null?a:null,Fe),X=o.useRef(null),g=o.useCallback((v,P)=>{let{sensor:Z,options:ee}=P;if(H.current==null)return;const ie=S.get(H.current);if(!ie)return;const se=v.nativeEvent,ce=new Z({active:H.current,activeNode:ie,event:se,options:ee,context:Y,onAbort(fe){if(!S.get(fe))return;const{onDragAbort:pe}=z.current,xe={id:fe};pe?.(xe),G({type:"onDragAbort",event:xe})},onPending(fe,pe,xe,Oe){if(!S.get(fe))return;const{onDragPending:Ne}=z.current,We={id:fe,constraint:pe,initialCoordinates:xe,offset:Oe};Ne?.(We),G({type:"onDragPending",event:We})},onStart(fe){const pe=H.current;if(pe==null)return;const xe=S.get(pe);if(!xe)return;const{onDragStart:Oe}=z.current,Ne={activatorEvent:se,active:{id:pe,data:xe.data,rect:$}};Lt.unstable_batchedUpdates(()=>{Oe?.(Ne),V(At.Initializing),D({type:ct.DragStart,initialCoordinates:fe,active:pe}),G({type:"onDragStart",event:Ne}),K(X.current),N(se)})},onMove(fe){D({type:ct.DragMove,coordinates:fe})},onEnd:we(ct.DragEnd),onCancel:we(ct.DragCancel)});function we(fe){return async function(){const{active:pe,collisions:xe,over:Oe,scrollAdjustedTranslate:Ne}=Y.current;let We=null;if(pe&&Ne){const{cancelDrop:je}=z.current;We={activatorEvent:se,active:pe,collisions:xe,delta:Ne,over:Oe},fe===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(fe=ct.DragCancel)}H.current=null,Lt.unstable_batchedUpdates(()=>{D({type:fe}),V(At.Uninitialized),Q(null),K(null),N(null),X.current=null;const je=fe===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const _e=z.current[je];_e?.(We),G({type:je,event:We})}})}}X.current=ce},[S]),x=o.useCallback((v,P)=>(Z,ee)=>{const ie=Z.nativeEvent,se=S.get(ee);if(H.current!==null||!se||ie.dndKit||ie.defaultPrevented)return;const ce={active:se};v(Z,P.options,ce)===!0&&(ie.dndKit={capturedBy:P.sensor},H.current=ee,g(Z,P))},[S,g]),F=(function(v,P){return o.useMemo(()=>v.reduce((Z,ee)=>{const{sensor:ie}=ee;return[...Z,...ie.activators.map(se=>({eventName:se.eventName,handler:P(se.handler,ee)}))]},[]),[v,P])})(u,x);(function(v){o.useEffect(()=>{if(!Pn)return;const P=v.map(Z=>{let{sensor:ee}=Z;return ee.setup==null?void 0:ee.setup()});return()=>{for(const Z of P)Z?.()}},v.map(P=>{let{sensor:Z}=P;return Z}))})(u),Rt(()=>{Fe&&T===At.Initializing&&V(At.Initialized)},[Fe,T]),o.useEffect(()=>{const{onDragMove:v}=z.current,{active:P,activatorEvent:Z,collisions:ee,over:ie}=Y.current;if(!P||!Z)return;const se={active:P,activatorEvent:Z,collisions:ee,delta:{x:Re.x,y:Re.y},over:ie};Lt.unstable_batchedUpdates(()=>{v?.(se),G({type:"onDragMove",event:se})})},[Re.x,Re.y]),o.useEffect(()=>{const{active:v,activatorEvent:P,collisions:Z,droppableContainers:ee,scrollAdjustedTranslate:ie}=Y.current;if(!v||H.current==null||!P||!ie)return;const{onDragOver:se}=z.current,ce=ee.get(Ae),we=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,fe={active:v,activatorEvent:P,collisions:Z,delta:{x:ie.x,y:ie.y},over:we};Lt.unstable_batchedUpdates(()=>{Q(we),se?.(fe),G({type:"onDragOver",event:fe})})},[Ae]),Rt(()=>{Y.current={activatorEvent:oe,active:_,activeNode:Ue,collisionRect:ze,collisions:ye,droppableRects:ue,draggableNodes:S,draggingNode:le,draggingNodeRect:me,droppableContainers:M,over:A,scrollableAncestors:Ee,scrollAdjustedTranslate:Re},$.current={initial:me,translated:ze}},[_,Ue,ye,ze,S,le,me,ue,M,A,Ee,Re]),Oi({...he,delta:j,draggingRect:ze,pointerCoordinates:Ye,scrollableAncestors:Ee,scrollableAncestorRects:f});const p=o.useMemo(()=>({active:_,activeNode:Ue,activeNodeRect:Fe,activatorEvent:oe,collisions:ye,containerNodeRect:Ce,dragOverlay:ne,draggableNodes:S,droppableContainers:M,droppableRects:ue,over:A,measureDroppableContainers:ke,scrollableAncestors:Ee,scrollableAncestorRects:f,measuringConfiguration:Ve,measuringScheduled:Ke,windowRect:Me}),[_,Ue,Fe,oe,ye,Ce,ne,S,M,ue,A,ke,Ee,f,Ve,Ke,Me]),L=o.useMemo(()=>({activatorEvent:oe,activators:F,active:_,activeNodeRect:Fe,ariaDescribedById:{draggable:ae},dispatch:D,draggableNodes:S,over:A,measureDroppableContainers:ke}),[oe,F,_,Fe,D,ae,S,A,ke]);return o.createElement(jr.Provider,{value:U},o.createElement(wn.Provider,{value:L},o.createElement(nl.Provider,{value:p},o.createElement($n.Provider,{value:O},b)),o.createElement($i,{disabled:d?.restoreFocus===!1})),o.createElement(yi,{...d,hiddenTextDescribedById:ae}))}),Gi=o.createContext(null),gr="button";function _i(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=yn("Draggable"),{activators:d,activatorEvent:m,active:b,activeNodeRect:u,ariaDescribedById:R,draggableNodes:h,over:C}=o.useContext(wn),{role:k=gr,roleDescription:q="draggable",tabIndex:E=0}=a??{},D=b?.id===t,G=o.useContext(D?$n:Gi),[U,T]=zn(),[V,y]=zn(),w=(function(j,M){return o.useMemo(()=>j.reduce((I,$)=>{let{eventName:_,handler:H}=$;return I[_]=B=>{H(B,M)},I},{}),[j,M])})(d,t),S=pn(n);return Rt(()=>(h.set(t,{id:t,key:l,node:U,activatorNode:V,data:S}),()=>{const j=h.get(t);j&&j.key===l&&h.delete(t)}),[h,t]),{active:b,activatorEvent:m,activeNodeRect:u,attributes:o.useMemo(()=>({role:k,tabIndex:E,"aria-disabled":i,"aria-pressed":!(!D||k!==gr)||void 0,"aria-roledescription":q,"aria-describedby":R.draggable}),[i,k,E,D,q,R.draggable]),isDragging:D,listeners:i?void 0:w,node:U,over:C,setNodeRef:T,setActivatorNodeRef:y,transform:G}}function rl(){return o.useContext(nl)}const Zi={timeout:25};function Xi(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Nn(n);return n||i||!m||a(m),Rt(()=>{if(!l)return;const b=i?.key,u=i?.props.id;b!=null&&u!=null?Promise.resolve(t(u,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const Yi={x:0,y:0,scaleX:1,scaleY:1};function Ji(e){let{children:t}=e;return o.createElement(wn.Provider,{value:tl},o.createElement($n.Provider,{value:Yi},t))}const Qi={position:"fixed",touchAction:"none"},ea=e=>Un(e)?"transform 250ms ease":void 0,ta=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:b,transform:u,transition:R=ea}=e;if(!m)return null;const h=a?u:{...u,scaleX:1,scaleY:1},C={...Qi,width:m.width,height:m.height,top:m.top,left:m.left,transform:jt.Transform.toString(h),transformOrigin:a&&i?wi(i,m):void 0,transition:typeof R=="function"?R(i):R,...b};return o.createElement(n,{className:d,style:C,ref:t},l)}),na=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,b]of Object.entries(l.active))b!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,b));if(l!=null&&l.dragOverlay)for(const[m,b]of Object.entries(l.dragOverlay))b!==void 0&&i.node.style.setProperty(m,b);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,b]of Object.entries(a))n.node.style.setProperty(m,b);d!=null&&d.active&&n.node.classList.remove(d.active)}},ll={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:jt.Transform.toString(t)},{transform:jt.Transform.toString(n)}]},sideEffects:na({styles:{active:{opacity:"0"}}})};function oa(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Hn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const b=m.node.current;if(!b)return;const u=el(d);if(!u)return;const{transform:R}=mt(d).getComputedStyle(d),h=Hr(R);if(!h)return;const C=typeof t=="function"?t:(function(k){const{duration:q,easing:E,sideEffects:D,keyframes:G}={...ll,...k};return U=>{let{active:T,dragOverlay:V,transform:y,...w}=U;if(!q)return;const S={x:V.rect.left-T.rect.left,y:V.rect.top-T.rect.top},j={scaleX:y.scaleX!==1?T.rect.width*y.scaleX/V.rect.width:1,scaleY:y.scaleY!==1?T.rect.height*y.scaleY/V.rect.height:1},M={x:y.x-S.x,y:y.y-S.y,...j},I=G({...w,active:T,dragOverlay:V,transform:{initial:y,final:M}}),[$]=I,_=I[I.length-1];if(JSON.stringify($)===JSON.stringify(_))return;const H=D?.({active:T,dragOverlay:V,...w}),B=V.node.animate(I,{duration:q,easing:E,fill:"forwards"});return new Promise(K=>{B.onfinish=()=>{H?.(),K()}})}})(t);return Zr(b,a.draggable.measure),C({active:{id:l,data:m.data,node:b,rect:a.draggable.measure(b)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(u)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let hr=0;function ra(e){return o.useMemo(()=>{if(e!=null)return hr++,hr},[e])}const la=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:b,zIndex:u=999}=e;const{activatorEvent:R,active:h,activeNodeRect:C,containerNodeRect:k,draggableNodes:q,droppableContainers:E,dragOverlay:D,over:G,measuringConfiguration:U,scrollableAncestors:T,scrollableAncestorRects:V,windowRect:y}=rl(),w=o.useContext($n),S=ra(h?.id),j=ol(d,{activatorEvent:R,active:h,activeNodeRect:C,containerNodeRect:k,draggingNodeRect:D.rect,over:G,overlayNodeRect:D.rect,scrollableAncestors:T,scrollableAncestorRects:V,transform:w,windowRect:y}),M=Co(C),I=oa({config:i,draggableNodes:q,droppableContainers:E,measuringConfiguration:U}),$=M?D.setRef:void 0;return o.createElement(Ji,null,o.createElement(Xi,{animation:I},h&&S?o.createElement(ta,{key:S,id:h.id,ref:$,as:m,activatorEvent:R,adjustScale:t,className:b,transition:l,rect:M,style:{zIndex:u,...a},transform:j},n):null))});function ko(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ia(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function En(e){return e!==null&&e>=0}const Fn={scaleX:1,scaleY:1},aa=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 b=(function(u,R,h){const C=u[R],k=u[R-1],q=u[R+1];return!C||!k&&!q?0:h<R?k?C.left-(k.left+k.width):q.left-(C.left+C.width):q?q.left-(C.left+C.width):C.left-(k.left+k.width)})(n,d,a);if(d===a){const u=n[l];return u?{x:a<l?u.left+u.width-(m.left+m.width):u.left-m.left,y:0,...Fn}:null}return d>a&&d<=l?{x:-m.width-b,y:0,...Fn}:d<a&&d>=l?{x:m.width+b,y:0,...Fn}:{x:0,y:0,...Fn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(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},il="Sortable",al=o.createContext({activeIndex:-1,containerId:il,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function sa(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:b,over:u,measureDroppableContainers:R}=rl(),h=yn(il,n),C=m.rect!==null,k=o.useMemo(()=>i.map(w=>typeof w=="object"&&"id"in w?w.id:w),[i]),q=d!=null,E=d?k.indexOf(d.id):-1,D=u?k.indexOf(u.id):-1,G=o.useRef(k),U=!(function(w,S){if(w===S)return!0;if(w.length!==S.length)return!1;for(let j=0;j<w.length;j++)if(w[j]!==S[j])return!1;return!0})(k,G.current),T=D!==-1&&E===-1||U,V=(function(w){return typeof w=="boolean"?{draggable:w,droppable:w}:w})(l);Rt(()=>{U&&q&&R(k)},[U,k,q,R]),o.useEffect(()=>{G.current=k},[k]);const y=o.useMemo(()=>({activeIndex:E,containerId:h,disabled:V,disableTransforms:T,items:k,overIndex:D,useDragOverlay:C,sortedRects:ia(k,b),strategy:a}),[E,h,V.draggable,V.droppable,T,k,D,b,C,a]);return o.createElement(al.Provider,{value:y},t)}const da=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},ca=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:b,transition:u}=e;return!(!u||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===b)},ua={duration:200,easing:"ease"},sl="transform",ga=jt.Transition.toString({property:sl,duration:0,easing:"linear"}),ha={roleDescription:"sortable"};function ma(e){let{animateLayoutChanges:t=ca,attributes:n,disabled:i,data:a,getNewIndex:l=da,id:d,strategy:m,resizeObserverConfig:b,transition:u=ua}=e;const{items:R,containerId:h,activeIndex:C,disabled:k,disableTransforms:q,sortedRects:E,overIndex:D,useDragOverlay:G,strategy:U}=o.useContext(al),T=(function(J,ne){var le,me;return typeof J=="boolean"?{draggable:J,droppable:!1}:{draggable:(le=J?.draggable)!=null?le:ne.draggable,droppable:(me=J?.droppable)!=null?me:ne.droppable}})(i,k),V=R.indexOf(d),y=o.useMemo(()=>({sortable:{containerId:h,index:V,items:R},...a}),[h,a,V,R]),w=o.useMemo(()=>R.slice(R.indexOf(d)),[R,d]),{rect:S,node:j,isOver:M,setNodeRef:I}=(function(J){let{data:ne,disabled:le=!1,id:me,resizeObserverConfig:Se}=J;const de=yn("Droppable"),{active:be,dispatch:Me,over:Ee,measureDroppableContainers:f}=o.useContext(wn),De=o.useRef({disabled:le}),Ye=o.useRef(!1),He=o.useRef(null),$e=o.useRef(null),{disabled:re,updateMeasurementsFor:Re,timeout:ze}={...Zi,...Se},ye=pn(Re??me),Ae=Bn({callback:o.useCallback(()=>{Ye.current?($e.current!=null&&clearTimeout($e.current),$e.current=setTimeout(()=>{f(Array.isArray(ye.current)?ye.current:[ye.current]),$e.current=null},ze)):Ye.current=!0},[ze]),disabled:re||!be}),A=o.useCallback((g,x)=>{Ae&&(x&&(Ae.unobserve(x),Ye.current=!1),g&&Ae.observe(g))},[Ae]),[Q,O]=zn(A),X=pn(ne);return o.useEffect(()=>{Ae&&Q.current&&(Ae.disconnect(),Ye.current=!1,Ae.observe(Q.current))},[Q,Ae]),o.useEffect(()=>(Me({type:ct.RegisterDroppable,element:{id:me,key:de,disabled:le,node:Q,rect:He,data:X}}),()=>Me({type:ct.UnregisterDroppable,key:de,id:me})),[me]),o.useEffect(()=>{le!==De.current.disabled&&(Me({type:ct.SetDroppableDisabled,id:me,key:de,disabled:le}),De.current.disabled=le)},[me,de,le,Me]),{active:be,rect:He,isOver:Ee?.id===me,node:Q,over:Ee,setNodeRef:O}})({id:d,data:y,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...b}}),{active:$,activatorEvent:_,activeNodeRect:H,attributes:B,setNodeRef:K,listeners:oe,isDragging:N,over:z,setActivatorNodeRef:ae,transform:ve}=_i({id:d,data:y,attributes:{...ha,...n},disabled:T.draggable}),Ve=(function(){for(var J=arguments.length,ne=new Array(J),le=0;le<J;le++)ne[le]=arguments[le];return o.useMemo(()=>me=>{ne.forEach(Se=>Se(me))},ne)})(I,K),qe=!!$,ue=qe&&!q&&En(C)&&En(D),ke=!G&&N,Ke=ke&&ue?ve:null,Ue=ue?Ke??(m??U)({rects:E,activeNodeRect:H,activeIndex:C,overIndex:D,index:V}):null,Te=En(C)&&En(D)?l({id:d,items:R,activeIndex:C,overIndex:D}):V,he=$?.id,W=o.useRef({activeId:he,items:R,newIndex:Te,containerId:h}),Fe=R!==W.current.items,Ce=t({active:$,containerId:h,isDragging:N,isSorting:qe,id:d,index:V,items:R,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:u,wasDragging:W.current.activeId!=null}),Y=(function(J){let{disabled:ne,index:le,node:me,rect:Se}=J;const[de,be]=o.useState(null),Me=o.useRef(le);return Rt(()=>{if(!ne&&le!==Me.current&&me.current){const Ee=Se.current;if(Ee){const f=Jt(me.current,{ignoreTransform:!0}),De={x:Ee.left-f.left,y:Ee.top-f.top,scaleX:Ee.width/f.width,scaleY:Ee.height/f.height};(De.x||De.y)&&be(De)}}le!==Me.current&&(Me.current=le)},[ne,le,me,Se]),o.useEffect(()=>{de&&be(null)},[de]),de})({disabled:!Ce,index:V,node:j,rect:S});return o.useEffect(()=>{qe&&W.current.newIndex!==Te&&(W.current.newIndex=Te),h!==W.current.containerId&&(W.current.containerId=h),R!==W.current.items&&(W.current.items=R)},[qe,Te,h,R]),o.useEffect(()=>{if(he===W.current.activeId)return;if(he!=null&&W.current.activeId==null)return void(W.current.activeId=he);const J=setTimeout(()=>{W.current.activeId=he},50);return()=>clearTimeout(J)},[he]),{active:$,activeIndex:C,attributes:B,data:y,rect:S,index:V,newIndex:Te,items:R,isOver:M,isSorting:qe,isDragging:N,listeners:oe,node:j,overIndex:D,over:z,setNodeRef:Ve,setActivatorNodeRef:ae,setDroppableNodeRef:I,setDraggableNodeRef:K,transform:Y??Ue,transition:(function(){if(Y||Fe&&W.current.newIndex===V)return ga;if(!(ke&&!Un(_)||!u)&&(qe||Ce))return jt.Transition.toString({...u,property:sl})})()}}function Vn(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 fa=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],pa=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(fa.includes(e.code)){if(e.preventDefault(),!n||!i)return;const b=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const C=a.get(h.id);if(C)switch(e.code){case Qe.Down:i.top<C.top&&b.push(h);break;case Qe.Up:i.top>C.top&&b.push(h);break;case Qe.Left:i.left>C.left&&b.push(h);break;case Qe.Right:i.left<C.left&&b.push(h)}});const u=(h=>{let{collisionRect:C,droppableRects:k,droppableContainers:q}=h;const E=Qo(C),D=[];for(const G of q){const{id:U}=G,T=k.get(U);if(T){const V=Qo(T),y=E.reduce((S,j,M)=>S+Br(V[M],j),0),w=Number((y/4).toFixed(4));D.push({id:U,data:{droppableContainer:G,value:w}})}}return D.sort(Vr)})({collisionRect:i,droppableRects:a,droppableContainers:b});let R=Pr(u,"id");if(R===d?.id&&u.length>1&&(R=u[1].id),R!=null){const h=l.get(n.id),C=l.get(R),k=C?a.get(C.id):null,q=C?.node.current;if(q&&k&&h&&C){const E=Kn(q).some((V,y)=>m[y]!==V),D=mr(h,C),G=(function(V,y){return!Vn(V)||!Vn(y)||!mr(V,y)?!1:V.data.current.sortable.index<y.data.current.sortable.index})(h,C),U=E||!D?{x:0,y:0}:{x:G?i.width-k.width:0,y:G?i.height-k.height:0},T={x:k.left,y:k.top};return U.x&&U.y?T:vn(T,U)}}}};function mr(e,t){return!(!Vn(e)||!Vn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const va=e=>{let{transform:t}=e;return{...t,y:0}},dl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:b,background:u,activeColor:R,borderColor:h,borderWidth:C,dragging:k,...q}=e;return c.jsxs("div",{ref:t,className:yt(a),style:{...i,display:"flex",flexDirection:"column",background:b===l?"white":u,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:b===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...q,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:b===l?"0px":"-1px",marginTop:b===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,b===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:b===l&&R?R?.toCSS():"none",minHeight:"2px"}})]})})),St={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"},Io=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:b,onRemove:u,renderItem:R,sorting:h,style:C,transition:k,transform:q,value:E,wrapperStyle:D,...G},U)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const T=R?R({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:b,ref:U,style:C,transform:q,transition:k,value:E}):c.jsx(c.Fragment,{children:E});return c.jsx("div",{className:yt("tab-item",St.Wrapper,a&&St.fadeIn,h&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[k,D?.transition].filter(Boolean).join(", "),"--translate-x":q?`${Math.round(q.x)}px`:void 0,"--translate-y":q?`${Math.round(q.y)}px`:void 0,"--scale-x":q?.scaleX?`${q.scaleX}`:void 0,"--scale-y":q?.scaleY?`${q.scaleY}`:void 0,"--index":m},ref:U,children:c.jsx("div",{className:yt(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:C,"data-cypress":"draggable-item",...l?void 0:b,...G,tabIndex:l?void 0:-1,children:T})})})),fr={Row:"_Row_1kr10_1"},cl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:yt(fr.Row,t&&fr.horizontal),children:e}))),Ca={...ll},ba=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=qi,coordinateGetter:m=pa,dropAnimation:b=Ca,getItemStyles:u=()=>({}),getNewIndex:R,handle:h=!1,items:C,onMove:k,isDisabled:q=()=>!1,measuring:E,modifiers:D,renderItem:G,renderDivider:U,reorderItems:T=ko,strategy:V=Mo,style:y,useDragOverlay:w=!0,onDragStart:S,wrapperStyle:j=()=>({})}=e,[M,I]=o.useState(()=>C);o.useEffect(()=>{I(C)},[C]);const[$,_]=o.useState(null),H=(function(){for(var z=arguments.length,ae=new Array(z),ve=0;ve<z;ve++)ae[ve]=arguments[ve];return o.useMemo(()=>[...ae].filter(Ve=>Ve!=null),[...ae])})(ao(Jr,{activationConstraint:i}),ao(Qr,{activationConstraint:i}),ao(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),B=M.indexOf.bind(M),K=$?B($):-1,oe=[];M.map((z,ae)=>{oe.push(c.jsx(ya,{id:z,handle:h,index:ae,style:u,wrapperStyle:j,disabled:q(z),renderItem:G,animateLayoutChanges:a,useDragOverlay:w,getNewIndex:R},z+"-"+ae));const ve=U?.({key:"divider-"+ae});ve&&oe.push(ve)});const{getPortalContainer:N}=r.useFullscreenPortal();return c.jsxs(Wi,{sensors:H,collisionDetection:d,onDragStart:z=>{const{active:ae}=z;ae&&(S?.(z),_(ae.id))},autoScroll:{canScroll:z=>!0},onDragEnd:z=>{if(_(null),z.over){const ae=B(z.over.id);K!==ae&&(I(ve=>T(ve,K,ae)),k?.(K,ae))}},onDragCancel:()=>{_(null)},measuring:E,modifiers:D,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...y},className:yt(n,St.Wrapper),children:c.jsx(sa,{items:M,strategy:V,children:c.jsx(cl,{ref:t,children:oe})})}),w?Lt.createPortal(c.jsx(la,{adjustScale:l,dropAnimation:b,children:$?c.jsx(Io,{value:M[K],handle:h,renderItem:G,wrapperStyle:j({index:K,isDragging:!0,id:M[K]}),index:K,dragging:!0,style:u({id:M[K],index:K,isSorting:$!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),N()):null]})}));function ya({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:b,useDragOverlay:u,wrapperStyle:R}){const{attributes:h,isDragging:C,isSorting:k,listeners:q,overIndex:E,setNodeRef:D,transform:G,transition:U}=ma({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(Io,{ref:D,value:a,disabled:e,dragging:C,sorting:k,handle:i,renderItem:b,index:l,style:m({index:l,id:a,isDragging:C,isSorting:k,overIndex:E}),onRemove:d?()=>d(a):void 0,transform:G,transition:U,wrapperStyle:R({index:l,isDragging:C,id:a}),listeners:q,"data-index":l,"data-id":a,dragOverlay:!u&&C,...h})}const wa="_TabStrip_3x0dp_1",xa=new s.Color("rgb(33, 115, 70)"),qa="#eee",Sa=e=>c.jsx(dl,{...e}),ul=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:b,onTabMove:u,createScrollStartButton:R=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:C=r.defaultCreateScrollEdgeButton,createTabButton:k=Sa,createTabDivider:q,editLabelProps:E,disabled:D=!1,disableDrag:G=!1,background:U="white",activeColor:T=xa,borderColor:V=qa,borderWidth:y=1}=e,[w,S]=o.useState(l),[j,M]=o.useState(d),I=o.useCallback(de=>{const be=N.current?.[de]?.closest(".tab-item")??N.current?.[de];be&&ke.current?.scrollTo({top:be.offsetTop,left:be.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{I(l)},[l]);const $=o.useCallback((de,be)=>{be!==w&&(S(be),m?.(be)),I(be)},[m,w]),_=o.useCallback((de,be)=>{u?.(de,be)},[u]),H=o.useRef(null),[B,K]=o.useState(-1),oe=o.useCallback((de,be)=>{b?.(de,be)},[b]);o.useLayoutEffect(()=>{S(l)},[l]),o.useLayoutEffect(()=>{M(d)},[d]);const N=o.useRef([]),z=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(de){N.current?.[de]?.startEdit()},cancel(de){N.current?.[de]?.cancel()}},z.current),[w,B]);const ae=o.useCallback(({value:de,index:be,dragging:Me})=>{const{style:Ee,maxLength:f,...De}=E||{},Ye=c.jsx(Nr,{ref:He=>{N.current[be]=He},value:de,disabled:D,maxLength:f,style:{color:w===be&&T?T?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Ee},styleHover:{},onSubmit:He=>(H.current=!1,K(-1),oe(be,He)),onCancel:()=>{H.current=!1,K(-1)},onChange:He=>{H.current=!0,K(be)},...De});return k({onClick:He=>$(He,be),value:de,index:be,editing:B===be&&H.current,editable:!0,disabled:D,selectedIndex:w,background:U,activeColor:T,borderColor:V,borderWidth:y,dragging:Me,children:Ye})},[w,oe,$,E,D,B,k]),[ve,{width:Ve}]=Ot(),[qe,{width:ue}]=Ot(),ke=o.useRef(null),[Ke,Ue]=o.useState({left:0,top:0,width:0,height:0}),[Te,he]=o.useState(null);o.useEffect(()=>{Te!==null&&ke.current&&ke.current.scrollTo({left:Te,behavior:"smooth"})},[Te]);const W=o.useCallback((de,be=!1)=>{if(!ke.current)return 0;let Me=ke.current.firstChild.getBoundingClientRect(),Ee=ke.current.firstChild.firstChild.children,f=0;return f=be?0:r.ScrollUtils.getScrollTo(de,Me.left,Ee,!0,Math.max(0,de-200)),he(f),Math.max(0,f)},[]),Fe=o.useCallback((de,be=!1)=>{if(!ke.current)return 0;let Me=ke.current.firstChild.getBoundingClientRect(),Ee=ke.current.firstChild.firstChild.children,f=0;const De=Math.ceil(ue-Ve);return f=be?De:r.ScrollUtils.getScrollTo(de,Me.left,Ee,!1,Math.max(0,de+200)),he(f),Math.min(De,f)},[ue,Ve]),Ce=o.useRef(null),Y=o.useRef(null),J=o.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null,Ce.current=null)},[]),ne=o.useCallback((de,be,Me=260)=>{Ce.current=de,Y.current=setTimeout(()=>{const Ee=be?W(Ce.current||de):Fe(Ce.current||de);Ee!==Ce.current?ne(Ee,be,120):J()},Me)},[W,Fe,J]);o.useEffect(()=>()=>J(),[J]);const le=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Ke.left)<=0||Math.floor(ue-Ve)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:J,onMouseLeave:J,onMouseDown:()=>ne(ke.current.scrollLeft,!0),onClick:de=>W(Math.min(ke.current.scrollLeft,Te??Number.MAX_SAFE_INTEGER),de.ctrlKey)}),[Ke,Te,ue,Ve]),me=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ue-Ve)<=Math.ceil(Ke.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:J,onMouseLeave:J,onMouseDown:()=>ne(ke.current.scrollLeft,!1),onClick:de=>Fe(Math.max(ke.current.scrollLeft,Te??0),de.ctrlKey)}),[Ke,Te,ue,Ve]),Se=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,C?.(le)]}),[le,me,R,h,n,C]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:yt(wa,a),ref:z,children:[c.jsx("div",{style:{borderTop:`solid ${V} ${y}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),c.jsx("div",{className:"Tabs",ref:ve,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:ke,onScroll:de=>{Ue({left:de.target.scrollLeft,top:de.target.scrollTop,width:de.target.scrollWidth,height:de.target.scrollHeight})},children:c.jsx(ba,{isDisabled:de=>D||G,items:j,strategy:aa,modifiers:[va],ref:qe,renderItem:ae,renderDivider:q,onMove:_,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:C(me)})]})}));ul.displayName="TabStrip";const Dn=o.createContext(null);Dn.displayName="DocThemesContext";const Ra="_script-editor_iy654_5",ka=o.lazy(()=>Promise.resolve().then(()=>require("./BpcQUJZeAVY6ZwMu.cjs"))),Ma={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"};let sn,dn,Ft=["define","require"],pr=!1;const vr=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 b={...m};b.lineNumber=1,b.column=1;let u=!1;for(let E=m.lineNumber;E>=1;E--)if(i.getLineContent(E).trim()===""){const D=To(d,i.getOffsetAt({lineNumber:E,column:1}),"function");if(!D||Ta(D)){u=!0,b.lineNumber=E+1;break}{const G=D.spans[0].start;E=i.getPositionAt(G).lineNumber,b.lineNumber=E}}let R=n,h=!1;!u&&!R.startsWith(`
27
+ `},yi={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 wi(e){let{announcements:t=yi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=bi}=e;const{announce:l,announcement:d}=(function(){const[h,C]=o.useState("");return{announce:o.useCallback(k=>{k!=null&&C(k)},[]),announcement:h}})(),m=yn("DndLiveRegion"),[b,u]=o.useState(!1);if(o.useEffect(()=>{u(!0)},[]),(function(h){const C=o.useContext(jr);o.useEffect(()=>{if(!C)throw new Error("useDndMonitor must be used within a children of <DndContext>");return C(h)},[h,C])})(o.useMemo(()=>({onDragStart(h){let{active:C}=h;l(t.onDragStart({active:C}))},onDragMove(h){let{active:C,over:k}=h;t.onDragMove&&l(t.onDragMove({active:C,over:k}))},onDragOver(h){let{active:C,over:k}=h;l(t.onDragOver({active:C,over:k}))},onDragEnd(h){let{active:C,over:k}=h;l(t.onDragEnd({active:C,over:k}))},onDragCancel(h){let{active:C,over:k}=h;l(t.onDragCancel({active:C,over:k}))}}),[l,t])),!b)return null;const R=o.createElement(o.Fragment,null,o.createElement(vi,{id:i,value:a.draggable}),o.createElement(Ci,{id:m,announcement:d}));return n?Lt.createPortal(R,n):R}var ct;function On(){}function ao(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 kt=Object.freeze({x:0,y:0});function Br(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xi(e,t){const n=Ln(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Vr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function qi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Qo(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 Pr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function er(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 Si=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=er(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,b=n.get(m);if(b){const u=Br(er(b),a);l.push({id:m,data:{droppableContainer:d,value:u}})}}return l.sort(Vr)};function Ri(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 b=t.width*t.height,u=e.width*e.height,R=d*m;return Number((R/(b+u-R)).toFixed(4))}return 0}const ki=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 b=Ri(m,t);b>0&&a.push({id:d,data:{droppableContainer:l,value:b}})}}return a.sort(qi)};function tr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function Mi(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 Ii=Mi(1);function Hr(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 Ti={ignoreTransform:!1};function Jt(e,t){t===void 0&&(t=Ti);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:R}=mt(e).getComputedStyle(e);u&&(n=(function(h,C,k){const q=Hr(C);if(!q)return h;const{scaleX:E,scaleY:D,x:G,y:U}=q,T=h.left-G-(1-E)*parseFloat(k),V=h.top-U-(1-D)*parseFloat(k.slice(k.indexOf(" ")+1)),y=E?h.width/E:h.width,w=D?h.height/D:h.height;return{width:y,height:w,top:V,right:T+y,bottom:V+w,left:T}})(n,u,R))}const{top:i,left:a,width:l,height:d,bottom:m,right:b}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:b}}function nr(e){return Jt(e,{ignoreTransform:!0})}function Kn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(qo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!bn(a)||Lr(a)||n.includes(a))return n;const l=mt(e).getComputedStyle(a);return a!==e&&(function(d,m){m===void 0&&(m=mt(d).getComputedStyle(d));const b=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const R=m[u];return typeof R=="string"&&b.test(R)})})(a,l)&&n.push(a),(function(d,m){return m===void 0&&(m=mt(d).getComputedStyle(d)),m.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Ur(e){const[t]=Kn(e,1);return t??null}function so(e){return Pn&&e?Yt(e)?e:xo(e)?qo(e)||e===Zt(e).scrollingElement?window:bn(e)?e:null:null:null}function Kr(e){return Yt(e)?e.scrollX:e.scrollLeft}function $r(e){return Yt(e)?e.scrollY:e.scrollTop}function mo(e){return{x:Kr(e),y:$r(e)}}var ut;function Wr(e){return!(!Pn||!e)&&e===document.scrollingElement}function Gr(e){const t={x:0,y:0},n=Wr(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 Ei={x:.2,y:.2};function Fi(e,t,n,i,a){let{top:l,left:d,right:m,bottom:b}=n;i===void 0&&(i=10),a===void 0&&(a=Ei);const{isTop:u,isBottom:R,isLeft:h,isRight:C}=Gr(e),k={x:0,y:0},q={x:0,y:0},E=t.height*a.y,D=t.width*a.x;return!u&&l<=t.top+E?(k.y=ut.Backward,q.y=i*Math.abs((t.top+E-l)/E)):!R&&b>=t.bottom-E&&(k.y=ut.Forward,q.y=i*Math.abs((t.bottom-E-b)/E)),!C&&m>=t.right-D?(k.x=ut.Forward,q.x=i*Math.abs((t.right-D-m)/D)):!h&&d<=t.left+D&&(k.x=ut.Backward,q.x=i*Math.abs((t.left+D-d)/D)),{direction:k,speed:q}}function Ai(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 _r(e){return e.reduce((t,n)=>_t(t,mo(n)),kt)}function Zr(e,t){if(t===void 0&&(t=Jt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Ur(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Di=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Kr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+$r(n),0)}]];class fo{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=Kn(n),a=_r(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of Di)for(const b of d)Object.defineProperty(this,b,{get:()=>{const u=m(i),R=a[l]-u;return this.rect[b]+R},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gn{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 co(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 qt,Qe;function or(e){e.preventDefault()}function zi(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"})(qt||(qt={})),(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"})(Qe||(Qe={}));const Xr={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},Ni=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class So{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 gn(Zt(n)),this.windowListeners=new gn(mt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Zr(i),n(kt)}handleKeyDown(t){if(Un(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Xr,coordinateGetter:d=Ni,scrollBehavior:m="smooth"}=a,{code:b}=t;if(l.end.includes(b))return void this.handleEnd(t);if(l.cancel.includes(b))return void this.handleCancel(t);const{collisionRect:u}=i.current,R=u?{x:u.left,y:u.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=R);const h=d(t,{active:n,context:i.current,currentCoordinates:R});if(h){const C=vn(h,R),k={x:0,y:0},{scrollableAncestors:q}=i.current;for(const E of q){const D=t.code,{isTop:G,isRight:U,isLeft:T,isBottom:V,maxScroll:y,minScroll:w}=Gr(E),S=Ai(E),j={x:Math.min(D===Qe.Right?S.right-S.width/2:S.right,Math.max(D===Qe.Right?S.left:S.left+S.width/2,h.x)),y:Math.min(D===Qe.Down?S.bottom-S.height/2:S.bottom,Math.max(D===Qe.Down?S.top:S.top+S.height/2,h.y))},M=D===Qe.Right&&!U||D===Qe.Left&&!T,I=D===Qe.Down&&!V||D===Qe.Up&&!G;if(M&&j.x!==h.x){const $=E.scrollLeft+C.x,_=D===Qe.Right&&$<=y.x||D===Qe.Left&&$>=w.x;if(_&&!C.y)return void E.scrollTo({left:$,behavior:m});k.x=_?E.scrollLeft-$:D===Qe.Right?E.scrollLeft-y.x:E.scrollLeft-w.x,k.x&&E.scrollBy({left:-k.x,behavior:m});break}if(I&&j.y!==h.y){const $=E.scrollTop+C.y,_=D===Qe.Down&&$<=y.y||D===Qe.Up&&$>=w.y;if(_&&!C.x)return void E.scrollTo({top:$,behavior:m});k.y=_?E.scrollTop-$:D===Qe.Down?E.scrollTop-y.y:E.scrollTop-w.y,k.y&&E.scrollBy({top:-k.y,behavior:m});break}}this.handleMove(t,_t(vn(h,this.referenceCoordinates),k))}}}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 rr(e){return!!(e&&"distance"in e)}function lr(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Xr,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 Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(m){const{EventTarget:b}=mt(m);return m instanceof b?m:Zt(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=Zt(d),this.documentListeners=new gn(this.document),this.listeners=new gn(i),this.windowListeners=new gn(mt(d)),this.initialCoordinates=(a=Ln(l))!=null?a:kt,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(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,or),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,or),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(rr(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(qt.Click,zi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.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 b=(n=Ln(t))!=null?n:kt,u=vn(a,b);if(!i&&m){if(rr(m)){if(m.tolerance!=null&&co(u,m.tolerance))return this.handleCancel();if(co(u,m.distance))return this.handleStart()}return lr(m)&&co(u,m.tolerance)?this.handleCancel():void this.handlePending(m,u)}t.cancelable&&t.preventDefault(),d(b)}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===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Li={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yr extends Ro{constructor(t){const{event:n}=t,i=Zt(n.target);super(t,Li,i)}}Yr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Oi={move:{name:"mousemove"},end:{name:"mouseup"}};var po;(function(e){e[e.RightClick=2]="RightClick"})(po||(po={}));class Jr extends Ro{constructor(t){super(t,Oi,Zt(t.event.target))}}Jr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==po.RightClick&&(i?.({event:n}),!0)}}];const uo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qr extends Ro{constructor(t){super(t,uo)}static setup(){return window.addEventListener(uo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(uo.move.name,t)};function t(){}}}var hn,jn;function ji(e){let{acceleration:t,activator:n=hn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=jn.TreeOrder,pointerCoordinates:b,scrollableAncestors:u,scrollableAncestorRects:R,delta:h,threshold:C}=e;const k=(function(w){let{delta:S,disabled:j}=w;const M=Nn(S);return un(I=>{if(j||!M||!I)return Bi;const $={x:Math.sign(S.x-M.x),y:Math.sign(S.y-M.y)};return{x:{[ut.Backward]:I.x[ut.Backward]||$.x===-1,[ut.Forward]:I.x[ut.Forward]||$.x===1},y:{[ut.Backward]:I.y[ut.Backward]||$.y===-1,[ut.Forward]:I.y[ut.Forward]||$.y===1}}},[j,S,M])})({delta:h,disabled:!l}),[q,E]=(function(){const w=o.useRef(null);return[o.useCallback((S,j)=>{w.current=setInterval(S,j)},[]),o.useCallback(()=>{w.current!==null&&(clearInterval(w.current),w.current=null)},[])]})(),D=o.useRef({x:0,y:0}),G=o.useRef({x:0,y:0}),U=o.useMemo(()=>{switch(n){case hn.Pointer:return b?{top:b.y,bottom:b.y,left:b.x,right:b.x}:null;case hn.DraggableRect:return a}},[n,a,b]),T=o.useRef(null),V=o.useCallback(()=>{const w=T.current;if(!w)return;const S=D.current.x*G.current.x,j=D.current.y*G.current.y;w.scrollBy(S,j)},[]),y=o.useMemo(()=>m===jn.TreeOrder?[...u].reverse():u,[m,u]);o.useEffect(()=>{if(l&&u.length&&U){for(const w of y){if(i?.(w)===!1)continue;const S=u.indexOf(w),j=R[S];if(!j)continue;const{direction:M,speed:I}=Fi(w,j,U,t,C);for(const $ of["x","y"])k[$][M[$]]||(I[$]=0,M[$]=0);if(I.x>0||I.y>0)return E(),T.current=w,q(V,d),D.current=I,void(G.current=M)}D.current={x:0,y:0},G.current={x:0,y:0},E()}else E()},[t,V,i,E,l,d,JSON.stringify(U),JSON.stringify(k),q,u,y,R,JSON.stringify(C)])}Qr.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"})(hn||(hn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jn||(jn={}));const Bi={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var Cn,vo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Cn||(Cn={})),(function(e){e.Optimized="optimized"})(vo||(vo={}));const ir=new Map;function Co(e,t){return un(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Bn(e){let{callback:t,disabled:n}=e;const i=Hn(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 Vi(e){return new fo(Jt(e),e)}function ar(e,t,n){t===void 0&&(t=Vi);const[i,a]=o.useState(null);function l(){a(b=>{if(!e)return null;var u;if(e.isConnected===!1)return(u=b??n)!=null?u:null;const R=t(e);return JSON.stringify(b)===JSON.stringify(R)?b:R})}const d=(function(b){let{callback:u,disabled:R}=b;const h=Hn(u),C=o.useMemo(()=>{if(R||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:k}=window;return new k(h)},[h,R]);return o.useEffect(()=>()=>C?.disconnect(),[C]),C})({callback(b){if(e)for(const u of b){const{type:R,target:h}=u;if(R==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Bn({callback:l});return Rt(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const sr=[];function dr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?vn(e,n.current):kt}function cr(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 ur=[];function el(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bn(t)?t:e}const Pi=[{sensor:Yr,options:{}},{sensor:So,options:{}}],Hi={current:{}},An={draggable:{measure:nr},droppable:{measure:nr,strategy:Cn.WhileDragging,frequency:vo.Optimized},dragOverlay:{measure:Jt}};class mn 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 Ui={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:On},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:An,measureDroppableContainers:On,windowRect:null,measuringScheduled:!1},tl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:On,draggableNodes:new Map,over:null,measureDroppableContainers:On},wn=o.createContext(tl),nl=o.createContext(Ui);function Ki(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mn}}}function $i(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 mn(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 mn(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 mn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Wi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(wn),l=Nn(i),d=Nn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Un(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:b,node:u}=m;if(!b.current&&!u.current)return;requestAnimationFrame(()=>{for(const R of[b.current,u.current]){if(!R)continue;const h=fi(R);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function ol(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const $n=o.createContext({...kt,scaleX:1,scaleY:1});var At;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(At||(At={}));const Gi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:b,sensors:u=Pi,collisionDetection:R=ki,measuring:h,modifiers:C,...k}=e;const q=o.useReducer($i,void 0,Ki),[E,D]=q,[G,U]=(function(){const[v]=o.useState(()=>new Set),P=o.useCallback(Z=>(v.add(Z),()=>v.delete(Z)),[v]);return[o.useCallback(Z=>{let{type:ee,event:ie}=Z;v.forEach(de=>{var ce;return(ce=de[ee])==null?void 0:ce.call(de,ie)})},[v]),P]})(),[T,V]=o.useState(At.Uninitialized),y=T===At.Initialized,{draggable:{active:w,nodes:S,translate:j},droppable:{containers:M}}=E,I=w!=null?S.get(w):null,$=o.useRef({initial:null,translated:null}),_=o.useMemo(()=>{var v;return w!=null?{id:w,data:(v=I?.data)!=null?v:Hi,rect:$}:null},[w,I]),H=o.useRef(null),[B,K]=o.useState(null),[ne,N]=o.useState(null),z=pn(k,Object.values(k)),se=yn("DndDescribedBy",l),ve=o.useMemo(()=>M.getEnabled(),[M]),Ve=(Se=h,o.useMemo(()=>({draggable:{...An.draggable,...Se?.draggable},droppable:{...An.droppable,...Se?.droppable},dragOverlay:{...An.dragOverlay,...Se?.dragOverlay}}),[Se?.draggable,Se?.droppable,Se?.dragOverlay]));var Se;const{droppableRects:ue,measureDroppableContainers:Me,measuringScheduled:Ke}=(function(v,P){let{dragging:Z,dependencies:ee,config:ie}=P;const[de,ce]=o.useState(null),{frequency:xe,measure:fe,strategy:pe}=ie,qe=o.useRef(v),Oe=(function(){switch(pe){case Cn.Always:return!1;case Cn.BeforeDragging:return Z;default:return!Z}})(),Ne=pn(Oe),We=o.useCallback(function(Le){Le===void 0&&(Le=[]),Ne.current||ce(Je=>Je===null?Le:Je.concat(Le.filter(at=>!Je.includes(at))))},[Ne]),je=o.useRef(null),_e=un(Le=>{if(Oe&&!Z)return ir;if(!Le||Le===ir||qe.current!==v||de!=null){const Je=new Map;for(let at of v){if(!at)continue;if(de&&de.length>0&&!de.includes(at.id)&&at.rect.current){Je.set(at.id,at.rect.current);continue}const ft=at.node.current,xt=ft?new fo(fe(ft),ft):null;at.rect.current=xt,xt&&Je.set(at.id,xt)}return Je}return Le},[v,de,Z,Oe,fe]);return o.useEffect(()=>{qe.current=v},[v]),o.useEffect(()=>{Oe||We()},[Z,Oe]),o.useEffect(()=>{de&&de.length>0&&ce(null)},[JSON.stringify(de)]),o.useEffect(()=>{Oe||typeof xe!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},xe))},[xe,Oe,We,...ee]),{droppableRects:_e,measureDroppableContainers:We,measuringScheduled:de!=null}})(ve,{dragging:y,dependencies:[j.x,j.y],config:Ve.droppable}),Ue=(function(v,P){const Z=P!=null?v.get(P):void 0,ee=Z?Z.node.current:null;return un(ie=>{var de;return P==null?null:(de=ee??ie)!=null?de:null},[ee,P])})(S,w),Te=o.useMemo(()=>ne?Ln(ne):null,[ne]),he=(function(){const v=B?.autoScrollEnabled===!1,P=typeof m=="object"?m.enabled===!1:m===!1,Z=y&&!v&&!P;return typeof m=="object"?{...m,enabled:Z}:{enabled:Z}})(),W=(function(v,P){return Co(v,P)})(Ue,Ve.draggable.measure);(function(v){let{activeNode:P,measure:Z,initialRect:ee,config:ie=!0}=v;const de=o.useRef(!1),{x:ce,y:xe}=typeof ie=="boolean"?{x:ie,y:ie}:ie;Rt(()=>{if(!ce&&!xe||!P)return void(de.current=!1);if(de.current||!ee)return;const fe=P?.node.current;if(!fe||fe.isConnected===!1)return;const pe=tr(Z(fe),ee);if(ce||(pe.x=0),xe||(pe.y=0),de.current=!0,Math.abs(pe.x)>0||Math.abs(pe.y)>0){const qe=Ur(fe);qe&&qe.scrollBy({top:pe.y,left:pe.x})}},[P,ce,xe,ee,Z])})({activeNode:w!=null?S.get(w):null,config:he.layoutShiftCompensation,initialRect:W,measure:Ve.draggable.measure});const Fe=ar(Ue,Ve.draggable.measure,W),Ce=ar(Ue?Ue.parentElement:null),Y=o.useRef({activatorEvent:null,active:null,activeNode:Ue,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=M.getNodeFor((t=Y.current.over)==null?void 0:t.id),re=(function(v){let{measure:P}=v;const[Z,ee]=o.useState(null),ie=Bn({callback:o.useCallback(fe=>{for(const{target:pe}of fe)if(bn(pe)){ee(qe=>{const Oe=P(pe);return qe?{...qe,width:Oe.width,height:Oe.height}:Oe});break}},[P])}),de=o.useCallback(fe=>{const pe=el(fe);ie?.disconnect(),pe&&ie?.observe(pe),ee(pe?P(pe):null)},[P,ie]),[ce,xe]=zn(de);return o.useMemo(()=>({nodeRef:ce,rect:Z,setRef:xe}),[Z,ce,xe])})({measure:Ve.dragOverlay.measure}),le=(n=re.nodeRef.current)!=null?n:Ue,me=y?(i=re.rect)!=null?i:Fe:null,ye=!!(re.nodeRef.current&&re.rect),ae=tr(be=ye?null:Fe,Co(be));var be;const Re=cr(le?mt(le):null),Ee=(function(v){const P=o.useRef(v),Z=un(ee=>v?ee&&ee!==sr&&v&&P.current&&v.parentNode===P.current.parentNode?ee:Kn(v):sr,[v]);return o.useEffect(()=>{P.current=v},[v]),Z})(y?J??Ue:null),f=(function(v,P){P===void 0&&(P=Jt);const[Z]=v,ee=cr(Z?mt(Z):null),[ie,de]=o.useState(ur);function ce(){de(()=>v.length?v.map(fe=>Wr(fe)?ee:new fo(P(fe),fe)):ur)}const xe=Bn({callback:ce});return Rt(()=>{xe?.disconnect(),ce(),v.forEach(fe=>xe?.observe(fe))},[v]),ie})(Ee),De=ol(C,{transform:{x:j.x-ae.x,y:j.y-ae.y,scaleX:1,scaleY:1},activatorEvent:ne,active:_,activeNodeRect:Fe,containerNodeRect:Ce,draggingNodeRect:me,over:Y.current.over,overlayNodeRect:re.rect,scrollableAncestors:Ee,scrollableAncestorRects:f,windowRect:Re}),Ye=Te?_t(Te,j):null,He=(function(v){const[P,Z]=o.useState(null),ee=o.useRef(v),ie=o.useCallback(de=>{const ce=so(de.target);ce&&Z(xe=>xe?(xe.set(ce,mo(ce)),new Map(xe)):null)},[]);return o.useEffect(()=>{const de=ee.current;if(v!==de){ce(de);const xe=v.map(fe=>{const pe=so(fe);return pe?(pe.addEventListener("scroll",ie,{passive:!0}),[pe,mo(pe)]):null}).filter(fe=>fe!=null);Z(xe.length?new Map(xe):null),ee.current=v}return()=>{ce(v),ce(de)};function ce(xe){xe.forEach(fe=>{const pe=so(fe);pe?.removeEventListener("scroll",ie)})}},[ie,v]),o.useMemo(()=>v.length?P?Array.from(P.values()).reduce((de,ce)=>_t(de,ce),kt):_r(v):kt,[v,P])})(Ee),$e=dr(He),oe=dr(He,[Fe]),ke=_t(De,$e),ze=me?Ii(me,De):null,we=_&&ze?R({active:_,collisionRect:ze,droppableRects:ue,droppableContainers:ve,pointerCoordinates:Ye}):null,Ae=Pr(we,"id"),[A,Q]=o.useState(null),O=(function(v,P,Z){return{...v,scaleX:P&&Z?P.width/Z.width:1,scaleY:P&&Z?P.height/Z.height:1}})(ye?De:_t(De,oe),(a=A?.rect)!=null?a:null,Fe),X=o.useRef(null),g=o.useCallback((v,P)=>{let{sensor:Z,options:ee}=P;if(H.current==null)return;const ie=S.get(H.current);if(!ie)return;const de=v.nativeEvent,ce=new Z({active:H.current,activeNode:ie,event:de,options:ee,context:Y,onAbort(fe){if(!S.get(fe))return;const{onDragAbort:pe}=z.current,qe={id:fe};pe?.(qe),G({type:"onDragAbort",event:qe})},onPending(fe,pe,qe,Oe){if(!S.get(fe))return;const{onDragPending:Ne}=z.current,We={id:fe,constraint:pe,initialCoordinates:qe,offset:Oe};Ne?.(We),G({type:"onDragPending",event:We})},onStart(fe){const pe=H.current;if(pe==null)return;const qe=S.get(pe);if(!qe)return;const{onDragStart:Oe}=z.current,Ne={activatorEvent:de,active:{id:pe,data:qe.data,rect:$}};Lt.unstable_batchedUpdates(()=>{Oe?.(Ne),V(At.Initializing),D({type:ct.DragStart,initialCoordinates:fe,active:pe}),G({type:"onDragStart",event:Ne}),K(X.current),N(de)})},onMove(fe){D({type:ct.DragMove,coordinates:fe})},onEnd:xe(ct.DragEnd),onCancel:xe(ct.DragCancel)});function xe(fe){return async function(){const{active:pe,collisions:qe,over:Oe,scrollAdjustedTranslate:Ne}=Y.current;let We=null;if(pe&&Ne){const{cancelDrop:je}=z.current;We={activatorEvent:de,active:pe,collisions:qe,delta:Ne,over:Oe},fe===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(fe=ct.DragCancel)}H.current=null,Lt.unstable_batchedUpdates(()=>{D({type:fe}),V(At.Uninitialized),Q(null),K(null),N(null),X.current=null;const je=fe===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const _e=z.current[je];_e?.(We),G({type:je,event:We})}})}}X.current=ce},[S]),x=o.useCallback((v,P)=>(Z,ee)=>{const ie=Z.nativeEvent,de=S.get(ee);if(H.current!==null||!de||ie.dndKit||ie.defaultPrevented)return;const ce={active:de};v(Z,P.options,ce)===!0&&(ie.dndKit={capturedBy:P.sensor},H.current=ee,g(Z,P))},[S,g]),F=(function(v,P){return o.useMemo(()=>v.reduce((Z,ee)=>{const{sensor:ie}=ee;return[...Z,...ie.activators.map(de=>({eventName:de.eventName,handler:P(de.handler,ee)}))]},[]),[v,P])})(u,x);(function(v){o.useEffect(()=>{if(!Pn)return;const P=v.map(Z=>{let{sensor:ee}=Z;return ee.setup==null?void 0:ee.setup()});return()=>{for(const Z of P)Z?.()}},v.map(P=>{let{sensor:Z}=P;return Z}))})(u),Rt(()=>{Fe&&T===At.Initializing&&V(At.Initialized)},[Fe,T]),o.useEffect(()=>{const{onDragMove:v}=z.current,{active:P,activatorEvent:Z,collisions:ee,over:ie}=Y.current;if(!P||!Z)return;const de={active:P,activatorEvent:Z,collisions:ee,delta:{x:ke.x,y:ke.y},over:ie};Lt.unstable_batchedUpdates(()=>{v?.(de),G({type:"onDragMove",event:de})})},[ke.x,ke.y]),o.useEffect(()=>{const{active:v,activatorEvent:P,collisions:Z,droppableContainers:ee,scrollAdjustedTranslate:ie}=Y.current;if(!v||H.current==null||!P||!ie)return;const{onDragOver:de}=z.current,ce=ee.get(Ae),xe=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,fe={active:v,activatorEvent:P,collisions:Z,delta:{x:ie.x,y:ie.y},over:xe};Lt.unstable_batchedUpdates(()=>{Q(xe),de?.(fe),G({type:"onDragOver",event:fe})})},[Ae]),Rt(()=>{Y.current={activatorEvent:ne,active:_,activeNode:Ue,collisionRect:ze,collisions:we,droppableRects:ue,draggableNodes:S,draggingNode:le,draggingNodeRect:me,droppableContainers:M,over:A,scrollableAncestors:Ee,scrollAdjustedTranslate:ke},$.current={initial:me,translated:ze}},[_,Ue,we,ze,S,le,me,ue,M,A,Ee,ke]),ji({...he,delta:j,draggingRect:ze,pointerCoordinates:Ye,scrollableAncestors:Ee,scrollableAncestorRects:f});const p=o.useMemo(()=>({active:_,activeNode:Ue,activeNodeRect:Fe,activatorEvent:ne,collisions:we,containerNodeRect:Ce,dragOverlay:re,draggableNodes:S,droppableContainers:M,droppableRects:ue,over:A,measureDroppableContainers:Me,scrollableAncestors:Ee,scrollableAncestorRects:f,measuringConfiguration:Ve,measuringScheduled:Ke,windowRect:Re}),[_,Ue,Fe,ne,we,Ce,re,S,M,ue,A,Me,Ee,f,Ve,Ke,Re]),L=o.useMemo(()=>({activatorEvent:ne,activators:F,active:_,activeNodeRect:Fe,ariaDescribedById:{draggable:se},dispatch:D,draggableNodes:S,over:A,measureDroppableContainers:Me}),[ne,F,_,Fe,D,se,S,A,Me]);return o.createElement(jr.Provider,{value:U},o.createElement(wn.Provider,{value:L},o.createElement(nl.Provider,{value:p},o.createElement($n.Provider,{value:O},b)),o.createElement(Wi,{disabled:d?.restoreFocus===!1})),o.createElement(wi,{...d,hiddenTextDescribedById:se}))}),_i=o.createContext(null),gr="button";function Zi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=yn("Draggable"),{activators:d,activatorEvent:m,active:b,activeNodeRect:u,ariaDescribedById:R,draggableNodes:h,over:C}=o.useContext(wn),{role:k=gr,roleDescription:q="draggable",tabIndex:E=0}=a??{},D=b?.id===t,G=o.useContext(D?$n:_i),[U,T]=zn(),[V,y]=zn(),w=(function(j,M){return o.useMemo(()=>j.reduce((I,$)=>{let{eventName:_,handler:H}=$;return I[_]=B=>{H(B,M)},I},{}),[j,M])})(d,t),S=pn(n);return Rt(()=>(h.set(t,{id:t,key:l,node:U,activatorNode:V,data:S}),()=>{const j=h.get(t);j&&j.key===l&&h.delete(t)}),[h,t]),{active:b,activatorEvent:m,activeNodeRect:u,attributes:o.useMemo(()=>({role:k,tabIndex:E,"aria-disabled":i,"aria-pressed":!(!D||k!==gr)||void 0,"aria-roledescription":q,"aria-describedby":R.draggable}),[i,k,E,D,q,R.draggable]),isDragging:D,listeners:i?void 0:w,node:U,over:C,setNodeRef:T,setActivatorNodeRef:y,transform:G}}function rl(){return o.useContext(nl)}const Xi={timeout:25};function Yi(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Nn(n);return n||i||!m||a(m),Rt(()=>{if(!l)return;const b=i?.key,u=i?.props.id;b!=null&&u!=null?Promise.resolve(t(u,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const Ji={x:0,y:0,scaleX:1,scaleY:1};function Qi(e){let{children:t}=e;return o.createElement(wn.Provider,{value:tl},o.createElement($n.Provider,{value:Ji},t))}const ea={position:"fixed",touchAction:"none"},ta=e=>Un(e)?"transform 250ms ease":void 0,na=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:b,transform:u,transition:R=ta}=e;if(!m)return null;const h=a?u:{...u,scaleX:1,scaleY:1},C={...ea,width:m.width,height:m.height,top:m.top,left:m.left,transform:jt.Transform.toString(h),transformOrigin:a&&i?xi(i,m):void 0,transition:typeof R=="function"?R(i):R,...b};return o.createElement(n,{className:d,style:C,ref:t},l)}),oa=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,b]of Object.entries(l.active))b!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,b));if(l!=null&&l.dragOverlay)for(const[m,b]of Object.entries(l.dragOverlay))b!==void 0&&i.node.style.setProperty(m,b);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,b]of Object.entries(a))n.node.style.setProperty(m,b);d!=null&&d.active&&n.node.classList.remove(d.active)}},ll={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:jt.Transform.toString(t)},{transform:jt.Transform.toString(n)}]},sideEffects:oa({styles:{active:{opacity:"0"}}})};function ra(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Hn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const b=m.node.current;if(!b)return;const u=el(d);if(!u)return;const{transform:R}=mt(d).getComputedStyle(d),h=Hr(R);if(!h)return;const C=typeof t=="function"?t:(function(k){const{duration:q,easing:E,sideEffects:D,keyframes:G}={...ll,...k};return U=>{let{active:T,dragOverlay:V,transform:y,...w}=U;if(!q)return;const S={x:V.rect.left-T.rect.left,y:V.rect.top-T.rect.top},j={scaleX:y.scaleX!==1?T.rect.width*y.scaleX/V.rect.width:1,scaleY:y.scaleY!==1?T.rect.height*y.scaleY/V.rect.height:1},M={x:y.x-S.x,y:y.y-S.y,...j},I=G({...w,active:T,dragOverlay:V,transform:{initial:y,final:M}}),[$]=I,_=I[I.length-1];if(JSON.stringify($)===JSON.stringify(_))return;const H=D?.({active:T,dragOverlay:V,...w}),B=V.node.animate(I,{duration:q,easing:E,fill:"forwards"});return new Promise(K=>{B.onfinish=()=>{H?.(),K()}})}})(t);return Zr(b,a.draggable.measure),C({active:{id:l,data:m.data,node:b,rect:a.draggable.measure(b)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(u)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let hr=0;function la(e){return o.useMemo(()=>{if(e!=null)return hr++,hr},[e])}const ia=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:b,zIndex:u=999}=e;const{activatorEvent:R,active:h,activeNodeRect:C,containerNodeRect:k,draggableNodes:q,droppableContainers:E,dragOverlay:D,over:G,measuringConfiguration:U,scrollableAncestors:T,scrollableAncestorRects:V,windowRect:y}=rl(),w=o.useContext($n),S=la(h?.id),j=ol(d,{activatorEvent:R,active:h,activeNodeRect:C,containerNodeRect:k,draggingNodeRect:D.rect,over:G,overlayNodeRect:D.rect,scrollableAncestors:T,scrollableAncestorRects:V,transform:w,windowRect:y}),M=Co(C),I=ra({config:i,draggableNodes:q,droppableContainers:E,measuringConfiguration:U}),$=M?D.setRef:void 0;return o.createElement(Qi,null,o.createElement(Yi,{animation:I},h&&S?o.createElement(na,{key:S,id:h.id,ref:$,as:m,activatorEvent:R,adjustScale:t,className:b,transition:l,rect:M,style:{zIndex:u,...a},transform:j},n):null))});function ko(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function aa(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function En(e){return e!==null&&e>=0}const Fn={scaleX:1,scaleY:1},sa=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 b=(function(u,R,h){const C=u[R],k=u[R-1],q=u[R+1];return!C||!k&&!q?0:h<R?k?C.left-(k.left+k.width):q.left-(C.left+C.width):q?q.left-(C.left+C.width):C.left-(k.left+k.width)})(n,d,a);if(d===a){const u=n[l];return u?{x:a<l?u.left+u.width-(m.left+m.width):u.left-m.left,y:0,...Fn}:null}return d>a&&d<=l?{x:-m.width-b,y:0,...Fn}:d<a&&d>=l?{x:m.width+b,y:0,...Fn}:{x:0,y:0,...Fn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(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},il="Sortable",al=o.createContext({activeIndex:-1,containerId:il,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function da(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:b,over:u,measureDroppableContainers:R}=rl(),h=yn(il,n),C=m.rect!==null,k=o.useMemo(()=>i.map(w=>typeof w=="object"&&"id"in w?w.id:w),[i]),q=d!=null,E=d?k.indexOf(d.id):-1,D=u?k.indexOf(u.id):-1,G=o.useRef(k),U=!(function(w,S){if(w===S)return!0;if(w.length!==S.length)return!1;for(let j=0;j<w.length;j++)if(w[j]!==S[j])return!1;return!0})(k,G.current),T=D!==-1&&E===-1||U,V=(function(w){return typeof w=="boolean"?{draggable:w,droppable:w}:w})(l);Rt(()=>{U&&q&&R(k)},[U,k,q,R]),o.useEffect(()=>{G.current=k},[k]);const y=o.useMemo(()=>({activeIndex:E,containerId:h,disabled:V,disableTransforms:T,items:k,overIndex:D,useDragOverlay:C,sortedRects:aa(k,b),strategy:a}),[E,h,V.draggable,V.droppable,T,k,D,b,C,a]);return o.createElement(al.Provider,{value:y},t)}const ca=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},ua=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:b,transition:u}=e;return!(!u||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===b)},ga={duration:200,easing:"ease"},sl="transform",ha=jt.Transition.toString({property:sl,duration:0,easing:"linear"}),ma={roleDescription:"sortable"};function fa(e){let{animateLayoutChanges:t=ua,attributes:n,disabled:i,data:a,getNewIndex:l=ca,id:d,strategy:m,resizeObserverConfig:b,transition:u=ga}=e;const{items:R,containerId:h,activeIndex:C,disabled:k,disableTransforms:q,sortedRects:E,overIndex:D,useDragOverlay:G,strategy:U}=o.useContext(al),T=(function(J,re){var le,me;return typeof J=="boolean"?{draggable:J,droppable:!1}:{draggable:(le=J?.draggable)!=null?le:re.draggable,droppable:(me=J?.droppable)!=null?me:re.droppable}})(i,k),V=R.indexOf(d),y=o.useMemo(()=>({sortable:{containerId:h,index:V,items:R},...a}),[h,a,V,R]),w=o.useMemo(()=>R.slice(R.indexOf(d)),[R,d]),{rect:S,node:j,isOver:M,setNodeRef:I}=(function(J){let{data:re,disabled:le=!1,id:me,resizeObserverConfig:ye}=J;const ae=yn("Droppable"),{active:be,dispatch:Re,over:Ee,measureDroppableContainers:f}=o.useContext(wn),De=o.useRef({disabled:le}),Ye=o.useRef(!1),He=o.useRef(null),$e=o.useRef(null),{disabled:oe,updateMeasurementsFor:ke,timeout:ze}={...Xi,...ye},we=pn(ke??me),Ae=Bn({callback:o.useCallback(()=>{Ye.current?($e.current!=null&&clearTimeout($e.current),$e.current=setTimeout(()=>{f(Array.isArray(we.current)?we.current:[we.current]),$e.current=null},ze)):Ye.current=!0},[ze]),disabled:oe||!be}),A=o.useCallback((g,x)=>{Ae&&(x&&(Ae.unobserve(x),Ye.current=!1),g&&Ae.observe(g))},[Ae]),[Q,O]=zn(A),X=pn(re);return o.useEffect(()=>{Ae&&Q.current&&(Ae.disconnect(),Ye.current=!1,Ae.observe(Q.current))},[Q,Ae]),o.useEffect(()=>(Re({type:ct.RegisterDroppable,element:{id:me,key:ae,disabled:le,node:Q,rect:He,data:X}}),()=>Re({type:ct.UnregisterDroppable,key:ae,id:me})),[me]),o.useEffect(()=>{le!==De.current.disabled&&(Re({type:ct.SetDroppableDisabled,id:me,key:ae,disabled:le}),De.current.disabled=le)},[me,ae,le,Re]),{active:be,rect:He,isOver:Ee?.id===me,node:Q,over:Ee,setNodeRef:O}})({id:d,data:y,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...b}}),{active:$,activatorEvent:_,activeNodeRect:H,attributes:B,setNodeRef:K,listeners:ne,isDragging:N,over:z,setActivatorNodeRef:se,transform:ve}=Zi({id:d,data:y,attributes:{...ma,...n},disabled:T.draggable}),Ve=(function(){for(var J=arguments.length,re=new Array(J),le=0;le<J;le++)re[le]=arguments[le];return o.useMemo(()=>me=>{re.forEach(ye=>ye(me))},re)})(I,K),Se=!!$,ue=Se&&!q&&En(C)&&En(D),Me=!G&&N,Ke=Me&&ue?ve:null,Ue=ue?Ke??(m??U)({rects:E,activeNodeRect:H,activeIndex:C,overIndex:D,index:V}):null,Te=En(C)&&En(D)?l({id:d,items:R,activeIndex:C,overIndex:D}):V,he=$?.id,W=o.useRef({activeId:he,items:R,newIndex:Te,containerId:h}),Fe=R!==W.current.items,Ce=t({active:$,containerId:h,isDragging:N,isSorting:Se,id:d,index:V,items:R,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:u,wasDragging:W.current.activeId!=null}),Y=(function(J){let{disabled:re,index:le,node:me,rect:ye}=J;const[ae,be]=o.useState(null),Re=o.useRef(le);return Rt(()=>{if(!re&&le!==Re.current&&me.current){const Ee=ye.current;if(Ee){const f=Jt(me.current,{ignoreTransform:!0}),De={x:Ee.left-f.left,y:Ee.top-f.top,scaleX:Ee.width/f.width,scaleY:Ee.height/f.height};(De.x||De.y)&&be(De)}}le!==Re.current&&(Re.current=le)},[re,le,me,ye]),o.useEffect(()=>{ae&&be(null)},[ae]),ae})({disabled:!Ce,index:V,node:j,rect:S});return o.useEffect(()=>{Se&&W.current.newIndex!==Te&&(W.current.newIndex=Te),h!==W.current.containerId&&(W.current.containerId=h),R!==W.current.items&&(W.current.items=R)},[Se,Te,h,R]),o.useEffect(()=>{if(he===W.current.activeId)return;if(he!=null&&W.current.activeId==null)return void(W.current.activeId=he);const J=setTimeout(()=>{W.current.activeId=he},50);return()=>clearTimeout(J)},[he]),{active:$,activeIndex:C,attributes:B,data:y,rect:S,index:V,newIndex:Te,items:R,isOver:M,isSorting:Se,isDragging:N,listeners:ne,node:j,overIndex:D,over:z,setNodeRef:Ve,setActivatorNodeRef:se,setDroppableNodeRef:I,setDraggableNodeRef:K,transform:Y??Ue,transition:(function(){if(Y||Fe&&W.current.newIndex===V)return ha;if(!(Me&&!Un(_)||!u)&&(Se||Ce))return jt.Transition.toString({...u,property:sl})})()}}function Vn(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 pa=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],va=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(pa.includes(e.code)){if(e.preventDefault(),!n||!i)return;const b=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const C=a.get(h.id);if(C)switch(e.code){case Qe.Down:i.top<C.top&&b.push(h);break;case Qe.Up:i.top>C.top&&b.push(h);break;case Qe.Left:i.left>C.left&&b.push(h);break;case Qe.Right:i.left<C.left&&b.push(h)}});const u=(h=>{let{collisionRect:C,droppableRects:k,droppableContainers:q}=h;const E=Qo(C),D=[];for(const G of q){const{id:U}=G,T=k.get(U);if(T){const V=Qo(T),y=E.reduce((S,j,M)=>S+Br(V[M],j),0),w=Number((y/4).toFixed(4));D.push({id:U,data:{droppableContainer:G,value:w}})}}return D.sort(Vr)})({collisionRect:i,droppableRects:a,droppableContainers:b});let R=Pr(u,"id");if(R===d?.id&&u.length>1&&(R=u[1].id),R!=null){const h=l.get(n.id),C=l.get(R),k=C?a.get(C.id):null,q=C?.node.current;if(q&&k&&h&&C){const E=Kn(q).some((V,y)=>m[y]!==V),D=mr(h,C),G=(function(V,y){return!Vn(V)||!Vn(y)||!mr(V,y)?!1:V.data.current.sortable.index<y.data.current.sortable.index})(h,C),U=E||!D?{x:0,y:0}:{x:G?i.width-k.width:0,y:G?i.height-k.height:0},T={x:k.left,y:k.top};return U.x&&U.y?T:vn(T,U)}}}};function mr(e,t){return!(!Vn(e)||!Vn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const Ca=e=>{let{transform:t}=e;return{...t,y:0}},dl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:b,background:u,activeColor:R,borderColor:h,borderWidth:C,dragging:k,...q}=e;return c.jsxs("div",{ref:t,className:yt(a),style:{...i,display:"flex",flexDirection:"column",background:b===l?"white":u,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:b===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...q,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:b===l?"0px":"-1px",marginTop:b===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,b===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:b===l&&R?R?.toCSS():"none",minHeight:"2px"}})]})})),St={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"},Io=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:b,onRemove:u,renderItem:R,sorting:h,style:C,transition:k,transform:q,value:E,wrapperStyle:D,...G},U)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const T=R?R({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:b,ref:U,style:C,transform:q,transition:k,value:E}):c.jsx(c.Fragment,{children:E});return c.jsx("div",{className:yt("tab-item",St.Wrapper,a&&St.fadeIn,h&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[k,D?.transition].filter(Boolean).join(", "),"--translate-x":q?`${Math.round(q.x)}px`:void 0,"--translate-y":q?`${Math.round(q.y)}px`:void 0,"--scale-x":q?.scaleX?`${q.scaleX}`:void 0,"--scale-y":q?.scaleY?`${q.scaleY}`:void 0,"--index":m},ref:U,children:c.jsx("div",{className:yt(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:C,"data-cypress":"draggable-item",...l?void 0:b,...G,tabIndex:l?void 0:-1,children:T})})})),fr={Row:"_Row_1kr10_1"},cl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:yt(fr.Row,t&&fr.horizontal),children:e}))),ba={...ll},ya=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=Si,coordinateGetter:m=va,dropAnimation:b=ba,getItemStyles:u=()=>({}),getNewIndex:R,handle:h=!1,items:C,onMove:k,isDisabled:q=()=>!1,measuring:E,modifiers:D,renderItem:G,renderDivider:U,reorderItems:T=ko,strategy:V=Mo,style:y,useDragOverlay:w=!0,onDragStart:S,wrapperStyle:j=()=>({})}=e,[M,I]=o.useState(()=>C);o.useEffect(()=>{I(C)},[C]);const[$,_]=o.useState(null),H=(function(){for(var z=arguments.length,se=new Array(z),ve=0;ve<z;ve++)se[ve]=arguments[ve];return o.useMemo(()=>[...se].filter(Ve=>Ve!=null),[...se])})(ao(Jr,{activationConstraint:i}),ao(Qr,{activationConstraint:i}),ao(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),B=M.indexOf.bind(M),K=$?B($):-1,ne=[];M.map((z,se)=>{ne.push(c.jsx(wa,{id:z,handle:h,index:se,style:u,wrapperStyle:j,disabled:q(z),renderItem:G,animateLayoutChanges:a,useDragOverlay:w,getNewIndex:R},z+"-"+se));const ve=U?.({key:"divider-"+se});ve&&ne.push(ve)});const{getPortalContainer:N}=r.useFullscreenPortal();return c.jsxs(Gi,{sensors:H,collisionDetection:d,onDragStart:z=>{const{active:se}=z;se&&(S?.(z),_(se.id))},autoScroll:{canScroll:z=>!0},onDragEnd:z=>{if(_(null),z.over){const se=B(z.over.id);K!==se&&(I(ve=>T(ve,K,se)),k?.(K,se))}},onDragCancel:()=>{_(null)},measuring:E,modifiers:D,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...y},className:yt(n,St.Wrapper),children:c.jsx(da,{items:M,strategy:V,children:c.jsx(cl,{ref:t,children:ne})})}),w?Lt.createPortal(c.jsx(ia,{adjustScale:l,dropAnimation:b,children:$?c.jsx(Io,{value:M[K],handle:h,renderItem:G,wrapperStyle:j({index:K,isDragging:!0,id:M[K]}),index:K,dragging:!0,style:u({id:M[K],index:K,isSorting:$!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),N()):null]})}));function wa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:b,useDragOverlay:u,wrapperStyle:R}){const{attributes:h,isDragging:C,isSorting:k,listeners:q,overIndex:E,setNodeRef:D,transform:G,transition:U}=fa({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(Io,{ref:D,value:a,disabled:e,dragging:C,sorting:k,handle:i,renderItem:b,index:l,style:m({index:l,id:a,isDragging:C,isSorting:k,overIndex:E}),onRemove:d?()=>d(a):void 0,transform:G,transition:U,wrapperStyle:R({index:l,isDragging:C,id:a}),listeners:q,"data-index":l,"data-id":a,dragOverlay:!u&&C,...h})}const xa="_TabStrip_3x0dp_1",qa=new s.Color("rgb(33, 115, 70)"),Sa="#eee",Ra=e=>c.jsx(dl,{...e}),ul=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:b,onTabMove:u,createScrollStartButton:R=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:C=r.defaultCreateScrollEdgeButton,createTabButton:k=Ra,createTabDivider:q,editLabelProps:E,disabled:D=!1,disableDrag:G=!1,background:U="white",activeColor:T=qa,borderColor:V=Sa,borderWidth:y=1}=e,[w,S]=o.useState(l),[j,M]=o.useState(d),I=o.useCallback(ae=>{const be=N.current?.[ae]?.closest(".tab-item")??N.current?.[ae];be&&Me.current?.scrollTo({top:be.offsetTop,left:be.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{I(l)},[l]);const $=o.useCallback((ae,be)=>{be!==w&&(S(be),m?.(be)),I(be)},[m,w]),_=o.useCallback((ae,be)=>{u?.(ae,be)},[u]),H=o.useRef(null),[B,K]=o.useState(-1),ne=o.useCallback((ae,be)=>{b?.(ae,be)},[b]);o.useLayoutEffect(()=>{S(l)},[l]),o.useLayoutEffect(()=>{M(d)},[d]);const N=o.useRef([]),z=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ae){N.current?.[ae]?.startEdit()},cancel(ae){N.current?.[ae]?.cancel()}},z.current),[w,B]);const se=o.useCallback(({value:ae,index:be,dragging:Re})=>{const{style:Ee,maxLength:f,...De}=E||{},Ye=c.jsx(Nr,{ref:He=>{N.current[be]=He},value:ae,disabled:D,maxLength:f,style:{color:w===be&&T?T?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Ee},styleHover:{},onSubmit:He=>(H.current=!1,K(-1),ne(be,He)),onCancel:()=>{H.current=!1,K(-1)},onChange:He=>{H.current=!0,K(be)},...De});return k({onClick:He=>$(He,be),value:ae,index:be,editing:B===be&&H.current,editable:!0,disabled:D,selectedIndex:w,background:U,activeColor:T,borderColor:V,borderWidth:y,dragging:Re,children:Ye})},[w,ne,$,E,D,B,k]),[ve,{width:Ve}]=Ot(),[Se,{width:ue}]=Ot(),Me=o.useRef(null),[Ke,Ue]=o.useState({left:0,top:0,width:0,height:0}),[Te,he]=o.useState(null);o.useEffect(()=>{Te!==null&&Me.current&&Me.current.scrollTo({left:Te,behavior:"smooth"})},[Te]);const W=o.useCallback((ae,be=!1)=>{if(!Me.current)return 0;let Re=Me.current.firstChild.getBoundingClientRect(),Ee=Me.current.firstChild.firstChild.children,f=0;return f=be?0:r.ScrollUtils.getScrollTo(ae,Re.left,Ee,!0,Math.max(0,ae-200)),he(f),Math.max(0,f)},[]),Fe=o.useCallback((ae,be=!1)=>{if(!Me.current)return 0;let Re=Me.current.firstChild.getBoundingClientRect(),Ee=Me.current.firstChild.firstChild.children,f=0;const De=Math.ceil(ue-Ve);return f=be?De:r.ScrollUtils.getScrollTo(ae,Re.left,Ee,!1,Math.max(0,ae+200)),he(f),Math.min(De,f)},[ue,Ve]),Ce=o.useRef(null),Y=o.useRef(null),J=o.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null,Ce.current=null)},[]),re=o.useCallback((ae,be,Re=260)=>{Ce.current=ae,Y.current=setTimeout(()=>{const Ee=be?W(Ce.current||ae):Fe(Ce.current||ae);Ee!==Ce.current?re(Ee,be,120):J()},Re)},[W,Fe,J]);o.useEffect(()=>()=>J(),[J]);const le=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Ke.left)<=0||Math.floor(ue-Ve)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:J,onMouseLeave:J,onMouseDown:()=>re(Me.current.scrollLeft,!0),onClick:ae=>W(Math.min(Me.current.scrollLeft,Te??Number.MAX_SAFE_INTEGER),ae.ctrlKey)}),[Ke,Te,ue,Ve]),me=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ue-Ve)<=Math.ceil(Ke.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:J,onMouseLeave:J,onMouseDown:()=>re(Me.current.scrollLeft,!1),onClick:ae=>Fe(Math.max(Me.current.scrollLeft,Te??0),ae.ctrlKey)}),[Ke,Te,ue,Ve]),ye=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,C?.(le)]}),[le,me,R,h,n,C]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:yt(xa,a),ref:z,children:[c.jsx("div",{style:{borderTop:`solid ${V} ${y}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:ye}),c.jsx("div",{className:"Tabs",ref:ve,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:Me,onScroll:ae=>{Ue({left:ae.target.scrollLeft,top:ae.target.scrollTop,width:ae.target.scrollWidth,height:ae.target.scrollHeight})},children:c.jsx(ya,{isDisabled:ae=>D||G,items:j,strategy:sa,modifiers:[Ca],ref:Se,renderItem:se,renderDivider:q,onMove:_,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:C(me)})]})}));ul.displayName="TabStrip";const Dn=o.createContext(null);Dn.displayName="DocThemesContext";const ka="_script-editor_iy654_5",Ma=o.lazy(()=>Promise.resolve().then(()=>require("./FsSILTL8Vc_EbUVs.cjs"))),Ia={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"};let sn,dn,Ft=["define","require"],pr=!1;const gl="https://cdn.jsdelivr.net/npm/@sheetxl/sdk@0.6.18/types/scripting.d.ts";console.log("loading",gl);const Ta=gl,vr=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 b={...m};b.lineNumber=1,b.column=1;let u=!1;for(let E=m.lineNumber;E>=1;E--)if(i.getLineContent(E).trim()===""){const D=To(d,i.getOffsetAt({lineNumber:E,column:1}),"function");if(!D||Fa(D)){u=!0,b.lineNumber=E+1;break}{const G=D.spans[0].start;E=i.getPositionAt(G).lineNumber,b.lineNumber=E}}let R=n,h=!1;!u&&!R.startsWith(`
28
28
  `)&&b.lineNumber>1&&(R=`
29
29
  `+R,h=!0);let C=!1;i.getLineCount()>1&&(R.endsWith(`
30
30
 
31
31
  `)||(R+=`
32
32
 
33
- `,C=!0));const k=[{range:new t.Range(b.lineNumber,b.column,b.lineNumber,b.column),text:`${R}`}];let q=null;i.pushEditOperations([],k,E=>(q=E[0].range,h&&q.startLineNumber++,C&&q.endLineNumber--,[new t.Selection(q.startLineNumber,q.startColumn,q.endLineNumber,q.endColumn)])),e.setSelection({startLineNumber:q.endLineNumber,startColumn:q.endColumn,endLineNumber:q.startLineNumber,endColumn:q.startColumn})};function Ia(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function bo(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:Ia(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)bo(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans,l=a.length;for(let d=0;d<l;d++){const m=a[d];if(m.start<=t&&t<m.start+m.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const b of e.childItems||[]){const u=To(b,t,n,i);if(u)return u}}return null}}function Ta(e){return e.kind==="comment"}const Ea=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:b,autoFocus:u=!0,onStatusChange:R,...h}=e,C=o.useRef(null),k=r.useCallbackRef(d,[d]),q=o.useRef(!1),E=o.useMemo(()=>({contains(he){if(!C.current)return;const W=C.current.editor;return W&&W.getDomNode()?.contains(he)},focus(){if(!C.current)return;const he=C.current.editor;return he&&he.getDomNode()?.focus()}}),[]),D=o.useMemo(()=>[new r.Command("help",E,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),G=o.useMemo(()=>{let he=null;const W=()=>E;return he=a?a.createChildGroup(W,"scriptEditor",!1):new r.CommandGroup(W,"scriptEditor"),he.addCommands(D,!0),he},[a,D]),U=r.useCommands(G,["executeSelectedScript","saveScripts"]),T=U[0],V=U[1],y=T?.context(),[w,S]=o.useState({message:"Loading",cursor:"",dirty:!1}),[j,M]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),I=r.useCallbackRef(he=>{S(W=>{const Fe={...W,...he};return ge.CommonUtils.deepEqual(Fe,W)?W:(V.update({disabled:!Fe.dirty}).updateCallback(async()=>{await $()}),Fe)})},[R,V]);o.useEffect(()=>{R?.(w)},[R,w]);const $=r.useCallbackRef(async()=>{if(!C.current)return;const he=C.current.editor;let W;if(w.dirty){const Fe=he.getValue();await y?.saveSource(Fe),W=y?.getScripts().getModules().getByName("scripts");const Ce=W?.getSource(),Y=he.getValue(),J=(Ce?.length??0)!==Fe.length||Ce!==Y;I({dirty:J})}else W=y?.getScripts().getModules().getByName("scripts");return W},[w]);o.useEffect(()=>{const he=y?.getScripts();if(he)return he.addListeners({onBeforeSearch:()=>$()})},[y]);const _=r.useCallbackRef(he=>{T?.execute(he)},[T]),H=o.useRef(""),[B,K]=o.useState(!1),oe=r.useCallbackRef(async()=>{if(!C.current)return null;const he=C.current,W=he.editor;if(!W)return null;const Fe=he.monaco,Ce=await(async(Y,J,ne="export")=>{const le=Y.getModel();if(!le)return null;const me=await J.languages.typescript.getTypeScriptWorker(),Se=await me(le.uri),de=await Se.getNavigationTree(le.uri.toString());let be=null,Me=Y.getSelection();const Ee=Me.startLineNumber===Me.endLineNumber&&Me.startColumn===Me.endColumn?le.getLineCount():Math.min(Me.endLineNumber,le.getLineCount());for(let f=Me.startLineNumber;!be&&f<=Ee;f++){const De=To(de,le.getOffsetAt({lineNumber:f,column:1}),"function",ne);De&&(be=De.text)}return be})(W,Fe);return I({message:(Ce??"").toUpperCase()}),Ce?{source:W.getValue(),name:Ce}:null},[]);r.useCallbackRef(ge.CommonUtils.debounce($,200),[]);const N=r.useCallbackRef(async(he,W,Fe)=>{M(Y=>({...Y,compiling:!0}));const Ce=await y?.getScripts().createModule({source:Fe?.getValue(),declarationsOnly:!0});Ce&&((async function(Y,J){const ne=[];for(let le=1;le<Y.getLineCount()+1;le++){const me={startLineNumber:le,startColumn:1,endLineNumber:le,endColumn:Y.getLineLength(le)+1},Se=Y.getValueInRange(me).indexOf("modelt");Se!==-1&&ne.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:J.MarkerSeverity.Hint,startLineNumber:me.startLineNumber,startColumn:Se+1,endLineNumber:me.startLineNumber,endColumn:Se+5})}J.editor.setModelMarkers(Y,"owner",ne)})(he,W),(async function(Y,J,ne,le){const me=await J.languages.typescript.getTypeScriptWorker(),Se=await me(Y.uri),de=await Se.getNavigationTree(Y.uri.toString()),be=bo(Y,J,le,de).map(Me=>{let Ee=null,f=null;return Me.type==="formula"?(Ee="formula.margin-icon",f="Formula"):Me.type==="macro"?(Ee="macro.margin-icon",f="Macro"):Me.type==="autoRun"&&(Ee="autorun.margin-icon",f="Auto Run"),{range:new J.Range(Me.lineNumber,1,Me.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Ee,glyphMarginHoverMessage:{value:f},stickiness:J.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ue.current&&ue.current.clear(),ue.current=ne.createDecorationsCollection(be)})(he,W,Fe,Ce?Ce.getFunctions().getItems():ge.CommonUtils.EmptyArray),M(Y=>({...Y,compiling:!1})))},[y]),z=r.useCallbackRef(ge.CommonUtils.debounce(N,580),[]),ae=r.useCallbackRef(async(he=void 0)=>{if(!C.current||!y)return;const W=C.current.editor.getPosition(),Fe={cursor:W?W.toString():""};he!==void 0&&(Fe.message=he),I(Fe);const Ce=oe();y.setSelectedFunction(Ce)},[y]);o.useEffect(()=>{},[j]);const ve=o.useRef(null),Ve=r.useCallbackRef(async()=>{await $(),k?.()},[k]);o.useEffect(()=>{if(!y)return;const he={insertSnippet:Fe=>{C.current?.editor&&vr(C.current.editor,C.current.monaco,Fe)},close:()=>Ve()};y.setEditor(he),y.setSelectedFunction(oe());const W=y.addContainerListener({onBeforeSave:async()=>{$()},onReadonlyChange(){},onScriptChange:async()=>{if(!C.current?.editor||!y)return;const Fe=C.current.editor,Ce=y.getScripts().getModules().getItems()[0]?.getSource()??"";Fe.setValue(Ce)}});return()=>{y.setEditor(null),W()}},[y]),o.useEffect(()=>()=>{const he=ve.current;if(he){he.dispose();const W=he.debounceTimer;W!==void 0&&clearTimeout(W),ve.current=null}},[B]);const qe=r.useCallbackRef(he=>{const W=C.current?.editor;return!!W&&(W.focus(he),!0)},[w]),ue=o.useRef(null),ke=r.useCallbackRef((he,W)=>{C.current={monaco:W,editor:he},K(!0),(()=>{if(pr)return;const Y=(ne,le)=>{try{if(le===void 0)try{delete globalThis[ne]}catch{try{globalThis[ne]=void 0}catch{}}else globalThis[ne]=le}catch{}},J=Ft.length;for(let ne=0;ne<J;ne++){const le=Ft[ne];Y(le,sn[le])}sn=void 0,pr=!0})(),ae("Loading Types");const Fe=y.getScripts().getModules().getItems()[0]?.getSource()??"";he.setValue(Fe),Promise.resolve().then(()=>require("./BplkvNn8Q7iWuskg.cjs")).then(Y=>Y.customEditor).then(async Y=>{ae(""),Y.AutoTypings.create(he,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:W,onUpdate:(J,ne)=>{if(J.type==="LookedUpPackage"&&J.success!==void 0){const le=W.languages.typescript.typescriptDefaults.getDiagnosticsOptions();W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...le,diagnosticCodesToIgnore:[]})}},onError:J=>{J==="Not implemented yet"&&(J="Compile Errors"),console.warn("Error compiling types",J)}}).then(J=>{ve.current=J;const ne=he.getModel();z(ne,W,he)})}),he.addCommand("executeScript",function(Y,...J){J?.[0]&&_({functionName:J?.[0]})},""),he.addAction({id:"executeScript",label:"Execute",keybindings:[W.KeyCode.F8],run:async Y=>{const J=oe();y.setSelectedFunction(J);const ne=await J;_(ne)}}),he.addAction({id:"saveScript",label:"Save Script",keybindings:[W.KeyMod.CtrlCmd|W.KeyCode.KeyS],run:Y=>{$()}}),he.onMouseDown(async Y=>{if(Y.target.type===W.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const J=Y.target.position.lineNumber,ne=await W.languages.typescript.getTypeScriptWorker(),le=await ne(Ce.uri),me=await le.getNavigationTree(Ce.uri.toString()),Se=(await $()).getFunctions().getItems(),de=bo(Ce,W,Se,me).find(be=>be.lineNumber===J);if(de){const be=Y.event.browserEvent.button;be===0?de.type==="macro"||de.type==="autoRun"?_({functionName:de.name}):de.type==="formula"&&y.quickInsertFunction?.(de.name):be===2&&(console.log("Context menu for function:",de.name),Y.event.browserEvent.preventDefault())}}}),he.onDidChangeModelContent(()=>{I({dirty:!0}),z(Ce,W,he)}),W.editor.onDidChangeMarkers(Y=>{Y.some(J=>J.toString()===Ce.uri.toString())});const Ce=he.getModel();(function(Y,J){J.languages.registerInlayHintsProvider("typescript",{provideInlayHints(ne,le,me){const Se=[];for(let de=1;de<ne.getLineCount()+1;de++){const be={startLineNumber:de,startColumn:1,endLineNumber:de,endColumn:ne.getLineLength(de)+1},Me="hint",Ee=ne.getValueInRange(be).indexOf("hint");Ee!==-1&&Se.push({kind:J.languages.InlayHintKind.Type,position:{lineNumber:be.startLineNumber,column:Ee+Me.length+1},label:"[hint]"})}return{hints:Se,dispose:()=>{}}}})})(0,W),Ce.onDidChangeContent(Y=>{const J=y?.getScripts().getModules().getByName("scripts"),ne=J?.getSource(),le=he.getValue(),me=(ne?.length??0)!==le.length||ne!==le;I({dirty:me})}),he.onDidChangeCursorPosition(Y=>{ae()})},[y]),Ke=o.useMemo(()=>B?null:b||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[B,b]),Ue=o.useMemo(()=>{if(!B){if(!sn){sn={};const W=Ft.length;for(let Fe=0;Fe<W;Fe++){const Ce=Ft[Fe];sn[Ce]=globalThis[Ce]}}if(dn){const W=Ft.length;for(let Fe=0;Fe<W;Fe++){const Ce=Ft[Fe];globalThis[Ce]=dn[Ce]}}}const he=y?.getScripts().getModules().getByName("scripts")?.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(ka,{theme:m?"extended-dark":"extended",options:{...Ma,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:he,onValidate:W=>{let Fe=!1;const Ce=W?W.length:0;for(let Y=0;!Fe&&Y<Ce;Y++)W[Y].severity===8&&(Fe=!0)},beforeMount:W=>{W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),W.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),W.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),W.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let Fe=!1,Ce=!1;try{const Y=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),J=W.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let ne=W.editor.getModel(J);ne?Ce=!0:ne=W.editor.createModel(Y,"typescript",J),W.editor.setModelMarkers(ne,"default",[]),Fe=!0}catch(Y){console.warn("cant load types",Y)}if(W.languages.registerLinkProvider("*",{provideLinks:(Y,J)=>{const ne=[],le={links:ne},me=Y.getLinesContent(),Se=me.length;for(let de=1;de<=Se;de++){const be=me[de-1],Me=W.editor.tokenize(be,"typescript"),Ee=Me[0].length;for(let f=0;f<Ee;f++){const De=Me[0]?.[f];if(De&&De.type.startsWith("string")){let Ye=De.offset,He=Me[0]?.[f+1]?.offset??be.length,$e=new W.Range(de,Ye+1,de,He+1),re=Y.getValueInRange($e);const Re=re[0];Re!=="`"&&Re!=="'"&&Re!=='"'||(Ye++,re=re.substring(1));const ze=re[re.length-1];ze!=="`"&&ze!=="'"&&ze!=='"'||(Ye++,re=re.substring(0,re.length-1));try{y.getRanges(re)&&ne.push({range:{endColumn:He,endLineNumber:de,startColumn:Ye,startLineNumber:de},tooltip:`Goto range '${re}'`,url:`/range/${re}`})}catch(ye){console.warn(ye)}}}}return le}}),W.editor.registerLinkOpener({open(Y){if(Y?.path?.startsWith("/range/")){try{y.getRanges(Y.path.substring(7))?.select()}catch(J){console.warn("invalid range",J)}return!0}return!1}}),!Ce){const Y=W.languages.typescript.typescriptDefaults.getCompilerOptions();W.languages.typescript.typescriptDefaults.setCompilerOptions({...Y,target:W.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:W.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(H.current&&(await vr(C.current.editor,C.current.monaco,H.current),H.current=null),q.current&&requestAnimationFrame(async()=>{q.current&&W.editor.focus()}),!dn){dn={};const Y=Ft.length;for(let J=0;J<Y;J++){const ne=Ft[J];dn[ne]=globalThis[ne]}}})()},onMount:ke})}),Ke]})},[y,G,l,Ke,m]),Te=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:he=>{qe(he)},close:()=>Ve(),getEditor:()=>y?.getEditor()}),[y]);return o.useEffect(()=>(u&&requestAnimationFrame(()=>{Te.current?.focus()}),()=>{C.current?.editor&&requestAnimationFrame(()=>{Te.current?.contains(document.activeElement)&&Te.current?.focus()})}),[]),c.jsx("div",{className:yt("script-editor",Ra,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:Te,...h,children:Ue})}));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=ui,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=ci,exports.CornerTriangle=ho,exports.DateUtils=yl,exports.DocThemesContext=Dn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(Dn.Provider,{value:t,children:n})},exports.EditableLabel=Nr,exports.EmptyFrame=ti,exports.FilterButton=br,exports.FontUtils=wl,exports.Item=Io,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=kr,exports.MovableArea=Tr,exports.PictureEditor=zr,exports.Row=cl,exports.ScriptEditor=Ea,exports.SheetCellEditor=wr,exports.SheetCellRenderer=yr,exports.SheetElement=Dr,exports.SheetScrollbar=wo,exports.StaticBorderRenderer=Fl,exports.StyledStrokePath=qr,exports.Tab=dl,exports.TabStrip=ul,exports.createCellEditStateFromCell=xr,exports.useBordersOverlay=yo,exports.useDocThemes=()=>{const e=o.useContext(Dn),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=et,exports.useMovableCommands=Er,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 b={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(b)}const d=b=>{a.current?.(b)},m=e.getRange(t).addListener(d,i);if(l){const b=e.getRange(t);d({getSource:()=>b,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=Mr,exports.useSheetCopyPaste=Ir,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
33
+ `,C=!0));const k=[{range:new t.Range(b.lineNumber,b.column,b.lineNumber,b.column),text:`${R}`}];let q=null;i.pushEditOperations([],k,E=>(q=E[0].range,h&&q.startLineNumber++,C&&q.endLineNumber--,[new t.Selection(q.startLineNumber,q.startColumn,q.endLineNumber,q.endColumn)])),e.setSelection({startLineNumber:q.endLineNumber,startColumn:q.endColumn,endLineNumber:q.startLineNumber,endColumn:q.startColumn})};function Ea(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function bo(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:Ea(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)bo(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans,l=a.length;for(let d=0;d<l;d++){const m=a[d];if(m.start<=t&&t<m.start+m.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const b of e.childItems||[]){const u=To(b,t,n,i);if(u)return u}}return null}}function Fa(e){return e.kind==="comment"}const Aa=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:b,autoFocus:u=!0,onStatusChange:R,...h}=e,C=o.useRef(null),k=r.useCallbackRef(d,[d]),q=o.useRef(!1),E=o.useMemo(()=>({contains(he){if(!C.current)return;const W=C.current.editor;return W&&W.getDomNode()?.contains(he)},focus(){if(!C.current)return;const he=C.current.editor;return he&&he.getDomNode()?.focus()}}),[]),D=o.useMemo(()=>[new r.Command("help",E,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),G=o.useMemo(()=>{let he=null;const W=()=>E;return he=a?a.createChildGroup(W,"scriptEditor",!1):new r.CommandGroup(W,"scriptEditor"),he.addCommands(D,!0),he},[a,D]),U=r.useCommands(G,["executeSelectedScript","saveScripts"]),T=U[0],V=U[1],y=T?.context(),[w,S]=o.useState({message:"Loading",cursor:"",dirty:!1}),[j,M]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),I=r.useCallbackRef(he=>{S(W=>{const Fe={...W,...he};return ge.CommonUtils.deepEqual(Fe,W)?W:(V.update({disabled:!Fe.dirty}).updateCallback(async()=>{await $()}),Fe)})},[R,V]);o.useEffect(()=>{R?.(w)},[R,w]);const $=r.useCallbackRef(async()=>{if(!C.current)return;const he=C.current.editor;let W;if(w.dirty){const Fe=he.getValue();await y?.saveSource(Fe),W=y?.getScripts().getModules().getByName("scripts");const Ce=W?.getSource(),Y=he.getValue(),J=(Ce?.length??0)!==Fe.length||Ce!==Y;I({dirty:J})}else W=y?.getScripts().getModules().getByName("scripts");return W},[w]);o.useEffect(()=>{const he=y?.getScripts();if(he)return he.addListeners({onBeforeSearch:()=>$()})},[y]);const _=r.useCallbackRef(he=>{T?.execute(he)},[T]),H=o.useRef(""),[B,K]=o.useState(!1),ne=r.useCallbackRef(async()=>{if(!C.current)return null;const he=C.current,W=he.editor;if(!W)return null;const Fe=he.monaco,Ce=await(async(Y,J,re="export")=>{const le=Y.getModel();if(!le)return null;const me=await J.languages.typescript.getTypeScriptWorker(),ye=await me(le.uri),ae=await ye.getNavigationTree(le.uri.toString());let be=null,Re=Y.getSelection();const Ee=Re.startLineNumber===Re.endLineNumber&&Re.startColumn===Re.endColumn?le.getLineCount():Math.min(Re.endLineNumber,le.getLineCount());for(let f=Re.startLineNumber;!be&&f<=Ee;f++){const De=To(ae,le.getOffsetAt({lineNumber:f,column:1}),"function",re);De&&(be=De.text)}return be})(W,Fe);return I({message:(Ce??"").toUpperCase()}),Ce?{source:W.getValue(),name:Ce}:null},[]);r.useCallbackRef(ge.CommonUtils.debounce($,200),[]);const N=r.useCallbackRef(async(he,W,Fe)=>{M(Y=>({...Y,compiling:!0}));const Ce=await y?.getScripts().createModule({source:Fe?.getValue(),declarationsOnly:!0});Ce&&((async function(Y,J){const re=[];for(let le=1;le<Y.getLineCount()+1;le++){const me={startLineNumber:le,startColumn:1,endLineNumber:le,endColumn:Y.getLineLength(le)+1},ye=Y.getValueInRange(me).indexOf("modelt");ye!==-1&&re.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:J.MarkerSeverity.Hint,startLineNumber:me.startLineNumber,startColumn:ye+1,endLineNumber:me.startLineNumber,endColumn:ye+5})}J.editor.setModelMarkers(Y,"owner",re)})(he,W),(async function(Y,J,re,le){const me=await J.languages.typescript.getTypeScriptWorker(),ye=await me(Y.uri),ae=await ye.getNavigationTree(Y.uri.toString()),be=bo(Y,J,le,ae).map(Re=>{let Ee=null,f=null;return Re.type==="formula"?(Ee="formula.margin-icon",f="Formula"):Re.type==="macro"?(Ee="macro.margin-icon",f="Macro"):Re.type==="autoRun"&&(Ee="autorun.margin-icon",f="Auto Run"),{range:new J.Range(Re.lineNumber,1,Re.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Ee,glyphMarginHoverMessage:{value:f},stickiness:J.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ue.current&&ue.current.clear(),ue.current=re.createDecorationsCollection(be)})(he,W,Fe,Ce?Ce.getFunctions().getItems():ge.CommonUtils.EmptyArray),M(Y=>({...Y,compiling:!1})))},[y]),z=r.useCallbackRef(ge.CommonUtils.debounce(N,580),[]),se=r.useCallbackRef(async(he=void 0)=>{if(!C.current||!y)return;const W=C.current.editor.getPosition(),Fe={cursor:W?W.toString():""};he!==void 0&&(Fe.message=he),I(Fe);const Ce=ne();y.setSelectedFunction(Ce)},[y]);o.useEffect(()=>{},[j]);const ve=o.useRef(null),Ve=r.useCallbackRef(async()=>{await $(),k?.()},[k]);o.useEffect(()=>{if(!y)return;const he={insertSnippet:Fe=>{C.current?.editor&&vr(C.current.editor,C.current.monaco,Fe)},close:()=>Ve()};y.setEditor(he),y.setSelectedFunction(ne());const W=y.addContainerListener({onBeforeSave:async()=>{$()},onReadonlyChange(){},onScriptChange:async()=>{if(!C.current?.editor||!y)return;const Fe=C.current.editor,Ce=y.getScripts().getModules().getItems()[0]?.getSource()??"";Fe.setValue(Ce)}});return()=>{y.setEditor(null),W()}},[y]),o.useEffect(()=>()=>{const he=ve.current;if(he){he.dispose();const W=he.debounceTimer;W!==void 0&&clearTimeout(W),ve.current=null}},[B]);const Se=r.useCallbackRef(he=>{const W=C.current?.editor;return!!W&&(W.focus(he),!0)},[w]),ue=o.useRef(null),Me=r.useCallbackRef((he,W)=>{C.current={monaco:W,editor:he},K(!0),se("Loading Types");const Fe=y.getScripts().getModules().getItems()[0]?.getSource()??"";he.setValue(Fe),Promise.resolve().then(()=>require("./C4SL8-6D_tlkDBCf.cjs")).then(Y=>Y.customEditor).then(async Y=>{se(""),Y.AutoTypings.create(he,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:W,onUpdate:(J,re)=>{if(J.type==="LookedUpPackage"&&J.success!==void 0){const le=W.languages.typescript.typescriptDefaults.getDiagnosticsOptions();W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...le,diagnosticCodesToIgnore:[]})}},onError:J=>{J==="Not implemented yet"&&(J="Compile Errors"),console.warn("Error compiling types",J)}}).then(J=>{ve.current=J;const re=he.getModel();z(re,W,he),(()=>{if(pr)return;const le=(ye,ae)=>{try{if(ae===void 0)try{delete globalThis[ye]}catch{try{globalThis[ye]=void 0}catch{}}else globalThis[ye]=ae}catch{}},me=Ft.length;for(let ye=0;ye<me;ye++){const ae=Ft[ye];le(ae,sn[ae])}sn=void 0,pr=!0})()})}),he.addCommand("executeScript",function(Y,...J){J?.[0]&&_({functionName:J?.[0]})},""),he.addAction({id:"executeScript",label:"Execute",keybindings:[W.KeyCode.F8],run:async Y=>{const J=ne();y.setSelectedFunction(J);const re=await J;_(re)}}),he.addAction({id:"saveScript",label:"Save Script",keybindings:[W.KeyMod.CtrlCmd|W.KeyCode.KeyS],run:Y=>{$()}}),he.onMouseDown(async Y=>{if(Y.target.type===W.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const J=Y.target.position.lineNumber,re=await W.languages.typescript.getTypeScriptWorker(),le=await re(Ce.uri),me=await le.getNavigationTree(Ce.uri.toString()),ye=(await $()).getFunctions().getItems(),ae=bo(Ce,W,ye,me).find(be=>be.lineNumber===J);if(ae){const be=Y.event.browserEvent.button;be===0?ae.type==="macro"||ae.type==="autoRun"?_({functionName:ae.name}):ae.type==="formula"&&y.quickInsertFunction?.(ae.name):be===2&&(console.log("Context menu for function:",ae.name),Y.event.browserEvent.preventDefault())}}}),he.onDidChangeModelContent(()=>{I({dirty:!0}),z(Ce,W,he)}),W.editor.onDidChangeMarkers(Y=>{Y.some(J=>J.toString()===Ce.uri.toString())});const Ce=he.getModel();(function(Y,J){J.languages.registerInlayHintsProvider("typescript",{provideInlayHints(re,le,me){const ye=[];for(let ae=1;ae<re.getLineCount()+1;ae++){const be={startLineNumber:ae,startColumn:1,endLineNumber:ae,endColumn:re.getLineLength(ae)+1},Re="hint",Ee=re.getValueInRange(be).indexOf("hint");Ee!==-1&&ye.push({kind:J.languages.InlayHintKind.Type,position:{lineNumber:be.startLineNumber,column:Ee+Re.length+1},label:"[hint]"})}return{hints:ye,dispose:()=>{}}}})})(0,W),Ce.onDidChangeContent(Y=>{const J=y?.getScripts().getModules().getByName("scripts"),re=J?.getSource(),le=he.getValue(),me=(re?.length??0)!==le.length||re!==le;I({dirty:me})}),he.onDidChangeCursorPosition(Y=>{se()})},[y]),Ke=o.useMemo(()=>B?null:b||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[B,b]),Ue=o.useMemo(()=>{if(!B){if(!sn){sn={};const W=Ft.length;for(let Fe=0;Fe<W;Fe++){const Ce=Ft[Fe];sn[Ce]=globalThis[Ce]}}if(dn){const W=Ft.length;for(let Fe=0;Fe<W;Fe++){const Ce=Ft[Fe];globalThis[Ce]=dn[Ce]}}}const he=y?.getScripts().getModules().getByName("scripts")?.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(Ma,{theme:m?"extended-dark":"extended",options:{...Ia,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:he,onValidate:W=>{let Fe=!1;const Ce=W?W.length:0;for(let Y=0;!Fe&&Y<Ce;Y++)W[Y].severity===8&&(Fe=!0)},beforeMount:W=>{W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),W.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),W.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),W.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let Fe=!1,Ce=!1;try{const Y=await(async()=>await(await fetch(Ta)).text())(),J=W.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let re=W.editor.getModel(J);re?Ce=!0:re=W.editor.createModel(Y,"typescript",J),W.editor.setModelMarkers(re,"default",[]),Fe=!0}catch(Y){console.warn("cant load types",Y)}if(W.languages.registerLinkProvider("*",{provideLinks:(Y,J)=>{const re=[],le={links:re},me=Y.getLinesContent(),ye=me.length;for(let ae=1;ae<=ye;ae++){const be=me[ae-1],Re=W.editor.tokenize(be,"typescript"),Ee=Re[0].length;for(let f=0;f<Ee;f++){const De=Re[0]?.[f];if(De&&De.type.startsWith("string")){let Ye=De.offset,He=Re[0]?.[f+1]?.offset??be.length,$e=new W.Range(ae,Ye+1,ae,He+1),oe=Y.getValueInRange($e);const ke=oe[0];ke!=="`"&&ke!=="'"&&ke!=='"'||(Ye++,oe=oe.substring(1));const ze=oe[oe.length-1];ze!=="`"&&ze!=="'"&&ze!=='"'||(Ye++,oe=oe.substring(0,oe.length-1));try{y.getRanges(oe)&&re.push({range:{endColumn:He,endLineNumber:ae,startColumn:Ye,startLineNumber:ae},tooltip:`Goto range '${oe}'`,url:`/range/${oe}`})}catch(we){console.warn(we)}}}}return le}}),W.editor.registerLinkOpener({open(Y){if(Y?.path?.startsWith("/range/")){try{y.getRanges(Y.path.substring(7))?.select()}catch(J){console.warn("invalid range",J)}return!0}return!1}}),!Ce){const Y=W.languages.typescript.typescriptDefaults.getCompilerOptions();W.languages.typescript.typescriptDefaults.setCompilerOptions({...Y,target:W.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:W.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(H.current&&(await vr(C.current.editor,C.current.monaco,H.current),H.current=null),q.current&&requestAnimationFrame(async()=>{q.current&&W.editor.focus()}),!dn){dn={};const Y=Ft.length;for(let J=0;J<Y;J++){const re=Ft[J];dn[re]=globalThis[re]}}})()},onMount:Me})}),Ke]})},[y,G,l,Ke,m]),Te=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:he=>{Se(he)},close:()=>Ve(),getEditor:()=>y?.getEditor()}),[y]);return o.useEffect(()=>(u&&requestAnimationFrame(()=>{Te.current?.focus()}),()=>{C.current?.editor&&requestAnimationFrame(()=>{Te.current?.contains(document.activeElement)&&Te.current?.focus()})}),[]),c.jsx("div",{className:yt("script-editor",ka,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:Te,...h,children:Ue})}));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=gi,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=ui,exports.CornerTriangle=ho,exports.DateUtils=wl,exports.DocThemesContext=Dn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(Dn.Provider,{value:t,children:n})},exports.EditableLabel=Nr,exports.EmptyFrame=ni,exports.FilterButton=br,exports.FontUtils=xl,exports.Item=Io,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=kr,exports.MovableArea=Tr,exports.PictureEditor=zr,exports.Row=cl,exports.ScriptEditor=Aa,exports.SheetCellEditor=wr,exports.SheetCellRenderer=yr,exports.SheetElement=Dr,exports.SheetScrollbar=wo,exports.StaticBorderRenderer=Al,exports.StyledStrokePath=qr,exports.Tab=dl,exports.TabStrip=ul,exports.createCellEditStateFromCell=xr,exports.useBordersOverlay=yo,exports.useDocThemes=()=>{const e=o.useContext(Dn),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=et,exports.useMovableCommands=Er,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 b={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(b)}const d=b=>{a.current?.(b)},m=e.getRange(t).addListener(d,i);if(l){const b=e.getRange(t);d({getSource:()=>b,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=Mr,exports.useSheetCopyPaste=Ir,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});