@sheetxl/react 0.4.11 → 0.4.13

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.
@@ -5,9 +5,9 @@
5
5
 
6
6
  })();
7
7
  /**
8
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.11
8
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.13
9
9
  *
10
10
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
11
  * License: The license can be found at https://www.sheetxl.com/license.
12
12
  */
13
- import{FormulaError as e,NumberFormat as t,ICell as n,IBorder as o,ITextFrame as r,GeomUtils as l,ScalarType as i,IFont as a,IRange as s,LicenseManager as d,IColor as c,AutoFill as u,ISheetView as g,Color as h,IFill as m,RangeClipboardItem as p,ExternalRangeClipboardItem as f,TextUtils as v,IAnchored as w,CoordUtils as y,ThemeCollection as b}from"@sheetxl/sdk";export{LicenseManager}from"@sheetxl/sdk";import{ReactUtils as q,useImperativeElement as C,useCallbackRef as x,KeyCodes as S,SimpleCommand as k,Command as R,KeyModifiers as M,CommandGroup as T,useCopyPaste as D,useEditMode as A,useGlobalClipboard as E,NotificationType as z,useCommands as F,ScrollbarOrientation as I,VirtualScrollbar as N,MouseButtonCodes as O,ToolTipPlacement as L,DefaultNotifier as V,HorizontalAlignment as B,ScrollPane as H,useFullscreenPortal as P,defaultCreateScrollStartButton as W,defaultCreateScrollEndButton as $,defaultCreateScrollEdgeButton as U,ScrollUtils as j}from"@sheetxl/utils-react";export*from"@sheetxl/utils-react";import{jsx as _,jsxs as G,Fragment as Z}from"react/jsx-runtime";import{CommonUtils as X,AnchorLocation as Y,TypesUtils as K,CoordUtils as J}from"@sheetxl/utils";import Q,{memo as ee,useMemo as te,useState as ne,forwardRef as oe,useRef as re,useEffect as le,useLayoutEffect as ie,useCallback as ae,version as se,useReducer as de,Suspense as ce,createElement as ue,createContext as ge,useContext as he,cloneElement as me,useImperativeHandle as pe}from"react";import{STANDARD_KEY_CHARS as fe,useSelection as ve,useHeaderSelection as we,HeaderRenderer as ye,Grid as be,HeaderDivider as qe,SELECTION_CLIP_INSETS as Ce,defaultSelectionRenderer as xe,useKeyboardEditorOverlay as Se,Selection as ke,SVGLine as Re}from"@sheetxl/grid-react";import{unstable_batchedUpdates as Me,createPortal as Te}from"react-dom";const De=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),Ae=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:De},Symbol.toStringTag,{value:"Module"})),Ee=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),ze=(e,t=!0,n=Ee)=>{if(!n||0===n.length)return e;if(void 0===e)return n[0];if(t&&e>=n[n.length-1])return e;if(!t&&e<=n[0])return e;let o=X.findEqualOrGreater(n,e);return t?(n[o]===e&&(o+=1),n[o]||(o-=1),n[o]):(o-=1,n[o])},Fe=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Ee,findNextFontSize:ze},Symbol.toStringTag,{value:"Module"})),Ie=ee(e=>{const{anchorLocation:t=Y.TopLeft,cellWidth:n,cellHeight:o,size:r=7,inset:l=1,darkMode:i,fill:a,pathProps:s,style:d,...c}=e,u=r,g=l;let h="red",m=[],p=[];return t===Y.TopLeft?(h=i?"rgb(255, 198, 246)":"green",m.push(g),p.push(g),m.push(g+u),p.push(g),m.push(g),p.push(g+u)):t===Y.TopRight?(h=i?"rgb(0, 255, 255)":"red",m.push(n-g),p.push(g),m.push(n-(g+u)),p.push(g),m.push(n-g),p.push(g+u)):t===Y.BottomRight?(h=i?"rgb(236, 252, 211)":"purple",m.push(n-g),p.push(o-g),m.push(n-(g+u)),p.push(o-g),m.push(n-g),p.push(o-(g+u))):t===Y.BottomLeft&&(h=i?"rgb(255, 236, 183)":"blue",m.push(g),p.push(o-g),m.push(g+u),p.push(o-g),m.push(g),p.push(o-(g+u))),_("svg",{width:`${n}`,height:`${o}`,viewBox:`0 0 ${n} ${o}`,style:{position:"absolute",width:`${n}px`,height:`${o}px`,pointerEvents:"none",...d},...c,children:_("path",{d:`M ${m[0]} ${p[0]} L ${m[1]} ${p[1]} L ${m[2]} ${p[2]} L ${m[0]} ${p[0]} Z`,fill:a??h,...s})})}),Ne=e=>{const{renderBounds:t,darkMode:n,zoom:o,disabled:r,filter:l,onFilterButtonMouseDown:i,style:a,...s}=e,d=te(()=>{let e=null;const t=l.getSortField();t&&(e=t.reverse);const n=l.getField(),o=n&&n.criteria&&n.criteria.length>0;return!0===e?o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":!1===e?o?"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":o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"m 3,5.025 4.5,5 4.5,-5 z"},[l]),[c,u]=ne(!1);const g=Math.min(Math.min(18,t.height-8),t.width);return _("div",{style:{width:`${g}px`,height:`${g}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${c&&!r?"--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:(g>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:r?void 0:"pointer",...a},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseDown:e=>{i?.(e,l)},...s,children:_("svg",{width:""+15*o,height:""+15*o,viewBox:"0 0 15 15",style:{fill:`var(${c&&!r?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:r?.6:1},children:_("path",{d:d})})})},Oe=s=>{const{value:d,coords:c,bounds:u,children:g,style:h,range:m,zoom:p=1,view:f,bodyStyle:v,normalStyle:w,showFormulas:y,showZeros:b,docTheme:C,onLinkMouseDown:x,onFilterButtonMouseDown:S,filterButtonProps:k,createFilterButton:R=Ne,...M}=s,T=u.height/p,D=u.width/p,A=d,E=A.getValue(),z=d.getStyle(),F=v?.darkMode??!1;let I,N;const O=E&&E.isFormulaError,L=O&&E instanceof e.Parse;let V,B=y||L;if(B)if(A.isSpillOverflow())N="";else{const e=A.getFormulaText();e?N=e:I=A.getNumberFormat(t.Type.General)}else I=A.getNumberFormat();B||(V=A.getTextOverflow());const H=V?V.colBounds.width+V.leftOffset+V.rightOffset:D,P=V?V.anchorBounds.x-V.leftOffset:0,W=V?V.anchorBounds.width:D,$=V?V.anchorBounds.x:0;let U,j=A.getRenderHorizontalAlignment();I&&(U=I?.formattedRuns,N=U?.runs[0]?.text??I.displayText);const Z=A.getCalcStatus()===n.CalcStatus.Pending;let K=null,J=z.getFill().toCSS(F,u),Q=0,ee=0;if(!z.getBorder().isEmpty()){const e=z.getBorder().getRight();!e.isNone()&&o.BuiltInDefinitions.get(e.getStyle()).width>1&&(Q=1);const t=z.getBorder().getBottom();!t.isNone()&&o.BuiltInDefinitions.get(t.getStyle()).width>1&&(ee=1)}let te=null;if(D!==W||Q||ee||"number"==typeof J?.backgroundPosition){const{backgroundPosition:e,...t}=J,n=e??0,o=f?.getScrollTopLeft(),r=n?-(u.x+(o.left??0))%n:0,l=n?-(u.y+(o.top??0))%n:0;(void 0!==e||Q||ee||D!==W)&&(1===Object.keys(t).length&&"none"===t.background||(J=null,te=_("div",{className:"fill",style:{marginLeft:`${r}px`,marginTop:`${l}px`,left:$*p,width:q.boundPixel(W*p-r+1+Q),height:q.boundPixel(u.height-l+1+ee),...t}},"background")))}let ne=null;const oe=A.getComments(),re=A.getWarnings(),le=A.getErrors();if(oe||O||le.length>0||re.length>0){const e={size:7*p,darkMode:F,cellWidth:W*p+2,cellHeight:T*p+2,style:{top:-1,left:$*p-1}};ne=ne??[],(re.length>0||le.length>0||O)&&ne.push(_(Ie,{anchorLocation:Y.TopLeft,...e},`indicator-${ne.length}`)),oe&&ne.push(_(Ie,{anchorLocation:Y.TopRight,...e},`indicator-${ne.length}`))}const ie=z.getFont();let ae=I?.conditionalColor;const se=z.getAlignment(),de=se.getHorizontal()===r.HorizontalAlignment.Fill,ce=se.getHorizontal()===r.HorizontalAlignment.CenterContinuous||de,ue=ce||B?0:se.getRotation(),ge=A.getInsets(),he=ge.top+ge.bottom;let me=ge.left,pe=ge.right;const fe={...h,left:h.left-1,top:h.top-1,width:h.width+1+Q,height:h.height+1+ee},ve=A.getColumnFilter(),we=ve&&!ve?.hasHiddenButton();let ye=null;Z&&(ye=G("div",{className:"slider",children:[_("div",{className:"line"}),_("div",{className:"subline inc"})]},"pending"));const be=!(Z||we||te||g||ne||U?.runs.length>1||V||ue%360!=0);"none"===J?.background&&(J=null);let qe=ce||!(!V||!(V.rightIndex>0||V.leftIndex>0||V.colSpan>1));if(!qe){const e=A.getSpans();(e.width>1||e.height>1)&&(qe=!0)}const Ce={...J,...fe,pointerEvents:x?"auto":void 0};if(!X.isEmpty(N)||!X.isEmpty(I?.repeatPlaceholder)){const e=I?.canWrap??!1;let n=null,o=null,s=null,d=[],c=!0;b||B||0!==E||(c=!1);const u=A.getTextFrame(B);if(c&&u){let c=H-1-(me+pe);if(ue){const e=u.layout();n=e.bounds;const t={x:0,y:0,width:H-1,height:T};if(U){let e=U.width;if(I.repeatPlaceholder||I.repeatChars.length>0){const n=l.boundsToPoints(t),o=l.rotatePoints(n,-ue);e=l.minBoundingRect(o).width}n={...n,width:e}}s=l.clipToOuterRect({...n,width:n.width+1+me+pe},t,ue),c=s.width-1-(me+pe)+.01}let g=null;e&&(g={width:c});let m=null,f=I?.repeatPlaceholder;const v=u.layout(g);if(n=v.bounds,B?n={...n,width:0}:U&&(n={...n,width:I.repeatPlaceholder||I.repeatChars.length>0?c:U.width}),ue&&e){let e=null;v.visitLines({visitTextLine:(t,n)=>{let o=t.bounds;const r=l.boundsToPoints(o),i=l.rotatePoints(r,ue),a=l.minBoundingRect(i);o={...o,x:(a.width-o.width)/2,y:(a.height-o.height)/2},e=e?l.unionBounds(e,o):o}}),n={...e,width:e.width+me+pe}}if(!f&&A.getType()!==i.String&&Math.floor(n.width)>c){if("General"===z.getNumberFormat()&&A.getType()===i.Number){const e=z.measureText("0"),t=Math.floor(c/e.width),n=E,o=X.splitNumber(n),r=Math.min(10,t-(Math.max(1,o.ipLength)+1)-(n<0?1:0));if(r>=-1){const e=`0${r>0?".":""}${"#".repeat(Math.max(0,r))}`;m=A.getNumberFormat(e).displayText,"0"===m&&n<0&&(m="-0")}else if(Math.abs(n)>=Math.pow(10,5)||Math.abs(n)<=Math.pow(10,-5)){const e=t-5-(n<0?1:0);if(e>=0){const t=`0.${"0".repeat(Math.max(0,e-1))}E+00`;m=A.getNumberFormat(t).displayText}}}m||(f="#")}if(!f&&U?.lastRepeatIndex>=0&&U?.width>c&&(f="#"),f&&c>0){const e=z.measureText(f),t=Math.floor((c||1)/(e?.width||1));m=t>0?f.repeat(t):""}if(B&&(j=r.HorizontalAlignment.Left),m){const e=z.measureText(m).width;e&&(n={...n,width:e})}if(o={...n,width:n.width+me+pe,height:n.height},ue&&!e){const e=l.boundsToPoints(o),t=l.rotatePoints(e,ue),n=l.minBoundingRect(t);o.width=n.width,o.height=n.height}j===r.HorizontalAlignment.Center||j===r.HorizontalAlignment.CenterContinuous?o.x=(H-o.width)/2:j===r.HorizontalAlignment.Right?o.x=H-o.width-.5:o.x=.5,se.getVertical()===r.VerticalAlignment.Center?o.y=(T-o.height)/2:se.getVertical()===r.VerticalAlignment.Bottom?o.y=T-o.height-he:o.y=he;const w=be?{...M}:void 0,y={style:{left:h.left-1,top:h.top-1,width:h.width+1,height:h.height+1,transform:ue?`rotate(${ue}deg)`:void 0,cursor:x?"pointer":void 0,pointerEvents:x?"auto":void 0,zIndex:qe?1:void 0,...J},onMouseDown:x,onDoubleClick:x?e=>{e.stopPropagation(),e.preventDefault()}:null,...w};L&&(y.style.textDecorationStyle="wavy",y.style.textDecorationColor=F?"rgb(0, 255, 255)":"red",y.style.textDecorationLine="underline");const b=ie.getSize(),q=(i,s,u,g,h,m,f,v=null)=>{let w=b*p,y=u,q=f?.runs?f.runs:[{type:t.ParseRunType.Text,text:i,width:z.measureText(i,w).width}];f&&f?.width!==n.width&&(n={...n,width:f?.width});let C=me;if(f?.lastRepeatIndex>=0&&c>f?.width){const e=f.runs[f.lastRepeatIndex];if(e){const o=[...q],r=Math.max(0,c-1-f.width);let l=0,i="";if(r>0){const t=Math.floor(r/e.width);i=t>0?e.text.repeat(t):"",l=r}o[f.lastRepeatIndex]={type:t.ParseRunType.Repeat,text:i,width:l},q=o,n={...n,width:f.width+l}}}const x=(t,n,o,i,s,c,u,g,f,v=null)=>{let b,q=y.width;h===r.HorizontalAlignment.Justify?(q=s,m||(b="justify")):h===r.HorizontalAlignment.Distributed&&(q=s,b=m||t.text.split(" ").length-1==0?"center":"justify");const{style:x,className:S,...k}=v;let R=t.text;if(h===r.HorizontalAlignment.Fill&&0===I?.repeatChars.length){const e=Math.max(1,Math.floor((y?.width??0)/(u?.width??1)));R=R.repeat(e)}let M=y.height;const T=ie.getVerticalAlignment(),D=T===a.VerticalAlignment.Sub,A=T===a.VerticalAlignment.Super;if(D||A){const e=ie.getSuperSubScale();w*=e,M*=e}const E={textAlign:b,textAlignLast:b,background:void 0,...x,...ie.toCSS(F,p,!0),fontSize:w*a.getDeviceScale()};ae&&(E.color=ae.toCSS(F));const z=C+n;let N=ge.top+y.y+0;if(D&&(N+=f-w),c){const e=(u.x+z)*p+1,t=(u.y+N)*p+1;t<0?E.marginTop=t:E.paddingTop=t,e<0?(E.width=(x?.width??0)-e,E.left=(x?.left??0)+e):E.paddingLeft=e,E.paddingRight=Math.max(0,(x?.width??0)-q*p-e),E.paddingBottom=Math.max(0,(x?.height??0)-y.height*p-t),E.height=(x?.height??0)+(t<0?-t:0),(t<0||e<0)&&(E.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else if(E.left=(u.x+z)*p+1,E.top=(u.y+N)*p+1,E.width=u.width*p,E.height=u.height*p,ue&&!e){E.left=(u.x+n)*p+1,E.top=(u.y+(y.y+0))*p+1;const e=l.centerPoint({x:C+n,y:0,width:t.width,height:y.height}),o=l.centerPoint({x:C,y:0,width:s,height:y.height}),r=l.rotatePoints([e],ue,o),i={x:r[0].x-e.x,y:r[0].y-e.y};E.left=E.left+i.x*p,E.top=E.top+i.y*p;const a={...y,x:C,y:ge.top,width:y.width+(me+pe)},d=l.boundsToPoints(a),c=l.rotatePoints(d,ue),g=l.minBoundingRect(c);a.width=g.width,a.height=g.height;const h=l.centerPoint(a),m={x:h.x-o.x,y:h.y-o.y};E.left=E.left+m.x*p,E.top=E.top+m.y*p}E.lineHeight=M*p+"px";const O=be?void 0:"text-line";d.push(_("div",{className:S?`${S} ${O}`:O,style:E,...k,children:R},`text-${y.y}-${i}-${o}`))};if(se.getOverflow()===r.Overflow.Shrink&&c>0){let e=n?.width??0,t=0;for(;e>1&&e>c&&w>2&&t<100;){w*=c/e;e=z.measureText(i,w).width,t++}n={...n,width:e}}let S=y.x;h===r.HorizontalAlignment.Right?S+=n.width-y.width:h!==r.HorizontalAlignment.Center&&h!==r.HorizontalAlignment.CenterContinuous||(S+=(n.width-y.width)/2),f?.lastRepeatIndex>=0&&(S=y.x);const k=q.length;for(let e=0;e<k;e++){const l=q[e];if(l.type===t.ParseRunType.Text||l.type===t.ParseRunType.Repeat){l.type,t.ParseRunType.Repeat;x(l,S,e,s,h===r.HorizontalAlignment.Justify||h===r.HorizontalAlignment.Distributed||f?.lastRepeatIndex>=0?c:y.width,be,{x:o.x+P,y:o.y,width:l.width,height:n.height},0,g,v)}S+=l.width}};m?q(m,0,{x:0,y:0,...n},v.lines[0].baseline,j,!0,null,y):v.visitLines({visitTextLine:(e,t,o)=>{const l=e.runs[0].text.replace(/\s+$/,""),i=t===o-1;let a=j===r.HorizontalAlignment.Justify&&(i||e.runs[0].text.endsWith("\n"))?r.HorizontalAlignment.Left:j,s=0;t>0&&(se.getVertical()===r.VerticalAlignment.Distributed||se.getVertical()===r.VerticalAlignment.Justify)&&(s=Math.max(0,(T-(he+3)-e.bounds.height*o)/(o-1)*t)),se.getVertical()===r.VerticalAlignment.Distributed&&ue&&ue%90==0&&ue%180!=0&&(a=r.HorizontalAlignment.Distributed),a!==r.HorizontalAlignment.Justify&&a!==r.HorizontalAlignment.Distributed&&a!==r.HorizontalAlignment.Fill||(n={...n,width:c});const d={...e.bounds,y:e.bounds.y+s+0,width:de||I&&(I.repeatChars.length>0||I.spacingChars.length>0)?n.width:e.bounds.width};q(l,t,d,u.lines[0].baseline,a,i,1===o?U:null,be&&t>0?{...y,style:{...y.style,background:void 0}}:y)}})}d.length>0&&(K=d)}if(be)return K&&K.length>0?K:_("div",{style:Ce,...M});let xe=x?"auto":fe.pointerEvents,Se=null;if(we){const e={x:$*p-1,y:-1,width:W*p+1,height:T*p+1};xe="auto",Se=R({renderBounds:e,darkMode:F,className:"filter-button",disabled:!A.isEditAllowed(),zoom:p,filter:A.getColumnFilter(),onFilterButtonMouseDown:S,...k}),Se&&(Se=_("div",{style:{...e,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:Se},"filterButton"))}Z&&!K&&(K=_("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const ke=[te,K,g,ne,ye,Se];return _("div",{style:{...J,...fe,pointerEvents:xe},...M,children:ke})},Le={text:"",placeholder:""},Ve=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return 0===n.length||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},Be=Object.freeze([S.Delete,S.Home,S.End]),He=ee(oe((e,t)=>{const{editState:n,onStartEdit:o,onChangeEdit:l,onSubmitEdit:d,onCancelEdit:c,onDoneEdit:u,defaultTextStyle:g,useRichStyling:h=!0,bodyStyle:m,activeCoords:p,sheet:f,commands:v,containerBounds:w,setNaturalDimensions:y,onFocus:b,disabled:q,style:A,zoom:E=1,linesVisible:z,autoFocus:F=!1,...I}=e,{height:N=0,width:O=0}=w??{},L=m?.darkMode??!1,V=re(null),[B,H]=ne(!1),[P,W]=ne(null),[$,U]=ne(()=>n);le(()=>{oe.current=!1,U(n)},[n]);const j=te(()=>{const e=$.clean();let t=e.getStyle();h||(t=t.createTemporaryStyle({font:{size:g?.fontSize}}));const n=e.getFormula(),o=t.getAlignment(),l=n?r.HorizontalAlignment.Left:o.getHorizontal(),a=o.getVertical(),s=o.getOverflow()===r.Overflow.Wrap||e.getType()===i.String&&(l===r.HorizontalAlignment.Justify||l===r.HorizontalAlignment.Distributed||a===r.VerticalAlignment.Justify||a===r.VerticalAlignment.Distributed),d=(e=>{if(!e)return Le;const t=e.clean();if(!t)return Le;let n=t.getStyle()?.getQuotePrefix();if(void 0===e.dirty||null===e.dirty){let o="",r=t.getFormulaText();r&&(o=r,n=!1),o||(o=t.toTextUnformatted(!0)??"");let l="";if(!e.editMode&&t.isSpillOverflow()){const e=t.getSpill();if(e){const n=e.getCell(),o=n.getFormulaText();n.isEqual(t)||(l=o)}}return n&&(o="'"+o),{text:o,placeholder:l}}return{text:e.dirty??"",placeholder:""}})($),c=d.text,u=r.toCSSHorizontalTextAlign(h&&!n?$.clean()?.getRenderHorizontalAlignment():r.HorizontalAlignment.Left);return{style:t,isWrapped:s,textValue:c,formula:n,frameVertAlign:a,placeholder:d.placeholder,insets:h?e.getInsets():K.EmptyRect,textAlign:u}},[$,g,L,E,h]),G=re(null),Z=C(t,()=>({startEdit:e=>{V.current=e?.initialSelection;const t={...n,editMode:e?.editMode??!1};void 0!==e?.text&&(t.dirty=e.text),t.editMode===n.editMode&&t.dirty===n.dirty||(U(t),J?.(t))},submitEdit:()=>se(),cancelEdit(){de()},autoFocus(){G.current.focus()},dispatchEvent:e=>G.current.dispatchEvent(e),focus(){G.current.focus()},getLineHeight:Y}),[o,n]);ie(()=>{if(!P||!B)return;const e=G.current;j.textValue,e&&e.setSelectionRange(P.start,P.end,P.direction)},[G.current,P,j.textValue]);const X=te(()=>{const e=$?.clean(),t=j.style.createTemporaryTextFrame(j.textValue,e?.getType()===i.String),n=h?e.getInsets().right+e.getInsets().left:0;let o=null;j.isWrapped&&(o={width:O-n});return t.layout(o)},[j,O,$,h]),Y=x(()=>Math.ceil(X?.lines[0]?.bounds.height),[X]);ie(()=>{if(!X)return;const e=j.style,t=e.getInsets()??K.EmptyRect,n=h?t.left+t.right:0,o=h?.04*e.getFont().getSize():1,r=Math.round(j.isWrapped?void 0:X.bounds.width+n+o),l=Math.round(X.bounds.height);y?.({width:r,height:l})},[X,y,j,h,$]);const J=x(l,[l]),Q=x(e=>{if($.dirty===e)return;const t={...$};t.dirty=e,G.current,U(t),J?.(t)},[$]),ee=x(e=>{if($.editMode===e)return;const t={...$};t.editMode=e,U(t),J?.(t)},[$]),oe=re(!1),se=x(()=>{if(oe.current)return!1;try{d?.($),u?.(),oe.current=!0}catch(e){return!1}return!0},[d,$]),de=x(()=>{oe.current=!0,U(n),c?.(),u?.()},[c,n]),ce=x(e=>{if(!G.current)return;if(e.key,e.isDefaultPrevented(),!(e.isTrusted||e.nativeEvent.ctrlKey||e.nativeEvent.metaKey||e.nativeEvent.altKey||e.nativeEvent.isComposing||-1===fe.indexOf(e.nativeEvent.key)&&"Backspace"!==e.nativeEvent.key)){const t={...$};let n=0;return Ve(t,t.dirty)&&!isNaN(parseFloat(e.key))?(t.dirty?.endsWith("%")?t.dirty=(t.dirty.substring(0,t.dirty.length-1)??"")+e.key+"%":t.dirty=(t.dirty??"")+e.key+"%",n=t.dirty.length-1):"Backspace"===e.nativeEvent.key?(t.dirty="",n=t.dirty.length):(t.dirty=(t.dirty??"")+e.key,n=t.dirty.length),G.current.value=t?.dirty,V.current={start:n,end:n,direction:"forward"},G.current?.setSelectionRange(n,n,"forward"),U(t),J?.(t),void e.preventDefault()}const t=e.nativeEvent.ctrlKey,n=e.nativeEvent.shiftKey,o=e.nativeEvent.altKey,r=e.nativeEvent.metaKey;if(t&&"z"===e.key&&e.stopPropagation(),e.which===S.Escape)return e.preventDefault(),void de();if(e.which===S.F2)return ee(!0),void e.preventDefault();const l=e.target;if("%"===e.key&&l.selectionStart===l.selectionEnd&&"%"===l.value[l.selectionStart]&&$?.clean().getStyle().numberFormat.includes("%"))return W({start:l.selectionStart+1,end:l.selectionEnd+1,direction:l.selectionDirection}),void e.preventDefault();if(e.which===S.Enter){if(e.preventDefault(),r||o){const e=j.textValue.substring(0,l.selectionStart)+"\n"+j.textValue.substring(l.selectionEnd);return Q(e),void W({start:l.selectionStart+1,end:l.selectionStart+1,direction:l.selectionDirection})}return void(se()&&f.getSelection().traverse(s.Orientation.Column,n))}if(e.which===S.Tab)return e.preventDefault(),void(se()&&f.getSelection().traverse(s.Orientation.Row,n));let i=null;switch(e.which){case S.Left:i=s.Direction.Left;break;case S.Right:i=s.Direction.Right;break;case S.Up:i=s.Direction.Up;break;case S.Down:i=s.Direction.Down}if(i){if(!(t||n||o||r)&&!$.editMode)return void se()}$.editMode&&(i||Be.includes(e.which))&&e.stopPropagation()},[$,f,j]),ue=ae(()=>{G.current?.focus(),setTimeout(()=>{G.current?.select()},0)},[]),ge=ae(()=>{G.current?.focus(),console.log("implement toggleRelativeReferences")},[]),he=x(()=>{const e=G.current?.value;let t="";if(p.rowIndex>0){const e=f.getRange({rowIndex:p.rowIndex-1,colIndex:p.colIndex}).getCell();e&&(t=e.toTextUnformatted(!0))}Q(e+t)},[p,f]);le(()=>f.getRange(p).addListener(()=>{const e={...$,clean:()=>f.getRange(p).getCell()};U(e),J?.(e)}),[p,f]);const me=ae(()=>{const e=$.clean().createTemporaryCell({value:De(),style:{numberFormat:"Medium Time"}}).toText();Q((G.current?.value??"")+e)},[f]),pe=ae(()=>{const e=$.clean().createTemporaryCell({value:De(),style:{numberFormat:"Short Date"}}).toText();Q((G.current?.value??"")+e)},[f]),ve=te(()=>({element:()=>G.current,doCopy:e=>{const t=G.current.value.substring(G.current.selectionStart,G.current.selectionEnd);if(e?.isCut){const e=G.current.value.substring(0,G.current.selectionStart)+G.current.value.substring(G.current.selectionEnd,G.current.value.length);Q(e)}return t}}),[G.current]),we=te(()=>({element:()=>G.current,doPaste:async(e,t)=>{const n=await(e.toText?.());if(!n)return!0;const o=G.current.value.substring(0,G.current.selectionStart)+n+G.current.value.substring(G.current.selectionEnd,G.current.value.length);return Q(o),W({start:G.current.selectionStart+n.length,end:G.current.selectionStart+n.length,direction:"forward"}),!0}}),[G.current]),ye=te(()=>({contains:e=>G.current?.contains(e)||!1,focus(){G.current.focus()}}),[]),be=te(()=>[new k("selectAll",ye,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[M.Ctrl]}},ue),new k("startEditValueAbove",ye,{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:[M.Ctrl]},{key:'"',modifiers:[M.Ctrl,M.Shift]}]},he),new k("startEditCurrentTime",ye,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl,M.Shift]}},me),new k("startEditCurrentDate",ye,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl]}},pe),new R("relativeReferencesToggle",ye,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},ge),new R("toggleEditorFocus",ye,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[M.Ctrl]}})],[]),qe=te(()=>{let e=null;const t=()=>({contains:e=>G.current?.contains(e)||!1,focus(){G.current.focus()}});return e=v?v.createChildGroup(t,"editor",!1):new T(t,"editor"),e.addCommands(be,!0),e},[v,be]),Ce=te(()=>({notifier:null,source:ve,target:we,commands:qe}),[ve,we,qe]);D(Ce);const[xe,Se]=ne(!F);le(()=>{Se(!1)},[]);const ke=x(e=>{H(!0),qe?.activate();const t=V.current;if(!1!==t){let e,n;const o=G.current.value;Ve($,o)&&(e=o.length-1,n=o.length-1),e=t?.start??e??o.length,n=t?.end??n??o.length,V.current=!1,W({start:e,end:n,direction:"forward"})}b?.(e)},[b,$]),Re=j.insets;let Me=Re.left+1;const Te=Re.left+Re.right+2-1,Ae=X?.bounds.height??0;let Ee,ze=Re.top;j.frameVertAlign===r.VerticalAlignment.Center?ze=Math.max(0,(N-(Re.top+Re.bottom)-Ae)/2):j.frameVertAlign===r.VerticalAlignment.Bottom&&(ze=Math.max(0,N-(Re.top+Re.bottom)-Ae)),void 0!==z&&X?.lines[0]?.bounds&&(Ee=X?.lines[0]?.bounds.height*z);const Fe=j.style.getFont();let Ie=Fe.getSize();Fe.isSuperSub()&&(Ie*=Fe.getSuperSubScale()),Ie*=a.getDeviceScale()*E;const Ne=h?Fe.toCSS(L,E):null;return _("div",{className:"sheet-cell-editor",onMouseDown:e=>{G.current&&document.activeElement!==G.current&&requestAnimationFrame(()=>{G.current.focus()})},ref:Z,...I,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...A},children:_("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:ze*E+1,left:Me*E,width:`calc(100% - ${Te*E}px)`,maxWidth:`calc(100% - ${Te*E}px)`,height:(Ee??Ae)*E,maxHeight:(Ee??Ae)*E},children:_("textarea",{spellCheck:"false",placeholder:j.placeholder,ref:G,value:j.textValue,disabled:xe,readOnly:q||f.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ne,fontSize:Ie?`${Ie}px`:"inherit",textAlign:j.textAlign,lineHeight:(X?.lines[0]?.bounds.height??0)*E+"px",height:(X?.bounds.height??0)*E,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:j.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:ke,onBlur:()=>{H(!1)},onSelect:e=>{},onChange:e=>{G.current&&!oe.current&&(V.current=!1,Q(e.target.value),j.textValue,e.target.value,e.target.selectionStart,e.target.selectionEnd,e.target.selectionDirection,W({start:e.target.selectionStart,end:e.target.selectionEnd,direction:e.target.selectionDirection}))},onMouseDown:e=>{B&&ee(!0)},onKeyDown:ce})})})})),Pe=(e,t)=>({clean:e,dirty:t,editMode:!1}),We=e=>{const{length:t=0,width:n=1,dashArray:o=null,dashArrayAdditional:r=null,isDouble:l=!1,isAngled:i=!1,offsetX:a=0,offsetY:s=0,isVertical:d=!1,...c}=e,u=e=>{let t=null;if(e&&n>0){t="";for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=",")}return t},g=u(o);let h=g;r&&(h=u(r));let m=n,p=t,f=null;if(l){m=Math.floor(n/2);const e=m+m/2+1;let t=null;t=d?`M ${q.boundPixel(a+e)} ${q.boundPixel(s)} L ${q.boundPixel(a+e)} ${q.boundPixel(s+p)}`:`M ${q.boundPixel(a)} ${q.boundPixel(s+e)} L ${q.boundPixel(a+p)} ${q.boundPixel(s+e)}`,f=_("path",{strokeWidth:m,strokeDasharray:h,d:t,...c})}if(i){m=n/2;const e=m+m/2;let t=h,o=null;o=d?`M ${q.boundPixel(a+e)} ${q.boundPixel(s)} L ${q.boundPixel(a+e)} ${q.boundPixel(s+p)}`:`M ${q.boundPixel(a)} ${q.boundPixel(s+e)} L ${q.boundPixel(a+p)} ${q.boundPixel(s+e)}`,f=_("path",{strokeWidth:m,strokeDasharray:t,strokeDashoffset:"1",shapeRendering:"crispEdges",d:o,...c})}let v=null;return v=d?`M ${q.boundPixel(a+m/2)} ${q.boundPixel(s)} L ${q.boundPixel(a+m/2)} ${q.boundPixel(s+p)}`:`M ${q.boundPixel(a)} ${q.boundPixel(s+m/2)} L ${q.boundPixel(a+p)} ${q.boundPixel(s+m/2)}`,G(Z,{children:[_("path",{strokeWidth:m,strokeDasharray:g,d:v,...c}),f]})};function $e(e,t){if("function"==typeof e)return e(t);e&&(e.current=t)}var Ue=parseInt(se.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const e=$e(o,t),r="function"==typeof e;n.push(r?e:()=>$e(o,null))}return()=>{for(const e of n)e()}}}:function(e){return t=>{for(const n of e)$e(n,t)}},je=function(){},_e="undefined"!=typeof window,Ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ze=_e?ie:le,Xe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ye=_e&&void 0!==window.ResizeObserver?function(){var e=ne(null),t=e[0],n=e[1],o=ne(Xe),r=o[0],l=o[1],i=te(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,o=t.y,r=t.width,i=t.height,a=t.top,s=t.left,d=t.bottom,c=t.right;l({x:n,y:o,width:r,height:i,top:a,left:s,bottom:d,right:c})}})},[]);return Ze(function(){if(t)return i.observe(t),function(){i.disconnect()}},[t]),[n,r]}:function(){return[je,Xe]},Ke=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Je=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Qe=e=>{const{key:t,points:n,range:r,stroke:l,darkMode:i,forceThinBorder:a=!1,shiftIfWide:s=!1,isVertical:d=!1,intersections:c,layout:u}=e,g=o.BuiltInDefinitions.get(a?o.StrokeStyle.Thin:l.getStyle());if(!g)return null;const h=n[0],m=n[1],p=n[2],f=n[3];let v=1+(d?f-m:p-h),w=0;const y=l.getColor().toRGBA(i).toString(),b=g.description.toLowerCase().includes("double");let q,C;const x=d?"rowStart":"colStart",S=d?"rowEnd":"colEnd",k=d?m:h;if(c?.length>0){const e=c[0];if(e?.range[x]===r[x]){const t=o.BuiltInDefinitions.get(e.stroke.getStyle());w=Math.floor(t.width/2)}const t=c[c.length-1];if(t?.range[S]===r[S]){const e=o.BuiltInDefinitions.get(c[c.length-1].stroke.getStyle());v=Math.floor(v+(2===e.width?0:e.width/2))}if(b){const e=d?"colStart":"rowStart",t=d?"colEnd":"rowEnd",n=d?u?.getRowOffset:u?.getColOffset;let l=0,i=0;q=[],C=[];for(let a=0;a<c.length;a++){const s=c[a];if(s.stroke.getStyle()===o.StrokeStyle.Double&&n){const o=n(s.range[x])-(k-w);s.range[e]<r[e]&&(q.push(o-l),l=o,q.push(1),l++),s.range[t]>r[t]&&(C.push(o-i),i=o,C.push(1),i++)}}q.length>0&&l<v&&q.push(v-l),C.length>0&&i<v&&C.push(v-i)}}let R=d?-Math.floor(g.width/2):-w,M=d?-w:-Math.floor(g.width/2);const T=s&&g.width>2?-1:0;return _(We,{offsetX:h+R+T,offsetY:m+M+T,length:v+w,isVertical:d,stroke:y,width:g.width,dashArray:q??g.pattern,dashArrayAdditional:C,isDouble:b,isAngled:g.description.toLowerCase().includes("slant")},t)},et=({getBorderAt:e,borderRenderer:t=Qe,getVisibleCells:n,darkMode:r,forceThinBorder:l=!1,defaultColor:i="black",shiftIfWide:a=!1})=>{const s=x(n,[n]),d=te(()=>n=>{const d=n.toClipBounds(n.getRangeCoordsBounds(),-3);if(!d)return;const c=s(n);if(0===c.length)return;const u=n.getVisibleColumnOffsets(),g=n.getVisibleRowOffsets();let h=[],m=[];const p=n.getVisibleColumns(),f=n.getVisibleRows(),v=[],w=[],y=[],b=(e,t,n,o,r,l,i)=>{const a={index:o,stroke:r,visibleIndex:n,edge:l,length:i};e[t]||(e[t]=[]),e[t].length>0&&e[t][e[t].length-1]?.index===o?e[t][e[t].length-1]=a:e[t].push(a)};for(let t=0;t<c.length;t++){const r=c[t],l=r.coords;if(!l)continue;const i=r?.range??{rowStart:l.rowIndex,colStart:l.colIndex,rowEnd:l.rowIndex,colEnd:l.colIndex},a=n.getVisibleRangeCoords();if(!J.isRangesIntersect(i,a)&&!J.isRangeWithinRange(i,a))continue;const s=l.colIndex,d=l.rowIndex,y=u[s],q=g[d];if(i.rowEnd!==i.rowStart){const e=g[i.rowStart]?.spanIndex??-1,t=g[i.rowEnd]?.spanIndex??g[f[f.length-1]].spanIndex+1;h.push({...i,rowStart:e,rowEnd:t})}if(i.colEnd!==i.colStart){const e=u[i.colStart]?.spanIndex??-1,t=u[i.colEnd]?.spanIndex??u[p[p.length-1]].spanIndex+1;m.push({...i,colStart:e,colEnd:t})}const C=r.value,x=e(C,t);if(!x||x.isEmpty())continue;const S=x.getLeft(),k=x.getTop(),R=x.getRight(),M=x.getBottom();let T=1,D=1;if(!y||!q)continue;const A=y.spanIndex,E=q.spanIndex;S.isNone()||b(v,A,E,d,S,o.Edge.Left,T),k.isNone()||b(w,E,A,s,k,o.Edge.Top,D),R.isNone()||b(v,A+D,E,d,R,o.Edge.Right,T),M.isNone()||b(w,E+T,A,s,M,o.Edge.Bottom,D)}const q=(e,t,n)=>{const o=[];return e.forEach((e,r)=>{let l=null;e.sort((e,t)=>e.visibleIndex-t.visibleIndex);for(let a=0;a<e.length;a++){const s=e[a];if(!s?.stroke)continue;if(void 0===t[r]&&void 0===t[r-1])continue;let d=!1;if(n)for(let e=0;!d&&e<h.length;e++){let t=h[e];t.colStart<=s.index&&t.colEnd>=s.index&&t.rowStart<r&&t.rowEnd>=r&&(d=!0)}else for(let e=0;!d&&e<m.length;e++){let t=m[e];t.rowStart<=s.index&&t.rowEnd>=s.index&&t.colStart<r&&t.colEnd>=r&&(d=!0)}if(d)continue;const c=s.stroke?.getColor(),u=c?c.toRGBA().toString():i,g=s.stroke.getStyle()+":"+u;(g!==l?.key||l&&l.visibleIndex+1<s.visibleIndex)&&(l&&o.push(l),l={key:g,index:t[r]??t[r-1]+1,visibleIndex:s.visibleIndex,edge:s.edge,stroke:s.stroke,from:s.index,to:s.index+s.length-1,intersections:[],length:1}),l.to=s.index+s.length-1,l.visibleIndex=s.visibleIndex}l&&o.push(l)}),o};h=h.sort(Je),m=m.sort(Ke);const C=q(v,p,!1),x=q(w,f,!0);if(0===C.length&&0===x.length)return null;for(let e=0;e<x.length;e++){const t=x[e];let n=X.findEqualOrGreater(C,t.from,e=>e.index),o=!1;for(;!o;){const e=C[n++];e&&e.index>=t.from&&e.index<=t.to+1&&e.from<=t.index&&e.to+1>=t.index&&(t.intersections.push({stroke:e.stroke,range:{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}}),e.intersections.push({stroke:t.stroke,range:{rowStart:t.index,rowEnd:t.index,colStart:t.from,colEnd:t.to+1}})),o=!e||e.index>t.to+1}}for(let e=0;e<x.length;e++){const o=x[e];let i=o.stroke;const s=`rBorder:${o.index}:${o.from}:${o.to}:${o.edge}`,d={rowStart:o.index,rowEnd:o.index,colStart:o.from,colEnd:o.to+1},c=n.getLayout(),u=!1,g=c.getColOffset(d.colStart),h=c.getRowOffset(d.rowStart),m=[g,h,c.getColOffset(d.colEnd),h];y.push(t({key:s,points:m,stroke:i,darkMode:r,forceThinBorder:l,shiftIfWide:a,range:d,intersections:o.intersections,layout:c,isVertical:u}))}for(let e=0;e<C.length;e++){const o=C[e];let i=o.stroke;const s=`cBorder:${o.index}:${o.from}:${o.to}:${o.edge}`,d={rowStart:o.from,rowEnd:o.to+1,colStart:o.index,colEnd:o.index},c=n.getLayout(),u=!0,g=c.getColOffset(d.colStart),h=[g,c.getRowOffset(d.rowStart),g,c.getRowOffset(d.rowEnd)];y.push(t({key:s,stroke:i,points:h,darkMode:r,forceThinBorder:l,shiftIfWide:a,range:d,intersections:o.intersections,layout:c,isVertical:u}))}return _("svg",{width:`${d.width}`,height:`${d.height}`,viewBox:`0 0 ${d.width} ${d.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${d.width}px`,height:`${d.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:y},"borders")},[e,r]);return{overlay:d}},tt=Y.Center,nt=Object.freeze({horizontal:!1,vertical:!1}),ot=K.EmptyTopLeft,rt=(e,t)=>J.EmptyCell,lt=(e,t)=>new Promise((e,t)=>{t("StaticBorderRenderer does not support scrolling")}),it=ee(e=>{const{getBorderAt:t,width:n,height:o,style:r,rowCount:l=2,columnCount:i=2,darkMode:a,forceThinBorder:s,children:d,...c}=e,u=re(null),[g,{width:h,height:m}]=Ye(),p=n??h,f=o??m,v=te(()=>{const e=[];for(let t=0;t<l;t++)for(let n=0;n<i;n++){const o={colIndex:n,rowIndex:t};e.push({coords:o,value:o})}return e},[]),w=ae(e=>v,[v]),{overlay:y}=et({getVisibleCells:w,getBorderAt:t,darkMode:a,forceThinBorder:s}),b=Math.floor(p/i),q=Math.floor(f/l),C={getColOffset:e=>Math.ceil(e*b)+0,getRowOffset:e=>Math.ceil(e*q)+0,getColIndex:e=>Math.floor((e-0)/b)-1,getRowIndex:e=>Math.floor((e-0)/q)-1},x={rowStart:0,colStart:0,rowEnd:l,colEnd:i},S={x:0,y:0,width:Math.max(0,p)+0,height:Math.max(0,f)+0},k=te(()=>{const e={},t=Math.floor(p/i);for(let n=0;n<i;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[p,f]),R=te(()=>{const e={},t=Math.floor(f/l);for(let n=0;n<l;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[p,f]);if(!y)return null;const M={width:p,height:f},T={width:p,height:f},D={getStage:()=>u.current,getTotalSize:()=>M,getViewportSize:()=>T,getLayout:()=>C,getCellCoordsAsRangeCoords:J.cellToRange,getVisibleRangeCoords:()=>x,getVisibleRows:()=>{const e=[];for(let t=0;t<l;t++)e.push(t);return e},getTotalRangeCoords:()=>x,getRelativePointFromClient:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{const e=[];for(let t=0;t<i;t++)e.push(t);return e},toClipBounds:(e,t)=>S,toViewBounds:e=>e,toAbsoluteBounds:e=>e,getBounds:()=>S,getInsets:()=>null,getRangeCoordsBounds:(e,t)=>null,getVisibleColumnOffsets:()=>k,getVisibleRowOffsets:()=>R,allViews:()=>({[tt]:D}),getAnchor:()=>tt,getZoom:()=>1,scrollCellCoordsIntoView:lt,getCellCoordsFromClient:rt,getScrollOrientation:()=>nt,getScrollTopLeft:()=>ot,getFreezeTopLeft:()=>ot},A=y(D);return G("div",{style:{...r,position:"relative",display:"flex"},...c,children:[_("div",{ref:Ue([u,g]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:d}),A]})});function at(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=at(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function st(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=at(e))&&(o&&(o+=" "),o+=t);return o}const dt="_sheetxl-sheet_1qeq6_5",ct="_viewport-overlay_1qeq6_6",ut=e=>{const{style:t,...n}=e??{};return G("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[_("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"}),_("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"}),_("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"}),_("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"}),_("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"})]})},gt=ee(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:o="grey",credits:r="All rights reserved - Michael Ford",feature:l,style:i,...a}=e??{},[s,c]=ne(null);Q.useEffect(()=>{(async()=>{const e=await d.getDetails();c(e)})()},[]);const[u,g]=Q.useState(!1),h={opacity:.65},m=Q.useMemo(()=>{const e=s?.exceptions(),t=e?.length??0;if(0===t)return null;const o=[];for(let r=0;r<t;r++){const t=e[r];o.push(_("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:t},r))}return o},[s,n]);if(null===s)return null;if(s.isValidFor(l))return null;const p=s.type(),f=!m&&p.endsWith("ity"),v=s.licensee(),w=f?1.6:1,y=135/w,b=37/w;let q=null;return!p&&v?.length>0&&(q=_("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:v})),_("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...i},...a,children:G("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[u?_(ut,{style:h}):_("svg",{width:y,height:b,style:h,children:_("image",{style:{width:y,height:b},href:"https://www.sheetxl.com/watermark.svg",onError:()=>g(!0)})}),G("div",{children:[q,m,_("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:o},children:r})]})]})})}),ht=(e,t,n)=>{const o=re(t);o.current=t;const r=n?.fireOnModelChange??!0;le(()=>{if(!e||!o.current)return;const t=Object.keys(o.current),l={},i=t.length;for(let e=0;e<i;e++){const n=t[e];l[n]=(e,t)=>{o.current[n]?.(e,t)}}const a=e.addListeners(l,n);if(r)for(let n=0;n<i;n++){l[t[n]](e)}return()=>{a?.()}},[e])},mt=(e,t,n,o)=>{const r=re(n);r.current=n;const l=o?.fireOnAddressChange??!0;le(()=>{if(!e||!t||!r.current){const e={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void r.current?.(e)}const n=e=>{r.current?.(e)},i=e.getRange(t).addListener(n,o);if(l){const o=e.getRange(t);n({getSource:()=>o,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{i?.()}},[e,t])},pt=new h("transparent");function ft(e){const{sheet:l,onRepeatCommandChange:i,bodyStyle:d,commands:h,target:p,notifier:f,onStartEdit:v,getViewport:w}=e,[y,b]=ne(null),[q,C]=ne(null),S=re(null),D=x(v,[v]),I=x(w,[w]),[N,O]=ne(),[L,V]=ne(()=>l?.getStyles().parseColor(c.Scheme.Bg2)),[B,H]=ne(()=>l?.getStyles().getNormal().getFont().getFill()),P=A();re(P.getMode()).current=P.getMode();const W=E(),[$,U]=ne(X.EmptyArray),j=ae(()=>{if(S.current!==l)return;const e=l.getSelectedRanges();let t=null;$.length>0&&J.isCellWithinRange(y,$[0].getRange().getCoords())&&(t=$[0]);const n=l?.getSelectedCell(),o=n?.getCoords()??null;Me(()=>{ue(t),b(o),C(e)})},[l,$,q,y]),Z=ae(X.debounce(j,210),[j]);le(()=>{S.current=l,j()},[l]);const Y=x(()=>l.getRange(y).getCell(),[l,y]),K=x(async(e,t,n=null,o=!1,r=!0)=>{const a=e?.label?.(),s=async()=>{const e=await Promise.resolve(r&&f?.showBusy?.(a??"Busy..."));try{await l.doBatch(async()=>t(l),a),o&&P.setMode(null),e&&e()}catch(t){if(e&&e(),!t)return;f?.showError?.(t)}},d=[];let c=!1;const u=async()=>(d.push(s),(async()=>{if(!c){for(c=!0;d.length>0;){const e=d.shift();e&&await e()}c=!1}})());if(i){let t=null;if(!1!==n&&e){const o=n??a;t=new k(e.key(),p,{label:o,description:o},u)}i(t)}return u()},[l,i,f]),Q=x((e,t,n=!1,o)=>K(e,e=>{const r=e.getSelectedRanges();n&&r.updateStyle(null,o),r.updateStyle(t,o),r.autoFit({expandOnly:s.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[l]),ee=x((e,t,n)=>{K(e,e=>{let o=t;(n||t?.address)&&(o=o??{},!n&&t?.address?.startsWith("#")?n=t?.address.substring(1):n&&(o.displayText=n)),e.getSelectedRange().setHyperlink(o)})},[l]),oe=x((e,t)=>{K(e,e=>{e.getSelectedRange().setComments(t)})},[l]),ie=x((e,t)=>{K(e,e=>{e.getSelectedRanges().clear(t)})},[l]),se=x(async(e,t,n=!1,o=!1)=>K(e,async e=>{let r=e.getSelectedRanges();n&&(t===s.Orientation.Row?r=r.getEntireRows(o):t===s.Orientation.Column&&(r=r.getEntireColumns(o)));let l=null;const i=P.getMode()?.key;if("copy"===i||"cut"===i){const e=await W.getClipboard().readReference();e&&"range"===e.getItemType()&&(l=e.getItem(),l.getCoords()||(l=null))}if(l){const e=await r.insertFrom(l,{...l.getMarkOptions(),orientation:t,autoSelect:!0});!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({orientations:s.Orientations.Row,minContent:!0}),P.setMode(null)}else r.insert(t,{autoSelect:!0})},"Insert Cells",!1),[P]),[ce,ue]=ne(null),ge=x(e=>l.getStyles().setDefaultTableStyle(e),[l]),he=x(e=>{l.getStyles().getTableStyle(e)?.delete()},[l]),me=x((e,t)=>{K(e,async e=>{const n=e.getSelectedRange(),o=e.getSelectedCell().getCoords();let r=null,l=0;const i=o.rowIndex>0?e.getRange({rowIndex:o.rowIndex,colIndex:o.colIndex}).getExtended(s.Direction.Up):null;i&&e.getRange({colStart:o.colIndex,rowStart:i.getCoords().rowStart,colEnd:o.colIndex,rowEnd:i.getCoords().rowStart}).isContentful()&&(r=s.Direction.Up,l=o.rowIndex-i.getCoords().rowEnd);const a=o.colIndex>0?e.getRange({rowIndex:o.rowIndex,colIndex:o.colIndex-1}).getExtended(s.Direction.Left):null;if(a&&e.getRange({colStart:a.getCoords().colStart,rowStart:o.rowIndex,colEnd:a.getCoords().colStart,rowEnd:o.rowIndex}).isContentful()){const e=o.colIndex-a.getCoords().colEnd;(e<l||!r)&&(r=s.Direction.Left,l=e)}let d=null;if(r===s.Direction.Up){if(d={...i.getCoords()},(d.rowEnd===o.rowIndex||!e.getRange({colIndex:o.colIndex,rowIndex:o.rowIndex-1}).isContentful())&&d.rowStart>0&&e.getRange({colIndex:o.colIndex,rowIndex:d.rowStart-1}).isContentful()){const e=i.getExtended(s.Direction.Up);d={colStart:o.colIndex,rowStart:e.getCoords().rowStart,colEnd:o.colIndex,rowEnd:i.getCoords().rowEnd}}d.rowEnd=o.rowIndex-1}else if(r===s.Direction.Left){if(d={...a.getCoords()},(d.colEnd===o.colIndex||!e.getRange({colIndex:o.colIndex-1,rowIndex:o.rowIndex}).isContentful())&&d.colStart>0&&e.getRange({colIndex:d.colStart-1,rowIndex:o.rowIndex}).isContentful()){const e=a.getExtended(s.Direction.Left);d={colStart:e.getCoords().colStart,rowStart:o.rowIndex,colEnd:e.getCoords().colEnd,rowEnd:o.rowIndex}}d.colEnd=o.colIndex-1}if(1!==n.size&&r){const o=n.getCoords(),l=n.startIncrementalUpdates({orientation:s.Orientation.Column}),i={...d},a=o.rowStart,c=o.rowEnd,u=o.colStart,g=o.colEnd,h=r===s.Direction.Up;for(let n=u;n<=g;n++){i.colStart=h?n:d.colStart+(n-u),i.colEnd=h?n:d.colEnd+(n-u);for(let o=a;o<=c;o++){i.rowStart=h?d.rowStart+(o-a):o,i.rowEnd=h?d.rowEnd+(o-a):o;const r=e.getRange(i).toString();l.pushAt(o,n,`=${t}(${r})`)}}l.apply()}else{const n=d?e.getRange(d).toString():"",o=`=${t}(`;D?.({text:`${o}${n})`,editMode:!0,initialSelection:{start:o.length,end:o.length+n.length}})}},!1)},[l]),pe=x((e,t,n=!1,o=!0)=>{K(e,async r=>{let l=null;if(ce)return void ce.updateStyleOptions(t);{const e=r.getSelectedRanges().getFixed(!0),t=r.getSelectedRange().getDefaultSortCriteria();let n={ranges:e,hasHeader:t?.options?.hasHeader??!1};l=o?new Promise((e,t)=>{const o={tableOptions:n,onCancel:()=>{t()},onDone:t=>{e(t)},context:{getNames:()=>r.getNames()}};f.showWindow?.("tableNew",o)}):{option:"Ok",tableOptions:n}}const i=await Promise.resolve(l);if("Ok"!==i?.option)throw null;const a=await Promise.resolve(f?.showBusy?.(e.label()));try{const e=r.getTables().add(i.tableOptions.ranges.at(0),{styleName:t?.name,clearFormatting:n,hasHeader:i.tableOptions.hasHeader});await e.getRange().select()}catch(e){a(),f?.showError?.(e)}a()},!1,!0,!1)},[ce]),fe=x(()=>d,[d]),ve=x(e=>({styles:()=>l.getStyles(),table:()=>e,bodyStyle:fe,getNames:()=>l.getNames()}),[l]),we=x(async(e,t,n,o=!0)=>{let r=null;if(!t){let e=l.getSelectedRange();1===e.size&&(e=e.getSurrounding());let n=l.getTables().search({address:l.getSelectedRange()});n.length>0&&(t=n[0]),await e.select()}if(t){if(o){try{n&&await t.select()}catch(e){}r=new Promise(async(n,o)=>{e.update({context:ve(t)});const r={command:e,commands:Oe,notifier:f,onDone:e=>{n(e)}},l=await(f.showWindow?.("tableDetails",r,{disableAutoDestroy:!0}));setTimeout(()=>{l.focus()},180)})}Promise.resolve(r).then(e=>{},e=>{f?.showError?.(e)})}},[f]),ye=x(async(e,t,n=!1)=>{let o=null;if(t)t.isITable?o=t:t.getValue()&&(o=t.getValue());else{const e=l.getTables().search({address:l.getSelectedRange()});e.length>0&&(o=e[0])}if(o){if(!n){const e=o.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4){if("Convert"!==await(f?.showOptions({title:"Confirm",description:`Converting a table to range with '${t}' cells will set a large number of cell styles and may affect performance.\nContinue?`,options:["Convert","Cancel"],defaultOption:"Convert"})))return}}K(e,async()=>{n?o.delete():o.convertToRange()},!1,!0)}},[f]),be=x((e,t,n)=>{K(e,async o=>{let r=o.getSelectedRanges();if(r.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let l=r.at(0);1===l.size&&(l=l.getSurrounding());const i=o.getSelection().getCoords().cell;let a=l.getDefaultSortCriteria(s.Orientation.Row,i);if(!a){if(n)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let d=a.options;if(n&&(d=new Promise((e,t)=>{const n={range:l,options:a.options,cell:i,onCancel:()=>{t()},onDone:n=>{n?e(n.options):t()}};f.showWindow?.("sort",n)})),d=await Promise.resolve(d),!d)return;const c=await Promise.resolve(f?.showBusy?.(e.label()));try{l.doBatch(()=>{const e={...d,...t};l.sort(e),l.autoFit({orientations:e?.orientation===s.Orientation.Column?s.Orientations.Column:s.Orientations.Row,skipCustomSize:!0,minContent:!0})},e?.label?.())}catch(e){c(),f?.showError?.(e)}c()},!1,!1,!1)},[f]),qe=x(()=>{console.log("compactedSelection");const e=l.getSelection().getCoords(),t=l.getSelectedRanges().getFlattened().getCoords(),n=(e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t),o=new Worker(n);return URL.revokeObjectURL(n),o})("console.log('hello from worker');");setTimeout(()=>{n.terminate(),console.log("Worker terminated")},5e3);let o=-1;for(let n=0;-1===o&&n<t.length;n++)J.isCellWithinRange(e.cell,t[n])&&(o=n);if(J.isEqualRangesArrays(e.ranges,t))return;const r={cell:e.cell,ranges:t,rangeIndex:o};l.getSelection().updateCoords(r)},[l]),Ce=x(()=>{console.log("selectComments")},[l]),xe=x(async(e=!1,t=!1)=>{let n=null;if(t)n=l.getEntireRange();else{const t=l.getSelectedRange();if(t.isEntireRange()){const e=l.getSelection().getCoords().cell,t=l.getRange(e);n=t.getSurrounding(),n.isEntireRange()&&(n=t)}else n=t.getSurrounding({contentOnly:e})}n&&await n.select()},[l]),Se=x((e,t,n)=>{K(e,async e=>{let o=e.getSelectedRanges();n&&(t===s.Orientation.Row?o=o.getEntireRows():t===s.Orientation.Column&&(o=o.getEntireColumns())),o.delete(t)},"Delete Cells")},[l]);x(async e=>{let t=null;const n=I(),o=Math.min(n.width-8,480),r=Math.min(n.height-8,288);try{l.getSelectedRanges();t=await l.getMovables().add({bounds:{x:n.left+(n.width-o)/2,y:n.top+(n.height-r)/2,width:o,height:r},type:"chart",json:e.template}),t.select(),P.setMode(null)}catch(e){f?.showError?.(e)}return t},[l,f]);const ke=x(async(e,t,n)=>{const o=await(f?.showBusy?.(e.label()));try{const e=await l.getMovables().addImage(t,{autoSelect:!0,...n});return o(),P.setMode(null),e}catch(e){o();let t=e;"string"!=typeof t&&(console.warn(e),t="Unable to resolve image."),f?.showMessage?.(t,{type:z.Error})}},[l,f]),Re=x((e,t)=>{K(e,async n=>{const o=n.getSelectedRanges();o.doBatch(()=>{const e=t===s.Direction.Up||t===s.Direction.Down,r=o.getCoords().slice().sort(J.createRangeComparator(e?s.Orientation.Row:s.Orientation.Column));for(let e=0;e<r.length;e++){const o=r[e];let l=o;const i=n.getRange(l).getMerges();let a=0,d=0;if(i.length>0){const e=i[0];a=e.rowEnd-e.rowStart,d=e.colEnd-e.colStart}t===s.Direction.Left?l={...o,colStart:o.colEnd+d}:t===s.Direction.Right?l={...o,colEnd:o.colStart+d}:t===s.Direction.Up?l={...o,rowStart:o.rowEnd+a}:t===s.Direction.Down&&(l={...o,rowEnd:o.rowStart+a}),n.getRange(l).autoFill(o,{filler:u.Types.Copy}),n.getRange(o).autoFit({orientations:s.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:e.label()})})},[f]),Te=x(()=>{let e=null;const t=l.getSelectedCell().getCoords();if(t?.rowIndex>0){const n=l.getRange({rowIndex:t.rowIndex-1,colIndex:t.colIndex}).getCell();n&&(e=n.toTextUnformatted(!0))}D?.({text:e})},[l]),[Ae,Ee]=de(e=>e+1,0),[Fe,Ie]=de(e=>e+1,0),Ne=te(()=>[new R("gridlinesToggle",p,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new R("sheetViewToggleGridlinesRows",p,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new R("sheetViewToggleGridlinesColumns",p,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new R("sheetViewFormatGridlinesColor",p,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new R("sheetViewToggleShowHeadings",p,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new R("sheetViewToggleShowHeadingRows",p,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new R("sheetViewToggleShowHeadingColumns",p,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new R("sheetViewToggleShowHeadingsNumeric",p,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[M.Ctrl,M.Shift]}}),new R("sheetViewToggleFormulaView",p,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[M.Ctrl]},{key:"`",modifiers:[M.Ctrl,M.Shift]}]}),new R("sheetViewToggleShowZeros",p,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new k("selectComments",p,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[M.Ctrl,M.Shift]}},()=>Ce()),new R("selectAll",p,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[M.Ctrl]},{key:"Space",modifiers:[M.Ctrl,M.Shift]}]},(e=!1)=>xe(!1,e)),new k("selectRegion",p,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[M.Ctrl,M.Shift]}},()=>xe(!0,!1)),new k("breakSelection",p,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl,M.Alt]}},()=>qe()),new k("formatTextRotate0",p,{label:"No Text Rotation",description:"Remove all text rotation."}),new k("formatTextRotate45",p,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new k("formatTextRotate90",p,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new k("formatTextRotate270",p,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new k("formatTextRotate315",p,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new R("formatTextRotateCustom",p,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new k("formatTextRotateVertical",p,{label:"Vertical Text",description:"Stack text vertically."}),new k("sortAscending",p,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){be(this,{reverse:!1},!1)}),new k("sortDescending",p,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){be(this,{reverse:!0},!1)}),new k("sortCustom",p,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){be(this,{},!0)}),new R("protectionSheetToggle",p,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:"Prevent unwanted changes from others by limiting their ability to edit.\nFor example, you can prevent people from editing locked cells or making formatting changes."}),new R("formatSheetTabColor",p,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new R("formatCellStyle",p,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(e){Q(this,{named:e.getName()},!0)}),new R("formatTableStyle",p,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(e){pe(this,e)}),new R("formatTableStyleClearCellStyles",p,{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(e){pe(this,e,!0)}),new R("formatTableStyleClearTableStyle",p,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){pe(this,{name:null},!0)}),new R("setDefaultTableStyle",p,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ge),new R("deleteTableStyle",p,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},he),new R("formatBorder",p,{label:"Border",description:"Create an outline border."},function(e){Q(this,{border:e})}),new R("formatFillColor",p,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(e){Q(this,{fill:e})}),new R("formatFontColor",p,{label:"Font Color",description:"Change the color of your text."},function(e){Q(this,{font:{fill:e}})}),new R("formatBoldToggle",p,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[M.Ctrl]},{key:"2",modifiers:[M.Ctrl]}]}),new R("formatItalicToggle",p,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[M.Ctrl]},{key:"3",modifiers:[M.Ctrl]}]}),new R("formatUnderlinedToggle",p,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[M.Ctrl]},{key:"4",modifiers:[M.Ctrl]}]}),new R("formatUnderlinedDoubleToggle",p,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new R("formatUnderlinedAccountingToggle",p,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new R("formatUnderlinedAccountingDoubleToggle",p,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new R("formatStrikeThroughToggle",p,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[M.Ctrl]}}),new R("formatSuperscriptToggle",p,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new R("formatSubscriptToggle",p,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new R("formatAlignTopToggle",p,{label:"Align Top",description:"Align text to the top."}),new R("formatTextOverflowVisibleToggle",p,{label:"Overflow Text",description:"Overflow text to the next cells."}),new R("formatTextOverflowWrapToggle",p,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new R("formatTextOverflowClipToggle",p,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new R("formatTextOverflowShrinkToggle",p,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new R("formatTextOverflowEllipsisToggle",p,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new R("formatAlignMiddleToggle",p,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new R("formatAlignBottomToggle",p,{label:"Align Bottom",description:"Align text to the bottom."}),new R("formatAlignJustifyVerticalToggle",p,{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("formatAlignDistributedVerticalToggle",p,{label:"Distribute Vertically",description:"Justify your content vertically."}),new R("formatAlignLeftToggle",p,{label:"Align Left",description:"Align your content to the left."}),new R("formatAlignCenterToggle",p,{label:"Align Center",description:"Center your content."}),new R("formatAlignRightToggle",p,{label:"Align Right",description:"Align your content to the right."}),new R("formatAlignJustifyToggle",p,{label:"Align Justify",description:"Justify your content."}),new R("formatAlignCenterContinuousToggle",p,{label:"Center Across",description:"Center your content across multiple cells."}),new R("formatAlignFillToggle",p,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new R("formatAlignDistributedHorizontalToggle",p,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new k("formatFontSizeIncrease",p,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,e=>({font:{size:ze(e.getFont().getSize(),!0)}}))}),new k("formatFontSizeDecrease",p,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,e=>({font:{size:ze(e.getFont().getSize(),!1)}}))}),new R("formatFontFamily",p,{label:"Font",description:"Select the font your text."},function(e){Q(this,{font:{family:e}})}),new R("formatFontSize",p,{label:"Font Size",description:"Change the size of your text."},function(e){Q(this,{font:{size:e}})}),new R("formatNumberDialog",p,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[M.Ctrl]},{key:"1",modifiers:[M.Ctrl,M.Alt]}]},function(e,t){const n=this,o={initialValue:e??t.state(),context:t.context(),onInputOption:(e,t)=>{Q(n,{numberFormat:e})}};f.showWindow?.("numberFormat",o)}),new R("formatNumberFormat",p,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(e){Q(this,{numberFormat:e})}),new R("formatNumberFormatGeneralStyle",p,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:t.Type.General})}),new R("formatNumberFormatNumberStyle",p,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"#,##0.00"})}),new R("formatNumberFormatTimeStyle",p,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"h:mm AM/PM"})}),new R("formatNumberFormatDateStyle",p,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"d-mmm-yy"})}),new R("formatNumberFormatAccountingStyle",p,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[M.Ctrl,M.Shift]}},function(e){Q(this,{numberFormat:e??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new R("formatNumberFormatPercentStyle",p,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"0%"})}),new R("formatNumberFormatScientificStyle",p,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"0.00E+00"})}),new R("formatNumberFormatCommaStyle",p,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[M.Ctrl]}},function(){Q(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new R("formatNumberFormatIncreaseDecimal",p,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){Q(this,e=>({numberFormat:t.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}),new R("formatNumberFormatDecreaseDecimal",p,{label:"Decrease Decimal",description:"Show few decimal places."},function(){Q(this,e=>({numberFormat:t.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}),new R("displayPlaceholdersToggle",p,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[M.Ctrl]}}),new k("noOp",p,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[M.Ctrl]}},function(){}),new R("displayOutlineSymbolsToggle",p,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[M.Ctrl]}}),new R("hideRows",p,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[M.Ctrl]}}),new R("unhideRows",p,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[M.Ctrl,M.Shift]}}),new R("hideColumns",p,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[M.Ctrl]},{key:"0",modifiers:[M.Ctrl,M.Alt]}]}),new R("unhideColumns",p,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[M.Ctrl,M.Shift]}}),new R("quickFormulaSum",p,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[M.Alt]}},function(){me(this,"SUM")}),new R("quickFormulaAverage",p,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){me(this,"AVERAGE")}),new R("quickFormulaCount",p,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){me(this,"COUNT")}),new R("quickFormulaMax",p,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){me(this,"MAX")}),new R("quickFormulaMin",p,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){me(this,"MIN")}),new R("startEditCurrentTime",p,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl,M.Shift]}},function(){D?.({text:l.createTemporaryCell({value:De(),style:{numberFormat:"Medium Time"}}).toText()})}),new R("startEditCurrentDate",p,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl]}},function(){D?.({text:l.createTemporaryCell({value:De(),style:{numberFormat:"Short Date"}}).toText()})}),new k("sheetZoomOut",p,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[M.Ctrl,M.Alt]},{key:"NumpadSubtract",modifiers:[M.Ctrl,M.Alt]}]}),new k("sheetZoomIn",p,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[M.Ctrl,M.Alt]},{key:"NumpadAdd",modifiers:[M.Ctrl,M.Alt]}]}),new k("sheetZoom100",p,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[M.Ctrl,M.Alt]}}),new R("insertFunction",p,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[M.Shift]}},function(e,t){console.log("insertFunction")}),new R("updateHyperlink",p,{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:()=>Y,shortcut:[{key:"K",modifiers:[M.Ctrl]},{key:"K",modifiers:[M.Ctrl,M.Alt]}]},async function(e,t){const n=this,o={context:t.context(),onUpdateHyperlink:(e,t)=>{ee(n,e,t)}};f.showWindow?.("hyperlink",o)}),new R("openHyperlink",p,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[M.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>Y},async(e,t)=>{const n=t.context()();if(!n)return;const o=n.getHyperlink();if(o)try{await o.open()}catch(e){f?.showError?.(e)}}),new R("deleteHyperlink",p,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>Y},function(e,t){ee(this,null,null)}),new k("insertNote",p,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[M.Shift]},description:"Add a note to the cell."},(e,t)=>{((e,t)=>{e?.showMessage?.(G("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[t," is not yet implemented.",_("br",{}),_("br",{}),"Please see the ",_("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(f,t.label())}),new R("updateComments",p,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[M.Ctrl,M.Alt]},description:"Add a comment to the current cell.",context:()=>Y},async function(e,t){const n=this,o={context:t.context(),onUpdateComments:e=>{oe(n,e)}};f.showWindow?.("comments",o)}),new R("deleteComments",p,{label:"Delete Comments",description:"Remove any comments.",context:()=>Y},function(e,t){oe(this,null)}),new R("insertImageFromFile",p,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(e=null){let t=null,n=null;"string"==typeof e?n=e:t=e?.file?e.file:e,(t||(t=await X.openFileDialog(n??"image/*"),t))&&await ke(this,{file:t},e?.options)}),new R("insertImageFromURL",p,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(e){if(!e){const t=await(f?.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("Insert"!==t.option)return;e=t.input}e&&ke(this,{fetch:e})}),new k("insertTable",p,{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:[M.Ctrl]},{key:"T",modifiers:[M.Alt,M.Ctrl]}]},function(){pe(this)}),new R("editTable",p,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(e){let t=null,n=!1;e.isITable?t=e:e.getValue()&&(t=e.getValue(),n=!0),we(this,t,n)}),new R("deleteTable",p,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:"Remove the table.\n\nThe table and table specific styling will be removed but the values will be preserved."},function(e){ye(this,e,!0)}),new R("convertTableToRange",p,{label:"Convert To Range",description:"Convert the table into a normal range of cells.\n\nThe values and the formatting are preserved."},function(e){ye(this,e,!1)}),new R("tableTotalRowToggle",p,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[M.Ctrl,M.Alt]}},function(){const e=this.context().table();e&&e.setShowTotals(!e.getShowTotals())}),new R("tableHeaderRowToggle",p,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const e=this.context().table();e&&e.setShowHeaders(!e.getShowHeaders())}),new R("autoFilterToggle",p,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[M.Ctrl,M.Shift]}},function(){const e=this.context().table();e&&e.setShowFilterButton(!e.getShowFilterButton())}),new R("autoFilterReapply",p,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[M.Ctrl,M.Alt]}}),new R("autoFilterClear",p,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new k("startEditValueAbove",p,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[M.Ctrl]},{key:'"',modifiers:[M.Ctrl,M.Shift]}]},Te),new R("formatPainterToggle",p,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new k("insertCells",p,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[M.Ctrl,M.Shift]}},function(){se(this)}),new k("insertCellsShiftRight",p,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){se(this,s.Orientation.Column)}),new k("insertCellsShiftDown",p,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return se(this,s.Orientation.Row)}),new k("insertRows",p,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return se(this,s.Orientation.Row,!0)}),new k("insertColumns",p,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return se(this,s.Orientation.Column,!0)}),new k("insertRowsAfter",p,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return se(this,s.Orientation.Row,!0,!0)}),new k("insertColumnsAfter",p,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return se(this,s.Orientation.Column,!0,!0)}),new k("deleteCells",p,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[M.Ctrl]}},function(){return Se(this)}),new k("deleteCellsShiftUp",p,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return Se(this,s.Orientation.Row)}),new k("deleteCellsShiftLeft",p,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return Se(this,s.Orientation.Column)}),new k("deleteRows",p,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return Se(this,s.Orientation.Row,!0)}),new k("deleteColumns",p,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return Se(this,s.Orientation.Column,!0)}),new k("flashFill",p,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[M.Ctrl]},{key:"e",modifiers:[M.Ctrl,M.Alt]}]}),new k("fillDown",p,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[M.Ctrl]}},function(){return Re(this,s.Direction.Down)}),new k("fillRight",p,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[M.Ctrl]}]},function(){return Re(this,s.Direction.Right)}),new k("fillUp",p,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return Re(this,s.Direction.Up)}),new k("fillLeft",p,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return Re(this,s.Direction.Left)}),new k("formatBorderAddOutline",p,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[M.Ctrl,M.Shift]}},function(){return Q(this,{border:{left:{style:o.StrokeStyle.Thin,color:null},top:{style:o.StrokeStyle.Thin,color:null},right:{style:o.StrokeStyle.Thin,color:null},bottom:{style:o.StrokeStyle.Thin,color:null}}})}),new k("formatBorderClearOutline",p,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[M.Ctrl,M.Shift]}},function(){return Q(this,{border:null})}),new k("formatIndentDecrease",p,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return Q(this,e=>{const t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}})}),new k("formatIndentIncrease",p,{label:"Increase Indent",description:"Move your content further from the border."},function(){return Q(this,e=>{const t={alignment:{indent:e.getAlignment().getIndent()+1}};return e.getAlignment().getHorizontal()===r.HorizontalAlignment.General&&(t.alignment.horizontal=r.HorizontalAlignment.Left),t})}),new R("mergeToggle",p,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[M.Ctrl]}}),new k("mergeHorizontal",p,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new k("mergeVertical",p,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new k("unmerge",p,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new k("clearContents",p,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:"Clear only the contents in the cells.\n\nThe formatting is not cleared.",shortcut:{key:"Delete"}},function(){ie(this,n.Content.Values)}),new k("clearFormats",p,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){ie(this,n.Content.Formats)}),new k("clearHyperlinks",p,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){ie(this,n.Content.Hyperlinks)}),new k("clearComments",p,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){ie(this,n.Content.Comments)}),new k("clearAll",p,{label:"Clear All",scopedLabels:{clear:"All"},description:"Clears everything from the cells.\n\nAll contents and formatting are removed.",shortcut:{key:"Delete",modifiers:[M.Ctrl,M.Shift]}},function(){ie(this)}),new R("freezeToggle",p,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new R("freezeToggleHorizontal",p,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new R("freezeToggleVertical",p,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new k("unfreeze",p,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new k("autoFitRows",p,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new k("autoFitColumns",p,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),Oe=te(()=>{let e=null;return e=h?h.createChildGroup(p,"sheet",!1):new T(p,"sheet"),e.addCommands(Ne,!0),e},[h,Ne]),[Le,Ve]=ne(!1),[Be,He]=ne(!1);le(()=>{if(S.current!==l||!q)return;const e=q.getCoords(),t=l.getTables().search({address:e[0]});U(e=>X.isEqualArrays(e,t)?e:t),y&&t[0]&&J.isCellWithinRange(y,t[0].getRange().getCoords())?ue(t[0]??null):ue(null);const n=l.getSelectedRanges(),o=n.getMerges().length>0,r=n.isOverlapping();let i=!0;for(let t=0;i&&t<e.length;t++)i=J.isSingleCell(e[t]);He(r),Ve(0===t.length&&!r&&(o||!i))},[Fe,q,l]),F(h,null,{onChange:()=>{const e=!l.getProtection().isFormatCellsAllowed(),t="formatPainter"===P.getMode()?.key;Oe.getCommand("formatPainterToggle").update({disabled:e||!h?.getCommand("copy"),state:()=>t}).updateCallback(()=>{if(t)return void P.setMode(null);return Oe.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"}})})}},[P,Ae,h]),ht(l.getView(),{onFreezeSplitChange:()=>{Ie()}}),ht(l.getSelection(),{onChange:()=>{Z()}});const Pe=()=>{Oe.getCommand("sheetViewFormatGridlinesColor").update({state:()=>l.getView().getGridLineColor(),context:()=>({onColorSelect:e=>{},darkMode:d.darkMode,autoColor:l.getStyles().parseColor(d.strokeFill),schemeLookup:l.getStyles().schemeLookup(),recentColors:()=>l.getStyles().recentColors(),addRecentColor:e=>l.getStyles().addRecentColor(e),clearRecentColors:()=>l.getStyles().clearRecentColors()})}),Oe.getCommand("formatSheetTabColor").updateCallback(e=>{l.setTabColor(e)}).update({state:()=>l?.getTabColor()??pt,context:()=>({onColorSelect:e=>{},darkMode:d.darkMode,autoColor:pt,schemeLookup:l.getStyles().schemeLookup(),recentColors:()=>l.getStyles().recentColors(),addRecentColor:e=>l.getStyles().addRecentColor(e),clearRecentColors:()=>l.getStyles().clearRecentColors()})})},We=()=>{Oe.getCommand("formatBorder").update({context:()=>({onBorderSelect:e=>{O(e)},darkMode:d.darkMode,quickBorder:N,autoColor:l.getStyles().getNormal().getFont().getFill(),autoStyle:o.StrokeStyle.Thin,createTemporaryBorder:e=>l.getStyles().getNormal().createTemporaryStyle({border:e}).getBorder(),schemeLookup:l.getStyles().schemeLookup()})})};le(()=>{We()},[N]),le(()=>{const e=!l.getProtection().isInsertHyperlinksAllowed();Oe.getCommand("openHyperlink").update({disabled:!Y().getHyperlink()}),Oe.getCommand("deleteHyperlink").update({disabled:e||!Y().getHyperlink()});const t=Y().getHyperlink()?"Edit":"Insert",n="Link";Oe.getCommand("updateHyperlink").update({label:()=>(Y().getHyperlink(),`${t} ${n}`),scopedLabels:{contextMenu:`${t} ${n}…`,insert:`${n}…`,hyperlink:`${t}…`},disabled:e})},[Y()?.getHyperlink(),Ae]),le(()=>{const e=Y().getComments(),t=()=>e?"Edit":"Insert",n=()=>e?"Comments":"Comment";Oe.getCommand("updateComments").update({label:()=>`${t()} ${n()}`,scopedLabels:{contextMenu:`${t()} ${n()}…`,insert:`${n()}…`}})},[Y()?.getComments(),Ae]),ht(l,{onViewChange:()=>{const e=l.getView();Oe.getCommand("sheetViewToggleFormulaView").update({state:e.isShowFormulas()}),Oe.getCommand("sheetViewToggleShowZeros").update({state:e.isShowZeros()}),Oe.getCommand("gridlinesToggle").update({state:e.isShowColumnGridlines()||e.isShowRowGridlines()}),Oe.getCommand("sheetViewToggleGridlinesColumns").update({state:e.isShowColumnGridlines()}),Oe.getCommand("sheetViewToggleGridlinesRows").update({state:e.isShowRowGridlines()}),Oe.getCommand("sheetViewToggleShowHeadings").update({state:e.isShowColumnHeaders()||e.isShowRowHeaders()}),Oe.getCommand("sheetViewToggleShowHeadingColumns").update({state:e.isShowColumnHeaders()}),Oe.getCommand("sheetViewToggleShowHeadingRows").update({state:e.isShowRowHeaders()}),Oe.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>l.getView().getColumnHeaderStyle()===g.HeaderTextStyle.Zero&&l.getView().getRowHeaderStyle()===g.HeaderTextStyle.Zero}),Pe()},onTabColorChange:()=>{Pe()},onMergesChange:()=>{Ie()},onMovablesChange:()=>{Ie()},onTablesChange:()=>{Ie()},onProtectionChange:()=>{Ie(),Ee()},onStyleChange:()=>{Pe(),We(),Ie()}}),le(()=>{Pe(),We()},[d]),le(()=>{const e=!l.getProtection().isFormatCellsAllowed(),t=$.length>0&&!ce||e,n=ve(ce),o={context:n};Oe.getCommand("editTable").update(o),Oe.getCommand("deleteTable").update(o),Oe.getCommand("convertTableToRange").update(o);const r={context:n,disabled:t};Oe.getCommand("formatTableStyle").update({label:ce?"Apply Table Style":"Format As Table",...r}),Oe.getCommand("formatTableStyleClearCellStyles").update(r),Oe.getCommand("deleteTableStyle").update(r),Oe.getCommand("convertTableToRange").update(r),Oe.getCommand("insertTable").update({disabled:t||$.length>0});const i={context:n,disabled:t||0===$.length};Oe.getCommand("tableHeaderRowToggle").update(i),Oe.getCommand("tableTotalRowToggle").update(i),Oe.getCommand("autoFilterToggle").update(i),Oe.getCommand("formatTableStyleClearTableStyle").update({...i,disabled:i.disabled||!ce||null===ce.getStyleOptions().name})},[ce,$,Ae]),le(()=>{Oe.getCommand("sheetZoomOut").updateCallback(()=>{l.getView().update({zoomScale:X.findNextStep(l.getView().getZoomScale(),!1)})}),Oe.getCommand("sheetZoomIn").updateCallback(()=>{l.getView().update({zoomScale:X.findNextStep(l.getView().getZoomScale())})}),Oe.getCommand("sheetZoom100").updateCallback(()=>{l.getView().update({zoomScale:100})}),Oe.getCommand("gridlinesToggle").updateCallback(()=>{const e=l.getView().isShowColumnGridlines()&&l.getView().isShowRowGridlines();l.getView().update({showColumnGridlines:!e,showRowGridlines:!e})}),Oe.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{l.getView().update({showRowGridlines:!l.getView().isShowRowGridlines()})}),Oe.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{l.getView().update({showColumnGridlines:!l.getView().isShowColumnGridlines()})}),Oe.getCommand("sheetViewFormatGridlinesColor").updateCallback(e=>{l.getView().update({gridLineColor:e})}),Oe.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const e=l.getView().isShowColumnHeaders()&&l.getView().isShowRowHeaders();l.getView().update({showColumnHeaders:!e,showRowHeaders:!e})}),Oe.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{l.getView().update({showColumnHeaders:!l.getView().isShowColumnHeaders()})}),Oe.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{l.getView().update({showRowHeaders:!l.getView().isShowRowHeaders()})}),Oe.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const e=l.getView().getColumnHeaderStyle()===g.HeaderTextStyle.Zero&&l.getView().getRowHeaderStyle()===g.HeaderTextStyle.Zero;l.getView().update({columnHeaderStyle:e?g.HeaderTextStyle.A1:g.HeaderTextStyle.Zero,rowHeaderStyle:e?g.HeaderTextStyle.One:g.HeaderTextStyle.Zero})}),Oe.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{l.getView().update({showFormulas:!l.getView().isShowFormulas()})}),Oe.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{l.getView().update({showZeros:!l.getView().isShowZeros()})})},[l]),le(()=>{const e=l.getView().getFreezePanes(),t=()=>0!==e.coords.rowIndex,n=()=>0!==e.coords.colIndex,o=()=>0!==e.coords.rowIndex||0!==e.coords.colIndex;Oe.getCommand("freezeToggle").updateCallback(()=>{o()?l.getView().setFreezePanes(null):o()?n()?l.getView().setFreezePanes({coords:{rowIndex:y.rowIndex}}):t()&&l.getView().setFreezePanes({coords:{colIndex:y.colIndex}}):l.getView().setFreezePanes({coords:y})}).update({state:o,disabled:()=>!y||!o()&&0===y.rowIndex&&0===y.colIndex}),Oe.getCommand("freezeToggleHorizontal").updateCallback(()=>{l.getView().setFreezePanes({coords:{rowIndex:t()?0:y.rowIndex}})}).update({state:t,disabled:()=>!y||!t()&&0===y.rowIndex}),Oe.getCommand("freezeToggleVertical").updateCallback(()=>{l.getView().setFreezePanes({coords:{colIndex:n()?0:y.colIndex}})}).update({state:n,disabled:()=>!y||!n()&&0===y.colIndex}),Oe.getCommand("unfreeze").updateCallback(()=>{l.getView().setFreezePanes(null)}).update({disabled:()=>!o()})},[Fe,y,l,d]);const $e=Y().getStyle(),Ue=$e.getFont(),je=$e.getAlignment(),_e=je.getHorizontal(),Ge=je.getVertical(),Ze=je.getOverflow(),Xe=je.getRotation();return le(()=>{Oe.getCommand("formatCellStyle").update({context:()=>({styles:()=>l.getStyles(),named:()=>Y().getStyle(!0).getNamed(),bodyStyle:fe,createTemporaryCell:e=>l.createTemporaryCell(e)})}),Oe.getCommand("formatFillColor").update({state:()=>{let e=null;const t=$e.getFill();return t?.getType()===m.Type.Solid?e=t.getColor():t?.getType()===m.Type.Gradient?e=t.getStops()?.[0]?.getColor():t?.getType()===m.Type.Pattern&&(e=t.getBackground()),e},context:()=>{const e=l.getStyles();return{onColorSelect:e=>{V(e??pt)},darkMode:d.darkMode,quickColor:L,autoColor:pt,schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),Oe.getCommand("formatFontColor").update({state:()=>Ue.toJSON()?.fill?Ue.getFill():null,context:()=>{const e=l.getStyles();return{onColorSelect:e=>{H(e)},darkMode:d.darkMode,quickColor:B,autoColor:e.getNormal().getFont().getFill(),schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),Oe.getCommand("formatNumberFormat").update({state:()=>$e.getNumberFormat(),context:()=>Y}),Oe.getCommand("formatNumberDialog").update({state:()=>$e.getNumberFormat(),context:()=>Y}),Oe.getCommand("formatFontFamily").update({state:()=>Ue.getFamily()}),Oe.getCommand("formatFontSize").update({state:()=>Ue.getSize()});const e=function(){const e=Ue.getWeight()||0;return!isNaN(e)&&e>500};Oe.getCommand("formatBoldToggle").updateCallback(function(){Q(this,{font:{weight:e()?400:700}})}).update({state:e});const t=function(){return Ue.getStyle()===a.Style.Italic};Oe.getCommand("formatItalicToggle").updateCallback(function(){Q(this,{font:{style:t()?a.Style.Normal:a.Style.Italic}})}).update({state:t}),Oe.getCommand("formatStrikeThroughToggle").updateCallback(function(){Q(this,{font:{strike:!Ue.getStrike()}})}).update({state:Ue.getStrike()}),Oe.getCommand("formatUnderlinedToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.Single?a.UnderlineStyle.Single:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.Single}),Oe.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.Double?a.UnderlineStyle.Double:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.Double}),Oe.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.SingleAccounting?a.UnderlineStyle.SingleAccounting:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.SingleAccounting}),Oe.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.DoubleAccounting?a.UnderlineStyle.DoubleAccounting:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.DoubleAccounting}),Oe.getCommand("formatSuperscriptToggle").updateCallback(function(){Q(this,{font:{verticalAlign:Ue.getVerticalAlignment()!==a.VerticalAlignment.Super?a.VerticalAlignment.Super:a.VerticalAlignment.Baseline}})}).update({state:Ue.getVerticalAlignment()===a.VerticalAlignment.Super}),Oe.getCommand("formatSubscriptToggle").updateCallback(function(){Q(this,{font:{verticalAlign:Ue.getVerticalAlignment()!==a.VerticalAlignment.Sub?a.VerticalAlignment.Sub:a.VerticalAlignment.Baseline}})}).update({state:Ue.getVerticalAlignment()===a.VerticalAlignment.Sub});const n=()=>Ze===r.Overflow.Visible;Oe.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){Q(this,{alignment:{overflow:(n(),r.Overflow.Visible)}})}).update({state:n});const o=()=>Ze===r.Overflow.Wrap;Oe.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){Q(this,{alignment:{overflow:o()?r.Overflow.Visible:r.Overflow.Wrap}})}).update({state:o});const i=function(){return Ze===r.Overflow.Clip};Oe.getCommand("formatTextOverflowClipToggle").updateCallback(function(){Q(this,{alignment:{overflow:i()?r.Overflow.Visible:r.Overflow.Clip}})}).update({state:i});const s=function(){return Ze===r.Overflow.Shrink};Oe.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){Q(this,{alignment:{overflow:s()?r.Overflow.Visible:r.Overflow.Shrink}})}).update({state:s});const c=function(){return Ze===r.Overflow.Shrink};Oe.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){Q(this,{alignment:{overflow:c()?r.Overflow.Visible:r.Overflow.Ellipsis}})}).update({state:c,disabled:!0});const u=function(){return Ge===r.VerticalAlignment.Top};Oe.getCommand("formatAlignTopToggle").updateCallback(function(){Q(this,{alignment:{vertical:u()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Top}})}).update({state:u});const g=function(){return Ge===r.VerticalAlignment.Center};Oe.getCommand("formatAlignMiddleToggle").updateCallback(function(){Q(this,{alignment:{vertical:g()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Center}})}).update({state:g});const h=function(){return Ge===r.VerticalAlignment.Bottom};Oe.getCommand("formatAlignBottomToggle").updateCallback(function(){Q(this,{alignment:{vertical:(h(),r.VerticalAlignment.Bottom)}})}).update({state:h});const p=function(){return Ge===r.VerticalAlignment.Justify};Oe.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){Q(this,{alignment:{vertical:p()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Justify}})}).update({state:p});const f=function(){return Ge===r.VerticalAlignment.Distributed};Oe.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){Q(this,{alignment:{vertical:f()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Distributed}})}).update({state:f});const v=function(){return _e===r.HorizontalAlignment.Left};Oe.getCommand("formatAlignLeftToggle").updateCallback(function(){Q(this,{alignment:{horizontal:v()?r.HorizontalAlignment.General:r.HorizontalAlignment.Left}})}).update({state:v});const w=function(){return _e===r.HorizontalAlignment.Center};Oe.getCommand("formatAlignCenterToggle").updateCallback(function(){Q(this,{alignment:{horizontal:w()?r.HorizontalAlignment.General:r.HorizontalAlignment.Center}})}).update({state:w});const y=function(){return _e===r.HorizontalAlignment.CenterContinuous};Oe.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const e={alignment:{horizontal:y()?r.HorizontalAlignment.General:r.HorizontalAlignment.CenterContinuous,rotation:null}};Q(this,e)}).update({state:y});const b=function(){return _e===r.HorizontalAlignment.Fill};Oe.getCommand("formatAlignFillToggle").updateCallback(function(){const e={alignment:{horizontal:b()?r.HorizontalAlignment.General:r.HorizontalAlignment.Fill,rotation:null}};Q(this,e)}).update({state:b});const q=function(){return _e===r.HorizontalAlignment.Distributed};Oe.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){Q(this,{alignment:{horizontal:q()?r.HorizontalAlignment.General:r.HorizontalAlignment.Distributed}})}).update({state:q});const C=function(){return _e===r.HorizontalAlignment.Right};Oe.getCommand("formatAlignRightToggle").updateCallback(function(){Q(this,{alignment:{horizontal:C()?r.HorizontalAlignment.General:r.HorizontalAlignment.Right}})}).update({state:C});const x=function(){return _e===r.HorizontalAlignment.Justify};Oe.getCommand("formatAlignJustifyToggle").updateCallback(function(){Q(this,{alignment:{horizontal:x()?r.HorizontalAlignment.General:r.HorizontalAlignment.Justify}})}).update({state:x});const S=!l.getProtection().isFormatCellsAllowed(),k=_e===r.HorizontalAlignment.CenterContinuous||_e===r.HorizontalAlignment.Fill;Oe.getCommand("formatTextRotate0").updateCallback(function(e){Q(this,{alignment:{rotation:0}})}).update({disabled:S||k,state:0===Xe}),Oe.getCommand("formatTextRotate45").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?45:0}})}).update({disabled:S||k,state:45===Xe}),Oe.getCommand("formatTextRotate90").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?90:0}})}).update({disabled:S||k,state:90===Xe}),Oe.getCommand("formatTextRotate270").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?270:0}})}).update({disabled:S||k,state:270===Xe}),Oe.getCommand("formatTextRotate315").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?315:0}})}).update({disabled:S||k,state:315===Xe}),Oe.getCommand("formatTextRotateCustom").updateCallback(function(e){Q(this,{alignment:{rotation:e}})}).update({disabled:S||k,state:Xe??0})},[$e,l,d,L,B]),le(()=>{const e=!l.getProtection().isFormatCellsAllowed(),t=l.getSelectedRanges().getMerges().length>0,n=async(e,t)=>{K(t,async n=>{const o=async(o=!1)=>{const l=await Promise.resolve(f?.showBusy?.(t.label()));try{const t=n.getSelectedRanges();if(t.merge({orientations:e,discardMultipleValues:o}),e===s.Orientations.Both){const e={alignment:{horizontal:r.HorizontalAlignment.Center}};t.updateStyle(e)}}catch(e){throw e}finally{l?.()}};let l;try{await o()}catch(e){if("discardMultipleValues"!==e.type)throw e;l=!0}if(l&&f?.showOptions){if("Merge"!==await(f?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})))return;await o(!0)}},void 0,void 0,!1)},o=e=>{K(e,async e=>{try{const t=e.getSelectedRanges();t.unmerge();const n={alignment:{horizontal:null}};t.updateStyle(n)}catch(e){throw e}})};Oe.getCommand("mergeToggle").updateCallback(function(){J.isSingleCell(l.getSelectedRange().getCoords())||(t?o(this):n(s.Orientations.Both,this))}).update({state:t,disabled:!Le||e}),Oe.getCommand("mergeHorizontal").updateCallback(function(){n(s.Orientations.Column,this)}).update({disabled:!Le||e}),Oe.getCommand("mergeVertical").updateCallback(function(){n(s.Orientations.Row,this)}).update({disabled:!Le}),Oe.getCommand("unmerge").updateCallback(function(){o(this)}).update({disabled:!t||!Le||e});const i={disabled:e};Oe.getCommand("hideRows").updateCallback(function(){K(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),Oe.getCommand("hideColumns").updateCallback(function(){K(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),Oe.getCommand("unhideRows").updateCallback(function(){K(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),Oe.getCommand("unhideColumns").updateCallback(function(){K(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),Oe.getCommand("autoFitRows").updateCallback(function(){K(this,e=>{e.getSelectedRanges().autoFit({orientations:s.Orientations.Row})})}).update(i),Oe.getCommand("autoFitColumns").updateCallback(function(){K(this,e=>{e.getSelectedRanges().autoFit({orientations:s.Orientations.Column})})}).update(i);let a=!1,d=0,c=!1,u=!1,g=0,h=!1;!q||e||Be||(a=q.isEntireColumnsAny(),a&&!q.isEntireColumns()?c=!0:d=q.getColumnCount(),u=q.isEntireRowsAny(),u&&!q.isEntireRows()?h=!0:g=q.getRowCount());const m={disabled:e||q&&1!==q.getCount()};Oe.getCommand("sortAscending").update(m),Oe.getCommand("sortDescending").update(m);const p={disabled:a||u||e||Be},v=a||e||Be||h;v&&(d=1);const w=u||e||Be||c;w&&(g=1);let y="",b="",C="",x="",S="",k="",R="",M="",T="";d>1&&(k=b=d+" ",R=C="s"),g>1&&(M=x=g+" ",T=S="s"),"copy"===P.getMode()?.key?(y=x=b="Copied ",C=S="s"):"cut"===P.getMode()?.key&&(y=x=b="Cut ",C=S="s");let D="",A="";if(q){const e=q.getDefaultShiftOrientation()===s.Orientation.Column;D=` (${e?"Shift Right":"Shift Down"})`,A=` (${e?"Shift Left":"Shift up"})`,Oe.getCommand("deleteCells").update({label:`Delete Cells${A}`})}Oe.getCommand("insertCells").update({label:`Insert ${y}Cells${D}`,scopedLabels:{insertCells:`${y}At Selection`}}),Oe.getCommand("insertCellsShiftRight").update(p),Oe.getCommand("insertCellsShiftDown").update(p),Oe.getCommand("deleteCellsShiftUp").update(p),Oe.getCommand("deleteCellsShiftLeft").update(p),Oe.getCommand("insertRows").update({label:`Insert ${x}Row${S}`,scopedLabels:{insertCells:`${x}Row${S}`},disabled:w}),Oe.getCommand("insertRowsAfter").update({label:`Insert ${x}Row${S} Below`,disabled:w}),Oe.getCommand("insertColumns").update({label:`Insert ${b}Column${C}`,scopedLabels:{insertCells:`${b}Column${C}`},disabled:v}),Oe.getCommand("insertColumnsAfter").update({label:`Insert ${b}Column${C} After`,disabled:v}),Oe.getCommand("deleteRows").update({label:`Delete ${M}Row${T}`,scopedLabels:{deleteCells:`${M}Row${T}`},disabled:w}),Oe.getCommand("deleteColumns").update({label:`Delete ${k}Column${R}`,scopedLabels:{deleteCells:`${k}Column${R}`},disabled:v})},[Fe,Le,Be,q,P,f,Ae]),le(()=>{const e=l.getProtection(),t=l.getProtection().isLocked(),n=!e.isFormatCellsAllowed(),o={disabled:n};Oe.getCommand("protectionSheetToggle").updateCallback(async(n,o)=>{let r=null;try{if(t){let t=null;if(e.hasPassword()){const e=await(f?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"}));if("Unprotect"!==e.option)return;t=e.input}r=await Promise.resolve(f?.showBusy?.(o.label())),await e.unlock(t)}else r=await Promise.resolve(f?.showBusy?.(o.label())),await e.lock();r?.()}catch(e){r?.(),f?.showError?.(e)}}).update({state:t,label:()=>t?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:t?"Unprotect":"Protect"}}),Oe.getCommand("deleteTable").update(o),Oe.getCommand("sortAscending").update(o),Oe.getCommand("sortDescending").update(o),Oe.getCommand("sortCustom")?.update(o),Oe.getCommand("updateComments").update(o),Oe.getCommand("deleteComments").update(o),Oe.getCommand("insertChart")?.update(o),Oe.getCommand("insertImageFromFile").update(o),Oe.getCommand("insertImageFromURL").update(o),Oe.getCommand("formatBorder").update(o),Oe.getCommand("formatFillColor").update(o),Oe.getCommand("formatFontColor").update(o),Oe.getCommand("formatBoldToggle").update(o),Oe.getCommand("formatItalicToggle").update(o),Oe.getCommand("formatUnderlinedToggle").update(o),Oe.getCommand("formatStrikeThroughToggle").update(o),Oe.getCommand("formatSuperscriptToggle").update(o),Oe.getCommand("formatSubscriptToggle").update(o),Oe.getCommand("formatAlignTopToggle").update(o),Oe.getCommand("formatTextOverflowVisibleToggle").update(o),Oe.getCommand("formatTextOverflowWrapToggle").update(o),Oe.getCommand("formatTextOverflowClipToggle").update(o),Oe.getCommand("formatTextOverflowShrinkToggle").update(o),Oe.getCommand("formatAlignMiddleToggle").update(o),Oe.getCommand("formatAlignBottomToggle").update(o),Oe.getCommand("formatAlignDistributedVerticalToggle").update(o),Oe.getCommand("formatAlignJustifyVerticalToggle").update(o),Oe.getCommand("formatAlignLeftToggle").update(o),Oe.getCommand("formatAlignCenterToggle").update(o),Oe.getCommand("formatAlignRightToggle").update(o),Oe.getCommand("formatAlignJustifyToggle").update(o),Oe.getCommand("formatAlignCenterContinuousToggle").update(o),Oe.getCommand("formatAlignDistributedHorizontalToggle").update(o),Oe.getCommand("formatAlignFillToggle").update(o),Oe.getCommand("formatFontSizeIncrease").update(o),Oe.getCommand("formatFontSizeDecrease").update(o),Oe.getCommand("formatFontFamily").update(o),Oe.getCommand("formatFontSize").update(o),Oe.getCommand("formatNumberFormat").update(o),Oe.getCommand("formatNumberFormatGeneralStyle").update(o),Oe.getCommand("formatNumberFormatNumberStyle").update(o),Oe.getCommand("formatNumberFormatTimeStyle").update(o),Oe.getCommand("formatNumberFormatDateStyle").update(o),Oe.getCommand("formatNumberFormatAccountingStyle").update(o),Oe.getCommand("formatNumberFormatPercentStyle").update(o),Oe.getCommand("formatNumberFormatScientificStyle").update(o),Oe.getCommand("formatNumberFormatCommaStyle").update(o),Oe.getCommand("formatNumberFormatIncreaseDecimal").update(o),Oe.getCommand("formatNumberFormatDecreaseDecimal").update(o),Oe.getCommand("hideColumns").update(o),Oe.getCommand("unhideColumns").update(o),Oe.getCommand("hideRows").update(o),Oe.getCommand("unhideRows").update(o),Oe.getCommand("quickFormulaSum").update(o),Oe.getCommand("quickFormulaAverage").update(o),Oe.getCommand("quickFormulaCount").update(o),Oe.getCommand("quickFormulaMax").update(o),Oe.getCommand("quickFormulaMin").update(o),Oe.getCommand("startEditCurrentTime").update(o),Oe.getCommand("startEditCurrentDate").update(o),Oe.getCommand("startEditValueAbove").update(o),Oe.getCommand("fillDown").update(o),Oe.getCommand("fillRight").update(o),Oe.getCommand("fillUp").update(o),Oe.getCommand("fillLeft").update(o),Oe.getCommand("formatCellStyle").update(o),Oe.getCommand("formatTableStyle").update(o),Oe.getCommand("formatPainterToggle").update(o),Oe.getCommand("formatBorderAddOutline").update(o),Oe.getCommand("formatBorderClearOutline").update(o),Oe.getCommand("formatIndentDecrease").update(o),Oe.getCommand("formatIndentIncrease").update(o),Oe.getCommand("clearContents").update(o),Oe.getCommand("clearFormats").update(o),Oe.getCommand("clearAll").update(o),Oe.getCommand("clearComments").update(o),Oe.getCommand("clearHyperlinks").update(o),Oe.getCommand("autoFilterClear").update(o),Oe.getCommand("autoFilterReapply").update(o);const i=_e===r.HorizontalAlignment.CenterContinuous||_e===r.HorizontalAlignment.Fill,a={disabled:n||i};Oe.getCommand("formatTextRotate0").update(a),Oe.getCommand("formatTextRotate45").update(a),Oe.getCommand("formatTextRotate90").update(a),Oe.getCommand("formatTextRotate270").update(a),Oe.getCommand("formatTextRotate315").update(a),Oe.getCommand("formatTextRotateCustom").update(a),Oe.getCommand("formatTextRotateVertical").update(a)},[Fe]),Oe}var vt,wt;!function(){if(wt)return vt;wt=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,l="object"==typeof Ge&&Ge&&Ge.Object===Object&&Ge,i="object"==typeof self&&self&&self.Object===Object&&self,a=l||i||Function("return this")(),s=Object.prototype.toString,d=Math.max,c=Math.min,u=function(){return a.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(l){if("number"==typeof l)return l;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(l))return NaN;if(g(l)){var i="function"==typeof l.valueOf?l.valueOf():l;l=g(i)?i+"":i}if("string"!=typeof l)return 0===l?l:+l;l=l.replace(e,"");var a=n.test(l);return a||o.test(l)?r(l.slice(2),a?2:8):t.test(l)?NaN:+l}vt=function(e,t,n){var o,r,l,i,a,s,m=0,p=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function w(t){var n=o,l=r;return o=r=void 0,m=t,i=e.apply(l,n)}function y(e){var n=e-s;return void 0===s||n>=t||n<0||f&&e-m>=l}function b(){var e=u();if(y(e))return q(e);a=setTimeout(b,function(e){var n=t-(e-s);return f?c(n,l-(e-m)):n}(e))}function q(e){return a=void 0,v&&o?w(e):(o=r=void 0,i)}function C(){var e=u(),n=y(e);if(o=arguments,r=this,s=e,n){if(void 0===a)return function(e){return m=e,a=setTimeout(b,t),p?w(e):i}(s);if(f)return a=setTimeout(b,t),w(s)}return void 0===a&&(a=setTimeout(b,t)),i}return t=h(t)||0,g(n)&&(p=!!n.leading,l=(f="maxWait"in n)?d(h(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==a&&clearTimeout(a),m=0,o=s=r=a=void 0},C.flush=function(){return void 0===a?i:q(u())},C}}();var yt,bt,qt={exports:{}},Ct={};bt||(bt=1,qt.exports=function(){if(yt)return Ct;yt=1;var e=Q,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,l=e.useDebugValue;function i(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),s=n({inst:{value:a,getSnapshot:t}}),d=s[0].inst,c=s[1];return r(function(){d.value=a,d.getSnapshot=t,i(d)&&c({inst:d})},[e,a,t]),o(function(){return i(d)&&c({inst:d}),e(function(){i(d)&&c({inst:d})})},[e]),l(a),a};return Ct.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:a,Ct}()),qt.exports;var xt,St,kt={exports:{}},Rt={exports:{}},Mt=Rt.exports;function Tt(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}!function(){if(St)return kt.exports;St=1;for(var e=(xt||(xt=1,function(){var e,t,n,o,r,l;"undefined"!=typeof performance&&null!==performance&&performance.now?Rt.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(Rt.exports=function(){return(e()-r)/1e6},t=process.hrtime,o=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),l=1e9*process.uptime(),r=o-l):Date.now?(Rt.exports=function(){return Date.now()-n},n=Date.now()):(Rt.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}.call(Mt)),Rt.exports),t="undefined"==typeof window?Ge:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],l=t["cancel"+o]||t["cancelRequest"+o],i=0;!r&&i<n.length;i++)r=t[n[i]+"Request"+o],l=t[n[i]+"Cancel"+o]||t[n[i]+"CancelRequest"+o];if(!r||!l){var a=0,s=0,d=[],c=1e3/60;r=function(t){if(0===d.length){var n=e(),o=Math.max(0,c-(n-a));a=o+n,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(a)}catch(e){setTimeout(function(){throw e},0)}},Math.round(o))}return d.push({handle:++s,callback:t,cancelled:!1}),s},l=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}kt.exports=function(e){return r.call(t,e)},kt.exports.cancel=function(){l.apply(t,arguments)},kt.exports.polyfill=function(e){e||(e=t),e.requestAnimationFrame=r,e.cancelAnimationFrame=l},kt.exports}();const Dt=ee(oe((e,t)=>{const{style:n=q.EmptyCssProperties,orientation:o,sheet:r,onShowTooltip:l,onCloseTooltip:i,onScrollOffset:a,showCustomScrollButtons:s=!1,offset:d=0,totalSize:c=0,viewportSize:u=0,...g}=e;if(!r)throw new Error("SheetScrollBar needs a sheet model");const[h]=Ye(),m=x(l,[l]),p=x(i,[i]),f=te(()=>null===v&&null===w?null:e=>{Tt(v,e),Tt(w,e)},[v=h,w=t]);var v,w;const[y,b]=ne(()=>{const e=r.getView().getTopLeft();return o===I.Vertical?e.top:e.left}),C=()=>{const e=r.getView().getFreezePanes();if(o===I.Vertical){if(0===e.coords.rowIndex)return{shift:0,scroll:0};return{shift:r.getRowHeaders().findOffset(e.coords.rowIndex)-e.topLeft.top,scroll:e.topLeft.top}}if(0===e.coords.colIndex)return{shift:0,scroll:0};return{shift:r.getColumnHeaders().findOffset(e.coords.colIndex)-e.topLeft.left,scroll:e.topLeft.left}},[S,k]=ne(C),[R,M]=ne(null),[T,D]=ne(!1),A=o===I.Vertical?r.getRowHeaders():r.getColumnHeaders(),E=()=>{const e=r.getUsedRange()?.getCoords()??J.EmptyRange,t=r.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[z,F]=ne(E),O=z?(o===I.Vertical?z.rowIndex:z.colIndex)+1:0,L=()=>{const e=E();J.isEqualCells(z,e)||F(e)};ht(r.getView(),{onFreezeSplitChange:()=>{k(C)}}),ht(r.getSelection(),{onChange:L}),ht(r,{onUsedRangeChange:L}),le(()=>{F(E())},[r]),le(()=>{if(!R)return T&&p?.(),void D(!1);const e=A.getTextAt(A.findIndex(y/(r.getView().getZoomScale()/100)+S.scroll+S.shift));D(!0),m?.({...R,display:(o===I.Vertical?"Row":"Column")+": "+e})},[d,y,S,o,R,A,T,r]);const V=x((e,t,n)=>{b(e);const o=e+S.scroll,r=t+S.shift,l=n+S.shift+S.scroll;a?.(o,r,l)},[a,S]),B=d-S.scroll,H=u-S.shift,P=c-(S.shift+S.scroll),W=A.findOffset(O)*(r.getView().getZoomScale()/100)-(S.scroll+S.shift);return _(N,{ref:f,style:n,offset:B,viewportSize:H,totalSize:P,orientation:o,showCustomScrollButtons:s,onMouseDown:e=>{M({anchor:{x:e.clientX,y:e.clientY}}),e.preventDefault()},onScrollOffset:V,onMouseOut:()=>{M(null)},onMouseUp:()=>{M(null)},minSize:W,...g})}));Dt.displayName="SheetScrollbar";const At=(e,t,n=null)=>{const o=[];for(let r=0;r<e.length;r++)if(e[r].value.isSelectedAll){if(e[r].min===e[r].max&&e[r].min===n)continue;o.push({address:{min:e[r].min,max:e[r].max},update:t})}return o},Et=ee(oe((e,t)=>{const{sheetHeader:n,gridRef:o,sheetElement:r,commands:l,oppositeSize:i=30,containerWidth:a,containerHeight:d,headerText:c,freezeStart:u,gridStyle:g,verticalPadding:h,horizontalPadding:m,onSheetContextMenu:p,onResizeHeadersStart:f,onResizeHeaders:v,onResizeHeadersEnd:w,onResizeHeadersDown:y,onResizeHeadersUp:b,scrollPoint:S,onSelectionStart:k,onSelectionEnd:R}=e,M=te(()=>n.getOrientation(),[n]),T=re(null),[D,E]=de(e=>e+1,0),[z,F]=de(e=>e+1,0),I=n?.getSheet(),N=re(!1);ie(()=>{N.current=!0},[n]);const L=te(()=>n.getEntireRange().getCoords().max+1,[n]),V=te(()=>{const e=M===s.Orientation.Column;return{left:e?S.left:0,top:e?0:S.top}},[S]),[B,H]=ne(I?.getView().getZoomScale()/100),[P,W]=ne(null);ht(n,{onSizesChange:e=>{H(I?.getView().getZoomScale()/100),me(ge())}});const $=ae(()=>{T.current?.invalidate(),F()},[]),U=ae(X.debounce(()=>{$()},10),[]),[j,G]=ne(null);ht(n.getSheet(),{onSelectionChange(){G(I?.getSelection().getCoords()),U()},onProtectionChange(){$()},onViewChange(){U()}}),ie(()=>{me(ge())},[M,B,i]),ie(()=>{W(null),H(n?.getSheet().getView().getZoomScale()/100),me(ge())},[n]);const Z=ae(e=>n.at(e)?.isHidden()||0===n.at(e)?.getSize(),[n]),Y=ae((e,t)=>n.hiddenHeadersAt(e,t),[Z]),K=x(e=>n.isSelected(e),[n]),J=x(e=>n.isSelectedAll(e),[n]),Q=ae(()=>n.getMinSize(),[n]),ee=ae(()=>n.getMaxSize(),[n]),oe=x((e,t,o)=>{t/=B;const r={size:t=Math.max(Q(),Math.min(X.roundAccurately(t,Q()),ee())),hidden:!1},l=[];if(t<=0&&(r.hidden=!0,r.size=o),l.push({address:{min:e,max:e},update:r}),t<0){const n=M===s.Orientation.Column,o=n?he.getColOffset:he.getRowOffset,r=n?he.getColIndex:he.getRowIndex,i=o(e);let a=r(i+t);const d=o(a);d===i+t?a--:l.push({address:{min:a,max:a},update:{size:i-d+t}}),e-a>1&&l.push({address:{min:a+1,max:e-1},update:{hidden:!0}})}n.updateHeaderPairs(l),v?.(e,t,o)},[D,n,B,v]),se=x((e,t,o)=>{const r=M===s.Orientation.Column;let l=null,i={min:e,max:e};if(n.isSelectedAll(e)){const a=n.getSelectedRuns();a.length>1?l="Resize "+(r?"Columns":"Rows"):i=a[0];const s={hidden:t<=0,size:(t<=0?o:t)/B};n.updateHeaderPairs(At(a,s,e))}if(i){const e=i.max-i.min+1;let t;t=1===e?n.getRange(i).at(0).getDisplayText():n.getRange(i).toString(),l=`Resize ${r?"Column":"Row"}${e>1?"s":""} '${t}'`}w?.(e,t,l)},[D,n,w]),ce=x((e,t)=>{const n=M===s.Orientation.Column;f(e,t,`Resize ${n?"Column":"Row"}(s)`)},[f]),ue=x(e=>{let t=!1;const o=M===s.Orientation.Column,r=n.getSheet().getEntireRange().getCoords(),l=[],i=n.getSelectedRuns(),a=e=>{let t;t=o?{colStart:e.min,rowStart:r.rowStart,colEnd:e.max,rowEnd:r.rowEnd}:{colStart:r.colStart,rowStart:e.min,colEnd:r.colEnd,rowEnd:e.max},l.push(t)};for(let n=0;n<i.length;n++){const o=i[n];o.value.isSelectedAll&&(o.min<=e&&o.max>=e&&(t=!0),a(o))}t||a({min:e,max:e}),n.getSheet().getRanges(l).autoFit({orientations:o?s.Orientations.Column:s.Orientations.Row});if(Z(e)){const o={hidden:null},r=At(i,o);t||r.push({address:e,update:o}),n.updateHeaderPairs(r)}w?.(e,null,"Resize Column(s)")},[D,n,w,Z]),ge=()=>{const e=M===s.Orientation.Column;return{getColOffset:t=>e?n.findOffset(t):0===t?0:i/B,getColIndex:t=>e?n.findIndex(t):0,getRowOffset:t=>e?0===t?0:i/B:n.findOffset(t),getRowIndex:t=>e?0:n.findIndex(t)}},[he,me]=ne(()=>ge()),pe=ae((e,t)=>!(e.nativeEvent.which===O.Right)||!J(M===s.Orientation.Column?t.colIndex:t.rowIndex),[M,J]),fe=x(e=>{r.focusSheet()},[r]),xe=x(e=>{I?.getSelection().updateCoords(e)},[I]),{...Se}=ve({gridRef:o,commands:null,layout:he,selection:j,fillHandleBorderColor:g.body.fill,selectionBackgroundColor:g.selection.fill,selectionBorderColor:g.selection.strokeFill,selectionRemoveBackgroundColor:g.selectionRemove.fill,selectionRemoveBorderColor:g.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:xe,canSelectionSpanMergedCells:e=>{const t=I.getRange(e);return t.isEntireColumns()||t.isEntireRows()}}),ke=x(()=>{k?.();const e=I?.getSelection();e&&e.setAdjusting(e.getCoords())},[I,k]),Re=x(async()=>{I?.getSelection().setAdjusting(null),R?.()},[I,R]),{...Me}=we({orientation:M,headerCount:L,gridRef:T,gridMainRef:o,newSelection:Se?.newSelection,modifySelection:Se?.modifySelection,appendSelection:Se?.appendSelection,clearSelections:Se?.clearSelections,pointerDownInterceptor:pe,onPointerUp:fe,onDragStart:ke,onDragEnd:Re}),Te=g.selection?.strokeFill;le(()=>{if(!T.current)return void W(null);const e=M===s.Orientation.Column,t=n.getSelectedRuns(),o=n.isProtected()?null:oe,r=(t,n,o)=>{if(o)return _("div",e?{style:{position:"absolute",borderBottom:`${g.headerSelection.strokeWidth}px solid ${Te}`,pointerEvents:"none",top:`${q.boundPixel(-g.headerSelection.strokeWidth/2)}px`,left:`${q.boundPixel(o.x-g.headerSelection.strokeWidth)}px`,width:`${q.boundPixel(o.width+g.headerSelection.strokeWidth+1,!0)}px`,height:i+g.headerSelection.strokeWidth-.5+"px"}}:{style:{position:"absolute",borderRight:`${g.headerSelection.strokeWidth}px solid ${Te}`,pointerEvents:"none",top:`${q.boundPixel(o.y-g.headerSelection.strokeWidth)}px`,left:`${q.boundPixel(-g.headerSelection.strokeWidth/2)}px`,width:i+g.headerSelection.strokeWidth-.5+"px",height:`${q.boundPixel(o.height+g.headerSelection.strokeWidth+1,!0)}px`}},t)},l=(t,n,o)=>{const r={x:0,y:0,width:0,height:0};if(e){const e=o.toClipBounds(o.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:t,colEnd:Math.min(L,n)}),Ce);if(!e)return;r.x=e.x,r.width=e.width}else{const e=o.toClipBounds(o.getRangeCoordsBounds({rowStart:t,rowEnd:Math.min(L,n),colStart:0,colEnd:0}),Ce);if(!e)return;r.y=e.y,r.height=e.height}return{x:r.x,y:r.y,width:r.width,height:r.height}};W([r=>{const l=[];let i=null,a=e?r.getVisibleColumns():r.getVisibleRows();const s=e?r.getTotalRangeCoords().colStart:r.getTotalRangeCoords().rowStart;a.length>0&&a[0]>s&&(a=[a[0]-1,...a]);let d=[];const c=[];for(let e=0;e<a.length;e++){const n=a[e],r=e<a.length-1?a[e+1]:n+Y(n+1,!1)+1,l=n+1!==r;if(!i||i.max<n)if(t.length>0&&t[t.length-1].max>=n){const e=X.findEqualOrGreater(t,n,e=>e.max);i=t[e]}else i=null;let u=!1,g=!1;if(i?.value&&(i.min<=n||i.min<=r&&!l)&&(u=!0,g=i.value.isSelectedAll),n===s){let e=!1,t=!1;i?.value&&i.min<=n&&(e=!0,t=i.value.isSelectedAll),n>0&&c.push({index:n-1,isNextHidden:l,isSelected:e,isSelectedAll:t,disabledResize:!0})}if(g&&d.push(c.length),c.push({index:n,isHidden:0===e&&Y(n,!1)>0,isNextHidden:l,isSelected:u,isSelectedAll:g,onDividerMouseDown:y,onDividerResizeStart:ce,onDividerResize:o,onDividerMouseUp:b,onDividerResizeEnd:se,onDividerAutoFit:ue}),l){let e=!1,l=!1;if(i&&i.min>=n&&i.max<=r-1&&i.value.isSelectedAll&&d.push(c.length),i?.value&&i.max>=r);else if(t.length>0&&t[t.length-1].max>=r){const e=X.findEqualOrGreater(t,r,e=>e.max);i=t[e]}else i=null;i?.value&&i.min<=r&&(e=i.value.isSelected,l=i.value.isSelectedAll),r>0&&c.push({index:r-1,isHidden:!0,isSelected:e,isSelectedAll:l,onDividerMouseDown:y,onDividerResizeStart:ce,onDividerResize:o,onDividerMouseUp:b,onDividerResizeEnd:se,onDividerAutoFit:ue})}}if(d.length>0){let n=d.length-1;if(d.length>0){const t=c[d[n]].index;let o=null;e?(o=r.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:t,colEnd:t}),o.x+o.width>r.getBounds().width&&(n-=1,0===n&&(n=-1))):(o=r.getRangeCoordsBounds({rowStart:t,rowEnd:t,colStart:0,colEnd:0}),o.y+o.height>r.getBounds().height&&(n-=1,0===n&&(n=-1)))}const o=t?.[t.length-1],l=r.getAnchor();if("t"===l||"l"===l){const e=c[d[Math.max(0,d.length-1)]];e.showTouchDivider=o&&o.max<=e.index}else n>=0&&(c[d[n]].showTouchDivider=!0)}const{header:u,headerSelect:h,headerSelectAll:m,headerHover:p}=g??{};for(let e=0;e<c.length;e++)l.push(_(qe,{orientation:M,view:r,headerStyle:u,headerStyleSelect:h,headerStyleSelectAll:m,headerStyleHover:p,disabled:n.isProtected(),...c[e]},`divider${e}`));return l},e=>{const n=[];for(let o=0;t&&o<t.length;o++)n.push(r(`selection:${e.getAnchor()}:${o}`,0,l(t[o].min,t[o].max,e)));return n}])},[z,!0,Te,g,he,L,u,D,B]),le(()=>{T.current?.invalidate()},[D]);const De=x(e=>c?c(e):n.getTextAt(e),[c,n]),Ae=x(e=>{const{header:t,headerSelect:n,headerSelectAll:o,headerHover:r}=g??{},{range:l,key:i,...a}=e;return _(ye,{orientation:M,index:M===s.Orientation.Column?l.colStart:l.rowStart,isSelected:K,isSelectedAll:J,zoomScale:100*B,headerText:De,headerStyle:t,headerStyleSelect:n,headerStyleSelectAll:o,headerStyleHover:r,verticalPadding:h,horizontalPadding:m,...a},i)},[D,L,g,B,n]),Ee=A(),ze=te(()=>{const e="white",t="black",n={};if("touch"!==q.detectIt().primaryInput){let o=M===s.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='${t}' fill='${e}'/%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='${t}' fill='${e}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;const r=Ee.getMode();if("formatPainter"===r?.key){const n=30,r=22;o=`url("data:image/svg+xml,%3Csvg width='${n}' height='${r}' viewBox='0 0 ${n} ${r}' 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='${t}' fill='${e}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}n.cursor=o}return n.backgroundColor=g?.header?.fill||"transparent",n},[M,D,Ee,g]),Fe=C(t,()=>({scrollTo:e=>{T.current?.scrollTo(e)},forceRender:()=>{E()},getGridElement:()=>T.current}),[]),Ie=ae(e=>{Me.onPointerDown(e)},[Me]),Ne=ae(e=>{const t=Me.getCellCoordsFromClient(e.clientX,e.clientY);if(!t)return;if(!p)return;const n=M===s.Orientation.Column;p({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:n?-1:t.rowIndex,colIndex:n?t.colIndex:-1}),e.stopPropagation(),e.preventDefault()},[Me,p]),Oe=te(()=>{const e=M===s.Orientation.Column;return _("div",{ref:Fe,children:_(be,{className:"sheet-header",style:ze,ref:T,scrollPoint:V,columnCount:e?L:1,rowCount:e?1:L,width:e?a:i,height:e?i:d,freezeLeft:e?u:void 0,freezeTop:e?void 0:u,hiddenColumnsAt:e?Y:void 0,hiddenRowsAt:e?void 0:Y,showGridLines:!1,layout:he,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:Ne,onPointerDown:Ie,zoom:B,cellRenderer:Ae,overlays:P})})},[P,he,a,d,V,ze,z]);return le(()=>{N.current=!1,T.current?.invalidate(),F()},[n,g]),Oe})),zt=ee(oe((e,t)=>{const{view:n,sheet:o,getVisibleCells:r,gridStyle:l}=e,i=x((e,t)=>e.getStyle().getBorder(),[]),{overlay:a}=et({getVisibleCells:r,getBorderAt:i,darkMode:l.body.darkMode,shiftIfWide:!0}),s=a(n);return s&&n?s:null})),Ft={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},It={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Nt={type:n.Content.Values},Ot={fitDestination:!0,type:n.Content.Formats},Lt={fitDestination:!0,type:n.Content.Formulas},Vt={transpose:!0},Bt={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},Ht=({element:e,sheet:t,sheetView:o,commands:r,onClipboardUpdate:l,onPaste:i,selectionRenderer:a=xe,copyForegroundColor:d="rgb(33, 115, 70)",cutForegroundColor:c="rgb(33, 115, 70)",copyBackgroundColor:u="white",cutBackgroundColor:g="white",notifier:h,...m})=>{const v=x(a,[a]),w=re(null),y=A(),b=y.getMode(),q=te(()=>({element:e,doCopy:e=>{const n=t.getSelectedRanges().getSnapshot(e);return new p(n)}}),[t,o,e]),C=te(()=>({element:e,importFromExternal:async(e,n)=>{const o=new f(e,n,t.getStyles(),t.isDate1904());return await o.parse()?o:null},doPaste:async(e,o)=>{if("range"!==e?.getItemType())return;o?.contentsOnly&&delete(o={...o,type:n.Content.Values}).contentsOnly;const r=t.getSelectedRange(),l=e.getItem(),i=l.getName();return await r.doBatch(async()=>{const e=await r.copyFrom(l,o);!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({orientations:s.Orientations.Row,minContent:!0})},{description:"Paste"+(i?` ${i}`:""),autoSelect:!0}),!0}}),[t,o,h,e]),{clipboard:S,...k}=D({...m,source:q,commands:r,target:C,notifier:h,onClipboardUpdate:e=>{const t="range"===e?.getItemType()?e:null;if(t){const t=e.editMode?.(),n={...e?.isCut?.()?It:Ft,...t,args:{isClipboard:!0,...t?.args},onModeChange:e=>{e?.args?.isClipboard||S.clear(!0),t?.onModeChange?.(e)}};y.setMode(n)}w.current=t,l?.(t)},onPaste:(n,o)=>{if("range"!==n?.getItemType())return;let r="cut"===y.getMode()?.key||n.isCut?.();if(!r&&"copy"===y.getMode()?.key){const e=n.getItem().getCoords(),o=t.getSelectedRanges().getCoords();let l=!1;if(!l&&e&&o&&n.getItem().getSource?.()===t)for(let t=0;!l&&t<o.length;t++)l=J.isRangesIntersect(e,o[t]);r=l}r&&y.setMode(null),e?.()?.focus(),i?.(n,o)}});te(()=>{const t=e;if(!r)return;const n=[new R("pasteValues",t,{label:"Paste Values",scopedLabels:{paste:"Values"},description:"Paste only the values of the selected cells.\n\nThe formatting is not applied.",shortcut:{key:"V",modifiers:[M.Ctrl,M.Shift]}}),new R("pasteFormats",t,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:"Paste only the formats of the selected cells.\n\nThe content is not applied."}),new R("pasteFormulas",t,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new R("pasteTranspose",t,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new R("pasteLinks",t,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];r.addCommands(n,!0)},[r,e]),le(()=>{if(!r)return;const e={disabled:!t.getProtection().isFormatCellsAllowed()};r.getCommand("pasteValues").updateCallback(e=>k.paste({...Nt,...e})).update(e),r.getCommand("pasteFormats").updateCallback((e,t)=>k.paste({...Ot,description:t.label(),...e})).update(e),r.getCommand("pasteFormulas").updateCallback((e,t)=>k.paste({...Lt,description:t.label(),...e})).update(e),r.getCommand("pasteTranspose").updateCallback((e,t)=>k.paste({...Vt,description:t.label(),...e})).update(e),r.getCommand("pasteLinks").updateCallback((e,t)=>k.paste({...Bt,description:t.label(),...e})).update(e),r.getCommand("cut").update(e),r.getCommand("paste").update(e)},[t,r]);const T=te(()=>{if(!b||!w.current)return;const e=b.key;if("copy"!==e&&"cut"!==e&&"formatPainter"!==e)return;const n=w.current.getItem();if(n.getSource()!==t)return;const o=w.current.isCut?.(),r=o?g:u,l=o?c:d,i=n.getCoords(),a=i?[i]:null;return a&&0!==a.length?e=>{const t=[];for(let n=0;n<a.length;n++){const o=a[n],i=e.toClipBounds(e.getRangeCoordsBounds(o,{top:0,left:0,right:1,bottom:1}),Ce);i&&(t.push(v({range:o,key:`copy-selection-background-${n}`,x:i.x,y:i.y,width:Math.max(i.width,0),height:Math.max(i.height,0),stroke:r,strokeWidth:2})),t.push(v({range:o,key:`copy-selection-foreground-${n}`,x:i.x+(i.width<=2?-1:0),y:i.y,width:Math.max(i.width,3),height:Math.max(i.height,3),stroke:l,strokeWidth:2,isAnimatedStroke:!0})))}return t}:null},[b,t,o,d,u,c,g]);return{...k,clipboard:S,overlays:T}},Pt=ee(oe((e,t)=>{const{view:n,element:o,sheet:r,gridStyle:l,commands:i,notifier:a}=e,s=l.body??{},d=r.getView(),{overlays:c}=Ht({element:o,sheet:r,sheetView:d,commands:i,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:s.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:s.fill,notifier:a});return ht(r?.getSelection(),{onChange(e){}}),le(()=>{n?.getStage()},[n?.getStage()]),c&&n?c(n):null})),Wt="_sheet-selection_12wyx_5",$t={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ut={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},jt={key:"dragCopy",description:"Drag selection to copy cell contents."},_t={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Gt=(e,t)=>t.ctrlKey&&t.shiftKey?_t:t.ctrlKey?jt:t.shiftKey?Ut:$t,Zt={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Xt=ee(oe((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:l,notifier:i,onShowTooltip:a,onCloseTooltip:d,sheet:c,gridRef:u,gridStyle:g,isActive:h,editingCoords:m,...p}=e,f=n?.getBounds(),v=x(a,[a]),w=x(d,[d]),[y,b]=ne(()=>c?.getSelection().getCoords()),S=x(e=>{J.isEqualSelectionCoords(e,y)||c&&c.getSelection().updateCoords(e)},[c,y]),k=A(),R=re(null),[M,T]=ne(c?.getProtection().isLocked()),[D,E]=ne(c?.getView().getMovableSelection().length>0),z="touch"===q.detectIt().primaryInput,F=!z&&h,I=null!==m||D,N=x(e=>{const t=J.cellToRange(e);if(c.isClosed())return t;const n=c.getRange(t,{excludeHidden:!0}).getMerges();return 0===n.length?t:n[0]},[c]),O=x((e,t,n,o,r,l)=>{const i=c.getSelectedRange().getExtended(o,e).getCoords();switch(o){case s.Direction.Up:return i.rowStart;case s.Direction.Down:return i.rowEnd;case s.Direction.Left:return i.colStart;case s.Direction.Right:return i.colEnd}},[c]),V=x(()=>{const e=c.getUsedRange()?.getCoords(),t=c.getRowHeaders().getUsedRange()?.getCoords(),n=c.getColumnHeaders().getUsedRange()?.getCoords();return{...e,colEnd:Math.max(e?.colEnd??0,n?.max??0),rowEnd:Math.max(e?.rowEnd??0,t?.max??0)}},[c]),B=x((e,t)=>c.getRowHeaders().hiddenHeadersAt(e,t),[c]),H=x((e,t)=>c.getColumnHeaders().hiddenHeadersAt(e,t),[c]),P=x(e=>c.getRange(e,{excludeHidden:!0}).getMerges(),[c]),W=x(e=>{c?.getSelection().setAdjusting(e)},[c]),$=x(async()=>{c?.getSelection().setAdjusting(null);const e=k.getMode();"formatPainter"===e?.key&&(await(o?.getCommand("pasteFormats")?.execute({})),k.setMode(null))},[k,y,c,o]),U=te(()=>{const e=k.getMode();return"cut"===e?.key||"copy"===e?.key},[k]);ht(c?.getView(),{onMovableSelectionChange:()=>{E(c.getView().getMovableSelection().length>0)}}),ht(c?.getSelection(),{onChange(e){const t=c.getSelection().getCoords();b(t)}}),ht(c,{onProtectionChange:()=>{T(c.getProtection().isLocked())}});const{body:j={}}=g||{},G=n.getLayout(),Z=!(F&&y.ranges.length<=1&&null===m&&!M&&(!k.getMode()||U)),{cursor:X,overlay:Y,onPointerDown:K}=ve({gridRef:u,commands:o,layout:G,getCellCoordsAsRangeCoords:N,selection:y,fillHandleBorderColor:j.fill,selectionBackgroundColor:h?g.selection.fill:g.selectionInactive.fill,selectionBorderColor:h?g.selection.strokeFill:g.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?g.selectionRemove.fill:g.selectionInactive.fill,selectionRemoveBorderColor:h?g.selectionRemove.strokeFill:g.selectionInactive.strokeFill,disableFillDrag:Z,disableMoveDrag:z||!(h&&y.ranges.length<=1&&null===m&&!M),disableTouchSelection:I,onSelectionChange:S,onSelectionDragStart:W,onSelectionDragEnd:$,onMoveDragStart:(e,t,n)=>{k.setMode(Gt(0,n))},onMoveDragUpdate:(e,t,n)=>{k.setMode(Gt(0,n))},onMoveDragEnd:(e,t)=>{k.setMode(null)},onMoveDragDone:async(e,t,n)=>{if(J.isEqualRanges(e,t))return;const o=c.getRange(t);if(i?.showOptions){const t=o.getDifferences(e);let n=!1;for(let e=0;!n&&e<t.getCount();e++)n=t.at(e).isContentful();if(n){if("Replace"!==await(i?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})))return}}const r=!n.ctrlKey,l=n.shiftKey,a=l?r?"Insert Moved Cells":"Insert Copied Cells":r?"Move Cells":"Copy Cells",d=await(i?.showBusy?.(a));try{const t=c.getRange(e);await o.doBatch(async()=>{l?await o.insertFrom(e,{isCut:r,undoRange:t}):await o.copyFrom(e,{isCut:r,undoRange:t}),t.autoFit({skipCustomSize:!0,orientations:s.Orientations.Row,minContent:!0}),o.autoFit({skipCustomSize:!0,orientations:s.Orientations.Row,minContent:!0})},{description:a,autoSelect:!0})}catch(e){i?.showError?.(e)}finally{d?.()}},contentfulCellFinder:O,hiddenRowsAt:B,hiddenColumnsAt:H,mergedRanges:P,getDataCoords:V,canSelectionSpanMergedCells:e=>{const t=c.getRange(e);return t.isEntireColumns()||t.isEntireRows()},onFill:async(e,t)=>{const n="Auto Fill",o=await(i?.showBusy?.(n));try{await c.doBatch(()=>{c.getRange(e).autoFill(t),c.getRange(t).autoFit({orientations:s.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:n,autoSelect:!0})}catch(e){i?.showError?.(e)}finally{R.current=null,o?.()}},onFillPreview:(e,t,o)=>{if(u.current&&v){k.setMode(Zt);try{R.current?.direction!==o&&(R.current=null,c.getRange(e).autoFill(t,{previewOnly:e=>{R.current={callback:e,direction:o}}}));const r=R.current?.callback?.(t);if(!r||r.isEmpty())return;const l=r.toText();if(!l)return;const i=J.cellToRange(r.getCoords()),a=n.getRelativePointFromClient(0,0);let d=0,u=0,g=L.Bottom;if(o===s.Direction.Down){d=G.getColOffset(i.colEnd+1)-a.x;const e=G.getRowOffset(i.rowEnd),t=G.getRowOffset(i.rowEnd+1);u=t-(t-e)/2-a.y,g=L.Right}else if(o===s.Direction.Right){u=G.getRowOffset(i.rowEnd+1)-a.y;const e=G.getColOffset(i.colEnd),t=G.getColOffset(i.colEnd+1);d=t-(t-e)/2-a.x,g=L.Bottom}else if(o===s.Direction.Up){d=G.getColOffset(i.colEnd+1)-a.x;const e=G.getRowOffset(i.rowStart),t=G.getRowOffset(i.rowStart+1);u=t-(t-e)/2-a.y,g=L.Right}else if(o===s.Direction.Left){u=G.getRowOffset(i.rowEnd+1)-a.y;const e=G.getColOffset(i.colStart),t=G.getColOffset(i.colStart+1);d=t-(t-e)/2-a.x,g=L.Bottom}v({anchor:{x:d,y:u},display:l,placement:g})}catch(e){i?.showError?.(e)}}},onFillDone:()=>{R.current=null,k.setMode(null),w?.()}}),Q=x(e=>{K(q.createSyntheticEvent(e))},[K,m]);le(()=>{const e=n?.getStage();if(e)return e.addEventListener("pointerdown",Q),()=>{e.removeEventListener("pointerdown",Q)}},[n?.getStage()]);const ee=C(t,()=>({}),[]),oe=re(null);return _("div",{className:st(r,"sheet-selection",Wt),style:{position:"absolute",width:f?.width,height:f?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Ue([ee,oe]),...p,children:Y(n)})})),Yt=Object.freeze({x:0,y:0,width:0,height:0}),Kt={fireOnModelChange:!1},Jt=ee(oe((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:l,onRefUnload:i,onHide:a,onShow:s,onUnFocus:d,isDragging:c,updateFrameBounds:u,dragStart:g,style:h,disabled:m,renderMovable:p,...f}=e,[v,w]=ne(Yt),[y,b]=ne(null),[q,C]=ne(!1),x=re(null);ie(()=>{if(r.isClosed())return;const e=r.getBounds();if(!e)return;const t=o.toViewBounds(e);w(t??Yt),u(t??Yt)},[o?.getBounds()]),ht(r,{onBoundsChange:e=>{const t=e.getBounds();if(!t)return;const n=o.toViewBounds(t);w(n??Yt),u(n)},onSelectionChange:()=>{const e=X.hasFocus(x.current,!0);!q&&!e||r.isSelected()||d()}}),ht(r,{onRequestFocus:()=>X.whenFocus(x.current,!0)},Kt),le(()=>{const e=x.current;return l(e),()=>{i(e)}},[]);const S=te(()=>{if(!v)return null;let{width:e,height:t}=v;return p({view:o,movable:r,disabled:m,isDragging:c,style:{position:"relative",left:0,top:0,width:e,height:t},onHide:a,onShow:s})},[o,r,v.width,v.height,m,c]);return _("div",{className:"movable",tabIndex:0,ref:Ue([x,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:v.x,top:v.y,width:v.width,height:v.height,...h},onMouseDown:async e=>{const t=e.shiftKey||e.ctrlKey,n=r.isSelected(),o=e.currentTarget;t&&n?r.unselect():(n&&!t||await r.select({addToSelection:t}),g(e.nativeEvent,o),o.focus())},onFocus:e=>{e.relatedTarget&&!y&&b(e.relatedTarget),C(!0)},onBlur:e=>{y&&!x?.current?.contains(e.relatedTarget)&&b(null),e.relatedTarget&&C(!1)},...f,children:S})})),Qt="_movable-area_314c6_5",en=ee(oe((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:l,transactional:i,onUnFocus:a,onFocus:s,disabled:d=!1,disableDrag:c=!1,disableResize:u=!1,className:g,style:h,renderDirections:m=["nw","n","ne","w","e","sw","s","se"],onFirstRender:p,...f}=e,w=n.getBounds(),y=x(p,[p]),b=x(a,[a]),q=x(s,[s]),[k,R]=ne([]),[M,T]=ne(!1),[D,A]=ne(!1),E=re(!0),z=re(new Map),F=re(new Map),I=re(new Map),N=re(new Map),O=re(new Map),L=re({onRequestFocus:e=>(ue(e),null)}),V=re(null),B=re(null),H=re(null),[P,W]=de(e=>e+1,0);ie(()=>{W()},[n,o]),ht(o,{onCollectionChange:()=>{const e=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),t=O.current;t.forEach(e=>{e()}),t.clear();const r=L.current;for(let n=0;n<e.length;n++){const o=e[n];if(o.isClosed())continue;const l=o.addListeners(r);t.set(o,l)}W()},onInvalidated:()=>{W()}}),ht(r,{onMovableSelectionChange(e){U(),W()}});const $=ae((e,t)=>{const n=I.current.get(e);H.current&&(H.current.getTargets().forEach(e=>{if(e===n)return e.style.left=t.x+"px",e.style.top=t.y+"px",e.style.width=t.width+"px",void(e.style.height=t.height+"px")}),H.current.updateRect())},[]),U=()=>{const e=[],t=r.getMovableSelection();t.forEach(n=>{const o=I.current.get(n);if(!o)return;-1!==t.indexOf(n)&&e.push(o)}),R(t=>X.isEqualArrays(t,e)?t:e)},j=re(null),Z=te(()=>new Promise(e=>{j.current=e}),[]),Y=re(null),K=x(async(e,t)=>{Y.current=t;await(async()=>!(!await Z.then()||!H.current))()&&Y.current===t&&H.current.dragStart(e,t)},[k]),[J,ee]=ne(!1),oe=re(null),se=re(null),ue=x(async(e=null)=>{if(e||(e=r.getMovableSelection()[0]),!e)return b?.(),!1;const t=I.current.get(e);t?(await X.whenFocus(t),t.focus(),se.current=t,oe.current=null):oe.current=e},[r]);le(()=>{J&&k.length>0&&se.current!==k[0]&&ue(),E.current&&(y?.(),E.current=!1)},[k]);const ge=te(()=>{const e=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(0===e.length&&0===z.current.size)return null;const t=(t,o,r,i=!0)=>{const a=t.isSelected(),s={tabIndex:r,view:n,movable:t,onRefLoad:e=>{oe.current===t&&(e.focus(),se.current=e,oe.current=null),I.current.set(t,e),F.current.set(e,t),o.rendered=!0,U()},onRefUnload:e=>{I.current.delete(t),F.current.delete(e),o.rendered=!1,U()},onUnFocus:b,onHide:e=>{o.onHide=e},onShow:e=>{o.onShow=e},isDragging:a&&(D||M),disabled:d,renderMovable:l,updateFrameBounds:e=>{$(t,e)},dragStart:K,onMouseUp:()=>{if(Y.current=null,B.current){T(!1),A(!1);let e=!1;N.current?.forEach(t=>{X.isEqualBounds(t.movable.getBounds(),t.startBounds)||(e=!0)}),e?me():pe()}},style:{opacity:i?M&&a?.7:void 0:0,zIndex:M&&a?t.getZIndex()+e.length:void 0,pointerEvents:i?void 0:"none",cursor:D&&a?"grabbing":d||c?"initial":"move",boxShadow:!a||D&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return _(Jt,{...s},`movable-${t.getUUID()}`)},i=z.current,a=new Map,s=[];for(let n=0;n<e.length;n++){const o=e[n];if(o.isClosed())continue;let r=i.get(o);r||(r={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;const n=++t.visibilityRequestId;requestAnimationFrame(()=>{const o=z.current.get(e);o&&n===t.visibilityRequestId&&(t.onShow?.(e),o.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;const n=++t.visibilityRequestId,o=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==o&&(t.shown=!1,z.current.delete(e),W())},visibilityRequestId:0}),r.frame=t(o,r,n,!0),s.push(r.frame),r.doShow(o,r),i.delete(o),a.set(o,r)}const u=[];return r.getMovableSelection().forEach(e=>{const n=i.get(e);n&&(n.frame=t(e,n,-1,!1),u.push(n.frame),i.delete(e),a.set(e,n))}),i.forEach((e,n)=>{e.frame=t(n,e,-1,!1),u.push(e.frame),e.doHide(n,e),i.delete(n),a.set(n,e)}),z.current=a,U(),[...u,...s]},[P,n,l,d,c,u,M,D]),he=x((e,t)=>{const o=`${t} ${1===k.length?v.capitalize(F.current?.get(k[0]).getContent().getType()):"Drawings"}`;B.current&&(console.warn(`Transaction ${B.current.getDescription()} is being replaced by ${o}`),B.current.rollback(),B.current=null),B.current=i.beginCommit({description:o}),N.current.clear();for(let e=0;e<k.length;e++){const t=k[e],o=F.current?.get(t);o?N.current.set(t,{movable:o,startBounds:n.toViewBounds(o.getBounds())}):console.warn("invalid element",o)}},[i,n,k]),me=ae(()=>{if(!B.current)return;const e=[];N.current?.forEach(t=>{e.push(t.movable)}),B.current.commit({viewAfter:{view:r,movableSelection:e}}),N.current.clear(),B.current=null},[]),pe=ae(()=>{B.current&&(B.current.rollback(),B.current=null)},[]),fe=re(null);le(()=>{fe.current&&(fe.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[fe.current]);const ve=C(t,()=>({isMovableArea:()=>!0,focusMovable:ue,focus:()=>{ue()}}),[r]),[we,ye]=ne(null),be=re(!1),qe=re(!1),Ce=re(!1);le(()=>{if(d||0===k.length)return;if(Ce.current)return;if(be.current)return;if(qe.current)return void requestAnimationFrame(()=>{H.current&&V.current&&H.current.refTargets.length>0&&(Ce.current=!0,j.current?.(!0)),R([...k])});be.current=!0;const e=Q.lazy(async()=>{try{const e=await import("./aD5wMdElQe_6jVAV.mjs");return be.current=!1,qe.current=!0,R([...k]),e}catch(e){return console.warn(e),j.current?.(!1),null}});ye(e)},[k,d,c,u]);const xe=te(()=>!we||d?null:_(ce,{children:_(we,{className:st({dragging:M||D,resizing:M,moving:D}),container:null,ref:H,target:H.current?k:[],draggable:!d&&!c,resizable:!d&&!u,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:m,onResizeStart:e=>{he(e.target,"Resize")},onResize:e=>{if(!B.current)return e.stopDrag(),void W();T(!0);const t=0!==e.direction[0]&&0!==e.direction[1];let o=0,r=0;for(let l=0;l<k.length;l++){const i=k[l],a=N.current.get(i),s=F.current.get(i);if(!a||!s){console.warn("invalid element");continue}let d=e.dist[0],c=e.dist[1],u=e.drag.dist[0],g=e.drag.dist[1],h=a.startBounds.width,m=a.startBounds.height;0===l?(o=h,r=m):(d*=h/o,u*=h/o,c*=m/r,g*=m/r);const p={...a.startBounds};if(p.width=Math.max(0,h+d),p.height=Math.max(0,m+c),-1===e.direction[0]&&(p.width=Math.max(0,Math.min(a.startBounds.x+h,h-u))),-1===e.direction[1]&&(p.height=Math.max(0,Math.min(a.startBounds.y+m,m-g))),t&&(s.isLockAspectRatio()||e.inputEvent?.shiftKey)){const e=h/m,t=p.width/p.height;t>e?p.height=p.width/e:t<e&&(p.width=p.height*e)}-1===e.direction[0]&&(p.x=Math.max(0,Math.min(a.startBounds.x+h,a.startBounds.x+h-p.width))),-1===e.direction[1]&&(p.y=Math.min(a.startBounds.y+m,a.startBounds.y+m-p.height)),a.movable.setBounds(n.toAbsoluteBounds(p))}},onResizeEnd:e=>{T(!1),me()},onDragStart:e=>{he(e.target,"Move")},onDrag:e=>{if(!B.current)return e.stopDrag(),void W();A(!0);for(let t=0;t<k.length;t++){const o=k[t],r=N.current.get(o);r?r.movable.setBounds(n.toAbsoluteBounds({...r.startBounds,x:r.startBounds.x+e.translate[0],y:r.startBounds.y+e.translate[1]})):console.warn("invalid element")}},onDragEnd:e=>{},onMouseUp:e=>{}})}),[P,we,k,n,d,c,u,M,D]);return _("div",{className:st(g,"movable-area",Qt),style:{width:w.width,height:w.height,...h,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Ue([ve,fe]),...f,children:_("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:w.width,height:w.height},...f,children:G("div",{ref:V,style:{position:"absolute",pointerEvents:"auto"},onFocus:e=>{q?.(),ee(!0)},onBlur:e=>{ee(!1)},onKeyDownCapture:e=>{if(e.isDefaultPrevented())return;const t=e.nativeEvent.ctrlKey,n=e.nativeEvent.altKey,l=e.nativeEvent.shiftKey;if(e.which===S.Escape){const t=r.getMovableSelection();let n=[...t];return k.forEach(e=>{if(0===n.length)return;const t=F.current.get(e);let o=n.indexOf(t);n.splice(o,1)}),n.length!==t.length&&r.selectMovables(n),0===n.length&&b?.(),void e.preventDefault()}const i=.1,a=e=>{o.updateSelected(t=>{t.setRotation(t.getRotation()+e)},"Rotate")},s=(e,t=!0)=>{o.updateSelected(n=>{const o=n.getBounds();let r=1+e;t||(r=1/r);const l=Math.sqrt(Math.pow(o.width,2)+Math.pow(o.height,2)),i=Math.atan2(o.height,o.width),a=r*l;if(a<10)return;const s=a*Math.cos(i),d=a*Math.sin(i),c={x:o.x+(o.width-s)/2,y:o.y+(o.height-d)/2,width:s,height:d};n.setBounds(c)},"Resize")},d=e=>{o.updateSelected(t=>{const n=t.getBounds(),o={x:n.x+(e.x??0),y:n.y+(e.y??0),width:n.width+(e.width??0),height:n.height+(e.height??0)};t.setBounds(o)},"Nudge")};if(e.which===S.Delete)o.updateSelected(e=>{e.delete()},"Delete"),e.preventDefault();else if("a"===e.key&&t){const t=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(t,!0),e.preventDefault()}else"ArrowLeft"===e.key?(l?s(i,!1):n?a(-10):d({x:t?-10:-1}),e.preventDefault()):"ArrowRight"===e.key?(l?s(i,!0):n?a(10):d({x:t?10:1}),e.preventDefault()):"ArrowUp"===e.key?(l?s(i,!0):d({y:t?-10:-1}),e.preventDefault()):"ArrowDown"===e.key&&(l?s(i,!1):d({y:t?10:1}),e.preventDefault())},children:[ge,xe]})})})})),tn=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let l=0;l<e.length;l++){const i=e[l].getBounds();t=Math.min(i.x,t),n=Math.min(i.y,n),o=Math.max(i.x+i.width,o),r=Math.max(i.y+i.height,r)}return{x:t,y:n,width:o-t,height:r-n}},nn=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",l=t?"width":"height";let i=0,a=Number.MAX_SAFE_INTEGER,s=0;for(let t=0;t<e.length;t++){const r=e[t],d=r.getBounds();i+=d[l],a=Math.min(d[o],a),s=Math.max(d[o]+d[l],s),n.push({bounds:d,movable:r})}const d=(s-a-i)/(e.length-1);n.sort((e,t)=>{const n=e.bounds[o],l=t.bounds[o];return n!==l?n-l:e.bounds[r]-t.bounds[r]});const c=new Map;c.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){const t=n[e-1].bounds,r={...n[e].bounds};r[o]=t[o]+t[l]+d,n[e].bounds=r,c.set(n[e].movable,r)}return c.set(n[n.length-1].movable,n[n.length-1].bounds),c};function on(e){const{movables:t,movablesView:n,transactional:o,commands:r,target:l,onRepeatCommandChange:i,notifier:a}=e,s=A();re(s.getMode()).current=s.getMode();const d=x(async(e,t,n=null,o=!0)=>{const r=async()=>{const d=await Promise.resolve(a?.showBusy?.(e.label()));try{await t();const a=n??e?.label?.();if(i){let t=null;e&&!1!==a&&(t=new k(e.key(),l,{label:a,description:a},r)),i(t)}d?.(),o&&s.setMode(null)}catch(e){d?.(),a?.showError?.(e)}};await r()},[i,a]),[c,u]=de(e=>e+1,0),g=x((e,t,r)=>{if(!n)return;const l=n.getMovableSelection();if(0===l.length)return;let i="Drawings";if(1===l.length){const e=l[0];i=v.capitalize(e.getContent().getType())??"Drawing"}const a=`${e.label()} ${i}`;d(e,()=>{let e=null;o&&(e=o.beginCommit(a));const l=n.getMovableSelection();if(0===l.length)return;const i=r?.(l);for(let e=0;e<l.length;e++){const n=l[e];t(n,i)}e?.commit()})},[n,o]),[h,m]=ne(n.getMovableSelection()[0]??null),[p,f]=ne(!h||h?.isProtected()),y=te(()=>[new R("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[M.Ctrl,M.Shift]}},function(){g(this,e=>{e.moveToFront()})}),new R("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[M.Ctrl]}},function(){g(this,e=>{e.moveForward()})}),new R("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[M.Ctrl,M.Shift]}},function(){g(this,e=>{e.moveToBack()})}),new R("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[M.Ctrl]}},function(){g(this,e=>{e.moveBackward()})}),new R("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){g(this,e=>{e.setLockAspectRatio(!e.isLockAspectRatio())})}),new R("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){g(this,e=>{e.setAnchorType(w.Type.TwoCell)})}),new R("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){g(this,e=>{e.setAnchorType(w.Type.OneCell)})}),new R("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){g(this,e=>{e.setAnchorType(w.Type.Absolute)})}),new R("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){g(this,(e,t)=>{e.setBounds({x:t.x})},tn)}),new R("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){g(this,(e,t)=>{e.setBounds({x:(t.width-e.getBounds().width)/2+t.x})},tn)}),new R("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){g(this,(e,t)=>{e.setBounds({x:t.width-e.getBounds().width+t.x})},tn)}),new R("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){g(this,(e,t)=>{e.setBounds({y:t.y})},tn)}),new R("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){g(this,(e,t)=>{e.setBounds({y:(t.height-e.getBounds().height)/2+t.y})},tn)}),new R("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){g(this,(e,t)=>{e.setBounds({y:t.height-e.getBounds().height+t.y})},tn)}),new R("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){g(this,(e,t)=>{e.setBounds(t.get(e))},e=>nn(e))}),new R("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){g(this,(e,t)=>{e.setBounds(t.get(e))},e=>nn(e,!1))}),new R("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new R("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new R("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new R("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new R("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new R("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new R("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,h]);le(()=>{},[s]);const b=te(()=>{let e=null;return e=r?r.createChildGroup(l,"movable",!1):new T(l,"movable"),e.addCommands(y,!0),e},[r,y]);return ht(h,{onAnyChange:()=>{b.getCommand("formatAnchorTypeTwoCell").update({state:h?.getAnchorType()===w.Type.TwoCell}),b.getCommand("formatAnchorTypeOneCell").update({state:h?.getAnchorType()===w.Type.OneCell}),b.getCommand("formatAnchorTypeAbsolute").update({state:h?.getAnchorType()===w.Type.Absolute}),b.getCommand("formatAnchorTypeAbsolute").update({state:h?.getAnchorType()===w.Type.Absolute}),b.getCommand("toggleLockAspectRatio").update({state:h?.isLockAspectRatio()})},onProtectedChange:e=>{f(e.isProtected())},onDelete:()=>{}}),ht(n,{onMovableSelectionChange:()=>{const e=n.getMovableSelection()[0]??null;m(e),f(!e||e.isProtected()),u()}}),ht(t,{onCollectionChange:()=>{u()}}),le(()=>{const e={disabled:p};b.getCommand("formatAnchorTypeTwoCell").update(e),b.getCommand("formatAnchorTypeOneCell").update(e),b.getCommand("formatAnchorTypeAbsolute").update(e),b.getCommand("toggleLockAspectRatio").update(e);const o=t.getCount(),r=n.getMovableSelection(),l=p||o<=1||0===r.length;let i={disabled:l},a=i;if(!l&&1===r.length){const e=r[0];0===e.getZIndex()&&(i={disabled:!0}),e.getZIndex()===o-1&&(a={disabled:!0})}b.getCommand("moveToFront").update(a),b.getCommand("moveForward").update(a),b.getCommand("moveToBack").update(i),b.getCommand("moveBackward").update(i);const s={disabled:p||r.length<=1};b.getCommand("formatDrawAlignLeft").update(s),b.getCommand("formatDrawAlignCenter").update(s),b.getCommand("formatDrawAlignRight").update(s),b.getCommand("formatDrawAlignTop").update(s),b.getCommand("formatDrawAlignMiddle").update(s),b.getCommand("formatDrawAlignBottom").update(s),b.getCommand("formatDrawFlipHorz").update(s),b.getCommand("formatDrawFlipVert").update(s),b.getCommand("formatDrawGroup").update(s),b.getCommand("formatDrawUngroup").update(s),b.getCommand("formatDrawSwapShapes").update(s),b.getCommand("formatDrawSwapShapesHorz").update(s),b.getCommand("formatDrawSwapShapesVert").update(s);const d={disabled:p||r.length<=2};b.getCommand("formatDrawDistributeHorz").update(d),b.getCommand("formatDrawDistributeVert").update(d)},[c,p,c]),b}const rn=ee(oe((e,t)=>{const{children:n,disabled:o,description:r,view:l,isDragging:i,onHide:a,onShow:s,...d}=e;le(()=>{},[r]);const c=C(t,()=>({isEmptyFrame:()=>!0}),[]),[u,{height:g,width:h}]=Ye();return _("div",{...d,ref:Ue([c,u]),children:_("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:o?"blur(1px)":void 0,boxShadow:i?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:_("div",{style:{textAlign:"center"},children:r})})})})),ln=ee(oe((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:l,commands:i,target:a,notifier:s,onRepeatCommandChange:d}=e,c=on({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:d,commands:i,target:a,notifier:s});le(()=>{n?.getStage()},[n?.getStage()]);const u=te(()=>_(en,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:l,...r,onFocus:()=>{c.activate(),r?.onFocus?.()}},"movable-area"),[o,r,i,c]);return u&&n?u:null})),an=ee(oe((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:l,showProtectedError:i,setEditingCoords:a,commands:d,notifier:c=V}=e,u=A(),[g,h]=ne(null),[m,p]=ne(null),[f,w]=ne(null),[y,b]=ne(null),[q,C]=ne(null);ie(()=>{if(null===f)return b(null),void C(null);const e=()=>{const e=o.getRange(f).getCell(),t=e.getStyle();let n,l=t.getFill()?.toCSS(r.body.darkMode);"none"!==l.background&&"transparent"!==l.background||(l=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),"none"!==l.background&&"transparent"!==l.background||(l={background:r.body.fill}),b({style:l}),e&&!e.getFormula()&&(n=e?.getRenderHorizontalAlignment()),C(n??B.Left)};return e(),o.getRange(f).addListener(()=>{e()})},[o,f,r?.body]);const S=x(()=>{let e=m.editState.dirty??"";if(void 0!==m.editState.dirty){const t=v.clampString(e);try{const n=m.sheet.getRange(m.coords),o=`Typing '${t}' into ${n.toString()}`;return n.setValue(e,{description:o,autoFit:!0}),w(null),p(null),u.setMode(null),a(null),!0}catch(e){throw c.showError(new Error(`Unable to enter '${t}'.`,{cause:e})),e}}},[o,m,c]),k=x(e=>o.getRange(e).getCell().getExtrusions()??J.cellToRange(e),[o]),R=x(e=>{let t=s.Orientation.Row,n=!1;e!==s.Direction.Up&&e!==s.Direction.Down||(t=s.Orientation.Column),e!==s.Direction.Left&&e!==s.Direction.Up||(n=!0),o.getSelection().traverse(t,n)},[o]),M=ae((e,t)=>{if(l)return l(e,t);if(!o)return null;const{ref:n,...i}=e;return _(He,{ref:n,...i,sheet:o,bodyStyle:r?.body,activeCoords:t,commands:d,onChangeEdit:e=>{const n={sheet:o,coords:t,editState:e};u.setMode(e=>({...e,description:n.editState.editMode?"Edit":"Enter",args:{...e?.args,stateAndCoords:n}}))},editState:m.editState})},[o,y,l,m,f]),{overlay:T,startEdit:D,submitEdit:E,cancelEdit:z,onKeyboardEventNative:F,onPointerEventNative:I}=Se({view:n,activeCoords:g,getCellEditor:M,canEdit:()=>{const e=o.getProtection();if(e.isReadOnly())return!1;const t=e.isLocked();return t&&i(),!t},onBeforeStartEdit:e=>{const t=Pe(()=>o.getRange(e).getCell()),n={sheet:o,coords:e,editState:Object.freeze(t)};u.setMode({key:"edit",args:{stateAndCoords:n}}),p(n)},onStartEdit:e=>{w(e),a(e)},onSubmitEdit:S,onCancelEdit:e=>{w(null),p(null),u.setMode(null),a(null)},onDoneEdit:e=>{u.setMode(null)},onNavigate:R,containerProps:y,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:q,getRangeCoords:k});ht(o.getSelection(),{onChange(e){h(o.getSelection().getCoords().cell)}});const N=x(e=>{I(e),f&&E()},[I,z,f]),O=ae(e=>{I(e)},[I]),L=ae(e=>{F(e)},[F]);return le(()=>{const e=n?.getStage();if(e)return e.addEventListener("pointerdown",N),e.addEventListener("dblclick",O),e.addEventListener("keydown",L),()=>{e.removeEventListener("pointerdown",N),e.removeEventListener("dblclick",O),e.removeEventListener("keydown",L)}},[n?.getStage()]),le(()=>{const e=u.getMode(),t=e?.key;"edit"===t||"enter"===t?m?e.args?.cancel?z():e.args?.submit?E():p(e.args?.stateAndCoords):D(e.args?.start):f&&z()},[u]),T(n,t)})),sn="white",dn="black",cn=`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='${dn}' fill='${sn}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,un=`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='${dn}' fill='${sn}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,gn=ee(oe((e,t)=>{const{view:n,sheet:o}=e,[r,l]=Q.useState(o.getTables().getCount()>0),[i,a]=Q.useState(null),[s,d]=Q.useState(null),[c,u]=Q.useState(null),[g,h]=Q.useState(null),m=x(()=>{if(o.getTables().getCount()>0){l(!0);const e=o.getTables().search({address:n.getVisibleRangeCoords()});a(e.length>0?e:null)}else l(!1),a(null)},[o,n]),p=x(e=>{e.preventDefault(),e.stopPropagation();const t=n.getCellCoordsFromClient(e.clientX,e.clientY),r=o.getTables().search({address:t});if(1===r.length){r[0].select()}},[n,o]),f=x(e=>{e.preventDefault(),e.stopPropagation();const t=n.getCellCoordsFromClient(e.clientX,e.clientY),r=o.getTables().search({address:t});if(1===r.length){const e=r[0].getRange().getCoords(),n={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};o.getRange(n).select()}},[n,o]),v=x(()=>{if(!r)return;const e=o.getTables().search({address:n.getVisibleRangeCoords()});a(e.length>0?e:null)},[o,r,n]);ht(o?.getSelection(),{onChange(e){d(o.getSelection().getCoords().cell)}}),ht(c,{onAnyChange(e){m(),v()}}),ht(g,{onAnyChange(e){v()}}),ht(o,{onTablesChange(e){m(),v()},onInvalidated(e){m(),v()}});const w=Q.useMemo(()=>X.debounce(X.throttle(v,300),300),[]);le(()=>{w()},[n]),le(()=>{let e=null;if(i)for(let t=0;t<i.length&&!e;t++){const n=i[t],o=n.getRange().getCoords();y.isCellWithinRange(s,o)&&(e=n)}u(e)},[s,i]);const b=x(e=>{let t=null;if(i)for(let o=0;o<i.length;o++){const r=i[o],l=r.getRange().getCoords();let a=n.getRangeCoordsBounds(l);const s=n.getRelativePointFromClient(e.clientX,e.clientY),d=s.x,c=s.y;if(d>=a.x&&d<=a.x+a.width&&c>=a.y&&c<=a.y+a.height){const e=n.getViewportSize();d<=0||c<=0||d>=e.width||c>=e.height||(t=r)}}h(t)},[n,i]);if(le(()=>{const e=n?.getStage();if(e&&i)return e.addEventListener("mousemove",b),e.addEventListener("mouseleave",b),()=>{e.removeEventListener("mousemove",b),e.removeEventListener("mouseleave",b)}},[i,n?.getStage()]),!n)return null;if(!i||0===i.length)return null;const q=[];for(let e=0;e<i.length;e++){const t=i[e];if(t.isClosed())continue;const r=t===g,l=t===c,a=t.getRange().getCoords(),s=n.getRangeCoordsBounds(a);let d;if(r||l){const e=t.getStyle().getProperties(),n=e.headerRow?.fill?.background??e.wholeTable?.border?.top?.color?.toString();if(n&&o){const e=o.getStyles().parseColor(n);e&&(d=e.toCSS())}d||(d="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}q.push(_("div",{style:{position:"absolute",left:s.x,top:s.y,width:Math.min(16,s.width),height:s.height,pointerEvents:"all",cursor:cn},onMouseDown:f},`table-select-row-${t.getName()}`)),q.push(_("div",{style:{position:"absolute",left:s.x,top:s.y,width:Math.min(16,s.width),height:Math.min(16,s.height),pointerEvents:"all",cursor:un},onMouseDown:p},`table-select-${t.getName()}`)),q.push(_(ke,{x:s.x,y:s.y,width:s.width,height:s.height,range:a,strokeWidth:l?.5:0,stroke:d??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:r?`${d} 0px 0px 1px 1px`:void 0}},`table-outline-${t.getName()}`))}return q})),hn=ee(oe((t,n)=>{const{view:o,sheet:r,animationTime:l=60}=t,[i,a]=Q.useState(null),[s,d]=Q.useState(null),c=Q.useRef(null),u=x(()=>{const e=r.getSelectedCell(),t=e.getSpill()?.getCoords()??null;J.isEqualRanges(t,i)||(d(t?{transition:i?"move":"in",bounds:o.getRangeCoordsBounds(t),coords:t}:{transition:"out",bounds:o.getRangeCoordsBounds(i),coords:i}),a(t))},[r,o,i]);Q.useEffect(()=>(c.current&&(clearTimeout(c.current),c.current=null),s&&(c.current=setTimeout(()=>{d(null),c.current=null},l)),()=>{c.current&&(clearTimeout(c.current),c.current=null)}),[s,l]);const g=Q.useMemo(()=>X.debounce(X.throttle(u,80),80),[]);if(ht(r?.getSelection(),{onChange(e){g()}}),ht(r,{onSpillsChange(e){u()},onInvalidated(e){u()}}),!o)return null;if(!i&&!s)return null;const h=r.getRange(i).getValue()instanceof e.Spill,m=[];let p=s?.bounds??o.getRangeCoordsBounds(i);if(s&&!X.isEqualBounds(s.bounds,o.getRangeCoordsBounds(s.coords))&&d(null),p=o.toClipBounds(p,-10),!p)return;const f="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return m.push(_(ke,{x:p.x,y:p.y,width:p.width,height:p.height,range:i,strokeWidth:1,stroke:f,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:"out"===s?.transition?0:1,transition:s?.transition?"in"===s.transition||"out"===s.transition?`opacity ${1.5*l}ms ease-in-out`:`left ${l}ms ease-out, top ${l}ms ease-out, width ${l}ms ease-out, height ${l}ms ease-out`:"none",boxShadow:`${f} 0px 0px 4px 0px`}},"spill-outline}")),m})),mn={position:"absolute",top:0,left:0,bottom:0,right:0},pn=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),l={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},i=n.body=X.mergeContentful(e.body,l);return n.body=X.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},i),n.buttonSurface=X.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=X.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=X.mergeContentful(n.header,l),n.headerSelect=X.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=X.mergeContentful(n.headerSelect,l),n.headerSelectAll=X.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=X.mergeContentful(n.headerSelectAll,l),n},fn={fireOnModelChange:!1},vn={},wn=ee(oe((e,t)=>{const{sheet:n,gridStyle:o=vn,headersStyle:r=vn,onSheetContextMenu:l,showColumnHeaders:s,columnHeaderProps:c,showRowHeaders:u,rowHeaderProps:g,showScrollbars:h=!0,scrollPaneProps:p,onViewportChange:f,commands:v,onRepeatCommandChange:w,onMoveCell:y,overlays:b,renderMovable:k,viewportComponent:R,onElementLoad:M,getCellEditor:T,onFocus:D,onBlur:E,style:F=q.EmptyCssProperties,notifier:I,onShowTooltip:N,onShowColumnTooltip:L,onShowRowTooltip:V,onCloseTooltip:B,gridProps:P,cellRenderProps:W,...$}=e;if(Q.useEffect(()=>{d._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[U,j]=Q.useReducer(e=>e+1,0),[ee,{width:oe,height:se}]=Ye(),de=x(N,[N]),ce=x(L,[L]),ge=x(V,[V]),he=x(B,[B]),me=re(!1);ie(()=>{me.current=!0},[n]);const pe=n?.getStyles(),fe=te(()=>pn(o,pe),[o,pe]),ve=te(()=>pn(r,pe),[r,pe]),{body:we={},buttonSurface:ye={}}=fe,{header:qe={},headerSelect:Ce={},headerSelectAll:xe={}}=ve,Se=re(null),[ke,Me]=ne(()=>n?.getView()),Te=(ke?.getZoomScale()??100)/100,De=te(()=>({vertical:ke.isShowColumnGridlines()&&Te>=.4,horizontal:ke.isShowRowGridlines()&&Te>=.4}),[ke?.isShowColumnGridlines(),ke?.isShowRowGridlines(),Te]),Ae=te(()=>{if(ke?.getGridLineColor())return{strokeDasharray:"1,1"}},[ke?.getGridLineColor(),fe]),Ee=s??ke?.isShowColumnHeaders(),ze=u??ke?.isShowRowHeaders(),[Fe,Ie]=ne({width:0,height:0}),Ne=te(()=>{let e=40,t=20;const o=n?.getStyles().getNormal().getFont();if(Fe.width>0&&Fe.height>0){const n=o?.toCSS()?.fontFamily??fe.header.text.fontFamily,r=o?.getSize()??fe.header.text.fontSize,l=a.getSharedMeasurer()(""+Fe.height,Math.ceil(r*a.getDeviceScale()),n);e=l.width,t=l.lineHeight}return{width:Math.round(e+5),height:Math.round(t+3)}},[Fe,fe?.header.text,n]),Le=ze?Te*Ne.width:qe.edgeStrokeWidth,Ve=Ee?Te*Ne.height:qe.edgeStrokeWidth,Be=Math.max(oe,(n?.getColumnHeaders().getDefaultSize()??Ne.width)+Le+1),He=Math.max(se,(n?.getRowHeaders().getDefaultSize()??Ne.height)+Ve+1),Pe=re(new Map),We=re(null),$e=()=>({getColOffset:e=>n.getColumnHeaders().findOffset(e),getColIndex:e=>n.getColumnHeaders().findIndex(e),getRowOffset:e=>n.getRowHeaders().findOffset(e),getRowIndex:e=>n.getRowHeaders().findIndex(e)}),[Ue,je]=ne(()=>$e()),[_e,Ge]=ne(!1),[Ze,Xe]=ne(null),Ke=!0,Je=fe.selection?.strokeFill,Qe=ae(()=>Gt.current,[]),[et,tt]=ne(),nt=x(e=>{tt(e),n&&n.getView()&&n.getView().setTopLeft(e?{left:e.left,top:e.top}:null),f?.(e)},[n,f]),ot=re(null);le(()=>{if(!et||!n)return;const e=n.getRangeAtBounds({x:et.left,y:et.top,width:et.width,height:et.height});ot.current?.(),ot.current=e.addListener(()=>{const t=e.getCoords();Se?.current?.invalidate(t)})},[et,n]);const[rt,lt]=ne(()=>n?.getView().getTopLeft()),it=x(e=>{const t=J.cellToRange(e);if(n.isClosed())return t;const o=n.getRange(t,{excludeHidden:!0}).getMerges();return 0===o.length?t:o[0]},[n]),at=e=>{if(!e||0===e.coords.colIndex&&0===e.coords.rowIndex)return null;const t={};return e.coords.colIndex>0&&(t[Y.Left]={index:e.coords.colIndex,scrollOffset:e.topLeft.left}),e.coords.rowIndex>0&&(t[Y.Top]={index:e.coords.rowIndex,scrollOffset:e.topLeft.top}),t},[ut,mt]=ne(()=>at(n.getView().getFreezePanes())),pt=A(),vt=ae(()=>Se.current,[]),wt=x(e=>{pt.setMode(t=>"edit"===t?.key?{...t,args:{...t.args}}:{key:"edit",args:{stateAndCoords:null,start:e}})},[]),yt=x(()=>et,[et]),bt=ft({sheet:n,commands:v,target:vt,onRepeatCommandChange:w,bodyStyle:we,notifier:I,onStartEdit:wt,getViewport:yt}),[qt,Ct]=ne(n.getSelection().isEntire()),[xt,St]=ne(ke?.getMovableSelection().length>0),kt=null!==Ze||xt,Rt=null,[Mt,Tt]=ne(!1);le(()=>{Tt(!1)},[n.getProtection()]);const At=x(()=>{Mt||(Tt(!0),I.showMessage?.(G("span",{children:["This sheet is protected.",_("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:z.Error}))},[I,Mt]),Ft=te(()=>{const e=pt.getMode();return e?.cursor?e.cursor:null},[Rt,pt]),[It,Nt]=ne(null),Ot=re(!1),[Lt,Vt]=ne([]),Bt=re(null),[Ht,Wt]=ne(K.EmptyTopLeft),[$t,Ut]=ne(K.EmptyTopLeft);le(()=>{Wt({left:rt?.left,top:0})},[rt?.left]),le(()=>{Ut({left:0,top:rt?.top})},[rt?.top]),ht(n?.getView(),{onFreezeSplitChange:()=>{mt(at(n.getView().getFreezePanes()))},onTopLeftChange:()=>{lt(n.getView().getTopLeft())},onMovableSelectionChange:()=>{St(n.getView().getMovableSelection().length>0)}}),ht(n?.getSelection(),{onChange:()=>{Ct(n.getSelection().isEntire())}}),ht(n,{onViewChange(){Me(n.getView()),je($e())},onLayoutChange:()=>{const e=n.getEntireRange();Ie({height:e.getRowCount(),width:e.getColumnCount()}),je($e())},onStyleChange:()=>{Zt()},onMovablesChange:()=>{},onInvalidated:()=>{Zt()}}),ht(n,{onRequestScrollIntoView:async(e,t)=>{if(!t)return;const n={colIndex:t?.coords.colStart,rowIndex:t?.coords.rowStart};return await(Se.current?.scrollCellCoordsIntoView(n,t?.scroll)),!0},onRequestFocus:()=>X.whenFocus(Gt.current)},fn);const jt=te(()=>{const e=(e,t)=>{Ot.current=!0,Nt([r=>{if(!r.toClipBounds(r.getRangeCoordsBounds({rowStart:0,rowEnd:Fe.height,colStart:e,colEnd:e})))return;const l=r.getLayout(),i=Math.max(0,l.getColOffset(e)),a=r.getBounds(),s=Math.min(a.x+a.width,l.getColOffset(e+1)),d=r.getAnchor();if(null!==t&&(d===Y.Left||d===Y.Center||d===Y.Right)){const e=X.roundAccurately(t*X.getDPI(),0),o=X.roundAccurately(n?.getColumnWidthAsFontUnit(t/Te),2).toFixed(2),r="Width: "+(t?o+" ("+e+" pixels)":"Hidden"),l=yn.current.getGridElement().getRelativePointFromClient(0,0),d=0-l.y,c=0-l.y+Ve,u={x:i-(l.x-a.x),y:d,width:s-i,height:c-d};requestAnimationFrame(()=>{Ot.current&&ce?.({anchor:u,display:r})})}const c=[0,0,0,a.height],u={style:{boxShadow:`0.5px 0px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},g={x:i-1,y:0,width:1,height:a.height},h={style:{boxShadow:`-0.5px 0px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},m={x:s-1,y:0,width:1,height:a.height};return G(Q.Fragment,{children:[_(Re,{linePoints:c,bounds:g,...u}),_(Re,{linePoints:c,bounds:m,...h})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(o,r,l)=>{t=n.beginCommit(l),e(o,r)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},...c}},[n,c,Ve,It]),_t=te(()=>{const e=(e,t)=>{Ot.current=!0,Nt([r=>{if(!r.toClipBounds(r.getRangeCoordsBounds({rowStart:e,rowEnd:e,colStart:0,colEnd:Fe.width})))return;const l=r.getLayout(),i=Math.max(0,l.getRowOffset(e)),a=r.getBounds(),s=Math.min(a.y+a.height,l.getRowOffset(e+1)),d=r.getAnchor();if(null!==t&&(d===Y.Top||d===Y.Center||d===Y.Bottom)){const e=Math.floor(10*X.getDPI())/10,o=X.roundAccurately(t*e,0),r=X.roundAccurately(o/Te/(n?.getRowHeaders().getScaleFactor()*X.getDPI()),2).toFixed(2),l="Height: "+(t?r+" ("+o+" pixels)":"Hidden"),d=un.current.getGridElement().getRelativePointFromClient(0,0),c=0-d.x,u=0-d.x+Le,g={x:c,y:i-(d.y-a.y),width:u-c,height:s-i};requestAnimationFrame(()=>{Ot.current&&ge?.({anchor:g,display:l})})}const c=[0,0,a.width,0],u={style:{boxShadow:`0px 0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},g={x:0,y:i-1,width:a.width,height:1},h={style:{boxShadow:`0px -0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},m={x:0,y:s-1,width:a.width,height:1};return G(Q.Fragment,{children:[_(Re,{linePoints:c,bounds:g,...u}),_(Re,{linePoints:c,bounds:m,...h})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(o,r,l)=>{t=n.beginCommit(l),e(o,r)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},...g}},[n,g,Le]),Gt=C(t,()=>{const e=e=>{n?.getView()&&n.getView().selectMovables([]),We.current=null,Se?.current?.focus(e)},t=async(e=null)=>{if(e||(e=n?.getView().getMovableSelection()[0]),!e)return!1;const t=e.getAnchorCoords();if(!t)return!1;const o=Se.current?.getViewFromCellCoords({colIndex:t.colStart,rowIndex:t.rowStart});if(!o)return!1;const r=o.getAnchor();-1===n?.getView().getMovableSelection().indexOf(e)&&n?.getView().selectMovables([e]);let l=Pe.current?.get(r);return l?.current?(await l.current.focusMovable(e),!0):(We.current={movable:e,anchor:r},!0)};return{getGridElement:()=>Se.current,getRowHeaderElement:()=>un.current,getColumnHeaderElement:()=>yn.current,rowHeaderHeight:()=>Ve,colHeaderWidth:()=>Le,startEdit:wt,submitEdit:()=>{pt.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{pt.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:null!==Ze,focus:o=>{n?.getView().getMovableSelection().length>0&&t()||e(o)},focusSheet:e,focusMovable:t,contains:e=>Se?.current?.contains?.(e),invalidate:Zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),Zt=ae(e=>{me.current||(Se?.current?.invalidate(e),j?.())},[]);le(()=>{Zt()},[fe]);const Yt=qt?xe.edgeStrokeFill:qe.fill,Kt=qt?Ce.fill:"function"==typeof fe.headerHover?fe.headerHover(qe)?.fill:qe.fill,Jt=te(()=>R?_("div",{className:st("sheetxl-viewport-overlay",ct),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:R}):_(Z,{}),[R]);let Qt=null;Ee&&ze&&(Qt=G("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Ve}px`,width:`${Le}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:e=>{let t=!e.ctrlKey;bt?.getCommand("selectAll")?.execute(!t||0!==e.button),e.nativeEvent.which===O.Right?l?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):Se.current?.focus()},children:[_("div",{style:{height:Ve-5+"px",width:Ve-5+"px",clipPath:`path('M${Ve-5} 0 L0 ${Ve-5} L${Ve-5} ${Ve-5} L${Ve-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Kt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),_("div",{style:{position:"absolute",height:`${Ve}px`,width:`${Le}px`,boxSizing:"border-box",borderRight:`solid 1px ${qe.strokeFill}`,borderBottom:`solid 1px ${qe.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const en=x(({_left:e,_top:t})=>{},[]),tn=x(e=>{if(!l)return;const t=Se.current.getViewFromClient(e.clientX,e.clientY)?.getCellCoordsFromClient(e.clientX,e.clientY);t&&(l({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[l]),nn=x(e=>{if(!(!e.shiftKey&&(e.ctrlKey||e.metaKey)))return;const{deltaY:t}=e;return t>0?bt.getCommand("sheetZoomOut")?.execute():t<0&&bt.getCommand("sheetZoomIn")?.execute(),0===t},[bt]);le(()=>{Vt(null),Bt.current=null,Ot.current=!1,Nt(null);const e=n?.getView().getTopLeft();en(e),Se.current?.scrollTo(e),lt(e),Me(n.getView()),mt(at(n.getView().getFreezePanes())),je($e()),j()},[n?.getView()]);const on=x(e=>{const t=e.getVisibleRangeCoords();if(!t)return null;const o=[];return n.getRange(t).forEach((e,t)=>{const n=t.getCoords(),r=t.getCell();(e=>{if(e.isEmpty())return!1;const t=e.getSpans();if(t.width>1||t.height>1)return!0;if(e.getStyle().hasVisibleStyling())return!0;if(ke.isShowFormulas()&&null!==e.getFormula())return!0;const n=e.getValue();return null!==n&&!(!ke.isShowZeros()&&0===n&&e.getType()===i.Number)})(r)&&o.push({coords:n,value:r,range:ke.isShowFormulas()?null:r.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),o},[n,ke.isShowZeros(),ke.isShowFormulas(),Ze]);le(()=>{const e=[];b&&e.push(...b),It&&e.push(...It),X.isEqualArrays(e,Bt.current)||(Bt.current=e,Vt(e))},[b,It,fe]);const rn=te(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:o?.body?.text?.fill??"black"}}),[fe?.header?.edgeStrokeFill]),sn=x(e=>{e.isDefaultPrevented()||e.isPropagationStopped()||(We.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),dn=te(()=>{const e=pt.getMode();return"cut"===e?.key||"copy"===e?.key},[pt]),cn=x(async e=>{const t=pt.getMode();return e.keyCode===S.Escape&&t?(e.preventDefault(),void pt.setMode(null)):e.keyCode===S.Enter&&dn?(e.preventDefault(),await(bt?.getCommand("paste")?.execute()),void pt.setMode(null)):void bt?.dispatchToFocusedCommand(e)},[bt,pt]),un=re(null),wn=te(()=>_("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Ve+1}px`,width:`${Le+qe.edgeStrokeWidth}px`,minWidth:`${Le+qe.edgeStrokeWidth}px`,borderRight:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,height:`calc(100% - ${Ve}px)`,boxSizing:"border-box",zIndex:"2"},children:_(Et,{ref:un,sheetElement:Gt.current,gridRef:Se,freezeStart:ut?.[Y.Top],oppositeSize:Le,containerWidth:Le,containerHeight:He,sheetHeader:n.getRowHeaders(),gridStyle:ve,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:$t,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Ve+1}px`,width:`${Le+qe.edgeStrokeWidth}px`,minWidth:`${Le+qe.edgeStrokeWidth}px`,borderRight:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,height:`calc(100% - ${Ve}px)`,boxSizing:"border-box",zIndex:"2",..._t?.style},..._t})}),[Le,Ve,He,n,$t,ut?.[Y.Top],fe,Ke,l,qe.fill,g]),yn=re(null),bn=te(()=>_("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Ve+qe.edgeStrokeWidth}px`,minHeight:`${Ve+qe.edgeStrokeWidth}px`,borderBottom:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:_(Et,{ref:yn,sheetElement:Gt.current,gridRef:Se,freezeStart:ut?.[Y.Left],oppositeSize:Ve,containerWidth:Be,containerHeight:Ve,sheetHeader:n.getColumnHeaders(),gridStyle:ve,scrollPoint:Ht,onSheetContextMenu:l,...jt,style:{...jt?.style,position:"relative",left:"0px",width:"100%",height:`${Ve+qe.edgeStrokeWidth}px`,minHeight:`${Ve+qe.edgeStrokeWidth}px`,borderBottom:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Ve,Be,n,Ht,ut?.[Y.Left],fe,qe.fill,Ke,l,c]),qn=x(e=>{const{value:t,key:o,...r}=e;let l=t,i=Ze;if(!i||i.colIndex===e.coords.colIndex&&i.rowIndex===e.coords.rowIndex||(i=null),!l){const t=e.range;if(l=n.getRange({rowIndex:t.rowStart,colIndex:t.colStart}).getCell(),l.isEmpty())return null}let a=null;l.getHyperlink()&&(a=async e=>{if(W?.onLinkMouseDown?.(e),0===e.button&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await(l.getHyperlink()?.open())}catch(e){I?.showError?.(e)}}}),i&&i.colIndex===e.range.colStart&&i.rowIndex===e.range.rowStart&&(l=l.createTemporaryCell({value:null}));const s=n.getStyles();return ue(Oe,{...r,key:o,bodyStyle:we,docTheme:s.getTheme(),normalStyle:s.getNormal(),showFormulas:ke.isShowFormulas(),showZeros:ke.isShowZeros(),onLinkMouseDown:a,...W,value:l})},[n,Ue,we,Ze,ke?.isShowFormulas(),ke.isShowZeros()]),Cn=ae((e,t)=>{const{key:o,...r}=e;return[_(zt,{ref:t,getVisibleCells:on,sheet:n,gridStyle:fe,...r},`border-${o}`),_(gn,{ref:t,sheet:n,commands:bt,...r},`table-${o}`),_(hn,{ref:t,sheet:n,...r},`spill-${o}`),_(Xt,{ref:t,sheet:n,commands:bt,notifier:I,onShowTooltip:de,onCloseTooltip:he,gridStyle:fe,gridRef:Se,editingCoords:Ze,isActive:Ke,...r},`selection-${o}`),_(Pt,{ref:t,sheet:n,commands:bt,gridStyle:fe,element:Qe,notifier:I,...r},`copy-paste-${o}`),_(ln,{ref:t,sheet:n,commands:bt,target:vt,notifier:I,renderMovable:k,movableProps:{onUnFocus:()=>{Gt.current.focus()}},...r},`movable-${o}`),_(an,{ref:t,sheet:n,commands:bt,notifier:I,gridStyle:fe,getCellEditor:T,showProtectedError:At,setEditingCoords:Xe,...r},`editor-${o}`)]},[n,Se.current,fe,T,bt,I]),[xn,Sn]=ne(!1),kn=te(()=>{if(0===Be||0===He)return null;const e=n.getStyles().getNormal(),t=e.getFont(),o=e.getFill(),r=e.getBorder(),l=e.getFill().getType()===m.Type.None;let i=Ae,a=Ae;const s=(e,t,n)=>n?{stroke:r.getBottom().isNone()?"none":e.getColor().toRGBA(we.darkMode).toString(),...t}:t;a=s(r.getBottom(),a,!r.getBottom().isNone()),a=s(r.getTop(),a,!r.getTop().isNone()),i=s(r.getRight(),i,!r.getRight().isNone()),i=s(r.getLeft(),i,!r.getLeft().isNone());let d=ke?.getGridLineColor()?.toRGBA(we.darkMode).toString()??we.strokeFill;return l||(a=s(r.getBottom(),a,!0),a=s(r.getTop(),a,!0),i=s(r.getRight(),i,!0),i=s(r.getLeft(),i,!0)),_(be,{className:"sheetxl-sheet-primary",style:{...mn,...o.toCSS(we.darkMode),...t.toCSS(we.darkMode,Te),"--sxl-app-color-background":we.fill,"--sxl-app-color-shadow":fe.colorShadow,"--sxl-app-color-grey":fe.colorGrey,"--sxl-app-color-button-fill":ye.fill,"--sxl-app-color-button-text":ye.text?.fill,"--sxl-app-color-button-border":ye.edgeStrokeFill,"--sxl-app-color-primary-dark":fe.selection.strokeFill},ref:Se,zoom:Te,...P,onFirstRender:e=>{Sn(!0),P?.onFirstRender?.(e),bt?.activate()},showGridLines:De,gridLineColor:d,gridLineColumnsProps:i,gridLineRowsProps:a,freezeLeft:ut?.[Y.Left],freezeLeftProps:rn,freezeTop:ut?.[Y.Top],freezeTopProps:rn,width:Be,height:He,columnCount:Fe.width,rowCount:Fe.height,cursor:Ft??Rt??"cell",clipCells:!0,layout:Ue,cellRenderer:qn,overlayRenderer:Cn,getCellCoordsAsRangeCoords:it,getVisibleCells:on,onWheelScroll:nn,onPointerDown:sn,onKeyDown:cn,onViewportChange:nt,onImmediateScroll:en,scrollPoint:rt,stageProps:{onFocus:()=>{bt?.activate()}},overlays:Lt})},[U]);le(()=>{me.current||j()},[Ue,ut,Te,bt,rt?.left,rt?.top,we,P,Be,He,Ft,Lt,Ke,Rt]);let Rn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};h||(Rn={...Rn,...F});const Mn=te(()=>{const e=n.getStyles().getTheme(),t=e.getColorScheme(),o=e.getFontScheme();return{"--sxl-doc-color-dk1":t.getDk1().toCSS(we.darkMode),"--sxl-doc-color-dk2":t.getDk2().toCSS(we.darkMode),"--sxl-doc-color-lt1":t.getLt1().toCSS(we.darkMode),"--sxl-doc-color-lt2":t.getLt2().toCSS(we.darkMode),"--sxl-doc-color-accent1":t.getAccent1().toCSS(we.darkMode),"--sxl-doc-color-accent2":t.getAccent2().toCSS(we.darkMode),"--sxl-doc-color-accent3":t.getAccent3().toCSS(we.darkMode),"--sxl-doc-color-accent4":t.getAccent4().toCSS(we.darkMode),"--sxl-doc-color-accent5":t.getAccent5().toCSS(we.darkMode),"--sxl-doc-color-accent6":t.getAccent6().toCSS(we.darkMode),"--sxl-doc-color-hlink":t.getHlink().toCSS(we.darkMode),"--sxl-doc-color-fol-hlink":t.getFolHlink().toCSS(we.darkMode),"--sxl-doc-font-major":o.getMajorFont(),"--sxl-doc-font-minor":o.getMinorFont()}},[n.getStyles().getTheme()]);let Tn=_("div",{style:Rn,onTouchStart:()=>{En()},onFocus:e=>{Ge(!0),D?.(e)},onBlur:e=>{Ge(!1),E?.(e)},ref:Gt,...$,children:_("div",{className:st("sheetxl-sheet",dt),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...Mn},children:G("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Qt,wn,G("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[bn,G("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,backgroundColor:we.fill},ref:ee,onContextMenu:tn,children:[kn,Jt,_(gt,{style:{position:"absolute",right:24,bottom:4},colorLicensee:fe?.selection?.strokeFill,colorCredits:fe?.body?.text?.fill})]})]})]})})});if(h){const e=e=>_(Dt,{...e,sheet:n});Tn=_(H,{style:{flex:"1 1 100%",overflow:"hidden",background:`${qe.fill}`,minHeight:2*Ne.height,minWidth:2*Ne.width,...F},viewport:et,touchElement:Se.current?.stage,disableTouch:kt,onScrollViewport:e=>{Se.current?.scrollTo(e)},createHorizontalScrollbar:e,createVerticalScrollbar:e,...p,children:Tn})}le(()=>{me.current=!1,j?.(),_e&&Gt.current?.focus()},[n]);const[Dn,An]=ne(!1),En=x(()=>{Dn||An(!0)},[Dn]);return le(()=>{if(xn)return"function"==typeof M&&M(),"touch"===q.detectIt().primaryInput&&En(),()=>{}},[M,xn,Dn]),Tn}));wn.displayName="SheetElement";const yn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),bn="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=",qn=ee(oe((e,t)=>{const{children:n,disabled:o,style:r,picture:l,description:i,isDragging:a,view:s,onHide:d,onShow:c,onKeyDownCapture:u,onFocus:g,onBlur:h,loadingPanel:m,...p}=e,[f,v]=ne(!1),[w,y]=ne(null),[b,q]=ne(null),[x,S]=ne(null);le(()=>{q(null),l.getDetails().then(e=>{v(!1),q(e.asUrl()),e.asSVGText?.()&&S(e.asSVGText())}).catch(e=>{console.warn(e),v(!0),q(bn),S(null)})},[l]);const k=C(t,()=>({isPictureEditor:()=>!0}),[]),R=te(()=>{if(b||x)return _("img",{style:{flex:"1",width:"100%",height:"100%",border:f?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:f?"var(--sxl-app-color-background, white)":void 0,boxShadow:f?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:f?"contain":void 0,opacity:w?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:b,onLoad:()=>{y(!0)},onError:({currentTarget:e})=>{console.log("error"),e.onerror=null,q(bn),v(!0)},alt:i??`${l.getType()}`})},[w,l,b,x,a]);if(!l.isClosed())return G("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:a?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...r,width:"100%",height:"100%"},tabIndex:0,...p,onKeyDownCapture:e=>{u?.(e)},ref:k,children:[w||f?void 0:m,R]})}));qn.displayName="PictureEditor";const Cn=ee(oe((e,t)=>{const{children:n,disabled:o,chart:r,view:l,isDragging:i,onHide:a,onShow:s,...d}=e;le(()=>{},[r]);const c=C(t,()=>({isChartEditor:()=>!0}),[]),[u,{height:g,width:h}]=Ye();if(!r.isClosed())return _("div",{...d,ref:Ue([c,u]),children:_("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:o?"blur(1px)":void 0,boxShadow:i?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:_("div",{style:{textAlign:"center"},children:r.getDescription()})})})})),xn="_editable-input_1bqx6_6",Sn=e=>_("input",{...e}),kn=ee(oe((e,t)=>{const{style:n={},className:o,value:r="",onSubmit:l,onChange:i,onCancel:a,createInput:s=Sn,notifier:d,styleHover:c={},dragging:u,maxLength:g,disabled:h=!1,readOnly:m=!1,...p}=e,[f,v]=ne(!1),[w,y]=ne(!1),[b,q]=ne(r);le(()=>{q(r)},[r]);const S=re(null),[k,R]=ne(null),M=ae(function(e){const t=e.message;k!==t&&(d?.showMessage?.(t,{type:z.Error}),R(t))},[d,k]),T=ae(e=>{let t=!1;try{t=l?.(e)??!0}catch(e){M(e)}return t?(S.current=null,y(!1),q(e),t):(setTimeout(()=>{S.current?.focus()},0),t)},[l]),D=x(()=>{q(r),S.current=null,y(!1),a?.()},[a,r]),A=te(()=>{if(!w)return null;const e={className:st(xn),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:g,type:"text",value:b,onFocus:e=>{S.current||(S.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{S.current&&T(b)},onChange:e=>{w&&q(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>"Escape"===e.code?(e.preventDefault(),void D()):"Enter"===e.code?(e.preventDefault(),void T(e.target.value)):void("Tab"!==e.code?e.stopPropagation():T(e.target.value))};return _(Z,{children:s(e)})},[w,b,T,D,s,h]),[E,F]=ne();ie(()=>{let e=Object.assign({},n);(u||f)&&(e=Object.assign(e,c)),F(e)},[u,f,c,n]),le(()=>{A&&i?.(b)},[A,i,b]);const I=C(t,()=>({startEdit(){h||m||y(!0)},cancel(){D()}}),[]);return G("div",{...p,ref:I,style:{flexDirection:"column",display:"flex",...E},className:st(o),children:[G("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{h||m||y(!0)},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[_("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:w?0:1},children:b}),A]}),_("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...c},children:b})]})}));const Rn="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Mn(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Tn(e){return"nodeType"in e}function Dn(e){var t,n;return e?Mn(e)?e:Tn(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function An(e){const{Document:t}=Dn(e);return e instanceof t}function En(e){return!Mn(e)&&e instanceof Dn(e).HTMLElement}function zn(e){return e instanceof Dn(e).SVGElement}function Fn(e){return e?Mn(e)?e.document:Tn(e)?An(e)?e:En(e)||zn(e)?e.ownerDocument:document:document:document}const In=Rn?ie:le;function Nn(e){const t=re(e);return In(()=>{t.current=e}),ae(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}function On(e,t){void 0===t&&(t=[e]);const n=re(e);return In(()=>{n.current!==e&&(n.current=e)},t),n}function Ln(e,t){const n=re();return te(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Vn(e){const t=Nn(e),n=re(null),o=ae(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function Bn(e){const t=re();return le(()=>{t.current=e},[e]),t.current}let Hn={};function Pn(e,t){return te(()=>{if(t)return t;const n=null==Hn[e]?0:Hn[e]+1;return Hn[e]=n,e+"-"+n},[e,t])}function Wn(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t},{...t})}}const $n=Wn(1),Un=Wn(-1);function jn(e){if(!e)return!1;const{KeyboardEvent:t}=Dn(e.target);return t&&e instanceof t}function _n(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Dn(e.target);return t&&e instanceof t}(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(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Gn=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[Gn.Translate.toString(e),Gn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Zn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xn(e){return e.matches(Zn)?e:e.querySelector(Zn)}const Yn={display:"none"};function Kn(e){let{id:t,value:n}=e;return Q.createElement("div",{id:t,style:Yn},n)}function Jn(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return Q.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":o,"aria-atomic":!0},n)}const Qn=ge(null);const eo={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},to={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 no(e){let{announcements:t=to,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=eo}=e;const{announce:l,announcement:i}=function(){const[e,t]=ne("");return{announce:ae(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Pn("DndLiveRegion"),[s,d]=ne(!1);if(le(()=>{d(!0)},[]),function(e){const t=he(Qn);le(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(te(()=>({onDragStart(e){let{active:n}=e;l(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&l(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;l(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;l(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;l(t.onDragCancel({active:n,over:o}))}}),[l,t])),!s)return null;const c=Q.createElement(Q.Fragment,null,Q.createElement(Kn,{id:o,value:r.draggable}),Q.createElement(Jn,{id:a,announcement:i}));return n?Te(c,n):c}var oo;function ro(){}function lo(e,t){return te(()=>({sensor:e,options:null!=t?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"}(oo||(oo={}));const io=Object.freeze({x:0,y:0});function ao(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function so(e,t){const n=_n(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function co(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function uo(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function go(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function ho(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function mo(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const po=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=mo(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=ao(mo(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(co)};function fo(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=l-n;if(o<r&&n<l){const n=t.width*t.height,o=e.width*e.height,r=i*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const vo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,l=n.get(o);if(l){const n=fo(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(uo)};function wo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:io}function yo(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const bo=yo(1);function qo(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 Co={ignoreTransform:!1};function xo(e,t){void 0===t&&(t=Co);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=Dn(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=qo(t);if(!o)return e;const{scaleX:r,scaleY:l,x:i,y:a}=o,s=e.left-i-(1-r)*parseFloat(n),d=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=l?e.height/l:e.height;return{width:c,height:u,top:d,right:s+c,bottom:d+u,left:s}}(n,t,o))}const{top:o,left:r,width:l,height:i,bottom:a,right:s}=n;return{top:o,left:r,width:l,height:i,bottom:a,right:s}}function So(e){return xo(e,{ignoreTransform:!0})}function ko(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(An(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!En(r)||zn(r))return n;if(n.includes(r))return n;const l=Dn(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=Dn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const o=t[e];return"string"==typeof o&&n.test(o)})}(r,l)&&n.push(r),function(e,t){return void 0===t&&(t=Dn(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function Ro(e){const[t]=ko(e,1);return null!=t?t:null}function Mo(e){return Rn&&e?Mn(e)?e:Tn(e)?An(e)||e===Fn(e).scrollingElement?window:En(e)?e:null:null:null}function To(e){return Mn(e)?e.scrollX:e.scrollLeft}function Do(e){return Mn(e)?e.scrollY:e.scrollTop}function Ao(e){return{x:To(e),y:Do(e)}}var Eo;function zo(e){return!(!Rn||!e)&&e===document.scrollingElement}function Fo(e){const t={x:0,y:0},n=zo(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Eo||(Eo={}));const Io={x:.2,y:.2};function No(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=Io);const{isTop:d,isBottom:c,isLeft:u,isRight:g}=Fo(e),h={x:0,y:0},m={x:0,y:0},p=t.height*r.y,f=t.width*r.x;return!d&&l<=t.top+p?(h.y=Eo.Backward,m.y=o*Math.abs((t.top+p-l)/p)):!c&&s>=t.bottom-p&&(h.y=Eo.Forward,m.y=o*Math.abs((t.bottom-p-s)/p)),!g&&a>=t.right-f?(h.x=Eo.Forward,m.x=o*Math.abs((t.right-f-a)/f)):!u&&i<=t.left+f&&(h.x=Eo.Backward,m.x=o*Math.abs((t.left+f-i)/f)),{direction:h,speed:m}}function Oo(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function Lo(e){return e.reduce((e,t)=>$n(e,Ao(t)),io)}function Vo(e,t){if(void 0===t&&(t=xo),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);Ro(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Bo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+To(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Do(t),0)}]];class Ho{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ko(t),o=Lo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of Bo)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=r(n),i=o[e]-t;return this.rect[l]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Po{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Wo(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var $o,Uo;function jo(e){e.preventDefault()}function _o(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"}($o||($o={})),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"}(Uo||(Uo={}));const Go={start:[Uo.Space,Uo.Enter],cancel:[Uo.Esc],end:[Uo.Space,Uo.Enter,Uo.Tab]},Zo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Uo.Right:return{...n,x:n.x+25};case Uo.Left:return{...n,x:n.x-25};case Uo.Down:return{...n,y:n.y+25};case Uo.Up:return{...n,y:n.y-25}}};class Xo{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Po(Fn(t)),this.windowListeners=new Po(Dn(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($o.Resize,this.handleCancel),this.windowListeners.add($o.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($o.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Vo(n),t(io)}handleKeyDown(e){if(jn(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=Go,coordinateGetter:l=Zo,scrollBehavior:i="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,d=s?{x:s.left,y:s.top}:io;this.referenceCoordinates||(this.referenceCoordinates=d);const c=l(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=Un(c,d),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:d,maxScroll:u,minScroll:g}=Fo(n),h=Oo(n),m={x:Math.min(r===Uo.Right?h.right-h.width/2:h.right,Math.max(r===Uo.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(r===Uo.Down?h.bottom-h.height/2:h.bottom,Math.max(r===Uo.Down?h.top:h.top+h.height/2,c.y))},p=r===Uo.Right&&!a||r===Uo.Left&&!s,f=r===Uo.Down&&!d||r===Uo.Up&&!l;if(p&&m.x!==c.x){const e=n.scrollLeft+t.x,l=r===Uo.Right&&e<=u.x||r===Uo.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===Uo.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:i});break}if(f&&m.y!==c.y){const e=n.scrollTop+t.y,l=r===Uo.Down&&e<=u.y||r===Uo.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===Uo.Down?n.scrollTop-u.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,$n(Un(c,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Yo(e){return Boolean(e&&"distance"in e)}function Ko(e){return Boolean(e&&"delay"in e)}Xo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Go,onActivation:r}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(o.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Jo{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=Dn(e);return e instanceof t?e:Fn(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:l}=r;this.props=e,this.events=t,this.document=Fn(l),this.documentListeners=new Po(this.document),this.listeners=new Po(n),this.windowListeners=new Po(Dn(l)),this.initialCoordinates=null!=(o=_n(r))?o:io,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add($o.Resize,this.handleCancel),this.windowListeners.add($o.DragStart,jo),this.windowListeners.add($o.VisibilityChange,this.handleCancel),this.windowListeners.add($o.ContextMenu,jo),this.documentListeners.add($o.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ko(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Yo(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add($o.Click,_o,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($o.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:l,options:{activationConstraint:i}}=r;if(!o)return;const a=null!=(t=_n(e))?t:io,s=Un(o,a);if(!n&&i){if(Yo(i)){if(null!=i.tolerance&&Wo(s,i.tolerance))return this.handleCancel();if(Wo(s,i.distance))return this.handleStart()}return Ko(i)&&Wo(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Uo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Qo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class er extends Jo{constructor(e){const{event:t}=e,n=Fn(t.target);super(e,Qo,n)}}er.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const tr={move:{name:"mousemove"},end:{name:"mouseup"}};var nr;!function(e){e[e.RightClick=2]="RightClick"}(nr||(nr={}));class or extends Jo{constructor(e){super(e,tr,Fn(e.event.target))}}or.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==nr.RightClick&&(null==o||o({event:n}),!0)}}];const rr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class lr extends Jo{constructor(e){super(e,rr)}static setup(){return window.addEventListener(rr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(rr.move.name,e)};function e(){}}}var ir,ar;function sr(e){let{acceleration:t,activator:n=ir.Pointer,canScroll:o,draggingRect:r,enabled:l,interval:i=5,order:a=ar.TreeOrder,pointerCoordinates:s,scrollableAncestors:d,scrollableAncestorRects:c,delta:u,threshold:g}=e;const h=function(e){let{delta:t,disabled:n}=e;const o=Bn(t);return Ln(e=>{if(n||!o||!e)return dr;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Eo.Backward]:e.x[Eo.Backward]||-1===r.x,[Eo.Forward]:e.x[Eo.Forward]||1===r.x},y:{[Eo.Backward]:e.y[Eo.Backward]||-1===r.y,[Eo.Forward]:e.y[Eo.Forward]||1===r.y}}},[n,t,o])}({delta:u,disabled:!l}),[m,p]=function(){const e=re(null);return[ae((t,n)=>{e.current=setInterval(t,n)},[]),ae(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),f=re({x:0,y:0}),v=re({x:0,y:0}),w=te(()=>{switch(n){case ir.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case ir.DraggableRect:return r}},[n,r,s]),y=re(null),b=ae(()=>{const e=y.current;if(!e)return;const t=f.current.x*v.current.x,n=f.current.y*v.current.y;e.scrollBy(t,n)},[]),q=te(()=>a===ar.TreeOrder?[...d].reverse():d,[a,d]);le(()=>{if(l&&d.length&&w){for(const e of q){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=c[n];if(!r)continue;const{direction:l,speed:a}=No(e,r,w,t,g);for(const e of["x","y"])h[e][l[e]]||(a[e]=0,l[e]=0);if(a.x>0||a.y>0)return p(),y.current=e,m(b,i),f.current=a,void(v.current=l)}f.current={x:0,y:0},v.current={x:0,y:0},p()}else p()},[t,b,o,p,l,i,JSON.stringify(w),JSON.stringify(h),m,d,q,c,JSON.stringify(g)])}lr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ir||(ir={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ar||(ar={}));const dr={x:{[Eo.Backward]:!1,[Eo.Forward]:!1},y:{[Eo.Backward]:!1,[Eo.Forward]:!1}};var cr,ur;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(cr||(cr={})),function(e){e.Optimized="optimized"}(ur||(ur={}));const gr=new Map;function hr(e,t){return Ln(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function mr(e){let{callback:t,disabled:n}=e;const o=Nn(t),r=te(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return le(()=>()=>null==r?void 0:r.disconnect(),[r]),r}function pr(e){return new Ho(xo(e),e)}function fr(e,t,n){void 0===t&&(t=pr);const[o,r]=ne(null);function l(){r(o=>{if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const l=t(e);return JSON.stringify(o)===JSON.stringify(l)?o:l})}const i=function(e){let{callback:t,disabled:n}=e;const o=Nn(t),r=te(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return le(()=>()=>null==r?void 0:r.disconnect(),[r]),r}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){l();break}}}}),a=mr({callback:l});return In(()=>{l(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())},[e]),o}const vr=[];function wr(e,t){void 0===t&&(t=[]);const n=re(null);return le(()=>{n.current=null},t),le(()=>{const t=e!==io;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Un(e,n.current):io}function yr(e){return te(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const br=[];function qr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return En(t)?t:e}const Cr=[{sensor:er,options:{}},{sensor:Xo,options:{}}],xr={current:{}},Sr={draggable:{measure:So},droppable:{measure:So,strategy:cr.WhileDragging,frequency:ur.Optimized},dragOverlay:{measure:xo}};class kr extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Rr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ro},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sr,measureDroppableContainers:ro,windowRect:null,measuringScheduled:!1},Mr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ro,draggableNodes:new Map,over:null,measureDroppableContainers:ro},Tr=ge(Mr),Dr=ge(Rr);function Ar(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function Er(e,t){switch(t.type){case oo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case oo.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case oo.DragEnd:case oo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case oo.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new kr(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case oo.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const i=new kr(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case oo.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new kr(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function zr(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=he(Tr),l=Bn(o),i=Bn(null==n?void 0:n.id);return le(()=>{if(!t&&!o&&l&&null!=i){if(!jn(l))return;if(document.activeElement===l.target)return;const e=r.get(i);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Xn(e);if(t){t.focus();break}}})}},[o,t,r,i,l]),null}function Fr(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...o}),n):n}const Ir=ge({...io,scaleX:1,scaleY:1});var Nr;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Nr||(Nr={}));const Or=ee(function(e){var t,n,o,r;let{id:l,accessibility:i,autoScroll:a=!0,children:s,sensors:d=Cr,collisionDetection:c=vo,measuring:u,modifiers:g,...h}=e;const m=de(Er,void 0,Ar),[p,f]=m,[v,w]=function(){const[e]=ne(()=>new Set),t=ae(t=>(e.add(t),()=>e.delete(t)),[e]);return[ae(t=>{let{type:n,event:o}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)})},[e]),t]}(),[y,b]=ne(Nr.Uninitialized),q=y===Nr.Initialized,{draggable:{active:C,nodes:x,translate:S},droppable:{containers:k}}=p,R=null!=C?x.get(C):null,M=re({initial:null,translated:null}),T=te(()=>{var e;return null!=C?{id:C,data:null!=(e=null==R?void 0:R.data)?e:xr,rect:M}:null},[C,R]),D=re(null),[A,E]=ne(null),[z,F]=ne(null),I=On(h,Object.values(h)),N=Pn("DndDescribedBy",l),O=te(()=>k.getEnabled(),[k]),L=te(()=>({draggable:{...Sr.draggable,...null==V?void 0:V.draggable},droppable:{...Sr.droppable,...null==V?void 0:V.droppable},dragOverlay:{...Sr.dragOverlay,...null==V?void 0:V.dragOverlay}}),[null==(V=u)?void 0:V.draggable,null==V?void 0:V.droppable,null==V?void 0:V.dragOverlay]);var V;const{droppableRects:B,measureDroppableContainers:H,measuringScheduled:P}=function(e,t){let{dragging:n,dependencies:o,config:r}=t;const[l,i]=ne(null),{frequency:a,measure:s,strategy:d}=r,c=re(e),u=function(){switch(d){case cr.Always:return!1;case cr.BeforeDragging:return n;default:return!n}}(),g=On(u),h=ae(function(e){void 0===e&&(e=[]),g.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[g]),m=re(null),p=Ln(t=>{if(u&&!n)return gr;if(!t||t===gr||c.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new Ho(s(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,l,n,u,s]);return le(()=>{c.current=e},[e]),le(()=>{u||h()},[n,u]),le(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),le(()=>{u||"number"!=typeof a||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},a))},[a,u,h,...o]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:null!=l}}(O,{dragging:q,dependencies:[S.x,S.y],config:L.droppable}),W=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return Ln(e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null},[o,t])}(x,C),$=te(()=>z?_n(z):null,[z]),U=function(){const e=!1===(null==A?void 0:A.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=q&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),j=function(e,t){return hr(e,t)}(W,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const l=re(!1),{x:i,y:a}="boolean"==typeof r?{x:r,y:r}:r;In(()=>{if(!i&&!a||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=wo(n(e),o);if(i||(r.x=0),a||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ro(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,i,a,o,n])}({activeNode:null!=C?x.get(C):null,config:U.layoutShiftCompensation,initialRect:j,measure:L.draggable.measure});const _=fr(W,L.draggable.measure,j),G=fr(W?W.parentElement:null),Z=re({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=k.getNodeFor(null==(t=Z.current.over)?void 0:t.id),Y=function(e){let{measure:t}=e;const[n,o]=ne(null),r=mr({callback:ae(e=>{for(const{target:n}of e)if(En(n)){o(e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o});break}},[t])}),l=ae(e=>{const n=qr(e);null==r||r.disconnect(),n&&(null==r||r.observe(n)),o(n?t(n):null)},[t,r]),[i,a]=Vn(l);return te(()=>({nodeRef:i,rect:n,setRef:a}),[n,i,a])}({measure:L.dragOverlay.measure}),K=null!=(n=Y.nodeRef.current)?n:W,J=q?null!=(o=Y.rect)?o:_:null,ee=Boolean(Y.nodeRef.current&&Y.rect),oe=wo(ie=ee?null:_,hr(ie));var ie;const se=yr(K?Dn(K):null),ce=function(e){const t=re(e),n=Ln(n=>e?n&&n!==vr&&e&&t.current&&e.parentNode===t.current.parentNode?n:ko(e):vr,[e]);return le(()=>{t.current=e},[e]),n}(q?null!=X?X:W:null),ue=function(e,t){void 0===t&&(t=xo);const[n]=e,o=yr(n?Dn(n):null),[r,l]=ne(br);function i(){l(()=>e.length?e.map(e=>zo(e)?o:new Ho(t(e),e)):br)}const a=mr({callback:i});return In(()=>{null==a||a.disconnect(),i(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),r}(ce),ge=Fr(g,{transform:{x:S.x-oe.x,y:S.y-oe.y,scaleX:1,scaleY:1},activatorEvent:z,active:T,activeNodeRect:_,containerNodeRect:G,draggingNodeRect:J,over:Z.current.over,overlayNodeRect:Y.rect,scrollableAncestors:ce,scrollableAncestorRects:ue,windowRect:se}),he=$?$n($,S):null,me=function(e){const[t,n]=ne(null),o=re(e),r=ae(e=>{const t=Mo(e.target);t&&n(e=>e?(e.set(t,Ao(t)),new Map(e)):null)},[]);return le(()=>{const t=o.current;if(e!==t){l(t);const i=e.map(e=>{const t=Mo(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,Ao(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),o.current=e}return()=>{l(e),l(t)};function l(e){e.forEach(e=>{const t=Mo(e);null==t||t.removeEventListener("scroll",r)})}},[r,e]),te(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>$n(e,t),io):Lo(e):io,[e,t])}(ce),pe=wr(me),fe=wr(me,[_]),ve=$n(ge,pe),we=J?bo(J,ge):null,ye=T&&we?c({active:T,collisionRect:we,droppableRects:B,droppableContainers:O,pointerCoordinates:he}):null,be=ho(ye,"id"),[qe,Ce]=ne(null),xe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ee?ge:$n(ge,fe),null!=(r=null==qe?void 0:qe.rect)?r:null,_),Se=re(null),ke=ae((e,t)=>{let{sensor:n,options:o}=t;if(null==D.current)return;const r=x.get(D.current);if(!r)return;const l=e.nativeEvent,i=new n({active:D.current,activeNode:r,event:l,options:o,context:Z,onAbort(e){if(!x.get(e))return;const{onDragAbort:t}=I.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!x.get(e))return;const{onDragPending:r}=I.current,l={id:e,constraint:t,initialCoordinates:n,offset:o};null==r||r(l),v({type:"onDragPending",event:l})},onStart(e){const t=D.current;if(null==t)return;const n=x.get(t);if(!n)return;const{onDragStart:o}=I.current,r={activatorEvent:l,active:{id:t,data:n.data,rect:M}};Me(()=>{null==o||o(r),b(Nr.Initializing),f({type:oo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:r}),E(Se.current),F(l)})},onMove(e){f({type:oo.DragMove,coordinates:e})},onEnd:a(oo.DragEnd),onCancel:a(oo.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=Z.current;let i=null;if(t&&r){const{cancelDrop:a}=I.current;if(i={activatorEvent:l,active:t,collisions:n,delta:r,over:o},e===oo.DragEnd&&"function"==typeof a){await Promise.resolve(a(i))&&(e=oo.DragCancel)}}D.current=null,Me(()=>{f({type:e}),b(Nr.Uninitialized),Ce(null),E(null),F(null),Se.current=null;const t=e===oo.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=I.current[t];null==e||e(i),v({type:t,event:i})}})}}Se.current=i},[x]),Re=ae((e,t)=>(n,o)=>{const r=n.nativeEvent,l=x.get(o);if(null!==D.current||!l||r.dndKit||r.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},D.current=o,ke(n,t))},[x,ke]),Te=function(e,t){return te(()=>e.reduce((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,Re);!function(e){le(()=>{if(!Rn)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),In(()=>{_&&y===Nr.Initializing&&b(Nr.Initialized)},[_,y]),le(()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:o,over:r}=Z.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:ve.x,y:ve.y},over:r};Me(()=>{null==e||e(l),v({type:"onDragMove",event:l})})},[ve.x,ve.y]),le(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=Z.current;if(!e||null==D.current||!t||!r)return;const{onDragOver:l}=I.current,i=o.get(be),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:a};Me(()=>{Ce(a),null==l||l(s),v({type:"onDragOver",event:s})})},[be]),In(()=>{Z.current={activatorEvent:z,active:T,activeNode:W,collisionRect:we,collisions:ye,droppableRects:B,draggableNodes:x,draggingNode:K,draggingNodeRect:J,droppableContainers:k,over:qe,scrollableAncestors:ce,scrollAdjustedTranslate:ve},M.current={initial:J,translated:we}},[T,W,ye,we,x,K,J,B,k,qe,ce,ve]),sr({...U,delta:S,draggingRect:we,pointerCoordinates:he,scrollableAncestors:ce,scrollableAncestorRects:ue});const De=te(()=>({active:T,activeNode:W,activeNodeRect:_,activatorEvent:z,collisions:ye,containerNodeRect:G,dragOverlay:Y,draggableNodes:x,droppableContainers:k,droppableRects:B,over:qe,measureDroppableContainers:H,scrollableAncestors:ce,scrollableAncestorRects:ue,measuringConfiguration:L,measuringScheduled:P,windowRect:se}),[T,W,_,z,ye,G,Y,x,k,B,qe,H,ce,ue,L,P,se]),Ae=te(()=>({activatorEvent:z,activators:Te,active:T,activeNodeRect:_,ariaDescribedById:{draggable:N},dispatch:f,draggableNodes:x,over:qe,measureDroppableContainers:H}),[z,Te,T,_,f,N,x,qe,H]);return Q.createElement(Qn.Provider,{value:w},Q.createElement(Tr.Provider,{value:Ae},Q.createElement(Dr.Provider,{value:De},Q.createElement(Ir.Provider,{value:xe},s)),Q.createElement(zr,{disabled:!1===(null==i?void 0:i.restoreFocus)})),Q.createElement(no,{...i,hiddenTextDescribedById:N}))}),Lr=ge(null),Vr="button";function Br(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const l=Pn("Draggable"),{activators:i,activatorEvent:a,active:s,activeNodeRect:d,ariaDescribedById:c,draggableNodes:u,over:g}=he(Tr),{role:h=Vr,roleDescription:m="draggable",tabIndex:p=0}=null!=r?r:{},f=(null==s?void 0:s.id)===t,v=he(f?Ir:Lr),[w,y]=Vn(),[b,q]=Vn(),C=function(e,t){return te(()=>e.reduce((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e},{}),[e,t])}(i,t),x=On(n);In(()=>(u.set(t,{id:t,key:l,node:w,activatorNode:b,data:x}),()=>{const e=u.get(t);e&&e.key===l&&u.delete(t)}),[u,t]);return{active:s,activatorEvent:a,activeNodeRect:d,attributes:te(()=>({role:h,tabIndex:p,"aria-disabled":o,"aria-pressed":!(!f||h!==Vr)||void 0,"aria-roledescription":m,"aria-describedby":c.draggable}),[o,h,p,f,m,c.draggable]),isDragging:f,listeners:o?void 0:C,node:w,over:g,setNodeRef:y,setActivatorNodeRef:q,transform:v}}function Hr(){return he(Dr)}const Pr={timeout:25};function Wr(e){let{animation:t,children:n}=e;const[o,r]=ne(null),[l,i]=ne(null),a=Bn(n);return n||o||!a||r(a),In(()=>{if(!l)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,l)).then(()=>{r(null)}):r(null)},[t,o,l]),Q.createElement(Q.Fragment,null,n,o?me(o,{ref:i}):null)}const $r={x:0,y:0,scaleX:1,scaleY:1};function Ur(e){let{children:t}=e;return Q.createElement(Tr.Provider,{value:Mr},Q.createElement(Ir.Provider,{value:$r},t))}const jr={position:"fixed",touchAction:"none"},_r=e=>jn(e)?"transform 250ms ease":void 0,Gr=oe((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:l,className:i,rect:a,style:s,transform:d,transition:c=_r}=e;if(!a)return null;const u=r?d:{...d,scaleX:1,scaleY:1},g={...jr,width:a.width,height:a.height,top:a.top,left:a.left,transform:Gn.Transform.toString(u),transformOrigin:r&&o?so(o,a):void 0,transition:"function"==typeof c?c(o):c,...s};return Q.createElement(n,{className:i,style:g,ref:t},l)}),Zr=e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:l,className:i}=e;if(null!=l&&l.active)for(const[e,t]of Object.entries(l.active))void 0!==t&&(r[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=l&&l.dragOverlay)for(const[e,t]of Object.entries(l.dragOverlay))void 0!==t&&o.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&o.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(r))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},Xr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Gn.Transform.toString(t)},{transform:Gn.Transform.toString(n)}]},sideEffects:Zr({styles:{active:{opacity:"0"}}})};function Yr(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:r}=e;return Nn((e,l)=>{if(null===t)return;const i=n.get(e);if(!i)return;const a=i.node.current;if(!a)return;const s=qr(l);if(!s)return;const{transform:d}=Dn(l).getComputedStyle(l),c=qo(d);if(!c)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:o,keyframes:r}={...Xr,...e};return e=>{let{active:l,dragOverlay:i,transform:a,...s}=e;if(!t)return;const d={x:i.rect.left-l.rect.left,y:i.rect.top-l.rect.top},c={scaleX:1!==a.scaleX?l.rect.width*a.scaleX/i.rect.width:1,scaleY:1!==a.scaleY?l.rect.height*a.scaleY/i.rect.height:1},u={x:a.x-d.x,y:a.y-d.y,...c},g=r({...s,active:l,dragOverlay:i,transform:{initial:a,final:u}}),[h]=g,m=g[g.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const p=null==o?void 0:o({active:l,dragOverlay:i,...s}),f=i.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{f.onfinish=()=>{null==p||p(),e()}})}}(t);return Vo(a,r.draggable.measure),u({active:{id:e,data:i.data,node:a,rect:r.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:l,rect:r.dragOverlay.measure(s)},droppableContainers:o,measuringConfiguration:r,transform:c})})}let Kr=0;function Jr(e){return te(()=>{if(null!=e)return Kr++,Kr},[e])}const Qr=Q.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:l,modifiers:i,wrapperElement:a="div",className:s,zIndex:d=999}=e;const{activatorEvent:c,active:u,activeNodeRect:g,containerNodeRect:h,draggableNodes:m,droppableContainers:p,dragOverlay:f,over:v,measuringConfiguration:w,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:q}=Hr(),C=he(Ir),x=Jr(null==u?void 0:u.id),S=Fr(i,{activatorEvent:c,active:u,activeNodeRect:g,containerNodeRect:h,draggingNodeRect:f.rect,over:v,overlayNodeRect:f.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:C,windowRect:q}),k=hr(g),R=Yr({config:o,draggableNodes:m,droppableContainers:p,measuringConfiguration:w}),M=k?f.setRef:void 0;return Q.createElement(Ur,null,Q.createElement(Wr,{animation:R},u&&x?Q.createElement(Gr,{key:x,id:u.id,ref:M,as:a,activatorEvent:c,adjustScale:t,className:s,transition:l,rect:k,style:{zIndex:d,...r},transform:S},n):null))});function el(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function tl(e,t){return e.reduce((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e},Array(e.length))}function nl(e){return null!==e&&e>=0}const ol={scaleX:1,scaleY:1},rl=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:l,index:i}=e;const a=null!=(t=n[r])?t:o;if(!a)return null;const s=function(e,t,n){const o=e[t],r=e[t-1],l=e[t+1];if(!o||!r&&!l)return 0;if(n<t)return r?o.left-(r.left+r.width):l.left-(o.left+o.width);return l?l.left-(o.left+o.width):o.left-(r.left+r.width)}(n,i,r);if(i===r){const e=n[l];return e?{x:r<l?e.left+e.width-(a.left+a.width):e.left-a.left,y:0,...ol}:null}return i>r&&i<=l?{x:-a.width-s,y:0,...ol}:i<r&&i>=l?{x:a.width+s,y:0,...ol}:{x:0,y:0,...ol}};const ll=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=el(t,o,n),i=t[r],a=l[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},il="Sortable",al=Q.createContext({activeIndex:-1,containerId:il,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ll,disabled:{draggable:!1,droppable:!1}});function sl(e){let{children:t,id:n,items:o,strategy:r=ll,disabled:l=!1}=e;const{active:i,dragOverlay:a,droppableRects:s,over:d,measureDroppableContainers:c}=Hr(),u=Pn(il,n),g=Boolean(null!==a.rect),h=te(()=>o.map(e=>"object"==typeof e&&"id"in e?e.id:e),[o]),m=null!=i,p=i?h.indexOf(i.id):-1,f=d?h.indexOf(d.id):-1,v=re(h),w=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(h,v.current),y=-1!==f&&-1===p||w,b=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(l);In(()=>{w&&m&&c(h)},[w,h,m,c]),le(()=>{v.current=h},[h]);const q=te(()=>({activeIndex:p,containerId:u,disabled:b,disableTransforms:y,items:h,overIndex:f,useDragOverlay:g,sortedRects:tl(h,s),strategy:r}),[p,u,b.draggable,b.droppable,y,h,f,s,g,r]);return Q.createElement(al.Provider,{value:q},t)}const dl=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return el(n,o,r).indexOf(t)},cl=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:l,newIndex:i,previousItems:a,previousContainerId:s,transition:d}=e;return!(!d||!o)&&((a===l||r!==i)&&(!!n||i!==r&&t===s))},ul={duration:200,easing:"ease"},gl="transform",hl=Gn.Transition.toString({property:gl,duration:0,easing:"linear"}),ml={roleDescription:"sortable"};function pl(e){let{animateLayoutChanges:t=cl,attributes:n,disabled:o,data:r,getNewIndex:l=dl,id:i,strategy:a,resizeObserverConfig:s,transition:d=ul}=e;const{items:c,containerId:u,activeIndex:g,disabled:h,disableTransforms:m,sortedRects:p,overIndex:f,useDragOverlay:v,strategy:w}=he(al),y=function(e,t){var n,o;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,h),b=c.indexOf(i),q=te(()=>({sortable:{containerId:u,index:b,items:c},...r}),[u,r,b,c]),C=te(()=>c.slice(c.indexOf(i)),[c,i]),{rect:x,node:S,isOver:k,setNodeRef:R}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const l=Pn("Droppable"),{active:i,dispatch:a,over:s,measureDroppableContainers:d}=he(Tr),c=re({disabled:n}),u=re(!1),g=re(null),h=re(null),{disabled:m,updateMeasurementsFor:p,timeout:f}={...Pr,...r},v=On(null!=p?p:o),w=mr({callback:ae(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),h.current=null},f)):u.current=!0},[f]),disabled:m||!i}),y=ae((e,t)=>{w&&(t&&(w.unobserve(t),u.current=!1),e&&w.observe(e))},[w]),[b,q]=Vn(y),C=On(t);return le(()=>{w&&b.current&&(w.disconnect(),u.current=!1,w.observe(b.current))},[b,w]),le(()=>(a({type:oo.RegisterDroppable,element:{id:o,key:l,disabled:n,node:b,rect:g,data:C}}),()=>a({type:oo.UnregisterDroppable,key:l,id:o})),[o]),le(()=>{n!==c.current.disabled&&(a({type:oo.SetDroppableDisabled,id:o,key:l,disabled:n}),c.current.disabled=n)},[o,l,n,a]),{active:i,rect:g,isOver:(null==s?void 0:s.id)===o,node:b,over:s,setNodeRef:q}}({id:i,data:q,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...s}}),{active:M,activatorEvent:T,activeNodeRect:D,attributes:A,setNodeRef:E,listeners:z,isDragging:F,over:I,setActivatorNodeRef:N,transform:O}=Br({id:i,data:q,attributes:{...ml,...n},disabled:y.draggable}),L=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return te(()=>e=>{t.forEach(t=>t(e))},t)}(R,E),V=Boolean(M),B=V&&!m&&nl(g)&&nl(f),H=!v&&F,P=H&&B?O:null,W=B?null!=P?P:(null!=a?a:w)({rects:p,activeNodeRect:D,activeIndex:g,overIndex:f,index:b}):null,$=nl(g)&&nl(f)?l({id:i,items:c,activeIndex:g,overIndex:f}):b,U=null==M?void 0:M.id,j=re({activeId:U,items:c,newIndex:$,containerId:u}),_=c!==j.current.items,G=t({active:M,containerId:u,isDragging:F,isSorting:V,id:i,index:b,items:c,newIndex:j.current.newIndex,previousItems:j.current.items,previousContainerId:j.current.containerId,transition:d,wasDragging:null!=j.current.activeId}),Z=function(e){let{disabled:t,index:n,node:o,rect:r}=e;const[l,i]=ne(null),a=re(n);return In(()=>{if(!t&&n!==a.current&&o.current){const e=r.current;if(e){const t=xo(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&i(n)}}n!==a.current&&(a.current=n)},[t,n,o,r]),le(()=>{l&&i(null)},[l]),l}({disabled:!G,index:b,node:S,rect:x});return le(()=>{V&&j.current.newIndex!==$&&(j.current.newIndex=$),u!==j.current.containerId&&(j.current.containerId=u),c!==j.current.items&&(j.current.items=c)},[V,$,u,c]),le(()=>{if(U===j.current.activeId)return;if(null!=U&&null==j.current.activeId)return void(j.current.activeId=U);const e=setTimeout(()=>{j.current.activeId=U},50);return()=>clearTimeout(e)},[U]),{active:M,activeIndex:g,attributes:A,data:q,rect:x,index:b,newIndex:$,items:c,isOver:k,isSorting:V,isDragging:F,listeners:z,node:S,overIndex:f,over:I,setNodeRef:L,setActivatorNodeRef:N,setDroppableNodeRef:R,setDraggableNodeRef:E,transform:null!=Z?Z:W,transition:function(){if(Z||_&&j.current.newIndex===b)return hl;if(H&&!jn(T)||!d)return;if(V||G)return Gn.Transition.toString({...d,property:gl});return}()}}function fl(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const vl=[Uo.Down,Uo.Right,Uo.Up,Uo.Left],wl=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:l,over:i,scrollableAncestors:a}}=t;if(vl.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];l.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const l=r.get(n.id);if(l)switch(e.code){case Uo.Down:o.top<l.top&&t.push(n);break;case Uo.Up:o.top>l.top&&t.push(n);break;case Uo.Left:o.left>l.left&&t.push(n);break;case Uo.Right:o.left<l.left&&t.push(n)}});const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=go(t),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=go(o),i=r.reduce((e,t,o)=>e+ao(n[o],t),0),a=Number((i/4).toFixed(4));l.push({id:t,data:{droppableContainer:e,value:a}})}}return l.sort(co)})({collisionRect:o,droppableRects:r,droppableContainers:t});let d=ho(s,"id");if(d===(null==i?void 0:i.id)&&s.length>1&&(d=s[1].id),null!=d){const e=l.get(n.id),t=l.get(d),i=t?r.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&i&&e&&t){const n=ko(s).some((e,t)=>a[t]!==e),r=yl(e,t),l=function(e,t){if(!fl(e)||!fl(t))return!1;if(!yl(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),d=n||!r?{x:0,y:0}:{x:l?o.width-i.width:0,y:l?o.height-i.height:0},c={x:i.left,y:i.top};return d.x&&d.y?c:Un(c,d)}}}};function yl(e,t){return!(!fl(e)||!fl(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const bl=e=>{let{transform:t}=e;return{...t,y:0}},ql=ee(oe((e,t)=>{const{children:n,style:o,className:r,index:l,editing:i,editable:a,selectedIndex:s,background:d,activeColor:c,borderColor:u,borderWidth:g,dragging:h,...m}=e;return G("div",{ref:t,className:st(r),style:{...o,display:"flex",flexDirection:"column",background:s===l?"white":d,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...m,children:[G("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[_("div",{style:{marginLeft:s===l?"0px":"-1px",marginTop:s===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===l?_("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):_(Z,{})]}),_("div",{style:{flex:"1 1 100%",background:s===l&&c?c?.toCSS():"none",minHeight:"2px"}})]})})),Cl={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"},xl=Q.memo(Q.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:l,height:i,index:a,listeners:s,onRemove:d,renderItem:c,sorting:u,style:g,transition:h,transform:m,value:p,wrapperStyle:f,...v},w)=>{le(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=c?c({dragOverlay:Boolean(t),dragging:Boolean(n),sorting:Boolean(u),index:a,fadeIn:Boolean(r),listeners:s,ref:w,style:g,transform:m,transition:h,value:p}):_(Z,{children:p});return _("div",{className:st("tab-item",Cl.Wrapper,r&&Cl.fadeIn,u&&Cl.sorting,t&&Cl.dragOverlay),style:{...f,transition:[h,f?.transition].filter(Boolean).join(", "),"--translate-x":m?`${Math.round(m.x)}px`:void 0,"--translate-y":m?`${Math.round(m.y)}px`:void 0,"--scale-x":m?.scaleX?`${m.scaleX}`:void 0,"--scale-y":m?.scaleY?`${m.scaleY}`:void 0,"--index":a},ref:w,children:_("div",{className:st(Cl.Item,n&&Cl.dragging,l&&Cl.withHandle,t&&Cl.dragOverlay,o&&Cl.disabled,e&&Cl.color,"dragging"),style:g,"data-cypress":"draggable-item",...l?void 0:s,...v,tabIndex:l?void 0:-1,children:y})})})),Sl={Row:"_Row_1kr10_1"},kl=ee(oe(({children:e,horizontal:t,style:n},o)=>_("div",{ref:o,style:{...n},className:st(Sl.Row,t&&Sl.horizontal),children:e}))),Rl={...Xr},Ml=ee(oe((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:l=!1,collisionDetection:i=po,coordinateGetter:a=wl,dropAnimation:s=Rl,getItemStyles:d=()=>({}),getNewIndex:c,handle:u=!1,items:g,onMove:h,isDisabled:m=()=>!1,measuring:p,modifiers:f,renderItem:v,renderDivider:w,reorderItems:y=el,strategy:b=ll,style:q,useDragOverlay:C=!0,onDragStart:x,wrapperStyle:S=()=>({})}=e,[k,R]=ne(()=>g);le(()=>{R(g)},[g]);const[M,T]=ne(null),D=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return te(()=>[...t].filter(e=>null!=e),[...t])}(lo(or,{activationConstraint:o}),lo(lr,{activationConstraint:o}),lo(Xo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:a})),A=k.indexOf.bind(k),E=M?A(M):-1,z=[];k.map((e,t)=>{z.push(_(Tl,{id:e,handle:u,index:t,style:d,wrapperStyle:S,disabled:m(e),renderItem:v,animateLayoutChanges:r,useDragOverlay:C,getNewIndex:c},e+"-"+t));const n=w?.({key:"divider-"+t});n&&z.push(n)});const{getPortalContainer:F}=P();return G(Or,{sensors:D,collisionDetection:i,onDragStart:e=>{const{active:t}=e;t&&(x?.(e),T(t.id))},autoScroll:{canScroll:e=>!0},onDragEnd:e=>{if(T(null),e.over){const t=A(e.over.id);E!==t&&(R(e=>y(e,E,t)),h?.(E,t))}},onDragCancel:()=>{T(null)},measuring:p,modifiers:f,children:[_("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...q},className:st(n,Cl.Wrapper),children:_(sl,{items:k,strategy:b,children:_(kl,{ref:t,children:z})})}),C?Te(_(Qr,{adjustScale:l,dropAnimation:s,children:M?_(xl,{value:k[E],handle:u,renderItem:v,wrapperStyle:S({index:E,isDragging:!0,id:k[E]}),index:E,dragging:!0,style:d({id:k[E],index:E,isSorting:null!==M,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),F()):null]})}));function Tl({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:l,onRemove:i,style:a,renderItem:s,useDragOverlay:d,wrapperStyle:c}){const{attributes:u,isDragging:g,isSorting:h,listeners:m,overIndex:p,setNodeRef:f,transform:v,transition:w}=pl({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return _(xl,{ref:f,value:r,disabled:e,dragging:g,sorting:h,handle:o,renderItem:s,index:l,style:a({index:l,id:r,isDragging:g,isSorting:h,overIndex:p}),onRemove:i?()=>i(r):void 0,transform:v,transition:w,wrapperStyle:c({index:l,isDragging:g,id:r}),listeners:m,"data-index":l,"data-id":r,dragOverlay:!d&&g,...u})}const Dl="_TabStrip_3x0dp_1",Al=new h("rgb(33, 115, 70)"),El="#eee",zl=e=>_(ql,{...e}),Fl=ee(oe((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:l=0,tabNames:i=[],onSelectedTabIndexChange:a,onTabNameChange:s,onTabMove:d,createScrollStartButton:c=W,createScrollEndButton:u=$,createScrollEdgeButton:g=U,createTabButton:h=zl,createTabDivider:m,editLabelProps:p,disabled:f=!1,disableDrag:v=!1,background:w="white",activeColor:y=Al,borderColor:b=El,borderWidth:q=1}=e,[C,x]=ne(l),[S,k]=ne(i),R=ae(e=>{const t=F.current?.[e]?.closest(".tab-item")??F.current?.[e];t&&P.current?.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:"smooth"})},[]);le(()=>{R(l)},[l]);const M=ae((e,t)=>{t!==C&&(x(t),a?.(t)),R(t)},[a,C]),T=ae((e,t)=>{d?.(e,t)},[d]),D=re(null),[A,E]=ne(-1),z=ae((e,t)=>{s?.(e,t)},[s]);ie(()=>{x(l)},[l]),ie(()=>{k(i)},[i]);const F=re([]),N=re(null);pe(t,()=>Object.assign({startEdit(e){F.current?.[e]?.startEdit()},cancel(e){F.current?.[e]?.cancel()}},N.current),[C,A]);const O=ae(({value:e,index:t,dragging:n})=>{const{style:o,maxLength:r,...l}=p||{},i=_(kn,{ref:e=>{F.current[t]=e},value:e,disabled:f,maxLength:r,style:{color:C===t&&y?y?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...o},styleHover:{},onSubmit:e=>(D.current=!1,E(-1),z(t,e)),onCancel:()=>{D.current=!1,E(-1)},onChange:e=>{D.current=!0,E(t)},...l});return h({onClick:e=>M(e,t),value:e,index:t,editing:A===t&&D.current,editable:!0,disabled:f,selectedIndex:C,background:w,activeColor:y,borderColor:b,borderWidth:q,dragging:n,children:i})},[C,z,M,p,f,A,h]),[L,{width:V}]=Ye(),[B,{width:H}]=Ye(),P=re(null),[X,Y]=ne({left:0,top:0,width:0,height:0}),[K,J]=ne(null);le(()=>{null!==K&&P.current&&P.current.scrollTo({left:K,behavior:"smooth"})},[K]);const Q=ae((e,t=!1)=>{if(!P.current)return 0;let n=P.current.firstChild.getBoundingClientRect(),o=P.current.firstChild.firstChild.children,r=0;return r=t?0:j.getScrollTo(e,n.left,o,!0,Math.max(0,e-200)),J(r),Math.max(0,r)},[]),ee=ae((e,t=!1)=>{if(!P.current)return 0;let n=P.current.firstChild.getBoundingClientRect(),o=P.current.firstChild.firstChild.children,r=0;const l=Math.ceil(H-V);return r=t?l:j.getScrollTo(e,n.left,o,!1,Math.max(0,e+200)),J(r),Math.min(l,r)},[H,V]),oe=re(null),se=re(null),de=ae(()=>{se.current&&(clearTimeout(se.current),se.current=null,oe.current=null)},[]),ce=ae((e,t,n=260)=>{oe.current=e,se.current=setTimeout(()=>{const n=t?Q(oe.current||e):ee(oe.current||e);n!==oe.current?ce(n,t,120):de()},n)},[Q,ee,de]);le(()=>()=>de(),[de]);const ue=te(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(X.left)<=0||0===Math.floor(H-V),orientation:I.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>ce(P.current.scrollLeft,!0),onClick:e=>Q(Math.min(P.current.scrollLeft,K??Number.MAX_SAFE_INTEGER),e.ctrlKey)}),[X,K,H,V]),ge=te(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(H-V)<=Math.ceil(X.left),orientation:I.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>ce(P.current.scrollLeft,!1),onClick:e=>ee(Math.max(P.current.scrollLeft,K??0),e.ctrlKey)}),[X,K,H,V]),he=te(()=>G(Z,{children:[_("div",{style:{minWidth:"16px"}}),n,g?.(ue)]}),[ue,ge,c,u,n,g]);return G("div",{style:{...o,display:"flex",alignItems:"stretch"},className:st(Dl,r),ref:N,children:[_("div",{style:{borderTop:`solid ${b} ${q}px`,position:"absolute",width:"100%"}}),_("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:he}),_("div",{className:"Tabs",ref:L,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:_("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:P,onScroll:e=>{Y({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:_(Ml,{isDisabled:e=>f||v,items:S,strategy:rl,modifiers:[bl],ref:B,renderItem:O,renderDivider:m,onMove:T,activationConstraint:{distance:15}})})}),_("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:g(ge)})]})}));Fl.displayName="TabStrip";const Il=e=>G("svg",{...e,viewBox:"0 0 48 48",children:[_("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"}),_("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"}),_("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"}),_("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"})]}),Nl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),_("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),_("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),_("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),_("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),_("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"})]}),Ol=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),_("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"})]}),Ll=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),_("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"})]}),Vl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),_("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"})]}),Bl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),Hl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),_("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"})]}),Pl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),Wl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),$l=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),Ul=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"}),_("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"})]}),jl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"}),_("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"})]}),_l=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),_("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),_("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),_("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),_("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),_("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"})]}),Gl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),_("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"})]}),Zl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),_("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"})]}),Xl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),_("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"}),_("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"})]}),Yl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),_("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"}),_("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"}),_("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),Kl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),_("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"})]}),Jl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"})]}),Ql=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"})]}),ei=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),ti=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"})]}),ni=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),oi=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),_("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),_("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),_("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),_("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),_("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"})]}),ri=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),_("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),_("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),_("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),_("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),_("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"})]}),li=ge(null),ii=e=>{const{themes:t,children:n}=e;return _(li.Provider,{value:t,children:n})},ai=()=>{const e=he(li),[t]=ne(()=>new b);return te(()=>e||t,[e])},si="_script-editor_iy654_5",di=Q.lazy(()=>import("./DGWjkC_oxdK41IpV.mjs")),ci={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:"\t})]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},ui=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString()),a=e.getPosition();let s={...a};s.lineNumber=1,s.column=1;let d=!1;for(let e=a.lineNumber;e>=1;e--){if(""===o.getLineContent(e).trim()){const t=mi(i,o.getOffsetAt({lineNumber:e,column:1}),"function");if(!t||pi(t)){d=!0,s.lineNumber=e+1;break}{const n=t.spans[0].start;e=o.getPositionAt(n).lineNumber,s.lineNumber=e}}}let c=n,u=!1;!d&&!c.startsWith("\n")&&s.lineNumber>1&&(c="\n"+c,u=!0);let g=!1;o.getLineCount()>1&&(c.endsWith("\n\n")||(c+="\n\n",g=!0));const h=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${c}`}];let m=null;o.pushEditOperations([],h,e=>(m=e[0].range,u&&m.startLineNumber++,g&&m.endLineNumber--,[new t.Selection(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)])),e.setSelection({startLineNumber:m.endLineNumber,startColumn:m.endColumn,endLineNumber:m.startLineNumber,endColumn:m.startColumn})};function gi(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function hi(e,t,n,o,r=[]){if("function"===o.kind&&"export"===o.kindModifiers){const t=o.spans[0].start,l=e.getPositionAt(t);r.push({name:o.text,type:gi(n,o),lineNumber:l.lineNumber})}if(o.childItems)for(const l of o.childItems)hi(e,t,n,l,r);return r}function mi(e,t,n="function",o){const r=e.spans;for(let l=0;l<r.length;l++){const i=r[l];if(i.start<=t&&t<i.start+i.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const r of e.childItems||[]){const e=mi(r,t,n,o);if(e)return e}}return null}}function pi(e){return"comment"===e.kind}const fi=ee(oe((e,t)=>{const{className:n,style:o,commands:r,readOnly:l=!1,onClose:i,darkMode:a,loadingPanel:s,autoFocus:d=!0,onStatusChange:c,...u}=e,g=re(null),h=x(i,[i]),m=re(!1),p=te(()=>({contains(e){if(!g.current)return;const t=g.current.editor;return t&&t.getDomNode()?.contains(e)},focus(){if(!g.current)return;const e=g.current.editor;return e&&e.getDomNode()?.focus()}}),[]),f=te(()=>[new R("help",p,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=te(()=>{let e=null;const t=()=>p;return e=r?r.createChildGroup(t,"scriptEditor",!1):new T(t,"scriptEditor"),e.addCommands(f,!0),e},[r,f]),w=F(v,["executeSelectedScript"])[0],y=w?.context(),b=x(e=>{w?.execute(e)},[w]),q=re(""),[S,k]=ne(!1),M=x(async()=>{if(!g.current)return null;const e=g.current,t=e.editor;if(!t)return null;const n=e.monaco,o=await(async(e,t,n="export")=>{const o=e.getModel();if(!o)return null;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString());let a=null,s=e.getSelection();const d=s.startLineNumber===s.endLineNumber&&s.startColumn===s.endColumn?o.getLineCount():Math.min(s.endLineNumber,o.getLineCount());for(let e=s.startLineNumber;!a&&e<=d;e++){const t=mi(i,o.getOffsetAt({lineNumber:e,column:1}),"function",n);t&&(a=t.text)}return a})(t,n);return c?.({message:(o??"").toUpperCase()}),o?{source:t.getValue(),name:o}:null},[c]);const D=x(async(e,t,n)=>{const o=await y.getScripts().createModule({source:n?.getValue(),declarationsOnly:!0}),r=o?o.getFunctions().search():X.EmptyArray;o&&(async function(e,t){const n=[];for(let o=1;o<e.getLineCount()+1;o++){const r={startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:e.getLineLength(o)+1},l=e.getValueInRange(r).indexOf("modelt");-1!==l&&n.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:t.MarkerSeverity.Hint,startLineNumber:r.startLineNumber,startColumn:l+1,endLineNumber:r.startLineNumber,endColumn:l+5})}t.editor.setModelMarkers(e,"owner",n)}(e,t),async function(e,t,n,o){const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(e.uri),i=await l.getNavigationTree(e.uri.toString()),a=hi(e,t,o,i).map(e=>{let n=null,o=null;return"formula"===e.type?(n="formula.margin-icon",o="Formula"):"macro"===e.type?(n="macro.margin-icon",o="Macro"):"autoRun"===e.type&&(n="autorun.margin-icon",o="Auto Run"),{range:new t.Range(e.lineNumber,1,e.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:n,glyphMarginHoverMessage:o,stickiness:t.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});I.current&&I.current.clear(),I.current=n.createDecorationsCollection(a)}(e,t,n,r))},[y]),A=x(X.debounce(D,580),[]),E=x(async(e=void 0)=>{if(!g.current||!y)return;const t=g.current.editor.getPosition(),n={cursor:t?t.toString():""};void 0!==e&&(n.message=e),c?.(n);const o=M();y.setSelectedFunction(o)},[y,c]);le(()=>{if(!y)return;const e={insertSnippet:e=>{g.current?.editor&&(S?ui(g.current.editor,g.current.monaco,e):q.current=e)}};y.setEditor(e),y.setSelectedFunction(M());const t=y.addContainerListener({onBeforeSave:async()=>{if(!g.current?.editor||!y)return;const e=g.current.editor,t=y?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue();if(!((n?.length??0)!==o.length||n!==o))return;await y.saveSource(e.getValue());const r=(n?.length??0)!==o.length||n!==o;c?.({dirty:r})},onReadonlyChange(){},onScriptChange:async()=>{if(!g.current?.editor||!y)return;const e=g.current.editor,t=y.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(t)}});return()=>{t(),y.setSelectedFunction(null),y.setEditor(null)}},[y,S]),le(()=>()=>{if(!g.current?.editor)return;const e=g.current.editor;y?.saveSource(e.getValue())},[]);const z=x(e=>{const t=g.current;if(!t)return!1;const n=t.editor;return!!n&&(n.focus(),!0)},[]),I=re(null),N=x((e,t)=>{g.current={monaco:t,editor:e},k(!0),E("Loading Types");const n=y.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(n),import("./DpKcTdC5MSNsa5UP.mjs").then(e=>e.c).then(n=>{E("");n.AutoTypings.create(e,{shareCache:!0,monaco:t,onError:e=>{"Not implemented yet"===e&&(e="Compile Errors"),console.warn("Error compiling types",e)}}).then(async n=>{const o=e.getModel();A(o,t,e)})}),e.addCommand("executeScript",function(e,...t){t?.[0]&&b({functionName:t?.[0]})},""),e.addAction({id:"executeScript",label:"Execute",keybindings:[t.KeyCode.F8],run:async e=>{const t=M();y.setSelectedFunction(t);const n=await t;b(n)}}),e.addAction({id:"saveScript",label:"Save Script",keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.KeyS],run:t=>{y?.saveSource(e.getValue()).then(()=>{const t=y?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue(),r=(n?.length??0)!==o.length||n!==o;c?.({dirty:r})})}}),e.onMouseDown(async n=>{if(n.target.type===t.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const r=n.target.position.lineNumber,l=await t.languages.typescript.getTypeScriptWorker(),i=await l(o.uri),a=await i.getNavigationTree(o.uri.toString()),s=e?.getValue(),d=(await(y?.saveSource(s))).getFunctions().search(),c=hi(o,t,d,a).find(e=>e.lineNumber===r);if(c){const e=n.event.browserEvent.button;0===e?"macro"===c.type||"autoRun"===c.type?b({functionName:c.name}):"formula"===c.type&&y.quickInsertFunction?.(c.name):2===e&&(console.log("Context menu for function:",c.name),n.event.browserEvent.preventDefault())}}}),e.onDidChangeModelContent(()=>{const n=e.getModel();A(n,t,e)});const o=e.getModel();!function(e,t){t.languages.registerInlayHintsProvider("typescript",{provideInlayHints(e,n,o){const r=[];for(let n=1;n<e.getLineCount()+1;n++){const o={startLineNumber:n,startColumn:1,endLineNumber:n,endColumn:e.getLineLength(n)+1},l="hint",i=e.getValueInRange(o).indexOf("hint");-1!==i&&r.push({kind:t.languages.InlayHintKind.Type,position:{lineNumber:o.startLineNumber,column:i+l.length+1},label:"[hint]"})}return{hints:r,dispose:()=>{}}}})}(0,t),o.onDidChangeContent(t=>{const n=y?.getScripts().getModules().getByName("scripting"),o=n?.getSource(),r=e.getValue(),l=(o?.length??0)!==r.length||o!==r;c?.({dirty:l})}),e.onDidChangeCursorPosition(e=>{E()})},[y,c]),O=te(()=>S?null:s||_("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[S,s]),L=te(()=>{const e=y?.getScripts().getModules().getByName("scripting")?.getSource()??"";return G("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[_(ce,{children:_(di,{theme:a?"extended-dark":"extended",options:{...ci,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:e,onValidate:e=>{let t=!1;for(let n=0;!t&&n<e?.length;n++)8===e[n].severity&&(t=!0)},beforeMount:e=>{e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),e.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),e.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}});(async()=>{let t=!1;try{const n=await(async()=>{const e=await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts");return await e.text()})(),o=e.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),r=e.editor.createModel(n,"typescript",o);e.editor.setModelMarkers(r,"default",[]),t=!0}catch(e){console.warn("cant load types",e)}e.languages.registerLinkProvider("*",{provideLinks:(t,n)=>{const o=[],r={links:o},l=t.getLinesContent();for(let n=1;n<=l.length;n++){const r=l[n-1],i=e.editor.tokenize(r,"typescript");for(let l=0;l<i[0].length;l++){const a=i[0]?.[l];if(a&&a.type.startsWith("string")){let s=a.offset,d=i[0]?.[l+1]?.offset??r.length,c=new e.Range(n,s+1,n,d+1),u=t.getValueInRange(c);const g=u[0];"`"!==g&&"'"!==g&&'"'!==g||(s++,u=u.substring(1));const h=u[u.length-1];"`"!==h&&"'"!==h&&'"'!==h||(s++,u=u.substring(0,u.length-1));try{y.getRanges(u)&&o.push({range:{endColumn:d,endLineNumber:n,startColumn:s,startLineNumber:n},tooltip:`Goto range '${u}'`,url:`/range/${u}`})}catch(e){console.warn(e)}}}}return r}}),e.editor.registerLinkOpener({open(e){if(e?.path?.startsWith("/range/")){try{y.getRanges(e.path.substring(7))?.select()}catch(e){console.warn("invalid range",e)}return!0}return!1}});const n=e.languages.typescript.typescriptDefaults.getCompilerOptions();e.languages.typescript.typescriptDefaults.setCompilerOptions({...n,target:e.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),q.current&&(await ui(g.current.editor,g.current.monaco,q.current),q.current=null),m.current&&requestAnimationFrame(async()=>{m.current&&e.editor.focus()}),e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),k(!0)})()},onMount:N})}),O]})},[y,v,l,O,a]),V=C(t,()=>({isScriptEditorElement:()=>!0,focus:e=>{z(e)},close:()=>{h?.()},getEditor:()=>y?.getEditor()}),[y]);return le(()=>(d&&requestAnimationFrame(()=>{z()}),()=>{g.current?.editor&&requestAnimationFrame(()=>{V.current?.contains(document.activeElement)&&z()})}),[]),_("div",{className:st("script-editor",si,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:V,...u,children:L})}));export{Xl as ChartAreaIcon,Yl as ChartAreaStackedIcon,Kl as ChartAreaStackedPercentIcon,_l as ChartBarIcon,Gl as ChartBarStackedIcon,Zl as ChartBarStackedPercentIcon,ri as ChartBubble3DIcon,oi as ChartBubbleIcon,Nl as ChartColumnIcon,Ol as ChartColumnStackedIcon,Ll as ChartColumnStackedPercentIcon,Cn as ChartEditor,Vl as ChartLineIcon,Pl as ChartLineMarkersIcon,Bl as ChartLineStackedIcon,Wl as ChartLineStackedMarkersIcon,Hl as ChartLineStackedPercentIcon,$l as ChartLineStackedPercentMarkersIcon,jl as ChartPieDoughnutIcon,Ul as ChartPieIcon,ni as ChartScatterLinesIcon,ti as ChartScatterLinesMarkersIcon,Ql as ChartScatterLinesMarkersSmoothIcon,ei as ChartScatterLinesSmoothIcon,Jl as ChartScatterMarkersIcon,yn as CommandContext,Ie as CornerTriangle,Ae as DateUtils,li as DocThemesContext,ii as DocThemesProvider,kn as EditableLabel,rn as EmptyFrame,Ne as FilterButton,Fe as FontUtils,xl as Item,Il as LogoNoPaddingIcon,ut as LogoTextNoPaddingIcon,en as MovableArea,qn as PictureEditor,kl as Row,fi as ScriptEditor,He as SheetCellEditor,Oe as SheetCellRenderer,wn as SheetElement,Dt as SheetScrollbar,it as StaticBorderRenderer,We as StyledStrokePath,ql as Tab,Fl as TabStrip,Pe as createCellEditStateFromCell,et as useBordersOverlay,ai as useDocThemes,ht as useModelListener,on as useMovableCommands,mt as useRangeListener,ft as useSheetCommands,Ht as useSheetCopyPaste};
13
+ import{FormulaError as e,NumberFormat as t,ICell as n,IBorder as o,ITextFrame as r,GeomUtils as l,ScalarType as i,IFont as a,IRange as s,LicenseManager as d,IColor as c,AutoFill as u,ISheetView as g,Color as h,IFill as m,RangeClipboardItem as p,ExternalRangeClipboardItem as f,TextUtils as v,IAnchored as w,CoordUtils as y,ThemeCollection as b}from"@sheetxl/sdk";export{LicenseManager}from"@sheetxl/sdk";import{ReactUtils as q,useImperativeElement as C,useCallbackRef as x,KeyCodes as S,SimpleCommand as k,Command as R,KeyModifiers as M,CommandGroup as T,useCopyPaste as D,useEditMode as A,useGlobalClipboard as E,NotificationType as z,useCommands as F,ScrollbarOrientation as I,VirtualScrollbar as N,MouseButtonCodes as O,ToolTipPlacement as L,DefaultNotifier as V,HorizontalAlignment as B,ScrollPane as H,useFullscreenPortal as P,defaultCreateScrollStartButton as W,defaultCreateScrollEndButton as $,defaultCreateScrollEdgeButton as U,ScrollUtils as j}from"@sheetxl/utils-react";export*from"@sheetxl/utils-react";import{jsx as _,jsxs as G,Fragment as Z}from"react/jsx-runtime";import{CommonUtils as X,AnchorLocation as Y,TypesUtils as K,CoordUtils as J}from"@sheetxl/utils";import Q,{memo as ee,useMemo as te,useState as ne,forwardRef as oe,useRef as re,useEffect as le,useLayoutEffect as ie,useCallback as ae,version as se,useReducer as de,Suspense as ce,createElement as ue,createContext as ge,useContext as he,cloneElement as me,useImperativeHandle as pe}from"react";import{STANDARD_KEY_CHARS as fe,useSelection as ve,useHeaderSelection as we,HeaderRenderer as ye,Grid as be,HeaderDivider as qe,SELECTION_CLIP_INSETS as Ce,defaultSelectionRenderer as xe,useKeyboardEditorOverlay as Se,Selection as ke,SVGLine as Re}from"@sheetxl/grid-react";import{unstable_batchedUpdates as Me,createPortal as Te}from"react-dom";const De=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),Ae=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:De},Symbol.toStringTag,{value:"Module"})),Ee=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),ze=(e,t=!0,n=Ee)=>{if(!n||0===n.length)return e;if(void 0===e)return n[0];if(t&&e>=n[n.length-1])return e;if(!t&&e<=n[0])return e;let o=X.findEqualOrGreater(n,e);return t?(n[o]===e&&(o+=1),n[o]||(o-=1),n[o]):(o-=1,n[o])},Fe=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:Ee,findNextFontSize:ze},Symbol.toStringTag,{value:"Module"})),Ie=ee(e=>{const{anchorLocation:t=Y.TopLeft,cellWidth:n,cellHeight:o,size:r=7,inset:l=1,darkMode:i,fill:a,pathProps:s,style:d,...c}=e,u=r,g=l;let h="red",m=[],p=[];return t===Y.TopLeft?(h=i?"rgb(255, 198, 246)":"green",m.push(g),p.push(g),m.push(g+u),p.push(g),m.push(g),p.push(g+u)):t===Y.TopRight?(h=i?"rgb(0, 255, 255)":"red",m.push(n-g),p.push(g),m.push(n-(g+u)),p.push(g),m.push(n-g),p.push(g+u)):t===Y.BottomRight?(h=i?"rgb(236, 252, 211)":"purple",m.push(n-g),p.push(o-g),m.push(n-(g+u)),p.push(o-g),m.push(n-g),p.push(o-(g+u))):t===Y.BottomLeft&&(h=i?"rgb(255, 236, 183)":"blue",m.push(g),p.push(o-g),m.push(g+u),p.push(o-g),m.push(g),p.push(o-(g+u))),_("svg",{width:`${n}`,height:`${o}`,viewBox:`0 0 ${n} ${o}`,style:{position:"absolute",width:`${n}px`,height:`${o}px`,pointerEvents:"none",...d},...c,children:_("path",{d:`M ${m[0]} ${p[0]} L ${m[1]} ${p[1]} L ${m[2]} ${p[2]} L ${m[0]} ${p[0]} Z`,fill:a??h,...s})})}),Ne=e=>{const{renderBounds:t,darkMode:n,zoom:o,disabled:r,filter:l,onFilterButtonMouseDown:i,style:a,...s}=e,d=te(()=>{let e=null;const t=l.getSortField();t&&(e=t.reverse);const n=l.getField(),o=n&&n.criteria&&n.criteria.length>0;return!0===e?o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":!1===e?o?"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":o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"m 3,5.025 4.5,5 4.5,-5 z"},[l]),[c,u]=ne(!1);const g=Math.min(Math.min(18,t.height-8),t.width);return _("div",{style:{width:`${g}px`,height:`${g}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${c&&!r?"--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:(g>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:r?void 0:"pointer",...a},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseDown:e=>{i?.(e,l)},...s,children:_("svg",{width:""+15*o,height:""+15*o,viewBox:"0 0 15 15",style:{fill:`var(${c&&!r?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:r?.6:1},children:_("path",{d:d})})})},Oe=s=>{const{value:d,coords:c,bounds:u,children:g,style:h,range:m,zoom:p=1,view:f,bodyStyle:v,normalStyle:w,showFormulas:y,showZeros:b,docTheme:C,onLinkMouseDown:x,onFilterButtonMouseDown:S,filterButtonProps:k,createFilterButton:R=Ne,...M}=s,T=u.height/p,D=u.width/p,A=d,E=A.getValue(),z=d.getStyle(),F=v?.darkMode??!1;let I,N;const O=E&&E.isFormulaError,L=O&&E instanceof e.Parse;let V,B=y||L;if(B)if(A.isSpillOverflow())N="";else{const e=A.getFormulaText();e?N=e:I=A.getNumberFormat(t.Type.General)}else I=A.getNumberFormat();B||(V=A.getTextOverflow());const H=V?V.colBounds.width+V.leftOffset+V.rightOffset:D,P=V?V.anchorBounds.x-V.leftOffset:0,W=V?V.anchorBounds.width:D,$=V?V.anchorBounds.x:0;let U,j=A.getRenderHorizontalAlignment();I&&(U=I?.formattedRuns,N=U?.runs[0]?.text??I.displayText);const Z=A.getCalcStatus()===n.CalcStatus.Pending;let K=null,J=z.getFill().toCSS(F,u),Q=0,ee=0;if(!z.getBorder().isEmpty()){const e=z.getBorder().getRight();!e.isNone()&&o.BuiltInDefinitions.get(e.getStyle()).width>1&&(Q=1);const t=z.getBorder().getBottom();!t.isNone()&&o.BuiltInDefinitions.get(t.getStyle()).width>1&&(ee=1)}let te=null;if(D!==W||Q||ee||"number"==typeof J?.backgroundPosition){const{backgroundPosition:e,...t}=J,n=e??0,o=f?.getScrollTopLeft(),r=n?-(u.x+(o.left??0))%n:0,l=n?-(u.y+(o.top??0))%n:0;(void 0!==e||Q||ee||D!==W)&&(1===Object.keys(t).length&&"none"===t.background||(J=null,te=_("div",{className:"fill",style:{marginLeft:`${r}px`,marginTop:`${l}px`,left:$*p,width:q.boundPixel(W*p-r+1+Q),height:q.boundPixel(u.height-l+1+ee),...t}},"background")))}let ne=null;const oe=A.getComments(),re=A.getWarnings(),le=A.getErrors();if(oe||O||le.length>0||re.length>0){const e={size:7*p,darkMode:F,cellWidth:W*p+2,cellHeight:T*p+2,style:{top:-1,left:$*p-1}};ne=ne??[],(re.length>0||le.length>0||O)&&ne.push(_(Ie,{anchorLocation:Y.TopLeft,...e},`indicator-${ne.length}`)),oe&&ne.push(_(Ie,{anchorLocation:Y.TopRight,...e},`indicator-${ne.length}`))}const ie=z.getFont();let ae=I?.conditionalColor;const se=z.getAlignment(),de=se.getHorizontal()===r.HorizontalAlignment.Fill,ce=se.getHorizontal()===r.HorizontalAlignment.CenterContinuous||de,ue=ce||B?0:se.getRotation(),ge=A.getInsets(),he=ge.top+ge.bottom;let me=ge.left,pe=ge.right;const fe={...h,left:h.left-1,top:h.top-1,width:h.width+1+Q,height:h.height+1+ee},ve=A.getColumnFilter(),we=ve&&!ve?.hasHiddenButton();let ye=null;Z&&(ye=G("div",{className:"slider",children:[_("div",{className:"line"}),_("div",{className:"subline inc"})]},"pending"));const be=!(Z||we||te||g||ne||U?.runs.length>1||V||ue%360!=0);"none"===J?.background&&(J=null);let qe=ce||!(!V||!(V.rightIndex>0||V.leftIndex>0||V.colSpan>1));if(!qe){const e=A.getSpans();(e.width>1||e.height>1)&&(qe=!0)}const Ce={...J,...fe,pointerEvents:x?"auto":void 0};if(!X.isEmpty(N)||!X.isEmpty(I?.repeatPlaceholder)){const e=I?.canWrap??!1;let n=null,o=null,s=null,d=[],c=!0;b||B||0!==E||(c=!1);const u=A.getTextFrame(B);if(c&&u){let c=H-1-(me+pe);if(ue){const e=u.layout();n=e.bounds;const t={x:0,y:0,width:H-1,height:T};if(U){let e=U.width;if(I.repeatPlaceholder||I.repeatChars.length>0){const n=l.boundsToPoints(t),o=l.rotatePoints(n,-ue);e=l.minBoundingRect(o).width}n={...n,width:e}}s=l.clipToOuterRect({...n,width:n.width+1+me+pe},t,ue),c=s.width-1-(me+pe)+.01}let g=null;e&&(g={width:c});let m=null,f=I?.repeatPlaceholder;const v=u.layout(g);if(n=v.bounds,B?n={...n,width:0}:U&&(n={...n,width:I.repeatPlaceholder||I.repeatChars.length>0?c:U.width}),ue&&e){let e=null;v.visitLines({visitTextLine:(t,n)=>{let o=t.bounds;const r=l.boundsToPoints(o),i=l.rotatePoints(r,ue),a=l.minBoundingRect(i);o={...o,x:(a.width-o.width)/2,y:(a.height-o.height)/2},e=e?l.unionBounds(e,o):o}}),n={...e,width:e.width+me+pe}}if(!f&&A.getType()!==i.String&&Math.floor(n.width)>c){if("General"===z.getNumberFormat()&&A.getType()===i.Number){const e=z.measureText("0"),t=Math.floor(c/e.width),n=E,o=X.splitNumber(n),r=Math.min(10,t-(Math.max(1,o.ipLength)+1)-(n<0?1:0));if(r>=-1){const e=`0${r>0?".":""}${"#".repeat(Math.max(0,r))}`;m=A.getNumberFormat(e).displayText,"0"===m&&n<0&&(m="-0")}else if(Math.abs(n)>=Math.pow(10,5)||Math.abs(n)<=Math.pow(10,-5)){const e=t-5-(n<0?1:0);if(e>=0){const t=`0.${"0".repeat(Math.max(0,e-1))}E+00`;m=A.getNumberFormat(t).displayText}}}m||(f="#")}if(!f&&U?.lastRepeatIndex>=0&&U?.width>c&&(f="#"),f&&c>0){const e=z.measureText(f),t=Math.floor((c||1)/(e?.width||1));m=t>0?f.repeat(t):""}if(B&&(j=r.HorizontalAlignment.Left),m){const e=z.measureText(m).width;e&&(n={...n,width:e})}if(o={...n,width:n.width+me+pe,height:n.height},ue&&!e){const e=l.boundsToPoints(o),t=l.rotatePoints(e,ue),n=l.minBoundingRect(t);o.width=n.width,o.height=n.height}j===r.HorizontalAlignment.Center||j===r.HorizontalAlignment.CenterContinuous?o.x=(H-o.width)/2:j===r.HorizontalAlignment.Right?o.x=H-o.width-.5:o.x=.5,se.getVertical()===r.VerticalAlignment.Center?o.y=(T-o.height)/2:se.getVertical()===r.VerticalAlignment.Bottom?o.y=T-o.height-he:o.y=he;const w=be?{...M}:void 0,y={style:{left:h.left-1,top:h.top-1,width:h.width+1,height:h.height+1,transform:ue?`rotate(${ue}deg)`:void 0,cursor:x?"pointer":void 0,pointerEvents:x?"auto":void 0,zIndex:qe?1:void 0,...J},onMouseDown:x,onDoubleClick:x?e=>{e.stopPropagation(),e.preventDefault()}:null,...w};L&&(y.style.textDecorationStyle="wavy",y.style.textDecorationColor=F?"rgb(0, 255, 255)":"red",y.style.textDecorationLine="underline");const b=ie.getSize(),q=(i,s,u,g,h,m,f,v=null)=>{let w=b*p,y=u,q=f?.runs?f.runs:[{type:t.ParseRunType.Text,text:i,width:z.measureText(i,w).width}];f&&f?.width!==n.width&&(n={...n,width:f?.width});let C=me;if(f?.lastRepeatIndex>=0&&c>f?.width){const e=f.runs[f.lastRepeatIndex];if(e){const o=[...q],r=Math.max(0,c-1-f.width);let l=0,i="";if(r>0){const t=Math.floor(r/e.width);i=t>0?e.text.repeat(t):"",l=r}o[f.lastRepeatIndex]={type:t.ParseRunType.Repeat,text:i,width:l},q=o,n={...n,width:f.width+l}}}const x=(t,n,o,i,s,c,u,g,f,v=null)=>{let b,q=y.width;h===r.HorizontalAlignment.Justify?(q=s,m||(b="justify")):h===r.HorizontalAlignment.Distributed&&(q=s,b=m||t.text.split(" ").length-1==0?"center":"justify");const{style:x,className:S,...k}=v;let R=t.text;if(h===r.HorizontalAlignment.Fill&&0===I?.repeatChars.length){const e=Math.max(1,Math.floor((y?.width??0)/(u?.width??1)));R=R.repeat(e)}let M=y.height;const T=ie.getVerticalAlignment(),D=T===a.VerticalAlignment.Sub,A=T===a.VerticalAlignment.Super;if(D||A){const e=ie.getSuperSubScale();w*=e,M*=e}const E={textAlign:b,textAlignLast:b,background:void 0,...x,...ie.toCSS(F,p,!0),fontSize:w*a.getDeviceScale()};ae&&(E.color=ae.toCSS(F));const z=C+n;let N=ge.top+y.y+0;if(D&&(N+=f-w),c){const e=(u.x+z)*p+1,t=(u.y+N)*p+1;t<0?E.marginTop=t:E.paddingTop=t,e<0?(E.width=(x?.width??0)-e,E.left=(x?.left??0)+e):E.paddingLeft=e,E.paddingRight=Math.max(0,(x?.width??0)-q*p-e),E.paddingBottom=Math.max(0,(x?.height??0)-y.height*p-t),E.height=(x?.height??0)+(t<0?-t:0),(t<0||e<0)&&(E.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else if(E.left=(u.x+z)*p+1,E.top=(u.y+N)*p+1,E.width=u.width*p,E.height=u.height*p,ue&&!e){E.left=(u.x+n)*p+1,E.top=(u.y+(y.y+0))*p+1;const e=l.centerPoint({x:C+n,y:0,width:t.width,height:y.height}),o=l.centerPoint({x:C,y:0,width:s,height:y.height}),r=l.rotatePoints([e],ue,o),i={x:r[0].x-e.x,y:r[0].y-e.y};E.left=E.left+i.x*p,E.top=E.top+i.y*p;const a={...y,x:C,y:ge.top,width:y.width+(me+pe)},d=l.boundsToPoints(a),c=l.rotatePoints(d,ue),g=l.minBoundingRect(c);a.width=g.width,a.height=g.height;const h=l.centerPoint(a),m={x:h.x-o.x,y:h.y-o.y};E.left=E.left+m.x*p,E.top=E.top+m.y*p}E.lineHeight=M*p+"px";const O=be?void 0:"text-line";d.push(_("div",{className:S?`${S} ${O}`:O,style:E,...k,children:R},`text-${y.y}-${i}-${o}`))};if(se.getOverflow()===r.Overflow.Shrink&&c>0){let e=n?.width??0,t=0;for(;e>1&&e>c&&w>2&&t<100;){w*=c/e;e=z.measureText(i,w).width,t++}n={...n,width:e}}let S=y.x;h===r.HorizontalAlignment.Right?S+=n.width-y.width:h!==r.HorizontalAlignment.Center&&h!==r.HorizontalAlignment.CenterContinuous||(S+=(n.width-y.width)/2),f?.lastRepeatIndex>=0&&(S=y.x);const k=q.length;for(let e=0;e<k;e++){const l=q[e];if(l.type===t.ParseRunType.Text||l.type===t.ParseRunType.Repeat){l.type,t.ParseRunType.Repeat;x(l,S,e,s,h===r.HorizontalAlignment.Justify||h===r.HorizontalAlignment.Distributed||f?.lastRepeatIndex>=0?c:y.width,be,{x:o.x+P,y:o.y,width:l.width,height:n.height},0,g,v)}S+=l.width}};m?q(m,0,{x:0,y:0,...n},v.lines[0].baseline,j,!0,null,y):v.visitLines({visitTextLine:(e,t,o)=>{const l=e.runs[0].text.replace(/\s+$/,""),i=t===o-1;let a=j===r.HorizontalAlignment.Justify&&(i||e.runs[0].text.endsWith("\n"))?r.HorizontalAlignment.Left:j,s=0;t>0&&(se.getVertical()===r.VerticalAlignment.Distributed||se.getVertical()===r.VerticalAlignment.Justify)&&(s=Math.max(0,(T-(he+3)-e.bounds.height*o)/(o-1)*t)),se.getVertical()===r.VerticalAlignment.Distributed&&ue&&ue%90==0&&ue%180!=0&&(a=r.HorizontalAlignment.Distributed),a!==r.HorizontalAlignment.Justify&&a!==r.HorizontalAlignment.Distributed&&a!==r.HorizontalAlignment.Fill||(n={...n,width:c});const d={...e.bounds,y:e.bounds.y+s+0,width:de||I&&(I.repeatChars.length>0||I.spacingChars.length>0)?n.width:e.bounds.width};q(l,t,d,u.lines[0].baseline,a,i,1===o?U:null,be&&t>0?{...y,style:{...y.style,background:void 0}}:y)}})}d.length>0&&(K=d)}if(be)return K&&K.length>0?K:_("div",{style:Ce,...M});let xe=x?"auto":fe.pointerEvents,Se=null;if(we){const e={x:$*p-1,y:-1,width:W*p+1,height:T*p+1};xe="auto",Se=R({renderBounds:e,darkMode:F,className:"filter-button",disabled:!A.isEditAllowed(),zoom:p,filter:A.getColumnFilter(),onFilterButtonMouseDown:S,...k}),Se&&(Se=_("div",{style:{...e,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:Se},"filterButton"))}Z&&!K&&(K=_("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const ke=[te,K,g,ne,ye,Se];return _("div",{style:{...J,...fe,pointerEvents:xe},...M,children:ke})},Le={text:"",placeholder:""},Ve=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return 0===n.length||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},Be=Object.freeze([S.Delete,S.Home,S.End]),He=ee(oe((e,t)=>{const{editState:n,onStartEdit:o,onChangeEdit:l,onSubmitEdit:d,onCancelEdit:c,onDoneEdit:u,defaultTextStyle:g,useRichStyling:h=!0,bodyStyle:m,activeCoords:p,sheet:f,commands:v,containerBounds:w,setNaturalDimensions:y,onFocus:b,disabled:q,style:A,zoom:E=1,linesVisible:z,autoFocus:F=!1,...I}=e,{height:N=0,width:O=0}=w??{},L=m?.darkMode??!1,V=re(null),[B,H]=ne(!1),[P,W]=ne(null),[$,U]=ne(()=>n);le(()=>{oe.current=!1,U(n)},[n]);const j=te(()=>{const e=$.clean();let t=e.getStyle();h||(t=t.createTemporaryStyle({font:{size:g?.fontSize}}));const n=e.getFormula(),o=t.getAlignment(),l=n?r.HorizontalAlignment.Left:o.getHorizontal(),a=o.getVertical(),s=o.getOverflow()===r.Overflow.Wrap||e.getType()===i.String&&(l===r.HorizontalAlignment.Justify||l===r.HorizontalAlignment.Distributed||a===r.VerticalAlignment.Justify||a===r.VerticalAlignment.Distributed),d=(e=>{if(!e)return Le;const t=e.clean();if(!t)return Le;let n=t.getStyle()?.getQuotePrefix();if(void 0===e.dirty||null===e.dirty){let o="",r=t.getFormulaText();r&&(o=r,n=!1),o||(o=t.toTextUnformatted(!0)??"");let l="";if(!e.editMode&&t.isSpillOverflow()){const e=t.getSpill();if(e){const n=e.getCell(),o=n.getFormulaText();n.isEqual(t)||(l=o)}}return n&&(o="'"+o),{text:o,placeholder:l}}return{text:e.dirty??"",placeholder:""}})($),c=d.text,u=r.toCSSHorizontalTextAlign(h&&!n?$.clean()?.getRenderHorizontalAlignment():r.HorizontalAlignment.Left);return{style:t,isWrapped:s,textValue:c,formula:n,frameVertAlign:a,placeholder:d.placeholder,insets:h?e.getInsets():K.EmptyRect,textAlign:u}},[$,g,L,E,h]),G=re(null),Z=C(t,()=>({startEdit:e=>{V.current=e?.initialSelection;const t={...n,editMode:e?.editMode??!1};void 0!==e?.text&&(t.dirty=e.text),t.editMode===n.editMode&&t.dirty===n.dirty||(U(t),J?.(t))},submitEdit:()=>se(),cancelEdit(){de()},autoFocus(){G.current.focus()},dispatchEvent:e=>G.current.dispatchEvent(e),focus(){G.current.focus()},getLineHeight:Y}),[o,n]);ie(()=>{if(!P||!B)return;const e=G.current;j.textValue,e&&e.setSelectionRange(P.start,P.end,P.direction)},[G.current,P,j.textValue]);const X=te(()=>{const e=$?.clean(),t=j.style.createTemporaryTextFrame(j.textValue,e?.getType()===i.String),n=h?e.getInsets().right+e.getInsets().left:0;let o=null;j.isWrapped&&(o={width:O-n});return t.layout(o)},[j,O,$,h]),Y=x(()=>Math.ceil(X?.lines[0]?.bounds.height),[X]);ie(()=>{if(!X)return;const e=j.style,t=e.getInsets()??K.EmptyRect,n=h?t.left+t.right:0,o=h?.04*e.getFont().getSize():1,r=Math.round(j.isWrapped?void 0:X.bounds.width+n+o),l=Math.round(X.bounds.height);y?.({width:r,height:l})},[X,y,j,h,$]);const J=x(l,[l]),Q=x(e=>{if($.dirty===e)return;const t={...$};t.dirty=e,G.current,U(t),J?.(t)},[$]),ee=x(e=>{if($.editMode===e)return;const t={...$};t.editMode=e,U(t),J?.(t)},[$]),oe=re(!1),se=x(()=>{if(oe.current)return!1;try{d?.($),u?.(),oe.current=!0}catch(e){return!1}return!0},[d,$]),de=x(()=>{oe.current=!0,U(n),c?.(),u?.()},[c,n]),ce=x(e=>{if(!G.current)return;if(e.key,e.isDefaultPrevented(),!(e.isTrusted||e.nativeEvent.ctrlKey||e.nativeEvent.metaKey||e.nativeEvent.altKey||e.nativeEvent.isComposing||-1===fe.indexOf(e.nativeEvent.key)&&"Backspace"!==e.nativeEvent.key)){const t={...$};let n=0;return Ve(t,t.dirty)&&!isNaN(parseFloat(e.key))?(t.dirty?.endsWith("%")?t.dirty=(t.dirty.substring(0,t.dirty.length-1)??"")+e.key+"%":t.dirty=(t.dirty??"")+e.key+"%",n=t.dirty.length-1):"Backspace"===e.nativeEvent.key?(t.dirty="",n=t.dirty.length):(t.dirty=(t.dirty??"")+e.key,n=t.dirty.length),G.current.value=t?.dirty,V.current={start:n,end:n,direction:"forward"},G.current?.setSelectionRange(n,n,"forward"),U(t),J?.(t),void e.preventDefault()}const t=e.nativeEvent.ctrlKey,n=e.nativeEvent.shiftKey,o=e.nativeEvent.altKey,r=e.nativeEvent.metaKey;if(t&&"z"===e.key&&e.stopPropagation(),e.which===S.Escape)return e.preventDefault(),void de();if(e.which===S.F2)return ee(!0),void e.preventDefault();const l=e.target;if("%"===e.key&&l.selectionStart===l.selectionEnd&&"%"===l.value[l.selectionStart]&&$?.clean().getStyle().numberFormat.includes("%"))return W({start:l.selectionStart+1,end:l.selectionEnd+1,direction:l.selectionDirection}),void e.preventDefault();if(e.which===S.Enter){if(e.preventDefault(),r||o){const e=j.textValue.substring(0,l.selectionStart)+"\n"+j.textValue.substring(l.selectionEnd);return Q(e),void W({start:l.selectionStart+1,end:l.selectionStart+1,direction:l.selectionDirection})}return void(se()&&f.getSelection().traverse(s.Orientation.Column,n))}if(e.which===S.Tab)return e.preventDefault(),void(se()&&f.getSelection().traverse(s.Orientation.Row,n));let i=null;switch(e.which){case S.Left:i=s.Direction.Left;break;case S.Right:i=s.Direction.Right;break;case S.Up:i=s.Direction.Up;break;case S.Down:i=s.Direction.Down}if(i){if(!(t||n||o||r)&&!$.editMode)return void se()}$.editMode&&(i||Be.includes(e.which))&&e.stopPropagation()},[$,f,j]),ue=ae(()=>{G.current?.focus(),setTimeout(()=>{G.current?.select()},0)},[]),ge=ae(()=>{G.current?.focus(),console.log("implement toggleRelativeReferences")},[]),he=x(()=>{const e=G.current?.value;let t="";if(p.rowIndex>0){const e=f.getRange({rowIndex:p.rowIndex-1,colIndex:p.colIndex}).getCell();e&&(t=e.toTextUnformatted(!0))}Q(e+t)},[p,f]);le(()=>f.getRange(p).addListener(()=>{const e={...$,clean:()=>f.getRange(p).getCell()};U(e),J?.(e)}),[p,f]);const me=ae(()=>{const e=$.clean().createTemporaryCell({value:De(),style:{numberFormat:"Medium Time"}}).toText();Q((G.current?.value??"")+e)},[f]),pe=ae(()=>{const e=$.clean().createTemporaryCell({value:De(),style:{numberFormat:"Short Date"}}).toText();Q((G.current?.value??"")+e)},[f]),ve=te(()=>({element:()=>G.current,doCopy:e=>{const t=G.current.value.substring(G.current.selectionStart,G.current.selectionEnd);if(e?.isCut){const e=G.current.value.substring(0,G.current.selectionStart)+G.current.value.substring(G.current.selectionEnd,G.current.value.length);Q(e)}return t}}),[G.current]),we=te(()=>({element:()=>G.current,doPaste:async(e,t)=>{const n=await(e.toText?.());if(!n)return!0;const o=G.current.value.substring(0,G.current.selectionStart)+n+G.current.value.substring(G.current.selectionEnd,G.current.value.length);return Q(o),W({start:G.current.selectionStart+n.length,end:G.current.selectionStart+n.length,direction:"forward"}),!0}}),[G.current]),ye=te(()=>({contains:e=>G.current?.contains(e)||!1,focus(){G.current.focus()}}),[]),be=te(()=>[new k("selectAll",ye,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[M.Ctrl]}},ue),new k("startEditValueAbove",ye,{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:[M.Ctrl]},{key:'"',modifiers:[M.Ctrl,M.Shift]}]},he),new k("startEditCurrentTime",ye,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl,M.Shift]}},me),new k("startEditCurrentDate",ye,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl]}},pe),new R("relativeReferencesToggle",ye,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},ge),new R("toggleEditorFocus",ye,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[M.Ctrl]}})],[]),qe=te(()=>{let e=null;const t=()=>({contains:e=>G.current?.contains(e)||!1,focus(){G.current.focus()}});return e=v?v.createChildGroup(t,"editor",!1):new T(t,"editor"),e.addCommands(be,!0),e},[v,be]),Ce=te(()=>({notifier:null,source:ve,target:we,commands:qe}),[ve,we,qe]);D(Ce);const[xe,Se]=ne(!F);le(()=>{Se(!1)},[]);const ke=x(e=>{H(!0),qe?.activate();const t=V.current;if(!1!==t){let e,n;const o=G.current.value;Ve($,o)&&(e=o.length-1,n=o.length-1),e=t?.start??e??o.length,n=t?.end??n??o.length,V.current=!1,W({start:e,end:n,direction:"forward"})}b?.(e)},[b,$]),Re=j.insets;let Me=Re.left+1;const Te=Re.left+Re.right+2-1,Ae=X?.bounds.height??0;let Ee,ze=Re.top;j.frameVertAlign===r.VerticalAlignment.Center?ze=Math.max(0,(N-(Re.top+Re.bottom)-Ae)/2):j.frameVertAlign===r.VerticalAlignment.Bottom&&(ze=Math.max(0,N-(Re.top+Re.bottom)-Ae)),void 0!==z&&X?.lines[0]?.bounds&&(Ee=X?.lines[0]?.bounds.height*z);const Fe=j.style.getFont();let Ie=Fe.getSize();Fe.isSuperSub()&&(Ie*=Fe.getSuperSubScale()),Ie*=a.getDeviceScale()*E;const Ne=h?Fe.toCSS(L,E):null;return _("div",{className:"sheet-cell-editor",onMouseDown:e=>{G.current&&document.activeElement!==G.current&&requestAnimationFrame(()=>{G.current.focus()})},ref:Z,...I,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...A},children:_("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:ze*E+1,left:Me*E,width:`calc(100% - ${Te*E}px)`,maxWidth:`calc(100% - ${Te*E}px)`,height:(Ee??Ae)*E,maxHeight:(Ee??Ae)*E},children:_("textarea",{spellCheck:"false",placeholder:j.placeholder,ref:G,value:j.textValue,disabled:xe,readOnly:q||f.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ne,fontSize:Ie?`${Ie}px`:"inherit",textAlign:j.textAlign,lineHeight:(X?.lines[0]?.bounds.height??0)*E+"px",height:(X?.bounds.height??0)*E,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:j.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:ke,onBlur:()=>{H(!1)},onSelect:e=>{},onChange:e=>{G.current&&!oe.current&&(V.current=!1,Q(e.target.value),j.textValue,e.target.value,e.target.selectionStart,e.target.selectionEnd,e.target.selectionDirection,W({start:e.target.selectionStart,end:e.target.selectionEnd,direction:e.target.selectionDirection}))},onMouseDown:e=>{B&&ee(!0)},onKeyDown:ce})})})})),Pe=(e,t)=>({clean:e,dirty:t,editMode:!1}),We=e=>{const{length:t=0,width:n=1,dashArray:o=null,dashArrayAdditional:r=null,isDouble:l=!1,isAngled:i=!1,offsetX:a=0,offsetY:s=0,isVertical:d=!1,...c}=e,u=e=>{let t=null;if(e&&n>0){t="";for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=",")}return t},g=u(o);let h=g;r&&(h=u(r));let m=n,p=t,f=null;if(l){m=Math.floor(n/2);const e=m+m/2+1;let t=null;t=d?`M ${q.boundPixel(a+e)} ${q.boundPixel(s)} L ${q.boundPixel(a+e)} ${q.boundPixel(s+p)}`:`M ${q.boundPixel(a)} ${q.boundPixel(s+e)} L ${q.boundPixel(a+p)} ${q.boundPixel(s+e)}`,f=_("path",{strokeWidth:m,strokeDasharray:h,d:t,...c})}if(i){m=n/2;const e=m+m/2;let t=h,o=null;o=d?`M ${q.boundPixel(a+e)} ${q.boundPixel(s)} L ${q.boundPixel(a+e)} ${q.boundPixel(s+p)}`:`M ${q.boundPixel(a)} ${q.boundPixel(s+e)} L ${q.boundPixel(a+p)} ${q.boundPixel(s+e)}`,f=_("path",{strokeWidth:m,strokeDasharray:t,strokeDashoffset:"1",shapeRendering:"crispEdges",d:o,...c})}let v=null;return v=d?`M ${q.boundPixel(a+m/2)} ${q.boundPixel(s)} L ${q.boundPixel(a+m/2)} ${q.boundPixel(s+p)}`:`M ${q.boundPixel(a)} ${q.boundPixel(s+m/2)} L ${q.boundPixel(a+p)} ${q.boundPixel(s+m/2)}`,G(Z,{children:[_("path",{strokeWidth:m,strokeDasharray:g,d:v,...c}),f]})};function $e(e,t){if("function"==typeof e)return e(t);e&&(e.current=t)}var Ue=parseInt(se.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const e=$e(o,t),r="function"==typeof e;n.push(r?e:()=>$e(o,null))}return()=>{for(const e of n)e()}}}:function(e){return t=>{for(const n of e)$e(n,t)}},je=function(){},_e="undefined"!=typeof window,Ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ze=_e?ie:le,Xe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ye=_e&&void 0!==window.ResizeObserver?function(){var e=ne(null),t=e[0],n=e[1],o=ne(Xe),r=o[0],l=o[1],i=te(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,o=t.y,r=t.width,i=t.height,a=t.top,s=t.left,d=t.bottom,c=t.right;l({x:n,y:o,width:r,height:i,top:a,left:s,bottom:d,right:c})}})},[]);return Ze(function(){if(t)return i.observe(t),function(){i.disconnect()}},[t]),[n,r]}:function(){return[je,Xe]},Ke=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Je=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Qe=e=>{const{key:t,points:n,range:r,stroke:l,darkMode:i,forceThinBorder:a=!1,shiftIfWide:s=!1,isVertical:d=!1,intersections:c,layout:u}=e,g=o.BuiltInDefinitions.get(a?o.StrokeStyle.Thin:l.getStyle());if(!g)return null;const h=n[0],m=n[1],p=n[2],f=n[3];let v=1+(d?f-m:p-h),w=0;const y=l.getColor().toRGBA(i).toString(),b=g.description.toLowerCase().includes("double");let q,C;const x=d?"rowStart":"colStart",S=d?"rowEnd":"colEnd",k=d?m:h;if(c?.length>0){const e=c[0];if(e?.range[x]===r[x]){const t=o.BuiltInDefinitions.get(e.stroke.getStyle());w=Math.floor(t.width/2)}const t=c[c.length-1];if(t?.range[S]===r[S]){const e=o.BuiltInDefinitions.get(c[c.length-1].stroke.getStyle());v=Math.floor(v+(2===e.width?0:e.width/2))}if(b){const e=d?"colStart":"rowStart",t=d?"colEnd":"rowEnd",n=d?u?.getRowOffset:u?.getColOffset;let l=0,i=0;q=[],C=[];for(let a=0;a<c.length;a++){const s=c[a];if(s.stroke.getStyle()===o.StrokeStyle.Double&&n){const o=n(s.range[x])-(k-w);s.range[e]<r[e]&&(q.push(o-l),l=o,q.push(1),l++),s.range[t]>r[t]&&(C.push(o-i),i=o,C.push(1),i++)}}q.length>0&&l<v&&q.push(v-l),C.length>0&&i<v&&C.push(v-i)}}let R=d?-Math.floor(g.width/2):-w,M=d?-w:-Math.floor(g.width/2);const T=s&&g.width>2?-1:0;return _(We,{offsetX:h+R+T,offsetY:m+M+T,length:v+w,isVertical:d,stroke:y,width:g.width,dashArray:q??g.pattern,dashArrayAdditional:C,isDouble:b,isAngled:g.description.toLowerCase().includes("slant")},t)},et=({getBorderAt:e,borderRenderer:t=Qe,getVisibleCells:n,darkMode:r,forceThinBorder:l=!1,defaultColor:i="black",shiftIfWide:a=!1})=>{const s=x(n,[n]),d=te(()=>n=>{const d=n.toClipBounds(n.getRangeCoordsBounds(),-3);if(!d)return;const c=s(n);if(0===c.length)return;const u=n.getVisibleColumnOffsets(),g=n.getVisibleRowOffsets();let h=[],m=[];const p=n.getVisibleColumns(),f=n.getVisibleRows(),v=[],w=[],y=[],b=(e,t,n,o,r,l,i)=>{const a={index:o,stroke:r,visibleIndex:n,edge:l,length:i};e[t]||(e[t]=[]),e[t].length>0&&e[t][e[t].length-1]?.index===o?e[t][e[t].length-1]=a:e[t].push(a)};for(let t=0;t<c.length;t++){const r=c[t],l=r.coords;if(!l)continue;const i=r?.range??{rowStart:l.rowIndex,colStart:l.colIndex,rowEnd:l.rowIndex,colEnd:l.colIndex},a=n.getVisibleRangeCoords();if(!J.isRangesIntersect(i,a)&&!J.isRangeWithinRange(i,a))continue;const s=l.colIndex,d=l.rowIndex,y=u[s],q=g[d];if(i.rowEnd!==i.rowStart){const e=g[i.rowStart]?.spanIndex??-1,t=g[i.rowEnd]?.spanIndex??g[f[f.length-1]].spanIndex+1;h.push({...i,rowStart:e,rowEnd:t})}if(i.colEnd!==i.colStart){const e=u[i.colStart]?.spanIndex??-1,t=u[i.colEnd]?.spanIndex??u[p[p.length-1]].spanIndex+1;m.push({...i,colStart:e,colEnd:t})}const C=r.value,x=e(C,t);if(!x||x.isEmpty())continue;const S=x.getLeft(),k=x.getTop(),R=x.getRight(),M=x.getBottom();let T=1,D=1;if(!y||!q)continue;const A=y.spanIndex,E=q.spanIndex;S.isNone()||b(v,A,E,d,S,o.Edge.Left,T),k.isNone()||b(w,E,A,s,k,o.Edge.Top,D),R.isNone()||b(v,A+D,E,d,R,o.Edge.Right,T),M.isNone()||b(w,E+T,A,s,M,o.Edge.Bottom,D)}const q=(e,t,n)=>{const o=[];return e.forEach((e,r)=>{let l=null;e.sort((e,t)=>e.visibleIndex-t.visibleIndex);for(let a=0;a<e.length;a++){const s=e[a];if(!s?.stroke)continue;if(void 0===t[r]&&void 0===t[r-1])continue;let d=!1;if(n)for(let e=0;!d&&e<h.length;e++){let t=h[e];t.colStart<=s.index&&t.colEnd>=s.index&&t.rowStart<r&&t.rowEnd>=r&&(d=!0)}else for(let e=0;!d&&e<m.length;e++){let t=m[e];t.rowStart<=s.index&&t.rowEnd>=s.index&&t.colStart<r&&t.colEnd>=r&&(d=!0)}if(d)continue;const c=s.stroke?.getColor(),u=c?c.toRGBA().toString():i,g=s.stroke.getStyle()+":"+u;(g!==l?.key||l&&l.visibleIndex+1<s.visibleIndex)&&(l&&o.push(l),l={key:g,index:t[r]??t[r-1]+1,visibleIndex:s.visibleIndex,edge:s.edge,stroke:s.stroke,from:s.index,to:s.index+s.length-1,intersections:[],length:1}),l.to=s.index+s.length-1,l.visibleIndex=s.visibleIndex}l&&o.push(l)}),o};h=h.sort(Je),m=m.sort(Ke);const C=q(v,p,!1),x=q(w,f,!0);if(0===C.length&&0===x.length)return null;for(let e=0;e<x.length;e++){const t=x[e];let n=X.findEqualOrGreater(C,t.from,e=>e.index),o=!1;for(;!o;){const e=C[n++];e&&e.index>=t.from&&e.index<=t.to+1&&e.from<=t.index&&e.to+1>=t.index&&(t.intersections.push({stroke:e.stroke,range:{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}}),e.intersections.push({stroke:t.stroke,range:{rowStart:t.index,rowEnd:t.index,colStart:t.from,colEnd:t.to+1}})),o=!e||e.index>t.to+1}}for(let e=0;e<x.length;e++){const o=x[e];let i=o.stroke;const s=`rBorder:${o.index}:${o.from}:${o.to}:${o.edge}`,d={rowStart:o.index,rowEnd:o.index,colStart:o.from,colEnd:o.to+1},c=n.getLayout(),u=!1,g=c.getColOffset(d.colStart),h=c.getRowOffset(d.rowStart),m=[g,h,c.getColOffset(d.colEnd),h];y.push(t({key:s,points:m,stroke:i,darkMode:r,forceThinBorder:l,shiftIfWide:a,range:d,intersections:o.intersections,layout:c,isVertical:u}))}for(let e=0;e<C.length;e++){const o=C[e];let i=o.stroke;const s=`cBorder:${o.index}:${o.from}:${o.to}:${o.edge}`,d={rowStart:o.from,rowEnd:o.to+1,colStart:o.index,colEnd:o.index},c=n.getLayout(),u=!0,g=c.getColOffset(d.colStart),h=[g,c.getRowOffset(d.rowStart),g,c.getRowOffset(d.rowEnd)];y.push(t({key:s,stroke:i,points:h,darkMode:r,forceThinBorder:l,shiftIfWide:a,range:d,intersections:o.intersections,layout:c,isVertical:u}))}return _("svg",{width:`${d.width}`,height:`${d.height}`,viewBox:`0 0 ${d.width} ${d.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${d.width}px`,height:`${d.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:y},"borders")},[e,r]);return{overlay:d}},tt=Y.Center,nt=Object.freeze({horizontal:!1,vertical:!1}),ot=K.EmptyTopLeft,rt=(e,t)=>J.EmptyCell,lt=(e,t)=>new Promise((e,t)=>{t("StaticBorderRenderer does not support scrolling")}),it=ee(e=>{const{getBorderAt:t,width:n,height:o,style:r,rowCount:l=2,columnCount:i=2,darkMode:a,forceThinBorder:s,children:d,...c}=e,u=re(null),[g,{width:h,height:m}]=Ye(),p=n??h,f=o??m,v=te(()=>{const e=[];for(let t=0;t<l;t++)for(let n=0;n<i;n++){const o={colIndex:n,rowIndex:t};e.push({coords:o,value:o})}return e},[]),w=ae(e=>v,[v]),{overlay:y}=et({getVisibleCells:w,getBorderAt:t,darkMode:a,forceThinBorder:s}),b=Math.floor(p/i),q=Math.floor(f/l),C={getColOffset:e=>Math.ceil(e*b)+0,getRowOffset:e=>Math.ceil(e*q)+0,getColIndex:e=>Math.floor((e-0)/b)-1,getRowIndex:e=>Math.floor((e-0)/q)-1},x={rowStart:0,colStart:0,rowEnd:l,colEnd:i},S={x:0,y:0,width:Math.max(0,p)+0,height:Math.max(0,f)+0},k=te(()=>{const e={},t=Math.floor(p/i);for(let n=0;n<i;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[p,f]),R=te(()=>{const e={},t=Math.floor(f/l);for(let n=0;n<l;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[p,f]);if(!y)return null;const M={width:p,height:f},T={width:p,height:f},D={getStage:()=>u.current,getTotalSize:()=>M,getViewportSize:()=>T,getLayout:()=>C,getCellCoordsAsRangeCoords:J.cellToRange,getVisibleRangeCoords:()=>x,getVisibleRows:()=>{const e=[];for(let t=0;t<l;t++)e.push(t);return e},getTotalRangeCoords:()=>x,getRelativePointFromClient:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{const e=[];for(let t=0;t<i;t++)e.push(t);return e},toClipBounds:(e,t)=>S,toViewBounds:e=>e,toAbsoluteBounds:e=>e,getBounds:()=>S,getInsets:()=>null,getRangeCoordsBounds:(e,t)=>null,getVisibleColumnOffsets:()=>k,getVisibleRowOffsets:()=>R,allViews:()=>({[tt]:D}),getAnchor:()=>tt,getZoom:()=>1,scrollCellCoordsIntoView:lt,getCellCoordsFromClient:rt,getScrollOrientation:()=>nt,getScrollTopLeft:()=>ot,getFreezeTopLeft:()=>ot},A=y(D);return G("div",{style:{...r,position:"relative",display:"flex"},...c,children:[_("div",{ref:Ue([u,g]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:d}),A]})});function at(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=at(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function st(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=at(e))&&(o&&(o+=" "),o+=t);return o}const dt="_sheetxl-sheet_1qeq6_5",ct="_viewport-overlay_1qeq6_6",ut=e=>{const{style:t,...n}=e??{};return G("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[_("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"}),_("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"}),_("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"}),_("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"}),_("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"})]})},gt=ee(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:o="grey",credits:r="All rights reserved - Michael Ford",feature:l,style:i,...a}=e??{},[s,c]=ne(null);Q.useEffect(()=>{(async()=>{const e=await d.getDetails();c(e)})()},[]);const[u,g]=Q.useState(!1),h={opacity:.65},m=Q.useMemo(()=>{const e=s?.exceptions(),t=e?.length??0;if(0===t)return null;const o=[];for(let r=0;r<t;r++){const t=e[r];o.push(_("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:t},r))}return o},[s,n]);if(null===s)return null;if(s.isValidFor(l))return null;const p=s.type(),f=!m&&p.endsWith("ity"),v=s.licensee(),w=f?1.6:1,y=135/w,b=37/w;let q=null;return!p&&v?.length>0&&(q=_("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:v})),_("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...i},...a,children:G("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[u?_(ut,{style:h}):_("svg",{width:y,height:b,style:h,children:_("image",{style:{width:y,height:b},href:"https://www.sheetxl.com/watermark.svg",onError:()=>g(!0)})}),G("div",{children:[q,m,_("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:o},children:r})]})]})})}),ht=(e,t,n)=>{const o=re(t);o.current=t;const r=n?.fireOnModelChange??!0;le(()=>{if(!e||!o.current)return;const t=Object.keys(o.current),l={},i=t.length;for(let e=0;e<i;e++){const n=t[e];l[n]=(e,t)=>{o.current[n]?.(e,t)}}const a=e.addListeners(l,n);if(r)for(let n=0;n<i;n++){l[t[n]](e)}return()=>{a?.()}},[e])},mt=(e,t,n,o)=>{const r=re(n);r.current=n;const l=o?.fireOnAddressChange??!0;le(()=>{if(!e||!t||!r.current){const e={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void r.current?.(e)}const n=e=>{r.current?.(e)},i=e.getRange(t).addListener(n,o);if(l){const o=e.getRange(t);n({getSource:()=>o,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{i?.()}},[e,t])},pt=new h("transparent");function ft(e){const{sheet:l,onRepeatCommandChange:i,bodyStyle:d,commands:h,target:p,notifier:f,onStartEdit:v,getViewport:w}=e,[y,b]=ne(null),[q,C]=ne(null),S=re(null),D=x(v,[v]),I=x(w,[w]),[N,O]=ne(),[L,V]=ne(()=>l?.getStyles().parseColor(c.Scheme.Bg2)),[B,H]=ne(()=>l?.getStyles().getNormal().getFont().getFill()),P=A();re(P.getMode()).current=P.getMode();const W=E(),[$,U]=ne(X.EmptyArray),j=ae(()=>{if(S.current!==l)return;const e=l.getSelectedRanges();let t=null;$.length>0&&J.isCellWithinRange(y,$[0].getRange().getCoords())&&(t=$[0]);const n=l?.getSelectedCell(),o=n?.getCoords()??null;Me(()=>{ue(t),b(o),C(e)})},[l,$,q,y]),Z=ae(X.debounce(j,210),[j]);le(()=>{S.current=l,j()},[l]);const Y=x(()=>l.getRange(y).getCell(),[l,y]),K=x(async(e,t,n=null,o=!1,r=!0)=>{const a=e?.label?.(),s=async()=>{const e=await Promise.resolve(r&&f?.showBusy?.(a??"Busy..."));try{await l.doBatch(async()=>t(l),a),o&&P.setMode(null),e&&e()}catch(t){if(e&&e(),!t)return;f?.showError?.(t)}},d=[];let c=!1;const u=async()=>(d.push(s),(async()=>{if(!c){for(c=!0;d.length>0;){const e=d.shift();e&&await e()}c=!1}})());if(i){let t=null;if(!1!==n&&e){const o=n??a;t=new k(e.key(),p,{label:o,description:o},u)}i(t)}return u()},[l,i,f]),Q=x((e,t,n=!1,o)=>K(e,e=>{const r=e.getSelectedRanges();n&&r.updateStyle(null,o),r.updateStyle(t,o),r.autoFit({expandOnly:s.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[l]),ee=x((e,t,n)=>{K(e,e=>{let o=t;(n||t?.address)&&(o=o??{},!n&&t?.address?.startsWith("#")?n=t?.address.substring(1):n&&(o.displayText=n)),e.getSelectedRange().setHyperlink(o)})},[l]),oe=x((e,t)=>{K(e,e=>{e.getSelectedRange().setComments(t)})},[l]),ie=x((e,t)=>{K(e,e=>{e.getSelectedRanges().clear(t)})},[l]),se=x(async(e,t,n=!1,o=!1)=>K(e,async e=>{let r=e.getSelectedRanges();n&&(t===s.Orientation.Row?r=r.getEntireRows(o):t===s.Orientation.Column&&(r=r.getEntireColumns(o)));let l=null;const i=P.getMode()?.key;if("copy"===i||"cut"===i){const e=await W.getClipboard().readReference();e&&"range"===e.getItemType()&&(l=e.getItem(),l.getCoords()||(l=null))}if(l){const e=await r.insertFrom(l,{...l.getMarkOptions(),orientation:t,autoSelect:!0});!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({orientations:s.Orientations.Row,minContent:!0}),P.setMode(null)}else r.insert(t,{autoSelect:!0})},"Insert Cells",!1),[P]),[ce,ue]=ne(null),ge=x(e=>l.getStyles().setDefaultTableStyle(e),[l]),he=x(e=>{l.getStyles().getTableStyle(e)?.delete()},[l]),me=x((e,t)=>{K(e,async e=>{const n=e.getSelectedRange(),o=e.getSelectedCell().getCoords();let r=null,l=0;const i=o.rowIndex>0?e.getRange({rowIndex:o.rowIndex,colIndex:o.colIndex}).getExtended(s.Direction.Up):null;i&&e.getRange({colStart:o.colIndex,rowStart:i.getCoords().rowStart,colEnd:o.colIndex,rowEnd:i.getCoords().rowStart}).isContentful()&&(r=s.Direction.Up,l=o.rowIndex-i.getCoords().rowEnd);const a=o.colIndex>0?e.getRange({rowIndex:o.rowIndex,colIndex:o.colIndex-1}).getExtended(s.Direction.Left):null;if(a&&e.getRange({colStart:a.getCoords().colStart,rowStart:o.rowIndex,colEnd:a.getCoords().colStart,rowEnd:o.rowIndex}).isContentful()){const e=o.colIndex-a.getCoords().colEnd;(e<l||!r)&&(r=s.Direction.Left,l=e)}let d=null;if(r===s.Direction.Up){if(d={...i.getCoords()},(d.rowEnd===o.rowIndex||!e.getRange({colIndex:o.colIndex,rowIndex:o.rowIndex-1}).isContentful())&&d.rowStart>0&&e.getRange({colIndex:o.colIndex,rowIndex:d.rowStart-1}).isContentful()){const e=i.getExtended(s.Direction.Up);d={colStart:o.colIndex,rowStart:e.getCoords().rowStart,colEnd:o.colIndex,rowEnd:i.getCoords().rowEnd}}d.rowEnd=o.rowIndex-1}else if(r===s.Direction.Left){if(d={...a.getCoords()},(d.colEnd===o.colIndex||!e.getRange({colIndex:o.colIndex-1,rowIndex:o.rowIndex}).isContentful())&&d.colStart>0&&e.getRange({colIndex:d.colStart-1,rowIndex:o.rowIndex}).isContentful()){const e=a.getExtended(s.Direction.Left);d={colStart:e.getCoords().colStart,rowStart:o.rowIndex,colEnd:e.getCoords().colEnd,rowEnd:o.rowIndex}}d.colEnd=o.colIndex-1}if(1!==n.size&&r){const o=n.getCoords(),l=n.startIncrementalUpdates({orientation:s.Orientation.Column}),i={...d},a=o.rowStart,c=o.rowEnd,u=o.colStart,g=o.colEnd,h=r===s.Direction.Up;for(let n=u;n<=g;n++){i.colStart=h?n:d.colStart+(n-u),i.colEnd=h?n:d.colEnd+(n-u);for(let o=a;o<=c;o++){i.rowStart=h?d.rowStart+(o-a):o,i.rowEnd=h?d.rowEnd+(o-a):o;const r=e.getRange(i).toString();l.pushAt(o,n,`=${t}(${r})`)}}l.apply()}else{const n=d?e.getRange(d).toString():"",o=`=${t}(`;D?.({text:`${o}${n})`,editMode:!0,initialSelection:{start:o.length,end:o.length+n.length}})}},!1)},[l]),pe=x((e,t,n=!1,o=!0)=>{K(e,async r=>{let l=null;if(ce)return void ce.updateStyleOptions(t);{const e=r.getSelectedRanges().getFixed(!0),t=r.getSelectedRange().getDefaultSortCriteria();let n={ranges:e,hasHeader:t?.options?.hasHeader??!1};l=o?new Promise((e,t)=>{const o={tableOptions:n,onCancel:()=>{t()},onDone:t=>{e(t)},context:{getNames:()=>r.getNames()}};f.showWindow?.("tableNew",o)}):{option:"Ok",tableOptions:n}}const i=await Promise.resolve(l);if("Ok"!==i?.option)throw null;const a=await Promise.resolve(f?.showBusy?.(e.label()));try{const e=r.getTables().add(i.tableOptions.ranges.at(0),{styleName:t?.name,clearFormatting:n,hasHeader:i.tableOptions.hasHeader});await e.getRange().select()}catch(e){a(),f?.showError?.(e)}a()},!1,!0,!1)},[ce]),fe=x(()=>d,[d]),ve=x(e=>({styles:()=>l.getStyles(),table:()=>e,bodyStyle:fe,getNames:()=>l.getNames()}),[l]),we=x(async(e,t,n,o=!0)=>{let r=null;if(!t){let e=l.getSelectedRange();1===e.size&&(e=e.getSurrounding());let n=l.getTables().search({address:l.getSelectedRange()});n.length>0&&(t=n[0]),await e.select()}if(t){if(o){try{n&&await t.select()}catch(e){}r=new Promise(async(n,o)=>{e.update({context:ve(t)});const r={command:e,commands:Oe,notifier:f,onDone:e=>{n(e)}},l=await(f.showWindow?.("tableDetails",r,{disableAutoDestroy:!0}));setTimeout(()=>{l.focus()},180)})}Promise.resolve(r).then(e=>{},e=>{f?.showError?.(e)})}},[f]),ye=x(async(e,t,n=!1)=>{let o=null;if(t)t.isITable?o=t:t.getValue()&&(o=t.getValue());else{const e=l.getTables().search({address:l.getSelectedRange()});e.length>0&&(o=e[0])}if(o){if(!n){const e=o.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4){if("Convert"!==await(f?.showOptions({title:"Confirm",description:`Converting a table to range with '${t}' cells will set a large number of cell styles and may affect performance.\nContinue?`,options:["Convert","Cancel"],defaultOption:"Convert"})))return}}K(e,async()=>{n?o.delete():o.convertToRange()},!1,!0)}},[f]),be=x((e,t,n)=>{K(e,async o=>{let r=o.getSelectedRanges();if(r.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let l=r.at(0);1===l.size&&(l=l.getSurrounding());const i=o.getSelection().getCoords().cell;let a=l.getDefaultSortCriteria(s.Orientation.Row,i);if(!a){if(n)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let d=a.options;if(n&&(d=new Promise((e,t)=>{const n={range:l,options:a.options,cell:i,onCancel:()=>{t()},onDone:n=>{n?e(n.options):t()}};f.showWindow?.("sort",n)})),d=await Promise.resolve(d),!d)return;const c=await Promise.resolve(f?.showBusy?.(e.label()));try{l.doBatch(()=>{const e={...d,...t};l.sort(e),l.autoFit({orientations:e?.orientation===s.Orientation.Column?s.Orientations.Column:s.Orientations.Row,skipCustomSize:!0,minContent:!0})},e?.label?.())}catch(e){c(),f?.showError?.(e)}c()},!1,!1,!1)},[f]),qe=x(()=>{console.log("compactedSelection");const e=l.getSelection().getCoords(),t=l.getSelectedRanges().getFlattened().getCoords(),n=(e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t),o=new Worker(n);return URL.revokeObjectURL(n),o})("console.log('hello from worker');");setTimeout(()=>{n.terminate(),console.log("Worker terminated")},5e3);let o=-1;for(let n=0;-1===o&&n<t.length;n++)J.isCellWithinRange(e.cell,t[n])&&(o=n);if(J.isEqualRangesArrays(e.ranges,t))return;const r={cell:e.cell,ranges:t,rangeIndex:o};l.getSelection().updateCoords(r)},[l]),Ce=x(()=>{console.log("selectComments")},[l]),xe=x(async(e=!1,t=!1)=>{let n=null;if(t)n=l.getEntireRange();else{const t=l.getSelectedRange();if(t.isEntireRange()){const e=l.getSelection().getCoords().cell,t=l.getRange(e);n=t.getSurrounding(),n.isEntireRange()&&(n=t)}else n=t.getSurrounding({contentOnly:e})}n&&await n.select()},[l]),Se=x((e,t,n)=>{K(e,async e=>{let o=e.getSelectedRanges();n&&(t===s.Orientation.Row?o=o.getEntireRows():t===s.Orientation.Column&&(o=o.getEntireColumns())),o.delete(t)},"Delete Cells")},[l]);x(async e=>{let t=null;const n=I(),o=Math.min(n.width-8,480),r=Math.min(n.height-8,288);try{l.getSelectedRanges();t=await l.getMovables().add({bounds:{x:n.left+(n.width-o)/2,y:n.top+(n.height-r)/2,width:o,height:r},type:"chart",json:e.template}),t.select(),P.setMode(null)}catch(e){f?.showError?.(e)}return t},[l,f]);const ke=x(async(e,t,n)=>{const o=await(f?.showBusy?.(e.label()));try{const e=await l.getMovables().addImage(t,{autoSelect:!0,...n});return o(),P.setMode(null),e}catch(e){o();let t=e;"string"!=typeof t&&(console.warn(e),t="Unable to resolve image."),f?.showMessage?.(t,{type:z.Error})}},[l,f]),Re=x((e,t)=>{K(e,async n=>{const o=n.getSelectedRanges();o.doBatch(()=>{const e=t===s.Direction.Up||t===s.Direction.Down,r=o.getCoords().slice().sort(J.createRangeComparator(e?s.Orientation.Row:s.Orientation.Column));for(let e=0;e<r.length;e++){const o=r[e];let l=o;const i=n.getRange(l).getMerges();let a=0,d=0;if(i.length>0){const e=i[0];a=e.rowEnd-e.rowStart,d=e.colEnd-e.colStart}t===s.Direction.Left?l={...o,colStart:o.colEnd+d}:t===s.Direction.Right?l={...o,colEnd:o.colStart+d}:t===s.Direction.Up?l={...o,rowStart:o.rowEnd+a}:t===s.Direction.Down&&(l={...o,rowEnd:o.rowStart+a}),n.getRange(l).autoFill(o,{filler:u.Types.Copy}),n.getRange(o).autoFit({orientations:s.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:e.label()})})},[f]),Te=x(()=>{let e=null;const t=l.getSelectedCell().getCoords();if(t?.rowIndex>0){const n=l.getRange({rowIndex:t.rowIndex-1,colIndex:t.colIndex}).getCell();n&&(e=n.toTextUnformatted(!0))}D?.({text:e})},[l]),[Ae,Ee]=de(e=>e+1,0),[Fe,Ie]=de(e=>e+1,0),Ne=te(()=>[new R("gridlinesToggle",p,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new R("sheetViewToggleGridlinesRows",p,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new R("sheetViewToggleGridlinesColumns",p,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new R("sheetViewFormatGridlinesColor",p,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new R("sheetViewToggleShowHeadings",p,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new R("sheetViewToggleShowHeadingRows",p,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new R("sheetViewToggleShowHeadingColumns",p,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new R("sheetViewToggleShowHeadingsNumeric",p,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[M.Ctrl,M.Shift]}}),new R("sheetViewToggleFormulaView",p,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[M.Ctrl]},{key:"`",modifiers:[M.Ctrl,M.Shift]}]}),new R("sheetViewToggleShowZeros",p,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new k("selectComments",p,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[M.Ctrl,M.Shift]}},()=>Ce()),new R("selectAll",p,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[M.Ctrl]},{key:"Space",modifiers:[M.Ctrl,M.Shift]}]},(e=!1)=>xe(!1,e)),new k("selectRegion",p,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[M.Ctrl,M.Shift]}},()=>xe(!0,!1)),new k("breakSelection",p,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl,M.Alt]}},()=>qe()),new k("formatTextRotate0",p,{label:"No Text Rotation",description:"Remove all text rotation."}),new k("formatTextRotate45",p,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new k("formatTextRotate90",p,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new k("formatTextRotate270",p,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new k("formatTextRotate315",p,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new R("formatTextRotateCustom",p,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new k("formatTextRotateVertical",p,{label:"Vertical Text",description:"Stack text vertically."}),new k("sortAscending",p,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){be(this,{reverse:!1},!1)}),new k("sortDescending",p,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){be(this,{reverse:!0},!1)}),new k("sortCustom",p,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){be(this,{},!0)}),new R("protectionSheetToggle",p,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:"Prevent unwanted changes from others by limiting their ability to edit.\nFor example, you can prevent people from editing locked cells or making formatting changes."}),new R("formatSheetTabColor",p,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new R("formatCellStyle",p,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(e){Q(this,{named:e.getName()},!0)}),new R("formatTableStyle",p,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(e){pe(this,e)}),new R("formatTableStyleClearCellStyles",p,{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(e){pe(this,e,!0)}),new R("formatTableStyleClearTableStyle",p,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){pe(this,{name:null},!0)}),new R("setDefaultTableStyle",p,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ge),new R("deleteTableStyle",p,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},he),new R("formatBorder",p,{label:"Border",description:"Create an outline border."},function(e){Q(this,{border:e})}),new R("formatFillColor",p,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(e){Q(this,{fill:e})}),new R("formatFontColor",p,{label:"Font Color",description:"Change the color of your text."},function(e){Q(this,{font:{fill:e}})}),new R("formatBoldToggle",p,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[M.Ctrl]},{key:"2",modifiers:[M.Ctrl]}]}),new R("formatItalicToggle",p,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[M.Ctrl]},{key:"3",modifiers:[M.Ctrl]}]}),new R("formatUnderlinedToggle",p,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[M.Ctrl]},{key:"4",modifiers:[M.Ctrl]}]}),new R("formatUnderlinedDoubleToggle",p,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new R("formatUnderlinedAccountingToggle",p,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new R("formatUnderlinedAccountingDoubleToggle",p,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new R("formatStrikeThroughToggle",p,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[M.Ctrl]}}),new R("formatSuperscriptToggle",p,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new R("formatSubscriptToggle",p,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new R("formatAlignTopToggle",p,{label:"Align Top",description:"Align text to the top."}),new R("formatTextOverflowVisibleToggle",p,{label:"Overflow Text",description:"Overflow text to the next cells."}),new R("formatTextOverflowWrapToggle",p,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new R("formatTextOverflowClipToggle",p,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new R("formatTextOverflowShrinkToggle",p,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new R("formatTextOverflowEllipsisToggle",p,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new R("formatAlignMiddleToggle",p,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new R("formatAlignBottomToggle",p,{label:"Align Bottom",description:"Align text to the bottom."}),new R("formatAlignJustifyVerticalToggle",p,{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("formatAlignDistributedVerticalToggle",p,{label:"Distribute Vertically",description:"Justify your content vertically."}),new R("formatAlignLeftToggle",p,{label:"Align Left",description:"Align your content to the left."}),new R("formatAlignCenterToggle",p,{label:"Align Center",description:"Center your content."}),new R("formatAlignRightToggle",p,{label:"Align Right",description:"Align your content to the right."}),new R("formatAlignJustifyToggle",p,{label:"Align Justify",description:"Justify your content."}),new R("formatAlignCenterContinuousToggle",p,{label:"Center Across",description:"Center your content across multiple cells."}),new R("formatAlignFillToggle",p,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new R("formatAlignDistributedHorizontalToggle",p,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new k("formatFontSizeIncrease",p,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,e=>({font:{size:ze(e.getFont().getSize(),!0)}}))}),new k("formatFontSizeDecrease",p,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,e=>({font:{size:ze(e.getFont().getSize(),!1)}}))}),new R("formatFontFamily",p,{label:"Font",description:"Select the font your text."},function(e){Q(this,{font:{family:e}})}),new R("formatFontSize",p,{label:"Font Size",description:"Change the size of your text."},function(e){Q(this,{font:{size:e}})}),new R("formatNumberDialog",p,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[M.Ctrl]},{key:"1",modifiers:[M.Ctrl,M.Alt]}]},function(e,t){const n=this,o={initialValue:e??t.state(),context:t.context(),onInputOption:(e,t)=>{Q(n,{numberFormat:e})}};f.showWindow?.("numberFormat",o)}),new R("formatNumberFormat",p,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(e){Q(this,{numberFormat:e})}),new R("formatNumberFormatGeneralStyle",p,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:t.Type.General})}),new R("formatNumberFormatNumberStyle",p,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"#,##0.00"})}),new R("formatNumberFormatTimeStyle",p,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"h:mm AM/PM"})}),new R("formatNumberFormatDateStyle",p,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"d-mmm-yy"})}),new R("formatNumberFormatAccountingStyle",p,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[M.Ctrl,M.Shift]}},function(e){Q(this,{numberFormat:e??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new R("formatNumberFormatPercentStyle",p,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"0%"})}),new R("formatNumberFormatScientificStyle",p,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[M.Ctrl,M.Shift]}},function(){Q(this,{numberFormat:"0.00E+00"})}),new R("formatNumberFormatCommaStyle",p,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[M.Ctrl]}},function(){Q(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new R("formatNumberFormatIncreaseDecimal",p,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){Q(this,e=>({numberFormat:t.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}),new R("formatNumberFormatDecreaseDecimal",p,{label:"Decrease Decimal",description:"Show few decimal places."},function(){Q(this,e=>({numberFormat:t.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}),new R("displayPlaceholdersToggle",p,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[M.Ctrl]}}),new k("noOp",p,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[M.Ctrl]}},function(){}),new R("displayOutlineSymbolsToggle",p,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[M.Ctrl]}}),new R("hideRows",p,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[M.Ctrl]}}),new R("unhideRows",p,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[M.Ctrl,M.Shift]}}),new R("hideColumns",p,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[M.Ctrl]},{key:"0",modifiers:[M.Ctrl,M.Alt]}]}),new R("unhideColumns",p,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[M.Ctrl,M.Shift]}}),new R("quickFormulaSum",p,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[M.Alt]}},function(){me(this,"SUM")}),new R("quickFormulaAverage",p,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){me(this,"AVERAGE")}),new R("quickFormulaCount",p,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){me(this,"COUNT")}),new R("quickFormulaMax",p,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){me(this,"MAX")}),new R("quickFormulaMin",p,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){me(this,"MIN")}),new R("startEditCurrentTime",p,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl,M.Shift]}},function(){D?.({text:l.createTemporaryCell({value:De(),style:{numberFormat:"Medium Time"}}).toText()})}),new R("startEditCurrentDate",p,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[M.Ctrl]}},function(){D?.({text:l.createTemporaryCell({value:De(),style:{numberFormat:"Short Date"}}).toText()})}),new k("sheetZoomOut",p,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[M.Ctrl,M.Alt]},{key:"NumpadSubtract",modifiers:[M.Ctrl,M.Alt]}]}),new k("sheetZoomIn",p,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[M.Ctrl,M.Alt]},{key:"NumpadAdd",modifiers:[M.Ctrl,M.Alt]}]}),new k("sheetZoom100",p,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[M.Ctrl,M.Alt]}}),new R("insertFunction",p,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[M.Shift]}},function(e,t){console.log("insertFunction")}),new R("updateHyperlink",p,{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:()=>Y,shortcut:[{key:"K",modifiers:[M.Ctrl]},{key:"K",modifiers:[M.Ctrl,M.Alt]}]},async function(e,t){const n=this,o={context:t.context(),onUpdateHyperlink:(e,t)=>{ee(n,e,t)}};f.showWindow?.("hyperlink",o)}),new R("openHyperlink",p,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[M.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>Y},async(e,t)=>{const n=t.context()();if(!n)return;const o=n.getHyperlink();if(o)try{await o.open()}catch(e){f?.showError?.(e)}}),new R("deleteHyperlink",p,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>Y},function(e,t){ee(this,null,null)}),new k("insertNote",p,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[M.Shift]},description:"Add a note to the cell."},(e,t)=>{((e,t)=>{e?.showMessage?.(G("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[t," is not yet implemented.",_("br",{}),_("br",{}),"Please see the ",_("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(f,t.label())}),new R("updateComments",p,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[M.Ctrl,M.Alt]},description:"Add a comment to the current cell.",context:()=>Y},async function(e,t){const n=this,o={context:t.context(),onUpdateComments:e=>{oe(n,e)}};f.showWindow?.("comments",o)}),new R("deleteComments",p,{label:"Delete Comments",description:"Remove any comments.",context:()=>Y},function(e,t){oe(this,null)}),new R("insertImageFromFile",p,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(e=null){let t=null,n=null;"string"==typeof e?n=e:t=e?.file?e.file:e,(t||(t=await X.openFileDialog(n??"image/*"),t))&&await ke(this,{file:t},e?.options)}),new R("insertImageFromURL",p,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(e){if(!e){const t=await(f?.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("Insert"!==t.option)return;e=t.input}e&&ke(this,{fetch:e})}),new k("insertTable",p,{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:[M.Ctrl]},{key:"T",modifiers:[M.Alt,M.Ctrl]}]},function(){pe(this)}),new R("editTable",p,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(e){let t=null,n=!1;e.isITable?t=e:e.getValue()&&(t=e.getValue(),n=!0),we(this,t,n)}),new R("deleteTable",p,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:"Remove the table.\n\nThe table and table specific styling will be removed but the values will be preserved."},function(e){ye(this,e,!0)}),new R("convertTableToRange",p,{label:"Convert To Range",description:"Convert the table into a normal range of cells.\n\nThe values and the formatting are preserved."},function(e){ye(this,e,!1)}),new R("tableTotalRowToggle",p,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[M.Ctrl,M.Alt]}},function(){const e=this.context().table();e&&e.setShowTotals(!e.getShowTotals())}),new R("tableHeaderRowToggle",p,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const e=this.context().table();e&&e.setShowHeaders(!e.getShowHeaders())}),new R("autoFilterToggle",p,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[M.Ctrl,M.Shift]}},function(){const e=this.context().table();e&&e.setShowFilterButton(!e.getShowFilterButton())}),new R("autoFilterReapply",p,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[M.Ctrl,M.Alt]}}),new R("autoFilterClear",p,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new k("startEditValueAbove",p,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[M.Ctrl]},{key:'"',modifiers:[M.Ctrl,M.Shift]}]},Te),new R("formatPainterToggle",p,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new k("insertCells",p,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[M.Ctrl,M.Shift]}},function(){se(this)}),new k("insertCellsShiftRight",p,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){se(this,s.Orientation.Column)}),new k("insertCellsShiftDown",p,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return se(this,s.Orientation.Row)}),new k("insertRows",p,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return se(this,s.Orientation.Row,!0)}),new k("insertColumns",p,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return se(this,s.Orientation.Column,!0)}),new k("insertRowsAfter",p,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return se(this,s.Orientation.Row,!0,!0)}),new k("insertColumnsAfter",p,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return se(this,s.Orientation.Column,!0,!0)}),new k("deleteCells",p,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[M.Ctrl]}},function(){return Se(this)}),new k("deleteCellsShiftUp",p,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return Se(this,s.Orientation.Row)}),new k("deleteCellsShiftLeft",p,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return Se(this,s.Orientation.Column)}),new k("deleteRows",p,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return Se(this,s.Orientation.Row,!0)}),new k("deleteColumns",p,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return Se(this,s.Orientation.Column,!0)}),new k("flashFill",p,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[M.Ctrl]},{key:"e",modifiers:[M.Ctrl,M.Alt]}]}),new k("fillDown",p,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[M.Ctrl]}},function(){return Re(this,s.Direction.Down)}),new k("fillRight",p,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[M.Ctrl]}]},function(){return Re(this,s.Direction.Right)}),new k("fillUp",p,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return Re(this,s.Direction.Up)}),new k("fillLeft",p,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return Re(this,s.Direction.Left)}),new k("formatBorderAddOutline",p,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[M.Ctrl,M.Shift]}},function(){return Q(this,{border:{left:{style:o.StrokeStyle.Thin,color:null},top:{style:o.StrokeStyle.Thin,color:null},right:{style:o.StrokeStyle.Thin,color:null},bottom:{style:o.StrokeStyle.Thin,color:null}}})}),new k("formatBorderClearOutline",p,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[M.Ctrl,M.Shift]}},function(){return Q(this,{border:null})}),new k("formatIndentDecrease",p,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return Q(this,e=>{const t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}})}),new k("formatIndentIncrease",p,{label:"Increase Indent",description:"Move your content further from the border."},function(){return Q(this,e=>{const t={alignment:{indent:e.getAlignment().getIndent()+1}};return e.getAlignment().getHorizontal()===r.HorizontalAlignment.General&&(t.alignment.horizontal=r.HorizontalAlignment.Left),t})}),new R("mergeToggle",p,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[M.Ctrl]}}),new k("mergeHorizontal",p,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new k("mergeVertical",p,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new k("unmerge",p,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new k("clearContents",p,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:"Clear only the contents in the cells.\n\nThe formatting is not cleared.",shortcut:{key:"Delete"}},function(){ie(this,n.Content.Values)}),new k("clearFormats",p,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){ie(this,n.Content.Formats)}),new k("clearHyperlinks",p,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){ie(this,n.Content.Hyperlinks)}),new k("clearComments",p,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){ie(this,n.Content.Comments)}),new k("clearAll",p,{label:"Clear All",scopedLabels:{clear:"All"},description:"Clears everything from the cells.\n\nAll contents and formatting are removed.",shortcut:{key:"Delete",modifiers:[M.Ctrl,M.Shift]}},function(){ie(this)}),new R("freezeToggle",p,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new R("freezeToggleHorizontal",p,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new R("freezeToggleVertical",p,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new k("unfreeze",p,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new k("autoFitRows",p,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new k("autoFitColumns",p,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),Oe=te(()=>{let e=null;return e=h?h.createChildGroup(p,"sheet",!1):new T(p,"sheet"),e.addCommands(Ne,!0),e},[h,Ne]),[Le,Ve]=ne(!1),[Be,He]=ne(!1);le(()=>{if(S.current!==l||!q)return;const e=q.getCoords(),t=l.getTables().search({address:e[0]});U(e=>X.isEqualArrays(e,t)?e:t),y&&t[0]&&J.isCellWithinRange(y,t[0].getRange().getCoords())?ue(t[0]??null):ue(null);const n=l.getSelectedRanges(),o=n.getMerges().length>0,r=n.isOverlapping();let i=!0;for(let t=0;i&&t<e.length;t++)i=J.isSingleCell(e[t]);He(r),Ve(0===t.length&&!r&&(o||!i))},[Fe,q,l]),F(h,null,{onChange:()=>{const e=!l.getProtection().isFormatCellsAllowed(),t="formatPainter"===P.getMode()?.key;Oe.getCommand("formatPainterToggle").update({disabled:e||!h?.getCommand("copy"),state:()=>t}).updateCallback(()=>{if(t)return void P.setMode(null);return Oe.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"}})})}},[P,Ae,h]),ht(l.getView(),{onFreezeSplitChange:()=>{Ie()}}),ht(l.getSelection(),{onChange:()=>{Z()}});const Pe=()=>{Oe.getCommand("sheetViewFormatGridlinesColor").update({state:()=>l.getView().getGridLineColor(),context:()=>({onColorSelect:e=>{},darkMode:d.darkMode,autoColor:l.getStyles().parseColor(d.strokeFill),schemeLookup:l.getStyles().schemeLookup(),recentColors:()=>l.getStyles().recentColors(),addRecentColor:e=>l.getStyles().addRecentColor(e),clearRecentColors:()=>l.getStyles().clearRecentColors()})}),Oe.getCommand("formatSheetTabColor").updateCallback(e=>{l.setTabColor(e)}).update({state:()=>l?.getTabColor()??pt,context:()=>({onColorSelect:e=>{},darkMode:d.darkMode,autoColor:pt,schemeLookup:l.getStyles().schemeLookup(),recentColors:()=>l.getStyles().recentColors(),addRecentColor:e=>l.getStyles().addRecentColor(e),clearRecentColors:()=>l.getStyles().clearRecentColors()})})},We=()=>{Oe.getCommand("formatBorder").update({context:()=>({onBorderSelect:e=>{O(e)},darkMode:d.darkMode,quickBorder:N,autoColor:l.getStyles().getNormal().getFont().getFill(),autoStyle:o.StrokeStyle.Thin,createTemporaryBorder:e=>l.getStyles().getNormal().createTemporaryStyle({border:e}).getBorder(),schemeLookup:l.getStyles().schemeLookup()})})};le(()=>{We()},[N]),le(()=>{const e=!l.getProtection().isInsertHyperlinksAllowed();Oe.getCommand("openHyperlink").update({disabled:!Y().getHyperlink()}),Oe.getCommand("deleteHyperlink").update({disabled:e||!Y().getHyperlink()});const t=Y().getHyperlink()?"Edit":"Insert",n="Link";Oe.getCommand("updateHyperlink").update({label:()=>(Y().getHyperlink(),`${t} ${n}`),scopedLabels:{contextMenu:`${t} ${n}…`,insert:`${n}…`,hyperlink:`${t}…`},disabled:e})},[Y()?.getHyperlink(),Ae]),le(()=>{const e=Y().getComments(),t=()=>e?"Edit":"Insert",n=()=>e?"Comments":"Comment";Oe.getCommand("updateComments").update({label:()=>`${t()} ${n()}`,scopedLabels:{contextMenu:`${t()} ${n()}…`,insert:`${n()}…`}})},[Y()?.getComments(),Ae]),ht(l,{onViewChange:()=>{const e=l.getView();Oe.getCommand("sheetViewToggleFormulaView").update({state:e.isShowFormulas()}),Oe.getCommand("sheetViewToggleShowZeros").update({state:e.isShowZeros()}),Oe.getCommand("gridlinesToggle").update({state:e.isShowColumnGridlines()||e.isShowRowGridlines()}),Oe.getCommand("sheetViewToggleGridlinesColumns").update({state:e.isShowColumnGridlines()}),Oe.getCommand("sheetViewToggleGridlinesRows").update({state:e.isShowRowGridlines()}),Oe.getCommand("sheetViewToggleShowHeadings").update({state:e.isShowColumnHeaders()||e.isShowRowHeaders()}),Oe.getCommand("sheetViewToggleShowHeadingColumns").update({state:e.isShowColumnHeaders()}),Oe.getCommand("sheetViewToggleShowHeadingRows").update({state:e.isShowRowHeaders()}),Oe.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>l.getView().getColumnHeaderStyle()===g.HeaderTextStyle.Zero&&l.getView().getRowHeaderStyle()===g.HeaderTextStyle.Zero}),Pe()},onTabColorChange:()=>{Pe()},onMergesChange:()=>{Ie()},onMovablesChange:()=>{Ie()},onTablesChange:()=>{Ie()},onProtectionChange:()=>{Ie(),Ee()},onStyleChange:()=>{Pe(),We(),Ie()}}),le(()=>{Pe(),We()},[d]),le(()=>{const e=!l.getProtection().isFormatCellsAllowed(),t=$.length>0&&!ce||e,n=ve(ce),o={context:n};Oe.getCommand("editTable").update(o),Oe.getCommand("deleteTable").update(o),Oe.getCommand("convertTableToRange").update(o);const r={context:n,disabled:t};Oe.getCommand("formatTableStyle").update({label:ce?"Apply Table Style":"Format As Table",...r}),Oe.getCommand("formatTableStyleClearCellStyles").update(r),Oe.getCommand("deleteTableStyle").update(r),Oe.getCommand("convertTableToRange").update(r),Oe.getCommand("insertTable").update({disabled:t||$.length>0});const i={context:n,disabled:t||0===$.length};Oe.getCommand("tableHeaderRowToggle").update(i),Oe.getCommand("tableTotalRowToggle").update(i),Oe.getCommand("autoFilterToggle").update(i),Oe.getCommand("formatTableStyleClearTableStyle").update({...i,disabled:i.disabled||!ce||null===ce.getStyleOptions().name})},[ce,$,Ae]),le(()=>{Oe.getCommand("sheetZoomOut").updateCallback(()=>{l.getView().update({zoomScale:X.findNextStep(l.getView().getZoomScale(),!1)})}),Oe.getCommand("sheetZoomIn").updateCallback(()=>{l.getView().update({zoomScale:X.findNextStep(l.getView().getZoomScale())})}),Oe.getCommand("sheetZoom100").updateCallback(()=>{l.getView().update({zoomScale:100})}),Oe.getCommand("gridlinesToggle").updateCallback(()=>{const e=l.getView().isShowColumnGridlines()&&l.getView().isShowRowGridlines();l.getView().update({showColumnGridlines:!e,showRowGridlines:!e})}),Oe.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{l.getView().update({showRowGridlines:!l.getView().isShowRowGridlines()})}),Oe.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{l.getView().update({showColumnGridlines:!l.getView().isShowColumnGridlines()})}),Oe.getCommand("sheetViewFormatGridlinesColor").updateCallback(e=>{l.getView().update({gridLineColor:e})}),Oe.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const e=l.getView().isShowColumnHeaders()&&l.getView().isShowRowHeaders();l.getView().update({showColumnHeaders:!e,showRowHeaders:!e})}),Oe.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{l.getView().update({showColumnHeaders:!l.getView().isShowColumnHeaders()})}),Oe.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{l.getView().update({showRowHeaders:!l.getView().isShowRowHeaders()})}),Oe.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const e=l.getView().getColumnHeaderStyle()===g.HeaderTextStyle.Zero&&l.getView().getRowHeaderStyle()===g.HeaderTextStyle.Zero;l.getView().update({columnHeaderStyle:e?g.HeaderTextStyle.A1:g.HeaderTextStyle.Zero,rowHeaderStyle:e?g.HeaderTextStyle.One:g.HeaderTextStyle.Zero})}),Oe.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{l.getView().update({showFormulas:!l.getView().isShowFormulas()})}),Oe.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{l.getView().update({showZeros:!l.getView().isShowZeros()})})},[l]),le(()=>{const e=l.getView().getFreezePanes(),t=()=>0!==e.coords.rowIndex,n=()=>0!==e.coords.colIndex,o=()=>0!==e.coords.rowIndex||0!==e.coords.colIndex;Oe.getCommand("freezeToggle").updateCallback(()=>{o()?l.getView().setFreezePanes(null):o()?n()?l.getView().setFreezePanes({coords:{rowIndex:y.rowIndex}}):t()&&l.getView().setFreezePanes({coords:{colIndex:y.colIndex}}):l.getView().setFreezePanes({coords:y})}).update({state:o,disabled:()=>!y||!o()&&0===y.rowIndex&&0===y.colIndex}),Oe.getCommand("freezeToggleHorizontal").updateCallback(()=>{l.getView().setFreezePanes({coords:{rowIndex:t()?0:y.rowIndex}})}).update({state:t,disabled:()=>!y||!t()&&0===y.rowIndex}),Oe.getCommand("freezeToggleVertical").updateCallback(()=>{l.getView().setFreezePanes({coords:{colIndex:n()?0:y.colIndex}})}).update({state:n,disabled:()=>!y||!n()&&0===y.colIndex}),Oe.getCommand("unfreeze").updateCallback(()=>{l.getView().setFreezePanes(null)}).update({disabled:()=>!o()})},[Fe,y,l,d]);const $e=Y().getStyle(),Ue=$e.getFont(),je=$e.getAlignment(),_e=je.getHorizontal(),Ge=je.getVertical(),Ze=je.getOverflow(),Xe=je.getRotation();return le(()=>{Oe.getCommand("formatCellStyle").update({context:()=>({styles:()=>l.getStyles(),named:()=>Y().getStyle(!0).getNamed(),bodyStyle:fe,createTemporaryCell:e=>l.createTemporaryCell(e)})}),Oe.getCommand("formatFillColor").update({state:()=>{let e=null;const t=$e.getFill();return t?.getType()===m.Type.Solid?e=t.getColor():t?.getType()===m.Type.Gradient?e=t.getStops()?.[0]?.getColor():t?.getType()===m.Type.Pattern&&(e=t.getBackground()),e},context:()=>{const e=l.getStyles();return{onColorSelect:e=>{V(e??pt)},darkMode:d.darkMode,quickColor:L,autoColor:pt,schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),Oe.getCommand("formatFontColor").update({state:()=>Ue.toJSON()?.fill?Ue.getFill():null,context:()=>{const e=l.getStyles();return{onColorSelect:e=>{H(e)},darkMode:d.darkMode,quickColor:B,autoColor:e.getNormal().getFont().getFill(),schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),Oe.getCommand("formatNumberFormat").update({state:()=>$e.getNumberFormat(),context:()=>Y}),Oe.getCommand("formatNumberDialog").update({state:()=>$e.getNumberFormat(),context:()=>Y}),Oe.getCommand("formatFontFamily").update({state:()=>Ue.getFamily()}),Oe.getCommand("formatFontSize").update({state:()=>Ue.getSize()});const e=function(){const e=Ue.getWeight()||0;return!isNaN(e)&&e>500};Oe.getCommand("formatBoldToggle").updateCallback(function(){Q(this,{font:{weight:e()?400:700}})}).update({state:e});const t=function(){return Ue.getStyle()===a.Style.Italic};Oe.getCommand("formatItalicToggle").updateCallback(function(){Q(this,{font:{style:t()?a.Style.Normal:a.Style.Italic}})}).update({state:t}),Oe.getCommand("formatStrikeThroughToggle").updateCallback(function(){Q(this,{font:{strike:!Ue.getStrike()}})}).update({state:Ue.getStrike()}),Oe.getCommand("formatUnderlinedToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.Single?a.UnderlineStyle.Single:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.Single}),Oe.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.Double?a.UnderlineStyle.Double:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.Double}),Oe.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.SingleAccounting?a.UnderlineStyle.SingleAccounting:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.SingleAccounting}),Oe.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){Q(this,{font:{underline:Ue.getUnderline()!==a.UnderlineStyle.DoubleAccounting?a.UnderlineStyle.DoubleAccounting:a.UnderlineStyle.None}})}).update({state:Ue.getUnderline()===a.UnderlineStyle.DoubleAccounting}),Oe.getCommand("formatSuperscriptToggle").updateCallback(function(){Q(this,{font:{verticalAlign:Ue.getVerticalAlignment()!==a.VerticalAlignment.Super?a.VerticalAlignment.Super:a.VerticalAlignment.Baseline}})}).update({state:Ue.getVerticalAlignment()===a.VerticalAlignment.Super}),Oe.getCommand("formatSubscriptToggle").updateCallback(function(){Q(this,{font:{verticalAlign:Ue.getVerticalAlignment()!==a.VerticalAlignment.Sub?a.VerticalAlignment.Sub:a.VerticalAlignment.Baseline}})}).update({state:Ue.getVerticalAlignment()===a.VerticalAlignment.Sub});const n=()=>Ze===r.Overflow.Visible;Oe.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){Q(this,{alignment:{overflow:(n(),r.Overflow.Visible)}})}).update({state:n});const o=()=>Ze===r.Overflow.Wrap;Oe.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){Q(this,{alignment:{overflow:o()?r.Overflow.Visible:r.Overflow.Wrap}})}).update({state:o});const i=function(){return Ze===r.Overflow.Clip};Oe.getCommand("formatTextOverflowClipToggle").updateCallback(function(){Q(this,{alignment:{overflow:i()?r.Overflow.Visible:r.Overflow.Clip}})}).update({state:i});const s=function(){return Ze===r.Overflow.Shrink};Oe.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){Q(this,{alignment:{overflow:s()?r.Overflow.Visible:r.Overflow.Shrink}})}).update({state:s});const c=function(){return Ze===r.Overflow.Shrink};Oe.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){Q(this,{alignment:{overflow:c()?r.Overflow.Visible:r.Overflow.Ellipsis}})}).update({state:c,disabled:!0});const u=function(){return Ge===r.VerticalAlignment.Top};Oe.getCommand("formatAlignTopToggle").updateCallback(function(){Q(this,{alignment:{vertical:u()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Top}})}).update({state:u});const g=function(){return Ge===r.VerticalAlignment.Center};Oe.getCommand("formatAlignMiddleToggle").updateCallback(function(){Q(this,{alignment:{vertical:g()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Center}})}).update({state:g});const h=function(){return Ge===r.VerticalAlignment.Bottom};Oe.getCommand("formatAlignBottomToggle").updateCallback(function(){Q(this,{alignment:{vertical:(h(),r.VerticalAlignment.Bottom)}})}).update({state:h});const p=function(){return Ge===r.VerticalAlignment.Justify};Oe.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){Q(this,{alignment:{vertical:p()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Justify}})}).update({state:p});const f=function(){return Ge===r.VerticalAlignment.Distributed};Oe.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){Q(this,{alignment:{vertical:f()?r.VerticalAlignment.Bottom:r.VerticalAlignment.Distributed}})}).update({state:f});const v=function(){return _e===r.HorizontalAlignment.Left};Oe.getCommand("formatAlignLeftToggle").updateCallback(function(){Q(this,{alignment:{horizontal:v()?r.HorizontalAlignment.General:r.HorizontalAlignment.Left}})}).update({state:v});const w=function(){return _e===r.HorizontalAlignment.Center};Oe.getCommand("formatAlignCenterToggle").updateCallback(function(){Q(this,{alignment:{horizontal:w()?r.HorizontalAlignment.General:r.HorizontalAlignment.Center}})}).update({state:w});const y=function(){return _e===r.HorizontalAlignment.CenterContinuous};Oe.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const e={alignment:{horizontal:y()?r.HorizontalAlignment.General:r.HorizontalAlignment.CenterContinuous,rotation:null}};Q(this,e)}).update({state:y});const b=function(){return _e===r.HorizontalAlignment.Fill};Oe.getCommand("formatAlignFillToggle").updateCallback(function(){const e={alignment:{horizontal:b()?r.HorizontalAlignment.General:r.HorizontalAlignment.Fill,rotation:null}};Q(this,e)}).update({state:b});const q=function(){return _e===r.HorizontalAlignment.Distributed};Oe.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){Q(this,{alignment:{horizontal:q()?r.HorizontalAlignment.General:r.HorizontalAlignment.Distributed}})}).update({state:q});const C=function(){return _e===r.HorizontalAlignment.Right};Oe.getCommand("formatAlignRightToggle").updateCallback(function(){Q(this,{alignment:{horizontal:C()?r.HorizontalAlignment.General:r.HorizontalAlignment.Right}})}).update({state:C});const x=function(){return _e===r.HorizontalAlignment.Justify};Oe.getCommand("formatAlignJustifyToggle").updateCallback(function(){Q(this,{alignment:{horizontal:x()?r.HorizontalAlignment.General:r.HorizontalAlignment.Justify}})}).update({state:x});const S=!l.getProtection().isFormatCellsAllowed(),k=_e===r.HorizontalAlignment.CenterContinuous||_e===r.HorizontalAlignment.Fill;Oe.getCommand("formatTextRotate0").updateCallback(function(e){Q(this,{alignment:{rotation:0}})}).update({disabled:S||k,state:0===Xe}),Oe.getCommand("formatTextRotate45").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?45:0}})}).update({disabled:S||k,state:45===Xe}),Oe.getCommand("formatTextRotate90").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?90:0}})}).update({disabled:S||k,state:90===Xe}),Oe.getCommand("formatTextRotate270").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?270:0}})}).update({disabled:S||k,state:270===Xe}),Oe.getCommand("formatTextRotate315").updateCallback(function(e){Q(this,{alignment:{rotation:e??1?315:0}})}).update({disabled:S||k,state:315===Xe}),Oe.getCommand("formatTextRotateCustom").updateCallback(function(e){Q(this,{alignment:{rotation:e}})}).update({disabled:S||k,state:Xe??0})},[$e,l,d,L,B]),le(()=>{const e=!l.getProtection().isFormatCellsAllowed(),t=l.getSelectedRanges().getMerges().length>0,n=async(e,t)=>{K(t,async n=>{const o=async(o=!1)=>{const l=await Promise.resolve(f?.showBusy?.(t.label()));try{const t=n.getSelectedRanges();if(t.merge({orientations:e,discardMultipleValues:o}),e===s.Orientations.Both){const e={alignment:{horizontal:r.HorizontalAlignment.Center}};t.updateStyle(e)}}catch(e){throw e}finally{l?.()}};let l;try{await o()}catch(e){if("discardMultipleValues"!==e.type)throw e;l=!0}if(l&&f?.showOptions){if("Merge"!==await(f?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})))return;await o(!0)}},void 0,void 0,!1)},o=e=>{K(e,async e=>{try{const t=e.getSelectedRanges();t.unmerge();const n={alignment:{horizontal:null}};t.updateStyle(n)}catch(e){throw e}})};Oe.getCommand("mergeToggle").updateCallback(function(){J.isSingleCell(l.getSelectedRange().getCoords())||(t?o(this):n(s.Orientations.Both,this))}).update({state:t,disabled:!Le||e}),Oe.getCommand("mergeHorizontal").updateCallback(function(){n(s.Orientations.Column,this)}).update({disabled:!Le||e}),Oe.getCommand("mergeVertical").updateCallback(function(){n(s.Orientations.Row,this)}).update({disabled:!Le}),Oe.getCommand("unmerge").updateCallback(function(){o(this)}).update({disabled:!t||!Le||e});const i={disabled:e};Oe.getCommand("hideRows").updateCallback(function(){K(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),Oe.getCommand("hideColumns").updateCallback(function(){K(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),Oe.getCommand("unhideRows").updateCallback(function(){K(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),Oe.getCommand("unhideColumns").updateCallback(function(){K(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),Oe.getCommand("autoFitRows").updateCallback(function(){K(this,e=>{e.getSelectedRanges().autoFit({orientations:s.Orientations.Row})})}).update(i),Oe.getCommand("autoFitColumns").updateCallback(function(){K(this,e=>{e.getSelectedRanges().autoFit({orientations:s.Orientations.Column})})}).update(i);let a=!1,d=0,c=!1,u=!1,g=0,h=!1;!q||e||Be||(a=q.isEntireColumnsAny(),a&&!q.isEntireColumns()?c=!0:d=q.getColumnCount(),u=q.isEntireRowsAny(),u&&!q.isEntireRows()?h=!0:g=q.getRowCount());const m={disabled:e||q&&1!==q.getCount()};Oe.getCommand("sortAscending").update(m),Oe.getCommand("sortDescending").update(m);const p={disabled:a||u||e||Be},v=a||e||Be||h;v&&(d=1);const w=u||e||Be||c;w&&(g=1);let y="",b="",C="",x="",S="",k="",R="",M="",T="";d>1&&(k=b=d+" ",R=C="s"),g>1&&(M=x=g+" ",T=S="s"),"copy"===P.getMode()?.key?(y=x=b="Copied ",C=S="s"):"cut"===P.getMode()?.key&&(y=x=b="Cut ",C=S="s");let D="",A="";if(q){const e=q.getDefaultShiftOrientation()===s.Orientation.Column;D=` (${e?"Shift Right":"Shift Down"})`,A=` (${e?"Shift Left":"Shift up"})`,Oe.getCommand("deleteCells").update({label:`Delete Cells${A}`})}Oe.getCommand("insertCells").update({label:`Insert ${y}Cells${D}`,scopedLabels:{insertCells:`${y}At Selection`}}),Oe.getCommand("insertCellsShiftRight").update(p),Oe.getCommand("insertCellsShiftDown").update(p),Oe.getCommand("deleteCellsShiftUp").update(p),Oe.getCommand("deleteCellsShiftLeft").update(p),Oe.getCommand("insertRows").update({label:`Insert ${x}Row${S}`,scopedLabels:{insertCells:`${x}Row${S}`},disabled:w}),Oe.getCommand("insertRowsAfter").update({label:`Insert ${x}Row${S} Below`,disabled:w}),Oe.getCommand("insertColumns").update({label:`Insert ${b}Column${C}`,scopedLabels:{insertCells:`${b}Column${C}`},disabled:v}),Oe.getCommand("insertColumnsAfter").update({label:`Insert ${b}Column${C} After`,disabled:v}),Oe.getCommand("deleteRows").update({label:`Delete ${M}Row${T}`,scopedLabels:{deleteCells:`${M}Row${T}`},disabled:w}),Oe.getCommand("deleteColumns").update({label:`Delete ${k}Column${R}`,scopedLabels:{deleteCells:`${k}Column${R}`},disabled:v})},[Fe,Le,Be,q,P,f,Ae]),le(()=>{const e=l.getProtection(),t=l.getProtection().isLocked(),n=!e.isFormatCellsAllowed(),o={disabled:n};Oe.getCommand("protectionSheetToggle").updateCallback(async(n,o)=>{let r=null;try{if(t){let t=null;if(e.hasPassword()){const e=await(f?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"}));if("Unprotect"!==e.option)return;t=e.input}r=await Promise.resolve(f?.showBusy?.(o.label())),await e.unlock(t)}else r=await Promise.resolve(f?.showBusy?.(o.label())),await e.lock();r?.()}catch(e){r?.(),f?.showError?.(e)}}).update({state:t,label:()=>t?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:t?"Unprotect":"Protect"}}),Oe.getCommand("deleteTable").update(o),Oe.getCommand("sortAscending").update(o),Oe.getCommand("sortDescending").update(o),Oe.getCommand("sortCustom")?.update(o),Oe.getCommand("updateComments").update(o),Oe.getCommand("deleteComments").update(o),Oe.getCommand("insertChart")?.update(o),Oe.getCommand("insertImageFromFile").update(o),Oe.getCommand("insertImageFromURL").update(o),Oe.getCommand("formatBorder").update(o),Oe.getCommand("formatFillColor").update(o),Oe.getCommand("formatFontColor").update(o),Oe.getCommand("formatBoldToggle").update(o),Oe.getCommand("formatItalicToggle").update(o),Oe.getCommand("formatUnderlinedToggle").update(o),Oe.getCommand("formatStrikeThroughToggle").update(o),Oe.getCommand("formatSuperscriptToggle").update(o),Oe.getCommand("formatSubscriptToggle").update(o),Oe.getCommand("formatAlignTopToggle").update(o),Oe.getCommand("formatTextOverflowVisibleToggle").update(o),Oe.getCommand("formatTextOverflowWrapToggle").update(o),Oe.getCommand("formatTextOverflowClipToggle").update(o),Oe.getCommand("formatTextOverflowShrinkToggle").update(o),Oe.getCommand("formatAlignMiddleToggle").update(o),Oe.getCommand("formatAlignBottomToggle").update(o),Oe.getCommand("formatAlignDistributedVerticalToggle").update(o),Oe.getCommand("formatAlignJustifyVerticalToggle").update(o),Oe.getCommand("formatAlignLeftToggle").update(o),Oe.getCommand("formatAlignCenterToggle").update(o),Oe.getCommand("formatAlignRightToggle").update(o),Oe.getCommand("formatAlignJustifyToggle").update(o),Oe.getCommand("formatAlignCenterContinuousToggle").update(o),Oe.getCommand("formatAlignDistributedHorizontalToggle").update(o),Oe.getCommand("formatAlignFillToggle").update(o),Oe.getCommand("formatFontSizeIncrease").update(o),Oe.getCommand("formatFontSizeDecrease").update(o),Oe.getCommand("formatFontFamily").update(o),Oe.getCommand("formatFontSize").update(o),Oe.getCommand("formatNumberFormat").update(o),Oe.getCommand("formatNumberFormatGeneralStyle").update(o),Oe.getCommand("formatNumberFormatNumberStyle").update(o),Oe.getCommand("formatNumberFormatTimeStyle").update(o),Oe.getCommand("formatNumberFormatDateStyle").update(o),Oe.getCommand("formatNumberFormatAccountingStyle").update(o),Oe.getCommand("formatNumberFormatPercentStyle").update(o),Oe.getCommand("formatNumberFormatScientificStyle").update(o),Oe.getCommand("formatNumberFormatCommaStyle").update(o),Oe.getCommand("formatNumberFormatIncreaseDecimal").update(o),Oe.getCommand("formatNumberFormatDecreaseDecimal").update(o),Oe.getCommand("hideColumns").update(o),Oe.getCommand("unhideColumns").update(o),Oe.getCommand("hideRows").update(o),Oe.getCommand("unhideRows").update(o),Oe.getCommand("quickFormulaSum").update(o),Oe.getCommand("quickFormulaAverage").update(o),Oe.getCommand("quickFormulaCount").update(o),Oe.getCommand("quickFormulaMax").update(o),Oe.getCommand("quickFormulaMin").update(o),Oe.getCommand("startEditCurrentTime").update(o),Oe.getCommand("startEditCurrentDate").update(o),Oe.getCommand("startEditValueAbove").update(o),Oe.getCommand("fillDown").update(o),Oe.getCommand("fillRight").update(o),Oe.getCommand("fillUp").update(o),Oe.getCommand("fillLeft").update(o),Oe.getCommand("formatCellStyle").update(o),Oe.getCommand("formatTableStyle").update(o),Oe.getCommand("formatPainterToggle").update(o),Oe.getCommand("formatBorderAddOutline").update(o),Oe.getCommand("formatBorderClearOutline").update(o),Oe.getCommand("formatIndentDecrease").update(o),Oe.getCommand("formatIndentIncrease").update(o),Oe.getCommand("clearContents").update(o),Oe.getCommand("clearFormats").update(o),Oe.getCommand("clearAll").update(o),Oe.getCommand("clearComments").update(o),Oe.getCommand("clearHyperlinks").update(o),Oe.getCommand("autoFilterClear").update(o),Oe.getCommand("autoFilterReapply").update(o);const i=_e===r.HorizontalAlignment.CenterContinuous||_e===r.HorizontalAlignment.Fill,a={disabled:n||i};Oe.getCommand("formatTextRotate0").update(a),Oe.getCommand("formatTextRotate45").update(a),Oe.getCommand("formatTextRotate90").update(a),Oe.getCommand("formatTextRotate270").update(a),Oe.getCommand("formatTextRotate315").update(a),Oe.getCommand("formatTextRotateCustom").update(a),Oe.getCommand("formatTextRotateVertical").update(a)},[Fe]),Oe}var vt,wt;!function(){if(wt)return vt;wt=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,l="object"==typeof Ge&&Ge&&Ge.Object===Object&&Ge,i="object"==typeof self&&self&&self.Object===Object&&self,a=l||i||Function("return this")(),s=Object.prototype.toString,d=Math.max,c=Math.min,u=function(){return a.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(l){if("number"==typeof l)return l;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(l))return NaN;if(g(l)){var i="function"==typeof l.valueOf?l.valueOf():l;l=g(i)?i+"":i}if("string"!=typeof l)return 0===l?l:+l;l=l.replace(e,"");var a=n.test(l);return a||o.test(l)?r(l.slice(2),a?2:8):t.test(l)?NaN:+l}vt=function(e,t,n){var o,r,l,i,a,s,m=0,p=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function w(t){var n=o,l=r;return o=r=void 0,m=t,i=e.apply(l,n)}function y(e){var n=e-s;return void 0===s||n>=t||n<0||f&&e-m>=l}function b(){var e=u();if(y(e))return q(e);a=setTimeout(b,function(e){var n=t-(e-s);return f?c(n,l-(e-m)):n}(e))}function q(e){return a=void 0,v&&o?w(e):(o=r=void 0,i)}function C(){var e=u(),n=y(e);if(o=arguments,r=this,s=e,n){if(void 0===a)return function(e){return m=e,a=setTimeout(b,t),p?w(e):i}(s);if(f)return a=setTimeout(b,t),w(s)}return void 0===a&&(a=setTimeout(b,t)),i}return t=h(t)||0,g(n)&&(p=!!n.leading,l=(f="maxWait"in n)?d(h(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==a&&clearTimeout(a),m=0,o=s=r=a=void 0},C.flush=function(){return void 0===a?i:q(u())},C}}();var yt,bt,qt={exports:{}},Ct={};bt||(bt=1,qt.exports=function(){if(yt)return Ct;yt=1;var e=Q,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,l=e.useDebugValue;function i(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),s=n({inst:{value:a,getSnapshot:t}}),d=s[0].inst,c=s[1];return r(function(){d.value=a,d.getSnapshot=t,i(d)&&c({inst:d})},[e,a,t]),o(function(){return i(d)&&c({inst:d}),e(function(){i(d)&&c({inst:d})})},[e]),l(a),a};return Ct.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:a,Ct}()),qt.exports;var xt,St,kt={exports:{}},Rt={exports:{}},Mt=Rt.exports;function Tt(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}!function(){if(St)return kt.exports;St=1;for(var e=(xt||(xt=1,function(){var e,t,n,o,r,l;"undefined"!=typeof performance&&null!==performance&&performance.now?Rt.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(Rt.exports=function(){return(e()-r)/1e6},t=process.hrtime,o=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),l=1e9*process.uptime(),r=o-l):Date.now?(Rt.exports=function(){return Date.now()-n},n=Date.now()):(Rt.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}.call(Mt)),Rt.exports),t="undefined"==typeof window?Ge:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],l=t["cancel"+o]||t["cancelRequest"+o],i=0;!r&&i<n.length;i++)r=t[n[i]+"Request"+o],l=t[n[i]+"Cancel"+o]||t[n[i]+"CancelRequest"+o];if(!r||!l){var a=0,s=0,d=[],c=1e3/60;r=function(t){if(0===d.length){var n=e(),o=Math.max(0,c-(n-a));a=o+n,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(a)}catch(e){setTimeout(function(){throw e},0)}},Math.round(o))}return d.push({handle:++s,callback:t,cancelled:!1}),s},l=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}kt.exports=function(e){return r.call(t,e)},kt.exports.cancel=function(){l.apply(t,arguments)},kt.exports.polyfill=function(e){e||(e=t),e.requestAnimationFrame=r,e.cancelAnimationFrame=l},kt.exports}();const Dt=ee(oe((e,t)=>{const{style:n=q.EmptyCssProperties,orientation:o,sheet:r,onShowTooltip:l,onCloseTooltip:i,onScrollOffset:a,showCustomScrollButtons:s=!1,offset:d=0,totalSize:c=0,viewportSize:u=0,...g}=e;if(!r)throw new Error("SheetScrollBar needs a sheet model");const[h]=Ye(),m=x(l,[l]),p=x(i,[i]),f=te(()=>null===v&&null===w?null:e=>{Tt(v,e),Tt(w,e)},[v=h,w=t]);var v,w;const[y,b]=ne(()=>{const e=r.getView().getTopLeft();return o===I.Vertical?e.top:e.left}),C=()=>{const e=r.getView().getFreezePanes();if(o===I.Vertical){if(0===e.coords.rowIndex)return{shift:0,scroll:0};return{shift:r.getRowHeaders().findOffset(e.coords.rowIndex)-e.topLeft.top,scroll:e.topLeft.top}}if(0===e.coords.colIndex)return{shift:0,scroll:0};return{shift:r.getColumnHeaders().findOffset(e.coords.colIndex)-e.topLeft.left,scroll:e.topLeft.left}},[S,k]=ne(C),[R,M]=ne(null),[T,D]=ne(!1),A=o===I.Vertical?r.getRowHeaders():r.getColumnHeaders(),E=()=>{const e=r.getUsedRange()?.getCoords()??J.EmptyRange,t=r.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[z,F]=ne(E),O=z?(o===I.Vertical?z.rowIndex:z.colIndex)+1:0,L=()=>{const e=E();J.isEqualCells(z,e)||F(e)};ht(r.getView(),{onFreezeSplitChange:()=>{k(C)}}),ht(r.getSelection(),{onChange:L}),ht(r,{onUsedRangeChange:L}),le(()=>{F(E())},[r]),le(()=>{if(!R)return T&&p?.(),void D(!1);const e=A.getTextAt(A.findIndex(y/(r.getView().getZoomScale()/100)+S.scroll+S.shift));D(!0),m?.({...R,display:(o===I.Vertical?"Row":"Column")+": "+e})},[d,y,S,o,R,A,T,r]);const V=x((e,t,n)=>{b(e);const o=e+S.scroll,r=t+S.shift,l=n+S.shift+S.scroll;a?.(o,r,l)},[a,S]),B=d-S.scroll,H=u-S.shift,P=c-(S.shift+S.scroll),W=A.findOffset(O)*(r.getView().getZoomScale()/100)-(S.scroll+S.shift);return _(N,{ref:f,style:n,offset:B,viewportSize:H,totalSize:P,orientation:o,showCustomScrollButtons:s,onMouseDown:e=>{M({anchor:{x:e.clientX,y:e.clientY}}),e.preventDefault()},onScrollOffset:V,onMouseOut:()=>{M(null)},onMouseUp:()=>{M(null)},minSize:W,...g})}));Dt.displayName="SheetScrollbar";const At=(e,t,n=null)=>{const o=[];for(let r=0;r<e.length;r++)if(e[r].value.isSelectedAll){if(e[r].min===e[r].max&&e[r].min===n)continue;o.push({address:{min:e[r].min,max:e[r].max},update:t})}return o},Et=ee(oe((e,t)=>{const{sheetHeader:n,gridRef:o,sheetElement:r,commands:l,oppositeSize:i=30,containerWidth:a,containerHeight:d,headerText:c,freezeStart:u,gridStyle:g,verticalPadding:h,horizontalPadding:m,onSheetContextMenu:p,onResizeHeadersStart:f,onResizeHeaders:v,onResizeHeadersEnd:w,onResizeHeadersDown:y,onResizeHeadersUp:b,scrollPoint:S,onSelectionStart:k,onSelectionEnd:R}=e,M=te(()=>n.getOrientation(),[n]),T=re(null),[D,E]=de(e=>e+1,0),[z,F]=de(e=>e+1,0),I=n?.getSheet(),N=re(!1);ie(()=>{N.current=!0},[n]);const L=te(()=>n.getEntireRange().getCoords().max+1,[n]),V=te(()=>{const e=M===s.Orientation.Column;return{left:e?S.left:0,top:e?0:S.top}},[S]),[B,H]=ne(I?.getView().getZoomScale()/100),[P,W]=ne(null);ht(n,{onSizesChange:e=>{H(I?.getView().getZoomScale()/100),me(ge())}});const $=ae(()=>{T.current?.invalidate(),F()},[]),U=ae(X.debounce(()=>{$()},10),[]),[j,G]=ne(null);ht(n.getSheet(),{onSelectionChange(){G(I?.getSelection().getCoords()),U()},onProtectionChange(){$()},onViewChange(){U()}}),ie(()=>{me(ge())},[M,B,i]),ie(()=>{W(null),H(n?.getSheet().getView().getZoomScale()/100),me(ge())},[n]);const Z=ae(e=>n.at(e)?.isHidden()||0===n.at(e)?.getSize(),[n]),Y=ae((e,t)=>n.hiddenHeadersAt(e,t),[Z]),K=x(e=>n.isSelected(e),[n]),J=x(e=>n.isSelectedAll(e),[n]),Q=ae(()=>n.getMinSize(),[n]),ee=ae(()=>n.getMaxSize(),[n]),oe=x((e,t,o)=>{t/=B;const r={size:t=Math.max(Q(),Math.min(X.roundAccurately(t,Q()),ee())),hidden:!1},l=[];if(t<=0&&(r.hidden=!0,r.size=o),l.push({address:{min:e,max:e},update:r}),t<0){const n=M===s.Orientation.Column,o=n?he.getColOffset:he.getRowOffset,r=n?he.getColIndex:he.getRowIndex,i=o(e);let a=r(i+t);const d=o(a);d===i+t?a--:l.push({address:{min:a,max:a},update:{size:i-d+t}}),e-a>1&&l.push({address:{min:a+1,max:e-1},update:{hidden:!0}})}n.updateHeaderPairs(l),v?.(e,t,o)},[D,n,B,v]),se=x((e,t,o)=>{const r=M===s.Orientation.Column;let l=null,i={min:e,max:e};if(n.isSelectedAll(e)){const a=n.getSelectedRuns();a.length>1?l="Resize "+(r?"Columns":"Rows"):i=a[0];const s={hidden:t<=0,size:(t<=0?o:t)/B};n.updateHeaderPairs(At(a,s,e))}if(i){const e=i.max-i.min+1;let t;t=1===e?n.getRange(i).at(0).getDisplayText():n.getRange(i).toString(),l=`Resize ${r?"Column":"Row"}${e>1?"s":""} '${t}'`}w?.(e,t,l)},[D,n,w]),ce=x((e,t)=>{const n=M===s.Orientation.Column;f(e,t,`Resize ${n?"Column":"Row"}(s)`)},[f]),ue=x(e=>{let t=!1;const o=M===s.Orientation.Column,r=n.getSheet().getEntireRange().getCoords(),l=[],i=n.getSelectedRuns(),a=e=>{let t;t=o?{colStart:e.min,rowStart:r.rowStart,colEnd:e.max,rowEnd:r.rowEnd}:{colStart:r.colStart,rowStart:e.min,colEnd:r.colEnd,rowEnd:e.max},l.push(t)};for(let n=0;n<i.length;n++){const o=i[n];o.value.isSelectedAll&&(o.min<=e&&o.max>=e&&(t=!0),a(o))}t||a({min:e,max:e}),n.getSheet().getRanges(l).autoFit({orientations:o?s.Orientations.Column:s.Orientations.Row});if(Z(e)){const o={hidden:null},r=At(i,o);t||r.push({address:e,update:o}),n.updateHeaderPairs(r)}w?.(e,null,"Resize Column(s)")},[D,n,w,Z]),ge=()=>{const e=M===s.Orientation.Column;return{getColOffset:t=>e?n.findOffset(t):0===t?0:i/B,getColIndex:t=>e?n.findIndex(t):0,getRowOffset:t=>e?0===t?0:i/B:n.findOffset(t),getRowIndex:t=>e?0:n.findIndex(t)}},[he,me]=ne(()=>ge()),pe=ae((e,t)=>!(e.nativeEvent.which===O.Right)||!J(M===s.Orientation.Column?t.colIndex:t.rowIndex),[M,J]),fe=x(e=>{r.focusSheet()},[r]),xe=x(e=>{I?.getSelection().updateCoords(e)},[I]),{...Se}=ve({gridRef:o,commands:null,layout:he,selection:j,fillHandleBorderColor:g.body.fill,selectionBackgroundColor:g.selection.fill,selectionBorderColor:g.selection.strokeFill,selectionRemoveBackgroundColor:g.selectionRemove.fill,selectionRemoveBorderColor:g.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:xe,canSelectionSpanMergedCells:e=>{const t=I.getRange(e);return t.isEntireColumns()||t.isEntireRows()}}),ke=x(()=>{k?.();const e=I?.getSelection();e&&e.setAdjusting(e.getCoords())},[I,k]),Re=x(async()=>{I?.getSelection().setAdjusting(null),R?.()},[I,R]),{...Me}=we({orientation:M,headerCount:L,gridRef:T,gridMainRef:o,newSelection:Se?.newSelection,modifySelection:Se?.modifySelection,appendSelection:Se?.appendSelection,clearSelections:Se?.clearSelections,pointerDownInterceptor:pe,onPointerUp:fe,onDragStart:ke,onDragEnd:Re}),Te=g.selection?.strokeFill;le(()=>{if(!T.current)return void W(null);const e=M===s.Orientation.Column,t=n.getSelectedRuns(),o=n.isProtected()?null:oe,r=(t,n,o)=>{if(o)return _("div",e?{style:{position:"absolute",borderBottom:`${g.headerSelection.strokeWidth}px solid ${Te}`,pointerEvents:"none",top:`${q.boundPixel(-g.headerSelection.strokeWidth/2)}px`,left:`${q.boundPixel(o.x-g.headerSelection.strokeWidth)}px`,width:`${q.boundPixel(o.width+g.headerSelection.strokeWidth+1,!0)}px`,height:i+g.headerSelection.strokeWidth-.5+"px"}}:{style:{position:"absolute",borderRight:`${g.headerSelection.strokeWidth}px solid ${Te}`,pointerEvents:"none",top:`${q.boundPixel(o.y-g.headerSelection.strokeWidth)}px`,left:`${q.boundPixel(-g.headerSelection.strokeWidth/2)}px`,width:i+g.headerSelection.strokeWidth-.5+"px",height:`${q.boundPixel(o.height+g.headerSelection.strokeWidth+1,!0)}px`}},t)},l=(t,n,o)=>{const r={x:0,y:0,width:0,height:0};if(e){const e=o.toClipBounds(o.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:t,colEnd:Math.min(L,n)}),Ce);if(!e)return;r.x=e.x,r.width=e.width}else{const e=o.toClipBounds(o.getRangeCoordsBounds({rowStart:t,rowEnd:Math.min(L,n),colStart:0,colEnd:0}),Ce);if(!e)return;r.y=e.y,r.height=e.height}return{x:r.x,y:r.y,width:r.width,height:r.height}};W([r=>{const l=[];let i=null,a=e?r.getVisibleColumns():r.getVisibleRows();const s=e?r.getTotalRangeCoords().colStart:r.getTotalRangeCoords().rowStart;a.length>0&&a[0]>s&&(a=[a[0]-1,...a]);let d=[];const c=[];for(let e=0;e<a.length;e++){const n=a[e],r=e<a.length-1?a[e+1]:n+Y(n+1,!1)+1,l=n+1!==r;if(!i||i.max<n)if(t.length>0&&t[t.length-1].max>=n){const e=X.findEqualOrGreater(t,n,e=>e.max);i=t[e]}else i=null;let u=!1,g=!1;if(i?.value&&(i.min<=n||i.min<=r&&!l)&&(u=!0,g=i.value.isSelectedAll),n===s){let e=!1,t=!1;i?.value&&i.min<=n&&(e=!0,t=i.value.isSelectedAll),n>0&&c.push({index:n-1,isNextHidden:l,isSelected:e,isSelectedAll:t,disabledResize:!0})}if(g&&d.push(c.length),c.push({index:n,isHidden:0===e&&Y(n,!1)>0,isNextHidden:l,isSelected:u,isSelectedAll:g,onDividerMouseDown:y,onDividerResizeStart:ce,onDividerResize:o,onDividerMouseUp:b,onDividerResizeEnd:se,onDividerAutoFit:ue}),l){let e=!1,l=!1;if(i&&i.min>=n&&i.max<=r-1&&i.value.isSelectedAll&&d.push(c.length),i?.value&&i.max>=r);else if(t.length>0&&t[t.length-1].max>=r){const e=X.findEqualOrGreater(t,r,e=>e.max);i=t[e]}else i=null;i?.value&&i.min<=r&&(e=i.value.isSelected,l=i.value.isSelectedAll),r>0&&c.push({index:r-1,isHidden:!0,isSelected:e,isSelectedAll:l,onDividerMouseDown:y,onDividerResizeStart:ce,onDividerResize:o,onDividerMouseUp:b,onDividerResizeEnd:se,onDividerAutoFit:ue})}}if(d.length>0){let n=d.length-1;if(d.length>0){const t=c[d[n]].index;let o=null;e?(o=r.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:t,colEnd:t}),o.x+o.width>r.getBounds().width&&(n-=1,0===n&&(n=-1))):(o=r.getRangeCoordsBounds({rowStart:t,rowEnd:t,colStart:0,colEnd:0}),o.y+o.height>r.getBounds().height&&(n-=1,0===n&&(n=-1)))}const o=t?.[t.length-1],l=r.getAnchor();if("t"===l||"l"===l){const e=c[d[Math.max(0,d.length-1)]];e.showTouchDivider=o&&o.max<=e.index}else n>=0&&(c[d[n]].showTouchDivider=!0)}const{header:u,headerSelect:h,headerSelectAll:m,headerHover:p}=g??{};for(let e=0;e<c.length;e++)l.push(_(qe,{orientation:M,view:r,headerStyle:u,headerStyleSelect:h,headerStyleSelectAll:m,headerStyleHover:p,disabled:n.isProtected(),...c[e]},`divider${e}`));return l},e=>{const n=[];for(let o=0;t&&o<t.length;o++)n.push(r(`selection:${e.getAnchor()}:${o}`,0,l(t[o].min,t[o].max,e)));return n}])},[z,!0,Te,g,he,L,u,D,B]),le(()=>{T.current?.invalidate()},[D]);const De=x(e=>c?c(e):n.getTextAt(e),[c,n]),Ae=x(e=>{const{header:t,headerSelect:n,headerSelectAll:o,headerHover:r}=g??{},{range:l,key:i,...a}=e;return _(ye,{orientation:M,index:M===s.Orientation.Column?l.colStart:l.rowStart,isSelected:K,isSelectedAll:J,zoomScale:100*B,headerText:De,headerStyle:t,headerStyleSelect:n,headerStyleSelectAll:o,headerStyleHover:r,verticalPadding:h,horizontalPadding:m,...a},i)},[D,L,g,B,n]),Ee=A(),ze=te(()=>{const e="white",t="black",n={};if("touch"!==q.detectIt().primaryInput){let o=M===s.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='${t}' fill='${e}'/%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='${t}' fill='${e}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;const r=Ee.getMode();if("formatPainter"===r?.key){const n=30,r=22;o=`url("data:image/svg+xml,%3Csvg width='${n}' height='${r}' viewBox='0 0 ${n} ${r}' 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='${t}' fill='${e}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}n.cursor=o}return n.backgroundColor=g?.header?.fill||"transparent",n},[M,D,Ee,g]),Fe=C(t,()=>({scrollTo:e=>{T.current?.scrollTo(e)},forceRender:()=>{E()},getGridElement:()=>T.current}),[]),Ie=ae(e=>{Me.onPointerDown(e)},[Me]),Ne=ae(e=>{const t=Me.getCellCoordsFromClient(e.clientX,e.clientY);if(!t)return;if(!p)return;const n=M===s.Orientation.Column;p({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:n?-1:t.rowIndex,colIndex:n?t.colIndex:-1}),e.stopPropagation(),e.preventDefault()},[Me,p]),Oe=te(()=>{const e=M===s.Orientation.Column;return _("div",{ref:Fe,children:_(be,{className:"sheet-header",style:ze,ref:T,scrollPoint:V,columnCount:e?L:1,rowCount:e?1:L,width:e?a:i,height:e?i:d,freezeLeft:e?u:void 0,freezeTop:e?void 0:u,hiddenColumnsAt:e?Y:void 0,hiddenRowsAt:e?void 0:Y,showGridLines:!1,layout:he,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:Ne,onPointerDown:Ie,zoom:B,cellRenderer:Ae,overlays:P})})},[P,he,a,d,V,ze,z]);return le(()=>{N.current=!1,T.current?.invalidate(),F()},[n,g]),Oe})),zt=ee(oe((e,t)=>{const{view:n,sheet:o,getVisibleCells:r,gridStyle:l}=e,i=x((e,t)=>e.getStyle().getBorder(),[]),{overlay:a}=et({getVisibleCells:r,getBorderAt:i,darkMode:l.body.darkMode,shiftIfWide:!0}),s=a(n);return s&&n?s:null})),Ft={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},It={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Nt={type:n.Content.Values},Ot={fitDestination:!0,type:n.Content.Formats},Lt={fitDestination:!0,type:n.Content.Formulas},Vt={transpose:!0},Bt={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},Ht=({element:e,sheet:t,sheetView:o,commands:r,onClipboardUpdate:l,onPaste:i,selectionRenderer:a=xe,copyForegroundColor:d="rgb(33, 115, 70)",cutForegroundColor:c="rgb(33, 115, 70)",copyBackgroundColor:u="white",cutBackgroundColor:g="white",notifier:h,...m})=>{const v=x(a,[a]),w=re(null),y=A(),b=y.getMode(),q=te(()=>({element:e,doCopy:e=>{const n=t.getSelectedRanges().getSnapshot(e);return new p(n)}}),[t,o,e]),C=te(()=>({element:e,importFromExternal:async(e,n)=>{const o=new f(e,n,t.getStyles(),t.isDate1904());return await o.parse()?o:null},doPaste:async(e,o)=>{if("range"!==e?.getItemType())return;o?.contentsOnly&&delete(o={...o,type:n.Content.Values}).contentsOnly;const r=t.getSelectedRange(),l=e.getItem(),i=l.getName();return await r.doBatch(async()=>{const e=await r.copyFrom(l,o);!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({orientations:s.Orientations.Row,minContent:!0})},{description:"Paste"+(i?` ${i}`:""),autoSelect:!0}),!0}}),[t,o,h,e]),{clipboard:S,...k}=D({...m,source:q,commands:r,target:C,notifier:h,onClipboardUpdate:e=>{const t="range"===e?.getItemType()?e:null;if(t){const t=e.editMode?.(),n={...e?.isCut?.()?It:Ft,...t,args:{isClipboard:!0,...t?.args},onModeChange:e=>{e?.args?.isClipboard||S.clear(!0),t?.onModeChange?.(e)}};y.setMode(n)}w.current=t,l?.(t)},onPaste:(n,o)=>{if("range"!==n?.getItemType())return;let r="cut"===y.getMode()?.key||n.isCut?.();if(!r&&"copy"===y.getMode()?.key){const e=n.getItem().getCoords(),o=t.getSelectedRanges().getCoords();let l=!1;if(!l&&e&&o&&n.getItem().getSource?.()===t)for(let t=0;!l&&t<o.length;t++)l=J.isRangesIntersect(e,o[t]);r=l}r&&y.setMode(null),e?.()?.focus(),i?.(n,o)}});te(()=>{const t=e;if(!r)return;const n=[new R("pasteValues",t,{label:"Paste Values",scopedLabels:{paste:"Values"},description:"Paste only the values of the selected cells.\n\nThe formatting is not applied.",shortcut:{key:"V",modifiers:[M.Ctrl,M.Shift]}}),new R("pasteFormats",t,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:"Paste only the formats of the selected cells.\n\nThe content is not applied."}),new R("pasteFormulas",t,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new R("pasteTranspose",t,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new R("pasteLinks",t,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];r.addCommands(n,!0)},[r,e]),le(()=>{if(!r)return;const e={disabled:!t.getProtection().isFormatCellsAllowed()};r.getCommand("pasteValues").updateCallback(e=>k.paste({...Nt,...e})).update(e),r.getCommand("pasteFormats").updateCallback((e,t)=>k.paste({...Ot,description:t.label(),...e})).update(e),r.getCommand("pasteFormulas").updateCallback((e,t)=>k.paste({...Lt,description:t.label(),...e})).update(e),r.getCommand("pasteTranspose").updateCallback((e,t)=>k.paste({...Vt,description:t.label(),...e})).update(e),r.getCommand("pasteLinks").updateCallback((e,t)=>k.paste({...Bt,description:t.label(),...e})).update(e),r.getCommand("cut").update(e),r.getCommand("paste").update(e)},[t,r]);const T=te(()=>{if(!b||!w.current)return;const e=b.key;if("copy"!==e&&"cut"!==e&&"formatPainter"!==e)return;const n=w.current.getItem();if(n.getSource()!==t)return;const o=w.current.isCut?.(),r=o?g:u,l=o?c:d,i=n.getCoords(),a=i?[i]:null;return a&&0!==a.length?e=>{const t=[];for(let n=0;n<a.length;n++){const o=a[n],i=e.toClipBounds(e.getRangeCoordsBounds(o,{top:0,left:0,right:1,bottom:1}),Ce);i&&(t.push(v({range:o,key:`copy-selection-background-${n}`,x:i.x,y:i.y,width:Math.max(i.width,0),height:Math.max(i.height,0),stroke:r,strokeWidth:2})),t.push(v({range:o,key:`copy-selection-foreground-${n}`,x:i.x+(i.width<=2?-1:0),y:i.y,width:Math.max(i.width,3),height:Math.max(i.height,3),stroke:l,strokeWidth:2,isAnimatedStroke:!0})))}return t}:null},[b,t,o,d,u,c,g]);return{...k,clipboard:S,overlays:T}},Pt=ee(oe((e,t)=>{const{view:n,element:o,sheet:r,gridStyle:l,commands:i,notifier:a}=e,s=l.body??{},d=r.getView(),{overlays:c}=Ht({element:o,sheet:r,sheetView:d,commands:i,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:s.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:s.fill,notifier:a});return ht(r?.getSelection(),{onChange(e){}}),le(()=>{n?.getStage()},[n?.getStage()]),c&&n?c(n):null})),Wt="_sheet-selection_12wyx_5",$t={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ut={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},jt={key:"dragCopy",description:"Drag selection to copy cell contents."},_t={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Gt=(e,t)=>t.ctrlKey&&t.shiftKey?_t:t.ctrlKey?jt:t.shiftKey?Ut:$t,Zt={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Xt=ee(oe((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:l,notifier:i,onShowTooltip:a,onCloseTooltip:d,sheet:c,gridRef:u,gridStyle:g,isActive:h,editingCoords:m,...p}=e,f=n?.getBounds(),v=x(a,[a]),w=x(d,[d]),[y,b]=ne(()=>c?.getSelection().getCoords()),S=x(e=>{J.isEqualSelectionCoords(e,y)||c&&c.getSelection().updateCoords(e)},[c,y]),k=A(),R=re(null),[M,T]=ne(c?.getProtection().isLocked()),[D,E]=ne(c?.getView().getMovableSelection().length>0),z="touch"===q.detectIt().primaryInput,F=!z&&h,I=null!==m||D,N=x(e=>{const t=J.cellToRange(e);if(c.isClosed())return t;const n=c.getRange(t,{excludeHidden:!0}).getMerges();return 0===n.length?t:n[0]},[c]),O=x((e,t,n,o,r,l)=>{const i=c.getSelectedRange().getExtended(o,e).getCoords();switch(o){case s.Direction.Up:return i.rowStart;case s.Direction.Down:return i.rowEnd;case s.Direction.Left:return i.colStart;case s.Direction.Right:return i.colEnd}},[c]),V=x(()=>{const e=c.getUsedRange()?.getCoords(),t=c.getRowHeaders().getUsedRange()?.getCoords(),n=c.getColumnHeaders().getUsedRange()?.getCoords();return{...e,colEnd:Math.max(e?.colEnd??0,n?.max??0),rowEnd:Math.max(e?.rowEnd??0,t?.max??0)}},[c]),B=x((e,t)=>c.getRowHeaders().hiddenHeadersAt(e,t),[c]),H=x((e,t)=>c.getColumnHeaders().hiddenHeadersAt(e,t),[c]),P=x(e=>c.getRange(e,{excludeHidden:!0}).getMerges(),[c]),W=x(e=>{c?.getSelection().setAdjusting(e)},[c]),$=x(async()=>{c?.getSelection().setAdjusting(null);const e=k.getMode();"formatPainter"===e?.key&&(await(o?.getCommand("pasteFormats")?.execute({})),k.setMode(null))},[k,y,c,o]),U=te(()=>{const e=k.getMode();return"cut"===e?.key||"copy"===e?.key},[k]);ht(c?.getView(),{onMovableSelectionChange:()=>{E(c.getView().getMovableSelection().length>0)}}),ht(c?.getSelection(),{onChange(e){const t=c.getSelection().getCoords();b(t)}}),ht(c,{onProtectionChange:()=>{T(c.getProtection().isLocked())}});const{body:j={}}=g||{},G=n.getLayout(),Z=!(F&&y.ranges.length<=1&&null===m&&!M&&(!k.getMode()||U)),{cursor:X,overlay:Y,onPointerDown:K}=ve({gridRef:u,commands:o,layout:G,getCellCoordsAsRangeCoords:N,selection:y,fillHandleBorderColor:j.fill,selectionBackgroundColor:h?g.selection.fill:g.selectionInactive.fill,selectionBorderColor:h?g.selection.strokeFill:g.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?g.selectionRemove.fill:g.selectionInactive.fill,selectionRemoveBorderColor:h?g.selectionRemove.strokeFill:g.selectionInactive.strokeFill,disableFillDrag:Z,disableMoveDrag:z||!(h&&y.ranges.length<=1&&null===m&&!M),disableTouchSelection:I,onSelectionChange:S,onSelectionDragStart:W,onSelectionDragEnd:$,onMoveDragStart:(e,t,n)=>{k.setMode(Gt(0,n))},onMoveDragUpdate:(e,t,n)=>{k.setMode(Gt(0,n))},onMoveDragEnd:(e,t)=>{k.setMode(null)},onMoveDragDone:async(e,t,n)=>{if(J.isEqualRanges(e,t))return;const o=c.getRange(t);if(i?.showOptions){const t=o.getDifferences(e);let n=!1;for(let e=0;!n&&e<t.getCount();e++)n=t.at(e).isContentful();if(n){if("Replace"!==await(i?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})))return}}const r=!n.ctrlKey,l=n.shiftKey,a=l?r?"Insert Moved Cells":"Insert Copied Cells":r?"Move Cells":"Copy Cells",d=await(i?.showBusy?.(a));try{const t=c.getRange(e);await o.doBatch(async()=>{l?await o.insertFrom(e,{isCut:r,undoRange:t}):await o.copyFrom(e,{isCut:r,undoRange:t}),t.autoFit({skipCustomSize:!0,orientations:s.Orientations.Row,minContent:!0}),o.autoFit({skipCustomSize:!0,orientations:s.Orientations.Row,minContent:!0})},{description:a,autoSelect:!0})}catch(e){i?.showError?.(e)}finally{d?.()}},contentfulCellFinder:O,hiddenRowsAt:B,hiddenColumnsAt:H,mergedRanges:P,getDataCoords:V,canSelectionSpanMergedCells:e=>{const t=c.getRange(e);return t.isEntireColumns()||t.isEntireRows()},onFill:async(e,t)=>{const n="Auto Fill",o=await(i?.showBusy?.(n));try{await c.doBatch(()=>{c.getRange(e).autoFill(t),c.getRange(t).autoFit({orientations:s.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:n,autoSelect:!0})}catch(e){i?.showError?.(e)}finally{R.current=null,o?.()}},onFillPreview:(e,t,o)=>{if(u.current&&v){k.setMode(Zt);try{R.current?.direction!==o&&(R.current=null,c.getRange(e).autoFill(t,{previewOnly:e=>{R.current={callback:e,direction:o}}}));const r=R.current?.callback?.(t);if(!r||r.isEmpty())return;const l=r.toText();if(!l)return;const i=J.cellToRange(r.getCoords()),a=n.getRelativePointFromClient(0,0);let d=0,u=0,g=L.Bottom;if(o===s.Direction.Down){d=G.getColOffset(i.colEnd+1)-a.x;const e=G.getRowOffset(i.rowEnd),t=G.getRowOffset(i.rowEnd+1);u=t-(t-e)/2-a.y,g=L.Right}else if(o===s.Direction.Right){u=G.getRowOffset(i.rowEnd+1)-a.y;const e=G.getColOffset(i.colEnd),t=G.getColOffset(i.colEnd+1);d=t-(t-e)/2-a.x,g=L.Bottom}else if(o===s.Direction.Up){d=G.getColOffset(i.colEnd+1)-a.x;const e=G.getRowOffset(i.rowStart),t=G.getRowOffset(i.rowStart+1);u=t-(t-e)/2-a.y,g=L.Right}else if(o===s.Direction.Left){u=G.getRowOffset(i.rowEnd+1)-a.y;const e=G.getColOffset(i.colStart),t=G.getColOffset(i.colStart+1);d=t-(t-e)/2-a.x,g=L.Bottom}v({anchor:{x:d,y:u},display:l,placement:g})}catch(e){i?.showError?.(e)}}},onFillDone:()=>{R.current=null,k.setMode(null),w?.()}}),Q=x(e=>{K(q.createSyntheticEvent(e))},[K,m]);le(()=>{const e=n?.getStage();if(e)return e.addEventListener("pointerdown",Q),()=>{e.removeEventListener("pointerdown",Q)}},[n?.getStage()]);const ee=C(t,()=>({}),[]),oe=re(null);return _("div",{className:st(r,"sheet-selection",Wt),style:{position:"absolute",width:f?.width,height:f?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Ue([ee,oe]),...p,children:Y(n)})})),Yt=Object.freeze({x:0,y:0,width:0,height:0}),Kt={fireOnModelChange:!1},Jt=ee(oe((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:l,onRefUnload:i,onHide:a,onShow:s,onUnFocus:d,isDragging:c,updateFrameBounds:u,dragStart:g,style:h,disabled:m,renderMovable:p,...f}=e,[v,w]=ne(Yt),[y,b]=ne(null),[q,C]=ne(!1),x=re(null);ie(()=>{if(r.isClosed())return;const e=r.getBounds();if(!e)return;const t=o.toViewBounds(e);w(t??Yt),u(t??Yt)},[o?.getBounds()]),ht(r,{onBoundsChange:e=>{const t=e.getBounds();if(!t)return;const n=o.toViewBounds(t);w(n??Yt),u(n)},onSelectionChange:()=>{const e=X.hasFocus(x.current,!0);!q&&!e||r.isSelected()||d()}}),ht(r,{onRequestFocus:()=>X.whenFocus(x.current,!0)},Kt),le(()=>{const e=x.current;return l(e),()=>{i(e)}},[]);const S=te(()=>{if(!v)return null;let{width:e,height:t}=v;return p({view:o,movable:r,disabled:m,isDragging:c,style:{position:"relative",left:0,top:0,width:e,height:t},onHide:a,onShow:s})},[o,r,v.width,v.height,m,c]);return _("div",{className:"movable",tabIndex:0,ref:Ue([x,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:v.x,top:v.y,width:v.width,height:v.height,...h},onMouseDown:async e=>{const t=e.shiftKey||e.ctrlKey,n=r.isSelected(),o=e.currentTarget;t&&n?r.unselect():(n&&!t||await r.select({addToSelection:t}),g(e.nativeEvent,o),o.focus())},onFocus:e=>{e.relatedTarget&&!y&&b(e.relatedTarget),C(!0)},onBlur:e=>{y&&!x?.current?.contains(e.relatedTarget)&&b(null),e.relatedTarget&&C(!1)},...f,children:S})})),Qt="_movable-area_314c6_5",en=ee(oe((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:l,transactional:i,onUnFocus:a,onFocus:s,disabled:d=!1,disableDrag:c=!1,disableResize:u=!1,className:g,style:h,renderDirections:m=["nw","n","ne","w","e","sw","s","se"],onFirstRender:p,...f}=e,w=n.getBounds(),y=x(p,[p]),b=x(a,[a]),q=x(s,[s]),[k,R]=ne([]),[M,T]=ne(!1),[D,A]=ne(!1),E=re(!0),z=re(new Map),F=re(new Map),I=re(new Map),N=re(new Map),O=re(new Map),L=re({onRequestFocus:e=>(ue(e),null)}),V=re(null),B=re(null),H=re(null),[P,W]=de(e=>e+1,0);ie(()=>{W()},[n,o]),ht(o,{onCollectionChange:()=>{const e=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),t=O.current;t.forEach(e=>{e()}),t.clear();const r=L.current;for(let n=0;n<e.length;n++){const o=e[n];if(o.isClosed())continue;const l=o.addListeners(r);t.set(o,l)}W()},onInvalidated:()=>{W()}}),ht(r,{onMovableSelectionChange(e){U(),W()}});const $=ae((e,t)=>{const n=I.current.get(e);H.current&&(H.current.getTargets().forEach(e=>{if(e===n)return e.style.left=t.x+"px",e.style.top=t.y+"px",e.style.width=t.width+"px",void(e.style.height=t.height+"px")}),H.current.updateRect())},[]),U=()=>{const e=[],t=r.getMovableSelection();t.forEach(n=>{const o=I.current.get(n);if(!o)return;-1!==t.indexOf(n)&&e.push(o)}),R(t=>X.isEqualArrays(t,e)?t:e)},j=re(null),Z=te(()=>new Promise(e=>{j.current=e}),[]),Y=re(null),K=x(async(e,t)=>{Y.current=t;await(async()=>!(!await Z.then()||!H.current))()&&Y.current===t&&H.current.dragStart(e,t)},[k]),[J,ee]=ne(!1),oe=re(null),se=re(null),ue=x(async(e=null)=>{if(e||(e=r.getMovableSelection()[0]),!e)return b?.(),!1;const t=I.current.get(e);t?(await X.whenFocus(t),t.focus(),se.current=t,oe.current=null):oe.current=e},[r]);le(()=>{J&&k.length>0&&se.current!==k[0]&&ue(),E.current&&(y?.(),E.current=!1)},[k]);const ge=te(()=>{const e=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(0===e.length&&0===z.current.size)return null;const t=(t,o,r,i=!0)=>{const a=t.isSelected(),s={tabIndex:r,view:n,movable:t,onRefLoad:e=>{oe.current===t&&(e.focus(),se.current=e,oe.current=null),I.current.set(t,e),F.current.set(e,t),o.rendered=!0,U()},onRefUnload:e=>{I.current.delete(t),F.current.delete(e),o.rendered=!1,U()},onUnFocus:b,onHide:e=>{o.onHide=e},onShow:e=>{o.onShow=e},isDragging:a&&(D||M),disabled:d,renderMovable:l,updateFrameBounds:e=>{$(t,e)},dragStart:K,onMouseUp:()=>{if(Y.current=null,B.current){T(!1),A(!1);let e=!1;N.current?.forEach(t=>{X.isEqualBounds(t.movable.getBounds(),t.startBounds)||(e=!0)}),e?me():pe()}},style:{opacity:i?M&&a?.7:void 0:0,zIndex:M&&a?t.getZIndex()+e.length:void 0,pointerEvents:i?void 0:"none",cursor:D&&a?"grabbing":d||c?"initial":"move",boxShadow:!a||D&&!M?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return _(Jt,{...s},`movable-${t.getUUID()}`)},i=z.current,a=new Map,s=[];for(let n=0;n<e.length;n++){const o=e[n];if(o.isClosed())continue;let r=i.get(o);r||(r={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;const n=++t.visibilityRequestId;requestAnimationFrame(()=>{const o=z.current.get(e);o&&n===t.visibilityRequestId&&(t.onShow?.(e),o.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;const n=++t.visibilityRequestId,o=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==o&&(t.shown=!1,z.current.delete(e),W())},visibilityRequestId:0}),r.frame=t(o,r,n,!0),s.push(r.frame),r.doShow(o,r),i.delete(o),a.set(o,r)}const u=[];return r.getMovableSelection().forEach(e=>{const n=i.get(e);n&&(n.frame=t(e,n,-1,!1),u.push(n.frame),i.delete(e),a.set(e,n))}),i.forEach((e,n)=>{e.frame=t(n,e,-1,!1),u.push(e.frame),e.doHide(n,e),i.delete(n),a.set(n,e)}),z.current=a,U(),[...u,...s]},[P,n,l,d,c,u,M,D]),he=x((e,t)=>{const o=`${t} ${1===k.length?v.capitalize(F.current?.get(k[0]).getContent().getType()):"Drawings"}`;B.current&&(console.warn(`Transaction ${B.current.getDescription()} is being replaced by ${o}`),B.current.rollback(),B.current=null),B.current=i.beginCommit({description:o}),N.current.clear();for(let e=0;e<k.length;e++){const t=k[e],o=F.current?.get(t);o?N.current.set(t,{movable:o,startBounds:n.toViewBounds(o.getBounds())}):console.warn("invalid element",o)}},[i,n,k]),me=ae(()=>{if(!B.current)return;const e=[];N.current?.forEach(t=>{e.push(t.movable)}),B.current.commit({viewAfter:{view:r,movableSelection:e}}),N.current.clear(),B.current=null},[]),pe=ae(()=>{B.current&&(B.current.rollback(),B.current=null)},[]),fe=re(null);le(()=>{fe.current&&(fe.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[fe.current]);const ve=C(t,()=>({isMovableArea:()=>!0,focusMovable:ue,focus:()=>{ue()}}),[r]),[we,ye]=ne(null),be=re(!1),qe=re(!1),Ce=re(!1);le(()=>{if(d||0===k.length)return;if(Ce.current)return;if(be.current)return;if(qe.current)return void requestAnimationFrame(()=>{H.current&&V.current&&H.current.refTargets.length>0&&(Ce.current=!0,j.current?.(!0)),R([...k])});be.current=!0;const e=Q.lazy(async()=>{try{const e=await import("./X4Oh9I7hCVznAbe3.mjs");return be.current=!1,qe.current=!0,R([...k]),e}catch(e){return console.warn(e),j.current?.(!1),null}});ye(e)},[k,d,c,u]);const xe=te(()=>!we||d?null:_(ce,{children:_(we,{className:st({dragging:M||D,resizing:M,moving:D}),container:null,ref:H,target:H.current?k:[],draggable:!d&&!c,resizable:!d&&!u,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:m,onResizeStart:e=>{he(e.target,"Resize")},onResize:e=>{if(!B.current)return e.stopDrag(),void W();T(!0);const t=0!==e.direction[0]&&0!==e.direction[1];let o=0,r=0;for(let l=0;l<k.length;l++){const i=k[l],a=N.current.get(i),s=F.current.get(i);if(!a||!s){console.warn("invalid element");continue}let d=e.dist[0],c=e.dist[1],u=e.drag.dist[0],g=e.drag.dist[1],h=a.startBounds.width,m=a.startBounds.height;0===l?(o=h,r=m):(d*=h/o,u*=h/o,c*=m/r,g*=m/r);const p={...a.startBounds};if(p.width=Math.max(0,h+d),p.height=Math.max(0,m+c),-1===e.direction[0]&&(p.width=Math.max(0,Math.min(a.startBounds.x+h,h-u))),-1===e.direction[1]&&(p.height=Math.max(0,Math.min(a.startBounds.y+m,m-g))),t&&(s.isLockAspectRatio()||e.inputEvent?.shiftKey)){const e=h/m,t=p.width/p.height;t>e?p.height=p.width/e:t<e&&(p.width=p.height*e)}-1===e.direction[0]&&(p.x=Math.max(0,Math.min(a.startBounds.x+h,a.startBounds.x+h-p.width))),-1===e.direction[1]&&(p.y=Math.min(a.startBounds.y+m,a.startBounds.y+m-p.height)),a.movable.setBounds(n.toAbsoluteBounds(p))}},onResizeEnd:e=>{T(!1),me()},onDragStart:e=>{he(e.target,"Move")},onDrag:e=>{if(!B.current)return e.stopDrag(),void W();A(!0);for(let t=0;t<k.length;t++){const o=k[t],r=N.current.get(o);r?r.movable.setBounds(n.toAbsoluteBounds({...r.startBounds,x:r.startBounds.x+e.translate[0],y:r.startBounds.y+e.translate[1]})):console.warn("invalid element")}},onDragEnd:e=>{},onMouseUp:e=>{}})}),[P,we,k,n,d,c,u,M,D]);return _("div",{className:st(g,"movable-area",Qt),style:{width:w.width,height:w.height,...h,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Ue([ve,fe]),...f,children:_("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:w.width,height:w.height},...f,children:G("div",{ref:V,style:{position:"absolute",pointerEvents:"auto"},onFocus:e=>{q?.(),ee(!0)},onBlur:e=>{ee(!1)},onKeyDownCapture:e=>{if(e.isDefaultPrevented())return;const t=e.nativeEvent.ctrlKey,n=e.nativeEvent.altKey,l=e.nativeEvent.shiftKey;if(e.which===S.Escape){const t=r.getMovableSelection();let n=[...t];return k.forEach(e=>{if(0===n.length)return;const t=F.current.get(e);let o=n.indexOf(t);n.splice(o,1)}),n.length!==t.length&&r.selectMovables(n),0===n.length&&b?.(),void e.preventDefault()}const i=.1,a=e=>{o.updateSelected(t=>{t.setRotation(t.getRotation()+e)},"Rotate")},s=(e,t=!0)=>{o.updateSelected(n=>{const o=n.getBounds();let r=1+e;t||(r=1/r);const l=Math.sqrt(Math.pow(o.width,2)+Math.pow(o.height,2)),i=Math.atan2(o.height,o.width),a=r*l;if(a<10)return;const s=a*Math.cos(i),d=a*Math.sin(i),c={x:o.x+(o.width-s)/2,y:o.y+(o.height-d)/2,width:s,height:d};n.setBounds(c)},"Resize")},d=e=>{o.updateSelected(t=>{const n=t.getBounds(),o={x:n.x+(e.x??0),y:n.y+(e.y??0),width:n.width+(e.width??0),height:n.height+(e.height??0)};t.setBounds(o)},"Nudge")};if(e.which===S.Delete)o.updateSelected(e=>{e.delete()},"Delete"),e.preventDefault();else if("a"===e.key&&t){const t=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(t,!0),e.preventDefault()}else"ArrowLeft"===e.key?(l?s(i,!1):n?a(-10):d({x:t?-10:-1}),e.preventDefault()):"ArrowRight"===e.key?(l?s(i,!0):n?a(10):d({x:t?10:1}),e.preventDefault()):"ArrowUp"===e.key?(l?s(i,!0):d({y:t?-10:-1}),e.preventDefault()):"ArrowDown"===e.key&&(l?s(i,!1):d({y:t?10:1}),e.preventDefault())},children:[ge,xe]})})})})),tn=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let l=0;l<e.length;l++){const i=e[l].getBounds();t=Math.min(i.x,t),n=Math.min(i.y,n),o=Math.max(i.x+i.width,o),r=Math.max(i.y+i.height,r)}return{x:t,y:n,width:o-t,height:r-n}},nn=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",l=t?"width":"height";let i=0,a=Number.MAX_SAFE_INTEGER,s=0;for(let t=0;t<e.length;t++){const r=e[t],d=r.getBounds();i+=d[l],a=Math.min(d[o],a),s=Math.max(d[o]+d[l],s),n.push({bounds:d,movable:r})}const d=(s-a-i)/(e.length-1);n.sort((e,t)=>{const n=e.bounds[o],l=t.bounds[o];return n!==l?n-l:e.bounds[r]-t.bounds[r]});const c=new Map;c.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){const t=n[e-1].bounds,r={...n[e].bounds};r[o]=t[o]+t[l]+d,n[e].bounds=r,c.set(n[e].movable,r)}return c.set(n[n.length-1].movable,n[n.length-1].bounds),c};function on(e){const{movables:t,movablesView:n,transactional:o,commands:r,target:l,onRepeatCommandChange:i,notifier:a}=e,s=A();re(s.getMode()).current=s.getMode();const d=x(async(e,t,n=null,o=!0)=>{const r=async()=>{const d=await Promise.resolve(a?.showBusy?.(e.label()));try{await t();const a=n??e?.label?.();if(i){let t=null;e&&!1!==a&&(t=new k(e.key(),l,{label:a,description:a},r)),i(t)}d?.(),o&&s.setMode(null)}catch(e){d?.(),a?.showError?.(e)}};await r()},[i,a]),[c,u]=de(e=>e+1,0),g=x((e,t,r)=>{if(!n)return;const l=n.getMovableSelection();if(0===l.length)return;let i="Drawings";if(1===l.length){const e=l[0];i=v.capitalize(e.getContent().getType())??"Drawing"}const a=`${e.label()} ${i}`;d(e,()=>{let e=null;o&&(e=o.beginCommit(a));const l=n.getMovableSelection();if(0===l.length)return;const i=r?.(l);for(let e=0;e<l.length;e++){const n=l[e];t(n,i)}e?.commit()})},[n,o]),[h,m]=ne(n.getMovableSelection()[0]??null),[p,f]=ne(!h||h?.isProtected()),y=te(()=>[new R("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[M.Ctrl,M.Shift]}},function(){g(this,e=>{e.moveToFront()})}),new R("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[M.Ctrl]}},function(){g(this,e=>{e.moveForward()})}),new R("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[M.Ctrl,M.Shift]}},function(){g(this,e=>{e.moveToBack()})}),new R("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[M.Ctrl]}},function(){g(this,e=>{e.moveBackward()})}),new R("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){g(this,e=>{e.setLockAspectRatio(!e.isLockAspectRatio())})}),new R("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){g(this,e=>{e.setAnchorType(w.Type.TwoCell)})}),new R("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){g(this,e=>{e.setAnchorType(w.Type.OneCell)})}),new R("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){g(this,e=>{e.setAnchorType(w.Type.Absolute)})}),new R("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){g(this,(e,t)=>{e.setBounds({x:t.x})},tn)}),new R("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){g(this,(e,t)=>{e.setBounds({x:(t.width-e.getBounds().width)/2+t.x})},tn)}),new R("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){g(this,(e,t)=>{e.setBounds({x:t.width-e.getBounds().width+t.x})},tn)}),new R("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){g(this,(e,t)=>{e.setBounds({y:t.y})},tn)}),new R("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){g(this,(e,t)=>{e.setBounds({y:(t.height-e.getBounds().height)/2+t.y})},tn)}),new R("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){g(this,(e,t)=>{e.setBounds({y:t.height-e.getBounds().height+t.y})},tn)}),new R("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){g(this,(e,t)=>{e.setBounds(t.get(e))},e=>nn(e))}),new R("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){g(this,(e,t)=>{e.setBounds(t.get(e))},e=>nn(e,!1))}),new R("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new R("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new R("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new R("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new R("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new R("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new R("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,h]);le(()=>{},[s]);const b=te(()=>{let e=null;return e=r?r.createChildGroup(l,"movable",!1):new T(l,"movable"),e.addCommands(y,!0),e},[r,y]);return ht(h,{onAnyChange:()=>{b.getCommand("formatAnchorTypeTwoCell").update({state:h?.getAnchorType()===w.Type.TwoCell}),b.getCommand("formatAnchorTypeOneCell").update({state:h?.getAnchorType()===w.Type.OneCell}),b.getCommand("formatAnchorTypeAbsolute").update({state:h?.getAnchorType()===w.Type.Absolute}),b.getCommand("formatAnchorTypeAbsolute").update({state:h?.getAnchorType()===w.Type.Absolute}),b.getCommand("toggleLockAspectRatio").update({state:h?.isLockAspectRatio()})},onProtectedChange:e=>{f(e.isProtected())},onDelete:()=>{}}),ht(n,{onMovableSelectionChange:()=>{const e=n.getMovableSelection()[0]??null;m(e),f(!e||e.isProtected()),u()}}),ht(t,{onCollectionChange:()=>{u()}}),le(()=>{const e={disabled:p};b.getCommand("formatAnchorTypeTwoCell").update(e),b.getCommand("formatAnchorTypeOneCell").update(e),b.getCommand("formatAnchorTypeAbsolute").update(e),b.getCommand("toggleLockAspectRatio").update(e);const o=t.getCount(),r=n.getMovableSelection(),l=p||o<=1||0===r.length;let i={disabled:l},a=i;if(!l&&1===r.length){const e=r[0];0===e.getZIndex()&&(i={disabled:!0}),e.getZIndex()===o-1&&(a={disabled:!0})}b.getCommand("moveToFront").update(a),b.getCommand("moveForward").update(a),b.getCommand("moveToBack").update(i),b.getCommand("moveBackward").update(i);const s={disabled:p||r.length<=1};b.getCommand("formatDrawAlignLeft").update(s),b.getCommand("formatDrawAlignCenter").update(s),b.getCommand("formatDrawAlignRight").update(s),b.getCommand("formatDrawAlignTop").update(s),b.getCommand("formatDrawAlignMiddle").update(s),b.getCommand("formatDrawAlignBottom").update(s),b.getCommand("formatDrawFlipHorz").update(s),b.getCommand("formatDrawFlipVert").update(s),b.getCommand("formatDrawGroup").update(s),b.getCommand("formatDrawUngroup").update(s),b.getCommand("formatDrawSwapShapes").update(s),b.getCommand("formatDrawSwapShapesHorz").update(s),b.getCommand("formatDrawSwapShapesVert").update(s);const d={disabled:p||r.length<=2};b.getCommand("formatDrawDistributeHorz").update(d),b.getCommand("formatDrawDistributeVert").update(d)},[c,p,c]),b}const rn=ee(oe((e,t)=>{const{children:n,disabled:o,description:r,view:l,isDragging:i,onHide:a,onShow:s,...d}=e;le(()=>{},[r]);const c=C(t,()=>({isEmptyFrame:()=>!0}),[]),[u,{height:g,width:h}]=Ye();return _("div",{...d,ref:Ue([c,u]),children:_("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:o?"blur(1px)":void 0,boxShadow:i?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:_("div",{style:{textAlign:"center"},children:r})})})})),ln=ee(oe((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:l,commands:i,target:a,notifier:s,onRepeatCommandChange:d}=e,c=on({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:d,commands:i,target:a,notifier:s});le(()=>{n?.getStage()},[n?.getStage()]);const u=te(()=>_(en,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:l,...r,onFocus:()=>{c.activate(),r?.onFocus?.()}},"movable-area"),[o,r,i,c]);return u&&n?u:null})),an=ee(oe((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:l,showProtectedError:i,setEditingCoords:a,commands:d,notifier:c=V}=e,u=A(),[g,h]=ne(null),[m,p]=ne(null),[f,w]=ne(null),[y,b]=ne(null),[q,C]=ne(null);ie(()=>{if(null===f)return b(null),void C(null);const e=()=>{const e=o.getRange(f).getCell(),t=e.getStyle();let n,l=t.getFill()?.toCSS(r.body.darkMode);"none"!==l.background&&"transparent"!==l.background||(l=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),"none"!==l.background&&"transparent"!==l.background||(l={background:r.body.fill}),b({style:l}),e&&!e.getFormula()&&(n=e?.getRenderHorizontalAlignment()),C(n??B.Left)};return e(),o.getRange(f).addListener(()=>{e()})},[o,f,r?.body]);const S=x(()=>{let e=m.editState.dirty??"";if(void 0!==m.editState.dirty){const t=v.clampString(e);try{const n=m.sheet.getRange(m.coords),o=`Typing '${t}' into ${n.toString()}`;return n.setValue(e,{description:o,autoFit:!0}),w(null),p(null),u.setMode(null),a(null),!0}catch(e){throw c.showError(new Error(`Unable to enter '${t}'.`,{cause:e})),e}}},[o,m,c]),k=x(e=>o.getRange(e).getCell().getExtrusions()??J.cellToRange(e),[o]),R=x(e=>{let t=s.Orientation.Row,n=!1;e!==s.Direction.Up&&e!==s.Direction.Down||(t=s.Orientation.Column),e!==s.Direction.Left&&e!==s.Direction.Up||(n=!0),o.getSelection().traverse(t,n)},[o]),M=ae((e,t)=>{if(l)return l(e,t);if(!o)return null;const{ref:n,...i}=e;return _(He,{ref:n,...i,sheet:o,bodyStyle:r?.body,activeCoords:t,commands:d,onChangeEdit:e=>{const n={sheet:o,coords:t,editState:e};u.setMode(e=>({...e,description:n.editState.editMode?"Edit":"Enter",args:{...e?.args,stateAndCoords:n}}))},editState:m.editState})},[o,y,l,m,f]),{overlay:T,startEdit:D,submitEdit:E,cancelEdit:z,onKeyboardEventNative:F,onPointerEventNative:I}=Se({view:n,activeCoords:g,getCellEditor:M,canEdit:()=>{const e=o.getProtection();if(e.isReadOnly())return!1;const t=e.isLocked();return t&&i(),!t},onBeforeStartEdit:e=>{const t=Pe(()=>o.getRange(e).getCell()),n={sheet:o,coords:e,editState:Object.freeze(t)};u.setMode({key:"edit",args:{stateAndCoords:n}}),p(n)},onStartEdit:e=>{w(e),a(e)},onSubmitEdit:S,onCancelEdit:e=>{w(null),p(null),u.setMode(null),a(null)},onDoneEdit:e=>{u.setMode(null)},onNavigate:R,containerProps:y,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:q,getRangeCoords:k});ht(o.getSelection(),{onChange(e){h(o.getSelection().getCoords().cell)}});const N=x(e=>{I(e),f&&E()},[I,z,f]),O=ae(e=>{I(e)},[I]),L=ae(e=>{F(e)},[F]);return le(()=>{const e=n?.getStage();if(e)return e.addEventListener("pointerdown",N),e.addEventListener("dblclick",O),e.addEventListener("keydown",L),()=>{e.removeEventListener("pointerdown",N),e.removeEventListener("dblclick",O),e.removeEventListener("keydown",L)}},[n?.getStage()]),le(()=>{const e=u.getMode(),t=e?.key;"edit"===t||"enter"===t?m?e.args?.cancel?z():e.args?.submit?E():p(e.args?.stateAndCoords):D(e.args?.start):f&&z()},[u]),T(n,t)})),sn="white",dn="black",cn=`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='${dn}' fill='${sn}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,un=`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='${dn}' fill='${sn}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,gn=ee(oe((e,t)=>{const{view:n,sheet:o}=e,[r,l]=Q.useState(o.getTables().getCount()>0),[i,a]=Q.useState(null),[s,d]=Q.useState(null),[c,u]=Q.useState(null),[g,h]=Q.useState(null),m=x(()=>{if(o.getTables().getCount()>0){l(!0);const e=o.getTables().search({address:n.getVisibleRangeCoords()});a(e.length>0?e:null)}else l(!1),a(null)},[o,n]),p=x(e=>{e.preventDefault(),e.stopPropagation();const t=n.getCellCoordsFromClient(e.clientX,e.clientY),r=o.getTables().search({address:t});if(1===r.length){r[0].select()}},[n,o]),f=x(e=>{e.preventDefault(),e.stopPropagation();const t=n.getCellCoordsFromClient(e.clientX,e.clientY),r=o.getTables().search({address:t});if(1===r.length){const e=r[0].getRange().getCoords(),n={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};o.getRange(n).select()}},[n,o]),v=x(()=>{if(!r)return;const e=o.getTables().search({address:n.getVisibleRangeCoords()});a(e.length>0?e:null)},[o,r,n]);ht(o?.getSelection(),{onChange(e){d(o.getSelection().getCoords().cell)}}),ht(c,{onAnyChange(e){m(),v()}}),ht(g,{onAnyChange(e){v()}}),ht(o,{onTablesChange(e){m(),v()},onInvalidated(e){m(),v()}});const w=Q.useMemo(()=>X.debounce(X.throttle(v,300),300),[]);le(()=>{w()},[n]),le(()=>{let e=null;if(i)for(let t=0;t<i.length&&!e;t++){const n=i[t],o=n.getRange().getCoords();y.isCellWithinRange(s,o)&&(e=n)}u(e)},[s,i]);const b=x(e=>{let t=null;if(i)for(let o=0;o<i.length;o++){const r=i[o],l=r.getRange().getCoords();let a=n.getRangeCoordsBounds(l);const s=n.getRelativePointFromClient(e.clientX,e.clientY),d=s.x,c=s.y;if(d>=a.x&&d<=a.x+a.width&&c>=a.y&&c<=a.y+a.height){const e=n.getViewportSize();d<=0||c<=0||d>=e.width||c>=e.height||(t=r)}}h(t)},[n,i]);if(le(()=>{const e=n?.getStage();if(e&&i)return e.addEventListener("mousemove",b),e.addEventListener("mouseleave",b),()=>{e.removeEventListener("mousemove",b),e.removeEventListener("mouseleave",b)}},[i,n?.getStage()]),!n)return null;if(!i||0===i.length)return null;const q=[];for(let e=0;e<i.length;e++){const t=i[e];if(t.isClosed())continue;const r=t===g,l=t===c,a=t.getRange().getCoords(),s=n.getRangeCoordsBounds(a);let d;if(r||l){const e=t.getStyle().getProperties(),n=e.headerRow?.fill?.background??e.wholeTable?.border?.top?.color?.toString();if(n&&o){const e=o.getStyles().parseColor(n);e&&(d=e.toCSS())}d||(d="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}q.push(_("div",{style:{position:"absolute",left:s.x,top:s.y,width:Math.min(16,s.width),height:s.height,pointerEvents:"all",cursor:cn},onMouseDown:f},`table-select-row-${t.getName()}`)),q.push(_("div",{style:{position:"absolute",left:s.x,top:s.y,width:Math.min(16,s.width),height:Math.min(16,s.height),pointerEvents:"all",cursor:un},onMouseDown:p},`table-select-${t.getName()}`)),q.push(_(ke,{x:s.x,y:s.y,width:s.width,height:s.height,range:a,strokeWidth:l?.5:0,stroke:d??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:r?`${d} 0px 0px 1px 1px`:void 0}},`table-outline-${t.getName()}`))}return q})),hn=ee(oe((t,n)=>{const{view:o,sheet:r,animationTime:l=60}=t,[i,a]=Q.useState(null),[s,d]=Q.useState(null),c=Q.useRef(null),u=x(()=>{const e=r.getSelectedCell(),t=e.getSpill()?.getCoords()??null;J.isEqualRanges(t,i)||(d(t?{transition:i?"move":"in",bounds:o.getRangeCoordsBounds(t),coords:t}:{transition:"out",bounds:o.getRangeCoordsBounds(i),coords:i}),a(t))},[r,o,i]);Q.useEffect(()=>(c.current&&(clearTimeout(c.current),c.current=null),s&&(c.current=setTimeout(()=>{d(null),c.current=null},l)),()=>{c.current&&(clearTimeout(c.current),c.current=null)}),[s,l]);const g=Q.useMemo(()=>X.debounce(X.throttle(u,80),80),[]);if(ht(r?.getSelection(),{onChange(e){g()}}),ht(r,{onSpillsChange(e){u()},onInvalidated(e){u()}}),!o)return null;if(!i&&!s)return null;const h=r.getRange(i).getValue()instanceof e.Spill,m=[];let p=s?.bounds??o.getRangeCoordsBounds(i);if(s&&!X.isEqualBounds(s.bounds,o.getRangeCoordsBounds(s.coords))&&d(null),p=o.toClipBounds(p,-10),!p)return;const f="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return m.push(_(ke,{x:p.x,y:p.y,width:p.width,height:p.height,range:i,strokeWidth:1,stroke:f,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:"out"===s?.transition?0:1,transition:s?.transition?"in"===s.transition||"out"===s.transition?`opacity ${1.5*l}ms ease-in-out`:`left ${l}ms ease-out, top ${l}ms ease-out, width ${l}ms ease-out, height ${l}ms ease-out`:"none",boxShadow:`${f} 0px 0px 4px 0px`}},"spill-outline}")),m})),mn={position:"absolute",top:0,left:0,bottom:0,right:0},pn=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),l={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},i=n.body=X.mergeContentful(e.body,l);return n.body=X.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},i),n.buttonSurface=X.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=X.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=X.mergeContentful(n.header,l),n.headerSelect=X.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=X.mergeContentful(n.headerSelect,l),n.headerSelectAll=X.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=X.mergeContentful(n.headerSelectAll,l),n},fn={fireOnModelChange:!1},vn={},wn=ee(oe((e,t)=>{const{sheet:n,gridStyle:o=vn,headersStyle:r=vn,onSheetContextMenu:l,showColumnHeaders:s,columnHeaderProps:c,showRowHeaders:u,rowHeaderProps:g,showScrollbars:h=!0,scrollPaneProps:p,onViewportChange:f,commands:v,onRepeatCommandChange:w,onMoveCell:y,overlays:b,renderMovable:k,viewportComponent:R,onElementLoad:M,getCellEditor:T,onFocus:D,onBlur:E,style:F=q.EmptyCssProperties,notifier:I,onShowTooltip:N,onShowColumnTooltip:L,onShowRowTooltip:V,onCloseTooltip:B,gridProps:P,cellRenderProps:W,...$}=e;if(Q.useEffect(()=>{d._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[U,j]=Q.useReducer(e=>e+1,0),[ee,{width:oe,height:se}]=Ye(),de=x(N,[N]),ce=x(L,[L]),ge=x(V,[V]),he=x(B,[B]),me=re(!1);ie(()=>{me.current=!0},[n]);const pe=n?.getStyles(),fe=te(()=>pn(o,pe),[o,pe]),ve=te(()=>pn(r,pe),[r,pe]),{body:we={},buttonSurface:ye={}}=fe,{header:qe={},headerSelect:Ce={},headerSelectAll:xe={}}=ve,Se=re(null),[ke,Me]=ne(()=>n?.getView()),Te=(ke?.getZoomScale()??100)/100,De=te(()=>({vertical:ke.isShowColumnGridlines()&&Te>=.4,horizontal:ke.isShowRowGridlines()&&Te>=.4}),[ke?.isShowColumnGridlines(),ke?.isShowRowGridlines(),Te]),Ae=te(()=>{if(ke?.getGridLineColor())return{strokeDasharray:"1,1"}},[ke?.getGridLineColor(),fe]),Ee=s??ke?.isShowColumnHeaders(),ze=u??ke?.isShowRowHeaders(),[Fe,Ie]=ne({width:0,height:0}),Ne=te(()=>{let e=40,t=20;const o=n?.getStyles().getNormal().getFont();if(Fe.width>0&&Fe.height>0){const n=o?.toCSS()?.fontFamily??fe.header.text.fontFamily,r=o?.getSize()??fe.header.text.fontSize,l=a.getSharedMeasurer()(""+Fe.height,Math.ceil(r*a.getDeviceScale()),n);e=l.width,t=l.lineHeight}return{width:Math.round(e+5),height:Math.round(t+3)}},[Fe,fe?.header.text,n]),Le=ze?Te*Ne.width:qe.edgeStrokeWidth,Ve=Ee?Te*Ne.height:qe.edgeStrokeWidth,Be=Math.max(oe,(n?.getColumnHeaders().getDefaultSize()??Ne.width)+Le+1),He=Math.max(se,(n?.getRowHeaders().getDefaultSize()??Ne.height)+Ve+1),Pe=re(new Map),We=re(null),$e=()=>({getColOffset:e=>n.getColumnHeaders().findOffset(e),getColIndex:e=>n.getColumnHeaders().findIndex(e),getRowOffset:e=>n.getRowHeaders().findOffset(e),getRowIndex:e=>n.getRowHeaders().findIndex(e)}),[Ue,je]=ne(()=>$e()),[_e,Ge]=ne(!1),[Ze,Xe]=ne(null),Ke=!0,Je=fe.selection?.strokeFill,Qe=ae(()=>Gt.current,[]),[et,tt]=ne(),nt=x(e=>{tt(e),n&&n.getView()&&n.getView().setTopLeft(e?{left:e.left,top:e.top}:null),f?.(e)},[n,f]),ot=re(null);le(()=>{if(!et||!n)return;const e=n.getRangeAtBounds({x:et.left,y:et.top,width:et.width,height:et.height});ot.current?.(),ot.current=e.addListener(()=>{const t=e.getCoords();Se?.current?.invalidate(t)})},[et,n]);const[rt,lt]=ne(()=>n?.getView().getTopLeft()),it=x(e=>{const t=J.cellToRange(e);if(n.isClosed())return t;const o=n.getRange(t,{excludeHidden:!0}).getMerges();return 0===o.length?t:o[0]},[n]),at=e=>{if(!e||0===e.coords.colIndex&&0===e.coords.rowIndex)return null;const t={};return e.coords.colIndex>0&&(t[Y.Left]={index:e.coords.colIndex,scrollOffset:e.topLeft.left}),e.coords.rowIndex>0&&(t[Y.Top]={index:e.coords.rowIndex,scrollOffset:e.topLeft.top}),t},[ut,mt]=ne(()=>at(n.getView().getFreezePanes())),pt=A(),vt=ae(()=>Se.current,[]),wt=x(e=>{pt.setMode(t=>"edit"===t?.key?{...t,args:{...t.args}}:{key:"edit",args:{stateAndCoords:null,start:e}})},[]),yt=x(()=>et,[et]),bt=ft({sheet:n,commands:v,target:vt,onRepeatCommandChange:w,bodyStyle:we,notifier:I,onStartEdit:wt,getViewport:yt}),[qt,Ct]=ne(n.getSelection().isEntire()),[xt,St]=ne(ke?.getMovableSelection().length>0),kt=null!==Ze||xt,Rt=null,[Mt,Tt]=ne(!1);le(()=>{Tt(!1)},[n.getProtection()]);const At=x(()=>{Mt||(Tt(!0),I.showMessage?.(G("span",{children:["This sheet is protected.",_("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:z.Error}))},[I,Mt]),Ft=te(()=>{const e=pt.getMode();return e?.cursor?e.cursor:null},[Rt,pt]),[It,Nt]=ne(null),Ot=re(!1),[Lt,Vt]=ne([]),Bt=re(null),[Ht,Wt]=ne(K.EmptyTopLeft),[$t,Ut]=ne(K.EmptyTopLeft);le(()=>{Wt({left:rt?.left,top:0})},[rt?.left]),le(()=>{Ut({left:0,top:rt?.top})},[rt?.top]),ht(n?.getView(),{onFreezeSplitChange:()=>{mt(at(n.getView().getFreezePanes()))},onTopLeftChange:()=>{lt(n.getView().getTopLeft())},onMovableSelectionChange:()=>{St(n.getView().getMovableSelection().length>0)}}),ht(n?.getSelection(),{onChange:()=>{Ct(n.getSelection().isEntire())}}),ht(n,{onViewChange(){Me(n.getView()),je($e())},onLayoutChange:()=>{const e=n.getEntireRange();Ie({height:e.getRowCount(),width:e.getColumnCount()}),je($e())},onStyleChange:()=>{Zt()},onMovablesChange:()=>{},onInvalidated:()=>{Zt()}}),ht(n,{onRequestScrollIntoView:async(e,t)=>{if(!t)return;const n={colIndex:t?.coords.colStart,rowIndex:t?.coords.rowStart};return await(Se.current?.scrollCellCoordsIntoView(n,t?.scroll)),!0},onRequestFocus:()=>X.whenFocus(Gt.current)},fn);const jt=te(()=>{const e=(e,t)=>{Ot.current=!0,Nt([r=>{if(!r.toClipBounds(r.getRangeCoordsBounds({rowStart:0,rowEnd:Fe.height,colStart:e,colEnd:e})))return;const l=r.getLayout(),i=Math.max(0,l.getColOffset(e)),a=r.getBounds(),s=Math.min(a.x+a.width,l.getColOffset(e+1)),d=r.getAnchor();if(null!==t&&(d===Y.Left||d===Y.Center||d===Y.Right)){const e=X.roundAccurately(t*X.getDPI(),0),o=X.roundAccurately(n?.getColumnWidthAsFontUnit(t/Te),2).toFixed(2),r="Width: "+(t?o+" ("+e+" pixels)":"Hidden"),l=yn.current.getGridElement().getRelativePointFromClient(0,0),d=0-l.y,c=0-l.y+Ve,u={x:i-(l.x-a.x),y:d,width:s-i,height:c-d};requestAnimationFrame(()=>{Ot.current&&ce?.({anchor:u,display:r})})}const c=[0,0,0,a.height],u={style:{boxShadow:`0.5px 0px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},g={x:i-1,y:0,width:1,height:a.height},h={style:{boxShadow:`-0.5px 0px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},m={x:s-1,y:0,width:1,height:a.height};return G(Q.Fragment,{children:[_(Re,{linePoints:c,bounds:g,...u}),_(Re,{linePoints:c,bounds:m,...h})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(o,r,l)=>{t=n.beginCommit(l),e(o,r)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},...c}},[n,c,Ve,It]),_t=te(()=>{const e=(e,t)=>{Ot.current=!0,Nt([r=>{if(!r.toClipBounds(r.getRangeCoordsBounds({rowStart:e,rowEnd:e,colStart:0,colEnd:Fe.width})))return;const l=r.getLayout(),i=Math.max(0,l.getRowOffset(e)),a=r.getBounds(),s=Math.min(a.y+a.height,l.getRowOffset(e+1)),d=r.getAnchor();if(null!==t&&(d===Y.Top||d===Y.Center||d===Y.Bottom)){const e=Math.floor(10*X.getDPI())/10,o=X.roundAccurately(t*e,0),r=X.roundAccurately(o/Te/(n?.getRowHeaders().getScaleFactor()*X.getDPI()),2).toFixed(2),l="Height: "+(t?r+" ("+o+" pixels)":"Hidden"),d=un.current.getGridElement().getRelativePointFromClient(0,0),c=0-d.x,u=0-d.x+Le,g={x:c,y:i-(d.y-a.y),width:u-c,height:s-i};requestAnimationFrame(()=>{Ot.current&&ge?.({anchor:g,display:l})})}const c=[0,0,a.width,0],u={style:{boxShadow:`0px 0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},g={x:0,y:i-1,width:a.width,height:1},h={style:{boxShadow:`0px -0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:Je}},m={x:0,y:s-1,width:a.width,height:1};return G(Q.Fragment,{children:[_(Re,{linePoints:c,bounds:g,...u}),_(Re,{linePoints:c,bounds:m,...h})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(o,r,l)=>{t=n.beginCommit(l),e(o,r)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>he?.()),Ot.current=!1,Nt(null)},...g}},[n,g,Le]),Gt=C(t,()=>{const e=e=>{n?.getView()&&n.getView().selectMovables([]),We.current=null,Se?.current?.focus(e)},t=async(e=null)=>{if(e||(e=n?.getView().getMovableSelection()[0]),!e)return!1;const t=e.getAnchorCoords();if(!t)return!1;const o=Se.current?.getViewFromCellCoords({colIndex:t.colStart,rowIndex:t.rowStart});if(!o)return!1;const r=o.getAnchor();-1===n?.getView().getMovableSelection().indexOf(e)&&n?.getView().selectMovables([e]);let l=Pe.current?.get(r);return l?.current?(await l.current.focusMovable(e),!0):(We.current={movable:e,anchor:r},!0)};return{getGridElement:()=>Se.current,getRowHeaderElement:()=>un.current,getColumnHeaderElement:()=>yn.current,rowHeaderHeight:()=>Ve,colHeaderWidth:()=>Le,startEdit:wt,submitEdit:()=>{pt.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{pt.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:null!==Ze,focus:o=>{n?.getView().getMovableSelection().length>0&&t()||e(o)},focusSheet:e,focusMovable:t,contains:e=>Se?.current?.contains?.(e),invalidate:Zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),Zt=ae(e=>{me.current||(Se?.current?.invalidate(e),j?.())},[]);le(()=>{Zt()},[fe]);const Yt=qt?xe.edgeStrokeFill:qe.fill,Kt=qt?Ce.fill:"function"==typeof fe.headerHover?fe.headerHover(qe)?.fill:qe.fill,Jt=te(()=>R?_("div",{className:st("sheetxl-viewport-overlay",ct),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:R}):_(Z,{}),[R]);let Qt=null;Ee&&ze&&(Qt=G("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Ve}px`,width:`${Le}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:e=>{let t=!e.ctrlKey;bt?.getCommand("selectAll")?.execute(!t||0!==e.button),e.nativeEvent.which===O.Right?l?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):Se.current?.focus()},children:[_("div",{style:{height:Ve-5+"px",width:Ve-5+"px",clipPath:`path('M${Ve-5} 0 L0 ${Ve-5} L${Ve-5} ${Ve-5} L${Ve-5} 0 Z')`,borderRight:`2px solid ${Yt}`,borderBottom:`2px solid ${Yt}`,background:`${Kt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),_("div",{style:{position:"absolute",height:`${Ve}px`,width:`${Le}px`,boxSizing:"border-box",borderRight:`solid 1px ${qe.strokeFill}`,borderBottom:`solid 1px ${qe.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const en=x(({_left:e,_top:t})=>{},[]),tn=x(e=>{if(!l)return;const t=Se.current.getViewFromClient(e.clientX,e.clientY)?.getCellCoordsFromClient(e.clientX,e.clientY);t&&(l({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[l]),nn=x(e=>{if(!(!e.shiftKey&&(e.ctrlKey||e.metaKey)))return;const{deltaY:t}=e;return t>0?bt.getCommand("sheetZoomOut")?.execute():t<0&&bt.getCommand("sheetZoomIn")?.execute(),0===t},[bt]);le(()=>{Vt(null),Bt.current=null,Ot.current=!1,Nt(null);const e=n?.getView().getTopLeft();en(e),Se.current?.scrollTo(e),lt(e),Me(n.getView()),mt(at(n.getView().getFreezePanes())),je($e()),j()},[n?.getView()]);const on=x(e=>{const t=e.getVisibleRangeCoords();if(!t)return null;const o=[];return n.getRange(t).forEach((e,t)=>{const n=t.getCoords(),r=t.getCell();(e=>{if(e.isEmpty())return!1;const t=e.getSpans();if(t.width>1||t.height>1)return!0;if(e.getStyle().hasVisibleStyling())return!0;if(ke.isShowFormulas()&&null!==e.getFormula())return!0;const n=e.getValue();return null!==n&&!(!ke.isShowZeros()&&0===n&&e.getType()===i.Number)})(r)&&o.push({coords:n,value:r,range:ke.isShowFormulas()?null:r.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),o},[n,ke.isShowZeros(),ke.isShowFormulas(),Ze]);le(()=>{const e=[];b&&e.push(...b),It&&e.push(...It),X.isEqualArrays(e,Bt.current)||(Bt.current=e,Vt(e))},[b,It,fe]);const rn=te(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${o?.body?.fill}`},pathProps:{stroke:o?.body?.text?.fill??"black"}}),[fe?.header?.edgeStrokeFill]),sn=x(e=>{e.isDefaultPrevented()||e.isPropagationStopped()||(We.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),dn=te(()=>{const e=pt.getMode();return"cut"===e?.key||"copy"===e?.key},[pt]),cn=x(async e=>{const t=pt.getMode();return e.keyCode===S.Escape&&t?(e.preventDefault(),void pt.setMode(null)):e.keyCode===S.Enter&&dn?(e.preventDefault(),await(bt?.getCommand("paste")?.execute()),void pt.setMode(null)):void bt?.dispatchToFocusedCommand(e)},[bt,pt]),un=re(null),wn=te(()=>_("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Ve+1}px`,width:`${Le+qe.edgeStrokeWidth}px`,minWidth:`${Le+qe.edgeStrokeWidth}px`,borderRight:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,height:`calc(100% - ${Ve}px)`,boxSizing:"border-box",zIndex:"2"},children:_(Et,{ref:un,sheetElement:Gt.current,gridRef:Se,freezeStart:ut?.[Y.Top],oppositeSize:Le,containerWidth:Le,containerHeight:He,sheetHeader:n.getRowHeaders(),gridStyle:ve,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:$t,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Ve+1}px`,width:`${Le+qe.edgeStrokeWidth}px`,minWidth:`${Le+qe.edgeStrokeWidth}px`,borderRight:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,height:`calc(100% - ${Ve}px)`,boxSizing:"border-box",zIndex:"2",..._t?.style},..._t})}),[Le,Ve,He,n,$t,ut?.[Y.Top],fe,Ke,l,qe.fill,g]),yn=re(null),bn=te(()=>_("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Ve+qe.edgeStrokeWidth}px`,minHeight:`${Ve+qe.edgeStrokeWidth}px`,borderBottom:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:_(Et,{ref:yn,sheetElement:Gt.current,gridRef:Se,freezeStart:ut?.[Y.Left],oppositeSize:Ve,containerWidth:Be,containerHeight:Ve,sheetHeader:n.getColumnHeaders(),gridStyle:ve,scrollPoint:Ht,onSheetContextMenu:l,...jt,style:{...jt?.style,position:"relative",left:"0px",width:"100%",height:`${Ve+qe.edgeStrokeWidth}px`,minHeight:`${Ve+qe.edgeStrokeWidth}px`,borderBottom:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Ve,Be,n,Ht,ut?.[Y.Left],fe,qe.fill,Ke,l,c]),qn=x(e=>{const{value:t,key:o,...r}=e;let l=t,i=Ze;if(!i||i.colIndex===e.coords.colIndex&&i.rowIndex===e.coords.rowIndex||(i=null),!l){const t=e.range;if(l=n.getRange({rowIndex:t.rowStart,colIndex:t.colStart}).getCell(),l.isEmpty())return null}let a=null;l.getHyperlink()&&(a=async e=>{if(W?.onLinkMouseDown?.(e),0===e.button&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await(l.getHyperlink()?.open())}catch(e){I?.showError?.(e)}}}),i&&i.colIndex===e.range.colStart&&i.rowIndex===e.range.rowStart&&(l=l.createTemporaryCell({value:null}));const s=n.getStyles();return ue(Oe,{...r,key:o,bodyStyle:we,docTheme:s.getTheme(),normalStyle:s.getNormal(),showFormulas:ke.isShowFormulas(),showZeros:ke.isShowZeros(),onLinkMouseDown:a,...W,value:l})},[n,Ue,we,Ze,ke?.isShowFormulas(),ke.isShowZeros()]),Cn=ae((e,t)=>{const{key:o,...r}=e;return[_(zt,{ref:t,getVisibleCells:on,sheet:n,gridStyle:fe,...r},`border-${o}`),_(gn,{ref:t,sheet:n,commands:bt,...r},`table-${o}`),_(hn,{ref:t,sheet:n,...r},`spill-${o}`),_(Xt,{ref:t,sheet:n,commands:bt,notifier:I,onShowTooltip:de,onCloseTooltip:he,gridStyle:fe,gridRef:Se,editingCoords:Ze,isActive:Ke,...r},`selection-${o}`),_(Pt,{ref:t,sheet:n,commands:bt,gridStyle:fe,element:Qe,notifier:I,...r},`copy-paste-${o}`),_(ln,{ref:t,sheet:n,commands:bt,target:vt,notifier:I,renderMovable:k,movableProps:{onUnFocus:()=>{Gt.current.focus()}},...r},`movable-${o}`),_(an,{ref:t,sheet:n,commands:bt,notifier:I,gridStyle:fe,getCellEditor:T,showProtectedError:At,setEditingCoords:Xe,...r},`editor-${o}`)]},[n,Se.current,fe,T,bt,I]),[xn,Sn]=ne(!1),kn=te(()=>{if(0===Be||0===He)return null;const e=n.getStyles().getNormal(),t=e.getFont(),o=e.getFill(),r=e.getBorder(),l=e.getFill().getType()===m.Type.None;let i=Ae,a=Ae;const s=(e,t,n)=>n?{stroke:r.getBottom().isNone()?"none":e.getColor().toRGBA(we.darkMode).toString(),...t}:t;a=s(r.getBottom(),a,!r.getBottom().isNone()),a=s(r.getTop(),a,!r.getTop().isNone()),i=s(r.getRight(),i,!r.getRight().isNone()),i=s(r.getLeft(),i,!r.getLeft().isNone());let d=ke?.getGridLineColor()?.toRGBA(we.darkMode).toString()??we.strokeFill;return l||(a=s(r.getBottom(),a,!0),a=s(r.getTop(),a,!0),i=s(r.getRight(),i,!0),i=s(r.getLeft(),i,!0)),_(be,{className:"sheetxl-sheet-primary",style:{...mn,...o.toCSS(we.darkMode),...t.toCSS(we.darkMode,Te),"--sxl-app-color-background":we.fill,"--sxl-app-color-shadow":fe.colorShadow,"--sxl-app-color-grey":fe.colorGrey,"--sxl-app-color-button-fill":ye.fill,"--sxl-app-color-button-text":ye.text?.fill,"--sxl-app-color-button-border":ye.edgeStrokeFill,"--sxl-app-color-primary-dark":fe.selection.strokeFill},ref:Se,zoom:Te,...P,onFirstRender:e=>{Sn(!0),P?.onFirstRender?.(e),bt?.activate()},showGridLines:De,gridLineColor:d,gridLineColumnsProps:i,gridLineRowsProps:a,freezeLeft:ut?.[Y.Left],freezeLeftProps:rn,freezeTop:ut?.[Y.Top],freezeTopProps:rn,width:Be,height:He,columnCount:Fe.width,rowCount:Fe.height,cursor:Ft??Rt??"cell",clipCells:!0,layout:Ue,cellRenderer:qn,overlayRenderer:Cn,getCellCoordsAsRangeCoords:it,getVisibleCells:on,onWheelScroll:nn,onPointerDown:sn,onKeyDown:cn,onViewportChange:nt,onImmediateScroll:en,scrollPoint:rt,stageProps:{onFocus:()=>{bt?.activate()}},overlays:Lt})},[U]);le(()=>{me.current||j()},[Ue,ut,Te,bt,rt?.left,rt?.top,we,P,Be,He,Ft,Lt,Ke,Rt]);let Rn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};h||(Rn={...Rn,...F});const Mn=te(()=>{const e=n.getStyles().getTheme(),t=e.getColorScheme(),o=e.getFontScheme();return{"--sxl-doc-color-dk1":t.getDk1().toCSS(we.darkMode),"--sxl-doc-color-dk2":t.getDk2().toCSS(we.darkMode),"--sxl-doc-color-lt1":t.getLt1().toCSS(we.darkMode),"--sxl-doc-color-lt2":t.getLt2().toCSS(we.darkMode),"--sxl-doc-color-accent1":t.getAccent1().toCSS(we.darkMode),"--sxl-doc-color-accent2":t.getAccent2().toCSS(we.darkMode),"--sxl-doc-color-accent3":t.getAccent3().toCSS(we.darkMode),"--sxl-doc-color-accent4":t.getAccent4().toCSS(we.darkMode),"--sxl-doc-color-accent5":t.getAccent5().toCSS(we.darkMode),"--sxl-doc-color-accent6":t.getAccent6().toCSS(we.darkMode),"--sxl-doc-color-hlink":t.getHlink().toCSS(we.darkMode),"--sxl-doc-color-fol-hlink":t.getFolHlink().toCSS(we.darkMode),"--sxl-doc-font-major":o.getMajorFont(),"--sxl-doc-font-minor":o.getMinorFont()}},[n.getStyles().getTheme()]);let Tn=_("div",{style:Rn,onTouchStart:()=>{En()},onFocus:e=>{Ge(!0),D?.(e)},onBlur:e=>{Ge(!1),E?.(e)},ref:Gt,...$,children:_("div",{className:st("sheetxl-sheet",dt),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...Mn},children:G("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Qt,wn,G("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[bn,G("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${qe.edgeStrokeWidth}px ${qe.edgeStrokeFill}`,backgroundColor:we.fill},ref:ee,onContextMenu:tn,children:[kn,Jt,_(gt,{style:{position:"absolute",right:24,bottom:4},colorLicensee:fe?.selection?.strokeFill,colorCredits:fe?.body?.text?.fill})]})]})]})})});if(h){const e=e=>_(Dt,{...e,sheet:n});Tn=_(H,{style:{flex:"1 1 100%",overflow:"hidden",background:`${qe.fill}`,minHeight:2*Ne.height,minWidth:2*Ne.width,...F},viewport:et,touchElement:Se.current?.stage,disableTouch:kt,onScrollViewport:e=>{Se.current?.scrollTo(e)},createHorizontalScrollbar:e,createVerticalScrollbar:e,...p,children:Tn})}le(()=>{me.current=!1,j?.(),_e&&Gt.current?.focus()},[n]);const[Dn,An]=ne(!1),En=x(()=>{Dn||An(!0)},[Dn]);return le(()=>{if(xn)return"function"==typeof M&&M(),"touch"===q.detectIt().primaryInput&&En(),()=>{}},[M,xn,Dn]),Tn}));wn.displayName="SheetElement";const yn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),bn="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=",qn=ee(oe((e,t)=>{const{children:n,disabled:o,style:r,picture:l,description:i,isDragging:a,view:s,onHide:d,onShow:c,onKeyDownCapture:u,onFocus:g,onBlur:h,loadingPanel:m,...p}=e,[f,v]=ne(!1),[w,y]=ne(null),[b,q]=ne(null),[x,S]=ne(null);le(()=>{q(null),l.getDetails().then(e=>{v(!1),q(e.asUrl()),e.asSVGText?.()&&S(e.asSVGText())}).catch(e=>{console.warn(e),v(!0),q(bn),S(null)})},[l]);const k=C(t,()=>({isPictureEditor:()=>!0}),[]),R=te(()=>{if(b||x)return _("img",{style:{flex:"1",width:"100%",height:"100%",border:f?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:f?"var(--sxl-app-color-background, white)":void 0,boxShadow:f?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:f?"contain":void 0,opacity:w?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:b,onLoad:()=>{y(!0)},onError:({currentTarget:e})=>{console.log("error"),e.onerror=null,q(bn),v(!0)},alt:i??`${l.getType()}`})},[w,l,b,x,a]);if(!l.isClosed())return G("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:a?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...r,width:"100%",height:"100%"},tabIndex:0,...p,onKeyDownCapture:e=>{u?.(e)},ref:k,children:[w||f?void 0:m,R]})}));qn.displayName="PictureEditor";const Cn=ee(oe((e,t)=>{const{children:n,disabled:o,chart:r,view:l,isDragging:i,onHide:a,onShow:s,...d}=e;le(()=>{},[r]);const c=C(t,()=>({isChartEditor:()=>!0}),[]),[u,{height:g,width:h}]=Ye();if(!r.isClosed())return _("div",{...d,ref:Ue([c,u]),children:_("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:o?"blur(1px)":void 0,boxShadow:i?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:_("div",{style:{textAlign:"center"},children:r.getDescription()})})})})),xn="_editable-input_1bqx6_6",Sn=e=>_("input",{...e}),kn=ee(oe((e,t)=>{const{style:n={},className:o,value:r="",onSubmit:l,onChange:i,onCancel:a,createInput:s=Sn,notifier:d,styleHover:c={},dragging:u,maxLength:g,disabled:h=!1,readOnly:m=!1,...p}=e,[f,v]=ne(!1),[w,y]=ne(!1),[b,q]=ne(r);le(()=>{q(r)},[r]);const S=re(null),[k,R]=ne(null),M=ae(function(e){const t=e.message;k!==t&&(d?.showMessage?.(t,{type:z.Error}),R(t))},[d,k]),T=ae(e=>{let t=!1;try{t=l?.(e)??!0}catch(e){M(e)}return t?(S.current=null,y(!1),q(e),t):(setTimeout(()=>{S.current?.focus()},0),t)},[l]),D=x(()=>{q(r),S.current=null,y(!1),a?.()},[a,r]),A=te(()=>{if(!w)return null;const e={className:st(xn),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:g,type:"text",value:b,onFocus:e=>{S.current||(S.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{S.current&&T(b)},onChange:e=>{w&&q(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>"Escape"===e.code?(e.preventDefault(),void D()):"Enter"===e.code?(e.preventDefault(),void T(e.target.value)):void("Tab"!==e.code?e.stopPropagation():T(e.target.value))};return _(Z,{children:s(e)})},[w,b,T,D,s,h]),[E,F]=ne();ie(()=>{let e=Object.assign({},n);(u||f)&&(e=Object.assign(e,c)),F(e)},[u,f,c,n]),le(()=>{A&&i?.(b)},[A,i,b]);const I=C(t,()=>({startEdit(){h||m||y(!0)},cancel(){D()}}),[]);return G("div",{...p,ref:I,style:{flexDirection:"column",display:"flex",...E},className:st(o),children:[G("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{h||m||y(!0)},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[_("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:w?0:1},children:b}),A]}),_("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...c},children:b})]})}));const Rn="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Mn(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Tn(e){return"nodeType"in e}function Dn(e){var t,n;return e?Mn(e)?e:Tn(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function An(e){const{Document:t}=Dn(e);return e instanceof t}function En(e){return!Mn(e)&&e instanceof Dn(e).HTMLElement}function zn(e){return e instanceof Dn(e).SVGElement}function Fn(e){return e?Mn(e)?e.document:Tn(e)?An(e)?e:En(e)||zn(e)?e.ownerDocument:document:document:document}const In=Rn?ie:le;function Nn(e){const t=re(e);return In(()=>{t.current=e}),ae(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}function On(e,t){void 0===t&&(t=[e]);const n=re(e);return In(()=>{n.current!==e&&(n.current=e)},t),n}function Ln(e,t){const n=re();return te(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Vn(e){const t=Nn(e),n=re(null),o=ae(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function Bn(e){const t=re();return le(()=>{t.current=e},[e]),t.current}let Hn={};function Pn(e,t){return te(()=>{if(t)return t;const n=null==Hn[e]?0:Hn[e]+1;return Hn[e]=n,e+"-"+n},[e,t])}function Wn(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t},{...t})}}const $n=Wn(1),Un=Wn(-1);function jn(e){if(!e)return!1;const{KeyboardEvent:t}=Dn(e.target);return t&&e instanceof t}function _n(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Dn(e.target);return t&&e instanceof t}(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(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Gn=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[Gn.Translate.toString(e),Gn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Zn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xn(e){return e.matches(Zn)?e:e.querySelector(Zn)}const Yn={display:"none"};function Kn(e){let{id:t,value:n}=e;return Q.createElement("div",{id:t,style:Yn},n)}function Jn(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return Q.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":o,"aria-atomic":!0},n)}const Qn=ge(null);const eo={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},to={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 no(e){let{announcements:t=to,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=eo}=e;const{announce:l,announcement:i}=function(){const[e,t]=ne("");return{announce:ae(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Pn("DndLiveRegion"),[s,d]=ne(!1);if(le(()=>{d(!0)},[]),function(e){const t=he(Qn);le(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(te(()=>({onDragStart(e){let{active:n}=e;l(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&l(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;l(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;l(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;l(t.onDragCancel({active:n,over:o}))}}),[l,t])),!s)return null;const c=Q.createElement(Q.Fragment,null,Q.createElement(Kn,{id:o,value:r.draggable}),Q.createElement(Jn,{id:a,announcement:i}));return n?Te(c,n):c}var oo;function ro(){}function lo(e,t){return te(()=>({sensor:e,options:null!=t?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"}(oo||(oo={}));const io=Object.freeze({x:0,y:0});function ao(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function so(e,t){const n=_n(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function co(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function uo(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function go(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function ho(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function mo(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const po=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=mo(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=ao(mo(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(co)};function fo(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=l-n;if(o<r&&n<l){const n=t.width*t.height,o=e.width*e.height,r=i*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const vo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,l=n.get(o);if(l){const n=fo(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(uo)};function wo(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:io}function yo(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const bo=yo(1);function qo(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 Co={ignoreTransform:!1};function xo(e,t){void 0===t&&(t=Co);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=Dn(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=qo(t);if(!o)return e;const{scaleX:r,scaleY:l,x:i,y:a}=o,s=e.left-i-(1-r)*parseFloat(n),d=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=l?e.height/l:e.height;return{width:c,height:u,top:d,right:s+c,bottom:d+u,left:s}}(n,t,o))}const{top:o,left:r,width:l,height:i,bottom:a,right:s}=n;return{top:o,left:r,width:l,height:i,bottom:a,right:s}}function So(e){return xo(e,{ignoreTransform:!0})}function ko(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(An(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!En(r)||zn(r))return n;if(n.includes(r))return n;const l=Dn(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=Dn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const o=t[e];return"string"==typeof o&&n.test(o)})}(r,l)&&n.push(r),function(e,t){return void 0===t&&(t=Dn(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function Ro(e){const[t]=ko(e,1);return null!=t?t:null}function Mo(e){return Rn&&e?Mn(e)?e:Tn(e)?An(e)||e===Fn(e).scrollingElement?window:En(e)?e:null:null:null}function To(e){return Mn(e)?e.scrollX:e.scrollLeft}function Do(e){return Mn(e)?e.scrollY:e.scrollTop}function Ao(e){return{x:To(e),y:Do(e)}}var Eo;function zo(e){return!(!Rn||!e)&&e===document.scrollingElement}function Fo(e){const t={x:0,y:0},n=zo(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Eo||(Eo={}));const Io={x:.2,y:.2};function No(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=Io);const{isTop:d,isBottom:c,isLeft:u,isRight:g}=Fo(e),h={x:0,y:0},m={x:0,y:0},p=t.height*r.y,f=t.width*r.x;return!d&&l<=t.top+p?(h.y=Eo.Backward,m.y=o*Math.abs((t.top+p-l)/p)):!c&&s>=t.bottom-p&&(h.y=Eo.Forward,m.y=o*Math.abs((t.bottom-p-s)/p)),!g&&a>=t.right-f?(h.x=Eo.Forward,m.x=o*Math.abs((t.right-f-a)/f)):!u&&i<=t.left+f&&(h.x=Eo.Backward,m.x=o*Math.abs((t.left+f-i)/f)),{direction:h,speed:m}}function Oo(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function Lo(e){return e.reduce((e,t)=>$n(e,Ao(t)),io)}function Vo(e,t){if(void 0===t&&(t=xo),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);Ro(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Bo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+To(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Do(t),0)}]];class Ho{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ko(t),o=Lo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of Bo)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=r(n),i=o[e]-t;return this.rect[l]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Po{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Wo(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var $o,Uo;function jo(e){e.preventDefault()}function _o(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"}($o||($o={})),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"}(Uo||(Uo={}));const Go={start:[Uo.Space,Uo.Enter],cancel:[Uo.Esc],end:[Uo.Space,Uo.Enter,Uo.Tab]},Zo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Uo.Right:return{...n,x:n.x+25};case Uo.Left:return{...n,x:n.x-25};case Uo.Down:return{...n,y:n.y+25};case Uo.Up:return{...n,y:n.y-25}}};class Xo{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Po(Fn(t)),this.windowListeners=new Po(Dn(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($o.Resize,this.handleCancel),this.windowListeners.add($o.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($o.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Vo(n),t(io)}handleKeyDown(e){if(jn(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=Go,coordinateGetter:l=Zo,scrollBehavior:i="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,d=s?{x:s.left,y:s.top}:io;this.referenceCoordinates||(this.referenceCoordinates=d);const c=l(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=Un(c,d),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:d,maxScroll:u,minScroll:g}=Fo(n),h=Oo(n),m={x:Math.min(r===Uo.Right?h.right-h.width/2:h.right,Math.max(r===Uo.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(r===Uo.Down?h.bottom-h.height/2:h.bottom,Math.max(r===Uo.Down?h.top:h.top+h.height/2,c.y))},p=r===Uo.Right&&!a||r===Uo.Left&&!s,f=r===Uo.Down&&!d||r===Uo.Up&&!l;if(p&&m.x!==c.x){const e=n.scrollLeft+t.x,l=r===Uo.Right&&e<=u.x||r===Uo.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===Uo.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:i});break}if(f&&m.y!==c.y){const e=n.scrollTop+t.y,l=r===Uo.Down&&e<=u.y||r===Uo.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===Uo.Down?n.scrollTop-u.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,$n(Un(c,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Yo(e){return Boolean(e&&"distance"in e)}function Ko(e){return Boolean(e&&"delay"in e)}Xo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Go,onActivation:r}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(o.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Jo{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=Dn(e);return e instanceof t?e:Fn(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:l}=r;this.props=e,this.events=t,this.document=Fn(l),this.documentListeners=new Po(this.document),this.listeners=new Po(n),this.windowListeners=new Po(Dn(l)),this.initialCoordinates=null!=(o=_n(r))?o:io,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add($o.Resize,this.handleCancel),this.windowListeners.add($o.DragStart,jo),this.windowListeners.add($o.VisibilityChange,this.handleCancel),this.windowListeners.add($o.ContextMenu,jo),this.documentListeners.add($o.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ko(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Yo(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add($o.Click,_o,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($o.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:l,options:{activationConstraint:i}}=r;if(!o)return;const a=null!=(t=_n(e))?t:io,s=Un(o,a);if(!n&&i){if(Yo(i)){if(null!=i.tolerance&&Wo(s,i.tolerance))return this.handleCancel();if(Wo(s,i.distance))return this.handleStart()}return Ko(i)&&Wo(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Uo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Qo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class er extends Jo{constructor(e){const{event:t}=e,n=Fn(t.target);super(e,Qo,n)}}er.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const tr={move:{name:"mousemove"},end:{name:"mouseup"}};var nr;!function(e){e[e.RightClick=2]="RightClick"}(nr||(nr={}));class or extends Jo{constructor(e){super(e,tr,Fn(e.event.target))}}or.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==nr.RightClick&&(null==o||o({event:n}),!0)}}];const rr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class lr extends Jo{constructor(e){super(e,rr)}static setup(){return window.addEventListener(rr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(rr.move.name,e)};function e(){}}}var ir,ar;function sr(e){let{acceleration:t,activator:n=ir.Pointer,canScroll:o,draggingRect:r,enabled:l,interval:i=5,order:a=ar.TreeOrder,pointerCoordinates:s,scrollableAncestors:d,scrollableAncestorRects:c,delta:u,threshold:g}=e;const h=function(e){let{delta:t,disabled:n}=e;const o=Bn(t);return Ln(e=>{if(n||!o||!e)return dr;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Eo.Backward]:e.x[Eo.Backward]||-1===r.x,[Eo.Forward]:e.x[Eo.Forward]||1===r.x},y:{[Eo.Backward]:e.y[Eo.Backward]||-1===r.y,[Eo.Forward]:e.y[Eo.Forward]||1===r.y}}},[n,t,o])}({delta:u,disabled:!l}),[m,p]=function(){const e=re(null);return[ae((t,n)=>{e.current=setInterval(t,n)},[]),ae(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),f=re({x:0,y:0}),v=re({x:0,y:0}),w=te(()=>{switch(n){case ir.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case ir.DraggableRect:return r}},[n,r,s]),y=re(null),b=ae(()=>{const e=y.current;if(!e)return;const t=f.current.x*v.current.x,n=f.current.y*v.current.y;e.scrollBy(t,n)},[]),q=te(()=>a===ar.TreeOrder?[...d].reverse():d,[a,d]);le(()=>{if(l&&d.length&&w){for(const e of q){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=c[n];if(!r)continue;const{direction:l,speed:a}=No(e,r,w,t,g);for(const e of["x","y"])h[e][l[e]]||(a[e]=0,l[e]=0);if(a.x>0||a.y>0)return p(),y.current=e,m(b,i),f.current=a,void(v.current=l)}f.current={x:0,y:0},v.current={x:0,y:0},p()}else p()},[t,b,o,p,l,i,JSON.stringify(w),JSON.stringify(h),m,d,q,c,JSON.stringify(g)])}lr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ir||(ir={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ar||(ar={}));const dr={x:{[Eo.Backward]:!1,[Eo.Forward]:!1},y:{[Eo.Backward]:!1,[Eo.Forward]:!1}};var cr,ur;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(cr||(cr={})),function(e){e.Optimized="optimized"}(ur||(ur={}));const gr=new Map;function hr(e,t){return Ln(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function mr(e){let{callback:t,disabled:n}=e;const o=Nn(t),r=te(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return le(()=>()=>null==r?void 0:r.disconnect(),[r]),r}function pr(e){return new Ho(xo(e),e)}function fr(e,t,n){void 0===t&&(t=pr);const[o,r]=ne(null);function l(){r(o=>{if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const l=t(e);return JSON.stringify(o)===JSON.stringify(l)?o:l})}const i=function(e){let{callback:t,disabled:n}=e;const o=Nn(t),r=te(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return le(()=>()=>null==r?void 0:r.disconnect(),[r]),r}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){l();break}}}}),a=mr({callback:l});return In(()=>{l(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())},[e]),o}const vr=[];function wr(e,t){void 0===t&&(t=[]);const n=re(null);return le(()=>{n.current=null},t),le(()=>{const t=e!==io;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Un(e,n.current):io}function yr(e){return te(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const br=[];function qr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return En(t)?t:e}const Cr=[{sensor:er,options:{}},{sensor:Xo,options:{}}],xr={current:{}},Sr={draggable:{measure:So},droppable:{measure:So,strategy:cr.WhileDragging,frequency:ur.Optimized},dragOverlay:{measure:xo}};class kr extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Rr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ro},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sr,measureDroppableContainers:ro,windowRect:null,measuringScheduled:!1},Mr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ro,draggableNodes:new Map,over:null,measureDroppableContainers:ro},Tr=ge(Mr),Dr=ge(Rr);function Ar(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function Er(e,t){switch(t.type){case oo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case oo.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case oo.DragEnd:case oo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case oo.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new kr(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case oo.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const i=new kr(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case oo.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new kr(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function zr(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=he(Tr),l=Bn(o),i=Bn(null==n?void 0:n.id);return le(()=>{if(!t&&!o&&l&&null!=i){if(!jn(l))return;if(document.activeElement===l.target)return;const e=r.get(i);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Xn(e);if(t){t.focus();break}}})}},[o,t,r,i,l]),null}function Fr(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...o}),n):n}const Ir=ge({...io,scaleX:1,scaleY:1});var Nr;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Nr||(Nr={}));const Or=ee(function(e){var t,n,o,r;let{id:l,accessibility:i,autoScroll:a=!0,children:s,sensors:d=Cr,collisionDetection:c=vo,measuring:u,modifiers:g,...h}=e;const m=de(Er,void 0,Ar),[p,f]=m,[v,w]=function(){const[e]=ne(()=>new Set),t=ae(t=>(e.add(t),()=>e.delete(t)),[e]);return[ae(t=>{let{type:n,event:o}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)})},[e]),t]}(),[y,b]=ne(Nr.Uninitialized),q=y===Nr.Initialized,{draggable:{active:C,nodes:x,translate:S},droppable:{containers:k}}=p,R=null!=C?x.get(C):null,M=re({initial:null,translated:null}),T=te(()=>{var e;return null!=C?{id:C,data:null!=(e=null==R?void 0:R.data)?e:xr,rect:M}:null},[C,R]),D=re(null),[A,E]=ne(null),[z,F]=ne(null),I=On(h,Object.values(h)),N=Pn("DndDescribedBy",l),O=te(()=>k.getEnabled(),[k]),L=te(()=>({draggable:{...Sr.draggable,...null==V?void 0:V.draggable},droppable:{...Sr.droppable,...null==V?void 0:V.droppable},dragOverlay:{...Sr.dragOverlay,...null==V?void 0:V.dragOverlay}}),[null==(V=u)?void 0:V.draggable,null==V?void 0:V.droppable,null==V?void 0:V.dragOverlay]);var V;const{droppableRects:B,measureDroppableContainers:H,measuringScheduled:P}=function(e,t){let{dragging:n,dependencies:o,config:r}=t;const[l,i]=ne(null),{frequency:a,measure:s,strategy:d}=r,c=re(e),u=function(){switch(d){case cr.Always:return!1;case cr.BeforeDragging:return n;default:return!n}}(),g=On(u),h=ae(function(e){void 0===e&&(e=[]),g.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[g]),m=re(null),p=Ln(t=>{if(u&&!n)return gr;if(!t||t===gr||c.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new Ho(s(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,l,n,u,s]);return le(()=>{c.current=e},[e]),le(()=>{u||h()},[n,u]),le(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),le(()=>{u||"number"!=typeof a||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},a))},[a,u,h,...o]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:null!=l}}(O,{dragging:q,dependencies:[S.x,S.y],config:L.droppable}),W=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return Ln(e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null},[o,t])}(x,C),$=te(()=>z?_n(z):null,[z]),U=function(){const e=!1===(null==A?void 0:A.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=q&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),j=function(e,t){return hr(e,t)}(W,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const l=re(!1),{x:i,y:a}="boolean"==typeof r?{x:r,y:r}:r;In(()=>{if(!i&&!a||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=wo(n(e),o);if(i||(r.x=0),a||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ro(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,i,a,o,n])}({activeNode:null!=C?x.get(C):null,config:U.layoutShiftCompensation,initialRect:j,measure:L.draggable.measure});const _=fr(W,L.draggable.measure,j),G=fr(W?W.parentElement:null),Z=re({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=k.getNodeFor(null==(t=Z.current.over)?void 0:t.id),Y=function(e){let{measure:t}=e;const[n,o]=ne(null),r=mr({callback:ae(e=>{for(const{target:n}of e)if(En(n)){o(e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o});break}},[t])}),l=ae(e=>{const n=qr(e);null==r||r.disconnect(),n&&(null==r||r.observe(n)),o(n?t(n):null)},[t,r]),[i,a]=Vn(l);return te(()=>({nodeRef:i,rect:n,setRef:a}),[n,i,a])}({measure:L.dragOverlay.measure}),K=null!=(n=Y.nodeRef.current)?n:W,J=q?null!=(o=Y.rect)?o:_:null,ee=Boolean(Y.nodeRef.current&&Y.rect),oe=wo(ie=ee?null:_,hr(ie));var ie;const se=yr(K?Dn(K):null),ce=function(e){const t=re(e),n=Ln(n=>e?n&&n!==vr&&e&&t.current&&e.parentNode===t.current.parentNode?n:ko(e):vr,[e]);return le(()=>{t.current=e},[e]),n}(q?null!=X?X:W:null),ue=function(e,t){void 0===t&&(t=xo);const[n]=e,o=yr(n?Dn(n):null),[r,l]=ne(br);function i(){l(()=>e.length?e.map(e=>zo(e)?o:new Ho(t(e),e)):br)}const a=mr({callback:i});return In(()=>{null==a||a.disconnect(),i(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),r}(ce),ge=Fr(g,{transform:{x:S.x-oe.x,y:S.y-oe.y,scaleX:1,scaleY:1},activatorEvent:z,active:T,activeNodeRect:_,containerNodeRect:G,draggingNodeRect:J,over:Z.current.over,overlayNodeRect:Y.rect,scrollableAncestors:ce,scrollableAncestorRects:ue,windowRect:se}),he=$?$n($,S):null,me=function(e){const[t,n]=ne(null),o=re(e),r=ae(e=>{const t=Mo(e.target);t&&n(e=>e?(e.set(t,Ao(t)),new Map(e)):null)},[]);return le(()=>{const t=o.current;if(e!==t){l(t);const i=e.map(e=>{const t=Mo(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,Ao(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),o.current=e}return()=>{l(e),l(t)};function l(e){e.forEach(e=>{const t=Mo(e);null==t||t.removeEventListener("scroll",r)})}},[r,e]),te(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>$n(e,t),io):Lo(e):io,[e,t])}(ce),pe=wr(me),fe=wr(me,[_]),ve=$n(ge,pe),we=J?bo(J,ge):null,ye=T&&we?c({active:T,collisionRect:we,droppableRects:B,droppableContainers:O,pointerCoordinates:he}):null,be=ho(ye,"id"),[qe,Ce]=ne(null),xe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ee?ge:$n(ge,fe),null!=(r=null==qe?void 0:qe.rect)?r:null,_),Se=re(null),ke=ae((e,t)=>{let{sensor:n,options:o}=t;if(null==D.current)return;const r=x.get(D.current);if(!r)return;const l=e.nativeEvent,i=new n({active:D.current,activeNode:r,event:l,options:o,context:Z,onAbort(e){if(!x.get(e))return;const{onDragAbort:t}=I.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!x.get(e))return;const{onDragPending:r}=I.current,l={id:e,constraint:t,initialCoordinates:n,offset:o};null==r||r(l),v({type:"onDragPending",event:l})},onStart(e){const t=D.current;if(null==t)return;const n=x.get(t);if(!n)return;const{onDragStart:o}=I.current,r={activatorEvent:l,active:{id:t,data:n.data,rect:M}};Me(()=>{null==o||o(r),b(Nr.Initializing),f({type:oo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:r}),E(Se.current),F(l)})},onMove(e){f({type:oo.DragMove,coordinates:e})},onEnd:a(oo.DragEnd),onCancel:a(oo.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=Z.current;let i=null;if(t&&r){const{cancelDrop:a}=I.current;if(i={activatorEvent:l,active:t,collisions:n,delta:r,over:o},e===oo.DragEnd&&"function"==typeof a){await Promise.resolve(a(i))&&(e=oo.DragCancel)}}D.current=null,Me(()=>{f({type:e}),b(Nr.Uninitialized),Ce(null),E(null),F(null),Se.current=null;const t=e===oo.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=I.current[t];null==e||e(i),v({type:t,event:i})}})}}Se.current=i},[x]),Re=ae((e,t)=>(n,o)=>{const r=n.nativeEvent,l=x.get(o);if(null!==D.current||!l||r.dndKit||r.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},D.current=o,ke(n,t))},[x,ke]),Te=function(e,t){return te(()=>e.reduce((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,Re);!function(e){le(()=>{if(!Rn)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),In(()=>{_&&y===Nr.Initializing&&b(Nr.Initialized)},[_,y]),le(()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:o,over:r}=Z.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:ve.x,y:ve.y},over:r};Me(()=>{null==e||e(l),v({type:"onDragMove",event:l})})},[ve.x,ve.y]),le(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=Z.current;if(!e||null==D.current||!t||!r)return;const{onDragOver:l}=I.current,i=o.get(be),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:a};Me(()=>{Ce(a),null==l||l(s),v({type:"onDragOver",event:s})})},[be]),In(()=>{Z.current={activatorEvent:z,active:T,activeNode:W,collisionRect:we,collisions:ye,droppableRects:B,draggableNodes:x,draggingNode:K,draggingNodeRect:J,droppableContainers:k,over:qe,scrollableAncestors:ce,scrollAdjustedTranslate:ve},M.current={initial:J,translated:we}},[T,W,ye,we,x,K,J,B,k,qe,ce,ve]),sr({...U,delta:S,draggingRect:we,pointerCoordinates:he,scrollableAncestors:ce,scrollableAncestorRects:ue});const De=te(()=>({active:T,activeNode:W,activeNodeRect:_,activatorEvent:z,collisions:ye,containerNodeRect:G,dragOverlay:Y,draggableNodes:x,droppableContainers:k,droppableRects:B,over:qe,measureDroppableContainers:H,scrollableAncestors:ce,scrollableAncestorRects:ue,measuringConfiguration:L,measuringScheduled:P,windowRect:se}),[T,W,_,z,ye,G,Y,x,k,B,qe,H,ce,ue,L,P,se]),Ae=te(()=>({activatorEvent:z,activators:Te,active:T,activeNodeRect:_,ariaDescribedById:{draggable:N},dispatch:f,draggableNodes:x,over:qe,measureDroppableContainers:H}),[z,Te,T,_,f,N,x,qe,H]);return Q.createElement(Qn.Provider,{value:w},Q.createElement(Tr.Provider,{value:Ae},Q.createElement(Dr.Provider,{value:De},Q.createElement(Ir.Provider,{value:xe},s)),Q.createElement(zr,{disabled:!1===(null==i?void 0:i.restoreFocus)})),Q.createElement(no,{...i,hiddenTextDescribedById:N}))}),Lr=ge(null),Vr="button";function Br(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const l=Pn("Draggable"),{activators:i,activatorEvent:a,active:s,activeNodeRect:d,ariaDescribedById:c,draggableNodes:u,over:g}=he(Tr),{role:h=Vr,roleDescription:m="draggable",tabIndex:p=0}=null!=r?r:{},f=(null==s?void 0:s.id)===t,v=he(f?Ir:Lr),[w,y]=Vn(),[b,q]=Vn(),C=function(e,t){return te(()=>e.reduce((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e},{}),[e,t])}(i,t),x=On(n);In(()=>(u.set(t,{id:t,key:l,node:w,activatorNode:b,data:x}),()=>{const e=u.get(t);e&&e.key===l&&u.delete(t)}),[u,t]);return{active:s,activatorEvent:a,activeNodeRect:d,attributes:te(()=>({role:h,tabIndex:p,"aria-disabled":o,"aria-pressed":!(!f||h!==Vr)||void 0,"aria-roledescription":m,"aria-describedby":c.draggable}),[o,h,p,f,m,c.draggable]),isDragging:f,listeners:o?void 0:C,node:w,over:g,setNodeRef:y,setActivatorNodeRef:q,transform:v}}function Hr(){return he(Dr)}const Pr={timeout:25};function Wr(e){let{animation:t,children:n}=e;const[o,r]=ne(null),[l,i]=ne(null),a=Bn(n);return n||o||!a||r(a),In(()=>{if(!l)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,l)).then(()=>{r(null)}):r(null)},[t,o,l]),Q.createElement(Q.Fragment,null,n,o?me(o,{ref:i}):null)}const $r={x:0,y:0,scaleX:1,scaleY:1};function Ur(e){let{children:t}=e;return Q.createElement(Tr.Provider,{value:Mr},Q.createElement(Ir.Provider,{value:$r},t))}const jr={position:"fixed",touchAction:"none"},_r=e=>jn(e)?"transform 250ms ease":void 0,Gr=oe((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:l,className:i,rect:a,style:s,transform:d,transition:c=_r}=e;if(!a)return null;const u=r?d:{...d,scaleX:1,scaleY:1},g={...jr,width:a.width,height:a.height,top:a.top,left:a.left,transform:Gn.Transform.toString(u),transformOrigin:r&&o?so(o,a):void 0,transition:"function"==typeof c?c(o):c,...s};return Q.createElement(n,{className:i,style:g,ref:t},l)}),Zr=e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:l,className:i}=e;if(null!=l&&l.active)for(const[e,t]of Object.entries(l.active))void 0!==t&&(r[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=l&&l.dragOverlay)for(const[e,t]of Object.entries(l.dragOverlay))void 0!==t&&o.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&o.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(r))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},Xr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Gn.Transform.toString(t)},{transform:Gn.Transform.toString(n)}]},sideEffects:Zr({styles:{active:{opacity:"0"}}})};function Yr(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:r}=e;return Nn((e,l)=>{if(null===t)return;const i=n.get(e);if(!i)return;const a=i.node.current;if(!a)return;const s=qr(l);if(!s)return;const{transform:d}=Dn(l).getComputedStyle(l),c=qo(d);if(!c)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:o,keyframes:r}={...Xr,...e};return e=>{let{active:l,dragOverlay:i,transform:a,...s}=e;if(!t)return;const d={x:i.rect.left-l.rect.left,y:i.rect.top-l.rect.top},c={scaleX:1!==a.scaleX?l.rect.width*a.scaleX/i.rect.width:1,scaleY:1!==a.scaleY?l.rect.height*a.scaleY/i.rect.height:1},u={x:a.x-d.x,y:a.y-d.y,...c},g=r({...s,active:l,dragOverlay:i,transform:{initial:a,final:u}}),[h]=g,m=g[g.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const p=null==o?void 0:o({active:l,dragOverlay:i,...s}),f=i.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{f.onfinish=()=>{null==p||p(),e()}})}}(t);return Vo(a,r.draggable.measure),u({active:{id:e,data:i.data,node:a,rect:r.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:l,rect:r.dragOverlay.measure(s)},droppableContainers:o,measuringConfiguration:r,transform:c})})}let Kr=0;function Jr(e){return te(()=>{if(null!=e)return Kr++,Kr},[e])}const Qr=Q.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:l,modifiers:i,wrapperElement:a="div",className:s,zIndex:d=999}=e;const{activatorEvent:c,active:u,activeNodeRect:g,containerNodeRect:h,draggableNodes:m,droppableContainers:p,dragOverlay:f,over:v,measuringConfiguration:w,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:q}=Hr(),C=he(Ir),x=Jr(null==u?void 0:u.id),S=Fr(i,{activatorEvent:c,active:u,activeNodeRect:g,containerNodeRect:h,draggingNodeRect:f.rect,over:v,overlayNodeRect:f.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:C,windowRect:q}),k=hr(g),R=Yr({config:o,draggableNodes:m,droppableContainers:p,measuringConfiguration:w}),M=k?f.setRef:void 0;return Q.createElement(Ur,null,Q.createElement(Wr,{animation:R},u&&x?Q.createElement(Gr,{key:x,id:u.id,ref:M,as:a,activatorEvent:c,adjustScale:t,className:s,transition:l,rect:k,style:{zIndex:d,...r},transform:S},n):null))});function el(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function tl(e,t){return e.reduce((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e},Array(e.length))}function nl(e){return null!==e&&e>=0}const ol={scaleX:1,scaleY:1},rl=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:l,index:i}=e;const a=null!=(t=n[r])?t:o;if(!a)return null;const s=function(e,t,n){const o=e[t],r=e[t-1],l=e[t+1];if(!o||!r&&!l)return 0;if(n<t)return r?o.left-(r.left+r.width):l.left-(o.left+o.width);return l?l.left-(o.left+o.width):o.left-(r.left+r.width)}(n,i,r);if(i===r){const e=n[l];return e?{x:r<l?e.left+e.width-(a.left+a.width):e.left-a.left,y:0,...ol}:null}return i>r&&i<=l?{x:-a.width-s,y:0,...ol}:i<r&&i>=l?{x:a.width+s,y:0,...ol}:{x:0,y:0,...ol}};const ll=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=el(t,o,n),i=t[r],a=l[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},il="Sortable",al=Q.createContext({activeIndex:-1,containerId:il,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ll,disabled:{draggable:!1,droppable:!1}});function sl(e){let{children:t,id:n,items:o,strategy:r=ll,disabled:l=!1}=e;const{active:i,dragOverlay:a,droppableRects:s,over:d,measureDroppableContainers:c}=Hr(),u=Pn(il,n),g=Boolean(null!==a.rect),h=te(()=>o.map(e=>"object"==typeof e&&"id"in e?e.id:e),[o]),m=null!=i,p=i?h.indexOf(i.id):-1,f=d?h.indexOf(d.id):-1,v=re(h),w=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(h,v.current),y=-1!==f&&-1===p||w,b=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(l);In(()=>{w&&m&&c(h)},[w,h,m,c]),le(()=>{v.current=h},[h]);const q=te(()=>({activeIndex:p,containerId:u,disabled:b,disableTransforms:y,items:h,overIndex:f,useDragOverlay:g,sortedRects:tl(h,s),strategy:r}),[p,u,b.draggable,b.droppable,y,h,f,s,g,r]);return Q.createElement(al.Provider,{value:q},t)}const dl=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return el(n,o,r).indexOf(t)},cl=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:l,newIndex:i,previousItems:a,previousContainerId:s,transition:d}=e;return!(!d||!o)&&((a===l||r!==i)&&(!!n||i!==r&&t===s))},ul={duration:200,easing:"ease"},gl="transform",hl=Gn.Transition.toString({property:gl,duration:0,easing:"linear"}),ml={roleDescription:"sortable"};function pl(e){let{animateLayoutChanges:t=cl,attributes:n,disabled:o,data:r,getNewIndex:l=dl,id:i,strategy:a,resizeObserverConfig:s,transition:d=ul}=e;const{items:c,containerId:u,activeIndex:g,disabled:h,disableTransforms:m,sortedRects:p,overIndex:f,useDragOverlay:v,strategy:w}=he(al),y=function(e,t){var n,o;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,h),b=c.indexOf(i),q=te(()=>({sortable:{containerId:u,index:b,items:c},...r}),[u,r,b,c]),C=te(()=>c.slice(c.indexOf(i)),[c,i]),{rect:x,node:S,isOver:k,setNodeRef:R}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const l=Pn("Droppable"),{active:i,dispatch:a,over:s,measureDroppableContainers:d}=he(Tr),c=re({disabled:n}),u=re(!1),g=re(null),h=re(null),{disabled:m,updateMeasurementsFor:p,timeout:f}={...Pr,...r},v=On(null!=p?p:o),w=mr({callback:ae(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),h.current=null},f)):u.current=!0},[f]),disabled:m||!i}),y=ae((e,t)=>{w&&(t&&(w.unobserve(t),u.current=!1),e&&w.observe(e))},[w]),[b,q]=Vn(y),C=On(t);return le(()=>{w&&b.current&&(w.disconnect(),u.current=!1,w.observe(b.current))},[b,w]),le(()=>(a({type:oo.RegisterDroppable,element:{id:o,key:l,disabled:n,node:b,rect:g,data:C}}),()=>a({type:oo.UnregisterDroppable,key:l,id:o})),[o]),le(()=>{n!==c.current.disabled&&(a({type:oo.SetDroppableDisabled,id:o,key:l,disabled:n}),c.current.disabled=n)},[o,l,n,a]),{active:i,rect:g,isOver:(null==s?void 0:s.id)===o,node:b,over:s,setNodeRef:q}}({id:i,data:q,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...s}}),{active:M,activatorEvent:T,activeNodeRect:D,attributes:A,setNodeRef:E,listeners:z,isDragging:F,over:I,setActivatorNodeRef:N,transform:O}=Br({id:i,data:q,attributes:{...ml,...n},disabled:y.draggable}),L=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return te(()=>e=>{t.forEach(t=>t(e))},t)}(R,E),V=Boolean(M),B=V&&!m&&nl(g)&&nl(f),H=!v&&F,P=H&&B?O:null,W=B?null!=P?P:(null!=a?a:w)({rects:p,activeNodeRect:D,activeIndex:g,overIndex:f,index:b}):null,$=nl(g)&&nl(f)?l({id:i,items:c,activeIndex:g,overIndex:f}):b,U=null==M?void 0:M.id,j=re({activeId:U,items:c,newIndex:$,containerId:u}),_=c!==j.current.items,G=t({active:M,containerId:u,isDragging:F,isSorting:V,id:i,index:b,items:c,newIndex:j.current.newIndex,previousItems:j.current.items,previousContainerId:j.current.containerId,transition:d,wasDragging:null!=j.current.activeId}),Z=function(e){let{disabled:t,index:n,node:o,rect:r}=e;const[l,i]=ne(null),a=re(n);return In(()=>{if(!t&&n!==a.current&&o.current){const e=r.current;if(e){const t=xo(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&i(n)}}n!==a.current&&(a.current=n)},[t,n,o,r]),le(()=>{l&&i(null)},[l]),l}({disabled:!G,index:b,node:S,rect:x});return le(()=>{V&&j.current.newIndex!==$&&(j.current.newIndex=$),u!==j.current.containerId&&(j.current.containerId=u),c!==j.current.items&&(j.current.items=c)},[V,$,u,c]),le(()=>{if(U===j.current.activeId)return;if(null!=U&&null==j.current.activeId)return void(j.current.activeId=U);const e=setTimeout(()=>{j.current.activeId=U},50);return()=>clearTimeout(e)},[U]),{active:M,activeIndex:g,attributes:A,data:q,rect:x,index:b,newIndex:$,items:c,isOver:k,isSorting:V,isDragging:F,listeners:z,node:S,overIndex:f,over:I,setNodeRef:L,setActivatorNodeRef:N,setDroppableNodeRef:R,setDraggableNodeRef:E,transform:null!=Z?Z:W,transition:function(){if(Z||_&&j.current.newIndex===b)return hl;if(H&&!jn(T)||!d)return;if(V||G)return Gn.Transition.toString({...d,property:gl});return}()}}function fl(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const vl=[Uo.Down,Uo.Right,Uo.Up,Uo.Left],wl=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:l,over:i,scrollableAncestors:a}}=t;if(vl.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];l.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const l=r.get(n.id);if(l)switch(e.code){case Uo.Down:o.top<l.top&&t.push(n);break;case Uo.Up:o.top>l.top&&t.push(n);break;case Uo.Left:o.left>l.left&&t.push(n);break;case Uo.Right:o.left<l.left&&t.push(n)}});const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=go(t),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=go(o),i=r.reduce((e,t,o)=>e+ao(n[o],t),0),a=Number((i/4).toFixed(4));l.push({id:t,data:{droppableContainer:e,value:a}})}}return l.sort(co)})({collisionRect:o,droppableRects:r,droppableContainers:t});let d=ho(s,"id");if(d===(null==i?void 0:i.id)&&s.length>1&&(d=s[1].id),null!=d){const e=l.get(n.id),t=l.get(d),i=t?r.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&i&&e&&t){const n=ko(s).some((e,t)=>a[t]!==e),r=yl(e,t),l=function(e,t){if(!fl(e)||!fl(t))return!1;if(!yl(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),d=n||!r?{x:0,y:0}:{x:l?o.width-i.width:0,y:l?o.height-i.height:0},c={x:i.left,y:i.top};return d.x&&d.y?c:Un(c,d)}}}};function yl(e,t){return!(!fl(e)||!fl(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const bl=e=>{let{transform:t}=e;return{...t,y:0}},ql=ee(oe((e,t)=>{const{children:n,style:o,className:r,index:l,editing:i,editable:a,selectedIndex:s,background:d,activeColor:c,borderColor:u,borderWidth:g,dragging:h,...m}=e;return G("div",{ref:t,className:st(r),style:{...o,display:"flex",flexDirection:"column",background:s===l?"white":d,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:s===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...m,children:[G("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[_("div",{style:{marginLeft:s===l?"0px":"-1px",marginTop:s===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,s===l?_("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):_(Z,{})]}),_("div",{style:{flex:"1 1 100%",background:s===l&&c?c?.toCSS():"none",minHeight:"2px"}})]})})),Cl={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"},xl=Q.memo(Q.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:l,height:i,index:a,listeners:s,onRemove:d,renderItem:c,sorting:u,style:g,transition:h,transform:m,value:p,wrapperStyle:f,...v},w)=>{le(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=c?c({dragOverlay:Boolean(t),dragging:Boolean(n),sorting:Boolean(u),index:a,fadeIn:Boolean(r),listeners:s,ref:w,style:g,transform:m,transition:h,value:p}):_(Z,{children:p});return _("div",{className:st("tab-item",Cl.Wrapper,r&&Cl.fadeIn,u&&Cl.sorting,t&&Cl.dragOverlay),style:{...f,transition:[h,f?.transition].filter(Boolean).join(", "),"--translate-x":m?`${Math.round(m.x)}px`:void 0,"--translate-y":m?`${Math.round(m.y)}px`:void 0,"--scale-x":m?.scaleX?`${m.scaleX}`:void 0,"--scale-y":m?.scaleY?`${m.scaleY}`:void 0,"--index":a},ref:w,children:_("div",{className:st(Cl.Item,n&&Cl.dragging,l&&Cl.withHandle,t&&Cl.dragOverlay,o&&Cl.disabled,e&&Cl.color,"dragging"),style:g,"data-cypress":"draggable-item",...l?void 0:s,...v,tabIndex:l?void 0:-1,children:y})})})),Sl={Row:"_Row_1kr10_1"},kl=ee(oe(({children:e,horizontal:t,style:n},o)=>_("div",{ref:o,style:{...n},className:st(Sl.Row,t&&Sl.horizontal),children:e}))),Rl={...Xr},Ml=ee(oe((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:l=!1,collisionDetection:i=po,coordinateGetter:a=wl,dropAnimation:s=Rl,getItemStyles:d=()=>({}),getNewIndex:c,handle:u=!1,items:g,onMove:h,isDisabled:m=()=>!1,measuring:p,modifiers:f,renderItem:v,renderDivider:w,reorderItems:y=el,strategy:b=ll,style:q,useDragOverlay:C=!0,onDragStart:x,wrapperStyle:S=()=>({})}=e,[k,R]=ne(()=>g);le(()=>{R(g)},[g]);const[M,T]=ne(null),D=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return te(()=>[...t].filter(e=>null!=e),[...t])}(lo(or,{activationConstraint:o}),lo(lr,{activationConstraint:o}),lo(Xo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:a})),A=k.indexOf.bind(k),E=M?A(M):-1,z=[];k.map((e,t)=>{z.push(_(Tl,{id:e,handle:u,index:t,style:d,wrapperStyle:S,disabled:m(e),renderItem:v,animateLayoutChanges:r,useDragOverlay:C,getNewIndex:c},e+"-"+t));const n=w?.({key:"divider-"+t});n&&z.push(n)});const{getPortalContainer:F}=P();return G(Or,{sensors:D,collisionDetection:i,onDragStart:e=>{const{active:t}=e;t&&(x?.(e),T(t.id))},autoScroll:{canScroll:e=>!0},onDragEnd:e=>{if(T(null),e.over){const t=A(e.over.id);E!==t&&(R(e=>y(e,E,t)),h?.(E,t))}},onDragCancel:()=>{T(null)},measuring:p,modifiers:f,children:[_("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...q},className:st(n,Cl.Wrapper),children:_(sl,{items:k,strategy:b,children:_(kl,{ref:t,children:z})})}),C?Te(_(Qr,{adjustScale:l,dropAnimation:s,children:M?_(xl,{value:k[E],handle:u,renderItem:v,wrapperStyle:S({index:E,isDragging:!0,id:k[E]}),index:E,dragging:!0,style:d({id:k[E],index:E,isSorting:null!==M,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),F()):null]})}));function Tl({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:l,onRemove:i,style:a,renderItem:s,useDragOverlay:d,wrapperStyle:c}){const{attributes:u,isDragging:g,isSorting:h,listeners:m,overIndex:p,setNodeRef:f,transform:v,transition:w}=pl({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return _(xl,{ref:f,value:r,disabled:e,dragging:g,sorting:h,handle:o,renderItem:s,index:l,style:a({index:l,id:r,isDragging:g,isSorting:h,overIndex:p}),onRemove:i?()=>i(r):void 0,transform:v,transition:w,wrapperStyle:c({index:l,isDragging:g,id:r}),listeners:m,"data-index":l,"data-id":r,dragOverlay:!d&&g,...u})}const Dl="_TabStrip_3x0dp_1",Al=new h("rgb(33, 115, 70)"),El="#eee",zl=e=>_(ql,{...e}),Fl=ee(oe((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:l=0,tabNames:i=[],onSelectedTabIndexChange:a,onTabNameChange:s,onTabMove:d,createScrollStartButton:c=W,createScrollEndButton:u=$,createScrollEdgeButton:g=U,createTabButton:h=zl,createTabDivider:m,editLabelProps:p,disabled:f=!1,disableDrag:v=!1,background:w="white",activeColor:y=Al,borderColor:b=El,borderWidth:q=1}=e,[C,x]=ne(l),[S,k]=ne(i),R=ae(e=>{const t=F.current?.[e]?.closest(".tab-item")??F.current?.[e];t&&P.current?.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:"smooth"})},[]);le(()=>{R(l)},[l]);const M=ae((e,t)=>{t!==C&&(x(t),a?.(t)),R(t)},[a,C]),T=ae((e,t)=>{d?.(e,t)},[d]),D=re(null),[A,E]=ne(-1),z=ae((e,t)=>{s?.(e,t)},[s]);ie(()=>{x(l)},[l]),ie(()=>{k(i)},[i]);const F=re([]),N=re(null);pe(t,()=>Object.assign({startEdit(e){F.current?.[e]?.startEdit()},cancel(e){F.current?.[e]?.cancel()}},N.current),[C,A]);const O=ae(({value:e,index:t,dragging:n})=>{const{style:o,maxLength:r,...l}=p||{},i=_(kn,{ref:e=>{F.current[t]=e},value:e,disabled:f,maxLength:r,style:{color:C===t&&y?y?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...o},styleHover:{},onSubmit:e=>(D.current=!1,E(-1),z(t,e)),onCancel:()=>{D.current=!1,E(-1)},onChange:e=>{D.current=!0,E(t)},...l});return h({onClick:e=>M(e,t),value:e,index:t,editing:A===t&&D.current,editable:!0,disabled:f,selectedIndex:C,background:w,activeColor:y,borderColor:b,borderWidth:q,dragging:n,children:i})},[C,z,M,p,f,A,h]),[L,{width:V}]=Ye(),[B,{width:H}]=Ye(),P=re(null),[X,Y]=ne({left:0,top:0,width:0,height:0}),[K,J]=ne(null);le(()=>{null!==K&&P.current&&P.current.scrollTo({left:K,behavior:"smooth"})},[K]);const Q=ae((e,t=!1)=>{if(!P.current)return 0;let n=P.current.firstChild.getBoundingClientRect(),o=P.current.firstChild.firstChild.children,r=0;return r=t?0:j.getScrollTo(e,n.left,o,!0,Math.max(0,e-200)),J(r),Math.max(0,r)},[]),ee=ae((e,t=!1)=>{if(!P.current)return 0;let n=P.current.firstChild.getBoundingClientRect(),o=P.current.firstChild.firstChild.children,r=0;const l=Math.ceil(H-V);return r=t?l:j.getScrollTo(e,n.left,o,!1,Math.max(0,e+200)),J(r),Math.min(l,r)},[H,V]),oe=re(null),se=re(null),de=ae(()=>{se.current&&(clearTimeout(se.current),se.current=null,oe.current=null)},[]),ce=ae((e,t,n=260)=>{oe.current=e,se.current=setTimeout(()=>{const n=t?Q(oe.current||e):ee(oe.current||e);n!==oe.current?ce(n,t,120):de()},n)},[Q,ee,de]);le(()=>()=>de(),[de]);const ue=te(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(X.left)<=0||0===Math.floor(H-V),orientation:I.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>ce(P.current.scrollLeft,!0),onClick:e=>Q(Math.min(P.current.scrollLeft,K??Number.MAX_SAFE_INTEGER),e.ctrlKey)}),[X,K,H,V]),ge=te(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(H-V)<=Math.ceil(X.left),orientation:I.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>ce(P.current.scrollLeft,!1),onClick:e=>ee(Math.max(P.current.scrollLeft,K??0),e.ctrlKey)}),[X,K,H,V]),he=te(()=>G(Z,{children:[_("div",{style:{minWidth:"16px"}}),n,g?.(ue)]}),[ue,ge,c,u,n,g]);return G("div",{style:{...o,display:"flex",alignItems:"stretch"},className:st(Dl,r),ref:N,children:[_("div",{style:{borderTop:`solid ${b} ${q}px`,position:"absolute",width:"100%"}}),_("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:he}),_("div",{className:"Tabs",ref:L,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:_("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:P,onScroll:e=>{Y({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:_(Ml,{isDisabled:e=>f||v,items:S,strategy:rl,modifiers:[bl],ref:B,renderItem:O,renderDivider:m,onMove:T,activationConstraint:{distance:15}})})}),_("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:g(ge)})]})}));Fl.displayName="TabStrip";const Il=e=>G("svg",{...e,viewBox:"0 0 48 48",children:[_("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"}),_("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"}),_("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"}),_("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"})]}),Nl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),_("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),_("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),_("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),_("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),_("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"})]}),Ol=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),_("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"})]}),Ll=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),_("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"})]}),Vl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),_("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"})]}),Bl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),Hl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),_("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"})]}),Pl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),Wl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),$l=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),Ul=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"}),_("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"})]}),jl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"}),_("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"})]}),_l=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),_("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),_("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),_("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),_("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),_("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"})]}),Gl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),_("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"})]}),Zl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),_("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"}),_("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),_("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"})]}),Xl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),_("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"}),_("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"})]}),Yl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),_("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"}),_("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"}),_("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),Kl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),_("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"}),_("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),_("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"})]}),Jl=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"})]}),Ql=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"})]}),ei=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),ti=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"}),_("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"})]}),ni=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("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"}),_("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"})]}),oi=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),_("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),_("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),_("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),_("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),_("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"})]}),ri=e=>G("svg",{viewBox:"0,0,2048,2048",...e,children:[_("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"}),_("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),_("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),_("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),_("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),_("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),_("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"})]}),li=ge(null),ii=e=>{const{themes:t,children:n}=e;return _(li.Provider,{value:t,children:n})},ai=()=>{const e=he(li),[t]=ne(()=>new b);return te(()=>e||t,[e])},si="_script-editor_iy654_5",di=Q.lazy(()=>import("./B4BYWB5Uu9K6VSTT.mjs")),ci={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:"\t})]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},ui=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString()),a=e.getPosition();let s={...a};s.lineNumber=1,s.column=1;let d=!1;for(let e=a.lineNumber;e>=1;e--){if(""===o.getLineContent(e).trim()){const t=mi(i,o.getOffsetAt({lineNumber:e,column:1}),"function");if(!t||pi(t)){d=!0,s.lineNumber=e+1;break}{const n=t.spans[0].start;e=o.getPositionAt(n).lineNumber,s.lineNumber=e}}}let c=n,u=!1;!d&&!c.startsWith("\n")&&s.lineNumber>1&&(c="\n"+c,u=!0);let g=!1;o.getLineCount()>1&&(c.endsWith("\n\n")||(c+="\n\n",g=!0));const h=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${c}`}];let m=null;o.pushEditOperations([],h,e=>(m=e[0].range,u&&m.startLineNumber++,g&&m.endLineNumber--,[new t.Selection(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)])),e.setSelection({startLineNumber:m.endLineNumber,startColumn:m.endColumn,endLineNumber:m.startLineNumber,endColumn:m.startColumn})};function gi(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function hi(e,t,n,o,r=[]){if("function"===o.kind&&"export"===o.kindModifiers){const t=o.spans[0].start,l=e.getPositionAt(t);r.push({name:o.text,type:gi(n,o),lineNumber:l.lineNumber})}if(o.childItems)for(const l of o.childItems)hi(e,t,n,l,r);return r}function mi(e,t,n="function",o){const r=e.spans;for(let l=0;l<r.length;l++){const i=r[l];if(i.start<=t&&t<i.start+i.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const r of e.childItems||[]){const e=mi(r,t,n,o);if(e)return e}}return null}}function pi(e){return"comment"===e.kind}const fi=ee(oe((e,t)=>{const{className:n,style:o,commands:r,readOnly:l=!1,onClose:i,darkMode:a,loadingPanel:s,autoFocus:d=!0,onStatusChange:c,...u}=e,g=re(null),h=x(i,[i]),m=re(!1),p=te(()=>({contains(e){if(!g.current)return;const t=g.current.editor;return t&&t.getDomNode()?.contains(e)},focus(){if(!g.current)return;const e=g.current.editor;return e&&e.getDomNode()?.focus()}}),[]),f=te(()=>[new R("help",p,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=te(()=>{let e=null;const t=()=>p;return e=r?r.createChildGroup(t,"scriptEditor",!1):new T(t,"scriptEditor"),e.addCommands(f,!0),e},[r,f]),w=F(v,["executeSelectedScript"])[0],y=w?.context(),b=x(e=>{w?.execute(e)},[w]),q=re(""),[S,k]=ne(!1),M=x(async()=>{if(!g.current)return null;const e=g.current,t=e.editor;if(!t)return null;const n=e.monaco,o=await(async(e,t,n="export")=>{const o=e.getModel();if(!o)return null;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString());let a=null,s=e.getSelection();const d=s.startLineNumber===s.endLineNumber&&s.startColumn===s.endColumn?o.getLineCount():Math.min(s.endLineNumber,o.getLineCount());for(let e=s.startLineNumber;!a&&e<=d;e++){const t=mi(i,o.getOffsetAt({lineNumber:e,column:1}),"function",n);t&&(a=t.text)}return a})(t,n);return c?.({message:(o??"").toUpperCase()}),o?{source:t.getValue(),name:o}:null},[c]);const D=x(async(e,t,n)=>{const o=await y.getScripts().createModule({source:n?.getValue(),declarationsOnly:!0}),r=o?o.getFunctions().search():X.EmptyArray;o&&(async function(e,t){const n=[];for(let o=1;o<e.getLineCount()+1;o++){const r={startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:e.getLineLength(o)+1},l=e.getValueInRange(r).indexOf("modelt");-1!==l&&n.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:t.MarkerSeverity.Hint,startLineNumber:r.startLineNumber,startColumn:l+1,endLineNumber:r.startLineNumber,endColumn:l+5})}t.editor.setModelMarkers(e,"owner",n)}(e,t),async function(e,t,n,o){const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(e.uri),i=await l.getNavigationTree(e.uri.toString()),a=hi(e,t,o,i).map(e=>{let n=null,o=null;return"formula"===e.type?(n="formula.margin-icon",o="Formula"):"macro"===e.type?(n="macro.margin-icon",o="Macro"):"autoRun"===e.type&&(n="autorun.margin-icon",o="Auto Run"),{range:new t.Range(e.lineNumber,1,e.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:n,glyphMarginHoverMessage:o,stickiness:t.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});I.current&&I.current.clear(),I.current=n.createDecorationsCollection(a)}(e,t,n,r))},[y]),A=x(X.debounce(D,580),[]),E=x(async(e=void 0)=>{if(!g.current||!y)return;const t=g.current.editor.getPosition(),n={cursor:t?t.toString():""};void 0!==e&&(n.message=e),c?.(n);const o=M();y.setSelectedFunction(o)},[y,c]);le(()=>{if(!y)return;const e={insertSnippet:e=>{g.current?.editor&&(S?ui(g.current.editor,g.current.monaco,e):q.current=e)}};y.setEditor(e),y.setSelectedFunction(M());const t=y.addContainerListener({onBeforeSave:async()=>{if(!g.current?.editor||!y)return;const e=g.current.editor,t=y?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue();if(!((n?.length??0)!==o.length||n!==o))return;await y.saveSource(e.getValue());const r=(n?.length??0)!==o.length||n!==o;c?.({dirty:r})},onReadonlyChange(){},onScriptChange:async()=>{if(!g.current?.editor||!y)return;const e=g.current.editor,t=y.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(t)}});return()=>{t(),y.setSelectedFunction(null),y.setEditor(null)}},[y,S]),le(()=>()=>{if(!g.current?.editor)return;const e=g.current.editor;y?.saveSource(e.getValue())},[]);const z=x(e=>{const t=g.current;if(!t)return!1;const n=t.editor;return!!n&&(n.focus(),!0)},[]),I=re(null),N=x((e,t)=>{g.current={monaco:t,editor:e},k(!0),E("Loading Types");const n=y.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(n),import("./BWXhJF6hNCn3u44J.mjs").then(e=>e.c).then(n=>{E("");n.AutoTypings.create(e,{shareCache:!0,monaco:t,onError:e=>{"Not implemented yet"===e&&(e="Compile Errors"),console.warn("Error compiling types",e)}}).then(async n=>{const o=e.getModel();A(o,t,e)})}),e.addCommand("executeScript",function(e,...t){t?.[0]&&b({functionName:t?.[0]})},""),e.addAction({id:"executeScript",label:"Execute",keybindings:[t.KeyCode.F8],run:async e=>{const t=M();y.setSelectedFunction(t);const n=await t;b(n)}}),e.addAction({id:"saveScript",label:"Save Script",keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.KeyS],run:t=>{y?.saveSource(e.getValue()).then(()=>{const t=y?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue(),r=(n?.length??0)!==o.length||n!==o;c?.({dirty:r})})}}),e.onMouseDown(async n=>{if(n.target.type===t.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const r=n.target.position.lineNumber,l=await t.languages.typescript.getTypeScriptWorker(),i=await l(o.uri),a=await i.getNavigationTree(o.uri.toString()),s=e?.getValue(),d=(await(y?.saveSource(s))).getFunctions().search(),c=hi(o,t,d,a).find(e=>e.lineNumber===r);if(c){const e=n.event.browserEvent.button;0===e?"macro"===c.type||"autoRun"===c.type?b({functionName:c.name}):"formula"===c.type&&y.quickInsertFunction?.(c.name):2===e&&(console.log("Context menu for function:",c.name),n.event.browserEvent.preventDefault())}}}),e.onDidChangeModelContent(()=>{const n=e.getModel();A(n,t,e)});const o=e.getModel();!function(e,t){t.languages.registerInlayHintsProvider("typescript",{provideInlayHints(e,n,o){const r=[];for(let n=1;n<e.getLineCount()+1;n++){const o={startLineNumber:n,startColumn:1,endLineNumber:n,endColumn:e.getLineLength(n)+1},l="hint",i=e.getValueInRange(o).indexOf("hint");-1!==i&&r.push({kind:t.languages.InlayHintKind.Type,position:{lineNumber:o.startLineNumber,column:i+l.length+1},label:"[hint]"})}return{hints:r,dispose:()=>{}}}})}(0,t),o.onDidChangeContent(t=>{const n=y?.getScripts().getModules().getByName("scripting"),o=n?.getSource(),r=e.getValue(),l=(o?.length??0)!==r.length||o!==r;c?.({dirty:l})}),e.onDidChangeCursorPosition(e=>{E()})},[y,c]),O=te(()=>S?null:s||_("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[S,s]),L=te(()=>{const e=y?.getScripts().getModules().getByName("scripting")?.getSource()??"";return G("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[_(ce,{children:_(di,{theme:a?"extended-dark":"extended",options:{...ci,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:e,onValidate:e=>{let t=!1;for(let n=0;!t&&n<e?.length;n++)8===e[n].severity&&(t=!0)},beforeMount:e=>{e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),e.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),e.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}});(async()=>{let t=!1;try{const n=await(async()=>{const e=await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts");return await e.text()})(),o=e.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),r=e.editor.createModel(n,"typescript",o);e.editor.setModelMarkers(r,"default",[]),t=!0}catch(e){console.warn("cant load types",e)}e.languages.registerLinkProvider("*",{provideLinks:(t,n)=>{const o=[],r={links:o},l=t.getLinesContent();for(let n=1;n<=l.length;n++){const r=l[n-1],i=e.editor.tokenize(r,"typescript");for(let l=0;l<i[0].length;l++){const a=i[0]?.[l];if(a&&a.type.startsWith("string")){let s=a.offset,d=i[0]?.[l+1]?.offset??r.length,c=new e.Range(n,s+1,n,d+1),u=t.getValueInRange(c);const g=u[0];"`"!==g&&"'"!==g&&'"'!==g||(s++,u=u.substring(1));const h=u[u.length-1];"`"!==h&&"'"!==h&&'"'!==h||(s++,u=u.substring(0,u.length-1));try{y.getRanges(u)&&o.push({range:{endColumn:d,endLineNumber:n,startColumn:s,startLineNumber:n},tooltip:`Goto range '${u}'`,url:`/range/${u}`})}catch(e){console.warn(e)}}}}return r}}),e.editor.registerLinkOpener({open(e){if(e?.path?.startsWith("/range/")){try{y.getRanges(e.path.substring(7))?.select()}catch(e){console.warn("invalid range",e)}return!0}return!1}});const n=e.languages.typescript.typescriptDefaults.getCompilerOptions();e.languages.typescript.typescriptDefaults.setCompilerOptions({...n,target:e.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),q.current&&(await ui(g.current.editor,g.current.monaco,q.current),q.current=null),m.current&&requestAnimationFrame(async()=>{m.current&&e.editor.focus()}),e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),k(!0)})()},onMount:N})}),O]})},[y,v,l,O,a]),V=C(t,()=>({isScriptEditorElement:()=>!0,focus:e=>{z(e)},close:()=>{h?.()},getEditor:()=>y?.getEditor()}),[y]);return le(()=>(d&&requestAnimationFrame(()=>{z()}),()=>{g.current?.editor&&requestAnimationFrame(()=>{V.current?.contains(document.activeElement)&&z()})}),[]),_("div",{className:st("script-editor",si,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:V,...u,children:L})}));export{Xl as ChartAreaIcon,Yl as ChartAreaStackedIcon,Kl as ChartAreaStackedPercentIcon,_l as ChartBarIcon,Gl as ChartBarStackedIcon,Zl as ChartBarStackedPercentIcon,ri as ChartBubble3DIcon,oi as ChartBubbleIcon,Nl as ChartColumnIcon,Ol as ChartColumnStackedIcon,Ll as ChartColumnStackedPercentIcon,Cn as ChartEditor,Vl as ChartLineIcon,Pl as ChartLineMarkersIcon,Bl as ChartLineStackedIcon,Wl as ChartLineStackedMarkersIcon,Hl as ChartLineStackedPercentIcon,$l as ChartLineStackedPercentMarkersIcon,jl as ChartPieDoughnutIcon,Ul as ChartPieIcon,ni as ChartScatterLinesIcon,ti as ChartScatterLinesMarkersIcon,Ql as ChartScatterLinesMarkersSmoothIcon,ei as ChartScatterLinesSmoothIcon,Jl as ChartScatterMarkersIcon,yn as CommandContext,Ie as CornerTriangle,Ae as DateUtils,li as DocThemesContext,ii as DocThemesProvider,kn as EditableLabel,rn as EmptyFrame,Ne as FilterButton,Fe as FontUtils,xl as Item,Il as LogoNoPaddingIcon,ut as LogoTextNoPaddingIcon,en as MovableArea,qn as PictureEditor,kl as Row,fi as ScriptEditor,He as SheetCellEditor,Oe as SheetCellRenderer,wn as SheetElement,Dt as SheetScrollbar,it as StaticBorderRenderer,We as StyledStrokePath,ql as Tab,Fl as TabStrip,Pe as createCellEditStateFromCell,et as useBordersOverlay,ai as useDocThemes,ht as useModelListener,on as useMovableCommands,mt as useRangeListener,ft as useSheetCommands,Ht as useSheetCopyPaste};