xiaodao-spreader 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ZH.md +14 -0
- package/README.md +14 -0
- package/dist/xiaodao-spreader.es.js +3233 -3222
- package/dist/xiaodao-spreader.umd.js +9 -9
- package/package.json +17 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(nn,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(nn=typeof globalThis<"u"?globalThis:nn||self,t(nn.XiaoDaoSpreader={},nn.Vue))})(this,function(nn,t){"use strict";const yr={"zh-CN":{insert:"插入",delete:"删除",rename:"重命名",moveLeft:"左移",moveRight:"右移",cut:"剪切",copy:"复制",paste:"粘贴",addSheet:"新建工作表",sheetList:"工作表列表",moveSheetLeft:"左移",moveSheetRight:"右移",scrollUp:"向上滚动",scrollDown:"向下滚动",scrollLeft:"向左滚动",scrollRight:"向右滚动",calculate:"计算",sum:"求和",avg:"平均值",count:"计数",undo:"撤销",redo:"重做",paintFormat:"格式刷",clearFormat:"清除格式",fontFamily:"字体",fontSize:"字号",fontSizeIncrease:"增大字号",fontSizeDecrease:"减小字号",bold:"加粗",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontColor:"文字颜色",fillColor:"填充颜色",borders:"边框",hAlign:"水平对齐",vAlign:"垂直对齐",alignLeft:"左端对齐",alignCenter:"居中对齐",alignRight:"右端对齐",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",wrap:"自动换行",mergeCells:"合并单元格",mergeCenter:"合并后居中",mergeAcross:"跨越合并",unmergeCells:"取消合并单元格",borderBottom:"下框线",borderTop:"上框线",borderLeft:"左框线",borderRight:"右框线",borderNone:"无框线",borderAll:"所有框线",borderOuter:"外框线",borderThickOuter:"粗外框线",fontDefault:"默认",rowHeight:"行高",colWidth:"列宽",autoRowHeight:"自动行高",defaultColWidth:"默认列宽",sort:"排序",sortAsc:"升序排序",sortDesc:"降序排序",sortReminderTitle:"排序提醒",sortReminderMessage:"选定区域的左侧或右侧还有相邻数据,这些数据未被选中,将不参与排序。是否将其一并纳入排序?",sortExpandSelection:"扩展选定区域",sortCurrentSelection:"仅对选定区域排序",insertFunctionTitle:"插入函数",insertFunctionSelectLabel:"函数",insertFunctionPlaceholder:"请选择函数",insertFunctionSearchPlaceholder:"搜索函数",insertFunctionFormulaLabel:"公式",insertFunctionBtn:"插入",fnDescSum:"计算单元格区域中所有数值的和",fnDescAverage:"计算单元格区域中数值的算术平均值",fnDescCount:"统计单元格区域中包含数值的单元格个数",fnDescIf:"根据指定条件判断真假,返回对应的两个值之一",fnDescVlookup:"在区域首列查找指定值,返回同一行中指定列的值",fnDescConcatenate:"将多个文本连接合并为一个文本",fnDescMax:"返回单元格区域中所有数值的最大值",fnDescMin:"返回单元格区域中所有数值的最小值",fnDescSin:"返回给定角度(弧度)的正弦值",fnDescSumif:"对区域中满足指定条件的单元格对应的数值求和",fnDescPmt:"计算基于固定利率及等额分期付款的贷款每期还款额",fnDescStdev:"估算基于样本的标准偏差(忽略文本与逻辑值)",ok:"确定",cancel:"取消",dimNumberError:"请输入数字",dimRangeError:"请输入 {min}~{max} 之间的数值",colorAutomatic:"自动",colorNoFill:"无填充",colorWhite:"白色",colorBlack:"黑色",colorLightGray:"浅灰",colorLightBlue:"浅蓝",colorLightOrange:"浅橙",colorLightYellow:"浅黄",colorLightGreen:"浅绿",colorPaleBlue:"淡蓝",colorPaleOrange:"淡橙",colorPaleYellow:"淡黄",colorPaleGreen:"淡绿",colorSilver:"银色",colorSkyBlue:"天蓝",colorCoral:"珊瑚",colorGold:"金色",colorMint:"薄荷",colorGray:"灰色",colorMediumBlue:"中蓝",colorOrange:"橙色",colorAmber:"琥珀",colorMediumGreen:"中绿",colorDarkGray:"深灰",colorRoyalBlue:"宝蓝",colorRed:"红色",colorDarkGold:"深金",colorDarkGreen:"深绿",colorCharcoal:"炭灰",colorDeepBlue:"深蓝",colorDarkRed:"深红",colorOlive:"橄榄",colorForest:"森林",colorSlate:"石板灰",colorNavy:"藏青",colorCrimson:"绯红",colorDarkOlive:"深橄榄",colorDeepForest:"深林",colorDarkSlate:"深石板灰",colorMidnight:"午夜蓝",colorMaroon:"栗色",colorCoffee:"咖啡色",colorEvergreen:"常青",colorDarkNavy:"深藏青",colorDarkMaroon:"深栗",colorDarkCoffee:"深咖",colorInkGreen:"墨绿",numberFormat:"数字格式",nfGeneral:"常规",nfText:"文本",nfNumber:"数字",nfPercent:"百分比",nfScientific:"科学计数法",nfAccounting:"会计专用",nfFinancial:"财务数值",nfCurrency:"货币",nfCurrencyRounded:"货币取整",nfDate:"日期",nfTime:"时间",nfDateTime:"日期和时间",nfDuration:"持续时间",nfCustom:"其他数字格式…",nfMixed:"混合",nfIncreaseDecimals:"增加小数位数",nfDecreaseDecimals:"减少小数位数",nfDialogTitle:"设置单元格格式",nfCategory:"分类",nfCatCustom:"自定义",nfDecimals:"小数位数",nfThousands:"使用千位分隔符",nfSymbol:"货币符号",nfDateFormat:"日期格式",nfTimeFormat:"时间格式",nfCustomCode:"自定义格式代码",nfPreview:"预览",nfPreviewSample:"示例",find:"查找",findReplace:"查找和替换",findPlaceholder:"查找内容",replacePlaceholder:"替换为",findPrev:"上一个",findNext:"下一个",replace:"替换",replaceAll:"全部替换",findScope:"范围",scopeSheet:"当前工作表",scopeWorkbook:"整个工作簿",scopeSelection:"当前选区",matchCase:"区分大小写",matchEntireCell:"完整匹配",findNoResult:"未找到",findNeedSelection:"请先选择范围",findReplacedAll:"已替换 {n} 处",findClose:"关闭",freezePane:"冻结窗格",freezePanes:"冻结窗格",freezeFirstRow:"冻结首行",freezeFirstCol:"冻结首列",unfreezePanes:"取消冻结",freezeToRow:"冻结至此行",freezeToCol:"冻结至此列",filter:"筛选",clearFilter:"清除筛选",cancelFilter:"取消",filterSearchPlaceholder:"搜索",filterSelectAll:"全选",filterClearAll:"清除全部",filterOk:"确定",filterBlank:"空白",filterNonBlank:"非空白",filterText:"文本筛选",filterNumber:"数字筛选",filterDate:"日期筛选",filterEquals:"等于",filterNotEquals:"不等于",filterContains:"包含",filterNotContains:"不包含",filterStartsWith:"开头是",filterEndsWith:"结尾是",filterGreaterThan:"大于",filterGreaterThanOrEqual:"大于等于",filterLessThan:"小于",filterLessThanOrEqual:"小于等于",filterBetween:"介于",filterAnd:"与",filterCustom:"自定义筛选",filterNoData:"无数据",filterFilteredCount:"共 {n} 项",filterActive:"筛选中",filterByValue:"按此值筛选",filterByThisColumn:"筛选此列"},"en-US":{insert:"Insert",delete:"Delete",rename:"Rename",moveLeft:"Move Left",moveRight:"Move Right",cut:"Cut",copy:"Copy",paste:"Paste",addSheet:"Add new sheet",sheetList:"Sheet list",moveSheetLeft:"Move Left",moveSheetRight:"Move Right",scrollUp:"Scroll up",scrollDown:"Scroll down",scrollLeft:"Scroll left",scrollRight:"Scroll right",calculate:"Calculate",sum:"Sum",avg:"Average",count:"Count",undo:"Undo",redo:"Redo",paintFormat:"Paint Format",clearFormat:"Clear Format",fontFamily:"Font Family",fontSize:"Font Size",fontSizeIncrease:"Increase Font Size",fontSizeDecrease:"Decrease Font Size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontColor:"Font Color",fillColor:"Fill Color",borders:"Borders",hAlign:"Horizontal Align",vAlign:"Vertical Align",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignTop:"Align Top",alignMiddle:"Align Middle",alignBottom:"Align Bottom",wrap:"Wrap Text",mergeCells:"Merge Cells",mergeCenter:"Merge & Center",mergeAcross:"Merge Across",unmergeCells:"Unmerge Cells",borderBottom:"Bottom Border",borderTop:"Top Border",borderLeft:"Left Border",borderRight:"Right Border",borderNone:"No Border",borderAll:"All Borders",borderOuter:"Outside Borders",borderThickOuter:"Thick Box Border",fontDefault:"Default",rowHeight:"Row Height",colWidth:"Column Width",autoRowHeight:"Auto Row Height",defaultColWidth:"Default Column Width",sort:"Sort",sortAsc:"Sort Ascending",sortDesc:"Sort Descending",sortReminderTitle:"Sort Warning",sortReminderMessage:"There is adjacent data to the left or right of your selection. It is not selected and will not be sorted. Include it in the sort?",sortExpandSelection:"Expand the selection",sortCurrentSelection:"Sort the current selection only",insertFunctionTitle:"Insert Function",insertFunctionSelectLabel:"Function",insertFunctionPlaceholder:"Select a function",insertFunctionSearchPlaceholder:"Search a function",insertFunctionFormulaLabel:"Formula",insertFunctionBtn:"Insert",fnDescSum:"Adds all the numbers in a range of cells",fnDescAverage:"Returns the arithmetic mean of the numbers in a range",fnDescCount:"Counts the cells that contain numbers in a range",fnDescIf:"Checks a condition and returns one of two values",fnDescVlookup:"Looks up a value in the first column of a range and returns a value in the same row",fnDescConcatenate:"Joins several text strings into one text string",fnDescMax:"Returns the largest numeric value in a range of cells",fnDescMin:"Returns the smallest numeric value in a range of cells",fnDescSin:"Returns the sine of a given angle (in radians)",fnDescSumif:"Sums the values in a range that meet a specified condition",fnDescPmt:"Calculates the periodic payment for a loan with constant payments and interest",fnDescStdev:"Estimates the sample standard deviation of a supplied set of values",ok:"OK",cancel:"Cancel",dimNumberError:"Please enter a number",dimRangeError:"Please enter a value between {min} and {max}",colorAutomatic:"Automatic",colorNoFill:"No Fill",colorWhite:"White",colorBlack:"Black",colorLightGray:"Light Gray",colorLightBlue:"Light Blue",colorLightOrange:"Light Orange",colorLightYellow:"Light Yellow",colorLightGreen:"Light Green",colorPaleBlue:"Pale Blue",colorPaleOrange:"Pale Orange",colorPaleYellow:"Pale Yellow",colorPaleGreen:"Pale Green",colorSilver:"Silver",colorSkyBlue:"Sky Blue",colorCoral:"Coral",colorGold:"Gold",colorMint:"Mint",colorGray:"Gray",colorMediumBlue:"Medium Blue",colorOrange:"Orange",colorAmber:"Amber",colorMediumGreen:"Medium Green",colorDarkGray:"Dark Gray",colorRoyalBlue:"Royal Blue",colorRed:"Red",colorDarkGold:"Dark Gold",colorDarkGreen:"Dark Green",colorCharcoal:"Charcoal",colorDeepBlue:"Deep Blue",colorDarkRed:"Dark Red",colorOlive:"Olive",colorForest:"Forest",colorSlate:"Slate",colorNavy:"Navy",colorCrimson:"Crimson",colorDarkOlive:"Dark Olive",colorDeepForest:"Deep Forest",colorDarkSlate:"Dark Slate",colorMidnight:"Midnight",colorMaroon:"Maroon",colorCoffee:"Coffee",colorEvergreen:"Evergreen",colorDarkNavy:"Dark Navy",colorDarkMaroon:"Dark Maroon",colorDarkCoffee:"Dark Coffee",colorInkGreen:"Ink Green",numberFormat:"Number Format",nfGeneral:"General",nfText:"Text",nfNumber:"Number",nfPercent:"Percentage",nfScientific:"Scientific",nfAccounting:"Accounting",nfFinancial:"Financial",nfCurrency:"Currency",nfCurrencyRounded:"Currency Rounded",nfDate:"Date",nfTime:"Time",nfDateTime:"Date & Time",nfDuration:"Duration",nfCustom:"Other Number Formats…",nfMixed:"Mixed",nfIncreaseDecimals:"Increase Decimal",nfDecreaseDecimals:"Decrease Decimal",nfDialogTitle:"Format Cells",nfCategory:"Category",nfCatCustom:"Custom",nfDecimals:"Decimal places",nfThousands:"Use 1000 separator",nfSymbol:"Currency symbol",nfDateFormat:"Date format",nfTimeFormat:"Time format",nfCustomCode:"Custom format code",nfPreview:"Preview",nfPreviewSample:"Sample",find:"Find",findReplace:"Find & Replace",findPlaceholder:"Find what",replacePlaceholder:"Replace with",findPrev:"Previous",findNext:"Next",replace:"Replace",replaceAll:"Replace All",findScope:"Scope",scopeSheet:"Current sheet",scopeWorkbook:"Entire workbook",scopeSelection:"Current selection",matchCase:"Match case",matchEntireCell:"Match entire cell",findNoResult:"No results",findNeedSelection:"Select a range first",findReplacedAll:"Replaced {n} occurrence(s)",findClose:"Close",freezePane:"Freeze Panes",freezePanes:"Freeze Panes",freezeFirstRow:"Freeze First Row",freezeFirstCol:"Freeze First Column",unfreezePanes:"Unfreeze Panes",freezeToRow:"Freeze to Row",freezeToCol:"Freeze to Column",filter:"Filter",clearFilter:"Clear Filter",cancelFilter:"Cancel",filterSearchPlaceholder:"Search",filterSelectAll:"Select All",filterClearAll:"Clear All",filterOk:"OK",filterBlank:"Blanks",filterNonBlank:"Non-blanks",filterText:"Text Filters",filterNumber:"Number Filters",filterDate:"Date Filters",filterEquals:"Equals",filterNotEquals:"Does Not Equal",filterContains:"Contains",filterNotContains:"Does Not Contain",filterStartsWith:"Begins With",filterEndsWith:"Ends With",filterGreaterThan:"Greater Than",filterGreaterThanOrEqual:"Greater Than Or Equal To",filterLessThan:"Less Than",filterLessThanOrEqual:"Less Than Or Equal To",filterBetween:"Between",filterAnd:"And",filterCustom:"Custom Filter",filterNoData:"No data",filterFilteredCount:"{n} items",filterActive:"Filtering",filterByValue:"Filter by This Value",filterByThisColumn:"Filter This Column"}};function N(e,l){var o;return((o=yr[e])==null?void 0:o[l])??l}const hn='-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif',Wl=10,br=[{label:"",value:""},{label:"微软雅黑",value:'"Microsoft YaHei", "微软雅黑", sans-serif'},{label:"宋体",value:'"SimSun", "宋体", serif'},{label:"黑体",value:'"SimHei", "黑体", sans-serif'},{label:"楷体",value:'"KaiTi", "楷体", serif'},{label:"Arial",value:"Arial, sans-serif"},{label:"Arial Black",value:'"Arial Black", sans-serif'},{label:"Times New Roman",value:'"Times New Roman", serif'},{label:"Courier New",value:'"Courier New", monospace'},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", sans-serif'},{label:"Comic Sans MS",value:'"Comic Sans MS", cursive'}],Cr=[{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"20",value:20},{label:"24",value:24},{label:"28",value:28},{label:"32",value:32},{label:"36",value:36},{label:"48",value:48},{label:"72",value:72}],wr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="19" y2="6"/><line x1="3" y1="12" x2="15" y2="12"/><line x1="3" y1="18" x2="17" y2="18"/></svg>',vr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="6" y1="12" x2="18" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>',kr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="6" x2="21" y2="6"/><line x1="9" y1="12" x2="21" y2="12"/><line x1="7" y1="18" x2="21" y2="18"/></svg>',Er='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="7" x2="6" y2="20"/><line x1="12" y1="7" x2="12" y2="16"/><line x1="18" y1="7" x2="18" y2="20"/><line x1="4" y1="3" x2="20" y2="3"/></svg>',Sr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="4" x2="6" y2="20"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="18" y1="4" x2="18" y2="20"/></svg>',Rr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="4" x2="6" y2="17"/><line x1="12" y1="8" x2="12" y2="17"/><line x1="18" y1="4" x2="18" y2="17"/><line x1="4" y1="21" x2="20" y2="21"/></svg>',Mr=[{value:"left",labelKey:"alignLeft",icon:wr},{value:"center",labelKey:"alignCenter",icon:vr},{value:"right",labelKey:"alignRight",icon:kr}],xr=[{value:"top",labelKey:"alignTop",icon:Er},{value:"middle",labelKey:"alignMiddle",icon:Sr},{value:"bottom",labelKey:"alignBottom",icon:Rr}],Eo=[{key:"mergeCenter",labelKey:"mergeCenter",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M709.952 465.92l88-76.032C801.92 385.984 806.656 384 812.032 384s10.048 1.984 14.08 5.952C830.08 393.92 832 398.656 832 403.968L832 448l32 0C881.664 448 896 462.336 896 480S881.664 512 864 512L832 512l0 44.032c0 5.376-1.92 10.112-5.952 14.08C822.08 574.08 817.344 576 812.032 576s-10.048-1.92-14.08-5.952L709.952 494.08C705.984 490.112 704 485.376 704 480S705.984 469.952 709.952 465.92zM378.048 465.92 290.048 389.952C286.08 385.984 281.344 384 275.968 384s-10.048 1.984-14.08 5.952C257.92 393.92 256 398.656 256 403.968L256 448 224 448C206.336 448 192 462.336 192 480S206.336 512 224 512L256 512l0 44.032c0 5.376 1.92 10.112 5.952 14.08C265.92 574.08 270.656 576 275.968 576s10.048-1.92 14.08-5.952L378.048 494.08C382.016 490.112 384 485.376 384 480S382.016 469.952 378.048 465.92zM448 128 128 128l0 704 320 0 0-128 64 0 0 128c0 35.392-28.608 64-64 64L128 896c-35.392 0-64-28.608-64-64L64 128c0-35.392 28.608-64 64-64l320 0 0 0c35.392 0 64 28.608 64 64l0 128L448 256 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128M722.304 642.304c0 8.512-3.52 16.32-10.496 23.36s-15.424 10.624-25.344 10.624c-5.76 0-10.688-1.088-14.72-3.136-4.096-2.048-7.616-4.928-10.432-8.512s-5.824-9.088-9.024-16.512-5.952-13.952-8.32-19.648l-17.28-46.016L479.36 582.464 462.08 629.568c-6.72 18.304-12.48 30.656-17.344 37.12s-12.544 9.6-23.424 9.6c-9.28 0-17.408-3.456-24.512-10.24s-10.624-14.592-10.624-23.232c0-4.992 0.896-10.176 2.496-15.488S393.024 614.592 396.8 605.056l92.672-238.016C492.096 360.256 495.296 352 499.008 342.464s7.68-17.536 11.904-23.872 9.664-11.456 16.576-15.36c6.784-3.968 15.232-5.888 25.344-5.888 10.176 0 18.752 1.92 25.472 5.888 6.848 3.968 12.352 8.96 16.64 15.104 4.096 6.208 7.744 12.8 10.624 19.904s6.528 16.576 11.008 28.352l94.656 236.48C718.592 621.056 722.304 634.112 722.304 642.304zM606.912 526.784 552.32 375.552 498.624 526.784 606.912 526.784z"/></svg>'},{key:"mergeAcross",labelKey:"mergeAcross",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M832 64c70.4 0 128 57.6 128 128v640c0 70.4-57.6 128-128 128H192c-70.4 0-128-57.6-128-128V192c0-70.4 57.6-128 128-128h640zM448 768H128v64c0 38.4 25.6 64 64 64h256v-128z m448 0H512v128h320c38.4 0 64-25.6 64-64v-64z m0-448H128v384h768V320zM633.6 390.4l96 96c6.4 6.4 6.4 12.8 6.4 19.2 0 6.4-6.4 12.8-6.4 19.2L633.6 633.6c-12.8 12.8-32 12.8-44.8 0-12.8-12.8-12.8-32-6.4-44.8l44.8-44.8H288c-19.2 0-32-12.8-32-32s12.8-32 32-32h339.2l-44.8-44.8c-6.4-12.8-6.4-32 0-44.8 12.8-12.8 38.4-12.8 51.2 0zM448 128H192c-38.4 0-64 25.6-64 64v64h320V128z m384 0H512v128h384V192c0-38.4-25.6-64-64-64z"/></svg>'},{key:"mergeCells",labelKey:"mergeCells",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M512 480c0 5.376-1.984 10.112-5.952 14.08L354.048 634.048C350.08 638.08 345.344 640 339.968 640s-10.048-1.92-14.08-5.952C321.92 630.144 320 625.344 320 620.032L320 512 224 512C206.336 512 192 497.664 192 480S206.336 448 224 448L320 448 320 339.968c0-5.376 1.92-10.048 5.952-14.08C329.92 321.984 334.656 320 339.968 320s10.048 1.984 14.08 5.952L506.048 465.92C510.016 469.952 512 474.624 512 480zM576 480c0 5.376 1.984 10.112 5.952 14.08l152 140.032C737.92 638.08 742.656 640 748.032 640s10.048-1.92 14.08-5.952C766.08 630.144 768 625.344 768 620.032L768 512l96 0C881.664 512 896 497.664 896 480S881.664 448 864 448L768 448 768 339.968c0-5.376-1.92-10.048-5.952-14.08C758.08 321.984 753.344 320 748.032 320s-10.048 1.984-14.08 5.952L581.952 465.92C577.984 469.952 576 474.624 576 480zM448 128l0 128 64 0L512 128c0-35.392-28.672-64-64-64l0 0L128 64C92.672 64 64 92.608 64 128l0 704c0 35.392 28.672 64 64 64l320 0c35.328 0 64-28.608 64-64l0-128L448 704l0 128L128 832 128 128 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128"/></svg>'},{key:"unmergeCells",labelKey:"unmergeCells",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M197.952 465.92l152-140.032C353.92 321.984 358.656 320 364.032 320s10.048 1.984 14.08 5.952C382.08 329.92 384 334.656 384 339.968L384 448l96 0C497.664 448 512 462.336 512 480S497.664 512 480 512L384 512l0 108.032c0 5.376-1.92 10.112-5.952 14.08C374.08 638.08 369.344 640 364.032 640S353.92 638.08 349.952 634.048L197.952 494.08C193.984 490.112 192 485.376 192 480S193.984 469.952 197.952 465.92zM890.048 465.92l-152-140.032C734.08 321.984 729.344 320 723.968 320s-10.048 1.984-14.08 5.952C705.92 329.92 704 334.656 704 339.968L704 448 608 448C590.336 448 576 462.336 576 480S590.336 512 608 512L704 512l0 108.032c0 5.376 1.92 10.112 5.952 14.08C713.92 638.08 718.656 640 723.968 640s10.048-1.92 14.08-5.952l152-140.032C894.016 490.112 896 485.376 896 480S894.016 469.952 890.048 465.92zM448 128l0 128 64 0L512 128c0-35.392-28.608-64-64-64l0 0L128 64C92.608 64 64 92.608 64 128l0 704c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64l0-128L448 704l0 128L128 832 128 128 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128"/></svg>'}],Br={bg:"#f4f4f4",gridBg:"#ffffff",headerBg:"#e8e8e8",headerBorder:"#c8c8c8",headerText:"#444",headerSep:"#b0b0b0",cornerBg:"#e0e0e0",gridLine:"#e0e0e0",selectionBg:"rgba(0, 120, 215, 0.12)",activeCellBorder:"#0078d7",cellText:"#1a1a1a",scrollTrack:"rgba(0,0,0,0.08)",scrollThumb:"rgba(0,0,0,0.25)",formulaBarBg:"#f0f0f0",formulaBarBorder:"#c8c8c8",formulaBarLabelText:"#333",formulaBarLabelBg:"#fff",formulaBarLabelBorder:"#c0c0c0",formulaBarInputBg:"#fff",formulaBarInputBorder:"#c0c0c0",formulaBarInputText:"#1a1a1a",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.3)",wrapperBg:"#e8e8e8",cellEditorBorder:"#0078d7",cellEditorText:"#1a1a1a",cellEditorBg:"#fff",cellEditorShadow:"#0078d7",tabBarBg:"#e8e8e8",tabBarBorder:"#c0c0c0",tabActiveBg:"#ffffff",tabActiveText:"#1a1a1a",tabActiveBorder:"#0078d7",tabInactiveBg:"#dfdfdf",tabInactiveText:"#666",tabInactiveBorder:"transparent",tabHoverBg:"#e0e0e0",tabAddBtnColor:"#555",tabAddBtnHoverBg:"#d0d0d0",tabScrollBtnColor:"#888",tabScrollBtnHoverBg:"#d0d0d0",scrollbarThumb:"rgba(0,0,0,0.25)",scrollbarThumbHover:"rgba(0,0,0,0.4)",scrollBtnBg:"#e8e8e8",scrollBtnColor:"#666",scrollBtnHoverBg:"#d0d0d0",scrollBtnActiveBg:"#c0c0c0",scrollTrackBg:"rgba(0,0,0,0.06)",toolbarBg:"#f7f7f7",toolbarBorder:"#d8d8d8",toolbarBtnColor:"#444",toolbarBtnHoverBg:"#e6e6e6",toolbarBtnDisabledColor:"#b0b0b0",toolbarBtnActiveColor:"#0078d7",findMatchBg:"rgba(255, 213, 79, 0.45)",findActiveBg:"rgba(255, 179, 0, 0.75)"},Tr={bg:"#1e1e1e",gridBg:"#252526",headerBg:"#252525",headerBorder:"#3e3e3e",headerText:"#999",headerSep:"#3e3e3e",cornerBg:"#2a2a2a",gridLine:"#3e3e3e",selectionBg:"rgba(0, 120, 215, 0.25)",activeCellBorder:"#0078d7",cellText:"#d4d4d4",scrollTrack:"rgba(255,255,255,0.06)",scrollThumb:"rgba(255,255,255,0.2)",formulaBarBg:"#2d2d2d",formulaBarBorder:"#3e3e3e",formulaBarLabelText:"#ccc",formulaBarLabelBg:"#3c3c3c",formulaBarLabelBorder:"#555",formulaBarInputBg:"#3c3c3c",formulaBarInputBorder:"#555",formulaBarInputText:"#d4d4d4",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.4)",wrapperBg:"#1e1e1e",cellEditorBorder:"#0078d7",cellEditorText:"#d4d4d4",cellEditorBg:"#3c3c3c",cellEditorShadow:"#0078d7",tabBarBg:"#2a2a2a",tabBarBorder:"#3e3e3e",tabActiveBg:"#1e1e1e",tabActiveText:"#e0e0e0",tabActiveBorder:"#0078d7",tabInactiveBg:"#333333",tabInactiveText:"#888",tabInactiveBorder:"transparent",tabHoverBg:"#3a3a3a",tabAddBtnColor:"#999",tabAddBtnHoverBg:"#3a3a3a",tabScrollBtnColor:"#777",tabScrollBtnHoverBg:"#3a3a3a",scrollbarThumb:"rgba(255,255,255,0.2)",scrollbarThumbHover:"rgba(255,255,255,0.35)",scrollBtnBg:"#2d2d2d",scrollBtnColor:"#999",scrollBtnHoverBg:"#3d3d3d",scrollBtnActiveBg:"#4d4d4d",scrollTrackBg:"rgba(255,255,255,0.05)",toolbarBg:"#2a2a2a",toolbarBorder:"#3e3e3e",toolbarBtnColor:"#ccc",toolbarBtnHoverBg:"#3a3a3a",toolbarBtnDisabledColor:"#666",toolbarBtnActiveColor:"#4ea1ff",findMatchBg:"rgba(255, 213, 79, 0.35)",findActiveBg:"rgba(255, 179, 0, 0.6)"},Pl="__nf_custom__",Bl="",Ul="",cl="@",Gn="__NF_INVALID__",oo=2958465,ro=0;function sl(e){return e==null||e===""?!0:e.toUpperCase()==="GENERAL"}function ao(e){return e==="zh-CN"?"¥":"$"}function Dr(e){return e.replace(/\*/g,"").replace(/_.|_\b/g,"")}function So(e){return e.replace(/"([^"]*)"/g,"$1")}function Nr(e){let l=e,o;const n=l.match(/^\[([^\]]+)\]/);n&&(o=n[1].toLowerCase(),l=l.slice(n[0].length)),l=Dr(l);const a=/E[+-]/i.test(l),i=l.includes("%"),r=l.search(/[0#?]/);if(r===-1)return{hasDigits:!1,decimals:0,minDecimals:0,minIntDigits:0,thousands:!1,scale:i?100:1,scientific:!1,prefix:l,suffix:"",color:o};let f=-1;for(let q=l.length-1;q>=0;q--){const se=l[q];if(se==="0"||se==="#"||se==="?"||se==="E"){f=q;break}}f<0&&(f=r);const m=r>0?l.slice(0,r):"",y=f<l.length-1?l.slice(f+1):"",k=l.slice(r,f+1),d=/[0#?]/.test(k),w=k.includes(",");let R=k.replace(/,/g,"");if(a){const q=R.search(/E/i);q>=0&&(R=R.slice(0,q))}const G=R.indexOf("."),te=G>=0?R.slice(0,G):R,Y=G>=0?R.slice(G+1):"",K=(Y.match(/[0#?]/g)||[]).length,C=(Y.match(/0/g)||[]).length,j=(te.match(/0/g)||[]).length;return{hasDigits:d,decimals:K,minDecimals:C,minIntDigits:j,thousands:w,scale:i?100:1,scientific:a,prefix:m,suffix:y,color:o}}function Fr(e){const l=[];let o=!1;const n=/\[h\]|\[mm\]|\[ss\]|yyyy|yy|y|mmmm|mmm|mm|m|dddd|ddd|dd|d|hh|h|ss|s|AM\/PM|am\/pm|"[^"]*"|\/|-|:|\s+|[^\s]/g;let a;for(;(a=n.exec(e))!==null;){const i=a[0];switch(i){case"[h]":o=!0,l.push({type:"hour",len:0});break;case"[mm]":o=!0,l.push({type:"minute",len:2});break;case"[ss]":o=!0,l.push({type:"second",len:2});break;case"yyyy":l.push({type:"year",len:4});break;case"yy":case"y":l.push({type:"year",len:2});break;case"mmmm":l.push(o?{type:"minute",len:4}:{type:"monthName",len:4});break;case"mmm":l.push(o?{type:"minute",len:3}:{type:"monthName",len:3});break;case"mm":l.push(o?{type:"minute",len:2}:{type:"month",len:2});break;case"m":l.push(o?{type:"minute",len:1}:{type:"month",len:1});break;case"dddd":l.push({type:"weekday",len:4});break;case"ddd":l.push({type:"weekday",len:3});break;case"dd":l.push({type:"day",len:2});break;case"d":l.push({type:"day",len:1});break;case"hh":l.push({type:"hour",len:2});break;case"h":l.push({type:"hour",len:1});break;case"ss":l.push({type:"second",len:2});break;case"s":l.push({type:"second",len:1});break;case"AM/PM":case"am/pm":l.push({type:"ampm",len:2});break;default:i.startsWith('"')?l.push({type:"literal",text:So(i),len:0}):l.push({type:"literal",text:i,len:0})}}return{tokens:l,isDuration:o}}const Ro=new Map;function Ir(e){const l=e.replace(/\[[^\]]*\]/gi,i=>/^\[(h|mm|ss)\]$/i.test(i)?i:"");if(/[ydhs]/.test(l)||/AM\/PM/i.test(l)||/\[h\]/i.test(l)){const i=e.split(";")[0]??e,{tokens:r,isDuration:f}=Fr(i);return{kind:f?"duration":"date",sections:[],tokens:r,isDuration:f,raw:e}}return{kind:"number",sections:e.split(";").map(i=>Nr(i)),tokens:[],isDuration:!1,raw:e}}function Kl(e){const l=Ro.get(e);if(l)return l;const o=Ir(e);return Ro.set(e,o),o}function Mo(e,l,o,n,a){const i=Math.pow(10,l),r=Math.round((e+Number.EPSILON)*i)/i,f=r<0,m=Math.abs(r);let k=new Intl.NumberFormat("en-US",{useGrouping:n,minimumIntegerDigits:a,minimumFractionDigits:l,maximumFractionDigits:l}).format(m);if(o<l&&l>0){const w=k.indexOf(".");if(w>=0){const v=k.substring(0,w);let R=k.substring(w+1);R=R.replace(/0+$/,""),R.length<o&&(R=R+"0".repeat(o-R.length)),k=R?`${v}.${R}`:v}}return`${f?"-":""}${k}`}function xo(e,l){if(e===0)return(l>0?"0."+"0".repeat(l):"0")+"E+00";const o=Math.floor(Math.log10(Math.abs(e))),n=e/Math.pow(10,o),a=Mo(n,l,l,!1,1),i=(o>=0?"+":"-")+String(Math.abs(o)).padStart(2,"0");return`${a}E${i}`}function Ar(e,l,o){if(!o.hasDigits)return So(o.prefix+o.suffix);const n=o.scale===100?e*100:e,a=o.scientific?xo(n,o.decimals):Mo(n,o.decimals,o.minDecimals,o.thousands,o.minIntDigits);return l+o.prefix+a+o.suffix}function Vr(e,l){const o=l.sections;if(o.length===0)return String(e);let n,a,i="";return e>0?(n=o[0],a=e):e<0?o[1]?(n=o[1],a=-e):(n=o[0],a=-e,i="-"):(n=o[2]??o[0],a=0),Ar(a,i,n)}function Hr(e){return new Date((e-25569)*864e5)}const Or=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],Lr=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],Bo=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],zr=["January","February","March","April","May","June","July","August","September","October","November","December"],_r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],To=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Bn(e,l){return String(e).padStart(l,"0")}function $r(e,l,o,n){const a=e.getUTCFullYear(),i=e.getUTCMonth()+1,r=e.getUTCDate(),f=e.getUTCDay(),m=o==="zh-CN";let y="",k=!1;for(const d of l)switch(d.type){case"literal":y+=d.text??"";break;case"year":y+=d.len>=4?String(a):String(a%100).padStart(2,"0");break;case"month":y+=Bn(k?e.getUTCMinutes():i,d.len);break;case"monthName":y+=d.len>=4?m?Or[i-1]:zr[i-1]:m?Lr[i-1]:_r[i-1];break;case"day":y+=Bn(r,d.len);break;case"weekday":y+=d.len>=4?m?Bo[f]:To[f]:m?Bo[f].slice(2):To[f].slice(0,3);break;case"hour":{let w=e.getUTCHours();if(d.len===0){const v=Math.floor(n*86400);w=Math.floor(v/3600)}y+=String(w),k=!0;break}case"minute":y+=Bn(e.getUTCMinutes(),d.len);break;case"second":y+=Bn(e.getUTCSeconds(),d.len);break;case"ampm":{const w=e.getUTCHours();y+=w<12?m?"上午":"AM":m?"下午":"PM";break}}return y}function Wr(e,l){const o=Math.floor(e*86400),n=Math.floor(o/3600),a=Math.floor(o%3600/60),i=o%60;let r="";for(const f of l)switch(f.type){case"literal":r+=f.text??"";break;case"hour":r+=String(n);break;case"minute":r+=Bn(a,f.len||2);break;case"second":r+=Bn(i,f.len||2);break;default:r+=""}return r}function Pr(e){if(e==="")return e;const l=Number(e);if(!isNaN(l)&&e.trim()!==""){const o=Math.abs(l);return o!==0&&(o>=1e15||o<1e-9)?xo(l,9):e}return e}function wl(e,l,o){if(sl(l))return Pr(e);if(l==null||l===cl)return e;const n=Kl(l);if(n.kind==="date"||n.kind==="duration"){const i=Number(e);if(!isFinite(i))return e;if(n.kind==="date"){if(i<ro||i>oo)return Gn}else if(i<0)return Gn;return n.kind==="duration"?Wr(i,n.tokens):$r(Hr(i),n.tokens,o,i)}const a=Number(e);return isNaN(a)?e:Vr(a,n)}const Ur=["general","text","number","percent","scientific","accounting","financial","currency","currencyRounded","date","time","dateTime","duration","custom"];function io(e,l){if(l===cl||l==="@")return!1;if(sl(l)){if(e==null||e===""||e.trim()==="")return!1;const n=Number(e);return!Number.isNaN(n)&&Number.isFinite(n)}const o=Kl(l);return!!(o.kind==="number"&&Do(o))}function Do(e){return e.sections.some(l=>l.hasDigits)}function No(e){if(e==null||sl(e)||e===cl||e==="@")return!1;const l=Kl(e);return!!(l.kind==="date"||l.kind==="duration"||l.kind==="number"&&Do(l))}function Fo(e,l){if(l==null||sl(l)||l===cl||l==="@")return!1;const o=Kl(l),n=Number(e);return Number.isFinite(n)?o.kind==="date"?n<ro||n>oo:o.kind==="duration"?n<0:!1:!1}const co=30,so=0;function Gl(e){if(e==null||e===""||e.trim()==="")return!1;const l=Number(e);return!Number.isNaN(l)&&Number.isFinite(l)}function Io(e,l){if(e==null||e===Bl||sl(e))return Gl(l);if(e===cl)return!1;const o=Kl(e);return o.kind==="date"||o.kind==="duration"?!1:o.sections.some(n=>n.hasDigits)}function Kr(e){if(!Gl(e))return 0;const l=String(Number(e));return l.indexOf(".")<0||/e/i.test(l)?0:l.slice(l.indexOf(".")+1).length}function Gr(e,l){if(!Io(e,l))return-1;if(e==null||e===Bl||sl(e))return Kr(l);const n=Kl(e).sections.find(a=>a.hasDigits);return n?n.decimals:-1}function Yr(e,l){let o=0;const n=/\[[^\]]*\]/g;let a;for(;(a=n.exec(e))!==null&&!/^\[(h|mm|ss)\]$/i.test(a[0]);)o=a.index+a[0].length;const i=e.slice(0,o),r=e.slice(o),f=r.search(/[0#?]/);if(f===-1)return e;let m=-1;for(let te=r.length-1;te>=0;te--){const Y=r[te];if(Y==="0"||Y==="#"||Y==="?"||Y==="E"){m=te;break}}if(m<f)return e;const y=r.slice(f,m+1),k=y.search(/E[+-]/i),d=k>=0?y.slice(0,k):y,w=d.indexOf("."),v=w>=0?(d.slice(w+1).match(/[0#?]/g)||[]).length:0;if(v===l)return e;let R;if(w<0)R=l>0?d+"."+"0".repeat(l):d;else if(l>v)R=d+"0".repeat(l-v);else{let te=v-l;const Y=d.split("");for(let K=Y.length-1;K>=0&&te>0;K--){const C=Y[K];(C==="0"||C==="#"||C==="?")&&(Y.splice(K,1),te--)}R=Y.join(""),l===0&&R.endsWith(".")&&(R=R.slice(0,-1))}const G=R+(k>=0?y.slice(k):"");return i+r.slice(0,f)+G+r.slice(m+1)}function Xr(e,l){if(!Number.isInteger(l)||l<so||l>co||e===Bl)return null;if(e==null||sl(e))return l>0?"0."+"0".repeat(l):"0";if(e===cl)return null;const o=Kl(e);return o.kind==="date"||o.kind==="duration"||!o.sections.some(n=>n.hasDigits)?null:e.split(";").map(n=>Yr(n,l)).join(";")}const uo=["¥","$","€","£"];function Ao(e,l){if(e==null||e===Bl)return e??Ul;if(sl(e))return Ul;if(e===cl||e==="@")return cl;const o=ao(l),n=l==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy",a=l==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss",i=`${o}#,##0.00;(${o}#,##0.00);${o}"-"`,r="#,##0.00;[Red](#,##0.00)";if(Vo(l).some(v=>v.value===e))return e;const m=e.replace(/\[[^\]]*\]/gi,v=>/^\[(h|mm|ss)\]$/i.test(v)?v:"");if(/\[(h|mm|ss)\]/i.test(m)&&!/[yd]/i.test(m))return"[h]:mm:ss";const y=/[yd]/i.test(m),k=/h|s|AM\/PM/i.test(m);if(y&&k)return a;if(y||/AM\/PM/i.test(m))return n;if(k)return"h:mm:ss";if(e.includes("%"))return"0.00%";if(/E[+-]/i.test(e))return"0.00E+00";if(e.includes("[Red]("))return r;const d=uo.find(v=>e.startsWith(v));if(d)return e.includes("(")?i:/\.\d/.test(e.slice(d.length))?o+"#,##0.00":o+"#,##0";const w=Kl(e);return w.kind==="number"&&w.sections.some(v=>v.hasDigits)?"#,##0.00":Pl}function jr(e,l){return new Date(Date.UTC(e,l,0)).getUTCDate()}function Zr(e,l,o){const n=Date.UTC(e,l-1,o)/864e5+25569;return n<=60?n-1:n}function Tn(e,l,o=new Date){const n=e.trim();if(!n||n.startsWith("=")||Gl(n))return null;const a=l==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy",i=l==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss",r="h:mm:ss";function f(w){const v=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(w);if(!v)return null;const R=Number(v[1]),G=Number(v[2]),te=v[3]!==void 0?Number(v[3]):0;return R>23||G>59||te>59?null:(R*3600+G*60+te)/86400}function m(w){let v=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/.exec(w),R,G,te;if(v)R=Number(v[1]),G=Number(v[2]),te=Number(v[3]);else if(v=/^(\d{4})年(\d{1,2})月(\d{1,2})日$/.exec(w))R=Number(v[1]),G=Number(v[2]),te=Number(v[3]);else if(v=/^(\d{1,2})[-/](\d{1,2})$/.exec(w))R=o.getUTCFullYear(),G=Number(v[1]),te=Number(v[2]);else return null;if(R<1900||R>9999||G<1||G>12||te<1||te>jr(R,G))return null;const Y=Zr(R,G,te);return Y>=ro&&Y<=oo?Y:null}const y=f(n);if(y!==null)return{serial:y,format:r};const k=/^(.+?)[T ](\d{1,2}:\d{1,2}(?::\d{1,2})?)$/.exec(n);if(k){const w=m(k[1].trim()),v=f(k[2]);if(w!==null&&v!==null)return{serial:w+v,format:i}}const d=m(n);return d!==null?{serial:d,format:a}:null}function qr(e,l){const o=e.trim();if(!o||o.startsWith("=")||!(o.includes(",")||o.includes("%")||uo.some(K=>o.startsWith(K)))||Tn(o,l))return null;const a=uo.find(K=>o.startsWith(K)),i=a?o.slice(a.length).trim():o;if(!i)return null;const r=/^([+-]?)(\d{1,3}(?:,\d{3})+)(?:\.(\d+))?(%?)$/.exec(i)||/^([+-]?)(\d+)(?:\.(\d+))?(%?)$/.exec(i);if(!r)return null;const f=r[1]==="-"?-1:1,m=r[2].replace(/,/g,""),y=r[3],k=(r[4]??"")==="%",d=y?y.length:0,w=+(m+(y?"."+y:""));if(!Number.isFinite(w))return null;const R=i.includes(",")?"#,##0":"0",G=d>0?"."+"0".repeat(d):"",te=(a??"")+R+G+(k?"%":"");let Y=w*f;return k&&(Y=Y/100),Y=Math.round(Y*1e12)/1e12,{num:Y,format:te}}function Jr(e,l,o,n){const a=ao(e),i=n?"#,##0":"0",r=o>0?"."+"0".repeat(o):"",f=i+r;switch(l){case"general":return"";case"text":return cl;case"custom":return"";case"number":return f;case"percent":return f+"%";case"scientific":return"0."+"0".repeat(o)+"E+00";case"currency":return a+f;case"currencyRounded":return a+(n?"#,##0":"0");case"accounting":return`${a}${f};(${a}${f});${a}"-"`;case"financial":return`${f};[Red](${f})`;case"date":return e==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy";case"time":return"h:mm:ss";case"dateTime":return e==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss";case"duration":return"[h]:mm:ss";default:return""}}function Vo(e){const l=ao(e);return[{label:N(e,"nfGeneral"),value:Ul},{label:N(e,"nfText"),value:cl},{label:N(e,"nfNumber"),value:"#,##0.00"},{label:N(e,"nfPercent"),value:"0.00%"},{label:N(e,"nfScientific"),value:"0.00E+00"},{label:N(e,"nfAccounting"),value:`${l}#,##0.00;(${l}#,##0.00);${l}"-"`},{label:N(e,"nfFinancial"),value:"#,##0.00;[Red](#,##0.00)"},{label:N(e,"nfCurrency"),value:l+"#,##0.00"},{label:N(e,"nfCurrencyRounded"),value:l+"#,##0"},{label:N(e,"nfDate"),value:e==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy"},{label:N(e,"nfTime"),value:"h:mm:ss"},{label:N(e,"nfDateTime"),value:e==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss"},{label:N(e,"nfDuration"),value:"[h]:mm:ss"},{label:N(e,"nfCustom"),value:Pl}]}const Qr=["title"],ea=["innerHTML"],ta={key:1,class:"sp-dropdown__value"},la=["disabled"],na=["placeholder"],oa=["onClick"],ra=["innerHTML"],aa={class:"sp-dropdown__item-label"},ia={key:2,class:"sp-dropdown__empty"},ca=["disabled"],sa=t.defineComponent({__name:"dropdown",props:{modelValue:{},options:{},width:{default:"auto"},menuWidth:{default:void 0},visibleCount:{default:8},title:{default:""},modelOpen:{type:Boolean,default:void 0},hideTrigger:{type:Boolean,default:!1},align:{default:"left"},triggerEl:{default:null},fallbackLabel:{default:""},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:""},triggerIcon:{default:""}},emits:["update:modelValue","change","update:modelOpen"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref(0),r=t.ref(null),f=t.ref(null),m=t.ref(null),y=t.ref({top:0,up:!1}),k=t.ref(void 0),d=t.ref(0),w=t.ref(!1),v=t.ref(""),R=t.ref(null),G=t.computed(()=>o.options.find(g=>String(g.value)===String(o.modelValue))),te=t.computed(()=>o.menuWidth!==void 0?o.menuWidth:k.value),Y=t.computed(()=>{if(!o.searchable||!v.value.trim())return o.options;const g=v.value.trim().toLowerCase();return o.options.filter(I=>String(I.label??"").toLowerCase().includes(g))}),K=t.computed(()=>Y.value.length>0),C=t.computed(()=>Math.min(o.visibleCount,Y.value.length)),j=t.computed(()=>Y.value.slice(i.value,i.value+C.value)),q=t.computed(()=>i.value>0),se=t.computed(()=>i.value+C.value<Y.value.length),Ne=t.computed(()=>Y.value.length>C.value);function Qe(g){i.value=Math.max(0,Math.min(Y.value.length-C.value,i.value+g))}function Ge(){a.value=!0,o.searchable&&(v.value=""),o.modelOpen!==void 0&&n("update:modelOpen",!0);const g=o.triggerEl??r.value;if(!g)return;const I=g.getBoundingClientRect();k.value=I.width;const L=C.value*22+(Ne.value?2*15:0)+8+(o.searchable?34:0),J=window.innerHeight-I.bottom-4<L&&I.top-4>L;o.align==="right"?y.value={right:window.innerWidth-I.right,top:J?I.top-L-4:I.bottom+4,up:J}:y.value={left:I.left,top:J?I.top-L-4:I.bottom+4,up:J};const ie=Y.value.findIndex(re=>String(re.value)===String(o.modelValue));i.value=ie>=0?Math.max(0,Math.min(ie-Math.floor(C.value/2),Y.value.length-C.value)):0,o.searchable&&t.nextTick(()=>{var re;return(re=R.value)==null?void 0:re.focus()})}function be(){a.value=!1,v.value="",o.modelOpen!==void 0&&n("update:modelOpen",!1)}function ve(){a.value?be():Ge()}function Xe(g){n("update:modelValue",g.value),n("change",g.value),be()}function Je(g){var L,$;if(!a.value)return;const I=g.target;(L=r.value)!=null&&L.contains(I)||($=m.value)!=null&&$.contains(I)||be()}function gt(g){a.value&&(g.preventDefault(),Qe(g.deltaY>0?1:-1))}t.watch(a,g=>{t.nextTick(()=>{var I,L;g?((I=f.value)==null||I.addEventListener("wheel",gt,{passive:!1}),document.addEventListener("keydown",Ze)):((L=f.value)==null||L.removeEventListener("wheel",gt),document.removeEventListener("keydown",Ze))})});function Ze(g){a.value&&g.key==="Escape"&&be()}t.watch(()=>o.modelOpen,g=>{g!==void 0&&g!==a.value&&(g?Ge():be())});function tt(g){a.value&&(d.value=g.touches[0].clientY,w.value=!0)}function et(g){if(!a.value||!w.value)return;const I=g.touches[0].clientY-d.value;Math.abs(I)>5&&(Qe(I<0?1:-1),d.value=g.touches[0].clientY)}function oe(){w.value=!1}function me(g){g.key==="Escape"&&(g.stopPropagation(),be())}return t.onMounted(()=>{document.addEventListener("pointerdown",Je),window.addEventListener("resize",be),window.addEventListener("scroll",be,!0)}),t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",Je),document.removeEventListener("keydown",Ze),window.removeEventListener("resize",be),window.removeEventListener("scroll",be,!0)}),(g,I)=>{var L,$,J;return t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"sp-dropdown",style:t.normalizeStyle(typeof e.width=="number"?{width:e.width+"px"}:{width:e.width})},[e.hideTrigger?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["sp-dropdown__trigger",{"sp-dropdown__trigger--open":a.value}]),title:e.title,onClick:ve},[(L=G.value)!=null&&L.icon||e.triggerIcon?(t.openBlock(),t.createElementBlock("span",{key:0,class:"sp-dropdown__icon",innerHTML:(($=G.value)==null?void 0:$.icon)||e.triggerIcon},null,8,ea)):(t.openBlock(),t.createElementBlock("span",ta,t.toDisplayString(((J=G.value)==null?void 0:J.label)??e.fallbackLabel),1)),I[5]||(I[5]=t.createElementVNode("svg",{class:"sp-dropdown__caret",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1))],10,Qr)),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:m,class:t.normalizeClass(["sp-dropdown__menu",{"sp-dropdown__menu--up":y.value.up}]),style:t.normalizeStyle({left:y.value.left!==void 0?y.value.left+"px":void 0,right:y.value.right!==void 0?y.value.right+"px":void 0,top:y.value.top+"px",minWidth:te.value!==void 0?typeof te.value=="number"?te.value+"px":te.value:void 0}),onKeydown:me,onMousedown:I[4]||(I[4]=t.withModifiers(()=>{},["prevent"]))},[Ne.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["sp-dropdown__nav",{"sp-dropdown__nav--disabled":!q.value}]),disabled:!q.value,onClick:I[0]||(I[0]=ie=>Qe(-1))},[...I[6]||(I[6]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z"})],-1)])],10,la)):t.createCommentVNode("",!0),e.searchable?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,ref_key:"searchInputRef",ref:R,"onUpdate:modelValue":I[1]||(I[1]=ie=>v.value=ie),class:"sp-dropdown__search",type:"text",placeholder:e.searchPlaceholder,onMousedown:I[2]||(I[2]=t.withModifiers(()=>{},["stop"]))},null,40,na)),[[t.vModelText,v.value]]):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"listRef",ref:f,class:"sp-dropdown__list",onTouchstart:tt,onTouchmove:et,onTouchend:oe},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.value,ie=>(t.openBlock(),t.createElementBlock("button",{key:String(ie.value),type:"button",class:t.normalizeClass(["sp-dropdown__item",{"sp-dropdown__item--active":String(ie.value)===String(e.modelValue)}]),onClick:re=>Xe(ie)},[ie.icon?(t.openBlock(),t.createElementBlock("span",{key:0,class:"sp-dropdown__item-icon",innerHTML:ie.icon},null,8,ra)):t.createCommentVNode("",!0),t.createElementVNode("span",aa,t.toDisplayString(ie.label),1)],10,oa))),128))],544),e.searchable&&!K.value?(t.openBlock(),t.createElementBlock("div",ia," 无匹配 ")):t.createCommentVNode("",!0),Ne.value?(t.openBlock(),t.createElementBlock("button",{key:3,type:"button",class:t.normalizeClass(["sp-dropdown__nav",{"sp-dropdown__nav--disabled":!se.value}]),disabled:!se.value,onClick:I[3]||(I[3]=ie=>Qe(1))},[...I[7]||(I[7]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],10,ca)):t.createCommentVNode("",!0)],38)):t.createCommentVNode("",!0)]),_:1})]))],4)}}}),Qt=(e,l)=>{const o=e.__vccOpts||e;for(const[n,a]of l)o[n]=a;return o},el=Qt(sa,[["__scopeId","data-v-804e629f"]]),ua=["title","onClick"],Ho=Qt(t.defineComponent({__name:"colorPicker",props:{modelOpen:{type:Boolean,default:void 0},colorKey:{default:"text"},currentColor:{default:""},locale:{default:"zh-CN"},triggerEl:{default:null}},emits:["update:modelValue","change","update:modelOpen"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[[{key:"colorAutomatic",value:""},{key:"colorLightBlue",value:"#DEEBF7"},{key:"colorLightOrange",value:"#FCE4D6"},{key:"colorLightYellow",value:"#FFE79A"},{key:"colorLightGreen",value:"#E2EFDA"}],[{key:"colorLightGray",value:"#F2F2F2"},{key:"colorPaleBlue",value:"#BDD7EE"},{key:"colorPaleOrange",value:"#F8CBAD"},{key:"colorPaleYellow",value:"#FFD966"},{key:"colorPaleGreen",value:"#C6EFCE"}],[{key:"colorSilver",value:"#D9D9D9"},{key:"colorSkyBlue",value:"#9BC2E6"},{key:"colorCoral",value:"#F4B183"},{key:"colorGold",value:"#FFC000"},{key:"colorMint",value:"#A9D18E"}],[{key:"colorGray",value:"#BFBFBF"},{key:"colorMediumBlue",value:"#6FA8DC"},{key:"colorOrange",value:"#ED7D31"},{key:"colorAmber",value:"#F1C232"},{key:"colorMediumGreen",value:"#70AD47"}],[{key:"colorDarkGray",value:"#A5A5A5"},{key:"colorRoyalBlue",value:"#4A86E8"},{key:"colorRed",value:"#E06666"},{key:"colorDarkGold",value:"#BF8F00"},{key:"colorDarkGreen",value:"#548235"}],[{key:"colorCharcoal",value:"#808080"},{key:"colorDeepBlue",value:"#2E75B6"},{key:"colorDarkRed",value:"#CC4125"},{key:"colorOlive",value:"#806000"},{key:"colorForest",value:"#375623"}],[{key:"colorSlate",value:"#595959"},{key:"colorNavy",value:"#1F4E79"},{key:"colorCrimson",value:"#993300"},{key:"colorDarkOlive",value:"#5C4500"},{key:"colorDeepForest",value:"#2D6A4F"}],[{key:"colorDarkSlate",value:"#404040"},{key:"colorMidnight",value:"#17375E"},{key:"colorMaroon",value:"#5A1E00"},{key:"colorCoffee",value:"#3D3000"},{key:"colorEvergreen",value:"#1B4332"}],[{key:"colorBlack",value:"#000000"},{key:"colorDarkNavy",value:"#0C2340"},{key:"colorDarkMaroon",value:"#2E0A00"},{key:"colorDarkCoffee",value:"#1F1800"},{key:"colorInkGreen",value:"#081C15"}]],r=[[{key:"colorNoFill",value:""},{key:"colorLightBlue",value:"#DEEBF7"},{key:"colorLightOrange",value:"#FCE4D6"},{key:"colorLightYellow",value:"#FFE79A"},{key:"colorLightGreen",value:"#E2EFDA"}],[{key:"colorWhite",value:"#FFFFFF"},{key:"colorPaleBlue",value:"#BDD7EE"},{key:"colorPaleOrange",value:"#F8CBAD"},{key:"colorPaleYellow",value:"#FFD966"},{key:"colorPaleGreen",value:"#C6EFCE"}],[{key:"colorLightGray",value:"#F2F2F2"},{key:"colorSkyBlue",value:"#9BC2E6"},{key:"colorCoral",value:"#F4B183"},{key:"colorGold",value:"#FFC000"},{key:"colorMint",value:"#A9D18E"}],[{key:"colorSilver",value:"#D9D9D9"},{key:"colorMediumBlue",value:"#6FA8DC"},{key:"colorOrange",value:"#ED7D31"},{key:"colorAmber",value:"#F1C232"},{key:"colorMediumGreen",value:"#70AD47"}],[{key:"colorGray",value:"#BFBFBF"},{key:"colorRoyalBlue",value:"#4A86E8"},{key:"colorRed",value:"#E06666"},{key:"colorDarkGold",value:"#BF8F00"},{key:"colorDarkGreen",value:"#548235"}],[{key:"colorDarkGray",value:"#A5A5A5"},{key:"colorDeepBlue",value:"#2E75B6"},{key:"colorDarkRed",value:"#CC4125"},{key:"colorOlive",value:"#806000"},{key:"colorForest",value:"#375623"}],[{key:"colorCharcoal",value:"#808080"},{key:"colorNavy",value:"#1F4E79"},{key:"colorCrimson",value:"#993300"},{key:"colorDarkOlive",value:"#5C4500"},{key:"colorDeepForest",value:"#2D6A4F"}],[{key:"colorSlate",value:"#595959"},{key:"colorMidnight",value:"#17375E"},{key:"colorMaroon",value:"#5A1E00"},{key:"colorCoffee",value:"#3D3000"},{key:"colorEvergreen",value:"#1B4332"}],[{key:"colorDarkSlate",value:"#404040"},{key:"colorDarkNavy",value:"#0C2340"},{key:"colorDarkMaroon",value:"#2E0A00"},{key:"colorDarkCoffee",value:"#1F1800"},{key:"colorInkGreen",value:"#081C15"}]],f=t.computed(()=>n.colorKey==="fill"?r:i);function m(K){return N(n.locale,K)}function y(K){const C=n.currentColor;return!C&&!K?!0:C?C.toLowerCase()===K.toLowerCase():!1}const k=t.ref(!1),d=t.ref(null),w=t.ref(null),v=t.ref({top:0});t.watch(()=>n.modelOpen,K=>{K!==void 0&&K!==k.value&&(K?G():te())});function R(K){const C=d.value,j=w.value,q=K.target;C&&C.contains(q)||j&&j.contains(q)||te()}function G(){k.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const K=n.triggerEl??d.value;if(K){const C=K.getBoundingClientRect(),j=150,q=120;let se=window.innerWidth-C.right,Ne=C.bottom+4,Qe;C.left-q<4&&(se=void 0,Qe=Math.max(4,C.left)),Ne+j>window.innerHeight-4&&(Ne=C.top-j-4),Ne<4&&(Ne=4),v.value=se!==void 0?{right:se,top:Ne}:{left:Qe,top:Ne}}document.addEventListener("pointerdown",R)})}function te(){k.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",R)}function Y(K){a("update:modelValue",K),a("change",K),te()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",R)}),l({open:k,openMenu:G,close:te}),(K,C)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:d,class:"color-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:w,class:"color-picker__menu",style:t.normalizeStyle({left:v.value.left!==void 0?v.value.left+"px":void 0,right:v.value.right!==void 0?v.value.right+"px":void 0,top:v.value.top+"px"}),onMousedown:C[0]||(C[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,(j,q)=>(t.openBlock(),t.createElementBlock("div",{key:q,class:"color-picker__row"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j,se=>(t.openBlock(),t.createElementBlock("button",{key:se.value,class:t.normalizeClass(["color-picker__swatch",{"color-picker__swatch--selected":y(se.value)}]),title:m(se.key),style:t.normalizeStyle({background:se.value||"transparent",border:se.value?"1px solid rgba(0,0,0,0.15)":"1px dashed #999"}),onClick:Ne=>Y(se.value)},null,14,ua))),128))]))),128))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-70f3dfdc"]]),da=["title","onClick"],fa={viewBox:"0 0 30 30",class:"border-picker__icon"},ma=["x1","y1","x2","y2","stroke-width","stroke-dasharray","stroke-linecap"],pa={class:"border-picker__label"},ha=Qt(t.defineComponent({__name:"borderPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},currentBorder:{default:"none"},triggerEl:{default:null}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[{key:"bottom",i18nKey:"borderBottom"},{key:"top",i18nKey:"borderTop"},{key:"left",i18nKey:"borderLeft"},{key:"right",i18nKey:"borderRight"},{key:"none",i18nKey:"borderNone"},{key:"all",i18nKey:"borderAll"},{key:"outer",i18nKey:"borderOuter"},{key:"thickOuter",i18nKey:"borderThickOuter"}],r=[{name:"top",x1:4,y1:4,x2:26,y2:4},{name:"bottom",x1:4,y1:26,x2:26,y2:26},{name:"left",x1:4,y1:4,x2:4,y2:26},{name:"right",x1:26,y1:4,x2:26,y2:26},{name:"vMid",x1:15,y1:4,x2:15,y2:26},{name:"hMid",x1:4,y1:15,x2:26,y2:15}],f={bottom:["bottom"],top:["top"],left:["left"],right:["right"],none:[],all:["top","bottom","left","right","vMid","hMid"],outer:["top","bottom","left","right"],thickOuter:["top","bottom","left","right"]},m={bottom:[],top:[],left:[],right:[],none:[],all:[],outer:[],thickOuter:["top","bottom","left","right"]};function y(K,C){return m[K].includes(C)?"thick":f[K].includes(C)?"solid":"dashed"}const k=t.ref(!1),d=t.ref(null),w=t.ref(null),v=t.ref({top:0});t.watch(()=>n.modelOpen,K=>{K!==void 0&&K!==k.value&&(K?G():te())});function R(K){const C=d.value,j=w.value,q=K.target;C&&C.contains(q)||j&&j.contains(q)||te()}function G(){k.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const K=n.triggerEl??d.value;if(K){const C=K.getBoundingClientRect(),j=200,q=160;let se=window.innerWidth-C.right,Ne=C.bottom+4,Qe;C.left-q<4&&(se=void 0,Qe=Math.max(4,C.left)),Ne+j>window.innerHeight-4&&(Ne=C.top-j-4),Ne<4&&(Ne=4),v.value=se!==void 0?{right:se,top:Ne}:{left:Qe,top:Ne}}document.addEventListener("pointerdown",R)})}function te(){k.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",R)}function Y(K){a("change",K),te()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",R)}),l({open:k,openMenu:G,close:te}),(K,C)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:d,class:"border-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:w,class:"border-picker__menu",style:t.normalizeStyle({left:v.value.left!==void 0?v.value.left+"px":void 0,right:v.value.right!==void 0?v.value.right+"px":void 0,top:v.value.top+"px"}),onMousedown:C[0]||(C[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,j=>t.createElementVNode("button",{key:j.key,class:"border-picker__item",title:t.unref(N)(e.locale,j.i18nKey),onClick:q=>Y(j.key)},[(t.openBlock(),t.createElementBlock("svg",fa,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,q=>t.createElementVNode("line",{key:q.name,x1:q.x1,y1:q.y1,x2:q.x2,y2:q.y2,stroke:"currentColor","stroke-width":y(j.key,q.name)==="thick"?3:1.5,"stroke-dasharray":y(j.key,q.name)==="dashed"?"0 4":"none","stroke-linecap":y(j.key,q.name)==="dashed"?"round":"square"},null,8,ma)),64))])),t.createElementVNode("span",pa,t.toDisplayString(t.unref(N)(e.locale,j.i18nKey)),1)],8,da)),64))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-551c0ffe"]]),ga=["title","onClick"],ya={viewBox:"0 0 1024 1024",class:"sort-picker__icon",fill:"none",stroke:"currentColor","stroke-width":"64","stroke-linecap":"round","stroke-linejoin":"round"},ba=["x1","y1","x2","y2"],Ca=["d"],wa={class:"sort-picker__label"},va=Qt(t.defineComponent({__name:"sortPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},currentSort:{default:"asc"},triggerEl:{default:null}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[{key:"asc",i18nKey:"sortAsc"},{key:"desc",i18nKey:"sortDesc"}],r=[{name:"bar1",x1:96,y1:224,x2:352,y2:224},{name:"bar2",x1:96,y1:512,x2:512,y2:512},{name:"bar3",x1:96,y1:800,x2:672,y2:800}],f={asc:"M832 800V288M672 448l160-160 160 160",desc:"M832 224v512M672 576l160 160 160-160"},m=t.ref(!1),y=t.ref(null),k=t.ref(null),d=t.ref({top:0});t.watch(()=>n.modelOpen,te=>{te!==void 0&&te!==m.value&&(te?v():R())});function w(te){const Y=y.value,K=k.value,C=te.target;Y&&Y.contains(C)||K&&K.contains(C)||R()}function v(){m.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const te=n.triggerEl??y.value;if(te){const Y=te.getBoundingClientRect(),K=84,C=160;let j=window.innerWidth-Y.right,q=Y.bottom+4,se;Y.left-C<4&&(j=void 0,se=Math.max(4,Y.left)),q+K>window.innerHeight-4&&(q=Y.top-K-4),q<4&&(q=4),d.value=j!==void 0?{right:j,top:q}:{left:se,top:q}}document.addEventListener("pointerdown",w)})}function R(){m.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",w)}function G(te){a("change",te),R()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",w)}),l({open:m,openMenu:v,close:R}),(te,Y)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:y,class:"sort-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[m.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:k,class:"sort-picker__menu",style:t.normalizeStyle({left:d.value.left!==void 0?d.value.left+"px":void 0,right:d.value.right!==void 0?d.value.right+"px":void 0,top:d.value.top+"px"}),onMousedown:Y[0]||(Y[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,K=>t.createElementVNode("button",{key:K.key,class:"sort-picker__item",title:t.unref(N)(e.locale,K.i18nKey),onClick:C=>G(K.key)},[(t.openBlock(),t.createElementBlock("svg",ya,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,C=>t.createElementVNode("line",{key:C.name,x1:C.x1,y1:C.y1,x2:C.x2,y2:C.y2},null,8,ba)),64)),t.createElementVNode("path",{d:f[K.key]},null,8,Ca)])),t.createElementVNode("span",wa,t.toDisplayString(t.unref(N)(e.locale,K.i18nKey)),1)],8,ga)),64))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-45929b74"]]),ka=["title","onClick"],Ea=["innerHTML"],Sa={class:"merge-picker__label"},Ra=Qt(t.defineComponent({__name:"mergePicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},triggerEl:{default:null}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=t.ref(!1),r=t.ref(null),f=t.ref(null),m=t.ref({top:0});t.watch(()=>n.modelOpen,v=>{v!==void 0&&v!==i.value&&(v?k():d())});function y(v){const R=r.value,G=f.value,te=v.target;R&&R.contains(te)||G&&G.contains(te)||d()}function k(){i.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const v=n.triggerEl??r.value;if(v){const R=v.getBoundingClientRect(),G=Eo.length*30+12,te=160;let Y=window.innerWidth-R.right,K=R.bottom+4,C;R.left-te<4&&(Y=void 0,C=Math.max(4,R.left)),K+G>window.innerHeight-4&&(K=R.top-G-4),K<4&&(K=4),m.value=Y!==void 0?{right:Y,top:K}:{left:C,top:K}}document.addEventListener("pointerdown",y)})}function d(){i.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",y)}function w(v){a("change",v),d()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",y)}),l({open:i,openMenu:k,close:d}),(v,R)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"merge-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[i.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:f,class:"merge-picker__menu",style:t.normalizeStyle({left:m.value.left!==void 0?m.value.left+"px":void 0,right:m.value.right!==void 0?m.value.right+"px":void 0,top:m.value.top+"px"}),onMousedown:R[0]||(R[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Eo),G=>(t.openBlock(),t.createElementBlock("button",{key:G.key,class:"merge-picker__item",title:t.unref(N)(e.locale,G.labelKey),onClick:te=>w(G.key)},[t.createElementVNode("span",{class:"merge-picker__icon",innerHTML:G.icon},null,8,Ea),t.createElementVNode("span",Sa,t.toDisplayString(t.unref(N)(e.locale,G.labelKey)),1)],8,ka))),128))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-edd36208"]]),Ma=["disabled","title","onClick"],xa={class:"calc-picker__label"},Ba=Qt(t.defineComponent({__name:"calcPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},triggerEl:{default:null},disabled:{type:Boolean,default:!1}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[{key:"sum",labelKey:"sum"},{key:"avg",labelKey:"avg"},{key:"count",labelKey:"count"}],r=t.ref(!1),f=t.ref(null),m=t.ref(null),y=t.ref({top:0});t.watch(()=>n.modelOpen,R=>{R!==void 0&&R!==r.value&&(R?d():w())});function k(R){const G=f.value,te=m.value,Y=R.target;G&&G.contains(Y)||te&&te.contains(Y)||w()}function d(){r.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const R=n.triggerEl??f.value;if(R){const G=R.getBoundingClientRect(),te=i.length*30+12,Y=160;let K=window.innerWidth-G.right,C=G.bottom+4,j;G.left-Y<4&&(K=void 0,j=Math.max(4,G.left)),C+te>window.innerHeight-4&&(C=G.top-te-4),C<4&&(C=4),y.value=K!==void 0?{right:K,top:C}:{left:j,top:C}}document.addEventListener("pointerdown",k)})}function w(){r.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",k)}function v(R){n.disabled||(a("change",R),w())}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",k)}),l({open:r,openMenu:d,close:w}),(R,G)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:f,class:"calc-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:m,class:"calc-picker__menu",style:t.normalizeStyle({left:y.value.left!==void 0?y.value.left+"px":void 0,right:y.value.right!==void 0?y.value.right+"px":void 0,top:y.value.top+"px"}),onMousedown:G[0]||(G[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,te=>t.createElementVNode("button",{key:te.key,class:t.normalizeClass(["calc-picker__item",{"calc-picker__item--disabled":e.disabled}]),disabled:e.disabled,title:t.unref(N)(e.locale,te.labelKey),onClick:Y=>v(te.key)},[t.createElementVNode("span",xa,t.toDisplayString(t.unref(N)(e.locale,te.labelKey)),1)],10,Ma)),64))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-01a18e00"]]),Ta={class:"tb-item","data-key":"undo"},Da=["title","disabled"],Na={class:"tb-item","data-key":"redo"},Fa=["title","disabled"],Ia={class:"tb-item","data-key":"paint"},Aa=["title","disabled"],Va={class:"tb-item","data-key":"clear"},Ha=["title","disabled"],Oa={class:"tb-item","data-key":"font"},La={class:"tb-item","data-key":"fontSize"},za={class:"toolbar-font-size"},_a=["value","title"],$a=["title"],Wa=["title","disabled"],Pa=["title","disabled"],Ua={class:"tb-item","data-key":"bold"},Ka=["title","disabled"],Ga={class:"tb-item","data-key":"italic"},Ya=["title","disabled"],Xa={class:"tb-item","data-key":"underline"},ja=["title","disabled"],Za={class:"tb-item","data-key":"strike"},qa=["title","disabled"],Ja={class:"tb-item","data-key":"textColor"},Qa={class:"toolbar-split"},ei=["title","disabled"],ti={viewBox:"0 0 1024 1024",fill:"currentColor"},li=["fill"],ni=["title","disabled"],oi={class:"tb-item","data-key":"fillColor"},ri={class:"toolbar-split"},ai=["title","disabled"],ii={viewBox:"0 0 1024 1024",fill:"currentColor"},ci=["fill"],si=["title","disabled"],ui={class:"tb-item","data-key":"border"},di={class:"toolbar-split"},fi=["title","disabled"],mi={viewBox:"0 0 30 30",fill:"none",stroke:"currentColor"},pi=["x1","y1","x2","y2","stroke-width","stroke-dasharray","stroke-linecap"],hi=["title","disabled"],gi={class:"tb-item","data-key":"hAlign"},yi={class:"tb-item","data-key":"vAlign"},bi={class:"tb-item","data-key":"wrap"},Ci=["title"],wi={class:"tb-item","data-key":"merge"},vi={class:"toolbar-split"},ki=["title","disabled"],Ei=["title","disabled"],Si={class:"tb-item","data-key":"numFmt"},Ri={class:"toolbar-number-format-group"},Mi=["title","disabled"],xi=["title","disabled"],Bi={class:"tb-item","data-key":"calc"},Ti={class:"toolbar-split"},Di=["title","disabled"],Ni=["title","disabled"],Fi={class:"tb-item","data-key":"sort"},Ii={class:"toolbar-split"},Ai=["title","disabled"],Vi={viewBox:"0 0 1024 1024",fill:"none",stroke:"currentColor","stroke-width":"64","stroke-linecap":"round","stroke-linejoin":"round"},Hi=["x1","y1","x2","y2"],Oi=["d"],Li=["title","disabled"],zi={class:"tb-item","data-key":"filter"},_i=["disabled","title"],$i={class:"tb-item","data-key":"freeze"},Wi={class:"tb-item","data-key":"find"},Pi=["title"],Oo='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M160 448 H864" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M448 160 V864" /><path d="M192 192 H416 V416 H192 Z" /></svg>',Ui='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M160 448 H864" /><path d="M192 192 H832 V416 H192 Z" /></svg>',Ki='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M448 160 V864" /><path d="M192 192 H416 V832 H192 Z" /></svg>',Gi='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M160 448 H864" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M448 160 V864" /><path fill="none" stroke="currentColor" stroke-width="48" stroke-linecap="round" d="M224 224 L416 416" /><path fill="none" stroke="currentColor" stroke-width="48" stroke-linecap="round" d="M416 224 L224 416" /></svg>',fo=2,Yi=6,Xi=34,ji=Qt(t.defineComponent({__name:"toolbar",props:{locale:{},canUndo:{type:Boolean},canRedo:{type:Boolean},paintFmtActive:{type:Boolean},hasSelection:{type:Boolean},fontFamilyOptions:{},fontSizeOptions:{},selFontFamily:{},selFontSize:{},fontSizeInput:{},fontSizeMenuOpen:{type:Boolean},selFontWeight:{type:Boolean},selFontStyle:{type:Boolean},selUnderline:{type:Boolean},selStrikethrough:{type:Boolean},selTextColor:{},textColorMenuOpen:{type:Boolean},selFillColor:{},fillColorMenuOpen:{type:Boolean},cachedTextColor:{},cachedFillColor:{},borderMenuOpen:{type:Boolean},cachedBorder:{},sortMenuOpen:{type:Boolean},cachedSortOrder:{},canSort:{type:Boolean},canFilter:{type:Boolean},filterActive:{type:Boolean},selHAlign:{},selVAlign:{},selWrap:{type:Boolean},hAlignOptions:{},vAlignOptions:{},mergeMenuOpen:{type:Boolean},calcMenuOpen:{type:Boolean},isSingleCell:{type:Boolean},hasFreeze:{type:Boolean},themeVars:{},selNumberFormat:{},nfOptions:{},canIncreaseDecimals:{type:Boolean},canDecreaseDecimals:{type:Boolean}},emits:["undo","redo","paint-format","clear-format","font-size-blur","font-size-toggle","font-size-step-up","font-size-step-down","bold-toggle","italic-toggle","underline-toggle","strikethrough-toggle","apply-text-color","apply-fill-color","apply-border","apply-sort","wrap-toggle","apply-merge","calc-sum","calc-avg","calc-count","find","increase-decimals","decrease-decimals","toggle-filter","font-family-change","font-size-change","h-align-change","v-align-change","font-size-input","text-color-change","fill-color-change","number-format-change","freeze-change","font-size-keydown","update:font-size-menu-open","update:text-color-menu-open","update:fill-color-menu-open","update:border-menu-open","update:sort-menu-open","update:merge-menu-open","update:calc-menu-open","border-change","sort-change","merge-change"],setup(e,{emit:l}){const o=[{name:"top",x1:4,y1:4,x2:26,y2:4},{name:"bottom",x1:4,y1:26,x2:26,y2:26},{name:"left",x1:4,y1:4,x2:4,y2:26},{name:"right",x1:26,y1:4,x2:26,y2:26},{name:"vMid",x1:15,y1:4,x2:15,y2:26},{name:"hMid",x1:4,y1:15,x2:26,y2:15}],n={bottom:["bottom"],top:["top"],left:["left"],right:["right"],none:[],all:["top","bottom","left","right","vMid","hMid"],outer:["top","bottom","left","right"],thickOuter:["top","bottom","left","right"]},a={bottom:[],top:[],left:[],right:[],none:[],all:[],outer:[],thickOuter:["top","bottom","left","right"]};function i(u,p){return a[u].includes(p)?"thick":n[u].includes(p)?"solid":"dashed"}const r=[{name:"bar1",x1:96,y1:224,x2:352,y2:224},{name:"bar2",x1:96,y1:512,x2:512,y2:512},{name:"bar3",x1:96,y1:800,x2:672,y2:800}],f={asc:"M832 800V288M672 448l160-160 160 160",desc:"M832 224v512M672 576l160 160 160-160"},m=["undo","redo","paint","clear","sep1","font","fontSize","sep2","bold","italic","underline","strike","sep3","textColor","fillColor","border","sep4","hAlign","vAlign","wrap","merge","sep6","numFmt","sep7","calc","sort","filter","freeze","find"],y=t.ref(null),k=t.ref(null),d=t.ref(null),w=t.ref(null),v=t.ref(null),R=t.ref(null),G=t.ref(null),te=t.ref(null),Y=t.ref(null),K=t.ref(null),C=t.ref(new Set),j=t.ref(!1),q=t.ref(!1),se=t.ref(0),Ne=new Map,Qe=t.computed(()=>C.value.size>0);function Ge(u){return C.value.has(u)}const be=t.computed(()=>{const u=k.value;return u instanceof HTMLElement?u:void 0});function ve(u){return be.value?!Ge(u):!0}function Xe(){for(const u of m){const p=Ne.get(u);if(p===void 0||p===0)return!0}return!1}function Je(){if(!y.value)return;y.value.querySelectorAll(".tb-item").forEach(p=>{const H=p.dataset.key;if(!H)return;const ct=p.offsetWidth;ct>0?Ne.set(H,ct):Ne.has(H)||Ne.set(H,0)})}function gt(u,p){if(u.size!==p.size)return!1;for(const H of u)if(!p.has(H))return!1;return!0}let Ze=0,tt=0;function et(){Ze&&cancelAnimationFrame(Ze),!(tt>60)&&(tt++,Ze=requestAnimationFrame(()=>requestAnimationFrame(oe)))}function oe(){if(!y.value)return;const u=y.value.clientWidth-Yi*2;if(u<=0){et();return}tt=0,(Ne.size===0||Xe())&&Je();let p=0;for(const ct of m)p+=(Ne.get(ct)??0)+fo;const H=new Set;if(p>u){const ct=u-Xi-fo;let ae=0;for(let Pe=0;Pe<m.length;Pe++){const at=m[Pe],St=(Ne.get(at)??0)+fo;if(ae+St>ct){for(let Rt=Pe;Rt<m.length;Rt++)H.add(m[Rt]);break}ae+=St}}gt(H,C.value)||(C.value=H,se.value++,H.size===0&&(j.value=!1))}let me=null;const g=t.ref(0),I=t.computed(()=>{const u=d.value,p={position:"fixed",top:"0px",right:"0px"};if(!u)return{...pe.themeVars,...p};g.value;const H=u.getBoundingClientRect();return{...pe.themeVars,position:"fixed",top:`${H.bottom+4}px`,right:`${window.innerWidth-H.right}px`}});function L(){j.value&&(g.value++,t.nextTick(()=>oe()))}function $(u){var H,ct;if(!j.value)return;const p=u.target;(H=k.value)!=null&&H.contains(p)||(ct=d.value)!=null&&ct.contains(p)||(q.value=!0,j.value=!1,t.nextTick(()=>{q.value=!1}))}function J(){j.value=!j.value}function ie(){j.value=!1,ce("find")}function re(){j.value=!1,ce("toggle-filter")}t.onMounted(()=>{et(),y.value&&(me=new ResizeObserver(()=>{j.value||et()}),me.observe(y.value)),document.addEventListener("pointerdown",$,!0),window.addEventListener("resize",L),window.addEventListener("load",et),window.addEventListener("orientationchange",et)}),t.onBeforeUnmount(()=>{Ze&&cancelAnimationFrame(Ze),me==null||me.disconnect(),document.removeEventListener("pointerdown",$,!0),window.removeEventListener("resize",L),window.removeEventListener("load",et),window.removeEventListener("orientationchange",et)});const pe=e,ce=l,A=t.computed(()=>pe.selNumberFormat===Bl?N(pe.locale,"nfMixed"):""),c=t.computed(()=>{const u=[{label:N(pe.locale,"freezeFirstRow"),value:"firstRow",icon:Ui},{label:N(pe.locale,"freezeFirstCol"),value:"firstCol",icon:Ki}];return pe.hasFreeze?u.unshift({label:N(pe.locale,"unfreezePanes"),value:"unfreeze",icon:Gi}):u.unshift({label:N(pe.locale,"freezePanes"),value:"panes",icon:Oo}),u});return(u,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{ref_key:"rootEl",ref:y,class:"toolbar",onMousedown:p[52]||(p[52]=t.withModifiers(()=>{},["prevent"]))},[(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("undo"),to:be.value},[t.createElementVNode("div",Ta,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!e.canUndo}]),title:t.unref(N)(e.locale,"undo"),disabled:!e.canUndo,onClick:p[0]||(p[0]=H=>ce("undo"))},[...p[54]||(p[54]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"})],-1)])],10,Da)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("redo"),to:be.value},[t.createElementVNode("div",Na,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!e.canRedo}]),title:t.unref(N)(e.locale,"redo"),disabled:!e.canRedo,onClick:p[1]||(p[1]=H=>ce("redo"))},[...p[55]||(p[55]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{transform:"translate(1024, 0) scale(-1, 1)",d:"M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"})],-1)])],10,Fa)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("paint"),to:be.value},[t.createElementVNode("div",Ia,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.paintFmtActive}]),title:t.unref(N)(e.locale,"paintFormat"),disabled:!e.hasSelection,onClick:p[2]||(p[2]=H=>ce("paint-format"))},[...p[56]||(p[56]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M722.285714 438.857143a36.571429 36.571429 0 0 1-36.571428 36.571428h-512a36.571429 36.571429 0 0 1-36.571429-36.571428V164.571429a36.571429 36.571429 0 0 1 36.571429-36.571429h512a36.571429 36.571429 0 0 1 36.571428 36.571429V256h128a36.571429 36.571429 0 0 1 36.571429 36.571429v294.4a36.571429 36.571429 0 0 1-31.890286 36.278857L448 675.766857V859.428571a36.571429 36.571429 0 0 1-32.292571 36.315429l-4.278858 0.256a36.571429 36.571429 0 0 1-36.571428-36.571429v-215.771428a36.571429 36.571429 0 0 1 31.890286-36.278857l406.966857-52.553143V329.142857h-91.428572v109.714286z m-73.142857-237.714286h-438.857143V402.285714h438.857143V201.142857z"})],-1)])],10,Aa)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("clear"),to:be.value},[t.createElementVNode("div",Va,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!e.hasSelection}]),title:t.unref(N)(e.locale,"clearFormat"),disabled:!e.hasSelection,onClick:p[3]||(p[3]=H=>ce("clear-format"))},[...p[57]||(p[57]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M672.748 105.674c-3.666-3.799-8.778-5.949-14.125-5.949-5.341 0-10.459 2.15-14.119 5.949L10.418 754.633c-7.789 8.163-7.789 20.798 0 28.967l123.353 126.213c7.782 7.979 23.113 14.461 34.111 14.461h395.042c12.774-0.742 24.882-5.854 34.162-14.461l416.525-426.362c7.751-8.163 7.751-20.76 0-28.916l-340.92-348.861h0.057zM557.85 832.801c-9.273 8.582-21.343 13.707-34.111 14.461H217.888c-12.781-0.742-24.882-5.867-34.162-14.461l-58.074-59.482c-7.782-8.163-7.782-20.804 0-28.967l232.333-237.87c3.666-3.799 8.778-5.949 14.125-5.949s10.453 2.15 14.119 5.949l231.102 236.551c7.744 8.157 7.744 20.753 0 28.916l-59.539 60.909 0.058-0.057z m0 0"})],-1)])],10,Ha)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep1"),to:be.value},[p[58]||(p[58]=t.createElementVNode("div",{class:"tb-item","data-key":"sep1"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("font"),to:be.value},[t.createElementVNode("div",Oa,[t.createVNode(el,{class:"toolbar-font","model-value":e.selFontFamily,options:e.fontFamilyOptions,width:Ge("font")?"100%":110,"menu-width":Ge("font")?120:void 0,"visible-count":8,title:t.unref(N)(e.locale,"fontFamily"),align:"right",onChange:p[4]||(p[4]=H=>ce("font-family-change",H))},null,8,["model-value","options","width","menu-width","title"])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("fontSize"),to:be.value},[t.createElementVNode("div",La,[t.createElementVNode("div",za,[t.createElementVNode("input",{class:"toolbar-font-size__input",type:"number",min:"5",max:"72",step:"1",value:e.fontSizeInput,title:t.unref(N)(e.locale,"fontSize"),onMousedown:p[5]||(p[5]=t.withModifiers(()=>{},["stop"])),onInput:p[6]||(p[6]=H=>ce("font-size-input",H.target.value)),onBlur:p[7]||(p[7]=H=>ce("font-size-blur")),onKeydown:p[8]||(p[8]=H=>ce("font-size-keydown",H))},null,40,_a),t.createVNode(el,{class:"toolbar-font-size__dropdown","model-value":e.selFontSize,options:e.fontSizeOptions,width:Ge("fontSize")?"100%":56,"menu-width":Ge("fontSize")?120:56,"visible-count":9,title:t.unref(N)(e.locale,"fontSize"),"hide-trigger":!0,"model-open":e.fontSizeMenuOpen,align:"right","trigger-el":K.value,"onUpdate:modelOpen":p[9]||(p[9]=H=>ce("update:font-size-menu-open",H)),onChange:p[10]||(p[10]=H=>ce("font-size-change",H))},null,8,["model-value","options","width","menu-width","title","model-open","trigger-el"]),t.createElementVNode("button",{ref_key:"fontSizeArrowRef",ref:K,class:"toolbar-font-size__btn",type:"button",title:t.unref(N)(e.locale,"fontSize"),onMousedown:p[11]||(p[11]=t.withModifiers(()=>{},["prevent"])),onClick:p[12]||(p[12]=H=>ce("font-size-toggle"))},[...p[59]||(p[59]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],40,$a),t.createElementVNode("button",{class:"toolbar-btn toolbar-btn--step",type:"button",title:t.unref(N)(e.locale,"fontSizeDecrease"),disabled:!e.hasSelection,onMousedown:p[13]||(p[13]=t.withModifiers(()=>{},["prevent"])),onClick:p[14]||(p[14]=H=>ce("font-size-step-down"))},[...p[60]||(p[60]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M675.2 184.533333h260.266667a12.8 12.8 0 0 1 12.8 12.8v21.333334a12.8 12.8 0 0 1-12.8 12.8H675.2a12.8 12.8 0 0 1-12.8-12.8v-21.333334a12.8 12.8 0 0 1 12.8-12.8zM687.744 739.413333l87.722667 197.717334a12.8 12.8 0 0 0 11.733333 7.594666h54.016a12.8 12.8 0 0 0 11.605333-18.133333l-7.466666-16.213333-131.2-287.829334-35.413334-77.653333-166.570666-365.525333a36.266667 36.266667 0 0 0-66.432 0.938666l-154.154667 365.482667-34.688 82.261333-34.688 82.218667-84.778667 201.045333-6.570666 15.658667a12.8 12.8 0 0 0 11.776 17.749333h57.557333a12.8 12.8 0 0 0 11.904-8.106666l102.4-258.474667 343.466667-4.010667 29.781333 65.28zM480.426667 284.672l132.352 290.261333 12.288 27.050667-279.808 3.242667 13.184-31.232 122.026666-289.28z"})],-1)])],40,Wa),t.createElementVNode("button",{class:"toolbar-btn toolbar-btn--step",type:"button",title:t.unref(N)(e.locale,"fontSizeIncrease"),disabled:!e.hasSelection,onMousedown:p[15]||(p[15]=t.withModifiers(()=>{},["prevent"])),onClick:p[16]||(p[16]=H=>ce("font-size-step-up"))},[...p[61]||(p[61]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M769.066667 77.952v93.781333h-93.866667a12.8 12.8 0 0 0-12.8 12.8v46.933334a12.8 12.8 0 0 0 12.8 12.8h93.866667v93.952a12.8 12.8 0 0 0 12.8 12.8h46.933333a12.8 12.8 0 0 0 12.8-12.8V244.266667h93.866667a12.8 12.8 0 0 0 12.8-12.8v-46.933334a12.8 12.8 0 0 0-12.8-12.8h-93.866667V77.952a12.8 12.8 0 0 0-12.8-12.8h-46.933333a12.8 12.8 0 0 0-12.8 12.8zM687.744 739.413333l87.722667 197.717334a12.8 12.8 0 0 0 11.733333 7.594666h54.016a12.8 12.8 0 0 0 11.605333-18.133333l-7.466666-16.213333-131.2-287.829334-35.413334-77.653333-166.570666-365.525333a36.266667 36.266667 0 0 0-66.432 0.938666l-154.154667 365.482667-34.688 82.261333-34.688 82.218667-84.778667 201.045333-6.570666 15.658667a12.8 12.8 0 0 0 11.776 17.749333h57.557333a12.8 12.8 0 0 0 11.904-8.106666l102.4-258.474667 343.466667-4.010667 29.781333 65.28zM480.426667 284.672l132.352 290.261333 12.288 27.050667-279.808 3.242667 13.184-31.232 122.026666-289.28z"})],-1)])],40,Pa)])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep2"),to:be.value},[p[62]||(p[62]=t.createElementVNode("div",{class:"tb-item","data-key":"sep2"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("bold"),to:be.value},[t.createElementVNode("div",Ua,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selFontWeight}]),title:t.unref(N)(e.locale,"bold"),disabled:!e.hasSelection,onClick:p[17]||(p[17]=H=>ce("bold-toggle"))},[...p[63]||(p[63]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M214.857 889.143v-68.571h68.571V203.429H214.857v-68.571h411.429v1.257c96.114 10.629 171.429 87.383 171.429 181.6 0 58.971-29.486 111.086-75.109 144.457 72.069 39.291 120.823 113.234 120.823 198.4 0 119.291-95.634 216.594-217.12 227.543l-0.286.029H214.857z m388.572-388.571H352v320h251.429c95.086 0 171.429-72.091 171.429-160s-76.343-160-171.429-160z m0-297.143H352v228.571h251.429l5.211-0.091c67.52-2.515 120.503-53.235 120.503-114.195 0-62.537-55.749-114.285-125.714-114.285z"})],-1)])],10,Ka)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("italic"),to:be.value},[t.createElementVNode("div",Ga,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selFontStyle}]),title:t.unref(N)(e.locale,"italic"),disabled:!e.hasSelection,onClick:p[18]||(p[18]=H=>ce("italic-toggle"))},[...p[64]||(p[64]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M730.143 127.714v64.286h-112.329l-166.521 621.429h128.871v64.286H276.286v-64.286h108.45l166.5-621.429H426.286V127.714h303.857z"})],-1)])],10,Ya)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("underline"),to:be.value},[t.createElementVNode("div",Xa,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selUnderline}]),title:t.unref(N)(e.locale,"underline"),disabled:!e.hasSelection,onClick:p[19]||(p[19]=H=>ce("underline-toggle"))},[...p[65]||(p[65]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M512 123.639a36.409 36.409 0 0 1 33.642 22.525l230.59 558.27a36.409 36.409 0 1 1-67.284 27.768L638.072 560.545H385.928l-70.876 171.656a36.409 36.409 0 1 1-67.332-27.768l230.59-558.27A36.409 36.409 0 0 1 512 123.639z m-95.974 364.089h191.948L512 255.439l-95.974 232.289zM769.289 827.544c19.418 0 38.836 14.564 38.836 38.836 0 19.418-14.564 33.982-29.127 33.982H259.565c-19.418 0-38.836-14.564-38.836-38.836 0-19.418 14.564-33.982 29.127-33.982h519.433z"})],-1)])],10,ja)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("strike"),to:be.value},[t.createElementVNode("div",Za,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selStrikethrough}]),title:t.unref(N)(e.locale,"strikethrough"),disabled:!e.hasSelection,onClick:p[20]||(p[20]=H=>ce("strikethrough-toggle"))},[...p[66]||(p[66]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M182.044 490.667h659.911a34.133 34.133 0 0 1 4.642 67.948l-4.597 0.319h-135.395c40.05 37 60.803 81.601 60.803 133.575 0 128.569-147.092 211.171-307.382 192.512-101.717-11.833-173.352-52.565-210.944-122.971a34.133 34.133 0 0 1 60.211-32.176c25.942 48.606 77.46 77.915 158.606 87.381 124.837 14.473 231.242-45.283 231.242-124.746 0-53.339-36.636-96.802-116.736-131.345l-5.279-2.23H182.044a34.133 34.133 0 0 1-33.815-29.492L147.911 524.8a34.133 34.133 0 0 1 29.491-33.815l4.642-0.318z m68.767-176.447c6.918-128.796 128.432-203.343 287.812-184.82 99.579 11.56 175.81 47.923 226.737 109.636a34.133 34.133 0 1 1-52.657 43.463c-38.775-47.013-98.759-75.639-181.999-85.288-123.654-14.381-211.627 36.591-211.627 117.009 0 35.135 10.65 61.349 37.774 90.203l5.826 6.007c4.278 4.369 8.966 8.875 11.377 10.923l1.411 0.91H288.085l-1.092-1.729c-6.508-9.376-38.958-54.386-36.182-106.314z"})],-1)])],10,qa)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep3"),to:be.value},[p[67]||(p[67]=t.createElementVNode("div",{class:"tb-item","data-key":"sep3"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("textColor"),to:be.value},[t.createElementVNode("div",Ja,[t.createElementVNode("div",Qa,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(N)(e.locale,"fontColor"),disabled:!e.hasSelection,onClick:p[21]||(p[21]=H=>ce("apply-text-color"))},[(t.openBlock(),t.createElementBlock("svg",ti,[p[68]||(p[68]=t.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[t.createElementVNode("path",{d:"M663.120842 529.946947H364.759579l-84.07579 212.884211a53.894737 53.894737 0 0 1-50.122105 34.169263h-14.551579a34.869895 34.869895 0 0 1-32.498526-47.696842L443.715368 70.063158a53.894737 53.894737 0 0 1 50.122106-34.115369h41.768421a53.894737 53.894737 0 0 1 50.176 34.277053l257.670737 659.078737a34.977684 34.977684 0 0 1-32.552421 47.696842h-14.389895a53.894737 53.894737 0 0 1-50.229895-34.277053l-83.159579-212.776421z m-35.139368-89.788631l-113.340632-289.953684-114.472421 289.953684h227.813053z"})],-1)),t.createElementVNode("path",{d:"M62.895 844.369m53.895 0l790.474 0q53.895 0 53.895 53.895l0 26.947q0 53.895-53.895 53.895l-790.474 0q-53.895 0-53.895-53.895l0-26.947q0-53.895 53.895-53.895z",fill:e.cachedTextColor||"#000000"},null,8,li)]))],8,ei),t.createElementVNode("button",{ref_key:"textColorArrowRef",ref:w,class:"toolbar-btn toolbar-split__arrow",title:t.unref(N)(e.locale,"fontColor"),disabled:!e.hasSelection,onClick:p[22]||(p[22]=H=>ce("update:text-color-menu-open",!e.textColorMenuOpen))},[...p[69]||(p[69]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,ni),t.createVNode(Ho,{"model-open":e.textColorMenuOpen,"color-key":"text","current-color":e.selTextColor,locale:e.locale,"trigger-el":w.value,"onUpdate:modelOpen":p[23]||(p[23]=H=>ce("update:text-color-menu-open",H)),onChange:p[24]||(p[24]=H=>ce("text-color-change",H))},null,8,["model-open","current-color","locale","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("fillColor"),to:be.value},[t.createElementVNode("div",oi,[t.createElementVNode("div",ri,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(N)(e.locale,"fillColor"),disabled:!e.hasSelection,onClick:p[25]||(p[25]=H=>ce("apply-fill-color"))},[(t.openBlock(),t.createElementBlock("svg",ii,[p[70]||(p[70]=t.createElementVNode("path",{d:"M447.018667 37.952l352.298666 352.298667c6.613333 6.613333 6.613333 17.344 0 23.957333L446.101333 767.424a16.938667 16.938667 0 0 1-23.957333 0L121.429333 466.688a16.938667 16.938667 0 0 1 0-23.957333L428.608 135.552 388.992 96a8.469333 8.469333 0 0 1 0-11.989333l46.058667-46.037334a8.469333 8.469333 0 0 1 11.968 0z m346.325333 517.461333l57.514667 60.074667c31.744 33.194667 31.744 86.997333 0 120.192a78.869333 78.869333 0 0 1-115.008 0c-31.765333-33.194667-31.765333-86.997333 0-120.192l57.493333-60.074667zM486.101333 193.066667l-261.12 261.12 20.458667 20.458666 380.16-1.728 70.186667-70.186666-209.706667-209.664z"},null,-1)),t.createElementVNode("path",{d:"M85.333333 853.333333m8.896 0l835.541334 0q8.896 0 8.896 8.896l0 110.208q0 8.896-8.896 8.896l-835.541334 0q-8.896 0-8.896-8.896l0-110.208q0-8.896 8.896-8.896Z",fill:e.cachedFillColor||"currentColor"},null,8,ci)]))],8,ai),t.createElementVNode("button",{ref_key:"fillColorArrowRef",ref:v,class:"toolbar-btn toolbar-split__arrow",title:t.unref(N)(e.locale,"fillColor"),disabled:!e.hasSelection,onClick:p[26]||(p[26]=H=>ce("update:fill-color-menu-open",!e.fillColorMenuOpen))},[...p[71]||(p[71]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,si),t.createVNode(Ho,{"model-open":e.fillColorMenuOpen,"color-key":"fill","current-color":e.selFillColor,locale:e.locale,"trigger-el":v.value,"onUpdate:modelOpen":p[27]||(p[27]=H=>ce("update:fill-color-menu-open",H)),onChange:p[28]||(p[28]=H=>ce("fill-color-change",H))},null,8,["model-open","current-color","locale","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("border"),to:be.value},[t.createElementVNode("div",ui,[t.createElementVNode("div",di,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(N)(e.locale,"borders"),disabled:!e.hasSelection,onClick:p[29]||(p[29]=H=>ce("apply-border"))},[(t.openBlock(),t.createElementBlock("svg",mi,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(o,H=>t.createElementVNode("line",{key:H.name,x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,"stroke-width":i(e.cachedBorder,H.name)==="thick"?3:1.5,"stroke-dasharray":i(e.cachedBorder,H.name)==="dashed"?"0 4":"none","stroke-linecap":i(e.cachedBorder,H.name)==="dashed"?"round":"square"},null,8,pi)),64))]))],8,fi),t.createElementVNode("button",{ref_key:"borderArrowRef",ref:R,class:"toolbar-btn toolbar-split__arrow",title:t.unref(N)(e.locale,"borders"),disabled:!e.hasSelection,onClick:p[30]||(p[30]=H=>ce("update:border-menu-open",!e.borderMenuOpen))},[...p[72]||(p[72]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,hi),t.createVNode(ha,{"model-open":e.borderMenuOpen,locale:e.locale,"current-border":e.cachedBorder,"trigger-el":R.value,"onUpdate:modelOpen":p[31]||(p[31]=H=>ce("update:border-menu-open",H)),onChange:p[32]||(p[32]=H=>ce("border-change",H))},null,8,["model-open","locale","current-border","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep4"),to:be.value},[p[73]||(p[73]=t.createElementVNode("div",{class:"tb-item","data-key":"sep4"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("hAlign"),to:be.value},[t.createElementVNode("div",gi,[t.createVNode(el,{class:"toolbar-align","model-value":e.selHAlign,options:e.hAlignOptions,width:Ge("hAlign")?"100%":44,"menu-width":Ge("hAlign")?120:void 0,"visible-count":3,align:"right",title:t.unref(N)(e.locale,"hAlign"),onChange:p[33]||(p[33]=H=>ce("h-align-change",H))},null,8,["model-value","options","width","menu-width","title"])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("vAlign"),to:be.value},[t.createElementVNode("div",yi,[t.createVNode(el,{class:"toolbar-align","model-value":e.selVAlign,options:e.vAlignOptions,width:Ge("vAlign")?"100%":44,"menu-width":Ge("vAlign")?120:void 0,"visible-count":3,align:"right",title:t.unref(N)(e.locale,"vAlign"),onChange:p[34]||(p[34]=H=>ce("v-align-change",H))},null,8,["model-value","options","width","menu-width","title"])]),t.createElementVNode("div",bi,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selWrap}]),type:"button",title:t.unref(N)(e.locale,"wrap"),onClick:p[35]||(p[35]=H=>ce("wrap-toggle"))},[...p[74]||(p[74]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M896 179.2a38.4 38.4 0 0 0-76.8 0v665.6a38.4 38.4 0 0 0 76.8 0v-665.6zM204.8 281.6A38.4 38.4 0 0 0 204.8 358.4h179.2a38.4 38.4 0 0 0 0-76.8H204.8zM550.4 281.6a38.4 38.4 0 0 0 0 76.8h51.2c35.328 0 64 28.672 64 64v179.2c0 35.328-28.672 64-64 64H246.272l36.864-36.864a38.4 38.4 0 1 0-54.272-54.272l-102.4 102.4a38.4 38.4 0 0 0 0 54.272l102.4 102.4a38.4 38.4 0 0 0 54.272-54.272l-36.864-36.864h355.328a140.8 140.8 0 0 0 140.8-140.8v-179.2a140.8 140.8 0 0 0-140.8-140.8h-51.2z"})],-1)])],10,Ci)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("merge"),to:be.value},[t.createElementVNode("div",wi,[t.createElementVNode("div",vi,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(N)(e.locale,"mergeCenter"),disabled:!e.hasSelection,onClick:p[36]||(p[36]=H=>ce("apply-merge"))},[...p[75]||(p[75]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M709.952 465.92l88-76.032C801.92 385.984 806.656 384 812.032 384s10.048 1.984 14.08 5.952C830.08 393.92 832 398.656 832 403.968L832 448l32 0C881.664 448 896 462.336 896 480S881.664 512 864 512L832 512l0 44.032c0 5.376-1.92 10.112-5.952 14.08C822.08 574.08 817.344 576 812.032 576s-10.048-1.92-14.08-5.952L709.952 494.08C705.984 490.112 704 485.376 704 480S705.984 469.952 709.952 465.92zM378.048 465.92 290.048 389.952C286.08 385.984 281.344 384 275.968 384s-10.048 1.984-14.08 5.952C257.92 393.92 256 398.656 256 403.968L256 448 224 448C206.336 448 192 462.336 192 480S206.336 512 224 512L256 512l0 44.032c0 5.376 1.92 10.112 5.952 14.08C265.92 574.08 270.656 576 275.968 576s10.048-1.92 14.08-5.952L378.048 494.08C382.016 490.112 384 485.376 384 480S382.016 469.952 378.048 465.92zM448 128 128 128l0 704 320 0 0-128 64 0 0 128c0 35.392-28.608 64-64 64L128 896c-35.392 0-64-28.608-64-64L64 128c0-35.392 28.608-64 64-64l320 0 0 0c35.392 0 64 28.608 64 64l0 128L448 256 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128M722.304 642.304c0 8.512-3.52 16.32-10.496 23.36s-15.424 10.624-25.344 10.624c-5.76 0-10.688-1.088-14.72-3.136-4.096-2.048-7.616-4.928-10.432-8.512s-5.824-9.088-9.024-16.512-5.952-13.952-8.32-19.648l-17.28-46.016L479.36 582.464 462.08 629.568c-6.72 18.304-12.48 30.656-17.344 37.12s-12.544 9.6-23.424 9.6c-9.28 0-17.408-3.456-24.512-10.24s-10.624-14.592-10.624-23.232c0-4.992 0.896-10.176 2.496-15.488S393.024 614.592 396.8 605.056l92.672-238.016C492.096 360.256 495.296 352 499.008 342.464s7.68-17.536 11.904-23.872 9.664-11.456 16.576-15.36c6.784-3.968 15.232-5.888 25.344-5.888 10.176 0 18.752 1.92 25.472 5.888 6.848 3.968 12.352 8.96 16.64 15.104 4.096 6.208 7.744 12.8 10.624 19.904s6.528 16.576 11.008 28.352l94.656 236.48C718.592 621.056 722.304 634.112 722.304 642.304zM606.912 526.784 552.32 375.552 498.624 526.784 606.912 526.784z"})],-1)])],8,ki),t.createElementVNode("button",{ref_key:"mergeArrowRef",ref:te,class:"toolbar-btn toolbar-split__arrow",title:t.unref(N)(e.locale,"mergeCells"),disabled:!e.hasSelection,onClick:p[37]||(p[37]=H=>ce("update:merge-menu-open",!e.mergeMenuOpen))},[...p[76]||(p[76]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,Ei),t.createVNode(Ra,{"model-open":e.mergeMenuOpen,locale:e.locale,"trigger-el":te.value,"onUpdate:modelOpen":p[38]||(p[38]=H=>ce("update:merge-menu-open",H)),onChange:p[39]||(p[39]=H=>ce("merge-change",H))},null,8,["model-open","locale","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep6"),to:be.value},[p[77]||(p[77]=t.createElementVNode("div",{class:"tb-item","data-key":"sep6"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("numFmt"),to:be.value},[t.createElementVNode("div",Si,[t.createElementVNode("div",Ri,[t.createVNode(el,{class:"toolbar-number-format","model-value":e.selNumberFormat,options:e.nfOptions,width:Ge("numFmt")?"auto":92,"menu-width":(Ge("numFmt"),150),"visible-count":8,title:t.unref(N)(e.locale,"numberFormat"),"fallback-label":A.value,align:"right",onChange:p[40]||(p[40]=H=>ce("number-format-change",String(H)))},null,8,["model-value","options","width","menu-width","title","fallback-label"]),t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn toolbar-number-format__btn",{"toolbar-btn--disabled":!e.canIncreaseDecimals}]),title:t.unref(N)(e.locale,"nfIncreaseDecimals"),disabled:!e.canIncreaseDecimals,onClick:p[41]||(p[41]=H=>ce("increase-decimals"))},[...p[78]||(p[78]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[t.createElementVNode("text",{x:"0.5",y:"16","font-size":"9","font-weight":"700","font-family":"Arial, sans-serif"},".00"),t.createElementVNode("path",{d:"M19 5.5l4.2 5.2h-2.7v7.8h-3v-7.8h-2.7z"})],-1)])],10,Mi),t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn toolbar-number-format__btn",{"toolbar-btn--disabled":!e.canDecreaseDecimals}]),title:t.unref(N)(e.locale,"nfDecreaseDecimals"),disabled:!e.canDecreaseDecimals,onClick:p[42]||(p[42]=H=>ce("decrease-decimals"))},[...p[79]||(p[79]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[t.createElementVNode("text",{x:"0.5",y:"16","font-size":"9","font-weight":"700","font-family":"Arial, sans-serif"},".00"),t.createElementVNode("path",{d:"M19 18.5l-4.2-5.2h2.7V5.5h3v7.8h2.7z"})],-1)])],10,xi)])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep7"),to:be.value},[p[80]||(p[80]=t.createElementVNode("div",{class:"tb-item","data-key":"sep7"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("calc"),to:be.value},[t.createElementVNode("div",Bi,[t.createElementVNode("div",Ti,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(N)(e.locale,"sum"),disabled:!e.hasSelection||e.isSingleCell,onClick:p[43]||(p[43]=H=>ce("calc-sum"))},[...p[81]||(p[81]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[t.createElementVNode("path",{d:"M19 3H5l7 9-7 9h14v-2H8l5.5-7L8 5h11z"})],-1)])],8,Di),t.createElementVNode("button",{ref_key:"calcArrowRef",ref:Y,class:"toolbar-btn toolbar-split__arrow",title:t.unref(N)(e.locale,"calculate"),disabled:!e.hasSelection,onClick:p[44]||(p[44]=H=>ce("update:calc-menu-open",!e.calcMenuOpen))},[...p[82]||(p[82]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,Ni),t.createVNode(Ba,{"model-open":e.calcMenuOpen,locale:e.locale,"trigger-el":Y.value,disabled:e.isSingleCell,"onUpdate:modelOpen":p[45]||(p[45]=H=>ce("update:calc-menu-open",H)),onChange:p[46]||(p[46]=H=>ce(`calc-${H}`))},null,8,["model-open","locale","trigger-el","disabled"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sort"),to:be.value},[t.createElementVNode("div",Fi,[t.createElementVNode("div",Ii,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:e.cachedSortOrder==="asc"?t.unref(N)(e.locale,"sortAsc"):t.unref(N)(e.locale,"sortDesc"),disabled:!e.canSort,onClick:p[47]||(p[47]=H=>ce("apply-sort"))},[(t.openBlock(),t.createElementBlock("svg",Vi,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,H=>t.createElementVNode("line",{key:H.name,x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2},null,8,Hi)),64)),t.createElementVNode("path",{d:f[e.cachedSortOrder]},null,8,Oi)]))],8,Ai),t.createElementVNode("button",{ref_key:"sortArrowRef",ref:G,class:"toolbar-btn toolbar-split__arrow",title:t.unref(N)(e.locale,"sort"),disabled:!e.canSort,onClick:p[48]||(p[48]=H=>ce("update:sort-menu-open",!e.sortMenuOpen))},[...p[83]||(p[83]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,Li),t.createVNode(va,{"model-open":e.sortMenuOpen,locale:e.locale,"current-sort":e.cachedSortOrder,"trigger-el":G.value,"onUpdate:modelOpen":p[49]||(p[49]=H=>ce("update:sort-menu-open",H)),onChange:p[50]||(p[50]=H=>ce("sort-change",H))},null,8,["model-open","locale","current-sort","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("filter"),to:be.value},[t.createElementVNode("div",zi,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.filterActive}]),disabled:!e.canFilter,title:e.filterActive?t.unref(N)(e.locale,"clearFilter"):t.unref(N)(e.locale,"filter"),onClick:re},[...p[84]||(p[84]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M96 192c0-17.6 14.4-32 32-32h768c17.6 0 32 14.4 32 32 0 9.6-4.8 19.2-12.8 25.6L608 480v320c0 19.2-12.8 35.2-32 40-4.8 1.6-9.6 1.6-14.4 1.6-12.8 0-24-4.8-33.6-12.8l-128-108.8c-8-6.4-12.8-16-12.8-25.6V480L108.8 217.6C100.8 211.2 96 201.6 96 192z"})],-1)])],10,_i)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("freeze"),to:be.value},[t.createElementVNode("div",$i,[t.createVNode(el,{class:"toolbar-freeze","model-value":"",options:c.value,width:Ge("freeze")?"100%":44,"menu-width":Ge("freeze")?120:void 0,"visible-count":4,align:"right",title:t.unref(N)(e.locale,"freezePane"),"trigger-icon":Oo,onChange:p[51]||(p[51]=H=>ce("freeze-change",String(H)))},null,8,["options","width","menu-width","title"])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("find"),to:be.value},[t.createElementVNode("div",Wi,[t.createElementVNode("button",{class:"toolbar-btn",title:t.unref(N)(e.locale,"find"),onClick:ie},[...p[85]||(p[85]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M448 128a320 320 0 0 1 251.2 516.8l171.2 171.2a32 32 0 0 1-45.2 45.2L654 689.9A320 320 0 1 1 448 128zm0 64a256 256 0 1 0 0 512 256 256 0 0 0 0-512z"})],-1)])],8,Pi)])],8,["disabled","to"])),Qe.value?(t.openBlock(),t.createElementBlock("button",{key:0,ref_key:"moreBtnEl",ref:d,class:t.normalizeClass(["toolbar-more",{"toolbar-more--active":j.value}]),type:"button",onClick:J},[...p[86]||(p[86]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("circle",{cx:"512",cy:"160",r:"96"}),t.createElementVNode("circle",{cx:"512",cy:"512",r:"96"}),t.createElementVNode("circle",{cx:"512",cy:"864",r:"96"})],-1)])],2)):t.createCommentVNode("",!0)],544),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref_key:"overflowMenuEl",ref:k,key:se.value,class:t.normalizeClass(["overflow-menu",{"no-anim":q.value}]),style:t.normalizeStyle(I.value),onMousedown:p[53]||(p[53]=t.withModifiers(()=>{},["prevent"]))},null,38)),[[t.vShow,j.value]])]),_:1})]))],64))}}),[["__scopeId","data-v-0d0b0e86"]]),Zi=["title"],qi={class:"tab-list"},Ji=["onClick","onDblclick","onContextmenu","onTouchstart"],Qi=["value"],ec={key:1,class:"tab-item__name"},tc=["title"],lc=["disabled"],nc=["title","onClick"],oc={class:"tab-list-menu__name"},rc=["title","disabled","onClick"],ac=["disabled"],ic=8,Lo=450,Yn=8,cc=Qt(t.defineComponent({__name:"tabbar",props:{locale:{},sheets:{},activeSheetIndex:{},renTab:{},renTabVal:{}},emits:["tab-click","tab-dblclick","delete-sheet","tab-contextmenu","tab-rename-input","tab-rename-keydown","tab-rename-commit","add-sheet","tabbar-contextmenu"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(null),i=t.ref(!1),r=t.ref(0),f=t.ref({left:0,bottom:0}),m=t.ref(null),y=t.computed(()=>Math.min(ic,o.sheets.length)),k=t.computed(()=>o.sheets.slice(r.value,r.value+y.value)),d=t.computed(()=>r.value>0),w=t.computed(()=>r.value+y.value<o.sheets.length),v=t.computed(()=>o.sheets.length>y.value),R=t.computed(()=>o.sheets.length>1);t.watch(()=>o.sheets.length,()=>{if(!i.value)return;const A=Math.max(0,o.sheets.length-y.value);r.value>A&&(r.value=A)});function G(A){r.value=Math.max(0,Math.min(o.sheets.length-y.value,r.value+A))}function te(){if(i.value){i.value=!1;return}const A=a.value;if(!A)return;const c=A.getBoundingClientRect();f.value={left:c.left,bottom:window.innerHeight-c.top+4};const u=o.activeSheetIndex;r.value=u>=0?Math.max(0,Math.min(u-Math.floor(y.value/2),o.sheets.length-y.value)):0,i.value=!0}function Y(A){n("tab-click",A),i.value=!1}function K(A){R.value&&n("delete-sheet",A)}function C(A){var p;if(!i.value)return;const c=A.target;if((p=a.value)!=null&&p.contains(c))return;const u=document.querySelector(".tab-list-menu");u!=null&&u.contains(c)||(i.value=!1)}function j(A){i.value&&A.key==="Escape"&&(i.value=!1)}function q(A){i.value&&(A.preventDefault(),G(A.deltaY>0?1:-1))}function se(){i.value=!1}function Ne(A){!i.value||A.target===m.value||se()}const Qe=t.ref(0),Ge=t.ref(!1);function be(A){i.value&&(Qe.value=A.touches[0].clientY,Ge.value=!0)}function ve(A){if(!i.value||!Ge.value)return;const c=A.touches[0].clientY-Qe.value;Math.abs(c)>5&&(G(c<0?1:-1),Qe.value=A.touches[0].clientY)}function Xe(){Ge.value=!1}let Je=null,gt=-1,Ze=0,tt=0,et=!1,oe=null,me=0,g=0;function I(A,c,u){return{clientX:A,clientY:c,target:u,preventDefault(){},stopPropagation(){}}}function L(A,c){const u=A.touches[0];if(!u)return;Ze=u.clientX,tt=u.clientY,gt=c,Je!==null&&clearTimeout(Je);const p=A.target;Je=window.setTimeout(()=>{et=!0;const H=I(Ze,tt,p);n("tab-contextmenu",{ev:H,i:gt})},Lo)}function $(A){const c=A.touches[0];!c||Je===null||(Math.abs(c.clientX-Ze)>Yn||Math.abs(c.clientY-tt)>Yn)&&(clearTimeout(Je),Je=null)}function J(){Je!==null&&(clearTimeout(Je),Je=null)}function ie(A){if(et){et=!1;return}n("tab-click",A)}function re(A){const c=A.touches[0];if(!c)return;const u=A.target;if(u.closest(".tab-item")||u.closest(".tab-bar__add-btn")||u.closest(".tab-bar__list-btn"))return;me=c.clientX,g=c.clientY,oe!==null&&clearTimeout(oe);const p=u;oe=window.setTimeout(()=>{const H=I(me,g,p);n("tabbar-contextmenu",H)},Lo)}function pe(A){const c=A.touches[0];!c||oe===null||(Math.abs(c.clientX-me)>Yn||Math.abs(c.clientY-g)>Yn)&&(clearTimeout(oe),oe=null)}function ce(){oe!==null&&(clearTimeout(oe),oe=null)}return t.watch(i,A=>{t.nextTick(()=>{var c,u;A?(c=m.value)==null||c.addEventListener("wheel",q,{passive:!1}):(u=m.value)==null||u.removeEventListener("wheel",q)})}),t.onMounted(()=>{document.addEventListener("pointerdown",C),document.addEventListener("keydown",j),window.addEventListener("resize",se),window.addEventListener("scroll",Ne,!0)}),t.onBeforeUnmount(()=>{Je!==null&&clearTimeout(Je),oe!==null&&clearTimeout(oe),document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",j),window.removeEventListener("resize",se),window.removeEventListener("scroll",Ne,!0)}),(A,c)=>(t.openBlock(),t.createElementBlock("div",{class:"tab-bar",onContextmenu:c[8]||(c[8]=u=>n("tabbar-contextmenu",u)),onTouchstart:re,onTouchmove:pe,onTouchend:ce,onTouchcancel:ce},[t.createElementVNode("button",{ref_key:"listBtnRef",ref:a,class:t.normalizeClass(["tab-bar__list-btn",{"tab-bar__list-btn--active":i.value}]),type:"button",title:t.unref(N)(e.locale,"sheetList"),onClick:te},[...c[9]||(c[9]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M128 256h768a32 32 0 0 0 0-64H128a32 32 0 0 0 0 64z m0 256h768a32 32 0 0 0 0-64H128a32 32 0 0 0 0 64z m0 256h768a32 32 0 0 0 0-64H128a32 32 0 0 0 0 64z"})],-1)])],10,Zi),t.createElementVNode("div",qi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.sheets,(u,p)=>(t.openBlock(),t.createElementBlock("div",{key:u.id,class:t.normalizeClass(["tab-item",{"tab-item--active":p===e.activeSheetIndex}]),onClick:H=>ie(p),onDblclick:t.withModifiers(H=>n("tab-dblclick",p),["prevent"]),onContextmenu:H=>n("tab-contextmenu",{ev:H,i:p}),onTouchstart:H=>L(H,p),onTouchmove:$,onTouchend:J,onTouchcancel:J},[e.renTab===p?(t.openBlock(),t.createElementBlock("input",{key:0,class:"tab-rename-input",value:e.renTabVal,onInput:c[0]||(c[0]=H=>n("tab-rename-input",H.target.value)),onKeydown:c[1]||(c[1]=H=>n("tab-rename-keydown",H)),onBlur:c[2]||(c[2]=H=>n("tab-rename-commit")),onClick:c[3]||(c[3]=t.withModifiers(()=>{},["stop"]))},null,40,Qi)):(t.openBlock(),t.createElementBlock("span",ec,t.toDisplayString(u.name),1))],42,Ji))),128))]),t.createElementVNode("button",{class:"tab-bar__add-btn",title:t.unref(N)(e.locale,"addSheet"),onClick:c[4]||(c[4]=u=>n("add-sheet"))}," + ",8,tc),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[i.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"tab-list-menu",style:t.normalizeStyle({left:f.value.left+"px",bottom:f.value.bottom+"px"}),onMousedown:c[7]||(c[7]=t.withModifiers(()=>{},["prevent"]))},[v.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["tab-list-menu__nav",{"tab-list-menu__nav--disabled":!d.value}]),disabled:!d.value,onClick:c[5]||(c[5]=u=>G(-1))},[...c[10]||(c[10]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z"})],-1)])],10,lc)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"listRef",ref:m,class:"tab-list-menu__list",onTouchstart:be,onTouchmove:ve,onTouchend:Xe},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,u=>(t.openBlock(),t.createElementBlock("div",{key:u.id,class:t.normalizeClass(["tab-list-menu__item",{"tab-list-menu__item--active":e.sheets.indexOf(u)===e.activeSheetIndex}]),title:u.name,onClick:p=>Y(e.sheets.indexOf(u))},[t.createElementVNode("span",oc,t.toDisplayString(u.name),1),t.createElementVNode("button",{type:"button",class:"tab-list-menu__del",title:t.unref(N)(e.locale,"delete"),disabled:!R.value,onClick:t.withModifiers(p=>K(e.sheets.indexOf(u)),["stop"])},[...c[11]||(c[11]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])],8,rc)],10,nc))),128))],544),v.value?(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["tab-list-menu__nav",{"tab-list-menu__nav--disabled":!w.value}]),disabled:!w.value,onClick:c[6]||(c[6]=u=>G(1))},[...c[12]||(c[12]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],10,ac)):t.createCommentVNode("",!0)],36)):t.createCommentVNode("",!0)]),_:1})]))],32))}}),[["__scopeId","data-v-e00401ad"]]),sc=["placeholder","value"],uc=["placeholder","value"],dc={class:"find-bar__chk"},fc=["checked"],mc={class:"find-bar__chk"},pc=["checked"],hc={class:"find-bar__count"},gc=["title","disabled"],yc=["title","disabled"],bc=["disabled"],Cc=["disabled"],wc=["title"],vc=Qt(t.defineComponent({__name:"find-replace-bar",props:{open:{type:Boolean},findText:{},replaceText:{},scope:{},matchCase:{type:Boolean},matchEntireCell:{type:Boolean},currentIndex:{},total:{},message:{},focusToken:{},locale:{},themeVars:{}},emits:["update:findText","update:replaceText","update:scope","update:matchCase","update:matchEntireCell","prev","next","replace","replace-all","close"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(null),i=t.computed(()=>o.total>0?`${o.currentIndex+1}/${o.total}`:o.message||""),r=t.computed(()=>[{label:N(o.locale,"scopeSheet"),value:"sheet"},{label:N(o.locale,"scopeWorkbook"),value:"workbook"},{label:N(o.locale,"scopeSelection"),value:"selection"}]);t.watch(()=>o.focusToken,()=>{t.nextTick(()=>{var m;return(m=a.value)==null?void 0:m.focus()})});function f(m){m.key==="Enter"?(m.preventDefault(),m.shiftKey?n("prev"):n("next")):m.key==="Escape"&&(m.preventDefault(),n("close"))}return(m,y)=>e.open?(t.openBlock(),t.createElementBlock("div",{key:0,class:"find-bar",style:t.normalizeStyle(e.themeVars)},[t.createElementVNode("input",{ref_key:"findInputRef",ref:a,class:"find-bar__input",placeholder:t.unref(N)(e.locale,"findPlaceholder"),value:e.findText,onInput:y[0]||(y[0]=k=>n("update:findText",k.target.value)),onKeydown:f},null,40,sc),t.createElementVNode("input",{class:"find-bar__input",placeholder:t.unref(N)(e.locale,"replacePlaceholder"),value:e.replaceText,onInput:y[1]||(y[1]=k=>n("update:replaceText",k.target.value)),onKeydown:f},null,40,uc),t.createVNode(el,{class:"find-bar__dropdown","model-value":e.scope,options:r.value,title:t.unref(N)(e.locale,"findScope"),"onUpdate:modelValue":y[2]||(y[2]=k=>m.$emit("update:scope",k))},null,8,["model-value","options","title"]),t.createElementVNode("label",dc,[t.createElementVNode("input",{class:"find-bar__chk-input",type:"checkbox",checked:e.matchCase,onChange:y[3]||(y[3]=k=>n("update:matchCase",k.target.checked))},null,40,fc),y[10]||(y[10]=t.createElementVNode("span",{class:"find-bar__chk-box"},[t.createElementVNode("svg",{class:"find-bar__chk-tick",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M405 697L195 487l58-58 152 152 304-304 58 58z"})])],-1)),t.createTextVNode(t.toDisplayString(t.unref(N)(e.locale,"matchCase")),1)]),t.createElementVNode("label",mc,[t.createElementVNode("input",{class:"find-bar__chk-input",type:"checkbox",checked:e.matchEntireCell,onChange:y[4]||(y[4]=k=>n("update:matchEntireCell",k.target.checked))},null,40,pc),y[11]||(y[11]=t.createElementVNode("span",{class:"find-bar__chk-box"},[t.createElementVNode("svg",{class:"find-bar__chk-tick",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M405 697L195 487l58-58 152 152 304-304 58 58z"})])],-1)),t.createTextVNode(t.toDisplayString(t.unref(N)(e.locale,"matchEntireCell")),1)]),t.createElementVNode("span",hc,t.toDisplayString(i.value),1),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--icon",title:t.unref(N)(e.locale,"findPrev"),disabled:e.total===0,onClick:y[5]||(y[5]=k=>n("prev"))},[...y[12]||(y[12]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M512 320a32 32 0 0 1 45.254 0l288 288a32 32 0 0 1-45.254 45.254L512 410.51 214.254 653.254A32 32 0 0 1 169 608l288-288z"})],-1)])],8,gc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--icon",title:t.unref(N)(e.locale,"findNext"),disabled:e.total===0,onClick:y[6]||(y[6]=k=>n("next"))},[...y[13]||(y[13]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M512 704a32 32 0 0 1-45.254 0l-288-288A32 32 0 0 1 214.254 370.746L512 613.49 809.746 370.746A32 32 0 0 1 855 416l-288 288z"})],-1)])],8,yc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--text",disabled:e.total===0,onClick:y[7]||(y[7]=k=>n("replace"))},t.toDisplayString(t.unref(N)(e.locale,"replace")),9,bc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--text",disabled:e.total===0,onClick:y[8]||(y[8]=k=>n("replace-all"))},t.toDisplayString(t.unref(N)(e.locale,"replaceAll")),9,Cc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--close",title:t.unref(N)(e.locale,"findClose"),onClick:y[9]||(y[9]=k=>n("close"))},[...y[14]||(y[14]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])],8,wc)],4)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-3120909b"]]),kc={class:"nf-dialog__header"},Ec={class:"nf-dialog__title"},Sc={class:"nf-dialog__body"},Rc={class:"nf-field"},Mc={class:"nf-field__label"},xc={key:0,class:"nf-field"},Bc={class:"nf-field__label"},Tc={key:1,class:"nf-field nf-field--inline"},Dc={class:"nf-checkbox"},Nc={key:2,class:"nf-field"},Fc={class:"nf-field__label"},Ic={key:3,class:"nf-field"},Ac={class:"nf-field__label"},Vc={key:4,class:"nf-field"},Hc={class:"nf-field__label"},Oc={key:5,class:"nf-field"},Lc={class:"nf-field__label"},zc={key:6,class:"nf-field"},_c={class:"nf-field__label"},$c={class:"nf-field"},Wc={class:"nf-field__label"},Pc={class:"nf-dialog__footer"},Uc={class:"nf-preview"},Kc={class:"nf-preview__label"},Gc={class:"nf-preview__value"},Yc={class:"nf-dialog__actions"},Xc=Qt(t.defineComponent({__name:"numberFormatDialog",props:{modelOpen:{type:Boolean,default:!1},locale:{default:"zh-CN"},currentFormat:{default:""},isCustom:{type:Boolean,default:!1},sampleValue:{default:"1234.5"}},emits:["update:modelOpen","apply"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref("general"),r=t.ref(2),f=t.ref(!1),m=t.ref("$"),y=t.ref("m/d/yyyy"),k=t.ref("h:mm:ss"),d=t.ref("m/d/yyyy h:mm:ss"),w=t.ref("[h]:mm:ss"),v=t.ref(""),R=t.ref(null),G=[{label:"¥",value:"¥"},{label:"$",value:"$"},{label:"€",value:"€"},{label:"£",value:"£"}],te=['yyyy"年"m"月"d"日"',"yyyy-mm-dd","yyyy/m/d",'m"月"d"日"'],Y=["m/d/yyyy","mm/dd/yyyy","d-mmm-yyyy","mmmm d, yyyy"],K=['yyyy"年"m"月"d"日" h:mm:ss','yyyy"年"m"月"d"日" hh:mm',"yyyy-mm-dd hh:mm:ss","yyyy/m/d h:mm"],C=["m/d/yyyy h:mm:ss","m/d/yyyy hh:mm","mm/dd/yyyy h:mm AM/PM","d-mmm-yyyy hh:mm:ss"],j=t.computed(()=>o.locale==="zh-CN"?[...te,...Y]:[...Y,...te]),q=["h:mm:ss","h:mm","hh:mm:ss","h:mm AM/PM",'hh"时"mm"分"ss"秒"',"H:mm:ss"],se=t.computed(()=>o.locale==="zh-CN"?[...K,...C]:[...C,...K]),Ne=["[h]:mm:ss","[h]:mm","mm:ss",'[h]"小时"mm"分"ss"秒"',"[h]:mm:ss.00",'d"天"h:mm:ss'],Qe={general:"nfGeneral",text:"nfText",number:"nfNumber",percent:"nfPercent",scientific:"nfScientific",accounting:"nfAccounting",financial:"nfFinancial",currency:"nfCurrency",currencyRounded:"nfCurrencyRounded",date:"nfDate",time:"nfTime",dateTime:"nfDateTime",duration:"nfDuration",custom:"nfCatCustom"},Ge=t.computed(()=>Ur.map(ae=>({label:N(o.locale,Qe[ae]),value:ae}))),be=G.map(ae=>({label:ae.label,value:ae.value})),ve=t.computed(()=>j.value.map(ae=>({label:ae,value:ae}))),Xe=q.map(ae=>({label:ae,value:ae})),Je=t.computed(()=>se.value.map(ae=>({label:ae,value:ae}))),gt=Ne.map(ae=>({label:ae,value:ae})),Ze=t.computed(()=>["number","currency","currencyRounded","accounting","financial"].includes(i.value)),tt=t.computed(()=>["currency","currencyRounded","accounting"].includes(i.value)),et=t.computed(()=>i.value==="date"),oe=t.computed(()=>i.value==="time"),me=t.computed(()=>i.value==="dateTime"),g=t.computed(()=>i.value==="duration"),I=t.computed(()=>["number","currency","accounting","financial","percent","scientific"].includes(i.value));function L(){if(i.value==="general")return Ul;if(i.value==="text")return cl;if(i.value==="custom")return v.value;if(i.value==="date")return y.value;if(i.value==="time")return k.value;if(i.value==="dateTime")return d.value;if(i.value==="duration")return w.value;const ae=Math.max(0,Math.min(30,r.value));return i.value==="currency"||i.value==="currencyRounded"||i.value==="accounting"?$(i.value,ae,f.value,m.value):Jr(o.locale,i.value,ae,f.value)}function $(ae,Pe,at,St){const Rt=at?"#,##0":"0";if(ae==="currencyRounded")return St+Rt;const Mt=Pe>0?"."+"0".repeat(Pe):"",It=Rt+Mt;return ae==="currency"?St+It:`${St}${It};(${St}${It});${St}"-"`}function J(ae){if(v.value=ae,sl(ae)){i.value="general";return}if(ae==="@"){i.value="text";return}const Pe=ae.replace(/\[[^\]]*\]/gi,Mt=>/\[h\]/i.test(Mt)?Mt:"");if(/\[h\]/i.test(Pe)&&!/[yd]/i.test(Pe)){i.value="duration",Ne.includes(ae)&&(w.value=ae);return}const at=/[yd]/i.test(Pe),St=/h|s|AM\/PM/i.test(Pe);if(at&&St){i.value="dateTime",se.value.includes(ae)&&(d.value=ae);return}if(at||/AM\/PM/i.test(Pe)){St&&!at?(i.value="time",q.includes(ae)&&(k.value=ae)):(i.value="date",j.value.includes(ae)&&(y.value=ae));return}if(ae.includes("%")){i.value="percent",r.value=ie(ae);return}if(/E[+-]/i.test(ae)){i.value="scientific",r.value=ie(ae);return}const Rt=G.find(Mt=>ae.startsWith(Mt.value));if(ae.includes("[Red](")){i.value="financial",f.value=ae.includes(","),r.value=ie(ae);return}if(Rt){ae.includes("(")?(i.value="accounting",m.value=Rt.value,f.value=ae.includes(","),r.value=ie(ae)):/\.\d/.test(ae.slice(Rt.value.length))?(i.value="currency",m.value=Rt.value,f.value=ae.includes(","),r.value=ie(ae)):(i.value="currencyRounded",m.value=Rt.value,f.value=ae.includes(","));return}i.value="number",f.value=ae.includes(","),r.value=ie(ae)}function ie(ae){const Pe=ae.match(/\.([0#?]+)/);return Pe?Pe[1].length:0}function re(){i.value!=="custom"&&(v.value=L())}function pe(){}function ce(){y.value=j.value[0],k.value=q[0],d.value=se.value[0],w.value=Ne[0]}function A(){a.value=!0,o.modelOpen!==void 0&&n("update:modelOpen",!0),ce(),J(o.currentFormat??""),o.isCustom&&(i.value="custom"),t.nextTick(()=>{var ae;return(ae=R.value)==null?void 0:ae.focus()})}function c(){a.value=!1,o.modelOpen!==void 0&&n("update:modelOpen",!1)}function u(){n("apply",v.value),c()}function p(){c()}function H(ae){ae.key==="Escape"&&c()}t.watch(()=>o.modelOpen,ae=>{ae&&!a.value?A():!ae&&a.value&&c()});const ct=t.computed(()=>wl(o.sampleValue,v.value,o.locale));return(ae,Pe)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"nf-dialog"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"nf-dialog__mask",onMousedown:p,onKeydown:H},[t.createElementVNode("div",{class:t.normalizeClass(["nf-dialog",{"nf-dialog--zh":e.locale==="zh-CN"}]),onMousedown:Pe[9]||(Pe[9]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",kc,[t.createElementVNode("span",Ec,t.toDisplayString(t.unref(N)(e.locale,"nfDialogTitle")),1),t.createElementVNode("button",{class:"nf-dialog__close",type:"button",onClick:c},[...Pe[10]||(Pe[10]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])])]),t.createElementVNode("div",Sc,[t.createElementVNode("div",Rc,[t.createElementVNode("label",Mc,t.toDisplayString(t.unref(N)(e.locale,"nfCategory")),1),t.createVNode(el,{class:"nf-field__dropdown","model-value":i.value,options:Ge.value,"onUpdate:modelValue":Pe[0]||(Pe[0]=at=>i.value=at),onChange:re},null,8,["model-value","options"])]),I.value?(t.openBlock(),t.createElementBlock("div",xc,[t.createElementVNode("label",Bc,t.toDisplayString(t.unref(N)(e.locale,"nfDecimals")),1),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pe[1]||(Pe[1]=at=>r.value=at),class:"nf-field__input",type:"number",min:"0",max:"30",onInput:re},null,544),[[t.vModelText,r.value,void 0,{number:!0}]])])):t.createCommentVNode("",!0),Ze.value?(t.openBlock(),t.createElementBlock("div",Tc,[t.createElementVNode("label",Dc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pe[2]||(Pe[2]=at=>f.value=at),type:"checkbox",onChange:re},null,544),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",null,t.toDisplayString(t.unref(N)(e.locale,"nfThousands")),1)])])):t.createCommentVNode("",!0),tt.value?(t.openBlock(),t.createElementBlock("div",Nc,[t.createElementVNode("label",Fc,t.toDisplayString(t.unref(N)(e.locale,"nfSymbol")),1),t.createVNode(el,{class:"nf-field__dropdown","model-value":m.value,options:t.unref(be),"onUpdate:modelValue":Pe[3]||(Pe[3]=at=>m.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),et.value?(t.openBlock(),t.createElementBlock("div",Ic,[t.createElementVNode("label",Ac,t.toDisplayString(t.unref(N)(e.locale,"nfDateFormat")),1),t.createVNode(el,{class:"nf-field__dropdown","model-value":y.value,options:ve.value,"onUpdate:modelValue":Pe[4]||(Pe[4]=at=>y.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),oe.value?(t.openBlock(),t.createElementBlock("div",Vc,[t.createElementVNode("label",Hc,t.toDisplayString(t.unref(N)(e.locale,"nfTimeFormat")),1),t.createVNode(el,{class:"nf-field__dropdown","model-value":k.value,options:t.unref(Xe),"onUpdate:modelValue":Pe[5]||(Pe[5]=at=>k.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),me.value?(t.openBlock(),t.createElementBlock("div",Oc,[t.createElementVNode("label",Lc,t.toDisplayString(t.unref(N)(e.locale,"nfDateTime")),1),t.createVNode(el,{class:"nf-field__dropdown","model-value":d.value,options:Je.value,"onUpdate:modelValue":Pe[6]||(Pe[6]=at=>d.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),g.value?(t.openBlock(),t.createElementBlock("div",zc,[t.createElementVNode("label",_c,t.toDisplayString(t.unref(N)(e.locale,"nfDuration")),1),t.createVNode(el,{class:"nf-field__dropdown","model-value":w.value,options:t.unref(gt),"onUpdate:modelValue":Pe[7]||(Pe[7]=at=>w.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),t.createElementVNode("div",$c,[t.createElementVNode("label",Wc,t.toDisplayString(t.unref(N)(e.locale,"nfCustomCode")),1),t.withDirectives(t.createElementVNode("textarea",{ref_key:"customCodeRef",ref:R,"onUpdate:modelValue":Pe[8]||(Pe[8]=at=>v.value=at),class:"nf-field__textarea",rows:"2",spellcheck:"false",onInput:pe},null,544),[[t.vModelText,v.value]])])]),t.createElementVNode("div",Pc,[t.createElementVNode("div",Uc,[t.createElementVNode("span",Kc,t.toDisplayString(t.unref(N)(e.locale,"nfPreview")),1),t.createElementVNode("span",Gc,t.toDisplayString(ct.value||"—"),1)]),t.createElementVNode("div",Yc,[t.createElementVNode("button",{class:"nf-btn nf-btn--primary",type:"button",onClick:u},t.toDisplayString(t.unref(N)(e.locale,"ok")),1),t.createElementVNode("button",{class:"nf-btn",type:"button",onClick:c},t.toDisplayString(t.unref(N)(e.locale,"cancel")),1)])])],34)],32)):t.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-39792a0b"]]),jc={class:"sort-confirm__header"},Zc={class:"sort-confirm__title"},qc={class:"sort-confirm__body"},Jc={class:"sort-confirm__message"},Qc={class:"sort-confirm__options"},es={class:"sort-confirm__option"},ts={class:"sort-confirm__option"},ls={class:"sort-confirm__footer"},ns=Qt(t.defineComponent({__name:"sortConfirmDialog",props:{modelOpen:{type:Boolean,default:!1},locale:{default:"zh-CN"}},emits:["update:modelOpen","confirm","cancel"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref(!0),r=t.ref(null);t.watch(()=>o.modelOpen,v=>{v&&!a.value?f():!v&&a.value&&m()});function f(){i.value=!0,a.value=!0,o.modelOpen!==void 0&&n("update:modelOpen",!0),t.nextTick(()=>{var R;const v=(R=r.value)==null?void 0:R.querySelector(".sort-confirm__btn--primary");v==null||v.focus()})}function m(){a.value=!1,o.modelOpen!==void 0&&n("update:modelOpen",!1)}function y(){w()}function k(v){v.key==="Escape"&&w()}function d(){n("confirm",i.value),m()}function w(){n("cancel"),m()}return(v,R)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"sort-confirm"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"sort-confirm__mask",onMousedown:y,onKeydown:k},[t.createElementVNode("div",{ref_key:"dialogRef",ref:r,class:"sort-confirm",onMousedown:R[2]||(R[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",jc,[t.createElementVNode("span",Zc,t.toDisplayString(t.unref(N)(e.locale,"sortReminderTitle")),1),t.createElementVNode("button",{class:"sort-confirm__close",type:"button",onClick:w},[...R[3]||(R[3]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])])]),t.createElementVNode("div",qc,[t.createElementVNode("p",Jc,t.toDisplayString(t.unref(N)(e.locale,"sortReminderMessage")),1),t.createElementVNode("div",Qc,[t.createElementVNode("label",es,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":R[0]||(R[0]=G=>i.value=G),type:"radio",value:!0},null,512),[[t.vModelRadio,i.value]]),t.createElementVNode("span",null,t.toDisplayString(t.unref(N)(e.locale,"sortExpandSelection")),1)]),t.createElementVNode("label",ts,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":R[1]||(R[1]=G=>i.value=G),type:"radio",value:!1},null,512),[[t.vModelRadio,i.value]]),t.createElementVNode("span",null,t.toDisplayString(t.unref(N)(e.locale,"sortCurrentSelection")),1)])])]),t.createElementVNode("div",ls,[t.createElementVNode("button",{class:"sort-confirm__btn sort-confirm__btn--primary",type:"button",onClick:d},t.toDisplayString(t.unref(N)(e.locale,"sort")),1),t.createElementVNode("button",{class:"sort-confirm__btn",type:"button",onClick:w},t.toDisplayString(t.unref(N)(e.locale,"cancel")),1)])],544)],32)):t.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-d26d5917"]]);function ht(e){let l="",o=e;do l=String.fromCharCode(65+o%26)+l,o=Math.floor(o/26)-1;while(o>=0);return l}function mo(e){let l=0;for(let o=0;o<e.length;o++)l=l*26+(e.toUpperCase().charCodeAt(o)-64);return l-1}function gn(e){if(e==null)return null;if(typeof e=="number")return e;if(typeof e=="string"){const l=parseFloat(e);return e.endsWith("%")||isNaN(l)?null:l}return null}function po(e){navigator.clipboard.writeText(e).catch(()=>{const l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l)})}function Dn(e,l){return`${e},${l}`}function On(e,l,o){const n=e.match(/^\$?([A-Z]+)\$?(\d+)$/i);if(!n)return null;const a=mo(n[1]),i=parseInt(n[2],10)-1;return a<0||a>=l||i<0||i>=o?null:{col:a,row:i}}function on(e,l){if(!l)return{x:0,y:0};const o=l.getBoundingClientRect();return{x:e.clientX-o.left,y:e.clientY-o.top}}const zo=[{name:"SUM",snippet:"SUM(A1:A10)"},{name:"AVERAGE",snippet:"AVERAGE(A1:A10)"},{name:"COUNT",snippet:"COUNT(A1:A10)"},{name:"IF",snippet:"IF(A1>0, B1, C1)"},{name:"VLOOKUP",snippet:"VLOOKUP(A1, B1:C10, 2, FALSE)"},{name:"CONCATENATE",snippet:"CONCATENATE(A1, B1)"},{name:"MAX",snippet:"MAX(A1:A10)"},{name:"MIN",snippet:"MIN(A1:A10)"},{name:"SIN",snippet:"SIN(A1)"},{name:"SUMIF",snippet:'SUMIF(A1:A10, ">0", B1:B10)'},{name:"PMT",snippet:"PMT(0.05/12, 360, 100000)"},{name:"STDEV",snippet:"STDEV(A1:A10)"}],os={SUM:{min:1,max:1},AVERAGE:{min:1,max:1},COUNT:{min:1,max:1},IF:{min:3,max:3},VLOOKUP:{min:3,max:4},CONCATENATE:{min:1,max:1/0},MAX:{min:1,max:1},MIN:{min:1,max:1},SIN:{min:1,max:1},SUMIF:{min:2,max:3},PMT:{min:3,max:5},STDEV:{min:1,max:1}};function rs(e){let l=0,o=null;for(let n=0;n<e.length;n++){const a=e[n];if(o){a===o&&(e[n+1]===o?n++:o=null);continue}if(a==='"'||a==="'"){o=a;continue}if(a==="(")l++;else if(a===")"&&(l--,l<0))return!1}return l===0}function as(e){const l=e.trim();if(!l.startsWith("="))return{ok:!1,name:null};const o=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(l.slice(1).trim());if(!o)return{ok:!1,name:null};const n=o[1].toUpperCase(),a=os[n];if(!a)return{ok:!1,name:n};const i=o[2];if(!rs(i))return{ok:!1,name:n};const r=yn(i),f=r.length===1&&r[0].trim()===""?0:r.length;return f<a.min||f>a.max?{ok:!1,name:n}:r.some(m=>m.trim()==="")?{ok:!1,name:n}:{ok:!0,name:n}}function Nn(e,l,o){const n=e.split(":");if(n.length!==2)return null;const a=On(n[0],l,o),i=On(n[1],l,o);return!a||!i?null:{sc:Math.min(a.col,i.col),sr:Math.min(a.row,i.row),ec:Math.max(a.col,i.col),er:Math.max(a.row,i.row)}}function _o(e){const l=e.trim();if(l==="")return"";const o=Number(l);return!isNaN(o)&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(l)?o:e}function Tl(e,l,o,n,a){const i=o[Dn(e,l)];if(!i)return"";const r=i.value;return r.startsWith("=")?Wo(Dn(e,l),o,n,a):_o(r)}function $o(e,l,o,n,a){const i=Tl(e,l,o,n,a);if(i===null)return 0;if(typeof i=="number")return i;const r=parseFloat(String(i));return isNaN(r)?0:r}const Ln=new Map,Xn=new Set;function zn(){Ln.clear(),Xn.clear()}function Wo(e,l,o,n){return is(e,l,o,n,0)}function is(e,l,o,n,a){if(Xn.has(e))return null;if(Ln.has(e))return Ln.get(e);Xn.add(e);const i=l[e];let r;if(!i)r=null;else{const f=i.value;if(!f.startsWith("="))r=_o(f);else{const m=f.slice(1).trim(),y=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(m);r=y?Go(y[1].toUpperCase(),y[2],l,o,n,a+1):Kt(m,l,o,n,a+1)}}return Xn.delete(e),Ln.set(e,r),r}function ho(e){return e===null||e===""?!1:typeof e=="number"?e!==0:!0}function Po(e,l){return typeof e=="number"&&typeof l=="number"?e===l:String(e??"")===String(l??"")}function Uo(e,l,o){let n;if(typeof e=="number"&&typeof l=="number")n=e<l?-1:e>l?1:0;else{const a=String(e??""),i=String(l??"");n=a<i?-1:a>i?1:0}switch(o){case"=":return n===0;case"<>":return n!==0;case"<":return n<0;case">":return n>0;case"<=":return n<=0;case">=":return n>=0}return!1}function Ko(e,l,o,n){const a=e.trim();if(a.length>=2&&(a[0]==='"'&&a[a.length-1]==='"'||a[0]==="'"&&a[a.length-1]==="'"))return a.slice(1,-1);const i=Number(a);return!isNaN(i)&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(a)?i:a}function cs(e,l,o,n,a,i){let f=l.trim();f.length>=2&&(f[0]==='"'&&f[f.length-1]==='"'||f[0]==="'"&&f[f.length-1]==="'")&&(f=f.slice(1,-1));const m=/^([<>=]+)([\s\S]*)$/.exec(f);if(m){const k=m[1],d=Ko(m[2]);return Uo(e,d,k)}const y=Ko(f);return Po(e,y)}function ss(e,l,o,n,a){const i=e.trim(),r=["<=",">=","<>"];let f=null,m=-1,y=null,k=0;for(let w=0;w<i.length;w++){const v=i[w];if(y){v===y&&(i[w+1]===y?w++:y=null);continue}if(v==='"'||v==="'"){y=v;continue}if(v==="("&&k++,v===")"&&k--,k===0&&(v==="<"||v===">"||v==="=")){const R=i.slice(w,w+2);f=r.includes(R)?R:v,m=w;break}}if(f&&m>=0){const w=i.slice(0,m).trim(),v=i.slice(m+f.length).trim(),R=Kt(w,l,o,n,a),G=Kt(v,l,o,n,a);return Uo(R,G,f)}const d=Kt(i,l,o,n,a);return ho(d)}function yn(e){const l=[];let o=0,n=null,a="";for(let i=0;i<e.length;i++){const r=e[i];if(n){a+=r,r===n&&(e[i+1]===n?(i++,a+=n):n=null);continue}if(r==='"'||r==="'"){n=r,a+=r;continue}if(r==="("&&o++,r===")"&&o--,r===","&&o===0){l.push(a),a="";continue}a+=r}return l.push(a),l}function Kt(e,l,o,n,a){if(a>20)return null;const i=e.trim();if(i==="")return null;const r=i.toUpperCase();if(r==="TRUE")return 1;if(r==="FALSE")return 0;const f=us(i);if(f.length===0)return null;let m=0;const y=()=>{let v=k();for(;m<f.length;){const R=f[m];if(R.type==="op"&&(R.val==="+"||R.val==="-"))m++,v=go(v,k(),R.val);else break}return v},k=()=>{let v=d();for(;m<f.length;){const R=f[m];if(R.type==="op"&&(R.val==="*"||R.val==="/"))m++,v=go(v,d(),R.val);else break}return v},d=()=>{const v=f[m];return v&&v.type==="op"&&v.val==="-"?(m++,go(0,d(),"-")):v&&v.type==="op"&&v.val==="+"?(m++,d()):w()},w=()=>{const v=f[m];if(!v)return null;if(v.type==="num")return m++,Number(v.val);if(v.type==="str")return m++,v.val;if(v.type==="lp"){m++;const R=y();return f[m]&&f[m].type==="rp"&&m++,R}if(v.type==="ref"){m++;const R=On(v.val,o,n);return R?Tl(R.col,R.row,l,o,n):null}if(v.type==="func"){const R=v.val.toUpperCase();if(m++,f[m]&&f[m].type==="lp"){const G=f[m];let te=0,Y=null,K=m;for(;K<f.length;K++)if(f[K].type==="lp")te++;else if(f[K].type==="rp"&&(te--,te===0)){Y=f[K];break}if(Y){const C=i.slice(G.start+1,Y.start);return m=K+1,Go(R,C,l,o,n,a+1)}}return null}return m++,null};return y()}function us(e){const l=[];let o=0;for(;o<e.length;){const n=e[o];if(/\s/.test(n)){o++;continue}if(n==='"'||n==="'"){const a=n,i=o;o++;let r="";for(;o<e.length;){if(e[o]===a){if(e[o+1]===a){r+=a,o+=2;continue}o++;break}r+=e[o],o++}l.push({type:"str",val:r,start:i});continue}if(/[0-9]/.test(n)||n==="."){const a=o;let i="";for(n==="."&&(i+=".",o++);o<e.length&&/[0-9]/.test(e[o]);)i+=e[o],o++;if(e[o]===".")for(i+=".",o++;o<e.length&&/[0-9]/.test(e[o]);)i+=e[o],o++;if(e[o]==="e"||e[o]==="E")for(i+=e[o],o++,(e[o]==="+"||e[o]==="-")&&(i+=e[o],o++);o<e.length&&/[0-9]/.test(e[o]);)i+=e[o],o++;l.push({type:"num",val:i,start:a});continue}if(/[A-Za-z_]/.test(n)){const a=o;let i="";for(;o<e.length&&/[A-Za-z0-9_]/.test(e[o]);)i+=e[o],o++;e[o]==="("?l.push({type:"func",val:i,start:a}):l.push({type:"ref",val:i,start:a});continue}if(n==="("){l.push({type:"lp",val:n,start:o}),o++;continue}if(n===")"){l.push({type:"rp",val:n,start:o}),o++;continue}if(n===","){l.push({type:"comma",val:n,start:o}),o++;continue}if(n==="+"||n==="-"||n==="*"||n==="/"){l.push({type:"op",val:n,start:o}),o++;continue}o++}return l}function go(e,l,o){if(typeof e!="number"||typeof l!="number")return null;switch(o){case"+":return e+l;case"-":return e-l;case"*":return e*l;case"/":return l===0?null:e/l}return null}function Go(e,l,o,n,a,i){switch(e){case"SUM":case"AVERAGE":case"COUNT":{const r=Nn(l.trim(),n,a);if(!r)return null;if(e==="COUNT"){let m=0;for(let y=r.sc;y<=r.ec;y++)for(let k=r.sr;k<=r.er;k++)typeof Tl(y,k,o,n,a)=="number"&&m++;return m}let f=0;for(let m=r.sc;m<=r.ec;m++)for(let y=r.sr;y<=r.er;y++)f+=$o(m,y,o,n,a);if(isNaN(f))return null;if(e==="AVERAGE"){const m=(r.ec-r.sc+1)*(r.er-r.sr+1);return m===0?null:f/m}return f}case"IF":{const r=yn(l);if(r.length<3)return null;const f=ss(r[0],o,n,a,i);return Kt(f?r[1]:r[2],o,n,a,i)}case"VLOOKUP":{const r=yn(l);if(r.length<3)return null;const f=Kt(r[0],o,n,a,i),m=Nn(r[1].trim(),n,a);if(!m)return null;const y=Kt(r[2],o,n,a,i),k=typeof y=="number"?y:parseFloat(String(y));if(isNaN(k))return null;const d=m.sc+(k-1);if(d<m.sc||d>m.ec)return null;if(r.length>=4?ho(Kt(r[3],o,n,a,i)):!1){let v=-1,R=-1/0;for(let G=m.sr;G<=m.er;G++){const te=Tl(m.sc,G,o,n,a);typeof te=="number"&&typeof f=="number"&&te<=f&&te>R&&(R=te,v=G)}return v>=0?Tl(d,v,o,n,a):null}for(let v=m.sr;v<=m.er;v++){const R=Tl(m.sc,v,o,n,a);if(Po(R,f))return Tl(d,v,o,n,a)}return null}case"CONCATENATE":{const r=yn(l);let f="";for(const m of r){const y=Kt(m,o,n,a,i);f+=y===null?"":typeof y=="number"?String(y):y}return f}case"MAX":case"MIN":{const r=Nn(l.trim(),n,a);if(!r)return null;const f=[];for(let m=r.sc;m<=r.ec;m++)for(let y=r.sr;y<=r.er;y++){const k=Tl(m,y,o,n,a);typeof k=="number"&&f.push(k)}return f.length===0?null:e==="MAX"?Math.max(...f):Math.min(...f)}case"STDEV":{const r=Nn(l.trim(),n,a);if(!r)return null;const f=[];for(let d=r.sc;d<=r.ec;d++)for(let w=r.sr;w<=r.er;w++){const v=Tl(d,w,o,n,a);typeof v=="number"&&f.push(v)}const m=f.length;if(m<2)return null;const y=f.reduce((d,w)=>d+w,0)/m,k=f.reduce((d,w)=>d+Math.pow(w-y,2),0)/(m-1);return Math.sqrt(k)}case"SIN":{const r=yn(l);if(r.length!==1)return null;const f=Kt(r[0],o,n,a,i);return typeof f!="number"?null:Math.sin(f)}case"SUMIF":{const r=yn(l);if(r.length<2||r.length>3)return null;const f=Nn(r[0].trim(),n,a);if(!f)return null;const m=r.length===3?Nn(r[2].trim(),n,a):f;if(!m)return null;let y=0;for(let k=f.sr;k<=f.er;k++)for(let d=f.sc;d<=f.ec;d++){const w=Tl(d,k,o,n,a);cs(w,r[1])&&(y+=$o(m.sc+(d-f.sc),m.sr+(k-f.sr),o,n,a))}return y}case"PMT":{const r=yn(l);if(r.length<3||r.length>5)return null;const f=Kt(r[0],o,n,a,i),m=Kt(r[1],o,n,a,i),y=Kt(r[2],o,n,a,i);if(typeof f!="number"||typeof m!="number"||typeof y!="number")return null;const k=r.length>=4?Kt(r[3],o,n,a,i):0,d=typeof k=="number"?k:0,w=r.length>=5?Kt(r[4],o,n,a,i):0,v=ho(w)?1:0;if(f===0)return m===0?null:-(y+d)/m;const R=Math.pow(1+f,m);return-(d+y*R)*f/((1+f*v)*(R-1))}default:return null}}function jn(e,l,o){const n=[],a=/(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;let i;for(;(i=a.exec(e))!==null;){const r=On(i[1],l,o);if(r)if(i[2]){const f=On(i[2],l,o);if(!f)continue;for(let m=Math.min(r.col,f.col);m<=Math.max(r.col,f.col);m++)for(let y=Math.min(r.row,f.row);y<=Math.max(r.row,f.row);y++)n.push(Dn(m,y))}else n.push(Dn(r.col,r.row))}return n}function Yo(e,l,o,n,a){const i=o[Dn(e,l)];if(!i)return"";const r=i.value;if(!r.startsWith("="))return r;const f=Wo(Dn(e,l),o,n,a);return f===null?"#ERROR":String(f)}function Xo(e,l,o,n,a,i){return l===0&&o===0?e:e.replace(/(\$?)([A-Z]+)(\$?)(\d+)/gi,(r,f,m,y,k)=>{const d=f?mo(m):mo(m)+l,w=y?parseInt(k,10)-1:parseInt(k,10)-1+o;let v;d<0?v="A":d>=n?v=i(n-1):v=i(d);let R;return w<0?R="1":w>=a?R=String(a):R=String(w+1),(f||"")+v+(y||"")+R})}class ds{constructor(){this.deps=new Map,this.rev=new Map,this.dirty=new Set}clear(l){var n;const o=this.deps.get(l);if(o){for(const a of o)(n=this.rev.get(a))==null||n.delete(l);this.deps.delete(l)}}set(l,o){if(this.clear(l),o.length!==0){this.deps.set(l,o);for(const n of o)this.rev.has(n)||this.rev.set(n,new Set),this.rev.get(n).add(l)}}markDirty(l){const o=[l];for(;o.length>0;){const n=o.pop(),a=this.rev.get(n);if(a)for(const i of a)this.dirty.has(i)||(this.dirty.add(i),o.push(i))}}getDirtyAndClear(){const l=this.dirty;return this.dirty=new Set,l}rebuild(l,o,n){this.deps.clear(),this.rev.clear(),this.dirty.clear(),Ln.clear();for(const[a,i]of Object.entries(l))if(i.value.startsWith("=")){const r=jn(i.value.slice(1),o,n);this.set(a,r)}}}const fs={class:"ifn-dialog__header"},ms={class:"ifn-dialog__title"},ps={class:"ifn-dialog__body"},hs={class:"ifn-dialog__field"},gs={class:"ifn-dialog__label"},ys={key:0,class:"ifn-dialog__desc"},bs={class:"ifn-dialog__field"},Cs={class:"ifn-dialog__label"},ws={class:"ifn-dialog__footer"},vs=["disabled"],ks=Qt(t.defineComponent({__name:"insertFunctionDialog",props:{modelOpen:{type:Boolean,default:!1},locale:{default:"zh-CN"}},emits:["update:modelOpen","insert","cancel"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref(""),r=t.ref(""),f=t.ref(null),m=t.ref(null),y={SUM:"fnDescSum",AVERAGE:"fnDescAverage",COUNT:"fnDescCount",IF:"fnDescIf",VLOOKUP:"fnDescVlookup",CONCATENATE:"fnDescConcatenate",MAX:"fnDescMax",MIN:"fnDescMin",SIN:"fnDescSin",SUMIF:"fnDescSumif",PMT:"fnDescPmt",STDEV:"fnDescStdev"},k=t.computed(()=>zo.map(q=>({label:q.name,value:q.name}))),d=t.computed(()=>{const q=String(i.value??"");return q?N(o.locale,y[q]??""):""}),w=t.computed(()=>as(r.value)),v=t.computed(()=>i.value===""||i.value===null||!r.value.trim()||!w.value.ok?!1:w.value.name===String(i.value).toUpperCase());t.watch(()=>o.modelOpen,q=>{q&&!a.value?R():!q&&a.value&&G()});function R(){r.value="",i.value="",a.value=!0,o.modelOpen!==void 0&&n("update:modelOpen",!0),t.nextTick(()=>{const q=f.value;if(q)try{q.focus({preventScroll:!0}),q.setSelectionRange(q.value.length,q.value.length)}catch{}})}function G(){a.value=!1,o.modelOpen!==void 0&&n("update:modelOpen",!1)}function te(q){i.value=q;const se=zo.find(Ne=>Ne.name===String(q));se&&(r.value="",Y(se.snippet))}function Y(q){const se=r.value,Ne=f.value,Qe=Ne?Ne.selectionStart??se.length:se.length,Ge=Ne?Ne.selectionEnd??se.length:se.length,be=se.trim()?q:"="+q;r.value=se.slice(0,Qe)+be+se.slice(Ge),t.nextTick(()=>{const ve=f.value;if(!ve)return;const Xe=Qe+be.length;try{ve.focus({preventScroll:!0}),ve.setSelectionRange(Xe,Xe)}catch{}})}function K(){n("insert",r.value),G()}function C(){n("cancel"),G()}function j(q){q.key==="Escape"&&(q.stopPropagation(),C())}return(q,se)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"ifn-dialog"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"ifn-dialog__mask",onMousedown:t.withModifiers(C,["self"]),onKeydown:j},[t.createElementVNode("div",{ref_key:"dialogRef",ref:m,class:"ifn-dialog",onMousedown:se[1]||(se[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",fs,[t.createElementVNode("span",ms,t.toDisplayString(t.unref(N)(e.locale,"insertFunctionTitle")),1),t.createElementVNode("button",{class:"ifn-dialog__close",type:"button",onClick:C},[...se[2]||(se[2]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])])]),t.createElementVNode("div",ps,[t.createElementVNode("div",hs,[t.createElementVNode("label",gs,t.toDisplayString(t.unref(N)(e.locale,"insertFunctionSelectLabel")),1),t.createVNode(el,{class:"ifn-dialog__dropdown","model-value":i.value,options:k.value,searchable:!0,"search-placeholder":t.unref(N)(e.locale,"insertFunctionSearchPlaceholder"),"fallback-label":t.unref(N)(e.locale,"insertFunctionPlaceholder"),title:t.unref(N)(e.locale,"insertFunctionSelectLabel"),"onUpdate:modelValue":te},null,8,["model-value","options","search-placeholder","fallback-label","title"]),d.value?(t.openBlock(),t.createElementBlock("div",ys,t.toDisplayString(d.value),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",bs,[t.createElementVNode("label",Cs,t.toDisplayString(t.unref(N)(e.locale,"insertFunctionFormulaLabel")),1),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textareaRef",ref:f,"onUpdate:modelValue":se[0]||(se[0]=Ne=>r.value=Ne),class:"ifn-dialog__textarea",spellcheck:"false"},null,512),[[t.vModelText,r.value]])])]),t.createElementVNode("div",ws,[t.createElementVNode("button",{class:"ifn-dialog__btn ifn-dialog__btn--primary",type:"button",disabled:!v.value,onClick:K},t.toDisplayString(t.unref(N)(e.locale,"insertFunctionBtn")),9,vs),t.createElementVNode("button",{class:"ifn-dialog__btn",type:"button",onClick:C},t.toDisplayString(t.unref(N)(e.locale,"cancel")),1)])],544)],32)):t.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-f4e459b6"]]),_n="__filter_blank__";function yo(e,l,o,n){if(Gl(e))return Number(e);if(n==="date"){const a=Tn(e,o);if(a)return a.serial}return null}function Zn(e,l,o){if(e==null)return null;if(Gl(e))return Number(e);if(l==="date"){const n=Tn(e,o);if(n)return n.serial}return null}function Es(e,l,o,n,a){const i=wl(l,o,n);switch(e.operator){case"blank":return l.trim()==="";case"notBlank":return l.trim()!=="";case"equals":case"notEquals":{const r=e.operator==="equals";if(a==="number"||a==="date"){const m=yo(l,o,n,a),y=Zn(e.value,a,n);return m==null||y==null?!1:r?m===y:m!==y}const f=i.toLowerCase()===(e.value??"").toLowerCase();return r?f:!f}case"contains":return i.toLowerCase().includes((e.value??"").toLowerCase());case"notContains":return!i.toLowerCase().includes((e.value??"").toLowerCase());case"startsWith":return i.toLowerCase().startsWith((e.value??"").toLowerCase());case"endsWith":return i.toLowerCase().endsWith((e.value??"").toLowerCase());case"gt":case"gte":case"lt":case"lte":{const r=yo(l,o,n,a),f=Zn(e.value,a,n);return r==null||f==null?!1:e.operator==="gt"?r>f:e.operator==="gte"?r>=f:e.operator==="lt"?r<f:r<=f}case"between":{const r=yo(l,o,n,a),f=Zn(e.value,a,n),m=Zn(e.value2,a,n);if(r==null||f==null||m==null)return!1;const y=Math.min(f,m),k=Math.max(f,m);return r>=y&&r<=k}}return!0}function jo(e,l,o,n){if(e.type==="values"){const a=e.values??[];if(a.length===0)return!0;if(l.trim()==="")return a.includes(_n);const i=wl(l,o,n);return a.includes(l)||a.includes(i)}return e.condition?Es(e.condition,l,o,n,e.type):!0}function Ss(e,l,o,n){if(!e)return!0;const{columns:a,range:i}=e;for(const r in a){const f=Number(r);if(f<i.startCol||f>i.endCol)continue;const m=a[r],y=o.getValue(f,l),k=o.getFormat(f,l);if(!jo(m,y,k,n))return!1}return!0}function Rs(e,l,o,n){const a=new Set,i=[];let r=!1;const{range:f,columns:m}=e;for(let k=f.startRow+1;k<=f.endRow;k++){let d=!0;for(const R in m){const G=Number(R);if(G===l)continue;const te=m[R];if(!jo(te,o.getValue(G,k),o.getFormat(G,k),n)){d=!1;break}}if(!d)continue;const w=o.getValue(l,k),v=wl(w,o.getFormat(l,k),n);if(w.trim()===""){r=!0;continue}a.has(v)||(a.add(v),i.push(v))}return i.length>0&&i.every(k=>Gl(k))?i.sort((k,d)=>Number(k)-Number(d)):i.sort((k,d)=>k.localeCompare(d,n,{numeric:!0})),{values:i,hasBlank:r}}function Zo(e){var l;return e?e.type==="values"?(((l=e.values)==null?void 0:l.length)??0)>0:!!e.condition:!1}const Ms={class:"filter-popup__head"},xs={class:"filter-popup__head-label"},Bs={key:0,class:"filter-popup__head-badge"},Ts={class:"filter-popup__search"},Ds=["placeholder"],Ns={class:"filter-popup__tools"},Fs={class:"filter-popup__count"},Is=["checked","onChange"],As={class:"filter-popup__item-label"},Vs={key:0,class:"filter-popup__item-note"},Hs={key:0,class:"filter-popup__empty"},Os={class:"filter-popup__modes"},Ls={key:1,class:"filter-popup__cond"},zs={class:"filter-popup__cond-row"},_s=["value"],$s={key:0,class:"filter-popup__cond-row"},Ws={class:"filter-popup__cond-and"},Ps={key:1,class:"filter-popup__cond-row"},Us=["placeholder"],Ks={class:"filter-popup__footer"},bo=248,qn=28,Gs=252,Ys=Qt(t.defineComponent({__name:"filter-popup",props:{col:{},anchor:{},locale:{default:"zh-CN"},headerLabel:{},getFilter:{},setFilter:{},setFilterColumn:{},clearFilterColumn:{},getColumnCandidates:{},close:{}},setup(e){const l=e,o=t.ref(null),n=t.ref(null),a=t.ref(null),i=t.ref({left:0,top:0}),r=t.ref("values"),f=t.ref(""),m=t.ref(new Set),y=t.ref(!1),k=t.ref(0),d=t.ref(null),w=t.ref("equals"),v=t.ref(""),R=t.ref(""),G=t.computed(()=>l.getColumnCandidates(l.col)),te=t.computed(()=>f.value.trim()!==""),Y=t.computed(()=>{const A=f.value.trim().toLowerCase();return A?G.value.values.filter(c=>c.toLowerCase().includes(A)):G.value.values}),K=t.computed(()=>{const A=Y.value.map(c=>({key:c,label:c,isBlank:!1}));return G.value.hasBlank&&!te.value&&A.push({key:_n,label:N(l.locale,"filterBlank"),isBlank:!0}),A}),C=Math.ceil(Gs/qn),j=t.computed(()=>Math.max(0,Math.floor(k.value/qn)-2)),q=t.computed(()=>Math.min(K.value.length,j.value+C+4)),se=t.computed(()=>K.value.slice(j.value,q.value)),Ne=t.computed(()=>j.value*qn),Qe=t.computed(()=>Math.max(0,(K.value.length-q.value)*qn));function Ge(A){k.value=A.target.scrollTop}const be=["equals","notEquals","contains","notContains","startsWith","endsWith"],ve=["equals","notEquals","gt","gte","lt","lte","between"],Xe={equals:"filterEquals",notEquals:"filterNotEquals",contains:"filterContains",notContains:"filterNotContains",startsWith:"filterStartsWith",endsWith:"filterEndsWith",gt:"filterGreaterThan",gte:"filterGreaterThanOrEqual",lt:"filterLessThan",lte:"filterLessThanOrEqual",between:"filterBetween",blank:"filterBlank",notBlank:"filterNonBlank"},Je=t.computed(()=>r.value==="text"?be:ve),gt=t.computed(()=>{var u;const A=l.getFilter(),c=A==null?void 0:A.columns[l.col];return c?c.type==="values"?(((u=c.values)==null?void 0:u.length)??0)>0:!!c.condition:!1});function Ze(){const A=l.getFilter(),c=A==null?void 0:A.columns[l.col];c&&c.type==="values"?(m.value=new Set((c.values??[]).filter(u=>u!==_n)),y.value=(c.values??[]).includes(_n)):c&&c.condition?(r.value=c.type,w.value=c.condition.operator,v.value=c.condition.value??"",R.value=c.condition.value2??""):(m.value=new Set(G.value.values),y.value=G.value.hasBlank)}function tt(){if(!l.getFilter())return;const c=G.value.values,u=G.value.hasBlank;if(m.value.size===c.length&&c.every(H=>m.value.has(H))&&y.value===u)l.setFilterColumn(l.col,null);else{const H=[...m.value];y.value&&H.push(_n),l.setFilterColumn(l.col,{type:"values",values:H})}}function et(A){const c=new Set(m.value);c.has(A)?c.delete(A):c.add(A),m.value=c}function oe(){y.value=!y.value}function me(){const A=te.value?Y.value:G.value.values,c=new Set(m.value);A.forEach(u=>c.add(u)),m.value=c,y.value=!0}function g(){m.value=new Set,y.value=!1}function I(A){r.value=A,w.value=A==="text"?"contains":"equals",v.value="",R.value=""}function L(){r.value="values",Ze()}function $(){const A={operator:w.value,value:v.value};r.value!=="text"&&w.value==="between"&&(A.value2=R.value),v.value.trim()!==""&&(l.setFilterColumn(l.col,{type:r.value,condition:A}),l.close())}function J(){m.value=new Set(G.value.values),y.value=G.value.hasBlank}function ie(){tt(),l.close()}function re(){d.value&&l.setFilter(d.value),l.close()}function pe(A){const c=o.value;c&&A.target instanceof Node&&c.contains(A.target)||l.close()}function ce(A){A.key==="Escape"&&re()}return t.onMounted(async()=>{var p,H;d.value=l.getFilter()?JSON.parse(JSON.stringify(l.getFilter())):null,Ze(),await t.nextTick();const A=((p=o.value)==null?void 0:p.offsetHeight)??400;let c=l.anchor.x+15-bo,u=l.anchor.y+24;c<4&&(c=Math.max(4,l.anchor.x)),c+bo>window.innerWidth-4&&(c=Math.max(4,window.innerWidth-bo-4)),u+A>window.innerHeight-4&&(u=Math.max(4,l.anchor.y-A-4)),i.value={left:c,top:u},(H=a.value)==null||H.focus(),document.addEventListener("pointerdown",pe,!0),document.addEventListener("keydown",ce,!0)}),t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",pe,!0),document.removeEventListener("keydown",ce,!0)}),(A,c)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createElementVNode("div",{ref_key:"rootRef",ref:o,class:"filter-popup",style:t.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onPointerdown:c[9]||(c[9]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",Ms,[t.createElementVNode("span",xs,t.toDisplayString(e.headerLabel||t.unref(ht)(e.col)),1),gt.value?(t.openBlock(),t.createElementBlock("span",Bs,t.toDisplayString(t.unref(N)(e.locale,"filterActive")),1)):t.createCommentVNode("",!0)]),r.value==="values"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",Ts,[t.withDirectives(t.createElementVNode("input",{ref_key:"searchInputRef",ref:a,"onUpdate:modelValue":c[0]||(c[0]=u=>f.value=u),class:"filter-popup__search-input",type:"text",placeholder:t.unref(N)(e.locale,"filterSearchPlaceholder")},null,8,Ds),[[t.vModelText,f.value]])]),t.createElementVNode("div",Ns,[t.createElementVNode("button",{class:"filter-popup__tool",onClick:me},t.toDisplayString(t.unref(N)(e.locale,"filterSelectAll")),1),t.createElementVNode("button",{class:"filter-popup__tool",onClick:g},t.toDisplayString(t.unref(N)(e.locale,"filterClearAll")),1),t.createElementVNode("span",Fs,t.toDisplayString(t.unref(N)(e.locale,"filterFilteredCount").replace("{n}",String(G.value.values.length))),1)]),t.createElementVNode("div",{ref_key:"listRef",ref:n,class:"filter-popup__list",onScroll:Ge},[t.createElementVNode("div",{style:t.normalizeStyle({height:Ne.value+"px"})},null,4),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(se.value,u=>(t.openBlock(),t.createElementBlock("label",{key:u.key,class:"filter-popup__item"},[t.createElementVNode("input",{type:"checkbox",checked:u.isBlank?y.value:m.value.has(u.key),onChange:p=>u.isBlank?oe():et(u.key)},null,40,Is),t.createElementVNode("span",As,t.toDisplayString(u.label),1),u.isBlank?(t.openBlock(),t.createElementBlock("span",Vs,"("+t.toDisplayString(t.unref(N)(e.locale,"filterBlank"))+")",1)):t.createCommentVNode("",!0)]))),128)),t.createElementVNode("div",{style:t.normalizeStyle({height:Qe.value+"px"})},null,4),K.value.length===0?(t.openBlock(),t.createElementBlock("div",Hs,t.toDisplayString(t.unref(N)(e.locale,"filterNoData")),1)):t.createCommentVNode("",!0)],544),t.createElementVNode("div",Os,[t.createElementVNode("button",{class:"filter-popup__mode",onClick:c[1]||(c[1]=u=>I("text"))},t.toDisplayString(t.unref(N)(e.locale,"filterText")),1),t.createElementVNode("button",{class:"filter-popup__mode",onClick:c[2]||(c[2]=u=>I("number"))},t.toDisplayString(t.unref(N)(e.locale,"filterNumber")),1),t.createElementVNode("button",{class:"filter-popup__mode",onClick:c[3]||(c[3]=u=>I("date"))},t.toDisplayString(t.unref(N)(e.locale,"filterDate")),1)])],64)):(t.openBlock(),t.createElementBlock("div",Ls,[t.createElementVNode("button",{class:"filter-popup__cond-back",onClick:L},"← "+t.toDisplayString(t.unref(N)(e.locale,"filterCustom")),1),t.createElementVNode("div",zs,[t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":c[4]||(c[4]=u=>w.value=u),class:"filter-popup__cond-select"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Je.value,u=>(t.openBlock(),t.createElementBlock("option",{key:u,value:u},t.toDisplayString(t.unref(N)(e.locale,Xe[u])),9,_s))),128))],512),[[t.vModelSelect,w.value]])]),w.value==="between"?(t.openBlock(),t.createElementBlock("div",$s,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":c[5]||(c[5]=u=>v.value=u),class:"filter-popup__cond-input",type:"text"},null,512),[[t.vModelText,v.value]]),t.createElementVNode("span",Ws,t.toDisplayString(t.unref(N)(e.locale,"filterAnd")),1),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":c[6]||(c[6]=u=>R.value=u),class:"filter-popup__cond-input",type:"text"},null,512),[[t.vModelText,R.value]])])):(t.openBlock(),t.createElementBlock("div",Ps,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":c[7]||(c[7]=u=>v.value=u),class:"filter-popup__cond-input",type:"text",placeholder:r.value==="date"?"2024-01-01":"",onKeydown:t.withKeys($,["enter"])},null,40,Us),[[t.vModelText,v.value]])]))])),t.createElementVNode("div",Ks,[t.createElementVNode("button",{class:"filter-popup__btn filter-popup__btn--clear",onClick:J},t.toDisplayString(t.unref(N)(e.locale,"clearFilter")),1),c[10]||(c[10]=t.createElementVNode("span",{class:"filter-popup__footer-spacer"},null,-1)),t.createElementVNode("button",{class:"filter-popup__btn",onClick:re},t.toDisplayString(t.unref(N)(e.locale,"cancelFilter")),1),t.createElementVNode("button",{class:"filter-popup__btn filter-popup__btn--primary",onClick:c[8]||(c[8]=u=>r.value==="values"?ie():$())},t.toDisplayString(t.unref(N)(e.locale,"filterOk")),1)])],36)]))}}),[["__scopeId","data-v-ec90eb74"]]);function rn(e,l){return`${e},${l}`}function qo(e,l){if(e.startsWith("="))return{kind:"formula",formula:e};const o=Tn(e,l);if(o)return{kind:"date",serial:o.serial};const n=/^(.*?)(\d+)$/.exec(e);if(n){const a=n[1],i=n[2];if(a!==""&&/^\d+$/.test(i))return{kind:"text-number",prefix:a,num:parseInt(i,10),digits:i.length}}return Gl(e)?{kind:"number",num:parseFloat(e)}:{kind:"text",text:e}}function Co(e,l){for(let o=2;o<e.length;o++)if(e[o]-e[o-1]!==l)return!1;return!0}function Jo(e){const l=e.length;if(l===0)return{kind:"copy",sourceValues:[]};if(e.some(o=>o.kind==="formula"))return{kind:"formula"};if(e.every(o=>o.kind==="date")){const o=e[0],n=l>=2?e[1].serial-o.serial:1;return{kind:"date-linear",baseSerial:o.serial,step:n,sourceLen:l}}if(e.every(o=>o.kind==="number")){if(l===1)return{kind:"copy",sourceValues:[...e]};const o=e.map(a=>a.num),n=o[1]-o[0];return Co(o,n)?{kind:"linear",step:n,base:o[0],sourceLen:l}:{kind:"copy",sourceValues:[...e]}}if(e.every(o=>o.kind==="text-number")){const o=e[0];if(e.every(a=>a.kind==="text-number"&&a.prefix===o.prefix)){if(l===1)return{kind:"copy",sourceValues:[...e]};const a=e.map(r=>r.num),i=a[1]-a[0];if(Co(a,i))return{kind:"text-number",prefix:o.prefix,step:i,base:o.num,digits:o.digits,sourceLen:l}}return{kind:"copy",sourceValues:[...e]}}if(e.every(o=>o.kind==="text")){const o=e.every(n=>n.text.length===1&&/[a-zA-Z]/.test(n.text));if(l>=2&&o){const n=e.map(i=>i.text.charCodeAt(0)),a=n[1]-n[0];if(a!==0&&Co(n,a))return{kind:"text-series",step:a,baseCharCode:n[0],sourceLen:l}}return{kind:"copy",sourceValues:[...e]}}return{kind:"copy",sourceValues:[...e]}}function Qo(e,l,o){switch(e.kind){case"copy":{const n=e.sourceValues.length;return n===0?{kind:"text",text:""}:e.sourceValues[l%n]}case"linear":return{kind:"number",num:e.base+e.step*(o+l)};case"text-number":return{kind:"text-number",prefix:e.prefix,num:e.base+e.step*(o+l),digits:e.digits};case"date-linear":return{kind:"date",serial:e.baseSerial+e.step*(o+l)};case"text-series":return{kind:"text",text:String.fromCharCode(e.baseCharCode+e.step*(o+l))};case"formula":return{kind:"formula",formula:""}}}function er(e,l){switch(e.kind){case"copy":{const o=e.sourceValues.length;return o===0?{kind:"text",text:""}:e.sourceValues[o-1-l%o]}case"linear":return{kind:"number",num:e.base-e.step*(l+1)};case"text-number":return{kind:"text-number",prefix:e.prefix,num:e.base-e.step*(l+1),digits:e.digits};case"date-linear":return{kind:"date",serial:e.baseSerial-e.step*(l+1)};case"text-series":return{kind:"text",text:String.fromCharCode(e.baseCharCode-e.step*(l+1))};case"formula":return{kind:"formula",formula:""}}}function Jn(e,l){switch(e.kind){case"formula":return{value:e.formula,styleId:l};case"number":return{value:String(e.num),styleId:l};case"text":return{value:e.text,styleId:l};case"text-number":return{value:e.prefix+String(e.num).padStart(e.digits,"0"),styleId:l};case"date":return{value:String(e.serial),styleId:l}}}function tr(e,l){const o=l.row<e.startRow?e.startRow-l.row:l.row>e.endRow?l.row-e.endRow:0,n=l.col<e.startCol?e.startCol-l.col:l.col>e.endCol?l.col-e.endCol:0;if(o===0&&n===0)return null;const a=o>=n?l.row<e.startRow?"up":"down":l.col<e.startCol?"left":"right";let i;switch(a){case"down":i={startCol:e.startCol,startRow:e.endRow+1,endCol:e.endCol,endRow:l.row};break;case"up":i={startCol:e.startCol,startRow:l.row,endCol:e.endCol,endRow:e.startRow-1};break;case"right":i={startCol:e.endCol+1,startRow:e.startRow,endCol:l.col,endRow:e.endRow};break;case"left":i={startCol:l.col,startRow:e.startRow,endCol:e.startCol-1,endRow:e.endRow};break}return{targetRange:i,direction:a}}function lr(e,l,o,n,a,i){return Xo(e,o.col-l.col,o.row-l.row,n,a,i)}function nr(e,l){return!(e.endCol<l.startCol||e.startCol>l.endCol||e.endRow<l.startRow||e.startRow>l.endRow)}function Xs(e,l){return l.startCol>=e.startCol&&l.endCol<=e.endCol&&l.startRow>=e.startRow&&l.endRow<=e.endRow}function wo(e,l,o){const n=Object.keys(o);for(const a of n){const i=o[a];if(nr(e,i)&&!Xs(e,i))return!1}for(const a of n){const i=o[a];if(nr(l,i))return!1}return!0}function or(e,l,o,n){const a=l.length;if(a!==0){if(e.kind==="copy"){const i=n?a-1-o%a:o%a;return l[i]}return n?l[0]:l[a-1]}}function js(e,l,o,n,a,i,r,f){const m={cells:{},merges:{}},y=n==="up"||n==="down",k=n==="up"||n==="left";if(y){const d=e.endRow-e.startRow+1;for(let w=e.startCol;w<=e.endCol;w++){const v=[],R=[];for(let Y=e.startRow;Y<=e.endRow;Y++){const K=o.cells[rn(w,Y)];v.push(K?qo(K.value,a):{kind:"text",text:""}),R.push(K==null?void 0:K.styleId)}const G=Jo(v),te=v.length;for(let Y=l.startRow;Y<=l.endRow;Y++){const K=k?l.endRow-Y:Y-l.startRow;if(G.kind==="formula"){const C=k?e.endRow-((l.endRow-Y)%d+d)%d:e.startRow+((Y-e.startRow)%d+d)%d,j=o.cells[rn(w,C)],q=j?j.value:"",se=lr(q,{col:w,row:C},{col:w,row:Y},i,r,f);m.cells[rn(w,Y)]=Jn({kind:"formula",formula:se},j==null?void 0:j.styleId)}else{const C=k?er(G,K):Qo(G,K,te),j=or(G,R,K,k);m.cells[rn(w,Y)]=Jn(C,j)}}}}else{const d=e.endCol-e.startCol+1;for(let w=e.startRow;w<=e.endRow;w++){const v=[],R=[];for(let Y=e.startCol;Y<=e.endCol;Y++){const K=o.cells[rn(Y,w)];v.push(K?qo(K.value,a):{kind:"text",text:""}),R.push(K==null?void 0:K.styleId)}const G=Jo(v),te=v.length;for(let Y=l.startCol;Y<=l.endCol;Y++){const K=k?l.endCol-Y:Y-l.startCol;if(G.kind==="formula"){const C=k?e.endCol-((l.endCol-Y)%d+d)%d:e.startCol+((Y-e.startCol)%d+d)%d,j=o.cells[rn(C,w)],q=j?j.value:"",se=lr(q,{col:C,row:w},{col:Y,row:w},i,r,f);m.cells[rn(Y,w)]=Jn({kind:"formula",formula:se},j==null?void 0:j.styleId)}else{const C=k?er(G,K):Qo(G,K,te),j=or(G,R,K,k);m.cells[rn(Y,w)]=Jn(C,j)}}}}return m}class Zs{constructor(l){if(l&&l.length>0){this.styles=l,this.index=new Map;for(let o=0;o<this.styles.length;o++){const n=this.stableKey(this.styles[o]);this.index.set(n,o)}}else this.styles=[{}],this.index=new Map,this.index.set(this.stableKey({}),0)}stableKey(l){const o=Object.keys(l).sort(),n={};for(const a of o)n[a]=l[a];return JSON.stringify(n)}get(l){const o=this.styles[l];return o?l===0?o:Object.freeze(o):{}}getId(l){if(!l||Object.keys(l).length===0)return 0;const o=this.stableKey(l),n=this.index.get(o);if(n!==void 0)return n;const a=this.styles.length,i=Object.freeze({...l});return this.styles.push(i),this.index.set(o,a),a}getStyles(){return[...this.styles]}setStyles(l){this.styles=l,this.index=new Map;for(let o=0;o<this.styles.length;o++){const n=this.stableKey(this.styles[o]);this.index.set(n,o)}}compactStyles(l){const o=new Set;o.add(0);for(const r in l){const f=l[r].styleId??0;o.add(f)}const n=new Map,a=[{}];n.set(0,0);const i=Array.from(o).sort((r,f)=>r-f);for(const r of i)if(r!==0&&r<this.styles.length){const f=a.length;n.set(r,f),a.push(this.styles[r])}for(const r in l){const f=l[r],m=f.styleId??0,y=n.get(m);y!==void 0&&y!==m&&(f.styleId=y)}this.styles=a,this.index=new Map;for(let r=0;r<this.styles.length;r++){const f=this.stableKey(this.styles[r]);this.index.set(f,r)}return a}}function qs(e,l){if(!e)return null;const o=e.styleId;return o===void 0||o===0?null:l[o]??null}function rr(e){const l=new Zs,o={};for(const[n,a]of Object.entries(e)){const i={value:a.value};a.styleId!==void 0&&a.styleId>0&&(i.styleId=a.styleId),a.style&&Object.keys(a.style).length>0&&(i.styleId=l.getId(a.style)),i.styleId===0&&delete i.styleId,o[n]=i}return{cells:o,styles:l.getStyles()}}function Js(e){const l={};for(const[o,n]of Object.entries(e)){const a={value:n.value};n.styleId!==void 0&&n.styleId>0&&(a.styleId=n.styleId),l[o]=a}return l}class Qs{constructor(l){if(l&&l.length>0){this.borders=l,this.index=new Map;for(let o=0;o<this.borders.length;o++){const n=this.stableKey(this.borders[o]);this.index.set(n,o)}}else this.borders=[{}],this.index=new Map,this.index.set(this.stableKey({}),0)}stableKey(l){const o=["top","right","bottom","left"],n={};for(const a of o){const i=l[a];if(i&&(i.width!==void 0||i.color!==void 0||i.style!==void 0)){const r={};i.width!==void 0&&(r.width=i.width),i.color!==void 0&&(r.color=i.color),i.style!==void 0&&(r.style=i.style),n[a]=r}}return JSON.stringify(n)}get(l){const o=this.borders[l];return o?l===0?o:Object.freeze(o):{}}getId(l){if(!l||this.isEmptyBorder(l))return 0;const o=this.stableKey(l),n=this.index.get(o);if(n!==void 0)return n;const a=this.borders.length,i=Object.freeze(this.deepCloneBorder(l));return this.borders.push(i),this.index.set(o,a),a}isEmptyBorder(l){return!l.top&&!l.right&&!l.bottom&&!l.left}deepCloneBorder(l){const o={};return l.top&&(o.top={...l.top}),l.right&&(o.right={...l.right}),l.bottom&&(o.bottom={...l.bottom}),l.left&&(o.left={...l.left}),o}getBorders(){return[...this.borders]}setBorders(l){this.borders=l,this.index=new Map;for(let o=0;o<this.borders.length;o++){const n=this.stableKey(this.borders[o]);this.index.set(n,o)}}compactBorders(l){const o=new Set;o.add(0);for(const r of l){const f=r.borderId??0;o.add(f)}const n=new Map,a=[{}];n.set(0,0);const i=Array.from(o).sort((r,f)=>r-f);for(const r of i)if(r!==0&&r<this.borders.length){const f=a.length;n.set(r,f),a.push(this.borders[r])}for(const r of l){const f=r.borderId??0,m=n.get(f);m!==void 0&&m!==f&&(r.borderId=m)}this.borders=a,this.index=new Map;for(let r=0;r<this.borders.length;r++){const f=this.stableKey(this.borders[r]);this.index.set(f,r)}return a}}function eu(e,l,o,n){if(!e)return;const a=e.styleId??0,i=o[a];if(!i)return;const r=i.borderId??0;if(r===0)return;const f=n.get(r);if(f)return f[l]}function tu(e,l,o,n,a,i){const r=n[e.styleId??0]??{},f=r.borderId??0,m=f>0?a.get(f):{},y={top:m.top?{...m.top}:void 0,right:m.right?{...m.right}:void 0,bottom:m.bottom?{...m.bottom}:void 0,left:m.left?{...m.left}:void 0};o?y[l]={...o}:y[l]=void 0;const k=a.getId(y),d={...r};k===0?delete d.borderId:d.borderId=k,delete d.borderTopWidth,delete d.borderBottomWidth,delete d.borderLeftWidth,delete d.borderRightWidth,delete d.borderColor,Object.keys(d).length===0?e.styleId=0:e.styleId=i(d)}function ar(e){const l=new Qs,o=[];for(const n of e){if(!(n.borderTopWidth!==void 0||n.borderBottomWidth!==void 0||n.borderLeftWidth!==void 0||n.borderRightWidth!==void 0)){o.push(n);continue}const i=typeof n.borderColor=="string"?n.borderColor:void 0,r={};n.borderTopWidth!==void 0&&n.borderTopWidth>0&&(r.top={width:n.borderTopWidth,color:i}),n.borderBottomWidth!==void 0&&n.borderBottomWidth>0&&(r.bottom={width:n.borderBottomWidth,color:i}),n.borderLeftWidth!==void 0&&n.borderLeftWidth>0&&(r.left={width:n.borderLeftWidth,color:i}),n.borderRightWidth!==void 0&&n.borderRightWidth>0&&(r.right={width:n.borderRightWidth,color:i});const f=l.getId(r),m={...n};delete m.borderTopWidth,delete m.borderBottomWidth,delete m.borderLeftWidth,delete m.borderRightWidth,delete m.borderColor,f>0?m.borderId=f:delete m.borderId,o.push(m)}return{styles:o,borders:l.getBorders()}}function lu(e,l){const o=t.reactive({rowCount:e.rowCount??l.rowCount,colCount:e.colCount??l.colCount,width:e.width,height:e.height,theme:e.theme??l.theme,locale:e.locale??l.locale});t.watchEffect(()=>{o.rowCount=e.rowCount??l.rowCount,o.colCount=e.colCount??l.colCount,o.width=e.width,o.height=e.height,o.theme=e.theme??l.theme,o.locale=e.locale??l.locale});const n=t.computed(()=>o.locale==="zh-CN"?"zh-CN":"en-US"),a=o.colCount,i=o.rowCount,r=t.reactive({colCount:a,rowCount:i}),f=8,m=32,y=t.reactive({}),k=t.reactive([{}]),d=t.reactive([{}]);let w=new Map;w.set("{}",0);let v=new Map;v.set("{}",0);function R(h){const S=Object.keys(h).sort(),B={};for(const W of S)B[W]=h[W];return JSON.stringify(B)}function G(h){const S=["top","right","bottom","left"],B={};for(const W of S){const X=h[W];if(X&&(X.width!==void 0||X.color!==void 0||X.style!==void 0)){const Ce={};X.width!==void 0&&(Ce.width=X.width),X.color!==void 0&&(Ce.color=X.color),X.style!==void 0&&(Ce.style=X.style),B[W]=Ce}}return JSON.stringify(B)}function te(h){if(!h||Object.keys(h).length===0)return 0;const S=R(h),B=w.get(S);if(B!==void 0)return B;const W=k.length;return k.push(Object.freeze({...h})),w.set(S,W),W}function Y(h){return qs(h,k)}function K(){w=new Map;for(let h=0;h<k.length;h++)w.set(R(k[h]),h)}function C(h){k.splice(0,k.length,...h),K()}function j(h){if(!h||!h.top&&!h.right&&!h.bottom&&!h.left)return 0;const S=G(h),B=v.get(S);if(B!==void 0)return B;const W=d.length;return d.push(Object.freeze({top:h.top?Object.freeze({...h.top}):void 0,right:h.right?Object.freeze({...h.right}):void 0,bottom:h.bottom?Object.freeze({...h.bottom}):void 0,left:h.left?Object.freeze({...h.left}):void 0})),v.set(S,W),W}function q(h){return d[h]??{}}function se(){v=new Map;for(let h=0;h<d.length;h++)v.set(G(d[h]),h)}function Ne(h){d.splice(0,d.length,...h),se()}function Qe(h,S){return eu(h,S,k,{get:B=>d[B]??{}})}function Ge(h,S){const B=p(h,S);return B?B.anchor:null}function be(h,S,B,W){const X=p(h,S),Ce=p(B,W);return!X||!Ce?!1:X.anchor===Ce.anchor}const ve=t.reactive({}),Xe=new ds,Je=t.ref(null),gt=t.ref("cell"),Ze=t.ref({col:0,row:0}),tt=t.ref(null),et=t.ref(""),oe=t.ref(new Array(r.colCount).fill(100)),me=t.ref(new Array(r.rowCount).fill(void 0)),g=t.ref(0),I=t.ref(0),L=t.reactive({rows:0,cols:0}),$=t.ref(null),J=t.shallowRef({active:!1,sourceRange:null,targetRange:null,direction:null,preview:!1}),ie=new Map;let re=null;function pe(h,S,B,W){const X=`${W} ${B} ${S}px ${h}`,Ce=ie.get(X);if(Ce)return Ce;if(!re){if(typeof document>"u")return{ascent:S*.88,descent:S*.28};re=document.createElement("canvas")}const xe=re.getContext("2d");if(!xe)return{ascent:S*.88,descent:S*.28};xe.font=X;const Fe=xe.measureText(" "),Ae=Fe.fontBoundingBoxAscent,ze=Fe.fontBoundingBoxDescent;if(typeof Ae=="number"&&typeof ze=="number"&&Ae>0&&ze>0){const al={ascent:Ae,descent:ze};return ie.set(X,al),al}const Ue=["M","中","y","Ä","0"];let dt=0,je=0;for(const al of Ue){const En=xe.measureText(al),Sn=En.actualBoundingBoxAscent||0,Vl=En.actualBoundingBoxDescent||0;Sn>dt&&(dt=Sn),Vl>je&&(je=Vl)}const ft=Math.max(dt,S*.88),Lt=Math.max(je,S*.28),kn={ascent:ft,descent:Lt};return ie.set(X,kn),kn}const ce=pe(hn,Wl,"normal","normal"),A=ce.ascent+ce.descent,c=Math.max(0,(24-A)/2);let u=(h,S)=>`${h},${S}`,p=()=>null,H=()=>Wl,ct=t.computed(()=>[0]),ae=()=>24,Pe=(h,S,B,W)=>({startCol:Math.min(h,B),startRow:Math.min(S,W),endCol:Math.max(h,B),endRow:Math.max(S,W)});function at(h,S){const B=Y(y[u(h,S)]),W=H(h,S),X=typeof(B==null?void 0:B.fontFamily)=="string"&&B.fontFamily?B.fontFamily:hn,Ce=(B==null?void 0:B.fontWeight)==="bold"?"bold":"normal",xe=(B==null?void 0:B.fontStyle)==="italic"?"italic":"normal";return pe(X,W,Ce,xe)}function St(h,S,B,W){if(!S)return[""];const X=S.split(`
|
|
2
|
-
`),Ce=[];for(const xe of X)if(!W||B<=0)Ce.push(xe);else{let
|
|
3
|
-
`).length,sn>X&&(X=sn)}}const Fe=B+W,Ae=c*2+X*Fe;return Math.min(500,Math.max(24,Math.round(Ae)))}ae=vl;function Dl(h){return me.value[h]===void 0}const ul={getValue:(h,S)=>ml(h,S),getFormat:(h,S)=>{var B;return(B=Y(y[u(h,S)]))==null?void 0:B.numberFormat}},$t=t.computed(()=>{const h=new Set,S=$.value;if(!S)return h;const{range:B}=S;for(let W=B.startRow+1;W<=B.endRow;W++)kl(W)||h.add(W);return h});function kl(h){return Ss($.value,h,ul,n.value)}function dl(){return $t.value}function fl(h){return $.value?$t.value.has(h):!1}function Nl(){return $.value?r.rowCount-$t.value.size:r.rowCount}function bn(h){let S=-1;for(let B=0;B<r.rowCount;B++)if(!fl(B)&&(S++,S===h))return B;return-1}function Yl(h){if(fl(h))return-1;let S=0;for(let B=0;B<h;B++)fl(B)||S++;return S}function an(){return $.value}function F(h,S=!1){var B,W;$.value=h,!S&&(_t(g.value,I.value),(B=De.scheduleRender)==null||B.call(De),(W=De.emitModelData)==null||W.call(De))}function D(h){var B,W;const S={range:{startCol:Math.min(h.startCol,h.endCol),endCol:Math.max(h.startCol,h.endCol),startRow:Math.min(h.startRow,h.endRow),endRow:Math.max(h.startRow,h.endRow)},columns:{}};$.value=S,_t(g.value,I.value),(B=De.scheduleRender)==null||B.call(De),(W=De.emitModelData)==null||W.call(De)}function O(){var h,S;$.value&&($.value=null,_t(g.value,I.value),(h=De.scheduleRender)==null||h.call(De),(S=De.emitModelData)==null||S.call(De))}function ue(h){var B,W;if(!$.value)return;const S={...$.value,columns:{...$.value.columns}};delete S.columns[h],$.value=S,(B=De.scheduleRender)==null||B.call(De),(W=De.emitModelData)==null||W.call(De)}function ge(h,S){var W,X;if(!$.value)return;const B={...$.value,columns:{...$.value.columns}};S?B.columns[h]=S:delete B.columns[h],$.value=B,(W=De.scheduleRender)==null||W.call(De),(X=De.emitModelData)==null||X.call(De)}function Me(h){const S=$.value;return S?Rs(S,h,ul,n.value):{values:[],hasBlank:!1}}function Se(h,S){const B=r.colCount,W=r.rowCount,X=(dt,je)=>{const ft=y[de(dt,je)];return!!ft&&(ft.value!==""||ft.styleId!==void 0)};if(!X(h,S))return null;const Ce=dt=>{for(let je=0;je<B;je++)if(X(je,dt))return!0;return!1},xe=(dt,je,ft)=>{for(let Lt=je;Lt<=ft;Lt++)if(X(dt,Lt))return!0;return!1};let Fe=S;for(;Fe>0&&Ce(Fe-1);)Fe--;let Ae=S;for(;Ae<W-1&&Ce(Ae+1);)Ae++;let ze=h;for(;ze>0&&xe(ze-1,Fe,Ae);)ze--;let Ue=h;for(;Ue<B-1&&xe(Ue+1,Fe,Ae);)Ue++;return{startCol:ze,startRow:Fe,endCol:Ue,endRow:Ae}}function he(){const h=Je.value;if(!!h&&h.startRow!==h.endRow)return{startCol:Math.min(h.startCol,h.endCol),endCol:Math.max(h.startCol,h.endCol),startRow:Math.min(h.startRow,h.endRow),endRow:Math.max(h.startRow,h.endRow)};const B=Ze.value,W=h?h.startCol:B.col,X=h?h.startRow:B.row,Ce=(ze,Ue)=>{const dt=y[de(ze,Ue)];return!!dt&&(dt.value!==""||dt.styleId!==void 0)};let xe,Fe;h?(xe=Math.min(h.startCol,h.endCol),Fe=Math.max(h.startCol,h.endCol)):(xe=B.col,Fe=B.col);let Ae=X;for(;Ae<r.rowCount-1;){const ze=Ae+1;let Ue=!1,dt=!1;for(let je=xe;je<=Fe;je++){Ce(je,ze)&&(Ue=!0);const ft=Tt(je,ze);ft&&(ft.range.startCol!==ft.range.endCol||ft.range.startRow!==ft.range.endRow)&&(dt=!0)}if(dt||!Ue)break;Ae++}return!Ce(W,X)&&Ae===X?st():{startCol:xe,endCol:Fe,startRow:X,endRow:Ae}}function Z(){if($.value){O();return}const h=he();h&&D(h)}function He(h){const S=$.value;return S?h>=S.range.startCol&&h<=S.range.endCol:!1}function $e(){return $.value?{...$.value.range}:null}function le(){return!!$.value}function Ke(h){const S=$.value;return S?Zo(S.columns[h]):!1}function st(){let h=1/0,S=1/0,B=-1,W=-1;for(const X in y){const Ce=X.indexOf(",");if(Ce<0)continue;const xe=parseInt(X.substring(0,Ce),10),Fe=parseInt(X.substring(Ce+1),10),Ae=y[X];Ae&&(Ae.value!==""||Ae.styleId!==void 0)&&(xe<h&&(h=xe),Fe<S&&(S=Fe),xe>B&&(B=xe),Fe>W&&(W=Fe))}return B<0?null:{startCol:h,startRow:S,endCol:B,endRow:W}}const E=t.computed(()=>{const h=[0];for(let S=0;S<r.rowCount;S++)h.push(h[S]+ae(S));return h}),U=t.computed(()=>Mt.value[r.colCount]),ee=t.computed(()=>E.value[r.rowCount]);function de(h,S){return`${h},${S}`}u=de;function ye(h){Reflect.deleteProperty(y,h)}function fe(h,S){gt.value="cell";const B=p(h,S);B?(Ze.value={col:B.range.startCol,row:B.range.startRow},Je.value={...B.range}):(Ze.value={col:h,row:S},Je.value={startCol:h,startRow:S,endCol:h,endRow:S})}function ke(h,S,B,W,X="cell"){const Ce=p(h,S);if(Ze.value=Ce?{col:Ce.range.startCol,row:Ce.range.startRow}:{col:h,row:S},gt.value=X,X==="row"||X==="col"){const xe=Math.min(h,B),Fe=Math.max(h,B),Ae=Math.min(S,W),ze=Math.max(S,W);Je.value={startCol:xe,startRow:Ae,endCol:Fe,endRow:ze}}else Je.value=Pe(h,S,B,W)}function We(){ke(0,0,r.colCount-1,r.rowCount-1,"all")}function mt(h,S){const B=Je.value;return B?(gt.value==="cell"||gt.value==="all",h>=B.startCol&&h<=B.endCol&&S>=B.startRow&&S<=B.endRow):!1}function Bt(h,S){return mt(h,S)}function Tt(h,S){for(const B in ve){const W=ve[B];if(W&&h>=W.startCol&&h<=W.endCol&&S>=W.startRow&&S<=W.endRow)return{range:W,anchor:B}}return null}p=Tt;function At(h,S){return ve[de(h,S)]!==void 0}function Ot(h,S){const B=p(h,S);if(B&&h===B.range.startCol&&S===B.range.startRow){const W=Mt.value[B.range.endCol+1]-Mt.value[h],X=E.value[B.range.endRow+1]-E.value[S];return{w:W,h:X}}return{w:oe.value[h],h:ae(S)}}function Wt(h,S,B,W){let X=Math.min(h,B),Ce=Math.max(h,B),xe=Math.min(S,W),Fe=Math.max(S,W),Ae=!0;for(;Ae;){Ae=!1;for(const ze in ve){const Ue=ve[ze];if(!Ue)continue;Ue.startCol<=Ce&&Ue.endCol>=X&&Ue.startRow<=Fe&&Ue.endRow>=xe&&(Ue.startCol<X&&(X=Ue.startCol,Ae=!0),Ue.endCol>Ce&&(Ce=Ue.endCol,Ae=!0),Ue.startRow<xe&&(xe=Ue.startRow,Ae=!0),Ue.endRow>Fe&&(Fe=Ue.endRow,Ae=!0))}}return{startCol:X,startRow:xe,endCol:Ce,endRow:Fe}}Pe=Wt;function Pt(h,S){var B;return((B=y[de(h,S)])==null?void 0:B.value)??""}function ml(h,S){return zn(),Yo(h,S,y,r.colCount,r.rowCount)}function Xl(h,S,B){var Fe,Ae;h>=0&&S>=0&&rl(h,S);const W=de(h,S);if(zn(),B===""||B==null){Xe.clear(W);const ze=(Fe=y[W])==null?void 0:Fe.styleId;ze!==void 0&&ze>0?y[W]={value:"",styleId:ze}:ye(W),Xe.markDirty(W);return}const X=String(B);if(!X.startsWith("=")){const ze=Y(y[W]),Ue=typeof(ze==null?void 0:ze.numberFormat)=="string"?ze.numberFormat:"";if(sl(Ue)){const dt=Tn(X,n.value);if(dt){const ft={...ze??{},numberFormat:dt.format};y[W]={value:String(dt.serial),styleId:te(ft)},Xe.clear(W),Xe.markDirty(W);return}const je=qr(X,n.value);if(je){const ft={...ze??{},numberFormat:je.format};y[W]={value:String(je.num),styleId:te(ft)},Xe.clear(W),Xe.markDirty(W);return}}}const Ce=(Ae=y[W])==null?void 0:Ae.styleId,xe={value:X};Ce!==void 0&&Ce>0&&(xe.styleId=Ce),y[W]=xe,X.startsWith("=")?Xe.set(W,jn(X.slice(1),r.colCount,r.rowCount)):Xe.clear(W),Xe.markDirty(W)}function Fl(h,S,B,W){for(let X=h;X<=S;X++)for(let Ce=B;Ce<=W;Ce++){const xe=de(X,Ce);Xe.clear(xe),ye(xe),Xe.markDirty(xe)}}let El=()=>{};function Cn(h){tt.value||(tt.value={...Ze.value},h!==void 0?et.value=h:et.value||(et.value=Pt(Ze.value.col,Ze.value.row)))}function wn(){tt.value&&(El(),Xl(tt.value.col,tt.value.row,et.value),tt.value=null,et.value="")}function Fn(){tt.value=null,et.value=""}function In(h,S){const B=Ze.value;let W=Math.max(0,B.col+h),X=Math.max(0,B.row+S);(W>=r.colCount||X>=r.rowCount)&&rl(W,X);const Ce=p(B.col,B.row),xe=p(W,X);Ce&&xe&&Ce.anchor===xe.anchor&&(h>0?W=Ce.range.endCol+1:h<0&&(W=Ce.range.startCol-1),S>0?X=Ce.range.endRow+1:S<0&&(X=Ce.range.startRow-1),(W>=r.colCount||X>=r.rowCount)&&rl(W,X)),W=Math.max(0,Math.min(r.colCount-1,W)),X=Math.max(0,Math.min(r.rowCount-1,X)),fe(W,X)}function Xt(h,S){hl(S,h)}function Il(h){const S=Mt.value;if(h<0||h>=S[r.colCount])return-1;let B=0,W=r.colCount-1;for(;B<W;){const X=B+W+1>>1;S[X]<=h?B=X:W=X-1}return B}function bt(h){const S=E.value;if(h<0||h>=S[r.rowCount])return-1;let B=0,W=r.rowCount-1;for(;B<W;){const X=B+W+1>>1;S[X]<=h?B=X:W=X-1}return B}function Ct(h,S){var X,Ce;const B=Math.max(0,Math.min(Math.floor(h),r.rowCount)),W=Math.max(0,Math.min(Math.floor(S),r.colCount));L.rows=B,L.cols=W,(X=De.scheduleRender)==null||X.call(De),(Ce=De.emitModelData)==null||Ce.call(De)}function Gt(){var h,S;L.rows=0,L.cols=0,(h=De.scheduleRender)==null||h.call(De),(S=De.emitModelData)==null||S.call(De)}function $n(){return{rows:L.rows,cols:L.cols}}function vn(){let h=0,S=0;if(L.cols>0){const B=oe.value,W=Math.min(L.cols,B.length);for(let X=0;X<W;X++)h+=B[X]}if(L.rows>0)for(let B=0;B<L.rows;B++)S+=ae(B);return{frozenRowsHeight:S,frozenColumnsWidth:h}}function Qn(){const{frozenColumnsWidth:h,frozenRowsHeight:S}=vn(),B=52+h,W=24+S,X=Math.max(0,It.w-52-11-h),Ce=Math.max(0,It.h-24-11-S),xe=[];return S>0&&h>0&&xe.push({kind:"corner",x:52,y:24,width:h,height:S,scrollLeft:0,scrollTop:0}),S>0&&xe.push({kind:"rows",x:B,y:24,width:X,height:S,scrollLeft:g.value,scrollTop:0}),h>0&&xe.push({kind:"columns",x:52,y:W,width:h,height:Ce,scrollLeft:0,scrollTop:I.value}),xe.push({kind:"body",x:B,y:W,width:X,height:Ce,scrollLeft:g.value,scrollTop:I.value}),xe}function ll(h,S){const B=Mt.value,W=E.value,X=oe.value,Ce=B[S]??0,xe=W[h]??0,Fe=p(S,h),Ae=Fe?(B[Fe.range.endCol+1]??Ce)-Ce:X[S]??0,ze=Fe?(W[Fe.range.endRow+1]??xe)-xe:ae(h),Ue=S<L.cols,dt=h<L.rows,je=Ue?52+Ce:52+Ce-g.value,ft=dt?24+xe:24+xe-I.value;return{x:je,y:ft,width:Ae,height:ze}}function Al(h,S){const{frozenColumnsWidth:B,frozenRowsHeight:W}=vn();if(h<52||S<24)return null;const X=B>0&&h<52+B,Ce=W>0&&S<24+W,xe=X?h-52:h-52+g.value,Fe=Ce?S-24:S-24+I.value,Ae=Il(xe),ze=bt(Fe);return Ae<0||ze<0?null:{col:Ae,row:ze}}function pl(h,S){return h<L.rows||S<L.cols}function hl(h,S){if(pl(h,S))return;const{frozenColumnsWidth:B,frozenRowsHeight:W}=vn(),X=Math.max(0,It.w-52-11-B),Ce=Math.max(0,It.h-24-11-W),xe=Mt.value,Fe=E.value,Ae=(xe[S]??0)-B,ze=(Fe[h]??0)-W,Ue=p(S,h),dt=Ue?(xe[Ue.range.endCol+1]??0)-(xe[S]??0):oe.value[S]??0,je=Ue?(Fe[Ue.range.endRow+1]??0)-(Fe[h]??0):ae(h);let ft=g.value,Lt=I.value;Ae<ft?ft=Ae:Ae+dt>ft+X&&(ft=Ae+dt-X),ze<Lt?Lt=ze:ze+je>Lt+Ce&&(Lt=ze+je-Ce),ft=Math.max(0,ft),Lt=Math.max(0,Lt),_t(ft,Lt)}function rl(h,S){var Ce;const B=h+1,W=S+1;let X=!1;if(B>=r.colCount){const xe=Math.max(r.colCount+f,B),Fe=xe-r.colCount,Ae=oe.value;for(let ze=0;ze<Fe;ze++)Ae.push(100);r.colCount=xe,X=!0}if(W>=r.rowCount){const xe=Math.max(r.rowCount+m,W),Fe=xe-r.rowCount,Ae=me.value;for(let ze=0;ze<Fe;ze++)Ae.push(void 0);r.rowCount=xe,X=!0}X&&((Ce=De.scheduleRender)==null||Ce.call(De))}function gl(){return r.colCount!==a||r.rowCount!==i}function cn(h,S,B){var Ce,xe,Fe;if(!wo(h,S,ve))return;(Ce=De.saveUndo)==null||Ce.call(De),rl(S.endCol,S.endRow);const W=js(h,S,{cells:y},B,n.value,r.colCount,r.rowCount,ht);zn();for(const[Ae,ze]of Object.entries(W.cells)){const Ue=ze.value;Ue===""&&(ze.styleId===void 0||ze.styleId===0)?(Xe.clear(Ae),ye(Ae)):(y[Ae]={value:Ue,...ze.styleId!==void 0&&ze.styleId>0?{styleId:ze.styleId}:{}},Ue.startsWith("=")?Xe.set(Ae,jn(Ue.slice(1),r.colCount,r.rowCount)):Xe.clear(Ae)),Xe.markDirty(Ae)}const X={startCol:Math.min(h.startCol,S.startCol),startRow:Math.min(h.startRow,S.startRow),endCol:Math.max(h.endCol,S.endCol),endRow:Math.max(h.endRow,S.endRow)};ke(X.startCol,X.startRow,X.endCol,X.endRow),(xe=De.scheduleRender)==null||xe.call(De),(Fe=De.emitModelData)==null||Fe.call(De)}function eo(h,S){var Ce;let B=!1;const W=Math.max(1,Math.floor(h)),X=Math.max(1,Math.floor(S));if(W!==r.colCount){if(W>r.colCount){const xe=oe.value;for(let Fe=r.colCount;Fe<W;Fe++)xe.push(100)}else oe.value=oe.value.slice(0,W);r.colCount=W,B=!0}if(X!==r.rowCount){if(X>r.rowCount){const xe=me.value;for(let Fe=r.rowCount;Fe<X;Fe++)xe.push(void 0)}else me.value=me.value.slice(0,X);r.rowCount=X,B=!0}B&&((Ce=De.scheduleRender)==null||Ce.call(De))}const De={props:o,locale:n,get colCount(){return r.colCount},get rowCount(){return r.rowCount},ensureCapacity:rl,hasDynamicDims:gl,setDims:eo,cells:y,styles:k,borders:d,merges:ve,formulaDeps:Xe,selection:Je,activeCell:Ze,editingCell:tt,editValue:et,colWidths:oe,rowHeights:me,scrollX:g,scrollY:I,freeze:L,setFreeze:Ct,clearFreeze:Gt,getFreeze:$n,getFrozenMetrics:vn,filter:$,getFilter:an,setFilter:F,enableFilter:D,clearFilter:O,clearFilterColumn:ue,setFilterColumn:ge,getColumnCandidates:Me,getDataRange:st,getCurrentRegion:Se,detectFilterRange:he,toggleAutoFilter:Z,isColumnInFilterRange:He,getFilterRange:$e,isFilterEnabled:le,isFilterColumnActive:Ke,isRowHidden:fl,getFilteredOutRows:dl,getVisibleRowCount:Nl,getVisibleRowAt:bn,getVisibleRowIndex:Yl,getViewportRegions:Qn,cellToScreenRect:ll,screenToCell:Al,isCellFrozen:pl,scrollCellIntoView:hl,BASE_CELL_VPAD:c,fontMetricsCache:ie,fontMetricsCanvas:re,measureFontMetrics:pe,_getFontMetricsForCell:at,getWrappedLines:St,cellFontSize:Rt,colPositions:Mt,getRowHeight:vl,_isAutoRow:Dl,rowPositions:E,totalWidth:U,totalHeight:ee,selectCell:fe,selectRange:ke,selectAll:We,isSelected:mt,isCellSelected:Bt,selectionMode:gt,cellKey:de,delCell:ye,findMerge:Tt,_isMergeAnchor:At,_mergedSpan:Ot,expandSelectionForMerges:Wt,getCellRaw:Pt,getCellValue:ml,setCellValue:Xl,clearCellsInRange:Fl,startEdit:Cn,commitEdit:wn,cancelEdit:Fn,moveActive:In,ensureVisible:Xt,hitCol:Il,hitRow:bt,registerStyle:te,resolveStyle:Y,rebuildStyleIndex:K,syncStyles:C,registerBorder:j,resolveBorder:q,rebuildBorderIndex:se,syncBorders:Ne,getCellBorderSide:Qe,getMergeOwner:Ge,isSameMergeInternal:be,viewSize:It,findHighlight:(h,S)=>null,autoFillState:J,applyAutoFill:cn};return El=()=>{var h;return(h=De.saveUndo)==null?void 0:h.call(De)},_t=(h,S)=>{var B;return(B=De.clampScroll)==null?void 0:B.call(De,h,S)},De}function nu(e,l){const o=t.ref([]),n=t.ref([]);function a(E){return Js(E)}function i(){return l.saveSheet(),{sheets:l.sheets.value.map(E=>({id:E.id,name:E.name,cells:a(E.cells),styles:[...E.styles],borders:E.borders?[...E.borders]:[{}],merges:E.merges?{...E.merges}:{},selection:E.selection?{...E.selection}:null,activeCell:E.activeCell?{...E.activeCell}:{col:0,row:0},scrollX:E.scrollX,scrollY:E.scrollY,colWidths:[...E.colWidths],rowHeights:[...E.rowHeights],colCount:E.colCount,rowCount:E.rowCount,freeze:{...E.freeze},filter:E.filter?JSON.parse(JSON.stringify(E.filter)):null})),styles:[...e.styles],activeSheetIndex:l.activeSheetIndex.value}}function r(E){const U=l.sheets.value;l.sheets.value=E.sheets.map((ee,de)=>{var fe;const ye=((fe=U[de])==null?void 0:fe.freeze)??{rows:0,cols:0};return{...ee,cells:a(ee.cells),styles:[...ee.styles],borders:ee.borders?[...ee.borders]:[{}],freeze:{rows:ye.rows,cols:ye.cols}}}),l.loadSheet(Math.max(0,Math.min(E.activeSheetIndex,l.sheets.value.length-1))),e.formulaDeps.rebuild(e.cells,e.colCount,e.rowCount)}function f(){const E=i(),U=o.value[o.value.length-1];U&&JSON.stringify(U)===JSON.stringify(E)||(o.value.push(E),n.value=[],o.value.length>50&&o.value.shift())}e.saveUndo=f;function m(){var E;o.value.length&&(n.value.push(i()),r(o.value.pop()),(E=e.scheduleRender)==null||E.call(e),t.nextTick(()=>{var U;return(U=e.emitModelData)==null?void 0:U.call(e)}))}function y(){var E;n.value.length&&(o.value.push(i()),r(n.value.pop()),(E=e.scheduleRender)==null||E.call(e),t.nextTick(()=>{var U;return(U=e.emitModelData)==null?void 0:U.call(e)}))}const k=t.computed(()=>o.value.length>0),d=t.computed(()=>n.value.length>0),w=t.computed(()=>!!e.selection.value),v=t.ref(null);function R(){var ee;const E=e.selection.value;if(!E)return;const U={};for(let de=E.startCol;de<=E.endCol;de++)for(let ye=E.startRow;ye<=E.endRow;ye++)U[`${de-E.startCol},${ye-E.startRow}`]=((ee=e.cells[e.cellKey(de,ye)])==null?void 0:ee.styleId)??0;v.value={styles:U}}function G(){var ee,de,ye;const E=v.value,U=e.selection.value;if(!(!E||!U)){f();for(let fe=U.startCol;fe<=U.endCol;fe++)for(let ke=U.startRow;ke<=U.endRow;ke++){const We=e.findMerge(fe,ke);if(We&&(fe!==We.range.startCol||ke!==We.range.startRow))continue;const mt=E.styles[`${fe-U.startCol},${ke-U.startRow}`]??0,Bt=e.cellKey(fe,ke),Tt=((ee=e.cells[Bt])==null?void 0:ee.value)??"";if(Tt===""&&mt===0)e.delCell(Bt);else{const At={value:Tt};mt>0&&(At.styleId=mt),e.cells[Bt]=At}}v.value=null,(de=e.scheduleRender)==null||de.call(e),(ye=e.emitModelData)==null||ye.call(e)}}function te(){var U,ee,de;const E=e.selection.value;if(E){f();for(let ye=E.startCol;ye<=E.endCol;ye++)for(let fe=E.startRow;fe<=E.endRow;fe++){const ke=e.findMerge(ye,fe);if(ke&&(ye!==ke.range.startCol||fe!==ke.range.startRow))continue;const We=e.cellKey(ye,fe),mt=((U=e.cells[We])==null?void 0:U.value)??"";mt===""?e.delCell(We):e.cells[We]={value:mt}}(ee=e.scheduleRender)==null||ee.call(e),(de=e.emitModelData)==null||de.call(e)}}const Y=t.computed(()=>br.map(E=>({...E,label:E.value===""?N(e.locale.value,"fontDefault"):E.label}))),K=t.computed(()=>Cr.map(E=>({...E,label:String(E.value)}))),C="\0",j=t.computed(()=>{const E=e.selection.value;if(!E)return"";let U,ee=!1;for(let de=E.startCol;de<=E.endCol&&!ee;de++)for(let ye=E.startRow;ye<=E.endRow&&!ee;ye++){const fe=e.findMerge(de,ye);if(fe&&(de!==fe.range.startCol||ye!==fe.range.startRow))continue;const ke=e.resolveStyle(e.cells[e.cellKey(de,ye)]),We=typeof(ke==null?void 0:ke.fontFamily)=="string"?ke.fontFamily:"";U===void 0?U=We:We!==U&&(ee=!0)}return ee?C:U??""}),q=t.computed(()=>{const E=e.selection.value;if(!E)return Wl;let U,ee=!1;for(let de=E.startCol;de<=E.endCol&&!ee;de++)for(let ye=E.startRow;ye<=E.endRow&&!ee;ye++){const fe=e.findMerge(de,ye);if(fe&&(de!==fe.range.startCol||ye!==fe.range.startRow))continue;const ke=e.cellFontSize(de,ye);U===void 0?U=ke:ke!==U&&(ee=!0)}return ee?0:U??Wl});function se(E,U){var de,ye,fe;const ee=e.selection.value;if(ee){f();for(let ke=ee.startCol;ke<=ee.endCol;ke++)for(let We=ee.startRow;We<=ee.endRow;We++){const mt=e.findMerge(ke,We);if(mt&&(ke!==mt.range.startCol||We!==mt.range.startRow))continue;const Bt=e.cellKey(ke,We),Tt=((de=e.cells[Bt])==null?void 0:de.value)??"";let Ot={...e.resolveStyle(e.cells[Bt])??{}};if(U===""||U===null||U===void 0||U===0){const{[E]:Pt,...ml}=Ot;Ot=ml}else Ot[E]=U;const Wt=Object.keys(Ot).length?e.registerStyle(Ot):0;if(Tt===""&&Wt===0)e.delCell(Bt);else{const Pt={value:Tt};Wt>0&&(Pt.styleId=Wt),e.cells[Bt]=Pt}}(ye=e.scheduleRender)==null||ye.call(e),(fe=e.emitModelData)==null||fe.call(e)}}function Ne(E){se("fontFamily",E===""?"":E)}const Qe=t.ref(!1),Ge=t.ref(!1),be=t.ref(!1),ve=t.ref(!1),Xe=t.ref(!1);function Je(E){se("fontSize",E),Qe.value=!1}const gt=t.computed(()=>Mr.map(E=>({label:N(e.locale.value,E.labelKey),value:E.value,icon:E.icon}))),Ze=t.computed(()=>xr.map(E=>({label:N(e.locale.value,E.labelKey),value:E.value,icon:E.icon}))),tt=t.computed(()=>{const E=e.selection.value;if(!E)return"left";const U=e.resolveStyle(e.cells[e.cellKey(E.startCol,E.startRow)]),ee=typeof(U==null?void 0:U.textAlign)=="string"?U.textAlign:"";return ee==="center"||ee==="right"?ee:"left"}),et=t.computed(()=>{const E=e.selection.value;if(!E)return"top";const U=e.resolveStyle(e.cells[e.cellKey(E.startCol,E.startRow)]),ee=typeof(U==null?void 0:U.verticalAlign)=="string"?U.verticalAlign:"";return ee==="middle"||ee==="bottom"?ee:"top"}),oe=t.computed(()=>{const E=e.selection.value;if(!E)return!1;const U=e.resolveStyle(e.cells[e.cellKey(E.startCol,E.startRow)]);return(U==null?void 0:U.wrap)==="wrap"});function me(E){se("textAlign",E)}function g(E){se("verticalAlign",E)}function I(){if(!e.selection.value)return;const U=oe.value;se("wrap",U?void 0:"wrap")}const L=t.ref(""),$=Qe;t.watch(q,E=>{L.value=E===0?"":String(E)},{immediate:!0});function J(E){const U=E.replace(/[^\d]/g,"");L.value=U;const ee=parseInt(U,10);!isNaN(ee)&&ee>=5&&ee<=72&&ee!==q.value&&se("fontSize",ee)}function ie(){const E=L.value.trim();if(!E){L.value=q.value===0?"":String(q.value);return}let U=parseInt(E,10);isNaN(U)?U=q.value===0?Wl:q.value:U=Math.max(5,Math.min(72,U)),L.value=String(U),U!==q.value&&se("fontSize",U)}function re(E){E.key==="Enter"&&E.target.blur()}function pe(E){E&&E.preventDefault(),$.value=!$.value,$.value&&(be&&(be.value=!1),Ge&&(Ge.value=!1),ve.value=!1,Xe.value=!1)}function ce(){const E=q.value===0?Wl:q.value,U=Math.min(72,E+1);se("fontSize",U),L.value=String(U),$.value=!1}function A(){const E=q.value===0?Wl:q.value,U=Math.max(5,E-1);se("fontSize",U),L.value=String(U),$.value=!1}function c(E){const U=e.selection.value;if(!U)return!1;let ee,de=!1;for(let ye=U.startCol;ye<=U.endCol&&!de;ye++)for(let fe=U.startRow;fe<=U.endRow&&!de;fe++){const ke=e.findMerge(ye,fe);if(ke&&(ye!==ke.range.startCol||fe!==ke.range.startRow))continue;const We=e.resolveStyle(e.cells[e.cellKey(ye,fe)]),mt=!!(We!=null&&We[E]);ee===void 0?ee=mt:mt!==ee&&(de=!0)}return!de&&ee===!0}const u=t.computed(()=>c("fontWeight")),p=t.computed(()=>c("fontStyle")),H=t.computed(()=>c("underline")),ct=t.computed(()=>c("strikethrough"));function ae(){se("fontWeight",u.value?"":"bold")}function Pe(){se("fontStyle",p.value?"":"italic")}function at(){se("underline",H.value?"":"underline")}function St(){se("strikethrough",ct.value?"":"line-through")}const Rt=t.ref(""),Mt=t.ref(""),It=ve,_t=Xe;function tl(){It.value=!It.value,_t.value=!1,Ge&&(Ge.value=!1),be&&(be.value=!1)}function vl(){_t.value=!_t.value,It.value=!1,Ge&&(Ge.value=!1),be&&(be.value=!1)}function Dl(E){Ge&&(Ge.value=E),E&&(It.value=!1,_t.value=!1,be&&(be.value=!1))}function ul(E){Rt.value=E,se("color",E===""?"":E)}function $t(E){Mt.value=E,se("backgroundColor",E===""?"":E)}function kl(){se("color",Rt.value===""?"":Rt.value)}function dl(){se("backgroundColor",Mt.value===""?"":Mt.value)}const fl=t.computed(()=>{const E=e.selection.value;if(!E)return"";let U,ee=!1;for(let de=E.startCol;de<=E.endCol&&!ee;de++)for(let ye=E.startRow;ye<=E.endRow&&!ee;ye++){const fe=e.findMerge(de,ye);if(fe&&(de!==fe.range.startCol||ye!==fe.range.startRow))continue;const ke=e.resolveStyle(e.cells[e.cellKey(de,ye)]),We=typeof(ke==null?void 0:ke.color)=="string"?ke.color:"";U===void 0?U=We:We!==U&&(ee=!0)}return ee?"":U??""}),Nl=t.computed(()=>{const E=e.selection.value;if(!E)return"";let U,ee=!1;for(let de=E.startCol;de<=E.endCol&&!ee;de++)for(let ye=E.startRow;ye<=E.endRow&&!ee;ye++){const fe=e.findMerge(de,ye);if(fe&&(de!==fe.range.startCol||ye!==fe.range.startRow))continue;const ke=e.resolveStyle(e.cells[e.cellKey(de,ye)]),We=typeof(ke==null?void 0:ke.backgroundColor)=="string"?ke.backgroundColor:"";U===void 0?U=We:We!==U&&(ee=!0)}return ee?"":U??""}),bn=t.computed(()=>Vo(e.locale.value)),Yl=t.ref(!1),an=t.computed(()=>{const E=e.selection.value;if(!E)return Ul;let U,ee=!1;for(let de=E.startCol;de<=E.endCol&&!ee;de++)for(let ye=E.startRow;ye<=E.endRow&&!ee;ye++){const fe=e.findMerge(de,ye);if(fe&&(de!==fe.range.startCol||ye!==fe.range.startRow))continue;const ke=e.resolveStyle(e.cells[e.cellKey(de,ye)]),We=(ke==null?void 0:ke.numberFormatCategory)==="custom"?Pl:typeof(ke==null?void 0:ke.numberFormat)=="string"?ke.numberFormat:"";U===void 0?U=We:We!==U&&(ee=!0)}return ee?Bl:U??Ul});function F(E){if((E==null?void 0:E.numberFormatCategory)==="custom")return Pl;const U=typeof(E==null?void 0:E.numberFormat)=="string"?E.numberFormat:"";return Ao(U,e.locale.value)}const D=t.computed(()=>{const E=an.value;if(E!==Bl)return E===Pl?Pl:Ao(E,e.locale.value);const U=e.selection.value;if(!U)return Ul;let ee,de=!1;for(let ye=U.startCol;ye<=U.endCol&&!de;ye++)for(let fe=U.startRow;fe<=U.endRow&&!de;fe++){const ke=e.findMerge(ye,fe);if(ke&&(ye!==ke.range.startCol||fe!==ke.range.startRow))continue;const We=F(e.resolveStyle(e.cells[e.cellKey(ye,fe)]));ee===void 0?ee=We:We!==ee&&(de=!0)}return de?Bl:ee??Ul});function O(E){se("numberFormat",E),ue()}function ue(){const E=e.selection.value;if(E)for(let U=E.startCol;U<=E.endCol;U++)for(let ee=E.startRow;ee<=E.endRow;ee++){const de=e.findMerge(U,ee);if(de&&(U!==de.range.startCol||ee!==de.range.startRow))continue;const ye=e.cellKey(U,ee),fe=e.cells[ye],ke=e.resolveStyle(fe);if((ke==null?void 0:ke.numberFormatCategory)!=="custom")continue;const{numberFormatCategory:We,...mt}=ke,Bt=Object.keys(mt).length?e.registerStyle(mt):0,Tt=(fe==null?void 0:fe.value)??"";if(Tt===""&&Bt===0)e.delCell(ye);else{const At={value:Tt};Bt>0&&(At.styleId=Bt),e.cells[ye]=At}}}function ge(E){if(E===Pl){Yl.value=!0;return}O(E)}function Me(){Yl.value=!0}function Se(){const E=e.selection.value;if(!E)return[];const U=[];for(let ee=E.startCol;ee<=E.endCol;ee++)for(let de=E.startRow;de<=E.endRow;de++){const ye=e.findMerge(ee,de);if(ye&&(ee!==ye.range.startCol||de!==ye.range.startRow))continue;const fe=e.cellKey(ee,de),ke=e.cells[fe],We=e.resolveStyle(ke),mt=typeof(We==null?void 0:We.numberFormat)=="string"?We.numberFormat:Ul,Bt=(ke==null?void 0:ke.value)??"",Tt=Bt.startsWith("=")?Yo(ee,de,e.cells,e.colCount,e.rowCount):Bt;Io(mt,Tt)&&U.push({key:fe,nf:mt,decimals:Gr(mt,Tt)})}return U}const he=t.computed(()=>Se().some(E=>E.decimals<co)),Z=t.computed(()=>Se().some(E=>E.decimals>so));function He(E,U,ee){var We;const de=((We=e.cells[E])==null?void 0:We.value)??"",fe={...e.resolveStyle(e.cells[E])??{}};U===""?(delete fe.numberFormat,delete fe.numberFormatCategory):(fe.numberFormat=U,ee==="custom"&&(fe.numberFormatCategory="custom"));const ke=Object.keys(fe).length?e.registerStyle(fe):0;if(de===""&&ke===0)e.delCell(E);else{const mt={value:de};ke>0&&(mt.styleId=ke),e.cells[E]=mt}}function $e(E){var de,ye;const U=Se(),ee=[];for(const fe of U){const ke=fe.decimals+E;if(ke<so||ke>co)continue;const We=Xr(fe.nf,ke);We==null||We===fe.nf||ee.push({key:fe.key,code:We,category:sl(fe.nf)?"custom":void 0})}if(ee.length){f();for(const fe of ee)He(fe.key,fe.code,fe.category);(de=e.scheduleRender)==null||de.call(e),(ye=e.emitModelData)==null||ye.call(e)}}function le(){$e(1)}function Ke(){$e(-1)}return{undoStack:o,redoStack:n,cloneCells:a,takeSnap:i,restoreSnap:r,saveUndo:f,undo:m,redo:y,canUndo:k,canRedo:d,hasSelection:w,paintFmt:v,onPaintFormat:R,applyPaintFormat:G,clearFormat:te,fontFamilyOptions:Y,fontSizeOptions:K,FONT_FAMILY_MIXED:C,selFontFamily:j,selFontSize:q,applyStyleToSelection:se,onFontFamilyChange:Ne,onFontSizeChange:Je,hAlignOptions:gt,vAlignOptions:Ze,selHAlign:tt,selVAlign:et,selWrap:oe,onHAlignChange:me,onVAlignChange:g,onWrapToggle:I,fontSizeInput:L,fontSizeMenuOpen:$,onFontSizeInput:J,onFontSizeBlur:ie,onFontSizeKeydown:re,toggleFontSizeMenu:pe,onFontSizeStepUp:ce,onFontSizeStepDown:A,selFontWeight:u,selFontStyle:p,selUnderline:H,selStrikethrough:ct,toggleFontWeight:ae,toggleFontStyle:Pe,toggleUnderline:at,toggleStrikethrough:St,cachedTextColor:Rt,cachedFillColor:Mt,textColorMenuOpen:It,fillColorMenuOpen:_t,_toggleTextColorMenu:tl,_toggleFillColorMenu:vl,onBorderMenuToggle:Dl,onTextColorChange:ul,onFillColorChange:$t,applyCachedTextColor:kl,applyCachedFillColor:dl,selTextColor:fl,selFillColor:Nl,nfOptions:bn,selNumberFormat:an,selNumberFormatDisplay:D,NF_NUMBER_FORMAT_MIXED:Bl,nfDialogOpen:Yl,onNumberFormatChange:ge,openNumberFormatDialog:Me,applyNumberFormatCode:O,canIncreaseDecimals:he,canDecreaseDecimals:Z,onIncreaseDecimals:le,onDecreaseDecimals:Ke}}function ou(e,l){l.borderMenuOpen&&(e.borderMenuOpen=l.borderMenuOpen),l.mergeMenuOpen&&(e.mergeMenuOpen=l.mergeMenuOpen),(()=>{const n=e.borderMenuOpen,a=e.mergeMenuOpen;e.onBorderMenuToggle=i=>{n&&(n.value=i),i&&(e.textColorMenuOpen.value=!1,e.fillColorMenuOpen.value=!1,a&&(a.value=!1))},e.toggleFontSizeMenu=i=>{i&&i.preventDefault(),e.fontSizeMenuOpen.value=!e.fontSizeMenuOpen.value,e.fontSizeMenuOpen.value&&(a&&(a.value=!1),n&&(n.value=!1),e.textColorMenuOpen.value=!1,e.fillColorMenuOpen.value=!1)},e._toggleTextColorMenu=()=>{e.textColorMenuOpen.value=!e.textColorMenuOpen.value,e.fillColorMenuOpen.value=!1,n&&(n.value=!1),a&&(a.value=!1)},e._toggleFillColorMenu=()=>{e.fillColorMenuOpen.value=!e.fillColorMenuOpen.value,e.textColorMenuOpen.value=!1,n&&(n.value=!1),a&&(a.value=!1)}})()}function ru(e,l){const o=t.ref("none"),n=t.ref(!1),a="#444";function i(g,I,L,$){if(g<0||I<0||g>=e.colCount||I>=e.rowCount)return;const J=e.findMerge(g,I),ie=J?J.anchor:e.cellKey(g,I);if(!e.cells[ie]){if(!$)return;e.cells[ie]={value:""}}tu(e.cells[ie],L,$,e.styles,{get:pe=>e.resolveBorder(pe),getId:pe=>e.registerBorder(pe)},e.registerStyle)}function r(g,I,L){var ce;const $=e.findMerge(g,I),J=$?$.anchor:e.cellKey(g,I),ie=((ce=e.cells[J])==null?void 0:ce.value)??"",re=e.resolveStyle(e.cells[J])?{...e.resolveStyle(e.cells[J])}:{},pe=e.registerBorder(L);if(pe>0?re.borderId=pe:delete re.borderId,delete re.borderTopWidth,delete re.borderBottomWidth,delete re.borderLeftWidth,delete re.borderRightWidth,delete re.borderColor,ie===""&&!Object.keys(re).length)e.delCell(J);else{const A=e.registerStyle(re);e.cells[J]={value:ie,styleId:A||void 0}}}function f(g){var ce,A;o.value=g;const I=e.selection.value;if(!I)return;l.saveUndo();const{startCol:L,startRow:$,endCol:J,endRow:ie}=I,re={width:1,color:a},pe={width:2,color:a};if(g==="none")for(let c=L;c<=J;c++)for(let u=$;u<=ie;u++){const p=e.findMerge(c,u);p&&(c!==p.range.startCol||u!==p.range.startRow)||r(c,u,{})}else if(g==="all")for(let c=L;c<=J;c++)for(let u=$;u<=ie;u++){const p=e.findMerge(c,u);p&&(c!==p.range.startCol||u!==p.range.startRow)||r(c,u,{top:re,right:re,bottom:re,left:re})}else if(g==="outer"||g==="thickOuter"){const c=g==="thickOuter"?pe:re;for(let u=L;u<=J;u++)i(u,$,"top",c);for(let u=L;u<=J;u++)i(u,ie,"bottom",c);for(let u=$;u<=ie;u++)i(L,u,"left",c);for(let u=$;u<=ie;u++)i(J,u,"right",c)}else{const u={top:{side:"top",edgeCheck:(p,H)=>H===$},bottom:{side:"bottom",edgeCheck:(p,H)=>H===ie},left:{side:"left",edgeCheck:(p,H)=>p===L},right:{side:"right",edgeCheck:(p,H)=>p===J}}[g];if(u)for(let p=L;p<=J;p++)for(let H=$;H<=ie;H++)u.edgeCheck(p,H)&&i(p,H,u.side,re)}(ce=e.scheduleRender)==null||ce.call(e),(A=e.emitModelData)==null||A.call(e)}function m(){f(o.value)}function y(g,I,L){const $=L.toLowerCase(),J=e.findMerge(g,I);if(J){if($==="top"&&I!==J.range.startRow||$==="bottom"&&I!==J.range.endRow||$==="left"&&g!==J.range.startCol||$==="right"&&g!==J.range.endCol)return 0;const re=e.getCellBorderSide(e.cells[J.anchor],$);return(re==null?void 0:re.width)??0}const ie=e.getCellBorderSide(e.cells[e.cellKey(g,I)],$);return(ie==null?void 0:ie.width)??0}const k=t.ref(!1);function d(g){k.value=g,g&&(l.textColorMenuOpen.value=!1,l.fillColorMenuOpen.value=!1,n.value=!1,l.fontSizeMenuOpen.value=!1)}function w(g,I,L,$){const J=[];for(const ie in e.merges){const re=e.merges[ie];re&&re.startCol<=L&&re.endCol>=g&&re.startRow<=$&&re.endRow>=I&&J.push(ie)}for(const ie of J)Reflect.deleteProperty(e.merges,ie)}function v(){var ie,re,pe;const g=e.selection.value;if(!g||g.startCol===g.endCol&&g.startRow===g.endRow)return;l.saveUndo(),w(g.startCol,g.startRow,g.endCol,g.endRow);const I=e.cellKey(g.startCol,g.startRow),L=((ie=e.cells[I])==null?void 0:ie.value)??"";for(let ce=g.startCol;ce<=g.endCol;ce++)for(let A=g.startRow;A<=g.endRow;A++)ce===g.startCol&&A===g.startRow||e.clearCellsInRange(ce,ce,A,A);const $=e.resolveStyle(e.cells[I])?{...e.resolveStyle(e.cells[I])}:{};$.textAlign="center";const J=e.registerStyle($);e.cells[I]={value:L,styleId:J||void 0},e.merges[I]={startCol:g.startCol,startRow:g.startRow,endCol:g.endCol,endRow:g.endRow},e.selectCell(g.startCol,g.startRow),(re=e.scheduleRender)==null||re.call(e),(pe=e.emitModelData)==null||pe.call(e)}function R(){var I,L,$;const g=e.selection.value;if(!(!g||g.startCol===g.endCol)){l.saveUndo();for(let J=g.startRow;J<=g.endRow;J++){w(g.startCol,J,g.endCol,J);const ie=e.cellKey(g.startCol,J);(I=e.cells[ie])==null||I.value;for(let re=g.startCol+1;re<=g.endCol;re++)e.clearCellsInRange(re,re,J,J);e.merges[ie]={startCol:g.startCol,startRow:J,endCol:g.endCol,endRow:J}}e.selectRange(g.startCol,g.startRow,g.endCol,g.endRow),(L=e.scheduleRender)==null||L.call(e),($=e.emitModelData)==null||$.call(e)}}function G(){var L,$,J;const g=e.selection.value;if(!g||g.startCol===g.endCol&&g.startRow===g.endRow)return;l.saveUndo(),w(g.startCol,g.startRow,g.endCol,g.endRow);const I=e.cellKey(g.startCol,g.startRow);(L=e.cells[I])==null||L.value;for(let ie=g.startCol;ie<=g.endCol;ie++)for(let re=g.startRow;re<=g.endRow;re++)ie===g.startCol&&re===g.startRow||e.clearCellsInRange(ie,ie,re,re);e.merges[I]={startCol:g.startCol,startRow:g.startRow,endCol:g.endCol,endRow:g.endRow},e.selectCell(g.startCol,g.startRow),($=e.scheduleRender)==null||$.call(e),(J=e.emitModelData)==null||J.call(e)}function te(){var I,L;const g=e.selection.value;g&&(l.saveUndo(),w(g.startCol,g.startRow,g.endCol,g.endRow),(I=e.scheduleRender)==null||I.call(e),(L=e.emitModelData)==null||L.call(e))}function Y(){const g=e.selection.value;if(!g)return;const I=e.findMerge(g.startCol,g.startRow);I&&g.startCol===I.range.startCol&&g.startRow===I.range.startRow&&g.endCol===I.range.endCol&&g.endRow===I.range.endRow?te():v()}function K(g){switch(g){case"mergeCenter":v();break;case"mergeAcross":R();break;case"mergeCells":G();break;case"unmergeCells":te();break}}let C=null,j=[];function q(g,I,L,$){j=[];for(let J=L;J<=$;J++){const ie=[];for(let re=g;re<=I;re++){const pe=e.cells[e.cellKey(re,J)];ie.push((pe==null?void 0:pe.styleId)??0)}j.push(ie)}}function se(g,I,L,$){const J=e.cellKey(g,I);if(zn(),L===""||L==null){e.formulaDeps.clear(J),$&&$>0?e.cells[J]={value:"",styleId:$}:e.delCell(J),e.formulaDeps.markDirty(J);return}e.cells[J]={value:L,styleId:$&&$>0?$:void 0},L.startsWith("=")?e.formulaDeps.set(J,jn(L.slice(1),e.colCount,e.rowCount)):e.formulaDeps.clear(J),e.formulaDeps.markDirty(J)}function Ne(){const g=e.selection.value;if(!g)return;C={...g},q(g.startCol,g.endCol,g.startRow,g.endRow);const I=[];for(let L=g.startRow;L<=g.endRow;L++){const $=[];for(let J=g.startCol;J<=g.endCol;J++)$.push(e.getCellRaw(J,L));I.push($.join(" "))}po(I.join(`
|
|
4
|
-
`))}function Qe(){const g=e.selection.value;if(g){if(g.startCol===0&&g.endCol===e.colCount-1){C={...g},q(0,e.colCount-1,g.startRow,g.endRow);const
|
|
5
|
-
`))}else if(g.startRow===0&&g.endRow===e.rowCount-1){C={...g},q(g.startCol,g.endCol,0,e.rowCount-1);const
|
|
6
|
-
`))}}}async function Ge(){var A;let g;try{g=await navigator.clipboard.readText()}catch{return}if(!g&&g!=="")return;const I=g.split(/\r?\n/),L=e.activeCell.value,$=C,J=$&&j.length>0,ie=I.map(c=>c.split(" ").length),re=ie.length?Math.max(...ie):0,pe=L.col+re-1,ce=L.row+I.length-1;pe>=0&&ce>=0&&e.ensureCapacity(pe,ce);for(let c=0;c<I.length;c++){const u=I[c].split(" ");for(let p=0;p<u.length;p++){const H=L.col+p,ct=L.row+c;let ae=u[p];if(ae.startsWith("=")&&$&&(ae=Xo(ae,H-($.startCol+p),ct-($.startRow+c),e.colCount,e.rowCount,ht)),J&&c<j.length&&p<(((A=j[c])==null?void 0:A.length)??0)){const Pe=j[c][p]??null;se(H,ct,ae,Pe)}else e.setCellValue(H,ct,ae)}}}function be(){var g;if(l.saveUndo(),Ne(),e.selection.value){const I=e.selection.value;e.clearCellsInRange(I.startCol,I.endCol,I.startRow,I.endRow),(g=e.scheduleRender)==null||g.call(e)}}function ve(){var g;if(e.selection.value){const I=e.selection.value;e.clearCellsInRange(I.startCol,I.endCol,I.startRow,I.endRow),(g=e.scheduleRender)==null||g.call(e)}}function Xe(){var ie,re;const g=e.selection.value;if(!g)return;l.saveUndo();const I=g.startCol,L=g.startRow,$=g.endCol,J=g.endRow;if(L===J)if($+1<e.colCount){const pe=`${ht(I)}${L+1}:${ht($)}${L+1}`;e.setCellValue($+1,L,`=SUM(${pe})`)}else{const pe=`${ht(I)}${L+1}:${ht($-1)}${L+1}`;e.setCellValue($,L,`=SUM(${pe})`)}else for(let pe=I;pe<=$;pe++)if(J+1<e.rowCount){const ce=`${ht(pe)}${L+1}:${ht(pe)}${J+1}`;e.setCellValue(pe,J+1,`=SUM(${ce})`)}else{const ce=`${ht(pe)}${L+1}:${ht(pe)}${J}`;e.setCellValue(pe,J,`=SUM(${ce})`)}(ie=e.scheduleRender)==null||ie.call(e),(re=e.emitModelData)==null||re.call(e)}function Je(){var ie,re;const g=e.selection.value;if(!g)return;l.saveUndo();const I=g.startCol,L=g.startRow,$=g.endCol,J=g.endRow;if(L===J)if($+1<e.colCount){const pe=`${ht(I)}${L+1}:${ht($)}${L+1}`;e.setCellValue($+1,L,`=AVERAGE(${pe})`)}else{const pe=`${ht(I)}${L+1}:${ht($-1)}${L+1}`;e.setCellValue($,L,`=AVERAGE(${pe})`)}else for(let pe=I;pe<=$;pe++)if(J+1<e.rowCount){const ce=`${ht(pe)}${L+1}:${ht(pe)}${J+1}`;e.setCellValue(pe,J+1,`=AVERAGE(${ce})`)}else{const ce=`${ht(pe)}${L+1}:${ht(pe)}${J}`;e.setCellValue(pe,J,`=AVERAGE(${ce})`)}(ie=e.scheduleRender)==null||ie.call(e),(re=e.emitModelData)==null||re.call(e)}function gt(){var ie,re;const g=e.selection.value;if(!g)return;l.saveUndo();const I=g.startCol,L=g.startRow,$=g.endCol,J=g.endRow;if(L===J)if($+1<e.colCount){const pe=`${ht(I)}${L+1}:${ht($)}${L+1}`;e.setCellValue($+1,L,`=COUNT(${pe})`)}else{const pe=`${ht(I)}${L+1}:${ht($-1)}${L+1}`;e.setCellValue($,L,`=COUNT(${pe})`)}else for(let pe=I;pe<=$;pe++)if(J+1<e.rowCount){const ce=`${ht(pe)}${L+1}:${ht(pe)}${J+1}`;e.setCellValue(pe,J+1,`=COUNT(${ce})`)}else{const ce=`${ht(pe)}${L+1}:${ht(pe)}${J}`;e.setCellValue(pe,J,`=COUNT(${ce})`)}(ie=e.scheduleRender)==null||ie.call(e),(re=e.emitModelData)==null||re.call(e)}const Ze=t.ref(!1);function tt(g){Ze.value=g,g&&(l.textColorMenuOpen.value=!1,l.fillColorMenuOpen.value=!1,n.value=!1,l.fontSizeMenuOpen.value=!1,k.value=!1)}function et(){Xe(),Ze.value=!1}function oe(){Je(),Ze.value=!1}function me(){gt(),Ze.value=!1}return{cachedBorder:o,borderMenuOpen:n,BORDER_COLOR:a,onBorderChange:f,setCellBorderSide:i,applyBorderToCell:r,applyCachedBorder:m,cellBorderWidth:y,mergeMenuOpen:k,onMergeMenuToggle:d,removeOverlappingMerges:w,mergeAndCenter:v,mergeAcross:R,mergeCells:G,unmergeCells:te,onApplyMerge:Y,onMergeChange:K,copySourceRange:null,copySourceStyles:[],captureStyles:q,setCellWithStyle:se,copyToClipboard:Ne,copyRowCol:Qe,pasteFromClipboard:Ge,cutSelected:be,clearSelected:ve,sumSelected:Xe,avgSelected:Je,countSelected:gt,calcMenuOpen:Ze,onCalcMenuToggle:tt,onCalcSum:et,onCalcAvg:oe,onCalcCount:me}}function au(e,l,o,n){const a={},i=n(l),r=n(o);return i!=null&&(a.width=`${i}px`),r!=null&&(a.height=`${r}px`),a["--sp-formula-bar-bg"]=e.formulaBarBg,a["--sp-formula-bar-border"]=e.formulaBarBorder,a["--sp-formula-bar-label-color"]=e.formulaBarLabelText,a["--sp-formula-bar-label-bg"]=e.formulaBarLabelBg,a["--sp-formula-bar-label-border"]=e.formulaBarLabelBorder,a["--sp-formula-bar-input-bg"]=e.formulaBarInputBg,a["--sp-formula-bar-input-border"]=e.formulaBarInputBorder,a["--sp-formula-bar-input-color"]=e.formulaBarInputText,a["--sp-formula-bar-input-focus-border"]=e.formulaBarInputFocusBorder,a["--sp-formula-bar-input-focus-shadow"]=e.formulaBarInputFocusShadow,a["--sp-wrapper-bg"]=e.wrapperBg,a["--sp-cell-editor-border"]=e.cellEditorBorder,a["--sp-cell-editor-color"]=e.cellEditorText,a["--sp-cell-editor-bg"]=e.cellEditorBg,a["--sp-cell-editor-shadow"]=e.cellEditorShadow,a["--sp-tab-bar-bg"]=e.tabBarBg,a["--sp-tab-bar-border"]=e.tabBarBorder,a["--sp-tab-active-bg"]=e.tabActiveBg,a["--sp-tab-active-color"]=e.tabActiveText,a["--sp-tab-active-border"]=e.tabActiveBorder,a["--sp-tab-inactive-bg"]=e.tabInactiveBg,a["--sp-tab-inactive-color"]=e.tabInactiveText,a["--sp-tab-inactive-border"]=e.tabInactiveBorder,a["--sp-tab-hover-bg"]=e.tabHoverBg,a["--sp-tab-add-btn-color"]=e.tabAddBtnColor,a["--sp-tab-add-btn-hover-bg"]=e.tabAddBtnHoverBg,a["--sp-tab-scroll-btn-color"]=e.tabScrollBtnColor,a["--sp-tab-scroll-btn-hover-bg"]=e.tabScrollBtnHoverBg,a["--sp-scroll-thumb"]=e.scrollbarThumb,a["--sp-scroll-thumb-hover"]=e.scrollbarThumbHover,a["--sp-scroll-btn-bg"]=e.scrollBtnBg,a["--sp-scroll-btn-color"]=e.scrollBtnColor,a["--sp-scroll-btn-hover-bg"]=e.scrollBtnHoverBg,a["--sp-scroll-btn-active-bg"]=e.scrollBtnActiveBg,a["--sp-scroll-track-bg"]=e.scrollTrackBg,a["--sp-toolbar-bg"]=e.toolbarBg,a["--sp-toolbar-border"]=e.toolbarBorder,a["--sp-toolbar-btn-color"]=e.toolbarBtnColor,a["--sp-toolbar-btn-hover-bg"]=e.toolbarBtnHoverBg,a["--sp-toolbar-btn-disabled-color"]=e.toolbarBtnDisabledColor,a["--sp-toolbar-btn-active-color"]=e.toolbarBtnActiveColor,a}function ir(e){return e==="number"?0:1}function cr(e,l,o){var i;if(e==null||e.trim()==="")return{kind:"blank"};const n=l??"";if(n===cl||n==="@")return{kind:"text",text:e};if(sl(n)){if(Gl(e))return{kind:"number",num:Number(e)};const r=Tn(e,o);return r?{kind:"number",num:r.serial}:{kind:"text",text:wl(e,n,o)}}const a=Kl(n);if(a.kind==="date"||a.kind==="duration"){const r=Number(e);return Number.isFinite(r)?{kind:"number",num:r}:{kind:"text",text:wl(e,n,o)}}if(a.kind==="number"){const r=Number(e);if(Number.isFinite(r)){const f=((i=a.sections.find(m=>m.hasDigits))==null?void 0:i.scale)??1;return{kind:"number",num:r*f}}return{kind:"text",text:wl(e,n,o)}}return{kind:"text",text:wl(e,n,o)}}function iu(e,l,o,n){if(e.kind==="blank"||l.kind==="blank")return e.kind==="blank"&&l.kind==="blank"?0:e.kind==="blank"?1:-1;const a=ir(e.kind),i=ir(l.kind);if(a!==i)return o==="asc"?a-i:i-a;let r;return e.kind==="number"?r=(e.num??0)-(l.num??0):r=(e.text??"").localeCompare(l.text??"",n,{numeric:!0}),o==="asc"?r:-r}function cu(e,l,o){const n=e.map((a,i)=>i);return n.sort((a,i)=>{const r=iu(e[a],e[i],l,o);return r!==0?r:a-i}),n}function su(e){if(e.length<2||e[0].kind!=="text")return!1;for(let l=1;l<e.length;l++)if(e[l].kind==="number")return!0;return!1}function vo(e){return e?JSON.parse(JSON.stringify(e)):null}function sr(e,l,o,n){if(!e)return null;const a=o-l+1,i={...e.range};return n?l<=i.endRow&&(l<=i.startRow&&(i.startRow+=a),i.endRow+=a):o<i.startRow?(i.startRow-=a,i.endRow-=a):l<=i.endRow&&(i.endRow-=Math.min(a,i.endRow-l+1),i.endRow<i.startRow&&(i.endRow=i.startRow)),{range:i,columns:e.columns}}function ur(e,l,o,n){if(!e)return null;const a=o-l+1,i={...e.range},r={};if(n){l<=i.endCol&&(l<=i.startCol&&(i.startCol+=a),i.endCol+=a);for(const f in e.columns){const m=Number(f);r[m>=l?m+a:m]=e.columns[f]}}else{o<i.startCol?(i.startCol-=a,i.endCol-=a):l<=i.endCol&&(i.endCol-=Math.min(a,i.endCol-l+1),i.endCol<i.startCol&&(i.endCol=i.startCol));for(const f in e.columns){const m=Number(f);m>=l&&m<=o||(r[m>o?m-a:m]=e.columns[f])}}return{range:i,columns:r}}function uu(e,l,o,n,a){function i(F,D){const O=D-F+1,ue=Xe(F,D),ge=[],Me=[];for(const Z in e.cells){const He=Z.indexOf(",");if(He<0)continue;const $e=parseInt(Z.substring(0,He),10),le=parseInt(Z.substring(He+1),10);le>=F&&le<=D?Me.push(Z):le>D&&ge.push({oldKey:Z,newKey:e.cellKey($e,le-O),cell:e.cells[Z]})}for(const Z of Me)Reflect.deleteProperty(e.cells,Z);for(const Z of ge)Reflect.deleteProperty(e.cells,Z.oldKey),e.cells[Z.newKey]=Z.cell;const Se=e.rowHeights.value,he=new Array(Se.length);for(let Z=0;Z<F;Z++)he[Z]=Se[Z];for(let Z=F;Z<Se.length-O;Z++)he[Z]=Se[Z+O];for(let Z=Se.length-O;Z<Se.length;Z++)he[Z]=void 0;e.rowHeights.value=he,ve(ue),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(sr(e.getFilter(),F,D,!1))}function r(F,D){const O=D-F+1,ue=e.rowCount,ge=e.colCount,{lastRow:Me}=y();Me>=F&&Me+O>=ue&&e.ensureCapacity(ge-1,ue-1+O);const Se=e.rowCount,he=gt(F,D),Z=[];for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const st=parseInt(le.substring(0,Ke),10),E=parseInt(le.substring(Ke+1),10);E>=F&&Z.push({oldKey:le,newKey:e.cellKey(st,E+O),cell:e.cells[le],oldRow:E})}Z.sort((le,Ke)=>Ke.oldRow-le.oldRow);for(const le of Z)Reflect.deleteProperty(e.cells,le.oldKey),e.cells[le.newKey]=le.cell;for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const st=parseInt(le.substring(Ke+1),10);st>=F&&st<=D&&Reflect.deleteProperty(e.cells,le)}const He=e.rowHeights.value,$e=new Array(Se);for(let le=0;le<F;le++)$e[le]=He[le];for(let le=F;le<=D;le++)$e[le]=void 0;for(let le=F;le<Se;le++)$e[le+O]=He[le];e.rowHeights.value=$e,ve(he),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(sr(e.getFilter(),F,D,!0))}function f(F,D){const O=D-F+1,ue=e.colCount,ge=e.rowCount,{lastCol:Me}=y();Me>=F&&Me+O>=ue&&e.ensureCapacity(ue-1+O,ge-1);const Se=e.colCount,he=Ze(F,D),Z=[];for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const st=parseInt(le.substring(0,Ke),10),E=parseInt(le.substring(Ke+1),10);st>=F&&Z.push({oldKey:le,newKey:e.cellKey(st+O,E),cell:e.cells[le],oldCol:st})}Z.sort((le,Ke)=>Ke.oldCol-le.oldCol);for(const le of Z)Reflect.deleteProperty(e.cells,le.oldKey),e.cells[le.newKey]=le.cell;for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const st=parseInt(le.substring(0,Ke),10);st>=F&&st<=D&&Reflect.deleteProperty(e.cells,le)}const He=e.colWidths.value,$e=new Array(Se);for(let le=0;le<F;le++)$e[le]=He[le];for(let le=F;le<=D;le++)$e[le]=100;for(let le=F;le<Se;le++)$e[le+O]=He[le];e.colWidths.value=$e,ve(he),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(ur(e.getFilter(),F,D,!0))}function m(F,D){const O=D-F+1,ue=Je(F,D),ge=[],Me=[];for(const Z in e.cells){const He=Z.indexOf(",");if(He<0)continue;const $e=parseInt(Z.substring(0,He),10),le=parseInt(Z.substring(He+1),10);$e>=F&&$e<=D?Me.push(Z):$e>D&&ge.push({oldKey:Z,newKey:e.cellKey($e-O,le),cell:e.cells[Z]})}for(const Z of Me)Reflect.deleteProperty(e.cells,Z);for(const Z of ge)Reflect.deleteProperty(e.cells,Z.oldKey),e.cells[Z.newKey]=Z.cell;const Se=e.colWidths.value,he=new Array(Se.length);for(let Z=0;Z<F;Z++)he[Z]=Se[Z];for(let Z=F;Z<Se.length-O;Z++)he[Z]=Se[Z+O];for(let Z=Se.length-O;Z<Se.length;Z++)he[Z]=100;e.colWidths.value=he,ve(ue),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(ur(e.getFilter(),F,D,!1))}function y(){let F=-1,D=-1;for(const O in e.cells){const ue=O.split(",");if(ue.length===2){const ge=parseInt(ue[0],10),Me=parseInt(ue[1],10),Se=e.cells[O];Se&&(Se.value!==""||Se.styleId!==void 0)&&(ge>F&&(F=ge),Me>D&&(D=Me))}}for(let O=e.colCount-1;O>=0;O--){const ue=e.colWidths.value[O];if(ue!==void 0&&ue!==100){O>F&&(F=O);break}}for(let O=e.rowCount-1;O>=0;O--)if(e.rowHeights.value[O]!==void 0){O>D&&(D=O);break}return{lastCol:F,lastRow:D}}function k(F,D){const O=e.resolveStyle(e.cells[e.cellKey(F,D)]);return typeof(O==null?void 0:O.numberFormat)=="string"?O.numberFormat:""}function d(F,D,O){for(let ue=D;ue<=O;ue++)if(e.getCellRaw(F,ue).trim()!=="")return!0;return!1}function w(F){const{startRow:D,endRow:O,startCol:ue,endCol:ge}=F;let Me=ue,Se=ge;for(;Me>0&&d(Me-1,D,O);)Me--;for(;Se<e.colCount-1&&d(Se+1,D,O);)Se++;return{startRow:D,endRow:O,startCol:Me,endCol:Se}}function v(F){const D=w(F);return D.startCol!==F.startCol||D.endCol!==F.endCol}function R(F,D,O,ue=F){let ge,Me;if(O)ge=O.startRow,Me=O.endRow;else{const le=e.selection.value,Ke=!!le&&le.startRow===le.endRow&&le.startCol===le.endCol;ge=Ke||!le?0:le.startRow,Me=Ke||!le?e.rowCount-1:le.endRow}let Se=-1,he=-1;for(let le=ge;le<=Me;le++){let Ke=!1;for(let st=F;st<=D;st++)if(e.getCellRaw(st,le).trim()!==""){Ke=!0;break}Ke&&(Se<0&&(Se=le),he=le)}if(Se<0)return null;const Z=[];for(let le=Se;le<=he;le++){const Ke=e.getCellRaw(ue,le);Z.push(cr(Ke,k(ue,le),e.locale.value))}const He=su(Z)?Se+1:Se;let $e=!1;for(let le=Se;le<=he&&!$e;le++)for(let Ke=F;Ke<=D;Ke++){const st=e.cells[e.cellKey(Ke,le)];if(st&&st.value.startsWith("=")){$e=!0;break}}if(!$e)for(const le in e.merges){const Ke=e.merges[le];if(Ke&&Ke.startCol<=D&&Ke.endCol>=F&&Ke.startRow<=Me&&Ke.endRow>=ge){$e=!0;break}}return{firstRow:Se,lastRow:he,sortStart:He,blocked:$e}}function G(F,D){const O=R(F,D);return!!O&&!O.blocked&&O.sortStart<O.lastRow}function te(F,D,O){var E,U;const ue=D??e.selection.value;if(!ue)return;const ge=ue.startCol,Me=ue.endCol,Se=O??ge,he=R(ge,Me,{startRow:ue.startRow,endRow:ue.endRow},Se);if(!he||he.blocked||he.sortStart>=he.lastRow)return;const Z=Me-ge+1,He=he.lastRow-he.sortStart+1,$e=[],le=[];for(let ee=he.sortStart;ee<=he.lastRow;ee++){const de=new Array(Z);for(let fe=ge;fe<=Me;fe++)de[fe-ge]=e.cells[e.cellKey(fe,ee)]??null;$e.push(de);const ye=e.getCellRaw(Se,ee);le.push(cr(ye,k(Se,ee),e.locale.value))}const Ke=cu(le,F,e.locale.value);let st=!1;for(let ee=0;ee<He;ee++)if(Ke[ee]!==ee){st=!0;break}if(st){l.saveUndo();for(let ee=0;ee<He;ee++){const de=$e[Ke[ee]],ye=he.sortStart+ee;for(let fe=ge;fe<=Me;fe++){const ke=e.cellKey(fe,ye),We=de[fe-ge],mt=We?We.value:"",Bt=(E=e.cells[ke])==null?void 0:E.styleId;mt!==""||Bt!==void 0?e.cells[ke]={value:mt,styleId:Bt}:e.delCell(ke)}}zn();for(let ee=he.sortStart;ee<=he.lastRow;ee++)for(let de=ge;de<=Me;de++)e.formulaDeps.markDirty(e.cellKey(de,ee));(U=e.scheduleRender)==null||U.call(e),p()}}const Y=t.ref(!1),K=t.ref(null);function C(F){const D=e.selection.value;if(!D||!v(D))return!1;const O=w(D);return K.value={order:F,originalRange:D,expandedRange:O},Y.value=!0,!0}function j(F){const D=K.value;if(!D)return;const{order:O,originalRange:ue,expandedRange:ge}=D;Y.value=!1,K.value=null,te(O,F?ge:ue,ue.startCol),Ne.value=O}function q(){Y.value=!1,K.value=null}const se=t.ref(!1),Ne=t.ref("asc");function Qe(F){se.value=F,F&&(l.textColorMenuOpen.value=!1,l.fillColorMenuOpen.value=!1,l.fontSizeMenuOpen.value=!1)}function Ge(F){C(F)||(Ne.value=F,te(F))}function be(){C(Ne.value)||te(Ne.value)}function ve(F){Object.keys(e.merges).forEach(D=>Reflect.deleteProperty(e.merges,D));for(const D of F)if(!(D.newRange.startCol>D.newRange.endCol||D.newRange.startRow>D.newRange.endRow)&&(e.merges[D.newAnchorKey]={...D.newRange},D.anchorCell)){const O=D.anchorCell.value,ue=D.anchorCell.styleId;O===""&&!ue||(e.cells[D.newAnchorKey]={value:O,styleId:ue||void 0})}}function Xe(F,D){const O=D-F+1,ue=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;const Se=e.cells[ge]?{value:e.cells[ge].value,styleId:e.cells[ge].styleId??0}:{value:"",styleId:0},{startCol:he,endCol:Z}=Me;let{startRow:He,endRow:$e}=Me;if(He>D){He-=O,$e-=O,ue.push({newAnchorKey:e.cellKey(he,He),newRange:{startCol:he,startRow:He,endCol:Z,endRow:$e}});continue}if($e<F){ue.push({newAnchorKey:ge,newRange:{startCol:he,startRow:He,endCol:Z,endRow:$e}});continue}if(He>=F&&$e<=D||(He>=F&&He<=D&&(He=F),$e>=F&&$e<=D?$e=F-1:$e>D&&($e-=O),He>$e))continue;const le=he,Ke=He,st=e.cellKey(le,Ke),U=ge.split(",").map(Number)[1],ee=U>=F&&U<=D||le!==Me.startCol||Ke!==U;ue.push({newAnchorKey:st,newRange:{startCol:he,startRow:He,endCol:Z,endRow:$e},anchorCell:ee?Se:void 0})}return ue}function Je(F,D){const O=D-F+1,ue=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;const Se=e.cells[ge]?{value:e.cells[ge].value,styleId:e.cells[ge].styleId??0}:{value:"",styleId:0};let{startCol:he,endCol:Z}=Me;const{startRow:He,endRow:$e}=Me;if(he>D){he-=O,Z-=O,ue.push({newAnchorKey:e.cellKey(he,He),newRange:{startCol:he,startRow:He,endCol:Z,endRow:$e}});continue}if(Z<F){ue.push({newAnchorKey:ge,newRange:{startCol:he,startRow:He,endCol:Z,endRow:$e}});continue}if(he>=F&&Z<=D||(he>=F&&he<=D&&(he=F),Z>=F&&Z<=D?Z=F-1:Z>D&&(Z-=O),he>Z))continue;const le=he,Ke=He,st=e.cellKey(le,Ke),U=ge.split(",").map(Number)[0],ee=U>=F&&U<=D||le!==U||Ke!==Me.startRow;ue.push({newAnchorKey:st,newRange:{startCol:he,startRow:He,endCol:Z,endRow:$e},anchorCell:ee?Se:void 0})}return ue}function gt(F,D){const O=D-F+1,ue=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;const{startCol:Se,endCol:he}=Me;let{startRow:Z,endRow:He}=Me;He<F?ue.push({newAnchorKey:ge,newRange:{startCol:Se,startRow:Z,endCol:he,endRow:He}}):Z>D?(Z+=O,He+=O,ue.push({newAnchorKey:e.cellKey(Se,Z),newRange:{startCol:Se,startRow:Z,endCol:he,endRow:He}})):(He+=O,ue.push({newAnchorKey:ge,newRange:{startCol:Se,startRow:Z,endCol:he,endRow:He}}))}return ue}function Ze(F,D){const O=D-F+1,ue=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;let{startCol:Se,endCol:he}=Me;const{startRow:Z,endRow:He}=Me;he<F?ue.push({newAnchorKey:ge,newRange:{startCol:Se,startRow:Z,endCol:he,endRow:He}}):Se>D?(Se+=O,he+=O,ue.push({newAnchorKey:e.cellKey(Se,Z),newRange:{startCol:Se,startRow:Z,endCol:he,endRow:He}})):(he+=O,ue.push({newAnchorKey:ge,newRange:{startCol:Se,startRow:Z,endCol:he,endRow:He}}))}return ue}let tt=0;function et(){return tt++,`s_${tt}`}function oe(F,D){const O=Math.max(1,(D==null?void 0:D.colCount)??e.colCount),ue=Math.max(1,(D==null?void 0:D.rowCount)??e.rowCount),ge=new Array(O).fill(100),Me=new Array(ue).fill(void 0);return{id:et(),name:F,cells:{},merges:{},styles:[{}],borders:[{}],selection:{startCol:0,startRow:0,endCol:0,endRow:0},activeCell:{col:0,row:0},scrollX:0,scrollY:0,colWidths:ge,rowHeights:Me,colCount:O,rowCount:ue,freeze:{rows:0,cols:0},filter:null}}const me=t.ref([oe("Sheet1")]),g=t.ref(0);function I(){const F=me.value[g.value];F&&(F.cells={...e.cells},F.merges={...e.merges},F.selection=e.selection.value?{...e.selection.value}:null,F.activeCell={...e.activeCell.value},F.scrollX=e.scrollX.value,F.scrollY=e.scrollY.value,F.colWidths=[...e.colWidths.value],F.rowHeights=[...e.rowHeights.value],F.styles=[...e.styles],F.borders=[...e.borders],F.colCount=e.colCount,F.rowCount=e.rowCount,F.freeze={rows:e.freeze.rows,cols:e.freeze.cols},F.filter=vo(e.getFilter()))}function L(F){var he;const D=me.value[F];if(!D)return;Object.keys(e.cells).forEach(Z=>e.delCell(Z)),Object.assign(e.cells,D.cells),Object.keys(e.merges).forEach(Z=>Reflect.deleteProperty(e.merges,Z)),D.merges&&Object.assign(e.merges,D.merges),e.selection.value=D.selection?{...D.selection}:null,e.activeCell.value={...D.activeCell};const O=e.activeCell.value,ue=e.selection.value,ge=e.findMerge(O.col,O.row);ge&&ge.anchor===e.cellKey(O.col,O.row)&&(!ue||ue.startCol===O.col&&ue.startRow===O.row&&ue.endCol===O.col&&ue.endRow===O.row)&&e.selectCell(O.col,O.row),e.scrollX.value=D.scrollX,e.scrollY.value=D.scrollY,e.colWidths.value=[...D.colWidths],e.rowHeights.value=[...D.rowHeights];const Me=Math.max(1,D.colCount??e.colCount),Se=Math.max(1,D.rowCount??e.rowCount);if((he=e.setDims)==null||he.call(e,Me,Se),e.freeze.rows=Math.max(0,Math.min(D.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(D.freeze.cols,e.colCount)),D.filter){const Z=D.filter.range;e.setFilter({range:{startCol:Math.max(0,Math.min(Z.startCol,e.colCount-1)),endCol:Math.max(0,Math.min(Z.endCol,e.colCount-1)),startRow:Math.max(0,Math.min(Z.startRow,e.rowCount-1)),endRow:Math.max(0,Math.min(Z.endRow,e.rowCount-1))},columns:{...D.filter.columns}},!0)}else e.setFilter(null,!0);e.syncStyles(D.styles),e.syncBorders(D.borders??[{}]),g.value=F}function $(F){F===g.value||F<0||F>=me.value.length||(e.cancelEdit(),I(),L(F))}function J(F){return l.saveUndo(),e.cancelEdit(),I(),me.value.push(oe(F??`Sheet${me.value.length+1}`)),L(me.value.length-1),me.value.length-1}function ie(F){return me.value.length<=1||(l.saveUndo(),e.cancelEdit(),me.value.splice(F,1),L(Math.min(F,me.value.length-1))),g.value}function re(F,D){me.value[F]&&D.trim()&&(l.saveUndo(),me.value[F].name=D.trim())}function pe(F){l.saveUndo(),e.cancelEdit(),I();const D=me.value[F];if(!D)return F;let O=D.name;const ue=O.match(/^(.*?)\s*\((\d+)\)$/);let ge=ue?parseInt(ue[2],10)+1:2;ue&&(O=ue[1]);let Me=`${O} (${ge})`;const Se=new Set(me.value.map(Z=>Z.name));for(;Se.has(Me);)ge++,Me=`${O} (${ge})`;const he={id:et(),name:Me,cells:{...D.cells},merges:D.merges?{...D.merges}:{},styles:[...D.styles],borders:D.borders?[...D.borders]:[{}],selection:D.selection?{...D.selection}:null,activeCell:D.activeCell?{...D.activeCell}:{col:0,row:0},scrollX:D.scrollX,scrollY:D.scrollY,colWidths:[...D.colWidths],rowHeights:[...D.rowHeights],colCount:D.colCount,rowCount:D.rowCount,freeze:{...D.freeze},filter:vo(D.filter)};return me.value.splice(F+1,0,he),L(F+1),F+1}function ce(F,D){var Me;const O=F+D;if(O<0||O>=me.value.length)return;l.saveUndo();const ue=g.value,ge=me.value.splice(F,1)[0];me.value.splice(O,0,ge),ue===F?g.value=O:F<ue&&O>=ue?g.value=ue-1:F>ue&&O<=ue&&(g.value=ue+1),(Me=e.scheduleRender)==null||Me.call(e)}const A=t.computed(()=>me.value.length);let c="";const u=o;function p(){I();const F=me.value.map(O=>{const ue={};for(const[he,Z]of Object.entries(O.cells))ue[he]={value:Z.value},Z.styleId&&Z.styleId>0&&(ue[he].styleId=Z.styleId);const ge={name:O.name,cells:ue};O.styles&&O.styles.length>1&&(ge.styles=[...O.styles]),O.borders&&O.borders.length>1&&(ge.borders=[...O.borders]),O.merges&&Object.keys(O.merges).length&&(ge.merges={...O.merges});const Me={};for(let he=0;he<O.colWidths.length;he++)O.colWidths[he]!==100&&(Me[he]=O.colWidths[he]);Object.keys(Me).length&&(ge.colWidths=Me);const Se={};for(let he=0;he<O.rowHeights.length;he++){const Z=O.rowHeights[he];Z!=null&&(Se[he]=Z)}return Object.keys(Se).length&&(ge.rowHeights=Se),O.colCount!==26&&(ge.colCount=O.colCount),O.rowCount!==200&&(ge.rowCount=O.rowCount),(O.freeze.rows!==0||O.freeze.cols!==0)&&(ge.freeze={rows:O.freeze.rows,cols:O.freeze.cols}),O.filter&&(ge.filter=vo(O.filter)),ge}),D=JSON.stringify(F);D!==c&&(c=D,u.value=F,a&&(a.value=D))}e.emitModelData=p;let H=!1;function ct(){H||(H=!0,Promise.resolve().then(()=>{H=!1,p()}))}const ae=t.computed(()=>e.props.theme==="dark"?Tr:Br),Pe=t.computed(()=>au(ae.value,e.props.width,e.props.height,gn)),at=t.computed(()=>{const F={};for(const[D,O]of Object.entries(Pe.value))D.startsWith("--")&&(F[D]=O);return F}),St=t.ref(null),Rt=t.ref(null),Mt=t.ref(null),It=t.ref(null),_t=t.ref(null),tl=t.reactive({w:800,h:600});e.viewSize&&t.watch(tl,F=>{e.viewSize&&(e.viewSize.w=F.w,e.viewSize.h=F.h)},{deep:!0});const vl=48,Dl=28,ul=11,$t=t.computed(()=>Math.max(0,e.totalWidth.value-Math.max(0,tl.w-vl-ul))),kl=t.computed(()=>Math.max(0,e.totalHeight.value-Math.max(0,tl.h-Dl-ul)));function dl(F,D){const O=Math.max(0,tl.w-vl-ul),ue=Math.max(0,tl.h-Dl-ul),ge=F??e.scrollX.value,Me=D??e.scrollY.value,Se=40,he=Math.max(0,e.totalWidth.value-O),Z=Math.max(0,e.totalHeight.value-ue);if(ge>=he-Se&&ge>e.scrollX.value||Me>=Z-Se&&Me>e.scrollY.value){const He=Math.max(0,Math.ceil((ge+O)/100)+2),$e=Math.max(0,Math.ceil((Me+ue)/24)+2);e.ensureCapacity(He,$e)}e.scrollX.value=Math.max(0,Math.min(ge,Math.max(0,e.totalWidth.value-O))),e.scrollY.value=Math.max(0,Math.min(Me,Math.max(0,e.totalHeight.value-ue)))}e.clampScroll=dl;function fl(){var F;return typeof window>"u"?!1:!((F=window.matchMedia)!=null&&F.call(window,"(hover: none) and (pointer: coarse)").matches)}function Nl(F=!1){t.nextTick(()=>{const D=It.value;if(D){if(!e.editingCell.value&&!fl()){document.activeElement===D&&D.blur();return}D.focus({preventScroll:!0}),F&&D.select()}})}function bn(){Nl()}function Yl(){var D;const F=e.selection.value;if(F){l.saveUndo();for(let O=F.startRow;O<=F.endRow;O++)e.rowHeights.value[O]=void 0;(D=e.scheduleRender)==null||D.call(e),p()}}function an(){var D;const F=e.selection.value;if(F){l.saveUndo();for(let O=F.startCol;O<=F.endCol;O++)e.colWidths.value[O]=100;(D=e.scheduleRender)==null||D.call(e),p()}}return{deleteRows:i,insertRows:r,insertCols:f,deleteCols:m,sortSelectedColumns:te,canSortColumns:G,sortMenuOpen:se,cachedSortOrder:Ne,onSortMenuToggle:Qe,onSortChange:Ge,applyCachedSort:be,sortConfirmOpen:Y,prepareSortConfirmation:C,confirmSort:j,cancelSortConfirmation:q,sheets:me,activeSheetIndex:g,saveSheet:I,loadSheet:L,switchSheet:$,addSheet:J,removeSheet:ie,renameSheet:re,dupSheet:pe,moveSheet:ce,sheetCount:A,mkSheet:oe,emitModelData:p,scheduleOptEmit:ct,themeColors:ae,outerStyle:Pe,toolbarThemeVars:at,wrapperRef:St,canvasRef:Rt,freezeCanvasRef:Mt,editInputRef:It,formulaBarRef:_t,viewSize:tl,maxScrollX:$t,maxScrollY:kl,clampScroll:dl,canFocusHiddenEditor:fl,focusEditInput:Nl,onCanvasFocus:bn,resetRowHeight:Yl,resetColWidth:an,modelData:u}}function dr(e){return!!e&&e.width!==void 0&&e.width>0}function Ft(e,l,o,n){const a=dr(e),i=dr(l);if(!a&&!i)return;if(a&&!i)return e;if(!a&&i)return l;const r=e.width??0,f=l.width??0;return r>f?e:f>r?l:e}function fr(e,l){if(!e||typeof e!="object")return null;const o=e,n=o.columns??{},a=Object.keys(n).map(r=>Number(r)).filter(r=>!Number.isNaN(r));if(!o.range||typeof o.range.startRow!="number"){let r=a.length?Math.min(...a):0,f=a.length?Math.max(...a):0,m=0;for(const y in l){const k=y.indexOf(",");if(k<0)continue;const d=parseInt(y.substring(k+1),10);d>m&&(m=d)}return{range:{startCol:r,startRow:0,endCol:f,endRow:Math.max(0,m)},columns:n}}const i={...o.range};for(const r of a)r<i.startCol&&(i.startCol=r),r>i.endCol&&(i.endCol=r);return{range:i,columns:n}}function du(e,l,o,n,a){let i=!1,r=null,f=1,m=()=>{},y=()=>{},k=()=>{};function d(){i||(i=!0,requestAnimationFrame(()=>{i=!1,G(),te()}))}e.scheduleRender=d;function w(s){const{frozenColumnsWidth:b}=e.getFrozenMetrics(),M=b>0&&s<52+b?s-52:s-52+e.scrollX.value;return e.hitCol(M)}function v(s){const{frozenRowsHeight:b}=e.getFrozenMetrics(),M=b>0&&s<24+b?s-24:s-24+e.scrollY.value;return e.hitRow(M)}const R="#444";function G(){const s=n.wrapperRef.value,b=n.canvasRef.value;if(!s||!b||(r=b.getContext("2d"),!r))return;f=window.devicePixelRatio||1;const M=s.getBoundingClientRect(),_=M.width,x=M.height;n.viewSize.w=_,n.viewSize.h=x,b.width=_*f,b.height=x*f,b.style.width=_+"px",b.style.height=x+"px",r.setTransform(f,0,0,f,0,0);const P=e.scrollX.value,z=e.scrollY.value,V=52,Q=24,Ee=n.themeColors.value,Ve=e.getFilter(),ot=e.colPositions.value,pt=e.rowPositions.value,yt=e.colWidths.value,{frozenRowsHeight:Dt,frozenColumnsWidth:jt}=e.getFrozenMetrics(),nl=V+jt,Sl=Q+Dt,jl=Math.max(0,_-V-11-jt),un=Math.max(0,x-Q-11-Dt),dn=Math.max(0,e.freeze.cols-1),fn=Math.max(0,e.freeze.rows-1),Zl=Math.max(e.freeze.cols,e.hitCol(jt+P));let mn=Zl;for(let T=Zl;T<e.colCount&&!(V+ot[T]-P>=_);T++)mn=T;const bl=Math.max(e.freeze.rows,e.hitRow(Dt+z));let Hl=bl;for(let T=bl;T<e.rowCount&&!(Q+pt[T]-z>=x);T++)Hl=T;let Zt=Zl,qt=mn,ol=bl,Ol=Hl;jt>0&&(Zt=0,qt=Math.max(qt,dn)),Dt>0&&(ol=0,Ol=Math.max(Ol,fn));let Ll=Zt,ql=ol;for(const T in e.merges){const Be=e.merges[T];Be&&(Be.startRow>Ol||Be.endRow<ol||Be.startCol>qt||Be.endCol<Zt||(Be.startCol<Ll&&(Ll=Be.startCol),Be.startRow<ql&&(ql=Be.startRow)))}const zl=new Array(ql);for(let T=ql;T<=Ol;T++)zl[T]=pt[T+1]-pt[T];r.fillStyle=Ee.bg,r.fillRect(0,0,_,x),r.fillStyle=Ee.gridBg,r.fillRect(V,Q,_-V,x-Q);const vt=e.selection.value,Rn=e.editingCell.value;m=(T,Be,Oe,wt,zt,Nt)=>{for(let qe=wt;qe<=zt;qe++)for(let Re=Be;Re<=Oe;Re++){if(e.findMerge(Re,qe))continue;const lt=e.cellToScreenRect(qe,Re),_e=lt.x,Le=lt.y,rt=lt.width,it=lt.height;if(_e+rt<V||Le+it<Q||_e>_||Le>x)continue;const kt=e.findHighlight?e.findHighlight(Re,qe):null,Et=e.resolveStyle(e.cells[e.cellKey(Re,qe)]),Ht=typeof(Et==null?void 0:Et.backgroundColor)=="string"?Et.backgroundColor:"";if(Ht&&(T.fillStyle=Ht,T.fillRect(_e,Le,rt,it)),kt&&(T.fillStyle=kt==="active"?Ee.findActiveBg:Ee.findMatchBg,T.fillRect(_e,Le,rt,it)),e.isSelected(Re,qe)&&(T.fillStyle=Ee.selectionBg,e.selectionMode.value==="row"||e.selectionMode.value==="col"?T.fillRect(_e,Le,yt[Re],Nt[qe]):T.fillRect(_e,Le,rt,it)),e.activeCell.value.col===Re&&e.activeCell.value.row===qe&&(T.strokeStyle=Ee.activeCellBorder,T.lineWidth=2,T.strokeRect(_e+1,Le+1,rt-2,it-2)),kt==="active"&&(T.strokeStyle=Ee.findActiveBg,T.lineWidth=2,T.strokeRect(_e+1,Le+1,rt-2,it-2)),T.strokeStyle=Ee.gridLine,T.lineWidth=.5,T.strokeRect(_e+.25,Le+.25,rt-.5,it-.5),!(Rn&&Rn.col===Re&&Rn.row===qe)){const we=e.resolveStyle(e.cells[e.cellKey(Re,qe)]),ne=e.getCellValue(Re,qe),Te=typeof(we==null?void 0:we.numberFormat)=="string"?we.numberFormat:"",Ie=ne?wl(ne,Te,e.locale.value):"";if(Ie){const nt=e.cellFontSize(Re,qe),xt=typeof(we==null?void 0:we.fontFamily)=="string"&&we.fontFamily?we.fontFamily:hn,Yt=(we==null?void 0:we.fontWeight)==="bold"?"bold":"normal",Ut=(we==null?void 0:we.fontStyle)==="italic"?"italic":"normal",_l=(we==null?void 0:we.underline)==="underline",Jl=(we==null?void 0:we.strikethrough)==="line-through",$l=typeof(we==null?void 0:we.color)=="string"?we.color:"",Ql=typeof(we==null?void 0:we.textAlign)=="string"?we.textAlign:io(ne,Te)?"right":"left",Vn=typeof(we==null?void 0:we.verticalAlign)=="string"?we.verticalAlign:"top";T.fillStyle=$l||Ee.cellText,T.font=`${Ut} ${Yt} ${nt}px ${xt}`,T.textBaseline="alphabetic",T.save(),T.beginPath(),T.rect(_e+5,Le+1,rt-10,it-2),T.clip();const en=(we==null?void 0:we.wrap)==="wrap";let Jt=rt-10;Ve&&qe===Ve.range.startRow&&Re>=Ve.range.startCol&&Re<=Ve.range.endCol&&(Jt=rt-10-ie);let Ml=Ie;const xl=!en&&No(Te),tn=Ie===Gn||Fo(ne,Te);if(tn||xl){if(tn){const xn=Math.max(1,T.measureText("#").width),Kn=Math.max(1,Math.floor(Jt/xn));Ml="#".repeat(Kn)}else if(e.getWrappedLines(T,Ie,1e9,!1).some(ln=>ln&&T.measureText(ln).width>Jt)){const ln=Math.max(1,T.measureText("#").width),Hn=Math.max(1,Math.floor(Jt/ln));Ml="#".repeat(Hn)}}const il=e.getWrappedLines(T,Ml,Jt,en),{ascent:Mn,descent:to}=e.measureFontMetrics(xt,nt,Yt,Ut),lo=Mn+to,Ou=il.length*lo;let no;Vn==="middle"?no=Le+(it-Ou)/2+Mn:Vn==="bottom"?no=Le+it-e.BASE_CELL_VPAD-to-(il.length-1)*lo:no=Le+e.BASE_CELL_VPAD+Mn;for(let xn=0;xn<il.length;xn++){const Kn=il[xn],ln=no+xn*lo,Hn=T.measureText(Kn);let pn;if(Ql==="center"?pn=_e+rt/2-Hn.width/2:Ql==="right"?pn=_e+rt-5-Hn.width:pn=_e+5,T.fillText(Kn,pn,ln),_l&&(T.strokeStyle=$l||Ee.cellText,T.lineWidth=1,T.beginPath(),T.moveTo(pn,ln+to+1),T.lineTo(pn+Hn.width,ln+to+1),T.stroke()),Jl){T.strokeStyle=$l||Ee.cellText,T.lineWidth=1;const gr=ln-Mn+lo*.42;T.beginPath(),T.moveTo(pn,gr),T.lineTo(pn+Hn.width,gr),T.stroke()}}T.restore()}}Ve&&qe===Ve.range.startRow&&Re>=Ve.range.startCol&&Re<=Ve.range.endCol&&c(T,_e,Le,rt,it,Zo(Ve.columns[Re]),Ee)}};const Ye=(T,Be,Oe)=>{const wt=e.findMerge(T,Be);return wt?e.getCellBorderSide(e.cells[wt.anchor],Oe):e.getCellBorderSide(e.cells[e.cellKey(T,Be)],Oe)};y=(T,Be,Oe,wt,zt,Nt)=>{T.fillStyle=R;for(let qe=wt;qe<=zt;qe++)for(let Re=Be;Re<=Oe;Re++){if(e.findMerge(Re,qe))continue;const lt=e.cellToScreenRect(qe,Re),_e=lt.x,Le=lt.y,rt=lt.width,it=lt.height;if(_e+rt<V||Le+it<Q||_e>_||Le>x)continue;const kt=e.cells[e.cellKey(Re,qe)],Et={top:e.getCellBorderSide(kt,"top"),right:e.getCellBorderSide(kt,"right"),bottom:e.getCellBorderSide(kt,"bottom"),left:e.getCellBorderSide(kt,"left")},Ht={top:Ye(Re,qe-1,"bottom"),left:Ye(Re-1,qe,"right"),bottom:Ye(Re,qe+1,"top"),right:Ye(Re+1,qe,"left")},we=Ft(Ht.top,Et.top),ne=Ft(Ht.left,Et.left),Te=Ft(Et.bottom,Ht.bottom),Ie=Ft(Et.right,Ht.right),nt=(we==null?void 0:we.width)??0,xt=(ne==null?void 0:ne.width)??0,Yt=(Te==null?void 0:Te.width)??0,Ut=(Ie==null?void 0:Ie.width)??0;nt>0&&(T.fillStyle=(we==null?void 0:we.color)||R,T.fillRect(_e,Le,rt,nt)),Yt>0&&(T.fillStyle=(Te==null?void 0:Te.color)||R,T.fillRect(_e,Le+it-Yt,rt,Yt)),xt>0&&(T.fillStyle=(ne==null?void 0:ne.color)||R,T.fillRect(_e,Le,xt,it)),Ut>0&&(T.fillStyle=(Ie==null?void 0:Ie.color)||R,T.fillRect(_e+rt-Ut,Le,Ut,it)),nt>0&&xt>0&&(T.fillStyle=(we==null?void 0:we.color)||(ne==null?void 0:ne.color)||R,T.fillRect(_e-xt,Le-nt,xt,nt)),nt>0&&Ut>0&&(T.fillStyle=(we==null?void 0:we.color)||(Ie==null?void 0:Ie.color)||R,T.fillRect(_e+rt,Le-nt,Ut,nt)),Yt>0&&xt>0&&(T.fillStyle=(Te==null?void 0:Te.color)||(ne==null?void 0:ne.color)||R,T.fillRect(_e-xt,Le+it,xt,Yt)),Yt>0&&Ut>0&&(T.fillStyle=(Te==null?void 0:Te.color)||(Ie==null?void 0:Ie.color)||R,T.fillRect(_e+rt,Le+it,Ut,Yt))}};const Vt=(T,Be,Oe,wt,zt,Nt,qe)=>{const Re=e.resolveStyle(e.cells[e.cellKey(Be,Oe)]),ut=e.getCellValue(Be,Oe),lt=typeof(Re==null?void 0:Re.numberFormat)=="string"?Re.numberFormat:"",_e=ut?wl(ut,lt,e.locale.value):"";if(!_e)return;const Le=e.cellFontSize(Be,Oe),rt=typeof(Re==null?void 0:Re.fontFamily)=="string"&&Re.fontFamily?Re.fontFamily:hn,it=(Re==null?void 0:Re.fontWeight)==="bold"?"bold":"normal",kt=(Re==null?void 0:Re.fontStyle)==="italic"?"italic":"normal",Et=(Re==null?void 0:Re.underline)==="underline",Ht=(Re==null?void 0:Re.strikethrough)==="line-through",we=typeof(Re==null?void 0:Re.color)=="string"?Re.color:"",ne=typeof(Re==null?void 0:Re.textAlign)=="string"?Re.textAlign:io(ut,lt)?"right":"left",Te=typeof(Re==null?void 0:Re.verticalAlign)=="string"?Re.verticalAlign:"top";T.fillStyle=we||Ee.cellText,T.font=`${kt} ${it} ${Le}px ${rt}`,T.textBaseline="alphabetic",T.save(),T.beginPath(),T.rect(Nt+5,qe+1,wt-10,zt-2),T.clip();const Ie=(Re==null?void 0:Re.wrap)==="wrap",nt=wt-10;let xt=_e;const Yt=!Ie&&No(lt),Ut=_e===Gn||Fo(ut,lt);if(Ut||Yt){if(Ut){const Jt=Math.max(1,T.measureText("#").width),Ml=Math.max(1,Math.floor(nt/Jt));xt="#".repeat(Ml)}else if(e.getWrappedLines(T,_e,1e9,!1).some(xl=>xl&&T.measureText(xl).width>nt)){const xl=Math.max(1,T.measureText("#").width),tn=Math.max(1,Math.floor(nt/xl));xt="#".repeat(tn)}}const _l=e.getWrappedLines(T,xt,nt,Ie),{ascent:Jl,descent:$l}=e.measureFontMetrics(rt,Le,it,kt),Ql=Jl+$l,Vn=_l.length*Ql;let en;Te==="middle"?en=qe+(zt-Vn)/2+Jl:Te==="bottom"?en=qe+zt-e.BASE_CELL_VPAD-$l-(_l.length-1)*Ql:en=qe+e.BASE_CELL_VPAD+Jl;for(let Jt=0;Jt<_l.length;Jt++){const Ml=_l[Jt],xl=en+Jt*Ql,tn=T.measureText(Ml);let il;if(ne==="center"?il=Nt+wt/2-tn.width/2:ne==="right"?il=Nt+wt-5-tn.width:il=Nt+5,T.fillText(Ml,il,xl),Et&&(T.strokeStyle=we||Ee.cellText,T.lineWidth=1,T.beginPath(),T.moveTo(il,xl+$l+1),T.lineTo(il+tn.width,xl+$l+1),T.stroke()),Ht){T.strokeStyle=we||Ee.cellText,T.lineWidth=1;const Mn=xl-Jl+Ql*.42;T.beginPath(),T.moveTo(il,Mn),T.lineTo(il+tn.width,Mn),T.stroke()}}T.restore()},Rl=(T,Be,Oe,wt,zt,Nt,qe,Re)=>{const ut=Be.startCol,lt=Be.endCol,_e=Be.startRow,Le=Be.endRow,rt=wt,it=Nt,kt=qe&<>=e.freeze.cols,Et=Re&&Le>=e.freeze.rows,Ht=e.cells[e.cellKey(ut,_e)],we={top:e.getCellBorderSide(Ht,"top"),right:e.getCellBorderSide(Ht,"right"),bottom:e.getCellBorderSide(Ht,"bottom"),left:e.getCellBorderSide(Ht,"left")};T.fillStyle=R;for(let ne=ut;ne<=lt;ne++){if(qe&&ne>=e.freeze.cols||e.isSameMergeInternal(ne,_e-1,ne,_e))continue;const Te=Ye(ne,_e-1,"bottom"),Ie=Ft(Te,we.top);if(Ie&&Ie.width&&Ie.width>0){const nt=ne<e.freeze.cols?V+ot[ne]:V+ot[ne]-P;T.fillStyle=Ie.color||R,T.fillRect(nt,rt,yt[ne],Ie.width)}}if(!Et)for(let ne=ut;ne<=lt;ne++){if(qe&&ne>=e.freeze.cols||e.isSameMergeInternal(ne,Le,ne,Le+1))continue;const Te=Ye(ne,Le+1,"top"),Ie=Ft(we.bottom,Te);if(Ie&&Ie.width&&Ie.width>0){const nt=ne<e.freeze.cols?V+ot[ne]:V+ot[ne]-P;T.fillStyle=Ie.color||R,T.fillRect(nt,rt+it-Ie.width,yt[ne],Ie.width)}}for(let ne=_e;ne<=Le;ne++){if(Re&&ne>=e.freeze.rows||e.isSameMergeInternal(ut-1,ne,ut,ne))continue;const Te=Ye(ut-1,ne,"right"),Ie=Ft(Te,we.left);if(Ie&&Ie.width&&Ie.width>0){const nt=ne<e.freeze.rows?Q+pt[ne]:Q+pt[ne]-z,xt=pt[ne+1]-pt[ne];T.fillStyle=Ie.color||R,T.fillRect(Oe,nt,Ie.width,xt)}}if(!kt)for(let ne=_e;ne<=Le;ne++){if(Re&&ne>=e.freeze.rows||e.isSameMergeInternal(lt,ne,lt+1,ne))continue;const Te=Ye(lt+1,ne,"left"),Ie=Ft(we.right,Te);if(Ie&&Ie.width&&Ie.width>0){const nt=ne<e.freeze.rows?Q+pt[ne]:Q+pt[ne]-z,xt=pt[ne+1]-pt[ne];T.fillStyle=Ie.color||R,T.fillRect(Oe+zt-Ie.width,nt,Ie.width,xt)}}{const ne=e.isSameMergeInternal(ut,_e-1,ut,_e)?we.top:Ft(Ye(ut,_e-1,"bottom"),we.top),Te=e.isSameMergeInternal(ut-1,_e,ut,_e)?we.left:Ft(Ye(ut-1,_e,"right"),we.left),Ie=(ne==null?void 0:ne.width)??0,nt=(Te==null?void 0:Te.width)??0;Ie>0&&nt>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(Oe-nt,wt-Ie,nt,Ie))}if(!kt){const ne=e.isSameMergeInternal(lt,_e-1,lt,_e)?we.top:Ft(Ye(lt,_e-1,"bottom"),we.top),Te=e.isSameMergeInternal(lt,_e,lt+1,_e)?we.right:Ft(we.right,Ye(lt+1,_e,"left")),Ie=(ne==null?void 0:ne.width)??0,nt=(Te==null?void 0:Te.width)??0;Ie>0&&nt>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(Oe+zt,wt-Ie,nt,Ie))}if(!Et){const ne=e.isSameMergeInternal(ut,Le,ut,Le+1)?we.bottom:Ft(we.bottom,Ye(ut,Le+1,"top")),Te=e.isSameMergeInternal(ut-1,Le,ut,Le)?we.left:Ft(Ye(ut-1,Le,"right"),we.left),Ie=(ne==null?void 0:ne.width)??0,nt=(Te==null?void 0:Te.width)??0;Ie>0&&nt>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(Oe-nt,wt+Nt,nt,Ie))}if(!kt&&!Et){const ne=e.isSameMergeInternal(lt,Le,lt,Le+1)?we.bottom:Ft(we.bottom,Ye(lt,Le+1,"top")),Te=e.isSameMergeInternal(lt,Le,lt+1,Le)?we.right:Ft(we.right,Ye(lt+1,Le,"left")),Ie=(ne==null?void 0:ne.width)??0,nt=(Te==null?void 0:Te.width)??0;Ie>0&&nt>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(Oe+zt,wt+Nt,nt,Ie))}};k=(T,Be,Oe,wt,zt)=>{var lt;const Nt=Be+wt,qe=Oe+zt,Re=Be<nl,ut=Oe<Sl;for(const _e in e.merges){const Le=e.merges[_e];if(!Le)continue;const rt=Le.startCol,it=Le.startRow,kt=Le.endCol,Et=Le.endRow,Ht=e.cellToScreenRect(it,rt),we=e.cellToScreenRect(Et,kt),ne=Ht.x,Te=Ht.y,Ie=we.x+we.width-ne,nt=we.y+we.height-Te,xt=Re&&kt>=e.freeze.cols?Math.min(Nt,nl):Math.min(ne+Ie,Nt),Yt=ut&&Et>=e.freeze.rows?Math.min(qe,Sl):Math.min(Te+nt,qe),Ut=Math.max(ne,Be),_l=Math.max(Te,Oe);if(xt<=Ut||Yt<=_l)continue;const Jl=(lt=e.resolveStyle(e.cells[e.cellKey(rt,it)]))==null?void 0:lt.backgroundColor;if(Jl&&(T.fillStyle=Jl,T.fillRect(Ut,_l,xt-Ut,Yt-_l)),T.strokeStyle=Ee.gridLine,T.lineWidth=.5,T.strokeRect(ne+.25,Te+.25,xt-ne-.5,Yt-Te-.5),Rl(T,Le,ne,Te,Ie,nt,Re,ut),!(e.editingCell.value&&e.editingCell.value.col===rt&&e.editingCell.value.row===it)){const $l=ot[kt+1]-ot[rt],Ql=pt[Et+1]-pt[it],Vn=rt<e.freeze.cols,en=it<e.freeze.rows,Jt=Re?ne:Vn?ne-P:ne,Ml=ut?Te:en?Te-z:Te;Vt(T,rt,it,$l,Ql,Jt,Ml)}}},r.save(),r.beginPath(),r.rect(nl,Sl,jl,un),r.clip(),m(r,Ll,qt,ql,Ol,zl),y(r,Ll,qt,ql,Ol,zl),k(r,nl,Sl,jl,un),r.restore(),jt>0&&(r.strokeStyle=Ee.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(nl+.5,Q),r.lineTo(nl+.5,x),r.stroke()),Dt>0&&(r.strokeStyle=Ee.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(V,Sl+.5),r.lineTo(_,Sl+.5),r.stroke()),r.fillStyle=Ee.headerBg,r.fillRect(V,0,_-V,Q);for(let T=Zl;T<=mn;T++){const Be=V+ot[T]-P,Oe=yt[T];Be+Oe<V||Be>_||(vt&&T>=vt.startCol&&T<=vt.endCol&&(r.fillStyle=Ee.selectionBg,r.fillRect(Be,0,Oe,Q)),r.strokeStyle=Ee.headerBorder,r.lineWidth=.5,r.strokeRect(Be+.25,.25,Oe-.5,Q-.5),vt&&T>=vt.startCol&&T<=vt.endCol&&(r.strokeStyle=Ee.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(Be,Q-1),r.lineTo(Be+Oe,Q-1),r.stroke()),r.fillStyle=Ee.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(ht(T),Be+Oe/2,Q/2))}if(jt>0){r.fillStyle=Ee.headerBg,r.fillRect(V,0,jt,Q);for(let T=0;T<=dn;T++){const Be=V+ot[T],Oe=yt[T];Be+Oe<V||Be>_||(vt&&T>=vt.startCol&&T<=vt.endCol&&(r.fillStyle=Ee.selectionBg,r.fillRect(Be,0,Oe,Q)),r.strokeStyle=Ee.headerBorder,r.lineWidth=.5,r.strokeRect(Be+.25,.25,Oe-.5,Q-.5),vt&&T>=vt.startCol&&T<=vt.endCol&&(r.strokeStyle=Ee.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(Be,Q-1),r.lineTo(Be+Oe,Q-1),r.stroke()),r.fillStyle=Ee.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(ht(T),Be+Oe/2,Q/2))}}r.strokeStyle=Ee.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(V,Q+.5),r.lineTo(_,Q+.5),r.stroke(),r.fillStyle=Ee.headerBg,r.fillRect(0,Q,V,x-Q);for(let T=bl;T<=Hl;T++){if(e.isRowHidden(T))continue;const Be=Q+pt[T]-z,Oe=zl[T];Be+Oe<Q||Be>x||(vt&&T>=vt.startRow&&T<=vt.endRow&&(r.fillStyle=Ee.selectionBg,r.fillRect(0,Be,V,Oe)),r.strokeStyle=Ee.headerBorder,r.lineWidth=.5,r.strokeRect(.25,Be+.25,V-.5,Oe-.5),vt&&T>=vt.startRow&&T<=vt.endRow&&(r.strokeStyle=Ee.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(V-1,Be),r.lineTo(V-1,Be+Oe),r.stroke()),r.fillStyle=Ee.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(String(T+1),V/2,Be+Oe/2+.5))}if(Dt>0){r.fillStyle=Ee.headerBg,r.fillRect(0,Q,V,Dt);for(let T=0;T<=fn;T++){if(e.isRowHidden(T))continue;const Be=Q+pt[T],Oe=zl[T];Be+Oe<Q||Be>x||(vt&&T>=vt.startRow&&T<=vt.endRow&&(r.fillStyle=Ee.selectionBg,r.fillRect(0,Be,V,Oe)),r.strokeStyle=Ee.headerBorder,r.lineWidth=.5,r.strokeRect(.25,Be+.25,V-.5,Oe-.5),vt&&T>=vt.startRow&&T<=vt.endRow&&(r.strokeStyle=Ee.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(V-1,Be),r.lineTo(V-1,Be+Oe),r.stroke()),r.fillStyle=Ee.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(String(T+1),V/2,Be+Oe/2+.5))}}r.strokeStyle=Ee.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(V+.5,Q),r.lineTo(V+.5,x),r.stroke(),r.fillStyle=Ee.headerBg,r.fillRect(0,0,V,Q),r.strokeStyle=Ee.headerSep,r.lineWidth=1,r.strokeRect(.5,.5,V-1,Q-1);const Cl=Math.min(V,Q)*.32;r.fillStyle=Ee.activeCellBorder,r.beginPath(),r.moveTo(V-1,Q-1-Cl),r.lineTo(V-1-Cl,Q-1),r.lineTo(V-1,Q-1),r.closePath(),r.fill(),Y(r,Ee),K(r,Ee)}function te(){const s=n.freezeCanvasRef.value,b=n.wrapperRef.value;if(!s||!b)return;const M=s.getContext("2d");if(!M)return;const _=b.getBoundingClientRect(),x=_.width,P=_.height,z=52,V=24,Q=n.themeColors.value,Ee=e.colPositions.value,Ve=e.rowPositions.value,ot=e.scrollX.value,pt=e.scrollY.value;s.width=x*f,s.height=P*f,s.style.width=x+"px",s.style.height=P+"px",M.setTransform(f,0,0,f,0,0),M.clearRect(0,0,x,P);const{frozenRowsHeight:yt,frozenColumnsWidth:Dt}=e.getFrozenMetrics();if(yt<=0&&Dt<=0)return;const jt=z+Dt,nl=V+yt,Sl=Math.max(0,x-z-11-Dt),jl=Math.max(0,P-V-11-yt),un=Math.max(0,e.freeze.cols-1),dn=Math.max(0,e.freeze.rows-1),fn=Math.max(e.freeze.cols,e.hitCol(Dt+ot));let Zl=fn;for(let Ye=fn;Ye<e.colCount&&!(z+Ee[Ye]-ot>=x);Ye++)Zl=Ye;const mn=Math.max(e.freeze.rows,e.hitRow(yt+pt));let bl=mn;for(let Ye=mn;Ye<e.rowCount&&!(V+Ve[Ye]-pt>=P);Ye++)bl=Ye;let Hl=fn,Zt=Zl,qt=mn,ol=bl;Dt>0&&(Hl=0,Zt=Math.max(Zt,un)),yt>0&&(qt=0,ol=Math.max(ol,dn));let Ol=Hl,Ll=qt;for(const Ye in e.merges){const Vt=e.merges[Ye];Vt&&(Vt.startRow>ol||Vt.endRow<qt||Vt.startCol>Zt||Vt.endCol<Hl||(Vt.startCol<Ol&&(Ol=Vt.startCol),Vt.startRow<Ll&&(Ll=Vt.startRow)))}const ql=new Array(Ll);for(let Ye=Ll;Ye<=ol;Ye++)ql[Ye]=Ve[Ye+1]-Ve[Ye];const zl=(Ye,Vt,Rl)=>{const Cl=e.findMerge(Ye,Vt);return Cl?e.getCellBorderSide(e.cells[Cl.anchor],Rl):e.getCellBorderSide(e.cells[e.cellKey(Ye,Vt)],Rl)},vt=(Ye,Vt,Rl,Cl,T)=>{Ye.fillStyle="#444";for(let Be=Cl;Be<=T;Be++)for(let Oe=Vt;Oe<=Rl;Oe++){const wt=e.findMerge(Oe,Be);if(wt&&!(Oe===wt.range.startCol&&Be===wt.range.startRow))continue;const zt=e.cellToScreenRect(Be,Oe),Nt=zt.x,qe=zt.y,Re=zt.width,ut=zt.height;if(Nt+Re<z||qe+ut<V||Nt>x||qe>P)continue;const lt=e.cells[e.cellKey(Oe,Be)],_e={top:e.getCellBorderSide(lt,"top"),right:e.getCellBorderSide(lt,"right"),bottom:e.getCellBorderSide(lt,"bottom"),left:e.getCellBorderSide(lt,"left")};if(wt)continue;const Le={top:zl(Oe,Be-1,"bottom"),left:zl(Oe-1,Be,"right"),bottom:zl(Oe,Be+1,"top"),right:zl(Oe+1,Be,"left")},rt=Ft(Le.top,_e.top),it=Ft(Le.left,_e.left),kt=Ft(_e.bottom,Le.bottom),Et=Ft(_e.right,Le.right),Ht=(rt==null?void 0:rt.width)??0,we=(it==null?void 0:it.width)??0,ne=(kt==null?void 0:kt.width)??0,Te=(Et==null?void 0:Et.width)??0;Ht>0&&(Ye.fillStyle=(rt==null?void 0:rt.color)||"#444",Ye.fillRect(Nt,qe,Re,Ht)),ne>0&&(Ye.fillStyle=(kt==null?void 0:kt.color)||"#444",Ye.fillRect(Nt,qe+ut-ne,Re,ne)),we>0&&(Ye.fillStyle=(it==null?void 0:it.color)||"#444",Ye.fillRect(Nt,qe,we,ut)),Te>0&&(Ye.fillStyle=(Et==null?void 0:Et.color)||"#444",Ye.fillRect(Nt+Re-Te,qe,Te,ut))}},Rn=(Ye,Vt,Rl,Cl,T,Be,Oe,wt)=>{Rl<=0||Cl<=0||(M.save(),M.beginPath(),M.rect(Ye,Vt,Rl,Cl),M.clip(),M.fillStyle=Q.gridBg,M.fillRect(Ye,Vt,Rl,Cl),m(M,T,Be,Oe,wt,ql),vt(M,T,Be,Oe,wt),k(M,Ye,Vt,Rl,Cl),M.restore())};Dt>0&&yt>0&&Rn(z,V,Dt,yt,0,un,0,dn),yt>0&&Rn(jt,V,Sl,yt,Ol,Zt,0,dn),Dt>0&&Rn(z,nl,Dt,jl,0,un,Ll,ol),M.strokeStyle=Q.headerSep,M.lineWidth=1,Dt>0&&(M.beginPath(),M.moveTo(jt+.5,V),M.lineTo(jt+.5,P),M.stroke()),yt>0&&(M.beginPath(),M.moveTo(z,nl+.5),M.lineTo(x,nl+.5),M.stroke()),M.fillStyle=Q.headerBg,M.fillRect(0,0,z,V),M.strokeStyle=Q.headerSep,M.lineWidth=1,M.strokeRect(.5,.5,z-.5,V-.5),Y(M,Q),K(M,Q)}function Y(s,b){const M=e.selection.value;if(!M||e.editingCell.value)return;const _=e.cellToScreenRect(M.endRow,M.endCol),x=wo(M,M,e.merges),P=_.x+_.width-6/2,z=_.y+_.height-6/2;s.fillStyle=x?b.activeCellBorder:b.scrollTrack,s.fillRect(P,z,6,6),s.strokeStyle="#fff",s.lineWidth=1,s.strokeRect(P+.5,z+.5,6-1,6-1)}function K(s,b){const M=e.autoFillState.value;if(!M.active||!M.preview||!M.targetRange)return;const _=M.targetRange,x=e.cellToScreenRect(_.startRow,_.startCol),P=e.cellToScreenRect(_.endRow,_.endCol),z=x.x,V=x.y,Q=P.x+P.width-z,Ee=P.y+P.height-V;s.fillStyle=b.selectionBg,s.fillRect(z,V,Q,Ee),s.strokeStyle=b.activeCellBorder,s.lineWidth=1.5,s.setLineDash([4,3]),s.strokeRect(z+.5,V+.5,Q-1,Ee-1),s.setLineDash([])}const C=t.computed(()=>ht(e.activeCell.value.col)+String(e.activeCell.value.row+1)),j=t.ref(""),q=t.ref(!1),se=t.computed(()=>e.editingCell.value?j.value:e.getCellRaw(e.activeCell.value.col,e.activeCell.value.row));t.watch(()=>e.editingCell.value,(s,b)=>{if(s&&!b){const M=e.editValue.value||e.getCellRaw(s.col,s.row)||"";j.value=M,ve=!1}else!s&&b&&(j.value="",q.value=!1,ve=!1)},{immediate:!0}),t.watch(()=>[e.activeCell.value.col,e.activeCell.value.row],()=>{e.editingCell.value||(j.value="",ve=!1)});function Ne(){e.editingCell.value||(e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(),d())}function Qe(s){const b=s.target.value;e.editingCell.value?e.editValue.value=b:e.startEdit(b),j.value=b,ve=!0}function Ge(s){var M,_;const b={...e.activeCell.value};e.editingCell.value?(e.editValue.value=s,e.commitEdit()):((M=e.saveUndo)==null||M.call(e),e.setCellValue(b.col,b.row,s)),j.value="",ve=!1,d(),(_=n.emitModelData)==null||_.call(n)}let be=!1,ve=!1;function Xe(){var P,z,V,Q,Ee,Ve,ot,pt,yt;if(be)return;const s=n.formulaBarRef.value,b=!!(s&&typeof document<"u"&&document.activeElement===s);if(!e.editingCell.value&&!b&&!ve)return;const M={...e.activeCell.value},_=e.editingCell.value?e.editingCell.value.col:M.col,x=e.editingCell.value?e.editingCell.value.row:M.row;if(!e.editingCell.value){const Dt=e.getCellRaw(_,x),jt=j.value!==Dt;if(!ve)return;be=!0,jt&&((P=e.saveUndo)==null||P.call(e),e.setCellValue(_,x,j.value),d(),(z=n.emitModelData)==null||z.call(n)),(V=n.formulaBarRef.value)==null||V.blur(),j.value="",q.value=!1,ve=!1,t.nextTick(()=>{be=!1});return}be=!0,ve?(e.editValue.value=j.value,e.commitEdit(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),(Q=n.formulaBarRef.value)==null||Q.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),(Ee=n.emitModelData)==null||Ee.call(n),t.nextTick(()=>{be=!1})):b?(j.value=e.editValue.value,e.commitEdit(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),(Ve=n.formulaBarRef.value)==null||Ve.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),(ot=n.emitModelData)==null||ot.call(n),t.nextTick(()=>{be=!1})):(e.commitEdit(),(pt=n.formulaBarRef.value)==null||pt.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),(yt=n.emitModelData)==null||yt.call(n),t.nextTick(()=>{be=!1}))}function Je(){var s;be||(be=!0,e.editingCell.value&&e.cancelEdit(),(s=n.formulaBarRef.value)==null||s.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),t.nextTick(()=>{be=!1}))}function gt(s){if(!s.isComposing){if(s.key==="Enter"&&(s.altKey||s.metaKey)&&!s.ctrlKey){s.preventDefault(),s.stopPropagation();const b=s.target;if(!b)return;e.editingCell.value||e.startEdit();const M=b.selectionStart??b.value.length,_=b.selectionEnd??b.value.length,x=b.value,P=x.substring(0,M)+`
|
|
7
|
-
`+x.substring(_),z=M+1;j.value=P,q.value||(q.value=!0),t.nextTick(()=>{try{b.setSelectionRange(z,z)}catch{}if(q.value)try{b.scrollTop=b.scrollHeight}catch{}try{b.focus({preventScroll:!0})}catch{}});return}s.key==="Enter"?(s.preventDefault(),Xe()):s.key==="Escape"&&(s.preventDefault(),Je())}}function Ze(){Xe()}const tt=t.ref(null),et=t.ref("");function oe(s){tt.value===null&&(n.switchSheet(s),d())}function me(s){s!==n.activeSheetIndex.value&&(n.saveSheet(),n.loadSheet(s),d()),tt.value=s,et.value=n.sheets.value[s].name,t.nextTick(()=>{const b=document.querySelector(".tab-rename-input");b==null||b.focus(),b==null||b.select()})}function g(){tt.value!==null&&(n.renameSheet(tt.value,et.value),t.nextTick(()=>n.emitModelData())),tt.value=null,et.value=""}function I(){tt.value=null,et.value=""}function L(s){s.key==="Enter"?(s.preventDefault(),g()):s.key==="Escape"&&(s.preventDefault(),I())}const $=t.ref(null);t.watch($,s=>{s===null&&Pe()});const J=t.ref(null),ie=18,re=2,pe=2,ce=new Path2D("M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z");function A(s,b,M,_,x,P){const z=Math.min(P,_/2,x/2);s.beginPath(),s.moveTo(b+z,M),s.arcTo(b+_,M,b+_,M+x,z),s.arcTo(b+_,M+x,b,M+x,z),s.arcTo(b,M+x,b,M,z),s.arcTo(b,M,b+_,M,z),s.closePath()}function c(s,b,M,_,x,P,z){const V=Math.min(_,ie)-re,Q=b+_-V-re,Ee=M+re,Ve=x-2*re;s.save(),s.fillStyle=P?z.activeCellBorder:"#ececec",A(s,Q,Ee,V,Ve,pe),s.fill();const ot=Math.min(V,Ve)*.72;s.translate(Q+V/2,Ee+Ve/2),s.scale(ot/1024,ot/1024),s.translate(-512,-512),s.fillStyle=P?"#ffffff":"#5a5a5a",s.fill(ce),s.restore()}function u(s,b){const M=e.getFilter();if(!M)return-1;const _=e.screenToCell(s,b);if(!_)return-1;const{col:x,row:P}=_;if(P!==M.range.startRow||x<M.range.startCol||x>M.range.endCol)return-1;const z=e.cellToScreenRect(P,x),V=Math.min(z.width,ie)-re,Q=z.x+z.width-V-re,Ee=z.x+z.width-re;return s>=Q&&s<=Ee&&b>=z.y+re&&b<=z.y+z.height-re?x:-1}function p(s){const b=e.getFilter();if(!b)return;const M=n.canvasRef.value;if(!M)return;const _=M.getBoundingClientRect(),x=e.cellToScreenRect(b.range.startRow,s);J.value={col:s,x:_.left+x.x+x.width-ie,y:_.top+x.y+2}}function H(){J.value=null}let ct=null,ae=null;function Pe(){ct&&(document.removeEventListener("click",ct),ct=null),ae&&(document.removeEventListener("touchstart",ae,{capture:!0}),ae=null)}function at(s,b,M){Pe();const _=140,x=M.length*28+8,P=window.innerWidth,z=window.innerHeight;s+_>P&&(s-=_),b+x>z&&(b-=x),St.value=s+_+150>P,$.value={x:s,y:b,items:M},ct=()=>{$.value=null,Pe()},ae=V=>{const Q=V.target;Q&&Q.closest(".context-menu")||($.value=null,Pe())},setTimeout(()=>{document.addEventListener("click",ct,{once:!0}),document.addEventListener("touchstart",ae,{capture:!0})},0)}const St=t.ref(!1);function Rt(s,b){if(b.disabled){St.value=!1;return}if(!b.children){St.value=!1;return}const M=s.currentTarget,_=M.querySelector(".context-submenu");if(!_){St.value=!1;return}const x=M.getBoundingClientRect(),P=_.getBoundingClientRect().width;St.value=x.right+P>window.innerWidth}function Mt(s,b){s.preventDefault(),s.stopPropagation(),at(s.clientX,s.clientY,[{label:N(e.locale.value,"insert"),action:()=>{n.addSheet(),d()}},{label:N(e.locale.value,"copy"),action:()=>{n.dupSheet(b)}},{label:N(e.locale.value,"rename"),action:()=>{me(b)}},{label:N(e.locale.value,"delete"),action:()=>{n.removeSheet(b),d()},disabled:n.sheetCount.value<=1},{label:N(e.locale.value,"moveSheetLeft"),action:()=>{n.moveSheet(b,-1)},disabled:b===0},{label:N(e.locale.value,"moveSheetRight"),action:()=>{n.moveSheet(b,1)},disabled:b===n.sheets.value.length-1}])}function It(s){s.preventDefault(),!(s.target.closest(".tab-item")||s.target.closest(".tab-bar__add-btn"))&&at(s.clientX,s.clientY,[{label:N(e.locale.value,"insert"),action:()=>{n.addSheet(),d()}}])}function _t(s){s.preventDefault(),e.selectAll(),d(),at(s.clientX,s.clientY,[{label:N(e.locale.value,"cut"),action:()=>{o.cutSelected(),n.emitModelData()}},{label:N(e.locale.value,"copy"),action:()=>o.copyToClipboard()},{label:N(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:N(e.locale.value,"delete"),action:()=>{l.saveUndo(),o.clearSelected();for(let b=0;b<e.colCount;b++)e.colWidths.value[b]=100;for(let b=0;b<e.rowCount;b++)e.rowHeights.value[b]=void 0;d(),n.emitModelData()}}])}function tl(s,b){s.preventDefault();const M=s.clientX,_=s.clientY,x=e.selection.value;x&&x.startCol===0&&x.endCol===e.colCount-1&&b>=x.startRow&&b<=x.endRow||(e.selectRange(0,b,e.colCount-1,b,"row"),d());const P=e.selection.value;at(s.clientX,s.clientY,[{label:N(e.locale.value,"insert"),action:()=>{l.saveUndo(),n.insertRows(P.startRow,P.endRow),d(),n.emitModelData()}},{label:N(e.locale.value,"cut"),action:()=>{l.saveUndo(),o.copyRowCol(),e.clearCellsInRange(0,e.colCount-1,P.startRow,P.endRow),d(),n.emitModelData()}},{label:N(e.locale.value,"copy"),action:()=>o.copyRowCol()},{label:N(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:N(e.locale.value,"delete"),action:()=>{l.saveUndo(),n.deleteRows(P.startRow,P.endRow),d(),n.emitModelData()}},{label:`${N(e.locale.value,"rowHeight")}...`,action:()=>Nl("row",M,_)},{label:N(e.locale.value,"autoRowHeight"),action:()=>n.resetRowHeight()},{label:N(e.locale.value,"freezeToRow"),action:()=>{e.setFreeze(b+1,e.freeze.cols),d()}}])}function vl(s,b){s.preventDefault();const M=s.clientX,_=s.clientY,x=e.selection.value;x&&x.startRow===0&&x.endRow===e.rowCount-1&&b>=x.startCol&&b<=x.endCol||(e.selectRange(b,0,b,e.rowCount-1,"col"),d());const P=e.selection.value,z=!n.canSortColumns(P.startCol,P.endCol);at(s.clientX,s.clientY,[{label:N(e.locale.value,"insert"),action:()=>{l.saveUndo(),n.insertCols(P.startCol,P.endCol),d(),n.emitModelData()}},{label:N(e.locale.value,"cut"),action:()=>{l.saveUndo(),o.copyRowCol(),e.clearCellsInRange(P.startCol,P.endCol,0,e.rowCount-1),d(),n.emitModelData()}},{label:N(e.locale.value,"copy"),action:()=>o.copyRowCol()},{label:N(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:N(e.locale.value,"delete"),action:()=>{l.saveUndo(),n.deleteCols(P.startCol,P.endCol),d(),n.emitModelData()}},{label:N(e.locale.value,"sort"),disabled:z,children:[{label:N(e.locale.value,"sortAsc"),action:()=>{n.prepareSortConfirmation("asc")||n.sortSelectedColumns("asc")},disabled:z},{label:N(e.locale.value,"sortDesc"),action:()=>{n.prepareSortConfirmation("desc")||n.sortSelectedColumns("desc")},disabled:z}]},{label:`${N(e.locale.value,"colWidth")}...`,action:()=>Nl("col",M,_)},{label:N(e.locale.value,"defaultColWidth"),action:()=>n.resetColWidth()},{label:N(e.locale.value,"freezeToCol"),action:()=>{e.setFreeze(e.freeze.rows,b+1),d()}}])}function Dl(s,b,M){s.preventDefault(),e.isSelected(b,M)||(e.selectCell(b,M),d());const _=e.selection.value,x=!!(_&&_.startCol===_.endCol&&_.startRow===_.endRow);at(s.clientX,s.clientY,[{label:N(e.locale.value,"cut"),action:()=>{o.cutSelected(),n.emitModelData()}},{label:N(e.locale.value,"copy"),action:()=>o.copyToClipboard()},{label:N(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:N(e.locale.value,"delete"),action:()=>{l.saveUndo(),o.clearSelected(),d(),n.emitModelData()}},{label:N(e.locale.value,"calculate"),children:[{label:N(e.locale.value,"sum"),action:o.sumSelected,disabled:x},{label:N(e.locale.value,"avg"),action:o.avgSelected,disabled:x},{label:N(e.locale.value,"count"),action:o.countSelected,disabled:x}]}])}const ul=t.ref(null),$t=t.ref(null);let kl=null,dl=null;function fl(){kl&&(document.removeEventListener("mousedown",kl),kl=null),dl&&(document.removeEventListener("touchstart",dl),dl=null)}function Nl(s,b,M){fl();const _=e.selection.value;let x="";if(_){const Ee=s==="row"?e.getRowHeight(_.startRow):e.colWidths.value[_.startCol];x=Ee!=null&&Ee>0?String(Math.round(Ee)):""}const P=220,z=118;let V=b,Q=M;V+P>window.innerWidth&&(V=window.innerWidth-P-8),Q+z>window.innerHeight&&(Q=window.innerHeight-z-8),V<8&&(V=8),Q<8&&(Q=8),$t.value={type:s,x:V,y:Q,value:x,error:""},kl=()=>{$t.value=null},dl=()=>{$t.value=null},setTimeout(()=>{document.addEventListener("mousedown",kl,{once:!0}),document.addEventListener("touchstart",dl,{once:!0})},0),t.nextTick(()=>{const Ee=ul.value;Ee&&(Ee.focus(),Ee.select())})}function bn(s){const b=$t.value;if(!b)return;const M=s.target,_=M.value,x=_.replace(/[^\d]/g,"");b.value=x,_!==x&&(M.value=x),b.error=""}function Yl(s){s.key==="Enter"?(s.preventDefault(),F()):s.key==="Escape"&&(s.preventDefault(),D())}function an(){const s=$t.value;if(!s)return;const b=s.value.trim(),M=Number(b),_=s.type==="row",x=_?24:30,P=_?500:1e3;if(b===""||!Number.isFinite(M)){D();return}const z=Math.max(x,Math.min(P,Math.round(M)));s.value=String(z),s.error=""}function F(){const s=$t.value,b=e.selection.value;if(!s||!b)return;const M=s.value.trim(),_=Number(M),x=s.type==="row",P=x?24:30,z=x?500:1e3;if(M===""||!Number.isFinite(_)){s.error=N(e.locale.value,"dimNumberError");return}if(_<P||_>z){s.error=N(e.locale.value,"dimRangeError").replace("{min}",String(P)).replace("{max}",String(z));return}const V=_;if(l.saveUndo(),x)for(let Q=b.startRow;Q<=b.endRow;Q++)e.rowHeights.value[Q]=V;else for(let Q=b.startCol;Q<=b.endCol;Q++)e.colWidths.value[Q]=V;d(),n.emitModelData(),D()}function D(){fl(),$t.value=null}const O=t.computed(()=>{const s=!e.editingCell.value,b=e.editingCell.value??e.activeCell.value,M=b.col,_=b.row,x=e.resolveStyle(e.cells[e.cellKey(M,_)]),P=e.cellFontSize(M,_),z=typeof(x==null?void 0:x.fontFamily)=="string"&&x.fontFamily?x.fontFamily:hn,V=(x==null?void 0:x.fontWeight)==="bold"?"bold":"normal",Q=(x==null?void 0:x.fontStyle)==="italic"?"italic":"normal",Ee=(x==null?void 0:x.underline)==="underline"?"underline":(x==null?void 0:x.strikethrough)==="line-through"?"line-through":"none",Ve=(x==null?void 0:x.underline)==="underline"&&(x==null?void 0:x.strikethrough)==="line-through"?"underline line-through":Ee,ot=typeof(x==null?void 0:x.color)=="string"?x.color:void 0,pt=typeof(x==null?void 0:x.backgroundColor)=="string"?x.backgroundColor:void 0,yt=typeof(x==null?void 0:x.numberFormat)=="string"?x.numberFormat:"",Dt=e.editValue.value??e.getCellValue(M,_),jt=typeof(x==null?void 0:x.textAlign)=="string"?x.textAlign:io(Dt,yt)?"right":"left",nl=typeof(x==null?void 0:x.verticalAlign)=="string"?x.verticalAlign:"top",Sl=e.findMerge(M,_),jl=Sl?e.rowPositions.value[Sl.range.endRow+1]-e.rowPositions.value[_]:e.getRowHeight(_),un=2,{ascent:dn,descent:fn}=e.measureFontMetrics(z,P,V,Q),Zl=dn+fn,bl=(e.editValue.value?e.editValue.value.split(`
|
|
8
|
-
`).length:1)*Zl,Hl=e.BASE_CELL_VPAD-un;let Zt=0,qt=0;nl==="middle"?(Zt=Math.floor((jl-bl)/2),qt=Math.max(0,jl-bl-Zt)):nl==="top"?(Zt=Hl,qt=Math.max(0,jl-bl-Zt)):nl==="bottom"&&(qt=Hl,Zt=Math.max(0,jl-bl-qt));const ol=e.cellToScreenRect(_,M);return{left:`${ol.x}px`,top:`${ol.y}px`,width:`${ol.width}px`,height:`${ol.height}px`,fontFamily:z,fontSize:`${P}px`,lineHeight:1,fontWeight:V,fontStyle:Q,textDecoration:Ve,textAlign:jt,paddingTop:`${Zt}px`,paddingRight:"3px",paddingBottom:`${qt}px`,paddingLeft:"3px",opacity:s?0:1,pointerEvents:s?"none":"auto",color:s?"transparent":ot,caretColor:s?"transparent":void 0,borderColor:s?"transparent":void 0,background:s?"transparent":pt,boxShadow:s?"none":void 0}});function ue(){return Math.max(0,n.viewSize.w-52-11)}function ge(){return Math.max(0,n.viewSize.h-24-11)}const Me=t.computed(()=>Math.max(0,ue()-e.getFrozenMetrics().frozenColumnsWidth)),Se=t.computed(()=>Math.max(0,ge()-e.getFrozenMetrics().frozenRowsHeight)),he=t.computed(()=>52+e.getFrozenMetrics().frozenColumnsWidth),Z=t.computed(()=>24+e.getFrozenMetrics().frozenRowsHeight),He=t.computed(()=>Math.max(0,Me.value-11*2)),$e=t.computed(()=>Math.max(0,Se.value-11*2)),le=t.computed(()=>n.maxScrollX.value<=0?He.value:Math.max(24,Me.value/e.totalWidth.value*He.value)),Ke=t.computed(()=>n.maxScrollX.value<=0?0:e.scrollX.value/n.maxScrollX.value*(He.value-le.value)),st=t.computed(()=>n.maxScrollY.value<=0?$e.value:Math.max(24,Se.value/e.totalHeight.value*$e.value)),E=t.computed(()=>n.maxScrollY.value<=0?0:e.scrollY.value/n.maxScrollY.value*($e.value-st.value));let U=null,ee=0,de=0;function ye(s){s.preventDefault(),U="v",ee=s.clientY,de=e.scrollY.value,document.addEventListener("mousemove",ke),document.addEventListener("mouseup",We)}function fe(s){s.preventDefault(),U="h",ee=s.clientX,de=e.scrollX.value,document.addEventListener("mousemove",ke),document.addEventListener("mouseup",We)}function ke(s){if(U==="v"){const M=(s.clientY-ee)/($e.value-st.value);n.clampScroll(null,de+M*n.maxScrollY.value),d()}else if(U==="h"){const M=(s.clientX-ee)/(He.value-le.value);n.clampScroll(de+M*n.maxScrollX.value,null),d()}}function We(){U=null,document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",We)}function mt(s){if(U)return;const b=s.currentTarget.getBoundingClientRect(),M=s.clientY-b.top;M<E.value?n.clampScroll(null,e.scrollY.value-ge()):M>E.value+st.value&&n.clampScroll(null,e.scrollY.value+ge()),d()}function Bt(s){if(U)return;const b=s.currentTarget.getBoundingClientRect(),M=s.clientX-b.left;M<Ke.value?n.clampScroll(e.scrollX.value-ue(),null):M>Ke.value+le.value&&n.clampScroll(e.scrollX.value+ue(),null),d()}let Tt=!1,At=0,Ot=0,Wt=!1,Pt=!1,ml=0,Xl=0,Fl=0,El=0,Cn=0,wn=0,Fn=0,In=0,Xt=!1,Il=!1,bt=0,Ct=0,Gt="cell",$n=0,vn=-1,Qn=-1,ll=null,Al=!1,pl=0,hl=0,rl=!1,gl=null,cn=null,eo=0,De=0;function h(s,b){const M=e.selection.value;if(!M||e.editingCell.value||!wo(M,M,e.merges))return!1;const _=e.cellToScreenRect(M.endRow,M.endCol),x=_.x+_.width-6,P=_.y+_.height-6,z=4;return s>=x-z&&s<=x+6+z&&b>=P-z&&b<=P+6+z}function S(){gl=requestAnimationFrame(B)}function B(){if(!e.autoFillState.value.active||!cn){gl=null;return}const s=8;n.clampScroll(e.scrollX.value+cn.x*s*.1,e.scrollY.value+cn.y*s*.1);const b=e.screenToCell(eo,De),M=e.autoFillState.value.sourceRange;if(b&&M){const _=tr(M,{col:b.col,row:b.row});_?e.autoFillState.value={...e.autoFillState.value,targetRange:_.targetRange,direction:_.direction}:e.autoFillState.value={...e.autoFillState.value,targetRange:null,direction:null}}d(),gl=requestAnimationFrame(B)}function W(){gl!==null&&(cancelAnimationFrame(gl),gl=null),cn=null}function X(s,b){eo=s,De=b;const M=e.screenToCell(s,b),_=e.autoFillState.value.sourceRange;if(M&&_){const Ee=tr(_,{col:M.col,row:M.row});Ee?e.autoFillState.value={...e.autoFillState.value,targetRange:Ee.targetRange,direction:Ee.direction}:e.autoFillState.value={...e.autoFillState.value,targetRange:null,direction:null}}const x=30,P=n.viewSize.w,z=n.viewSize.h;let V=0,Q=0;s<52+x?V=-(52+x-s):s>P-11-x&&(V=s-(P-11-x)),b<24+x?Q=-(24+x-b):b>z-11-x&&(Q=b-(z-11-x)),V!==0||Q!==0?(cn={x:V,y:Q},gl===null&&S()):(cn=null,gl!==null&&(cancelAnimationFrame(gl),gl=null)),d()}function Ce(){W();const s=e.autoFillState.value;s.targetRange&&s.direction&&s.sourceRange&&e.applyAutoFill(s.sourceRange,s.targetRange,s.direction),e.autoFillState.value={active:!1,sourceRange:null,targetRange:null,direction:null,preview:!1}}function xe(s){if(s.button!==0)return;s.preventDefault(),$.value=null;const b=on(s,n.canvasRef.value),M=u(b.x,b.y);if(M>=0){p(M);return}if(b.y<24&&b.x>=52){const z=b.x-52+e.scrollX.value,V=w(b.x),Q=V>=0?e.cellToScreenRect(0,V).x+e.colWidths.value[V]:-1;if(V>=0&&Math.abs(b.x-Q)<=4){l.saveUndo(),Wt=!0,ml=V,Fl=e.colWidths.value[V],El=z,d();return}}if(b.x<52&&b.y>=24){const z=b.y-24+e.scrollY.value,V=v(b.y),Q=V>=0?e.cellToScreenRect(V,0).y+e.getRowHeight(V):-1;if(V>=0&&Math.abs(b.y-Q)<=4){l.saveUndo(),Pt=!0,Xl=V,Fl=e.getRowHeight(V),El=z,d();return}}if(h(b.x,b.y)){const z=e.selection.value;z&&(e.autoFillState.value={active:!0,sourceRange:{...z},targetRange:null,direction:null,preview:!0},d());return}if(b.x<52||b.y<24){{const z=n.formulaBarRef.value,V=!!(z&&typeof document<"u"&&document.activeElement===z);(e.editingCell.value||V||ve)&&Xe()}if(b.y<24&&b.x>=52){const z=w(b.x);z>=0&&(e.selectRange(z,0,z,e.rowCount-1,"col"),Tt=!0,At=z,Ot=0)}else if(b.x<52&&b.y>=24){const z=v(b.y);z>=0&&(e.selectRange(0,z,e.colCount-1,z,"row"),Tt=!0,At=0,Ot=z)}else b.x<52&&b.y<24&&e.selectAll();d();return}const _=e.screenToCell(b.x,b.y);if(!_)return;const x=_.col,P=_.row;{const z=n.formulaBarRef.value,V=!!(z&&typeof document<"u"&&document.activeElement===z);(e.editingCell.value||V||ve)&&Xe()}if(s.shiftKey&&e.selection.value){const z=e.selection.value;e.selectRange(z.startCol,z.startRow,x,P)}else e.selectCell(x,P);Tt=!0,At=x,Ot=P,n.focusEditInput(),d()}function Fe(s){if(Wt){const z=on(s,n.canvasRef.value).x-52+e.scrollX.value-El,V=Fl+z;V>=30&&V<=1e3?e.colWidths.value[ml]=V:V<30?e.colWidths.value[ml]=30:e.colWidths.value[ml]=1e3,d();return}if(Pt){const z=on(s,n.canvasRef.value).y-24+e.scrollY.value-El,V=Fl+z;V>=24&&V<=500?e.rowHeights.value[Xl]=V:V<24?e.rowHeights.value[Xl]=24:e.rowHeights.value[Xl]=500,d();return}if(e.autoFillState.value.active){const P=on(s,n.canvasRef.value);X(P.x,P.y);return}if(!Tt){const P=n.canvasRef.value;if(!P)return;if(l.paintFmt.value){P.style.cursor="copy";return}const z=on(s,P);if(u(z.x,z.y)>=0){P.style.cursor="pointer";return}if(z.y<24&&z.x>=52){const V=w(z.x),Q=V>=0?e.cellToScreenRect(0,V).x+e.colWidths.value[V]:-1;if(V>=0&&Math.abs(z.x-Q)<=4){P.style.cursor="col-resize";return}}if(z.x<52&&z.y>=24){const V=v(z.y),Q=V>=0?e.cellToScreenRect(V,0).y+e.getRowHeight(V):-1;if(V>=0&&Math.abs(z.y-Q)<=4){P.style.cursor="row-resize";return}}if(h(z.x,z.y)){P.style.cursor="crosshair";return}P.style.cursor="cell";return}const b=on(s,n.canvasRef.value);if(At<0||Ot<0)return;if(b.x<52||b.y<24){if(b.y<24&&b.x>=52){const P=w(b.x);P>=0&&e.selectRange(Math.min(At,P),0,Math.max(At,P),e.rowCount-1,"col")}else if(b.x<52&&b.y>=24){const P=v(b.y);P>=0&&e.selectRange(0,Math.min(Ot,P),e.colCount-1,Math.max(Ot,P),"row")}d();return}const M=e.screenToCell(b.x,b.y);if(!M)return;const _=M.col,x=M.row;Ot===0&&At>=0&&e.selection.value&&e.selection.value.startRow===0&&e.selection.value.endRow===e.rowCount-1?e.selectRange(Math.min(At,_),0,Math.max(At,_),e.rowCount-1,"col"):At===0&&Ot>=0&&e.selection.value&&e.selection.value.startCol===0&&e.selection.value.endCol===e.colCount-1?e.selectRange(0,Math.min(Ot,x),e.colCount-1,Math.max(Ot,x),"row"):e.selectRange(At,Ot,_,x),d()}function Ae(s){const b=Wt||Pt;if(Tt=!1,Wt=!1,Pt=!1,b&&n.scheduleOptEmit(),e.autoFillState.value.active){Ce();return}l.paintFmt.value&&l.applyPaintFormat()}function ze(){W();const s=Wt||Pt;Tt=!1,Wt=!1,Pt=!1,s&&n.scheduleOptEmit()}function Ue(s){s.preventDefault();const b=on(s,n.canvasRef.value);if(b.x<52&&b.y<24){_t(s);return}if(b.y<24&&b.x>=52){const M=w(b.x);M>=0&&vl(s,M);return}if(b.x<52&&b.y>=24){const M=v(b.y);M>=0&&tl(s,M);return}if(b.x>=52&&b.y>=24){const M=e.screenToCell(b.x,b.y);M&&Dl(s,M.col,M.row)}}function dt(s){const b=on(s,n.canvasRef.value);if(b.x<52||b.y<24)return;const M=e.screenToCell(b.x,b.y);if(!M)return;const _=M.col,x=M.row;{const P=n.formulaBarRef.value,z=!!(P&&typeof document<"u"&&document.activeElement===P);(e.editingCell.value||z||ve)&&Xe()}e.selectCell(_,x),e.ensureVisible(_,x),e.startEdit(),d(),n.focusEditInput()}function je(s){const b=e.scrollX.value+s.deltaX,M=e.scrollY.value+s.deltaY,_=40,x=n.maxScrollX.value,P=n.maxScrollY.value;if(b>=x-_&&s.deltaX>0||M>=P-_&&s.deltaY>0){const z=Math.max(0,n.viewSize.w-28-11),V=Math.max(0,n.viewSize.h-28-11),Q=Math.max(0,Math.ceil((b+z)/100)+2),Ee=Math.max(0,Math.ceil((M+V)/24)+2);e.ensureCapacity(Q,Ee)}n.clampScroll(b,M),d()}function ft(s){if(s.touches.length!==1){Xt=!1;return}const b=s.touches[0],M=n.canvasRef.value;if(!M)return;const _=M.getBoundingClientRect(),x=b.clientX-_.left,P=b.clientY-_.top,z=b.clientX,V=b.clientY,Q=(Ve,ot)=>({clientX:Ve,clientY:ot,preventDefault(){}});{const Ve=n.formulaBarRef.value,ot=!!(Ve&&typeof document<"u"&&document.activeElement===Ve);(e.editingCell.value||ot||ve)&&Xe()}if(h(x,P)){s.preventDefault();const Ve=e.selection.value;Ve&&(e.autoFillState.value={active:!0,sourceRange:{...Ve},targetRange:null,direction:null,preview:!0},Xt=!0,Il=!1,Gt="cell",Cn=x,wn=P,Fn=e.scrollX.value,In=e.scrollY.value);return}const Ee=u(x,P);if(Ee>=0){s.preventDefault(),p(Ee);return}if(P<24&&x>=52){const Ve=w(x);if(Ve>=0){const ot=e.cellToScreenRect(0,Ve).x+e.colWidths.value[Ve];if(Math.abs(x-ot)<=8){s.preventDefault(),l.saveUndo(),Wt=!0,ml=Ve,Fl=e.colWidths.value[Ve],El=x-52+e.scrollX.value,Xt=!0,Il=!1;return}}}if(x<52&&P>=24){const Ve=v(P);if(Ve>=0){const ot=e.cellToScreenRect(Ve,0).y+e.getRowHeight(Ve);if(Math.abs(P-ot)<=8){s.preventDefault(),l.saveUndo(),Pt=!0,Xl=Ve,Fl=e.getRowHeight(Ve),El=P-24+e.scrollY.value,Xt=!0,Il=!1;return}}}x>=52&&P>=24?(s.preventDefault(),Xt=!0,Il=!1,Al=!1,rl=!1,Gt="cell",Cn=x,wn=P,Fn=e.scrollX.value,In=e.scrollY.value,bt=w(x),Ct=v(P),ll!==null&&clearTimeout(ll),ll=window.setTimeout(()=>{const Ve=e.selection.value;if(!!Ve&&bt>=Ve.startCol&&bt<=Ve.endCol&&Ct>=Ve.startRow&&Ct<=Ve.endRow){rl=!0,Dl(Q(z,V),bt,Ct);return}Al=!0,pl=bt,hl=Ct,bt>=0&&Ct>=0&&(e.selectCell(bt,Ct),d())},450)):x>=0&&P>=0&&(x<52||P<24)&&(s.preventDefault(),Xt=!0,Il=!1,Al=!1,Cn=x,wn=P,Fn=e.scrollX.value,In=e.scrollY.value,P<24&&x>=52?(Gt="col",bt=w(x),Ct=-1):x<52&&P>=24?(Gt="row",Ct=v(P),bt=-1):(Gt="all",bt=-1,Ct=-1),(Gt==="col"||Gt==="row"||Gt==="all")&&(ll!==null&&clearTimeout(ll),ll=window.setTimeout(()=>{const Ve=e.selection.value;if(Gt==="all"){rl=!0,_t(Q(z,V));return}if(Gt==="col"){if(!!Ve&&Ve.startRow===0&&Ve.endRow===e.rowCount-1&&bt>=Ve.startCol&&bt<=Ve.endCol){rl=!0,vl(Q(z,V),bt);return}Al=!0,pl=bt,hl=-1,bt>=0&&(e.selectRange(bt,0,bt,e.rowCount-1,"col"),d())}else{if(!!Ve&&Ve.startCol===0&&Ve.endCol===e.colCount-1&&Ct>=Ve.startRow&&Ct<=Ve.endRow){rl=!0,tl(Q(z,V),Ct);return}Al=!0,pl=-1,hl=Ct,Ct>=0&&(e.selectRange(0,Ct,e.colCount-1,Ct,"row"),d())}},450)))}function Lt(s){if(!Xt||s.touches.length!==1)return;const b=s.touches[0],M=n.canvasRef.value;if(!M)return;const _=M.getBoundingClientRect(),x=b.clientX-_.left,P=b.clientY-_.top;if(e.autoFillState.value.active){s.preventDefault(),X(x,P);return}if(Wt){const z=x-52+e.scrollX.value-El;let V=Fl+z;V=V<30?30:V>1e3?1e3:V,e.colWidths.value[ml]=V,s.preventDefault(),d();return}if(Pt){const z=P-24+e.scrollY.value-El;let V=Fl+z;V=V<24?24:V>500?500:V,e.rowHeights.value[Xl]=V,s.preventDefault(),d();return}if(Al){if(s.preventDefault(),pl>=0&&hl>=0){const z=w(x),V=v(P);z>=0&&V>=0&&(e.selectRange(pl,hl,z,V),d())}else if(hl===-1&&pl>=0){const z=w(x);z>=0&&(e.selectRange(Math.min(pl,z),0,Math.max(pl,z),e.rowCount-1,"col"),d())}else if(pl===-1&&hl>=0){const z=v(P);z>=0&&(e.selectRange(0,Math.min(hl,z),e.colCount-1,Math.max(hl,z),"row"),d())}return}ll!==null&&(clearTimeout(ll),ll=null),(Math.abs(x-Cn)>8||Math.abs(P-wn)>8)&&(Il=!0,s.preventDefault(),n.clampScroll(Fn+(Cn-x),In+(wn-P)),d())}function kn(){if(Xt){if(ll!==null&&(clearTimeout(ll),ll=null),rl){rl=!1,Xt=!1;return}if(e.autoFillState.value.active){Ce(),Xt=!1;return}if(Wt||Pt){Wt=!1,Pt=!1,n.scheduleOptEmit(),l.paintFmt.value&&l.applyPaintFormat(),Xt=!1;return}if(Al){Al=!1,l.paintFmt.value&&l.applyPaintFormat(),Xt=!1;return}if(Xt=!1,!Il){if(Gt==="cell"&&bt>=0&&Ct>=0){const s=Date.now();bt===vn&&Ct===Qn&&s-$n<300?(e.selectCell(bt,Ct),e.startEdit(),d(),n.focusEditInput(),$n=0):(e.commitEdit(),e.selectCell(bt,Ct),d(),$n=s),vn=bt,Qn=Ct,n.focusEditInput()}else Gt==="col"&&bt>=0?(e.commitEdit(),e.selectRange(bt,0,bt,e.rowCount-1,"col"),d()):Gt==="row"&&Ct>=0?(e.commitEdit(),e.selectRange(0,Ct,e.colCount-1,Ct,"row"),d()):Gt==="all"&&(e.commitEdit(),e.selectAll(),d());l.paintFmt.value&&!e.editingCell.value&&l.applyPaintFormat()}}}function al(s){return s.isComposing||s.key==="Process"||s.keyCode===229}function En(s){return s.key.length===1&&!s.ctrlKey&&!s.metaKey&&!s.altKey}function Sn(s){if(e.autoFillState.value.active){s.key==="Escape"&&(s.preventDefault(),W(),e.autoFillState.value={active:!1,sourceRange:null,targetRange:null,direction:null,preview:!1},d());return}if(e.editingCell.value)return;const b=s.ctrlKey||s.metaKey,M=s.shiftKey;switch(!0){case(b&&(s.key==="c"||s.key==="C")):s.preventDefault(),o.copyToClipboard();return;case(b&&(s.key==="x"||s.key==="X")):s.preventDefault(),o.cutSelected();return;case(b&&(s.key==="z"||s.key==="Z")):s.preventDefault(),l.undo();return;case(b&&(s.key==="y"||s.key==="Y")):s.preventDefault(),l.redo();return;case(b&&(s.key==="v"||s.key==="V")):s.preventDefault(),l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())});return;case(b&&(s.key==="a"||s.key==="A")):s.preventDefault(),e.selectAll(),d();return;case(b&&M&&(s.key==="l"||s.key==="L")):s.preventDefault(),e.toggleAutoFilter(),d();return;case(b&&s.key==="Home"):s.preventDefault(),e.selectCell(0,0),e.ensureVisible(0,0),d();return;case(b&&s.key==="End"):s.preventDefault(),e.selectCell(e.colCount-1,e.rowCount-1),e.ensureVisible(e.colCount-1,e.rowCount-1),d();return;case s.key==="Home":s.preventDefault(),e.selectCell(0,e.activeCell.value.row),e.ensureVisible(0,e.activeCell.value.row),d();return;case s.key==="End":s.preventDefault(),e.selectCell(e.colCount-1,e.activeCell.value.row),e.ensureVisible(e.colCount-1,e.activeCell.value.row),d();return;case s.key==="ArrowUp":s.preventDefault(),e.moveActive(0,-1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="ArrowDown":s.preventDefault(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="ArrowLeft":s.preventDefault(),e.moveActive(-1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="ArrowRight":s.preventDefault(),e.moveActive(1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="Tab":s.preventDefault(),e.moveActive(M?-1:1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="Enter":s.preventDefault(),e.moveActive(0,M?-1:1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="F2":s.preventDefault(),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(),d(),n.focusEditInput();return;case s.key==="Delete":case s.key==="Backspace":s.preventDefault(),l.saveUndo(),o.clearSelected(),d();return;case s.key==="Escape":s.preventDefault(),e.cancelEdit(),l.paintFmt.value=null,d();return;case En(s):if(al(s)){e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(""),d(),n.focusEditInput();return}s.preventDefault(),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(s.key),d(),t.nextTick(()=>{const _=n.editInputRef.value;_&&(_.focus(),_.setSelectionRange(1,1))});return}}let Vl=!1,Wn=!1;function sn(s){const b=s.target.value;if(!e.editingCell.value){e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(b),j.value=b,d();return}e.editValue.value=b,j.value=b}function An(){Vl=!0,e.editingCell.value||(e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(""),j.value="",d())}function Pn(s){Vl=!1,Wn=!0,setTimeout(()=>{Wn=!1},0);const b=s.target.value;e.editValue.value=b,j.value=b}function hr(s){if(!e.editingCell.value){if(En(s)||al(s))return;Sn(s);return}if(!(Vl||al(s))&&!(Wn&&(s.key==="Enter"||s.key==="Escape")))if(s.key==="Enter"&&(s.altKey||s.metaKey)){s.preventDefault();const b=n.editInputRef.value;if(!b)return;const M=b.selectionStart??b.value.length,_=b.selectionEnd??b.value.length,x=b.value,P=x.slice(0,M)+`
|
|
9
|
-
`+x.slice(_);e.editValue.value=P,b.value=P,b.selectionStart=b.selectionEnd=M+1,d()}else s.key==="Enter"?(s.preventDefault(),e.commitEdit(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d(),n.focusEditInput()):s.key==="Tab"?(s.preventDefault(),e.commitEdit(),e.moveActive(s.shiftKey?-1:1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d(),n.focusEditInput()):s.key==="Escape"&&(s.preventDefault(),e.cancelEdit(),d(),n.focusEditInput())}function Au(s){e.editingCell.value}function Vu(){setTimeout(()=>{e.editingCell.value&&(e.commitEdit(),d())},0)}let yl=null;function Un(){var b;const s=(b=n.wrapperRef.value)==null?void 0:b.getBoundingClientRect();if(s){const M=gn(e.props.width),_=gn(e.props.height);M!=null?n.viewSize.w=M:n.viewSize.w=s.width,_!=null?n.viewSize.h=_:n.viewSize.h=s.height}n.clampScroll(null,null),d()}function Hu(){t.onMounted(()=>{const s=gn(e.props.width),b=gn(e.props.height);(s==null||b==null)&&(yl=new ResizeObserver(()=>Un()),n.wrapperRef.value&&yl.observe(n.wrapperRef.value)),t.nextTick(()=>{Un(),n.focusEditInput()}),e.selectCell(0,0),n.modelData.value&&n.modelData.value.length>0&&(a.value=JSON.stringify(n.modelData.value),n.sheets.value=n.modelData.value.map(M=>{const _=n.mkSheet(M.name,{colCount:M.colCount,rowCount:M.rowCount}),{cells:x,styles:P}=rr(M.cells);if(Object.assign(_.cells,x),_.styles=M.styles??P,M.borders)_.borders=M.borders;else{const z=ar(_.styles);_.styles=z.styles,_.borders=z.borders}if(M.colWidths)for(const[z,V]of Object.entries(M.colWidths)){const Q=Number(z);Q>=0&&Q<(_.colCount??e.colCount)&&V>=30&&(_.colWidths[Q]=V)}if(M.rowHeights)for(const[z,V]of Object.entries(M.rowHeights)){const Q=Number(z);Q>=0&&Q<(_.rowCount??e.rowCount)&&V>=24&&(_.rowHeights[Q]=V)}if(M.merges)for(const[z,V]of Object.entries(M.merges))_.merges[z]={...V};return _.freeze=M.freeze?{rows:M.freeze.rows,cols:M.freeze.cols}:{rows:0,cols:0},_.filter=fr(M.filter,_.cells),_}),n.sheets.value.length>0&&n.loadSheet(0))}),t.watch(()=>[e.props.width,e.props.height],()=>{const s=gn(e.props.width),b=gn(e.props.height);s!=null&&b!=null?(yl==null||yl.disconnect(),yl=null):!yl&&n.wrapperRef.value&&(yl=new ResizeObserver(()=>Un()),yl.observe(n.wrapperRef.value)),t.nextTick(()=>Un())}),t.watch(()=>e.props.theme,()=>d()),t.watch(()=>({...e.cells}),()=>t.nextTick(()=>n.emitModelData()),{deep:!1}),t.watch(()=>({...e.merges}),()=>{t.nextTick(()=>n.emitModelData()),d()},{deep:!1}),t.watch(n.activeSheetIndex,()=>t.nextTick(()=>n.emitModelData())),t.watch(()=>n.modelData.value,s=>{if(!s||s.length===0)return;const b=JSON.stringify(s);if(b===a.value)return;a.value=b;const M=e.selection.value?{...e.selection.value}:null,_={...e.activeCell.value};n.sheets.value=s.map(V=>{const Q=n.mkSheet(V.name),{cells:Ee,styles:Ve}=rr(V.cells);if(Object.assign(Q.cells,Ee),Q.styles=V.styles??Ve,V.borders)Q.borders=V.borders;else{const ot=ar(Q.styles);Q.styles=ot.styles,Q.borders=ot.borders}if(V.colWidths)for(const[ot,pt]of Object.entries(V.colWidths)){const yt=Number(ot);yt>=0&&yt<e.colCount&&pt>=30&&(Q.colWidths[yt]=pt)}if(V.rowHeights)for(const[ot,pt]of Object.entries(V.rowHeights)){const yt=Number(ot);yt>=0&&yt<e.rowCount&&pt>=24&&(Q.rowHeights[yt]=pt)}if(V.merges)for(const[ot,pt]of Object.entries(V.merges))Q.merges[ot]={...pt};return Q.freeze=V.freeze?{rows:V.freeze.rows,cols:V.freeze.cols}:{rows:0,cols:0},Q.filter=fr(V.filter,Q.cells),Q}),n.sheets.value.length>0&&n.loadSheet(0),M&&(e.selection.value=M),e.activeCell.value=_;const x=e.activeCell.value,P=e.selection.value,z=e.findMerge(x.col,x.row);z&&z.anchor===e.cellKey(x.col,x.row)&&(!P||P.startCol===x.col&&P.startRow===x.row&&P.endCol===x.col&&P.endRow===x.row)&&e.selectCell(x.col,x.row),d()},{deep:!0}),t.onBeforeUnmount(()=>{yl==null||yl.disconnect()})}return{scheduleRender:d,render:G,renderFrozenOverlay:te,activeCellLabel:C,formulaBarDisplay:se,formulaBarDraft:j,formulaBarExpanded:q,onFormulaBarFocus:Ne,onFormulaBarInput:Qe,onFormulaBarKeydown:gt,onFormulaBarBlur:Ze,acceptFormulaBarEdit:Xe,cancelFormulaBarEdit:Je,insertFunctionIntoCell:Ge,renTab:tt,renTabVal:et,onTabClick:oe,onTabDblClick:me,commitTabRename:g,cclTabRename:I,onTabRenameKd:L,ctxMenu:$,ctxSubmenuLeft:St,filterPopup:J,isFilterButtonHit:u,openFilterPopup:p,closeFilterPopup:H,onCtxItemEnter:Rt,onTabCtxMenu:Mt,onTabBarCtx:It,onCornerCtx:_t,onRowHdrCtx:tl,onColHdrCtx:vl,onCellCtx:Dl,dimInputRef:ul,dimPanel:$t,openDimPanel:Nl,onDimInput:bn,onDimKeydown:Yl,onDimBlur:an,applyDimPanel:F,closeDimPanel:D,editInputStyle:O,hScrollbarW:Me,vScrollbarH:Se,hScrollbarLeft:he,vScrollbarTop:Z,hTrackW:He,vTrackH:$e,hThumbW:le,hThumbL:Ke,vThumbH:st,vThumbT:E,onVStart:ye,onHStart:fe,onSbMove:ke,onSbUp:We,onVTrk:mt,onHTrk:Bt,onMouseDown:xe,onMouseMove:Fe,onMouseUp:Ae,onMouseLeave:ze,onCanvasCtx:Ue,onDblClick:dt,onWheel:je,onTouchStart:ft,onTouchMove:Lt,onTouchEnd:kn,onKeydown:Sn,onEditInput:sn,onEditCompositionStart:An,onEditCompositionEnd:Pn,onEditKd:hr,onEditPaste:Au,onEditBlur:Vu,applySize:Un,setupLifecycle:Hu}}function fu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mr(e,l,o,n){return l?n?o?e===l:e.toLowerCase()===l.toLowerCase():o?e.includes(l):e.toLowerCase().includes(l.toLowerCase()):!1}function mu(e,l,o,n){if(!l)return e;if(n){const i=e.indexOf(l);return i<0?e:e.slice(0,i)+o+e.slice(i+l.length)}const a=e.toLowerCase().indexOf(l.toLowerCase());return a<0?e:e.slice(0,a)+o+e.slice(a+l.length)}function pu(e,l,o,n){return l?n?e.indexOf(l)<0?e:e.split(l).join(o):e.toLowerCase().indexOf(l.toLowerCase())<0?e:e.replace(new RegExp(fu(l),"gi"),()=>o):e}function ko(e,l,o,n,a,i,r){const f=[];if(r){for(let m=r.startRow;m<=r.endRow;m++)for(let y=r.startCol;y<=r.endCol;y++){const k=e[o(y,m)];k&&mr(k.value,n,a,i)&&f.push({sheetIndex:l,col:y,row:m})}return f}for(const m in e){const y=e[m];if(y&&mr(y.value,n,a,i)){const k=m.split(","),d=Number(k[0]),w=Number(k[1]);!Number.isNaN(d)&&!Number.isNaN(w)&&f.push({sheetIndex:l,col:d,row:w})}}return f}function hu(e,l,o,n){const a=t.ref(!1),i=t.ref(""),r=t.ref(""),f=t.ref("sheet"),m=t.ref(!1),y=t.ref(!1),k=t.ref(-1),d=t.ref([]),w=t.ref(""),v=t.ref(0),R=t.ref(""),G=t.computed(()=>{const oe=new Set,me=o.activeSheetIndex.value;for(const g of d.value)g.sheetIndex===me&&oe.add(`${g.col},${g.row}`);return oe}),te=t.computed(()=>{if(k.value<0||k.value>=d.value.length)return null;const oe=d.value[k.value];return oe.sheetIndex!==o.activeSheetIndex.value?null:`${oe.col},${oe.row}`});e.findHighlight=(oe,me)=>{const g=`${oe},${me}`;return te.value===g?"active":G.value.has(g)?"match":null};function Y(oe){var I,L;const me=e.cellKey(oe.col,oe.row);if(oe.sheetIndex===o.activeSheetIndex.value)return((I=e.cells[me])==null?void 0:I.value)??"";const g=o.sheets.value[oe.sheetIndex];return((L=g==null?void 0:g.cells[me])==null?void 0:L.value)??""}function K(oe,me){const g=e.cellKey(oe.col,oe.row);if(oe.sheetIndex===o.activeSheetIndex.value)e.setCellValue(oe.col,oe.row,me);else{const I=o.sheets.value[oe.sheetIndex];if(!I)return;const L=I.cells[g];I.cells[g]={value:String(me),styleId:L==null?void 0:L.styleId}}}function C(){if(R.value){w.value=R.value;return}if(!i.value){w.value="";return}if(f.value==="selection"&&!e.selection.value){w.value=N(e.locale.value,"findNeedSelection");return}if(d.value.length===0){w.value=N(e.locale.value,"findNoResult");return}w.value=""}function j(){const oe=i.value,me=[];if(oe)if(f.value==="workbook")o.sheets.value.forEach((g,I)=>{me.push(...ko(g.cells,I,e.cellKey,oe,m.value,y.value))});else if(f.value==="selection"){const g=e.selection.value;g&&me.push(...ko(e.cells,o.activeSheetIndex.value,e.cellKey,oe,m.value,y.value,g))}else me.push(...ko(e.cells,o.activeSheetIndex.value,e.cellKey,oe,m.value,y.value));d.value=me,me.length===0?k.value=-1:k.value>=me.length?k.value=me.length-1:k.value<0&&(k.value=0),C()}function q(){if(k.value<0||k.value>=d.value.length)return;const oe=d.value[k.value];oe.sheetIndex!==o.activeSheetIndex.value&&o.switchSheet(oe.sheetIndex),f.value==="selection"?e.activeCell.value={col:oe.col,row:oe.row}:e.selectCell(oe.col,oe.row),e.ensureVisible(oe.col,oe.row)}const se=typeof requestAnimationFrame=="function"?requestAnimationFrame:oe=>setTimeout(oe,16);let Ne=!1,Qe=!1;function Ge(oe){if(Ne){Qe=Qe||oe;return}Ne=!0,Qe=oe,se(()=>{var me;Ne=!1,j(),Qe&&d.value.length>0&&k.value>=0&&q(),Qe=!1,(me=e.scheduleRender)==null||me.call(e)})}function be(){var oe;a.value=!0,v.value++,j(),d.value.length>0&&(k.value=0,q()),(oe=e.scheduleRender)==null||oe.call(e)}function ve(){be()}function Xe(){var oe;a.value=!1,d.value=[],k.value=-1,R.value="",w.value="",(oe=e.scheduleRender)==null||oe.call(e)}function Je(){var oe;d.value.length!==0&&(k.value=(k.value+1)%d.value.length,q(),(oe=e.scheduleRender)==null||oe.call(e))}function gt(){var oe;d.value.length!==0&&(k.value=(k.value-1+d.value.length)%d.value.length,q(),(oe=e.scheduleRender)==null||oe.call(e))}function Ze(){var L,$;if(k.value<0||k.value>=d.value.length)return;const oe=d.value[k.value],me=Y(oe),g=mu(me,i.value,r.value,m.value);if(g===me)return;l.saveUndo(),K(oe,g);const I=k.value;j(),d.value.length>0?(k.value=Math.min(I,d.value.length-1),Je()):k.value=-1,(L=e.emitModelData)==null||L.call(e),($=e.scheduleRender)==null||$.call(e)}function tt(){var I,L;const oe=i.value;if(!oe||d.value.length===0)return;l.saveUndo();let me=0;const g=d.value.slice();for(const $ of g){const J=Y($),ie=pu(J,oe,r.value,m.value);ie!==J&&(K($,ie),me++)}d.value=[],k.value=-1,R.value=N(e.locale.value,"findReplacedAll").replace("{n}",String(me)),C(),(I=e.emitModelData)==null||I.call(e),(L=e.scheduleRender)==null||L.call(e)}function et(){const oe=me=>{if(!(me.ctrlKey||me.metaKey))return;const I=me.key.toLowerCase();(I==="f"||I==="h")&&(me.preventDefault(),be())};window.addEventListener("keydown",oe),t.onBeforeUnmount(()=>window.removeEventListener("keydown",oe))}return t.watch(i,()=>{a.value&&(R.value="",k.value=0,Ge(!0))}),t.watch([f,m,y],()=>{a.value&&(R.value="",k.value=0,Ge(!0))}),t.watch(e.cells,()=>{a.value&&Ge(!1)},{deep:!0}),t.watch(()=>e.selection.value,()=>{a.value&&f.value==="selection"&&(k.value=0,Ge(!0))}),t.watch([()=>l.undoStack.value.length,()=>l.redoStack.value.length],()=>{a.value&&Ge(!1)}),{open:a,findText:i,replaceText:r,scope:f,matchCase:m,matchEntireCell:y,currentIndex:k,results:d,message:w,focusToken:v,activeSheetMatches:G,activeMatchKey:te,openFind:be,openReplace:ve,close:Xe,recompute:j,findNext:Je,findPrev:gt,replace:Ze,replaceAll:tt,setupLifecycle:et}}const gu={class:"formula-bar__cell-label"},yu={class:"formula-bar__buttons"},bu=["title","aria-label"],Cu=["rows","value"],wu=["title"],vu={key:0,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},ku={key:1,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},Eu=["value"],Su={key:2,class:"sb-corner"},Ru=["onClick","onMouseenter"],Mu={class:"context-menu__label"},xu={key:0,class:"context-menu__arrow",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"22869"},Bu=["onClick"],Tu={class:"dim-panel__title"},Du={class:"dim-panel__body"},Nu=["value"],Fu={key:0,class:"dim-panel__error"},Iu={class:"dim-panel__footer"},pr=Qt(t.defineComponent({__name:"spreader",props:t.mergeModels({rowCount:{default:200},colCount:{default:26},width:{},height:{},theme:{default:"light"},locale:{default:"zh-CN"}},{data:{default:()=>[]},dataModifiers:{}}),emits:["update:data"],setup(e){const l=e,o=t.useModel(e,"data"),n={value:""},a=lu(l,{rowCount:l.rowCount,colCount:l.colCount,theme:l.theme,locale:l.locale}),i={sheets:t.ref([]),activeSheetIndex:t.ref(0),saveSheet:()=>{},loadSheet:A=>{},mkSheet:A=>({id:"",name:A,cells:{},merges:{},styles:[{}],borders:[{}],selection:null,activeCell:{col:0,row:0},scrollX:0,scrollY:0,colWidths:[],rowHeights:[],colCount:0,rowCount:0,freeze:{rows:0,cols:0},filter:null})},r=nu(a,i),f=ru(a,r);ou(r,{borderMenuOpen:f.borderMenuOpen,mergeMenuOpen:f.mergeMenuOpen});const m=uu(a,r,o,void 0,n);i.sheets=m.sheets,i.activeSheetIndex=m.activeSheetIndex,i.saveSheet=m.saveSheet,i.loadSheet=m.loadSheet,i.mkSheet=m.mkSheet;const y=du(a,r,f,m,n);y.setupLifecycle();const k=hu(a,r,m);k.setupLifecycle();const d=t.reactive(a),w=t.reactive(r),v=t.reactive(f),R=t.reactive(m),G=m.sheets,te=m.activeSheetIndex,Y=m.sortMenuOpen,K=m.cachedSortOrder,C=t.reactive(y),j=t.reactive(k),q=t.computed(()=>{const A=d.selection;return!!A&&A.startCol===A.endCol&&A.startRow===A.endRow}),se=t.computed(()=>{const A=d.selection;return A?m.canSortColumns(A.startCol,A.endCol):!1}),Ne=t.computed(()=>{if(d.getFilter()!==null)return!0;const A=d.selection;if(!A)return!0;const c=Math.min(A.startCol,A.endCol),u=Math.max(A.startCol,A.endCol),p=Math.min(A.startRow,A.endRow),H=Math.max(A.startRow,A.endRow);for(const ct in d.merges){const ae=d.merges[ct];if(!(ae.startCol===ae.endCol&&ae.startRow===ae.endRow)&&c<=ae.endCol&&u>=ae.startCol&&p<=ae.endRow&&H>=ae.startRow)return!1}return!0}),Qe=t.computed(()=>{const A=w.selNumberFormat;if(A!==Bl&&A!==Pl)return A;const c=d.activeCell,u=a.resolveStyle(d.cells[d.cellKey(c.col,c.row)]);return typeof(u==null?void 0:u.numberFormat)=="string"?u.numberFormat:""});function Ge(A){r.nfDialogOpen.value=A}const be=t.ref(!1);function ve(){be.value=!0}function Xe(A){be.value=A}function Je(A){y.insertFunctionIntoCell(A)}function gt(){d.toggleAutoFilter(),C.scheduleRender()}function Ze(A){const c=d.getFilter();return c?d.getCellValue(A,c.range.startRow):""}function tt(A){const c=d.freeze;if(A==="panes"){const u=d.selection,p=u?u.startRow:d.activeCell.row,H=u?u.startCol:d.activeCell.col;d.setFreeze(p,H)}else A==="firstRow"?d.setFreeze(1,c.cols):A==="firstCol"?d.setFreeze(c.rows,1):A==="unfreeze"&&d.clearFreeze();C.scheduleRender()}function et(A){r.fontSizeMenuOpen.value=A}function oe(A){r.textColorMenuOpen.value=A}function me(A){r.fillColorMenuOpen.value=A}function g(A){y.renTabVal.value=A}function I(){y.ctxMenu.value=null}const L=A=>{m.formulaBarRef.value=A};function $(){y.formulaBarExpanded.value=!y.formulaBarExpanded.value}const J=A=>{m.wrapperRef.value=A},ie=A=>{m.canvasRef.value=A},re=A=>{m.freezeCanvasRef.value=A},pe=A=>{m.editInputRef.value=A},ce=A=>{y.dimInputRef.value=A};return(A,c)=>(t.openBlock(),t.createElementBlock("div",{class:"spreadsheet-outer",style:t.normalizeStyle(R.outerStyle)},[t.createVNode(ji,{locale:d.locale,"can-undo":w.canUndo,"can-redo":w.canRedo,"paint-fmt-active":w.paintFmt!==null,"has-selection":w.hasSelection,"font-family-options":w.fontFamilyOptions,"font-size-options":w.fontSizeOptions,"sel-font-family":w.selFontFamily,"sel-font-size":w.selFontSize,"font-size-input":w.fontSizeInput,"font-size-menu-open":w.fontSizeMenuOpen,"sel-font-weight":w.selFontWeight,"sel-font-style":w.selFontStyle,"sel-underline":w.selUnderline,"sel-strikethrough":w.selStrikethrough,"sel-text-color":w.selTextColor,"text-color-menu-open":w.textColorMenuOpen,"sel-fill-color":w.selFillColor,"fill-color-menu-open":w.fillColorMenuOpen,"cached-text-color":w.cachedTextColor,"cached-fill-color":w.cachedFillColor,"border-menu-open":v.borderMenuOpen,"cached-border":v.cachedBorder,"sort-menu-open":t.unref(Y),"cached-sort-order":t.unref(K),"can-sort":se.value,"can-filter":Ne.value,"filter-active":d.getFilter()!==null,"h-align-options":w.hAlignOptions,"v-align-options":w.vAlignOptions,"sel-h-align":w.selHAlign,"sel-v-align":w.selVAlign,"sel-wrap":w.selWrap,"merge-menu-open":v.mergeMenuOpen,"calc-menu-open":v.calcMenuOpen,"is-single-cell":q.value,"has-freeze":d.freeze.rows>0||d.freeze.cols>0,"sel-number-format":w.selNumberFormatDisplay,"nf-options":w.nfOptions,"can-increase-decimals":w.canIncreaseDecimals,"can-decrease-decimals":w.canDecreaseDecimals,"theme-vars":R.toolbarThemeVars,onUndo:c[0]||(c[0]=u=>w.undo()),onRedo:c[1]||(c[1]=u=>w.redo()),onPaintFormat:w.onPaintFormat,onClearFormat:c[2]||(c[2]=u=>w.clearFormat()),onNumberFormatChange:c[3]||(c[3]=u=>w.onNumberFormatChange(u)),onIncreaseDecimals:w.onIncreaseDecimals,onDecreaseDecimals:w.onDecreaseDecimals,onFontFamilyChange:c[4]||(c[4]=u=>w.onFontFamilyChange(u)),onFontSizeInput:c[5]||(c[5]=u=>w.onFontSizeInput(u)),onFontSizeBlur:w.onFontSizeBlur,onFontSizeKeydown:c[6]||(c[6]=u=>w.onFontSizeKeydown(u)),onFontSizeChange:c[7]||(c[7]=u=>w.onFontSizeChange(u)),"onUpdate:fontSizeMenuOpen":c[8]||(c[8]=u=>et(u)),onFontSizeToggle:c[9]||(c[9]=u=>w.toggleFontSizeMenu()),onFontSizeStepUp:w.onFontSizeStepUp,onFontSizeStepDown:w.onFontSizeStepDown,onBoldToggle:w.toggleFontWeight,onItalicToggle:w.toggleFontStyle,onUnderlineToggle:w.toggleUnderline,onStrikethroughToggle:w.toggleStrikethrough,onTextColorChange:c[10]||(c[10]=u=>w.onTextColorChange(u)),"onUpdate:textColorMenuOpen":c[11]||(c[11]=u=>oe(u)),onFillColorChange:c[12]||(c[12]=u=>w.onFillColorChange(u)),"onUpdate:fillColorMenuOpen":c[13]||(c[13]=u=>me(u)),onApplyTextColor:w.applyCachedTextColor,onApplyFillColor:w.applyCachedFillColor,"onUpdate:borderMenuOpen":c[14]||(c[14]=u=>w.onBorderMenuToggle(u)),onBorderChange:c[15]||(c[15]=u=>v.onBorderChange(u)),onApplyBorder:v.applyCachedBorder,"onUpdate:sortMenuOpen":c[16]||(c[16]=u=>R.onSortMenuToggle(u)),onSortChange:c[17]||(c[17]=u=>R.onSortChange(u)),onApplySort:R.applyCachedSort,onToggleFilter:gt,onFreezeChange:c[18]||(c[18]=u=>tt(u)),onHAlignChange:c[19]||(c[19]=u=>w.onHAlignChange(u)),onVAlignChange:c[20]||(c[20]=u=>w.onVAlignChange(u)),onWrapToggle:w.onWrapToggle,"onUpdate:mergeMenuOpen":c[21]||(c[21]=u=>v.onMergeMenuToggle(u)),onMergeChange:c[22]||(c[22]=u=>v.onMergeChange(u)),onApplyMerge:v.onApplyMerge,"onUpdate:calcMenuOpen":c[23]||(c[23]=u=>v.onCalcMenuToggle(u)),onCalcSum:v.onCalcSum,onCalcAvg:v.onCalcAvg,onCalcCount:v.onCalcCount,onFind:c[24]||(c[24]=u=>t.unref(k).openFind())},null,8,["locale","can-undo","can-redo","paint-fmt-active","has-selection","font-family-options","font-size-options","sel-font-family","sel-font-size","font-size-input","font-size-menu-open","sel-font-weight","sel-font-style","sel-underline","sel-strikethrough","sel-text-color","text-color-menu-open","sel-fill-color","fill-color-menu-open","cached-text-color","cached-fill-color","border-menu-open","cached-border","sort-menu-open","cached-sort-order","can-sort","can-filter","filter-active","h-align-options","v-align-options","sel-h-align","sel-v-align","sel-wrap","merge-menu-open","calc-menu-open","is-single-cell","has-freeze","sel-number-format","nf-options","can-increase-decimals","can-decrease-decimals","theme-vars","onPaintFormat","onIncreaseDecimals","onDecreaseDecimals","onFontSizeBlur","onFontSizeStepUp","onFontSizeStepDown","onBoldToggle","onItalicToggle","onUnderlineToggle","onStrikethroughToggle","onApplyTextColor","onApplyFillColor","onApplyBorder","onApplySort","onWrapToggle","onApplyMerge","onCalcSum","onCalcAvg","onCalcCount"]),t.createVNode(vc,{open:j.open,"find-text":j.findText,"replace-text":j.replaceText,scope:j.scope,"match-case":j.matchCase,"match-entire-cell":j.matchEntireCell,"current-index":j.currentIndex,total:j.results.length,message:j.message,"focus-token":j.focusToken,locale:d.locale,"theme-vars":R.toolbarThemeVars,"onUpdate:findText":c[25]||(c[25]=u=>t.unref(k).findText.value=u),"onUpdate:replaceText":c[26]||(c[26]=u=>t.unref(k).replaceText.value=u),"onUpdate:scope":c[27]||(c[27]=u=>t.unref(k).scope.value=u),"onUpdate:matchCase":c[28]||(c[28]=u=>t.unref(k).matchCase.value=u),"onUpdate:matchEntireCell":c[29]||(c[29]=u=>t.unref(k).matchEntireCell.value=u),onPrev:c[30]||(c[30]=u=>t.unref(k).findPrev()),onNext:c[31]||(c[31]=u=>t.unref(k).findNext()),onReplace:c[32]||(c[32]=u=>t.unref(k).replace()),onReplaceAll:c[33]||(c[33]=u=>t.unref(k).replaceAll()),onClose:c[34]||(c[34]=u=>t.unref(k).close())},null,8,["open","find-text","replace-text","scope","match-case","match-entire-cell","current-index","total","message","focus-token","locale","theme-vars"]),t.createVNode(Xc,{"model-open":w.nfDialogOpen,locale:d.locale,"current-format":Qe.value,"is-custom":w.selNumberFormat===t.unref(Pl),"onUpdate:modelOpen":c[35]||(c[35]=u=>Ge(u)),onApply:c[36]||(c[36]=u=>w.applyNumberFormatCode(u))},null,8,["model-open","locale","current-format","is-custom"]),t.createVNode(ns,{"model-open":R.sortConfirmOpen,locale:d.locale,"onUpdate:modelOpen":c[37]||(c[37]=u=>R.sortConfirmOpen=u),onConfirm:c[38]||(c[38]=u=>R.confirmSort(u)),onCancel:c[39]||(c[39]=u=>R.cancelSortConfirmation())},null,8,["model-open","locale"]),t.createVNode(ks,{"model-open":be.value,locale:d.locale,"onUpdate:modelOpen":c[40]||(c[40]=u=>Xe(u)),onInsert:c[41]||(c[41]=u=>Je(u))},null,8,["model-open","locale"]),t.createElementVNode("div",{class:t.normalizeClass(["formula-bar",{"formula-bar--expanded":C.formulaBarExpanded}])},[t.createElementVNode("div",gu,t.toDisplayString(C.activeCellLabel),1),t.createElementVNode("div",yu,[t.createElementVNode("button",{type:"button",class:"formula-bar__btn formula-bar__btn--cancel",title:"取消(Esc)","aria-label":"取消",onMousedown:c[42]||(c[42]=t.withModifiers(()=>{},["prevent"])),onClick:c[43]||(c[43]=t.withModifiers((...u)=>C.cancelFormulaBarEdit&&C.cancelFormulaBarEdit(...u),["stop"]))},[...c[95]||(c[95]=[t.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true"},[t.createElementVNode("path",{d:"M3 3l8 8M11 3l-8 8",fill:"none",stroke:"#e53935","stroke-width":"1.8","stroke-linecap":"round"})],-1)])],32),t.createElementVNode("button",{type:"button",class:"formula-bar__btn formula-bar__btn--accept",title:"接受(Enter)","aria-label":"接受",onMousedown:c[44]||(c[44]=t.withModifiers(()=>{},["prevent"])),onClick:c[45]||(c[45]=t.withModifiers((...u)=>C.acceptFormulaBarEdit&&C.acceptFormulaBarEdit(...u),["stop"]))},[...c[96]||(c[96]=[t.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true"},[t.createElementVNode("path",{d:"M2.5 7.5l3.5 3.5L12 3.5",fill:"none",stroke:"#2e7d32","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],32),t.createElementVNode("button",{type:"button",class:"formula-bar__btn formula-bar__btn--fx",title:t.unref(N)(d.locale,"insertFunctionTitle"),"aria-label":t.unref(N)(d.locale,"insertFunctionTitle"),onMousedown:c[46]||(c[46]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers(ve,["stop"])},[...c[97]||(c[97]=[t.createElementVNode("span",{class:"formula-bar__fx-label"},"fx",-1)])],40,bu)]),t.createElementVNode("textarea",{ref:L,class:t.normalizeClass(["formula-bar__input",{"formula-bar__input--expanded":C.formulaBarExpanded}]),rows:C.formulaBarExpanded?3:1,value:C.formulaBarDisplay,spellcheck:"false",onFocus:c[47]||(c[47]=(...u)=>C.onFormulaBarFocus&&C.onFormulaBarFocus(...u)),onInput:c[48]||(c[48]=(...u)=>C.onFormulaBarInput&&C.onFormulaBarInput(...u)),onKeydown:c[49]||(c[49]=(...u)=>C.onFormulaBarKeydown&&C.onFormulaBarKeydown(...u)),onBlur:c[50]||(c[50]=(...u)=>C.onFormulaBarBlur&&C.onFormulaBarBlur(...u))},null,42,Cu),t.createElementVNode("button",{type:"button",class:"formula-bar__toggle",title:C.formulaBarExpanded?"折叠为1行":"展开为3行",onMousedown:c[51]||(c[51]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers($,["stop"])},[C.formulaBarExpanded?(t.openBlock(),t.createElementBlock("svg",ku,[...c[99]||(c[99]=[t.createElementVNode("path",{d:"M2 8l4-4 4 4",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(t.openBlock(),t.createElementBlock("svg",vu,[...c[98]||(c[98]=[t.createElementVNode("path",{d:"M2 4l4 4 4-4",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],40,wu)],2),t.createElementVNode("div",{ref:J,class:"spreadsheet-wrapper"},[t.createElementVNode("canvas",{ref:ie,class:"grid-canvas",tabindex:"0",onMousedown:c[52]||(c[52]=(...u)=>C.onMouseDown&&C.onMouseDown(...u)),onMousemove:c[53]||(c[53]=(...u)=>C.onMouseMove&&C.onMouseMove(...u)),onMouseup:c[54]||(c[54]=(...u)=>C.onMouseUp&&C.onMouseUp(...u)),onMouseleave:c[55]||(c[55]=(...u)=>C.onMouseLeave&&C.onMouseLeave(...u)),onDblclick:c[56]||(c[56]=(...u)=>C.onDblClick&&C.onDblClick(...u)),onWheel:c[57]||(c[57]=t.withModifiers((...u)=>C.onWheel&&C.onWheel(...u),["prevent"])),onFocus:c[58]||(c[58]=(...u)=>R.onCanvasFocus&&R.onCanvasFocus(...u)),onKeydown:c[59]||(c[59]=(...u)=>C.onKeydown&&C.onKeydown(...u)),onContextmenu:c[60]||(c[60]=(...u)=>C.onCanvasCtx&&C.onCanvasCtx(...u)),onTouchstart:c[61]||(c[61]=t.withModifiers((...u)=>C.onTouchStart&&C.onTouchStart(...u),["prevent"])),onTouchmove:c[62]||(c[62]=t.withModifiers((...u)=>C.onTouchMove&&C.onTouchMove(...u),["prevent"])),onTouchend:c[63]||(c[63]=(...u)=>C.onTouchEnd&&C.onTouchEnd(...u))},null,32),t.createElementVNode("canvas",{ref:re,class:"grid-canvas grid-canvas--freeze","aria-hidden":"true"}),t.createElementVNode("textarea",{ref:pe,class:"cell-editor",value:d.editValue,style:t.normalizeStyle(C.editInputStyle),onInput:c[64]||(c[64]=(...u)=>C.onEditInput&&C.onEditInput(...u)),onKeydown:c[65]||(c[65]=(...u)=>C.onEditKd&&C.onEditKd(...u)),onCompositionstart:c[66]||(c[66]=(...u)=>C.onEditCompositionStart&&C.onEditCompositionStart(...u)),onCompositionend:c[67]||(c[67]=(...u)=>C.onEditCompositionEnd&&C.onEditCompositionEnd(...u)),onBlur:c[68]||(c[68]=(...u)=>C.onEditBlur&&C.onEditBlur(...u)),onPaste:c[69]||(c[69]=(...u)=>C.onEditPaste&&C.onEditPaste(...u))},null,44,Eu),R.maxScrollY>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"v-scrollbar",style:t.normalizeStyle({top:C.vScrollbarTop+"px",height:`calc(100% - ${C.vScrollbarTop+t.unref(11)}px)`})},[t.createElementVNode("button",{class:"sb-btn sb-btn--up",title:"",onMousedown:c[70]||(c[70]=t.withModifiers(u=>{R.clampScroll(null,d.scrollY-50),C.scheduleRender()},["prevent"]))},[...c[100]||(c[100]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--up"},null,-1)])],32),t.createElementVNode("div",{class:"sb-track sb-track--v",onMousedown:c[72]||(c[72]=(...u)=>C.onVTrk&&C.onVTrk(...u))},[t.createElementVNode("div",{class:"sb-thumb sb-thumb--v",style:t.normalizeStyle({top:C.vThumbT+"px",height:C.vThumbH+"px"}),onMousedown:c[71]||(c[71]=(...u)=>C.onVStart&&C.onVStart(...u))},null,36)],32),t.createElementVNode("button",{class:"sb-btn sb-btn--down",onMousedown:c[73]||(c[73]=t.withModifiers(u=>{R.clampScroll(null,d.scrollY+50),C.scheduleRender()},["prevent"]))},[...c[101]||(c[101]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--down"},null,-1)])],32)],4)):t.createCommentVNode("",!0),R.maxScrollX>0?(t.openBlock(),t.createElementBlock("div",{key:1,class:"h-scrollbar",style:t.normalizeStyle({left:C.hScrollbarLeft+"px",width:`calc(100% - ${C.hScrollbarLeft+t.unref(11)}px)`})},[t.createElementVNode("button",{class:"sb-btn sb-btn--left",onMousedown:c[74]||(c[74]=t.withModifiers(u=>{R.clampScroll(d.scrollX-50,null),C.scheduleRender()},["prevent"]))},[...c[102]||(c[102]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--left"},null,-1)])],32),t.createElementVNode("div",{class:"sb-track sb-track--h",onMousedown:c[76]||(c[76]=(...u)=>C.onHTrk&&C.onHTrk(...u))},[t.createElementVNode("div",{class:"sb-thumb sb-thumb--h",style:t.normalizeStyle({left:C.hThumbL+"px",width:C.hThumbW+"px"}),onMousedown:c[75]||(c[75]=(...u)=>C.onHStart&&C.onHStart(...u))},null,36)],32),t.createElementVNode("button",{class:"sb-btn sb-btn--right",onMousedown:c[77]||(c[77]=t.withModifiers(u=>{R.clampScroll(d.scrollX+50,null),C.scheduleRender()},["prevent"]))},[...c[103]||(c[103]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--right"},null,-1)])],32)],4)):t.createCommentVNode("",!0),R.maxScrollX>0&&R.maxScrollY>0?(t.openBlock(),t.createElementBlock("div",Su)):t.createCommentVNode("",!0)]),t.createVNode(cc,{locale:d.locale,sheets:t.unref(G),"active-sheet-index":t.unref(te),"ren-tab":C.renTab,"ren-tab-val":C.renTabVal,onTabClick:c[78]||(c[78]=u=>C.onTabClick(u)),onTabDblclick:c[79]||(c[79]=u=>C.onTabDblClick(u)),onTabContextmenu:c[80]||(c[80]=u=>C.onTabCtxMenu(u.ev,u.i)),onTabRenameInput:c[81]||(c[81]=u=>g(u)),onTabRenameKeydown:c[82]||(c[82]=u=>C.onTabRenameKd(u)),onTabRenameCommit:C.commitTabRename,onTabbarContextmenu:c[83]||(c[83]=u=>C.onTabBarCtx(u)),onDeleteSheet:c[84]||(c[84]=u=>{R.removeSheet(u),C.scheduleRender()}),onAddSheet:c[85]||(c[85]=u=>{R.addSheet(),C.scheduleRender()})},null,8,["locale","sheets","active-sheet-index","ren-tab","ren-tab-val","onTabRenameCommit"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[C.ctxMenu?(t.openBlock(),t.createElementBlock("div",{key:0,class:"context-menu",style:t.normalizeStyle({left:C.ctxMenu.x+"px",top:C.ctxMenu.y+"px"}),onClick:c[86]||(c[86]=t.withModifiers(()=>{},["stop"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.ctxMenu.items,(u,p)=>(t.openBlock(),t.createElementBlock("div",{key:p,class:t.normalizeClass(["context-menu__item",{"context-menu__item--disabled":u.disabled}]),onClick:H=>!u.disabled&&u.action&&(u.action(),I()),onMouseenter:H=>C.onCtxItemEnter(H,u)},[t.createElementVNode("span",Mu,t.toDisplayString(u.label),1),u.children?(t.openBlock(),t.createElementBlock("svg",xu,[...c[104]||(c[104]=[t.createElementVNode("path",{d:"M361.386667 180.053333a32 32 0 0 0 0 45.226667L648.106667 512l-286.72 286.72a32 32 0 1 0 45.226666 45.226667l309.333334-309.333334a32 32 0 0 0 0-45.226666L406.613333 180.053333a32 32 0 0 0-45.226666 0z","p-id":"22870"},null,-1)])])):t.createCommentVNode("",!0),u.children?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["context-submenu",{"context-submenu--left":C.ctxSubmenuLeft}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.children,(H,ct)=>(t.openBlock(),t.createElementBlock("div",{key:ct,class:t.normalizeClass(["context-menu__item",{"context-menu__item--disabled":H.disabled}]),onClick:t.withModifiers(ae=>!H.disabled&&H.action&&(H.action(),I()),["stop"])},t.toDisplayString(H.label),11,Bu))),128))],2)):t.createCommentVNode("",!0)],42,Ru))),128))],4)):t.createCommentVNode("",!0)]),_:1})])),C.filterPopup?(t.openBlock(),t.createBlock(Ys,{key:C.filterPopup.col,col:C.filterPopup.col,"header-label":Ze(C.filterPopup.col),anchor:{x:C.filterPopup.x,y:C.filterPopup.y},locale:d.locale,"get-filter":d.getFilter,"set-filter":d.setFilter,"set-filter-column":d.setFilterColumn,"clear-filter-column":d.clearFilterColumn,"get-column-candidates":d.getColumnCandidates,close:C.closeFilterPopup},null,8,["col","header-label","anchor","locale","get-filter","set-filter","set-filter-column","clear-filter-column","get-column-candidates","close"])):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[C.dimPanel?(t.openBlock(),t.createElementBlock("div",{key:0,class:"dim-panel",style:t.normalizeStyle({left:C.dimPanel.x+"px",top:C.dimPanel.y+"px"}),onMousedown:c[92]||(c[92]=t.withModifiers(()=>{},["stop"])),onTouchstart:c[93]||(c[93]=t.withModifiers(()=>{},["stop"])),onClick:c[94]||(c[94]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",Tu,t.toDisplayString(C.dimPanel.type==="row"?"行高":"列宽"),1),t.createElementVNode("div",Du,[t.createElementVNode("input",{ref:ce,class:t.normalizeClass(["dim-panel__input",{"dim-panel__input--error":C.dimPanel.error}]),type:"number",step:"1",min:"1",inputmode:"numeric",value:C.dimPanel.value,onInput:c[87]||(c[87]=(...u)=>C.onDimInput&&C.onDimInput(...u)),onKeydown:c[88]||(c[88]=(...u)=>C.onDimKeydown&&C.onDimKeydown(...u)),onBlur:c[89]||(c[89]=(...u)=>C.onDimBlur&&C.onDimBlur(...u))},null,42,Nu)]),C.dimPanel.error?(t.openBlock(),t.createElementBlock("div",Fu,t.toDisplayString(C.dimPanel.error),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Iu,[t.createElementVNode("button",{class:"dim-panel__btn dim-panel__btn--primary",onClick:c[90]||(c[90]=(...u)=>C.applyDimPanel&&C.applyDimPanel(...u))}," 确定 "),t.createElementVNode("button",{class:"dim-panel__btn",onClick:c[91]||(c[91]=(...u)=>C.closeDimPanel&&C.closeDimPanel(...u))}," 取消 ")])],36)):t.createCommentVNode("",!0)]),_:1})]))],4))}}),[["__scopeId","data-v-17b333fa"]]);nn.Spreader=pr,nn.default=pr,Object.defineProperties(nn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(rn,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(rn=typeof globalThis<"u"?globalThis:rn||self,t(rn.XiaoDaoSpreader={},rn.Vue))})(this,function(rn,t){"use strict";const yr={"zh-CN":{insert:"插入",delete:"删除",rename:"重命名",moveLeft:"左移",moveRight:"右移",cut:"剪切",copy:"复制",paste:"粘贴",addSheet:"新建工作表",sheetList:"工作表列表",moveSheetLeft:"左移",moveSheetRight:"右移",scrollUp:"向上滚动",scrollDown:"向下滚动",scrollLeft:"向左滚动",scrollRight:"向右滚动",calculate:"计算",sum:"求和",avg:"平均值",count:"计数",undo:"撤销",redo:"重做",paintFormat:"格式刷",clearFormat:"清除格式",fontFamily:"字体",fontSize:"字号",fontSizeIncrease:"增大字号",fontSizeDecrease:"减小字号",bold:"加粗",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontColor:"文字颜色",fillColor:"填充颜色",borders:"边框",hAlign:"水平对齐",vAlign:"垂直对齐",alignLeft:"左端对齐",alignCenter:"居中对齐",alignRight:"右端对齐",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",wrap:"自动换行",mergeCells:"合并单元格",mergeCenter:"合并后居中",mergeAcross:"跨越合并",unmergeCells:"取消合并单元格",borderBottom:"下框线",borderTop:"上框线",borderLeft:"左框线",borderRight:"右框线",borderNone:"无框线",borderAll:"所有框线",borderOuter:"外框线",borderThickOuter:"粗外框线",fontDefault:"默认",rowHeight:"行高",colWidth:"列宽",autoRowHeight:"自动行高",defaultColWidth:"默认列宽",sort:"排序",sortAsc:"升序排序",sortDesc:"降序排序",sortReminderTitle:"排序提醒",sortReminderMessage:"选定区域的左侧或右侧还有相邻数据,这些数据未被选中,将不参与排序。是否将其一并纳入排序?",sortExpandSelection:"扩展选定区域",sortCurrentSelection:"仅对选定区域排序",insertFunctionTitle:"插入函数",insertFunctionSelectLabel:"函数",insertFunctionPlaceholder:"请选择函数",insertFunctionSearchPlaceholder:"搜索函数",insertFunctionFormulaLabel:"公式",insertFunctionBtn:"插入",fnDescSum:"计算单元格区域中所有数值的和",fnDescAverage:"计算单元格区域中数值的算术平均值",fnDescCount:"统计单元格区域中包含数值的单元格个数",fnDescIf:"根据指定条件判断真假,返回对应的两个值之一",fnDescVlookup:"在区域首列查找指定值,返回同一行中指定列的值",fnDescConcatenate:"将多个文本连接合并为一个文本",fnDescMax:"返回单元格区域中所有数值的最大值",fnDescMin:"返回单元格区域中所有数值的最小值",fnDescSin:"返回给定角度(弧度)的正弦值",fnDescSumif:"对区域中满足指定条件的单元格对应的数值求和",fnDescPmt:"计算基于固定利率及等额分期付款的贷款每期还款额",fnDescStdev:"估算基于样本的标准偏差(忽略文本与逻辑值)",ok:"确定",cancel:"取消",dimNumberError:"请输入数字",dimRangeError:"请输入 {min}~{max} 之间的数值",colorAutomatic:"自动",colorNoFill:"无填充",colorWhite:"白色",colorBlack:"黑色",colorLightGray:"浅灰",colorLightBlue:"浅蓝",colorLightOrange:"浅橙",colorLightYellow:"浅黄",colorLightGreen:"浅绿",colorPaleBlue:"淡蓝",colorPaleOrange:"淡橙",colorPaleYellow:"淡黄",colorPaleGreen:"淡绿",colorSilver:"银色",colorSkyBlue:"天蓝",colorCoral:"珊瑚",colorGold:"金色",colorMint:"薄荷",colorGray:"灰色",colorMediumBlue:"中蓝",colorOrange:"橙色",colorAmber:"琥珀",colorMediumGreen:"中绿",colorDarkGray:"深灰",colorRoyalBlue:"宝蓝",colorRed:"红色",colorDarkGold:"深金",colorDarkGreen:"深绿",colorCharcoal:"炭灰",colorDeepBlue:"深蓝",colorDarkRed:"深红",colorOlive:"橄榄",colorForest:"森林",colorSlate:"石板灰",colorNavy:"藏青",colorCrimson:"绯红",colorDarkOlive:"深橄榄",colorDeepForest:"深林",colorDarkSlate:"深石板灰",colorMidnight:"午夜蓝",colorMaroon:"栗色",colorCoffee:"咖啡色",colorEvergreen:"常青",colorDarkNavy:"深藏青",colorDarkMaroon:"深栗",colorDarkCoffee:"深咖",colorInkGreen:"墨绿",numberFormat:"数字格式",nfGeneral:"常规",nfText:"文本",nfNumber:"数字",nfPercent:"百分比",nfScientific:"科学计数法",nfAccounting:"会计专用",nfFinancial:"财务数值",nfCurrency:"货币",nfCurrencyRounded:"货币取整",nfDate:"日期",nfTime:"时间",nfDateTime:"日期和时间",nfDuration:"持续时间",nfCustom:"其他数字格式…",nfMixed:"混合",nfIncreaseDecimals:"增加小数位数",nfDecreaseDecimals:"减少小数位数",nfDialogTitle:"设置单元格格式",nfCategory:"分类",nfCatCustom:"自定义",nfDecimals:"小数位数",nfThousands:"使用千位分隔符",nfSymbol:"货币符号",nfDateFormat:"日期格式",nfTimeFormat:"时间格式",nfCustomCode:"自定义格式代码",nfPreview:"预览",nfPreviewSample:"示例",find:"查找",findReplace:"查找和替换",findPlaceholder:"查找内容",replacePlaceholder:"替换为",findPrev:"上一个",findNext:"下一个",replace:"替换",replaceAll:"全部替换",findScope:"范围",scopeSheet:"当前工作表",scopeWorkbook:"整个工作簿",scopeSelection:"当前选区",matchCase:"区分大小写",matchEntireCell:"完整匹配",findNoResult:"未找到",findNeedSelection:"请先选择范围",findReplacedAll:"已替换 {n} 处",findClose:"关闭",freezePane:"冻结窗格",freezePanes:"冻结窗格",freezeFirstRow:"冻结首行",freezeFirstCol:"冻结首列",unfreezePanes:"取消冻结",freezeToRow:"冻结至此行",freezeToCol:"冻结至此列",filter:"筛选",clearFilter:"清除筛选",cancelFilter:"取消",filterSearchPlaceholder:"搜索",filterSelectAll:"全选",filterClearAll:"清除全部",filterOk:"确定",filterBlank:"空白",filterNonBlank:"非空白",filterText:"文本筛选",filterNumber:"数字筛选",filterDate:"日期筛选",filterEquals:"等于",filterNotEquals:"不等于",filterContains:"包含",filterNotContains:"不包含",filterStartsWith:"开头是",filterEndsWith:"结尾是",filterGreaterThan:"大于",filterGreaterThanOrEqual:"大于等于",filterLessThan:"小于",filterLessThanOrEqual:"小于等于",filterBetween:"介于",filterAnd:"与",filterCustom:"自定义筛选",filterNoData:"无数据",filterFilteredCount:"共 {n} 项",filterActive:"筛选中",filterByValue:"按此值筛选",filterByThisColumn:"筛选此列"},"en-US":{insert:"Insert",delete:"Delete",rename:"Rename",moveLeft:"Move Left",moveRight:"Move Right",cut:"Cut",copy:"Copy",paste:"Paste",addSheet:"Add new sheet",sheetList:"Sheet list",moveSheetLeft:"Move Left",moveSheetRight:"Move Right",scrollUp:"Scroll up",scrollDown:"Scroll down",scrollLeft:"Scroll left",scrollRight:"Scroll right",calculate:"Calculate",sum:"Sum",avg:"Average",count:"Count",undo:"Undo",redo:"Redo",paintFormat:"Paint Format",clearFormat:"Clear Format",fontFamily:"Font Family",fontSize:"Font Size",fontSizeIncrease:"Increase Font Size",fontSizeDecrease:"Decrease Font Size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontColor:"Font Color",fillColor:"Fill Color",borders:"Borders",hAlign:"Horizontal Align",vAlign:"Vertical Align",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignTop:"Align Top",alignMiddle:"Align Middle",alignBottom:"Align Bottom",wrap:"Wrap Text",mergeCells:"Merge Cells",mergeCenter:"Merge & Center",mergeAcross:"Merge Across",unmergeCells:"Unmerge Cells",borderBottom:"Bottom Border",borderTop:"Top Border",borderLeft:"Left Border",borderRight:"Right Border",borderNone:"No Border",borderAll:"All Borders",borderOuter:"Outside Borders",borderThickOuter:"Thick Box Border",fontDefault:"Default",rowHeight:"Row Height",colWidth:"Column Width",autoRowHeight:"Auto Row Height",defaultColWidth:"Default Column Width",sort:"Sort",sortAsc:"Sort Ascending",sortDesc:"Sort Descending",sortReminderTitle:"Sort Warning",sortReminderMessage:"There is adjacent data to the left or right of your selection. It is not selected and will not be sorted. Include it in the sort?",sortExpandSelection:"Expand the selection",sortCurrentSelection:"Sort the current selection only",insertFunctionTitle:"Insert Function",insertFunctionSelectLabel:"Function",insertFunctionPlaceholder:"Select a function",insertFunctionSearchPlaceholder:"Search a function",insertFunctionFormulaLabel:"Formula",insertFunctionBtn:"Insert",fnDescSum:"Adds all the numbers in a range of cells",fnDescAverage:"Returns the arithmetic mean of the numbers in a range",fnDescCount:"Counts the cells that contain numbers in a range",fnDescIf:"Checks a condition and returns one of two values",fnDescVlookup:"Looks up a value in the first column of a range and returns a value in the same row",fnDescConcatenate:"Joins several text strings into one text string",fnDescMax:"Returns the largest numeric value in a range of cells",fnDescMin:"Returns the smallest numeric value in a range of cells",fnDescSin:"Returns the sine of a given angle (in radians)",fnDescSumif:"Sums the values in a range that meet a specified condition",fnDescPmt:"Calculates the periodic payment for a loan with constant payments and interest",fnDescStdev:"Estimates the sample standard deviation of a supplied set of values",ok:"OK",cancel:"Cancel",dimNumberError:"Please enter a number",dimRangeError:"Please enter a value between {min} and {max}",colorAutomatic:"Automatic",colorNoFill:"No Fill",colorWhite:"White",colorBlack:"Black",colorLightGray:"Light Gray",colorLightBlue:"Light Blue",colorLightOrange:"Light Orange",colorLightYellow:"Light Yellow",colorLightGreen:"Light Green",colorPaleBlue:"Pale Blue",colorPaleOrange:"Pale Orange",colorPaleYellow:"Pale Yellow",colorPaleGreen:"Pale Green",colorSilver:"Silver",colorSkyBlue:"Sky Blue",colorCoral:"Coral",colorGold:"Gold",colorMint:"Mint",colorGray:"Gray",colorMediumBlue:"Medium Blue",colorOrange:"Orange",colorAmber:"Amber",colorMediumGreen:"Medium Green",colorDarkGray:"Dark Gray",colorRoyalBlue:"Royal Blue",colorRed:"Red",colorDarkGold:"Dark Gold",colorDarkGreen:"Dark Green",colorCharcoal:"Charcoal",colorDeepBlue:"Deep Blue",colorDarkRed:"Dark Red",colorOlive:"Olive",colorForest:"Forest",colorSlate:"Slate",colorNavy:"Navy",colorCrimson:"Crimson",colorDarkOlive:"Dark Olive",colorDeepForest:"Deep Forest",colorDarkSlate:"Dark Slate",colorMidnight:"Midnight",colorMaroon:"Maroon",colorCoffee:"Coffee",colorEvergreen:"Evergreen",colorDarkNavy:"Dark Navy",colorDarkMaroon:"Dark Maroon",colorDarkCoffee:"Dark Coffee",colorInkGreen:"Ink Green",numberFormat:"Number Format",nfGeneral:"General",nfText:"Text",nfNumber:"Number",nfPercent:"Percentage",nfScientific:"Scientific",nfAccounting:"Accounting",nfFinancial:"Financial",nfCurrency:"Currency",nfCurrencyRounded:"Currency Rounded",nfDate:"Date",nfTime:"Time",nfDateTime:"Date & Time",nfDuration:"Duration",nfCustom:"Other Number Formats…",nfMixed:"Mixed",nfIncreaseDecimals:"Increase Decimal",nfDecreaseDecimals:"Decrease Decimal",nfDialogTitle:"Format Cells",nfCategory:"Category",nfCatCustom:"Custom",nfDecimals:"Decimal places",nfThousands:"Use 1000 separator",nfSymbol:"Currency symbol",nfDateFormat:"Date format",nfTimeFormat:"Time format",nfCustomCode:"Custom format code",nfPreview:"Preview",nfPreviewSample:"Sample",find:"Find",findReplace:"Find & Replace",findPlaceholder:"Find what",replacePlaceholder:"Replace with",findPrev:"Previous",findNext:"Next",replace:"Replace",replaceAll:"Replace All",findScope:"Scope",scopeSheet:"Current sheet",scopeWorkbook:"Entire workbook",scopeSelection:"Current selection",matchCase:"Match case",matchEntireCell:"Match entire cell",findNoResult:"No results",findNeedSelection:"Select a range first",findReplacedAll:"Replaced {n} occurrence(s)",findClose:"Close",freezePane:"Freeze Panes",freezePanes:"Freeze Panes",freezeFirstRow:"Freeze First Row",freezeFirstCol:"Freeze First Column",unfreezePanes:"Unfreeze Panes",freezeToRow:"Freeze to Row",freezeToCol:"Freeze to Column",filter:"Filter",clearFilter:"Clear Filter",cancelFilter:"Cancel",filterSearchPlaceholder:"Search",filterSelectAll:"Select All",filterClearAll:"Clear All",filterOk:"OK",filterBlank:"Blanks",filterNonBlank:"Non-blanks",filterText:"Text Filters",filterNumber:"Number Filters",filterDate:"Date Filters",filterEquals:"Equals",filterNotEquals:"Does Not Equal",filterContains:"Contains",filterNotContains:"Does Not Contain",filterStartsWith:"Begins With",filterEndsWith:"Ends With",filterGreaterThan:"Greater Than",filterGreaterThanOrEqual:"Greater Than Or Equal To",filterLessThan:"Less Than",filterLessThanOrEqual:"Less Than Or Equal To",filterBetween:"Between",filterAnd:"And",filterCustom:"Custom Filter",filterNoData:"No data",filterFilteredCount:"{n} items",filterActive:"Filtering",filterByValue:"Filter by This Value",filterByThisColumn:"Filter This Column"}};function D(e,l){var o;return((o=yr[e])==null?void 0:o[l])??l}const Cn='-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif',_l=10,br=[{label:"",value:""},{label:"微软雅黑",value:'"Microsoft YaHei", "微软雅黑", sans-serif'},{label:"宋体",value:'"SimSun", "宋体", serif'},{label:"黑体",value:'"SimHei", "黑体", sans-serif'},{label:"楷体",value:'"KaiTi", "楷体", serif'},{label:"Arial",value:"Arial, sans-serif"},{label:"Arial Black",value:'"Arial Black", sans-serif'},{label:"Times New Roman",value:'"Times New Roman", serif'},{label:"Courier New",value:'"Courier New", monospace'},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", sans-serif'},{label:"Comic Sans MS",value:'"Comic Sans MS", cursive'}],Cr=[{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"20",value:20},{label:"24",value:24},{label:"28",value:28},{label:"32",value:32},{label:"36",value:36},{label:"48",value:48},{label:"72",value:72}],wr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="19" y2="6"/><line x1="3" y1="12" x2="15" y2="12"/><line x1="3" y1="18" x2="17" y2="18"/></svg>',vr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="6" y1="12" x2="18" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>',kr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="6" x2="21" y2="6"/><line x1="9" y1="12" x2="21" y2="12"/><line x1="7" y1="18" x2="21" y2="18"/></svg>',Er='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="7" x2="6" y2="20"/><line x1="12" y1="7" x2="12" y2="16"/><line x1="18" y1="7" x2="18" y2="20"/><line x1="4" y1="3" x2="20" y2="3"/></svg>',Sr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="4" x2="6" y2="20"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="18" y1="4" x2="18" y2="20"/></svg>',Rr='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="4" x2="6" y2="17"/><line x1="12" y1="8" x2="12" y2="17"/><line x1="18" y1="4" x2="18" y2="17"/><line x1="4" y1="21" x2="20" y2="21"/></svg>',Mr=[{value:"left",labelKey:"alignLeft",icon:wr},{value:"center",labelKey:"alignCenter",icon:vr},{value:"right",labelKey:"alignRight",icon:kr}],xr=[{value:"top",labelKey:"alignTop",icon:Er},{value:"middle",labelKey:"alignMiddle",icon:Sr},{value:"bottom",labelKey:"alignBottom",icon:Rr}],Eo=[{key:"mergeCenter",labelKey:"mergeCenter",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M709.952 465.92l88-76.032C801.92 385.984 806.656 384 812.032 384s10.048 1.984 14.08 5.952C830.08 393.92 832 398.656 832 403.968L832 448l32 0C881.664 448 896 462.336 896 480S881.664 512 864 512L832 512l0 44.032c0 5.376-1.92 10.112-5.952 14.08C822.08 574.08 817.344 576 812.032 576s-10.048-1.92-14.08-5.952L709.952 494.08C705.984 490.112 704 485.376 704 480S705.984 469.952 709.952 465.92zM378.048 465.92 290.048 389.952C286.08 385.984 281.344 384 275.968 384s-10.048 1.984-14.08 5.952C257.92 393.92 256 398.656 256 403.968L256 448 224 448C206.336 448 192 462.336 192 480S206.336 512 224 512L256 512l0 44.032c0 5.376 1.92 10.112 5.952 14.08C265.92 574.08 270.656 576 275.968 576s10.048-1.92 14.08-5.952L378.048 494.08C382.016 490.112 384 485.376 384 480S382.016 469.952 378.048 465.92zM448 128 128 128l0 704 320 0 0-128 64 0 0 128c0 35.392-28.608 64-64 64L128 896c-35.392 0-64-28.608-64-64L64 128c0-35.392 28.608-64 64-64l320 0 0 0c35.392 0 64 28.608 64 64l0 128L448 256 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128M722.304 642.304c0 8.512-3.52 16.32-10.496 23.36s-15.424 10.624-25.344 10.624c-5.76 0-10.688-1.088-14.72-3.136-4.096-2.048-7.616-4.928-10.432-8.512s-5.824-9.088-9.024-16.512-5.952-13.952-8.32-19.648l-17.28-46.016L479.36 582.464 462.08 629.568c-6.72 18.304-12.48 30.656-17.344 37.12s-12.544 9.6-23.424 9.6c-9.28 0-17.408-3.456-24.512-10.24s-10.624-14.592-10.624-23.232c0-4.992 0.896-10.176 2.496-15.488S393.024 614.592 396.8 605.056l92.672-238.016C492.096 360.256 495.296 352 499.008 342.464s7.68-17.536 11.904-23.872 9.664-11.456 16.576-15.36c6.784-3.968 15.232-5.888 25.344-5.888 10.176 0 18.752 1.92 25.472 5.888 6.848 3.968 12.352 8.96 16.64 15.104 4.096 6.208 7.744 12.8 10.624 19.904s6.528 16.576 11.008 28.352l94.656 236.48C718.592 621.056 722.304 634.112 722.304 642.304zM606.912 526.784 552.32 375.552 498.624 526.784 606.912 526.784z"/></svg>'},{key:"mergeAcross",labelKey:"mergeAcross",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M832 64c70.4 0 128 57.6 128 128v640c0 70.4-57.6 128-128 128H192c-70.4 0-128-57.6-128-128V192c0-70.4 57.6-128 128-128h640zM448 768H128v64c0 38.4 25.6 64 64 64h256v-128z m448 0H512v128h320c38.4 0 64-25.6 64-64v-64z m0-448H128v384h768V320zM633.6 390.4l96 96c6.4 6.4 6.4 12.8 6.4 19.2 0 6.4-6.4 12.8-6.4 19.2L633.6 633.6c-12.8 12.8-32 12.8-44.8 0-12.8-12.8-12.8-32-6.4-44.8l44.8-44.8H288c-19.2 0-32-12.8-32-32s12.8-32 32-32h339.2l-44.8-44.8c-6.4-12.8-6.4-32 0-44.8 12.8-12.8 38.4-12.8 51.2 0zM448 128H192c-38.4 0-64 25.6-64 64v64h320V128z m384 0H512v128h384V192c0-38.4-25.6-64-64-64z"/></svg>'},{key:"mergeCells",labelKey:"mergeCells",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M512 480c0 5.376-1.984 10.112-5.952 14.08L354.048 634.048C350.08 638.08 345.344 640 339.968 640s-10.048-1.92-14.08-5.952C321.92 630.144 320 625.344 320 620.032L320 512 224 512C206.336 512 192 497.664 192 480S206.336 448 224 448L320 448 320 339.968c0-5.376 1.92-10.048 5.952-14.08C329.92 321.984 334.656 320 339.968 320s10.048 1.984 14.08 5.952L506.048 465.92C510.016 469.952 512 474.624 512 480zM576 480c0 5.376 1.984 10.112 5.952 14.08l152 140.032C737.92 638.08 742.656 640 748.032 640s10.048-1.92 14.08-5.952C766.08 630.144 768 625.344 768 620.032L768 512l96 0C881.664 512 896 497.664 896 480S881.664 448 864 448L768 448 768 339.968c0-5.376-1.92-10.048-5.952-14.08C758.08 321.984 753.344 320 748.032 320s-10.048 1.984-14.08 5.952L581.952 465.92C577.984 469.952 576 474.624 576 480zM448 128l0 128 64 0L512 128c0-35.392-28.672-64-64-64l0 0L128 64C92.672 64 64 92.608 64 128l0 704c0 35.392 28.672 64 64 64l320 0c35.328 0 64-28.608 64-64l0-128L448 704l0 128L128 832 128 128 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128"/></svg>'},{key:"unmergeCells",labelKey:"unmergeCells",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M197.952 465.92l152-140.032C353.92 321.984 358.656 320 364.032 320s10.048 1.984 14.08 5.952C382.08 329.92 384 334.656 384 339.968L384 448l96 0C497.664 448 512 462.336 512 480S497.664 512 480 512L384 512l0 108.032c0 5.376-1.92 10.112-5.952 14.08C374.08 638.08 369.344 640 364.032 640S353.92 638.08 349.952 634.048L197.952 494.08C193.984 490.112 192 485.376 192 480S193.984 469.952 197.952 465.92zM890.048 465.92l-152-140.032C734.08 321.984 729.344 320 723.968 320s-10.048 1.984-14.08 5.952C705.92 329.92 704 334.656 704 339.968L704 448 608 448C590.336 448 576 462.336 576 480S590.336 512 608 512L704 512l0 108.032c0 5.376 1.92 10.112 5.952 14.08C713.92 638.08 718.656 640 723.968 640s10.048-1.92 14.08-5.952l152-140.032C894.016 490.112 896 485.376 896 480S894.016 469.952 890.048 465.92zM448 128l0 128 64 0L512 128c0-35.392-28.608-64-64-64l0 0L128 64C92.608 64 64 92.608 64 128l0 704c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64l0-128L448 704l0 128L128 832 128 128 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128"/></svg>'}],Br={bg:"#f4f4f4",gridBg:"#ffffff",headerBg:"#e8e8e8",headerBorder:"#c8c8c8",headerText:"#444",headerSep:"#b0b0b0",cornerBg:"#e0e0e0",gridLine:"#e0e0e0",selectionBg:"rgba(0, 120, 215, 0.12)",activeCellBorder:"#0078d7",cellText:"#1a1a1a",scrollTrack:"rgba(0,0,0,0.08)",scrollThumb:"rgba(0,0,0,0.25)",formulaBarBg:"#f0f0f0",formulaBarBorder:"#c8c8c8",formulaBarLabelText:"#333",formulaBarLabelBg:"#fff",formulaBarLabelBorder:"#c0c0c0",formulaBarInputBg:"#fff",formulaBarInputBorder:"#c0c0c0",formulaBarInputText:"#1a1a1a",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.3)",wrapperBg:"#e8e8e8",cellEditorBorder:"#0078d7",cellEditorText:"#1a1a1a",cellEditorBg:"#fff",cellEditorShadow:"#0078d7",tabBarBg:"#e8e8e8",tabBarBorder:"#c0c0c0",tabActiveBg:"#ffffff",tabActiveText:"#1a1a1a",tabActiveBorder:"#0078d7",tabInactiveBg:"#dfdfdf",tabInactiveText:"#666",tabInactiveBorder:"transparent",tabHoverBg:"#e0e0e0",tabAddBtnColor:"#555",tabAddBtnHoverBg:"#d0d0d0",tabScrollBtnColor:"#888",tabScrollBtnHoverBg:"#d0d0d0",scrollbarThumb:"rgba(0,0,0,0.25)",scrollbarThumbHover:"rgba(0,0,0,0.4)",scrollBtnBg:"#e8e8e8",scrollBtnColor:"#666",scrollBtnHoverBg:"#d0d0d0",scrollBtnActiveBg:"#c0c0c0",scrollTrackBg:"rgba(0,0,0,0.06)",toolbarBg:"#f7f7f7",toolbarBorder:"#d8d8d8",toolbarBtnColor:"#444",toolbarBtnHoverBg:"#e6e6e6",toolbarBtnDisabledColor:"#b0b0b0",toolbarBtnActiveColor:"#0078d7",findMatchBg:"rgba(255, 213, 79, 0.45)",findActiveBg:"rgba(255, 179, 0, 0.75)"},Tr={bg:"#1e1e1e",gridBg:"#252526",headerBg:"#252525",headerBorder:"#3e3e3e",headerText:"#999",headerSep:"#3e3e3e",cornerBg:"#2a2a2a",gridLine:"#3e3e3e",selectionBg:"rgba(0, 120, 215, 0.25)",activeCellBorder:"#0078d7",cellText:"#d4d4d4",scrollTrack:"rgba(255,255,255,0.06)",scrollThumb:"rgba(255,255,255,0.2)",formulaBarBg:"#2d2d2d",formulaBarBorder:"#3e3e3e",formulaBarLabelText:"#ccc",formulaBarLabelBg:"#3c3c3c",formulaBarLabelBorder:"#555",formulaBarInputBg:"#3c3c3c",formulaBarInputBorder:"#555",formulaBarInputText:"#d4d4d4",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.4)",wrapperBg:"#1e1e1e",cellEditorBorder:"#0078d7",cellEditorText:"#d4d4d4",cellEditorBg:"#3c3c3c",cellEditorShadow:"#0078d7",tabBarBg:"#2a2a2a",tabBarBorder:"#3e3e3e",tabActiveBg:"#1e1e1e",tabActiveText:"#e0e0e0",tabActiveBorder:"#0078d7",tabInactiveBg:"#333333",tabInactiveText:"#888",tabInactiveBorder:"transparent",tabHoverBg:"#3a3a3a",tabAddBtnColor:"#999",tabAddBtnHoverBg:"#3a3a3a",tabScrollBtnColor:"#777",tabScrollBtnHoverBg:"#3a3a3a",scrollbarThumb:"rgba(255,255,255,0.2)",scrollbarThumbHover:"rgba(255,255,255,0.35)",scrollBtnBg:"#2d2d2d",scrollBtnColor:"#999",scrollBtnHoverBg:"#3d3d3d",scrollBtnActiveBg:"#4d4d4d",scrollTrackBg:"rgba(255,255,255,0.05)",toolbarBg:"#2a2a2a",toolbarBorder:"#3e3e3e",toolbarBtnColor:"#ccc",toolbarBtnHoverBg:"#3a3a3a",toolbarBtnDisabledColor:"#666",toolbarBtnActiveColor:"#4ea1ff",findMatchBg:"rgba(255, 213, 79, 0.35)",findActiveBg:"rgba(255, 179, 0, 0.6)"},$l="__nf_custom__",Bl="",Wl="",ul="@",Gn="__NF_INVALID__",oo=2958465,ro=0;function dl(e){return e==null||e===""?!0:e.toUpperCase()==="GENERAL"}function ao(e){return e==="zh-CN"?"¥":"$"}function Dr(e){return e.replace(/\*/g,"").replace(/_.|_\b/g,"")}function So(e){return e.replace(/"([^"]*)"/g,"$1")}function Nr(e){let l=e,o;const n=l.match(/^\[([^\]]+)\]/);n&&(o=n[1].toLowerCase(),l=l.slice(n[0].length)),l=Dr(l);const a=/E[+-]/i.test(l),i=l.includes("%"),r=l.search(/[0#?]/);if(r===-1)return{hasDigits:!1,decimals:0,minDecimals:0,minIntDigits:0,thousands:!1,scale:i?100:1,scientific:!1,prefix:l,suffix:"",color:o};let f=-1;for(let q=l.length-1;q>=0;q--){const se=l[q];if(se==="0"||se==="#"||se==="?"||se==="E"){f=q;break}}f<0&&(f=r);const m=r>0?l.slice(0,r):"",y=f<l.length-1?l.slice(f+1):"",k=l.slice(r,f+1),d=/[0#?]/.test(k),w=k.includes(",");let R=k.replace(/,/g,"");if(a){const q=R.search(/E/i);q>=0&&(R=R.slice(0,q))}const G=R.indexOf("."),te=G>=0?R.slice(0,G):R,Y=G>=0?R.slice(G+1):"",K=(Y.match(/[0#?]/g)||[]).length,C=(Y.match(/0/g)||[]).length,j=(te.match(/0/g)||[]).length;return{hasDigits:d,decimals:K,minDecimals:C,minIntDigits:j,thousands:w,scale:i?100:1,scientific:a,prefix:m,suffix:y,color:o}}function Fr(e){const l=[];let o=!1;const n=/\[h\]|\[mm\]|\[ss\]|yyyy|yy|y|mmmm|mmm|mm|m|dddd|ddd|dd|d|hh|h|ss|s|AM\/PM|am\/pm|"[^"]*"|\/|-|:|\s+|[^\s]/g;let a;for(;(a=n.exec(e))!==null;){const i=a[0];switch(i){case"[h]":o=!0,l.push({type:"hour",len:0});break;case"[mm]":o=!0,l.push({type:"minute",len:2});break;case"[ss]":o=!0,l.push({type:"second",len:2});break;case"yyyy":l.push({type:"year",len:4});break;case"yy":case"y":l.push({type:"year",len:2});break;case"mmmm":l.push(o?{type:"minute",len:4}:{type:"monthName",len:4});break;case"mmm":l.push(o?{type:"minute",len:3}:{type:"monthName",len:3});break;case"mm":l.push(o?{type:"minute",len:2}:{type:"month",len:2});break;case"m":l.push(o?{type:"minute",len:1}:{type:"month",len:1});break;case"dddd":l.push({type:"weekday",len:4});break;case"ddd":l.push({type:"weekday",len:3});break;case"dd":l.push({type:"day",len:2});break;case"d":l.push({type:"day",len:1});break;case"hh":l.push({type:"hour",len:2});break;case"h":l.push({type:"hour",len:1});break;case"ss":l.push({type:"second",len:2});break;case"s":l.push({type:"second",len:1});break;case"AM/PM":case"am/pm":l.push({type:"ampm",len:2});break;default:i.startsWith('"')?l.push({type:"literal",text:So(i),len:0}):l.push({type:"literal",text:i,len:0})}}return{tokens:l,isDuration:o}}const Ro=new Map;function Ir(e){const l=e.replace(/\[[^\]]*\]/gi,i=>/^\[(h|mm|ss)\]$/i.test(i)?i:"");if(/[ydhs]/.test(l)||/AM\/PM/i.test(l)||/\[h\]/i.test(l)){const i=e.split(";")[0]??e,{tokens:r,isDuration:f}=Fr(i);return{kind:f?"duration":"date",sections:[],tokens:r,isDuration:f,raw:e}}return{kind:"number",sections:e.split(";").map(i=>Nr(i)),tokens:[],isDuration:!1,raw:e}}function Pl(e){const l=Ro.get(e);if(l)return l;const o=Ir(e);return Ro.set(e,o),o}function Mo(e,l,o,n,a){const i=Math.pow(10,l),r=Math.round((e+Number.EPSILON)*i)/i,f=r<0,m=Math.abs(r);let k=new Intl.NumberFormat("en-US",{useGrouping:n,minimumIntegerDigits:a,minimumFractionDigits:l,maximumFractionDigits:l}).format(m);if(o<l&&l>0){const w=k.indexOf(".");if(w>=0){const v=k.substring(0,w);let R=k.substring(w+1);R=R.replace(/0+$/,""),R.length<o&&(R=R+"0".repeat(o-R.length)),k=R?`${v}.${R}`:v}}return`${f?"-":""}${k}`}function xo(e,l){if(e===0)return(l>0?"0."+"0".repeat(l):"0")+"E+00";const o=Math.floor(Math.log10(Math.abs(e))),n=e/Math.pow(10,o),a=Mo(n,l,l,!1,1),i=(o>=0?"+":"-")+String(Math.abs(o)).padStart(2,"0");return`${a}E${i}`}function Ar(e,l,o){if(!o.hasDigits)return So(o.prefix+o.suffix);const n=o.scale===100?e*100:e,a=o.scientific?xo(n,o.decimals):Mo(n,o.decimals,o.minDecimals,o.thousands,o.minIntDigits);return l+o.prefix+a+o.suffix}function Vr(e,l){const o=l.sections;if(o.length===0)return String(e);let n,a,i="";return e>0?(n=o[0],a=e):e<0?o[1]?(n=o[1],a=-e):(n=o[0],a=-e,i="-"):(n=o[2]??o[0],a=0),Ar(a,i,n)}function Hr(e){return new Date((e-25569)*864e5)}const Or=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],Lr=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],Bo=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],zr=["January","February","March","April","May","June","July","August","September","October","November","December"],_r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],To=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Tn(e,l){return String(e).padStart(l,"0")}function $r(e,l,o,n){const a=e.getUTCFullYear(),i=e.getUTCMonth()+1,r=e.getUTCDate(),f=e.getUTCDay(),m=o==="zh-CN";let y="",k=!1;for(const d of l)switch(d.type){case"literal":y+=d.text??"";break;case"year":y+=d.len>=4?String(a):String(a%100).padStart(2,"0");break;case"month":y+=Tn(k?e.getUTCMinutes():i,d.len);break;case"monthName":y+=d.len>=4?m?Or[i-1]:zr[i-1]:m?Lr[i-1]:_r[i-1];break;case"day":y+=Tn(r,d.len);break;case"weekday":y+=d.len>=4?m?Bo[f]:To[f]:m?Bo[f].slice(2):To[f].slice(0,3);break;case"hour":{let w=e.getUTCHours();if(d.len===0){const v=Math.floor(n*86400);w=Math.floor(v/3600)}y+=String(w),k=!0;break}case"minute":y+=Tn(e.getUTCMinutes(),d.len);break;case"second":y+=Tn(e.getUTCSeconds(),d.len);break;case"ampm":{const w=e.getUTCHours();y+=w<12?m?"上午":"AM":m?"下午":"PM";break}}return y}function Wr(e,l){const o=Math.floor(e*86400),n=Math.floor(o/3600),a=Math.floor(o%3600/60),i=o%60;let r="";for(const f of l)switch(f.type){case"literal":r+=f.text??"";break;case"hour":r+=String(n);break;case"minute":r+=Tn(a,f.len||2);break;case"second":r+=Tn(i,f.len||2);break;default:r+=""}return r}function Pr(e){if(e==="")return e;const l=Number(e);if(!isNaN(l)&&e.trim()!==""){const o=Math.abs(l);return o!==0&&(o>=1e15||o<1e-9)?xo(l,9):e}return e}function bl(e,l,o){if(dl(l))return Pr(e);if(l==null||l===ul)return e;const n=Pl(l);if(n.kind==="date"||n.kind==="duration"){const i=Number(e);if(!isFinite(i))return e;if(n.kind==="date"){if(i<ro||i>oo)return Gn}else if(i<0)return Gn;return n.kind==="duration"?Wr(i,n.tokens):$r(Hr(i),n.tokens,o,i)}const a=Number(e);return isNaN(a)?e:Vr(a,n)}const Ur=["general","text","number","percent","scientific","accounting","financial","currency","currencyRounded","date","time","dateTime","duration","custom"];function io(e,l){if(l===ul||l==="@")return!1;if(dl(l)){if(e==null||e===""||e.trim()==="")return!1;const n=Number(e);return!Number.isNaN(n)&&Number.isFinite(n)}const o=Pl(l);return!!(o.kind==="number"&&Do(o))}function Do(e){return e.sections.some(l=>l.hasDigits)}function No(e){if(e==null||dl(e)||e===ul||e==="@")return!1;const l=Pl(e);return!!(l.kind==="date"||l.kind==="duration"||l.kind==="number"&&Do(l))}function Fo(e,l){if(l==null||dl(l)||l===ul||l==="@")return!1;const o=Pl(l),n=Number(e);return Number.isFinite(n)?o.kind==="date"?n<ro||n>oo:o.kind==="duration"?n<0:!1:!1}const co=30,so=0;function Ul(e){if(e==null||e===""||e.trim()==="")return!1;const l=Number(e);return!Number.isNaN(l)&&Number.isFinite(l)}function Io(e,l){if(e==null||e===Bl||dl(e))return Ul(l);if(e===ul)return!1;const o=Pl(e);return o.kind==="date"||o.kind==="duration"?!1:o.sections.some(n=>n.hasDigits)}function Kr(e){if(!Ul(e))return 0;const l=String(Number(e));return l.indexOf(".")<0||/e/i.test(l)?0:l.slice(l.indexOf(".")+1).length}function Gr(e,l){if(!Io(e,l))return-1;if(e==null||e===Bl||dl(e))return Kr(l);const n=Pl(e).sections.find(a=>a.hasDigits);return n?n.decimals:-1}function Yr(e,l){let o=0;const n=/\[[^\]]*\]/g;let a;for(;(a=n.exec(e))!==null&&!/^\[(h|mm|ss)\]$/i.test(a[0]);)o=a.index+a[0].length;const i=e.slice(0,o),r=e.slice(o),f=r.search(/[0#?]/);if(f===-1)return e;let m=-1;for(let te=r.length-1;te>=0;te--){const Y=r[te];if(Y==="0"||Y==="#"||Y==="?"||Y==="E"){m=te;break}}if(m<f)return e;const y=r.slice(f,m+1),k=y.search(/E[+-]/i),d=k>=0?y.slice(0,k):y,w=d.indexOf("."),v=w>=0?(d.slice(w+1).match(/[0#?]/g)||[]).length:0;if(v===l)return e;let R;if(w<0)R=l>0?d+"."+"0".repeat(l):d;else if(l>v)R=d+"0".repeat(l-v);else{let te=v-l;const Y=d.split("");for(let K=Y.length-1;K>=0&&te>0;K--){const C=Y[K];(C==="0"||C==="#"||C==="?")&&(Y.splice(K,1),te--)}R=Y.join(""),l===0&&R.endsWith(".")&&(R=R.slice(0,-1))}const G=R+(k>=0?y.slice(k):"");return i+r.slice(0,f)+G+r.slice(m+1)}function Xr(e,l){if(!Number.isInteger(l)||l<so||l>co||e===Bl)return null;if(e==null||dl(e))return l>0?"0."+"0".repeat(l):"0";if(e===ul)return null;const o=Pl(e);return o.kind==="date"||o.kind==="duration"||!o.sections.some(n=>n.hasDigits)?null:e.split(";").map(n=>Yr(n,l)).join(";")}const uo=["¥","$","€","£"];function Ao(e,l){if(e==null||e===Bl)return e??Wl;if(dl(e))return Wl;if(e===ul||e==="@")return ul;const o=ao(l),n=l==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy",a=l==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss",i=`${o}#,##0.00;(${o}#,##0.00);${o}"-"`,r="#,##0.00;[Red](#,##0.00)";if(Vo(l).some(v=>v.value===e))return e;const m=e.replace(/\[[^\]]*\]/gi,v=>/^\[(h|mm|ss)\]$/i.test(v)?v:"");if(/\[(h|mm|ss)\]/i.test(m)&&!/[yd]/i.test(m))return"[h]:mm:ss";const y=/[yd]/i.test(m),k=/h|s|AM\/PM/i.test(m);if(y&&k)return a;if(y||/AM\/PM/i.test(m))return n;if(k)return"h:mm:ss";if(e.includes("%"))return"0.00%";if(/E[+-]/i.test(e))return"0.00E+00";if(e.includes("[Red]("))return r;const d=uo.find(v=>e.startsWith(v));if(d)return e.includes("(")?i:/\.\d/.test(e.slice(d.length))?o+"#,##0.00":o+"#,##0";const w=Pl(e);return w.kind==="number"&&w.sections.some(v=>v.hasDigits)?"#,##0.00":$l}function jr(e,l){return new Date(Date.UTC(e,l,0)).getUTCDate()}function Zr(e,l,o){const n=Date.UTC(e,l-1,o)/864e5+25569;return n<=60?n-1:n}function Dn(e,l,o=new Date){const n=e.trim();if(!n||n.startsWith("=")||Ul(n))return null;const a=l==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy",i=l==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss",r="h:mm:ss";function f(w){const v=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(w);if(!v)return null;const R=Number(v[1]),G=Number(v[2]),te=v[3]!==void 0?Number(v[3]):0;return R>23||G>59||te>59?null:(R*3600+G*60+te)/86400}function m(w){let v=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/.exec(w),R,G,te;if(v)R=Number(v[1]),G=Number(v[2]),te=Number(v[3]);else if(v=/^(\d{4})年(\d{1,2})月(\d{1,2})日$/.exec(w))R=Number(v[1]),G=Number(v[2]),te=Number(v[3]);else if(v=/^(\d{1,2})[-/](\d{1,2})$/.exec(w))R=o.getUTCFullYear(),G=Number(v[1]),te=Number(v[2]);else return null;if(R<1900||R>9999||G<1||G>12||te<1||te>jr(R,G))return null;const Y=Zr(R,G,te);return Y>=ro&&Y<=oo?Y:null}const y=f(n);if(y!==null)return{serial:y,format:r};const k=/^(.+?)[T ](\d{1,2}:\d{1,2}(?::\d{1,2})?)$/.exec(n);if(k){const w=m(k[1].trim()),v=f(k[2]);if(w!==null&&v!==null)return{serial:w+v,format:i}}const d=m(n);return d!==null?{serial:d,format:a}:null}function qr(e,l){const o=e.trim();if(!o||o.startsWith("=")||!(o.includes(",")||o.includes("%")||uo.some(K=>o.startsWith(K)))||Dn(o,l))return null;const a=uo.find(K=>o.startsWith(K)),i=a?o.slice(a.length).trim():o;if(!i)return null;const r=/^([+-]?)(\d{1,3}(?:,\d{3})+)(?:\.(\d+))?(%?)$/.exec(i)||/^([+-]?)(\d+)(?:\.(\d+))?(%?)$/.exec(i);if(!r)return null;const f=r[1]==="-"?-1:1,m=r[2].replace(/,/g,""),y=r[3],k=(r[4]??"")==="%",d=y?y.length:0,w=+(m+(y?"."+y:""));if(!Number.isFinite(w))return null;const R=i.includes(",")?"#,##0":"0",G=d>0?"."+"0".repeat(d):"",te=(a??"")+R+G+(k?"%":"");let Y=w*f;return k&&(Y=Y/100),Y=Math.round(Y*1e12)/1e12,{num:Y,format:te}}function Jr(e,l,o,n){const a=ao(e),i=n?"#,##0":"0",r=o>0?"."+"0".repeat(o):"",f=i+r;switch(l){case"general":return"";case"text":return ul;case"custom":return"";case"number":return f;case"percent":return f+"%";case"scientific":return"0."+"0".repeat(o)+"E+00";case"currency":return a+f;case"currencyRounded":return a+(n?"#,##0":"0");case"accounting":return`${a}${f};(${a}${f});${a}"-"`;case"financial":return`${f};[Red](${f})`;case"date":return e==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy";case"time":return"h:mm:ss";case"dateTime":return e==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss";case"duration":return"[h]:mm:ss";default:return""}}function Vo(e){const l=ao(e);return[{label:D(e,"nfGeneral"),value:Wl},{label:D(e,"nfText"),value:ul},{label:D(e,"nfNumber"),value:"#,##0.00"},{label:D(e,"nfPercent"),value:"0.00%"},{label:D(e,"nfScientific"),value:"0.00E+00"},{label:D(e,"nfAccounting"),value:`${l}#,##0.00;(${l}#,##0.00);${l}"-"`},{label:D(e,"nfFinancial"),value:"#,##0.00;[Red](#,##0.00)"},{label:D(e,"nfCurrency"),value:l+"#,##0.00"},{label:D(e,"nfCurrencyRounded"),value:l+"#,##0"},{label:D(e,"nfDate"),value:e==="zh-CN"?'yyyy"年"m"月"d"日"':"m/d/yyyy"},{label:D(e,"nfTime"),value:"h:mm:ss"},{label:D(e,"nfDateTime"),value:e==="zh-CN"?'yyyy"年"m"月"d"日" h:mm:ss':"m/d/yyyy h:mm:ss"},{label:D(e,"nfDuration"),value:"[h]:mm:ss"},{label:D(e,"nfCustom"),value:$l}]}const Qr=["title"],ea=["innerHTML"],ta={key:1,class:"sp-dropdown__value"},la=["disabled"],na=["placeholder"],oa=["onClick"],ra=["innerHTML"],aa={class:"sp-dropdown__item-label"},ia={key:2,class:"sp-dropdown__empty"},ca=["disabled"],sa=t.defineComponent({__name:"dropdown",props:{modelValue:{},options:{},width:{default:"auto"},menuWidth:{default:void 0},visibleCount:{default:8},title:{default:""},modelOpen:{type:Boolean,default:void 0},hideTrigger:{type:Boolean,default:!1},align:{default:"left"},triggerEl:{default:null},fallbackLabel:{default:""},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:""},triggerIcon:{default:""}},emits:["update:modelValue","change","update:modelOpen"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref(0),r=t.ref(null),f=t.ref(null),m=t.ref(null),y=t.ref({top:0,up:!1}),k=t.ref(void 0),d=t.ref(0),w=t.ref(!1),v=t.ref(""),R=t.ref(null),G=t.computed(()=>o.options.find(g=>String(g.value)===String(o.modelValue))),te=t.computed(()=>o.menuWidth!==void 0?o.menuWidth:k.value),Y=t.computed(()=>{if(!o.searchable||!v.value.trim())return o.options;const g=v.value.trim().toLowerCase();return o.options.filter(A=>String(A.label??"").toLowerCase().includes(g))}),K=t.computed(()=>Y.value.length>0),C=t.computed(()=>Math.min(o.visibleCount,Y.value.length)),j=t.computed(()=>Y.value.slice(i.value,i.value+C.value)),q=t.computed(()=>i.value>0),se=t.computed(()=>i.value+C.value<Y.value.length),Fe=t.computed(()=>Y.value.length>C.value);function Qe(g){i.value=Math.max(0,Math.min(Y.value.length-C.value,i.value+g))}function Ge(){a.value=!0,o.searchable&&(v.value=""),o.modelOpen!==void 0&&n("update:modelOpen",!0);const g=o.triggerEl??r.value;if(!g)return;const A=g.getBoundingClientRect();k.value=A.width;const L=C.value*22+(Fe.value?2*15:0)+8+(o.searchable?34:0),ee=window.innerHeight-A.bottom-4<L&&A.top-4>L;o.align==="right"?y.value={right:window.innerWidth-A.right,top:ee?A.top-L-4:A.bottom+4,up:ee}:y.value={left:A.left,top:ee?A.top-L-4:A.bottom+4,up:ee};const ie=Y.value.findIndex(re=>String(re.value)===String(o.modelValue));i.value=ie>=0?Math.max(0,Math.min(ie-Math.floor(C.value/2),Y.value.length-C.value)):0,o.searchable&&t.nextTick(()=>{var re;return(re=R.value)==null?void 0:re.focus()})}function be(){a.value=!1,v.value="",o.modelOpen!==void 0&&n("update:modelOpen",!1)}function ve(){a.value?be():Ge()}function Xe(g){n("update:modelValue",g.value),n("change",g.value),be()}function Je(g){var L,$;if(!a.value)return;const A=g.target;(L=r.value)!=null&&L.contains(A)||($=m.value)!=null&&$.contains(A)||be()}function gt(g){a.value&&(g.preventDefault(),Qe(g.deltaY>0?1:-1))}t.watch(a,g=>{t.nextTick(()=>{var A,L;g?((A=f.value)==null||A.addEventListener("wheel",gt,{passive:!1}),document.addEventListener("keydown",Ze)):((L=f.value)==null||L.removeEventListener("wheel",gt),document.removeEventListener("keydown",Ze))})});function Ze(g){a.value&&g.key==="Escape"&&be()}t.watch(()=>o.modelOpen,g=>{g!==void 0&&g!==a.value&&(g?Ge():be())});function lt(g){a.value&&(d.value=g.touches[0].clientY,w.value=!0)}function et(g){if(!a.value||!w.value)return;const A=g.touches[0].clientY-d.value;Math.abs(A)>5&&(Qe(A<0?1:-1),d.value=g.touches[0].clientY)}function oe(){w.value=!1}function pe(g){g.key==="Escape"&&(g.stopPropagation(),be())}return t.onMounted(()=>{document.addEventListener("pointerdown",Je),window.addEventListener("resize",be),window.addEventListener("scroll",be,!0)}),t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",Je),document.removeEventListener("keydown",Ze),window.removeEventListener("resize",be),window.removeEventListener("scroll",be,!0)}),(g,A)=>{var L,$,ee;return t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"sp-dropdown",style:t.normalizeStyle(typeof e.width=="number"?{width:e.width+"px"}:{width:e.width})},[e.hideTrigger?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["sp-dropdown__trigger",{"sp-dropdown__trigger--open":a.value}]),title:e.title,onClick:ve},[(L=G.value)!=null&&L.icon||e.triggerIcon?(t.openBlock(),t.createElementBlock("span",{key:0,class:"sp-dropdown__icon",innerHTML:(($=G.value)==null?void 0:$.icon)||e.triggerIcon},null,8,ea)):(t.openBlock(),t.createElementBlock("span",ta,t.toDisplayString(((ee=G.value)==null?void 0:ee.label)??e.fallbackLabel),1)),A[5]||(A[5]=t.createElementVNode("svg",{class:"sp-dropdown__caret",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1))],10,Qr)),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:m,class:t.normalizeClass(["sp-dropdown__menu",{"sp-dropdown__menu--up":y.value.up}]),style:t.normalizeStyle({left:y.value.left!==void 0?y.value.left+"px":void 0,right:y.value.right!==void 0?y.value.right+"px":void 0,top:y.value.top+"px",minWidth:te.value!==void 0?typeof te.value=="number"?te.value+"px":te.value:void 0}),onKeydown:pe,onMousedown:A[4]||(A[4]=t.withModifiers(()=>{},["prevent"]))},[Fe.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["sp-dropdown__nav",{"sp-dropdown__nav--disabled":!q.value}]),disabled:!q.value,onClick:A[0]||(A[0]=ie=>Qe(-1))},[...A[6]||(A[6]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z"})],-1)])],10,la)):t.createCommentVNode("",!0),e.searchable?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,ref_key:"searchInputRef",ref:R,"onUpdate:modelValue":A[1]||(A[1]=ie=>v.value=ie),class:"sp-dropdown__search",type:"text",placeholder:e.searchPlaceholder,onMousedown:A[2]||(A[2]=t.withModifiers(()=>{},["stop"]))},null,40,na)),[[t.vModelText,v.value]]):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"listRef",ref:f,class:"sp-dropdown__list",onTouchstart:lt,onTouchmove:et,onTouchend:oe},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.value,ie=>(t.openBlock(),t.createElementBlock("button",{key:String(ie.value),type:"button",class:t.normalizeClass(["sp-dropdown__item",{"sp-dropdown__item--active":String(ie.value)===String(e.modelValue)}]),onClick:re=>Xe(ie)},[ie.icon?(t.openBlock(),t.createElementBlock("span",{key:0,class:"sp-dropdown__item-icon",innerHTML:ie.icon},null,8,ra)):t.createCommentVNode("",!0),t.createElementVNode("span",aa,t.toDisplayString(ie.label),1)],10,oa))),128))],544),e.searchable&&!K.value?(t.openBlock(),t.createElementBlock("div",ia," 无匹配 ")):t.createCommentVNode("",!0),Fe.value?(t.openBlock(),t.createElementBlock("button",{key:3,type:"button",class:t.normalizeClass(["sp-dropdown__nav",{"sp-dropdown__nav--disabled":!se.value}]),disabled:!se.value,onClick:A[3]||(A[3]=ie=>Qe(1))},[...A[7]||(A[7]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],10,ca)):t.createCommentVNode("",!0)],38)):t.createCommentVNode("",!0)]),_:1})]))],4)}}}),tl=(e,l)=>{const o=e.__vccOpts||e;for(const[n,a]of l)o[n]=a;return o},ll=tl(sa,[["__scopeId","data-v-804e629f"]]),ua=["title","onClick"],Ho=tl(t.defineComponent({__name:"colorPicker",props:{modelOpen:{type:Boolean,default:void 0},colorKey:{default:"text"},currentColor:{default:""},locale:{default:"zh-CN"},triggerEl:{default:null}},emits:["update:modelValue","change","update:modelOpen"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[[{key:"colorAutomatic",value:""},{key:"colorLightBlue",value:"#DEEBF7"},{key:"colorLightOrange",value:"#FCE4D6"},{key:"colorLightYellow",value:"#FFE79A"},{key:"colorLightGreen",value:"#E2EFDA"}],[{key:"colorLightGray",value:"#F2F2F2"},{key:"colorPaleBlue",value:"#BDD7EE"},{key:"colorPaleOrange",value:"#F8CBAD"},{key:"colorPaleYellow",value:"#FFD966"},{key:"colorPaleGreen",value:"#C6EFCE"}],[{key:"colorSilver",value:"#D9D9D9"},{key:"colorSkyBlue",value:"#9BC2E6"},{key:"colorCoral",value:"#F4B183"},{key:"colorGold",value:"#FFC000"},{key:"colorMint",value:"#A9D18E"}],[{key:"colorGray",value:"#BFBFBF"},{key:"colorMediumBlue",value:"#6FA8DC"},{key:"colorOrange",value:"#ED7D31"},{key:"colorAmber",value:"#F1C232"},{key:"colorMediumGreen",value:"#70AD47"}],[{key:"colorDarkGray",value:"#A5A5A5"},{key:"colorRoyalBlue",value:"#4A86E8"},{key:"colorRed",value:"#E06666"},{key:"colorDarkGold",value:"#BF8F00"},{key:"colorDarkGreen",value:"#548235"}],[{key:"colorCharcoal",value:"#808080"},{key:"colorDeepBlue",value:"#2E75B6"},{key:"colorDarkRed",value:"#CC4125"},{key:"colorOlive",value:"#806000"},{key:"colorForest",value:"#375623"}],[{key:"colorSlate",value:"#595959"},{key:"colorNavy",value:"#1F4E79"},{key:"colorCrimson",value:"#993300"},{key:"colorDarkOlive",value:"#5C4500"},{key:"colorDeepForest",value:"#2D6A4F"}],[{key:"colorDarkSlate",value:"#404040"},{key:"colorMidnight",value:"#17375E"},{key:"colorMaroon",value:"#5A1E00"},{key:"colorCoffee",value:"#3D3000"},{key:"colorEvergreen",value:"#1B4332"}],[{key:"colorBlack",value:"#000000"},{key:"colorDarkNavy",value:"#0C2340"},{key:"colorDarkMaroon",value:"#2E0A00"},{key:"colorDarkCoffee",value:"#1F1800"},{key:"colorInkGreen",value:"#081C15"}]],r=[[{key:"colorNoFill",value:""},{key:"colorLightBlue",value:"#DEEBF7"},{key:"colorLightOrange",value:"#FCE4D6"},{key:"colorLightYellow",value:"#FFE79A"},{key:"colorLightGreen",value:"#E2EFDA"}],[{key:"colorWhite",value:"#FFFFFF"},{key:"colorPaleBlue",value:"#BDD7EE"},{key:"colorPaleOrange",value:"#F8CBAD"},{key:"colorPaleYellow",value:"#FFD966"},{key:"colorPaleGreen",value:"#C6EFCE"}],[{key:"colorLightGray",value:"#F2F2F2"},{key:"colorSkyBlue",value:"#9BC2E6"},{key:"colorCoral",value:"#F4B183"},{key:"colorGold",value:"#FFC000"},{key:"colorMint",value:"#A9D18E"}],[{key:"colorSilver",value:"#D9D9D9"},{key:"colorMediumBlue",value:"#6FA8DC"},{key:"colorOrange",value:"#ED7D31"},{key:"colorAmber",value:"#F1C232"},{key:"colorMediumGreen",value:"#70AD47"}],[{key:"colorGray",value:"#BFBFBF"},{key:"colorRoyalBlue",value:"#4A86E8"},{key:"colorRed",value:"#E06666"},{key:"colorDarkGold",value:"#BF8F00"},{key:"colorDarkGreen",value:"#548235"}],[{key:"colorDarkGray",value:"#A5A5A5"},{key:"colorDeepBlue",value:"#2E75B6"},{key:"colorDarkRed",value:"#CC4125"},{key:"colorOlive",value:"#806000"},{key:"colorForest",value:"#375623"}],[{key:"colorCharcoal",value:"#808080"},{key:"colorNavy",value:"#1F4E79"},{key:"colorCrimson",value:"#993300"},{key:"colorDarkOlive",value:"#5C4500"},{key:"colorDeepForest",value:"#2D6A4F"}],[{key:"colorSlate",value:"#595959"},{key:"colorMidnight",value:"#17375E"},{key:"colorMaroon",value:"#5A1E00"},{key:"colorCoffee",value:"#3D3000"},{key:"colorEvergreen",value:"#1B4332"}],[{key:"colorDarkSlate",value:"#404040"},{key:"colorDarkNavy",value:"#0C2340"},{key:"colorDarkMaroon",value:"#2E0A00"},{key:"colorDarkCoffee",value:"#1F1800"},{key:"colorInkGreen",value:"#081C15"}]],f=t.computed(()=>n.colorKey==="fill"?r:i);function m(K){return D(n.locale,K)}function y(K){const C=n.currentColor;return!C&&!K?!0:C?C.toLowerCase()===K.toLowerCase():!1}const k=t.ref(!1),d=t.ref(null),w=t.ref(null),v=t.ref({top:0});t.watch(()=>n.modelOpen,K=>{K!==void 0&&K!==k.value&&(K?G():te())});function R(K){const C=d.value,j=w.value,q=K.target;C&&C.contains(q)||j&&j.contains(q)||te()}function G(){k.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const K=n.triggerEl??d.value;if(K){const C=K.getBoundingClientRect(),j=150,q=120;let se=window.innerWidth-C.right,Fe=C.bottom+4,Qe;C.left-q<4&&(se=void 0,Qe=Math.max(4,C.left)),Fe+j>window.innerHeight-4&&(Fe=C.top-j-4),Fe<4&&(Fe=4),v.value=se!==void 0?{right:se,top:Fe}:{left:Qe,top:Fe}}document.addEventListener("pointerdown",R)})}function te(){k.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",R)}function Y(K){a("update:modelValue",K),a("change",K),te()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",R)}),l({open:k,openMenu:G,close:te}),(K,C)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:d,class:"color-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:w,class:"color-picker__menu",style:t.normalizeStyle({left:v.value.left!==void 0?v.value.left+"px":void 0,right:v.value.right!==void 0?v.value.right+"px":void 0,top:v.value.top+"px"}),onMousedown:C[0]||(C[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,(j,q)=>(t.openBlock(),t.createElementBlock("div",{key:q,class:"color-picker__row"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j,se=>(t.openBlock(),t.createElementBlock("button",{key:se.value,class:t.normalizeClass(["color-picker__swatch",{"color-picker__swatch--selected":y(se.value)}]),title:m(se.key),style:t.normalizeStyle({background:se.value||"transparent",border:se.value?"1px solid rgba(0,0,0,0.15)":"1px dashed #999"}),onClick:Fe=>Y(se.value)},null,14,ua))),128))]))),128))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-70f3dfdc"]]),da=["title","onClick"],fa={viewBox:"0 0 30 30",class:"border-picker__icon"},ma=["x1","y1","x2","y2","stroke-width","stroke-dasharray","stroke-linecap"],pa={class:"border-picker__label"},ha=tl(t.defineComponent({__name:"borderPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},currentBorder:{default:"none"},triggerEl:{default:null}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[{key:"bottom",i18nKey:"borderBottom"},{key:"top",i18nKey:"borderTop"},{key:"left",i18nKey:"borderLeft"},{key:"right",i18nKey:"borderRight"},{key:"none",i18nKey:"borderNone"},{key:"all",i18nKey:"borderAll"},{key:"outer",i18nKey:"borderOuter"},{key:"thickOuter",i18nKey:"borderThickOuter"}],r=[{name:"top",x1:4,y1:4,x2:26,y2:4},{name:"bottom",x1:4,y1:26,x2:26,y2:26},{name:"left",x1:4,y1:4,x2:4,y2:26},{name:"right",x1:26,y1:4,x2:26,y2:26},{name:"vMid",x1:15,y1:4,x2:15,y2:26},{name:"hMid",x1:4,y1:15,x2:26,y2:15}],f={bottom:["bottom"],top:["top"],left:["left"],right:["right"],none:[],all:["top","bottom","left","right","vMid","hMid"],outer:["top","bottom","left","right"],thickOuter:["top","bottom","left","right"]},m={bottom:[],top:[],left:[],right:[],none:[],all:[],outer:[],thickOuter:["top","bottom","left","right"]};function y(K,C){return m[K].includes(C)?"thick":f[K].includes(C)?"solid":"dashed"}const k=t.ref(!1),d=t.ref(null),w=t.ref(null),v=t.ref({top:0});t.watch(()=>n.modelOpen,K=>{K!==void 0&&K!==k.value&&(K?G():te())});function R(K){const C=d.value,j=w.value,q=K.target;C&&C.contains(q)||j&&j.contains(q)||te()}function G(){k.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const K=n.triggerEl??d.value;if(K){const C=K.getBoundingClientRect(),j=200,q=160;let se=window.innerWidth-C.right,Fe=C.bottom+4,Qe;C.left-q<4&&(se=void 0,Qe=Math.max(4,C.left)),Fe+j>window.innerHeight-4&&(Fe=C.top-j-4),Fe<4&&(Fe=4),v.value=se!==void 0?{right:se,top:Fe}:{left:Qe,top:Fe}}document.addEventListener("pointerdown",R)})}function te(){k.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",R)}function Y(K){a("change",K),te()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",R)}),l({open:k,openMenu:G,close:te}),(K,C)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:d,class:"border-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:w,class:"border-picker__menu",style:t.normalizeStyle({left:v.value.left!==void 0?v.value.left+"px":void 0,right:v.value.right!==void 0?v.value.right+"px":void 0,top:v.value.top+"px"}),onMousedown:C[0]||(C[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,j=>t.createElementVNode("button",{key:j.key,class:"border-picker__item",title:t.unref(D)(e.locale,j.i18nKey),onClick:q=>Y(j.key)},[(t.openBlock(),t.createElementBlock("svg",fa,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,q=>t.createElementVNode("line",{key:q.name,x1:q.x1,y1:q.y1,x2:q.x2,y2:q.y2,stroke:"currentColor","stroke-width":y(j.key,q.name)==="thick"?3:1.5,"stroke-dasharray":y(j.key,q.name)==="dashed"?"0 4":"none","stroke-linecap":y(j.key,q.name)==="dashed"?"round":"square"},null,8,ma)),64))])),t.createElementVNode("span",pa,t.toDisplayString(t.unref(D)(e.locale,j.i18nKey)),1)],8,da)),64))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-551c0ffe"]]),ga=["title","onClick"],ya={viewBox:"0 0 1024 1024",class:"sort-picker__icon",fill:"none",stroke:"currentColor","stroke-width":"64","stroke-linecap":"round","stroke-linejoin":"round"},ba=["x1","y1","x2","y2"],Ca=["d"],wa={class:"sort-picker__label"},va=tl(t.defineComponent({__name:"sortPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},currentSort:{default:"asc"},triggerEl:{default:null}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[{key:"asc",i18nKey:"sortAsc"},{key:"desc",i18nKey:"sortDesc"}],r=[{name:"bar1",x1:96,y1:224,x2:352,y2:224},{name:"bar2",x1:96,y1:512,x2:512,y2:512},{name:"bar3",x1:96,y1:800,x2:672,y2:800}],f={asc:"M832 800V288M672 448l160-160 160 160",desc:"M832 224v512M672 576l160 160 160-160"},m=t.ref(!1),y=t.ref(null),k=t.ref(null),d=t.ref({top:0});t.watch(()=>n.modelOpen,te=>{te!==void 0&&te!==m.value&&(te?v():R())});function w(te){const Y=y.value,K=k.value,C=te.target;Y&&Y.contains(C)||K&&K.contains(C)||R()}function v(){m.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const te=n.triggerEl??y.value;if(te){const Y=te.getBoundingClientRect(),K=84,C=160;let j=window.innerWidth-Y.right,q=Y.bottom+4,se;Y.left-C<4&&(j=void 0,se=Math.max(4,Y.left)),q+K>window.innerHeight-4&&(q=Y.top-K-4),q<4&&(q=4),d.value=j!==void 0?{right:j,top:q}:{left:se,top:q}}document.addEventListener("pointerdown",w)})}function R(){m.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",w)}function G(te){a("change",te),R()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",w)}),l({open:m,openMenu:v,close:R}),(te,Y)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:y,class:"sort-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[m.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:k,class:"sort-picker__menu",style:t.normalizeStyle({left:d.value.left!==void 0?d.value.left+"px":void 0,right:d.value.right!==void 0?d.value.right+"px":void 0,top:d.value.top+"px"}),onMousedown:Y[0]||(Y[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,K=>t.createElementVNode("button",{key:K.key,class:"sort-picker__item",title:t.unref(D)(e.locale,K.i18nKey),onClick:C=>G(K.key)},[(t.openBlock(),t.createElementBlock("svg",ya,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,C=>t.createElementVNode("line",{key:C.name,x1:C.x1,y1:C.y1,x2:C.x2,y2:C.y2},null,8,ba)),64)),t.createElementVNode("path",{d:f[K.key]},null,8,Ca)])),t.createElementVNode("span",wa,t.toDisplayString(t.unref(D)(e.locale,K.i18nKey)),1)],8,ga)),64))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-45929b74"]]),ka=["title","onClick"],Ea=["innerHTML"],Sa={class:"merge-picker__label"},Ra=tl(t.defineComponent({__name:"mergePicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},triggerEl:{default:null}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=t.ref(!1),r=t.ref(null),f=t.ref(null),m=t.ref({top:0});t.watch(()=>n.modelOpen,v=>{v!==void 0&&v!==i.value&&(v?k():d())});function y(v){const R=r.value,G=f.value,te=v.target;R&&R.contains(te)||G&&G.contains(te)||d()}function k(){i.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const v=n.triggerEl??r.value;if(v){const R=v.getBoundingClientRect(),G=Eo.length*30+12,te=160;let Y=window.innerWidth-R.right,K=R.bottom+4,C;R.left-te<4&&(Y=void 0,C=Math.max(4,R.left)),K+G>window.innerHeight-4&&(K=R.top-G-4),K<4&&(K=4),m.value=Y!==void 0?{right:Y,top:K}:{left:C,top:K}}document.addEventListener("pointerdown",y)})}function d(){i.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",y)}function w(v){a("change",v),d()}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",y)}),l({open:i,openMenu:k,close:d}),(v,R)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"merge-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[i.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:f,class:"merge-picker__menu",style:t.normalizeStyle({left:m.value.left!==void 0?m.value.left+"px":void 0,right:m.value.right!==void 0?m.value.right+"px":void 0,top:m.value.top+"px"}),onMousedown:R[0]||(R[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Eo),G=>(t.openBlock(),t.createElementBlock("button",{key:G.key,class:"merge-picker__item",title:t.unref(D)(e.locale,G.labelKey),onClick:te=>w(G.key)},[t.createElementVNode("span",{class:"merge-picker__icon",innerHTML:G.icon},null,8,Ea),t.createElementVNode("span",Sa,t.toDisplayString(t.unref(D)(e.locale,G.labelKey)),1)],8,ka))),128))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-edd36208"]]),Ma=["disabled","title","onClick"],xa={class:"calc-picker__label"},Ba=tl(t.defineComponent({__name:"calcPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},triggerEl:{default:null},disabled:{type:Boolean,default:!1}},emits:["update:modelOpen","change"],setup(e,{expose:l,emit:o}){const n=e,a=o,i=[{key:"sum",labelKey:"sum"},{key:"avg",labelKey:"avg"},{key:"count",labelKey:"count"}],r=t.ref(!1),f=t.ref(null),m=t.ref(null),y=t.ref({top:0});t.watch(()=>n.modelOpen,R=>{R!==void 0&&R!==r.value&&(R?d():w())});function k(R){const G=f.value,te=m.value,Y=R.target;G&&G.contains(Y)||te&&te.contains(Y)||w()}function d(){r.value=!0,n.modelOpen!==void 0&&a("update:modelOpen",!0),t.nextTick(()=>{const R=n.triggerEl??f.value;if(R){const G=R.getBoundingClientRect(),te=i.length*30+12,Y=160;let K=window.innerWidth-G.right,C=G.bottom+4,j;G.left-Y<4&&(K=void 0,j=Math.max(4,G.left)),C+te>window.innerHeight-4&&(C=G.top-te-4),C<4&&(C=4),y.value=K!==void 0?{right:K,top:C}:{left:j,top:C}}document.addEventListener("pointerdown",k)})}function w(){r.value=!1,n.modelOpen!==void 0&&a("update:modelOpen",!1),document.removeEventListener("pointerdown",k)}function v(R){n.disabled||(a("change",R),w())}return t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",k)}),l({open:r,openMenu:d,close:w}),(R,G)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootRef",ref:f,class:"calc-picker"},[(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"menuRef",ref:m,class:"calc-picker__menu",style:t.normalizeStyle({left:y.value.left!==void 0?y.value.left+"px":void 0,right:y.value.right!==void 0?y.value.right+"px":void 0,top:y.value.top+"px"}),onMousedown:G[0]||(G[0]=t.withModifiers(()=>{},["stop","prevent"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,te=>t.createElementVNode("button",{key:te.key,class:t.normalizeClass(["calc-picker__item",{"calc-picker__item--disabled":e.disabled}]),disabled:e.disabled,title:t.unref(D)(e.locale,te.labelKey),onClick:Y=>v(te.key)},[t.createElementVNode("span",xa,t.toDisplayString(t.unref(D)(e.locale,te.labelKey)),1)],10,Ma)),64))],36)):t.createCommentVNode("",!0)]),_:1})]))],512))}}),[["__scopeId","data-v-01a18e00"]]),Ta={class:"tb-item","data-key":"undo"},Da=["title","disabled"],Na={class:"tb-item","data-key":"redo"},Fa=["title","disabled"],Ia={class:"tb-item","data-key":"paint"},Aa=["title","disabled"],Va={class:"tb-item","data-key":"clear"},Ha=["title","disabled"],Oa={class:"tb-item","data-key":"font"},La={class:"tb-item","data-key":"fontSize"},za={class:"toolbar-font-size"},_a=["value","title"],$a=["title"],Wa=["title","disabled"],Pa=["title","disabled"],Ua={class:"tb-item","data-key":"bold"},Ka=["title","disabled"],Ga={class:"tb-item","data-key":"italic"},Ya=["title","disabled"],Xa={class:"tb-item","data-key":"underline"},ja=["title","disabled"],Za={class:"tb-item","data-key":"strike"},qa=["title","disabled"],Ja={class:"tb-item","data-key":"textColor"},Qa={class:"toolbar-split"},ei=["title","disabled"],ti={viewBox:"0 0 1024 1024",fill:"currentColor"},li=["fill"],ni=["title","disabled"],oi={class:"tb-item","data-key":"fillColor"},ri={class:"toolbar-split"},ai=["title","disabled"],ii={viewBox:"0 0 1024 1024",fill:"currentColor"},ci=["fill"],si=["title","disabled"],ui={class:"tb-item","data-key":"border"},di={class:"toolbar-split"},fi=["title","disabled"],mi={viewBox:"0 0 30 30",fill:"none",stroke:"currentColor"},pi=["x1","y1","x2","y2","stroke-width","stroke-dasharray","stroke-linecap"],hi=["title","disabled"],gi={class:"tb-item","data-key":"hAlign"},yi={class:"tb-item","data-key":"vAlign"},bi={class:"tb-item","data-key":"wrap"},Ci=["title"],wi={class:"tb-item","data-key":"merge"},vi={class:"toolbar-split"},ki=["title","disabled"],Ei=["title","disabled"],Si={class:"tb-item","data-key":"numFmt"},Ri={class:"toolbar-number-format-group"},Mi=["title","disabled"],xi=["title","disabled"],Bi={class:"tb-item","data-key":"calc"},Ti={class:"toolbar-split"},Di=["title","disabled"],Ni=["title","disabled"],Fi={class:"tb-item","data-key":"sort"},Ii={class:"toolbar-split"},Ai=["title","disabled"],Vi={viewBox:"0 0 1024 1024",fill:"none",stroke:"currentColor","stroke-width":"64","stroke-linecap":"round","stroke-linejoin":"round"},Hi=["x1","y1","x2","y2"],Oi=["d"],Li=["title","disabled"],zi={class:"tb-item","data-key":"filter"},_i=["disabled","title"],$i={class:"tb-item","data-key":"freeze"},Wi={class:"tb-item","data-key":"find"},Pi=["title"],Oo='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M160 448 H864" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M448 160 V864" /><path d="M192 192 H416 V416 H192 Z" /></svg>',Ui='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M160 448 H864" /><path d="M192 192 H832 V416 H192 Z" /></svg>',Ki='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M448 160 V864" /><path d="M192 192 H416 V832 H192 Z" /></svg>',Gi='<svg viewBox="0 0 1024 1024" fill="currentColor"><path fill="none" stroke="currentColor" stroke-width="64" stroke-linejoin="round" stroke-linecap="round" d="M160 160 H864 V864 H160 Z" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M160 448 H864" /><path fill="none" stroke="currentColor" stroke-width="64" stroke-linecap="round" d="M448 160 V864" /><path fill="none" stroke="currentColor" stroke-width="48" stroke-linecap="round" d="M224 224 L416 416" /><path fill="none" stroke="currentColor" stroke-width="48" stroke-linecap="round" d="M416 224 L224 416" /></svg>',fo=2,Yi=6,Xi=34,ji=tl(t.defineComponent({__name:"toolbar",props:{locale:{},canUndo:{type:Boolean},canRedo:{type:Boolean},paintFmtActive:{type:Boolean},hasSelection:{type:Boolean},fontFamilyOptions:{},fontSizeOptions:{},selFontFamily:{},selFontSize:{},fontSizeInput:{},fontSizeMenuOpen:{type:Boolean},selFontWeight:{type:Boolean},selFontStyle:{type:Boolean},selUnderline:{type:Boolean},selStrikethrough:{type:Boolean},selTextColor:{},textColorMenuOpen:{type:Boolean},selFillColor:{},fillColorMenuOpen:{type:Boolean},cachedTextColor:{},cachedFillColor:{},borderMenuOpen:{type:Boolean},cachedBorder:{},sortMenuOpen:{type:Boolean},cachedSortOrder:{},canSort:{type:Boolean},canFilter:{type:Boolean},filterActive:{type:Boolean},selHAlign:{},selVAlign:{},selWrap:{type:Boolean},hAlignOptions:{},vAlignOptions:{},mergeMenuOpen:{type:Boolean},calcMenuOpen:{type:Boolean},isSingleCell:{type:Boolean},hasFreeze:{type:Boolean},themeVars:{},selNumberFormat:{},nfOptions:{},canIncreaseDecimals:{type:Boolean},canDecreaseDecimals:{type:Boolean}},emits:["undo","redo","paint-format","clear-format","font-size-blur","font-size-toggle","font-size-step-up","font-size-step-down","bold-toggle","italic-toggle","underline-toggle","strikethrough-toggle","apply-text-color","apply-fill-color","apply-border","apply-sort","wrap-toggle","apply-merge","calc-sum","calc-avg","calc-count","find","increase-decimals","decrease-decimals","toggle-filter","font-family-change","font-size-change","h-align-change","v-align-change","font-size-input","text-color-change","fill-color-change","number-format-change","freeze-change","font-size-keydown","update:font-size-menu-open","update:text-color-menu-open","update:fill-color-menu-open","update:border-menu-open","update:sort-menu-open","update:merge-menu-open","update:calc-menu-open","border-change","sort-change","merge-change"],setup(e,{emit:l}){const o=[{name:"top",x1:4,y1:4,x2:26,y2:4},{name:"bottom",x1:4,y1:26,x2:26,y2:26},{name:"left",x1:4,y1:4,x2:4,y2:26},{name:"right",x1:26,y1:4,x2:26,y2:26},{name:"vMid",x1:15,y1:4,x2:15,y2:26},{name:"hMid",x1:4,y1:15,x2:26,y2:15}],n={bottom:["bottom"],top:["top"],left:["left"],right:["right"],none:[],all:["top","bottom","left","right","vMid","hMid"],outer:["top","bottom","left","right"],thickOuter:["top","bottom","left","right"]},a={bottom:[],top:[],left:[],right:[],none:[],all:[],outer:[],thickOuter:["top","bottom","left","right"]};function i(u,p){return a[u].includes(p)?"thick":n[u].includes(p)?"solid":"dashed"}const r=[{name:"bar1",x1:96,y1:224,x2:352,y2:224},{name:"bar2",x1:96,y1:512,x2:512,y2:512},{name:"bar3",x1:96,y1:800,x2:672,y2:800}],f={asc:"M832 800V288M672 448l160-160 160 160",desc:"M832 224v512M672 576l160 160 160-160"},m=["undo","redo","paint","clear","sep1","font","fontSize","sep2","bold","italic","underline","strike","sep3","textColor","fillColor","border","sep4","hAlign","vAlign","wrap","merge","sep6","numFmt","sep7","calc","sort","filter","freeze","find"],y=t.ref(null),k=t.ref(null),d=t.ref(null),w=t.ref(null),v=t.ref(null),R=t.ref(null),G=t.ref(null),te=t.ref(null),Y=t.ref(null),K=t.ref(null),C=t.ref(new Set),j=t.ref(!1),q=t.ref(!1),se=t.ref(0),Fe=new Map,Qe=t.computed(()=>C.value.size>0);function Ge(u){return C.value.has(u)}const be=t.computed(()=>{const u=k.value;return u instanceof HTMLElement?u:void 0});function ve(u){return be.value?!Ge(u):!0}function Xe(){for(const u of m){const p=Fe.get(u);if(p===void 0||p===0)return!0}return!1}function Je(){if(!y.value)return;y.value.querySelectorAll(".tb-item").forEach(p=>{const H=p.dataset.key;if(!H)return;const ct=p.offsetWidth;ct>0?Fe.set(H,ct):Fe.has(H)||Fe.set(H,0)})}function gt(u,p){if(u.size!==p.size)return!1;for(const H of u)if(!p.has(H))return!1;return!0}let Ze=0,lt=0;function et(){Ze&&cancelAnimationFrame(Ze),!(lt>60)&&(lt++,Ze=requestAnimationFrame(()=>requestAnimationFrame(oe)))}function oe(){if(!y.value)return;const u=y.value.clientWidth-Yi*2;if(u<=0){et();return}lt=0,(Fe.size===0||Xe())&&Je();let p=0;for(const ct of m)p+=(Fe.get(ct)??0)+fo;const H=new Set;if(p>u){const ct=u-Xi-fo;let ae=0;for(let Pe=0;Pe<m.length;Pe++){const at=m[Pe],Mt=(Fe.get(at)??0)+fo;if(ae+Mt>ct){for(let St=Pe;St<m.length;St++)H.add(m[St]);break}ae+=Mt}}gt(H,C.value)||(C.value=H,se.value++,H.size===0&&(j.value=!1))}let pe=null;const g=t.ref(0),A=t.computed(()=>{const u=d.value,p={position:"fixed",top:"0px",right:"0px"};if(!u)return{...he.themeVars,...p};g.value;const H=u.getBoundingClientRect();return{...he.themeVars,position:"fixed",top:`${H.bottom+4}px`,right:`${window.innerWidth-H.right}px`}});function L(){j.value&&(g.value++,t.nextTick(()=>oe()))}function $(u){var H,ct;if(!j.value)return;const p=u.target;(H=k.value)!=null&&H.contains(p)||(ct=d.value)!=null&&ct.contains(p)||(q.value=!0,j.value=!1,t.nextTick(()=>{q.value=!1}))}function ee(){j.value=!j.value}function ie(){j.value=!1,ce("find")}function re(){j.value=!1,ce("toggle-filter")}t.onMounted(()=>{et(),y.value&&(pe=new ResizeObserver(()=>{j.value||et()}),pe.observe(y.value)),document.addEventListener("pointerdown",$,!0),window.addEventListener("resize",L),window.addEventListener("load",et),window.addEventListener("orientationchange",et)}),t.onBeforeUnmount(()=>{Ze&&cancelAnimationFrame(Ze),pe==null||pe.disconnect(),document.removeEventListener("pointerdown",$,!0),window.removeEventListener("resize",L),window.removeEventListener("load",et),window.removeEventListener("orientationchange",et)});const he=e,ce=l,V=t.computed(()=>he.selNumberFormat===Bl?D(he.locale,"nfMixed"):""),c=t.computed(()=>{const u=[{label:D(he.locale,"freezeFirstRow"),value:"firstRow",icon:Ui},{label:D(he.locale,"freezeFirstCol"),value:"firstCol",icon:Ki}];return he.hasFreeze?u.unshift({label:D(he.locale,"unfreezePanes"),value:"unfreeze",icon:Gi}):u.unshift({label:D(he.locale,"freezePanes"),value:"panes",icon:Oo}),u});return(u,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{ref_key:"rootEl",ref:y,class:"toolbar",onMousedown:p[52]||(p[52]=t.withModifiers(()=>{},["prevent"]))},[(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("undo"),to:be.value},[t.createElementVNode("div",Ta,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!e.canUndo}]),title:t.unref(D)(e.locale,"undo"),disabled:!e.canUndo,onClick:p[0]||(p[0]=H=>ce("undo"))},[...p[54]||(p[54]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"})],-1)])],10,Da)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("redo"),to:be.value},[t.createElementVNode("div",Na,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!e.canRedo}]),title:t.unref(D)(e.locale,"redo"),disabled:!e.canRedo,onClick:p[1]||(p[1]=H=>ce("redo"))},[...p[55]||(p[55]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{transform:"translate(1024, 0) scale(-1, 1)",d:"M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"})],-1)])],10,Fa)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("paint"),to:be.value},[t.createElementVNode("div",Ia,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.paintFmtActive}]),title:t.unref(D)(e.locale,"paintFormat"),disabled:!e.hasSelection,onClick:p[2]||(p[2]=H=>ce("paint-format"))},[...p[56]||(p[56]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M722.285714 438.857143a36.571429 36.571429 0 0 1-36.571428 36.571428h-512a36.571429 36.571429 0 0 1-36.571429-36.571428V164.571429a36.571429 36.571429 0 0 1 36.571429-36.571429h512a36.571429 36.571429 0 0 1 36.571428 36.571429V256h128a36.571429 36.571429 0 0 1 36.571429 36.571429v294.4a36.571429 36.571429 0 0 1-31.890286 36.278857L448 675.766857V859.428571a36.571429 36.571429 0 0 1-32.292571 36.315429l-4.278858 0.256a36.571429 36.571429 0 0 1-36.571428-36.571429v-215.771428a36.571429 36.571429 0 0 1 31.890286-36.278857l406.966857-52.553143V329.142857h-91.428572v109.714286z m-73.142857-237.714286h-438.857143V402.285714h438.857143V201.142857z"})],-1)])],10,Aa)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("clear"),to:be.value},[t.createElementVNode("div",Va,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!e.hasSelection}]),title:t.unref(D)(e.locale,"clearFormat"),disabled:!e.hasSelection,onClick:p[3]||(p[3]=H=>ce("clear-format"))},[...p[57]||(p[57]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M672.748 105.674c-3.666-3.799-8.778-5.949-14.125-5.949-5.341 0-10.459 2.15-14.119 5.949L10.418 754.633c-7.789 8.163-7.789 20.798 0 28.967l123.353 126.213c7.782 7.979 23.113 14.461 34.111 14.461h395.042c12.774-0.742 24.882-5.854 34.162-14.461l416.525-426.362c7.751-8.163 7.751-20.76 0-28.916l-340.92-348.861h0.057zM557.85 832.801c-9.273 8.582-21.343 13.707-34.111 14.461H217.888c-12.781-0.742-24.882-5.867-34.162-14.461l-58.074-59.482c-7.782-8.163-7.782-20.804 0-28.967l232.333-237.87c3.666-3.799 8.778-5.949 14.125-5.949s10.453 2.15 14.119 5.949l231.102 236.551c7.744 8.157 7.744 20.753 0 28.916l-59.539 60.909 0.058-0.057z m0 0"})],-1)])],10,Ha)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep1"),to:be.value},[p[58]||(p[58]=t.createElementVNode("div",{class:"tb-item","data-key":"sep1"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("font"),to:be.value},[t.createElementVNode("div",Oa,[t.createVNode(ll,{class:"toolbar-font","model-value":e.selFontFamily,options:e.fontFamilyOptions,width:Ge("font")?"100%":110,"menu-width":Ge("font")?120:void 0,"visible-count":8,title:t.unref(D)(e.locale,"fontFamily"),align:"right",onChange:p[4]||(p[4]=H=>ce("font-family-change",H))},null,8,["model-value","options","width","menu-width","title"])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("fontSize"),to:be.value},[t.createElementVNode("div",La,[t.createElementVNode("div",za,[t.createElementVNode("input",{class:"toolbar-font-size__input",type:"number",min:"5",max:"72",step:"1",value:e.fontSizeInput,title:t.unref(D)(e.locale,"fontSize"),onMousedown:p[5]||(p[5]=t.withModifiers(()=>{},["stop"])),onInput:p[6]||(p[6]=H=>ce("font-size-input",H.target.value)),onBlur:p[7]||(p[7]=H=>ce("font-size-blur")),onKeydown:p[8]||(p[8]=H=>ce("font-size-keydown",H))},null,40,_a),t.createVNode(ll,{class:"toolbar-font-size__dropdown","model-value":e.selFontSize,options:e.fontSizeOptions,width:Ge("fontSize")?"100%":56,"menu-width":Ge("fontSize")?120:56,"visible-count":9,title:t.unref(D)(e.locale,"fontSize"),"hide-trigger":!0,"model-open":e.fontSizeMenuOpen,align:"right","trigger-el":K.value,"onUpdate:modelOpen":p[9]||(p[9]=H=>ce("update:font-size-menu-open",H)),onChange:p[10]||(p[10]=H=>ce("font-size-change",H))},null,8,["model-value","options","width","menu-width","title","model-open","trigger-el"]),t.createElementVNode("button",{ref_key:"fontSizeArrowRef",ref:K,class:"toolbar-font-size__btn",type:"button",title:t.unref(D)(e.locale,"fontSize"),onMousedown:p[11]||(p[11]=t.withModifiers(()=>{},["prevent"])),onClick:p[12]||(p[12]=H=>ce("font-size-toggle"))},[...p[59]||(p[59]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],40,$a),t.createElementVNode("button",{class:"toolbar-btn toolbar-btn--step",type:"button",title:t.unref(D)(e.locale,"fontSizeDecrease"),disabled:!e.hasSelection,onMousedown:p[13]||(p[13]=t.withModifiers(()=>{},["prevent"])),onClick:p[14]||(p[14]=H=>ce("font-size-step-down"))},[...p[60]||(p[60]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M675.2 184.533333h260.266667a12.8 12.8 0 0 1 12.8 12.8v21.333334a12.8 12.8 0 0 1-12.8 12.8H675.2a12.8 12.8 0 0 1-12.8-12.8v-21.333334a12.8 12.8 0 0 1 12.8-12.8zM687.744 739.413333l87.722667 197.717334a12.8 12.8 0 0 0 11.733333 7.594666h54.016a12.8 12.8 0 0 0 11.605333-18.133333l-7.466666-16.213333-131.2-287.829334-35.413334-77.653333-166.570666-365.525333a36.266667 36.266667 0 0 0-66.432 0.938666l-154.154667 365.482667-34.688 82.261333-34.688 82.218667-84.778667 201.045333-6.570666 15.658667a12.8 12.8 0 0 0 11.776 17.749333h57.557333a12.8 12.8 0 0 0 11.904-8.106666l102.4-258.474667 343.466667-4.010667 29.781333 65.28zM480.426667 284.672l132.352 290.261333 12.288 27.050667-279.808 3.242667 13.184-31.232 122.026666-289.28z"})],-1)])],40,Wa),t.createElementVNode("button",{class:"toolbar-btn toolbar-btn--step",type:"button",title:t.unref(D)(e.locale,"fontSizeIncrease"),disabled:!e.hasSelection,onMousedown:p[15]||(p[15]=t.withModifiers(()=>{},["prevent"])),onClick:p[16]||(p[16]=H=>ce("font-size-step-up"))},[...p[61]||(p[61]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M769.066667 77.952v93.781333h-93.866667a12.8 12.8 0 0 0-12.8 12.8v46.933334a12.8 12.8 0 0 0 12.8 12.8h93.866667v93.952a12.8 12.8 0 0 0 12.8 12.8h46.933333a12.8 12.8 0 0 0 12.8-12.8V244.266667h93.866667a12.8 12.8 0 0 0 12.8-12.8v-46.933334a12.8 12.8 0 0 0-12.8-12.8h-93.866667V77.952a12.8 12.8 0 0 0-12.8-12.8h-46.933333a12.8 12.8 0 0 0-12.8 12.8zM687.744 739.413333l87.722667 197.717334a12.8 12.8 0 0 0 11.733333 7.594666h54.016a12.8 12.8 0 0 0 11.605333-18.133333l-7.466666-16.213333-131.2-287.829334-35.413334-77.653333-166.570666-365.525333a36.266667 36.266667 0 0 0-66.432 0.938666l-154.154667 365.482667-34.688 82.261333-34.688 82.218667-84.778667 201.045333-6.570666 15.658667a12.8 12.8 0 0 0 11.776 17.749333h57.557333a12.8 12.8 0 0 0 11.904-8.106666l102.4-258.474667 343.466667-4.010667 29.781333 65.28zM480.426667 284.672l132.352 290.261333 12.288 27.050667-279.808 3.242667 13.184-31.232 122.026666-289.28z"})],-1)])],40,Pa)])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep2"),to:be.value},[p[62]||(p[62]=t.createElementVNode("div",{class:"tb-item","data-key":"sep2"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("bold"),to:be.value},[t.createElementVNode("div",Ua,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selFontWeight}]),title:t.unref(D)(e.locale,"bold"),disabled:!e.hasSelection,onClick:p[17]||(p[17]=H=>ce("bold-toggle"))},[...p[63]||(p[63]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M214.857 889.143v-68.571h68.571V203.429H214.857v-68.571h411.429v1.257c96.114 10.629 171.429 87.383 171.429 181.6 0 58.971-29.486 111.086-75.109 144.457 72.069 39.291 120.823 113.234 120.823 198.4 0 119.291-95.634 216.594-217.12 227.543l-0.286.029H214.857z m388.572-388.571H352v320h251.429c95.086 0 171.429-72.091 171.429-160s-76.343-160-171.429-160z m0-297.143H352v228.571h251.429l5.211-0.091c67.52-2.515 120.503-53.235 120.503-114.195 0-62.537-55.749-114.285-125.714-114.285z"})],-1)])],10,Ka)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("italic"),to:be.value},[t.createElementVNode("div",Ga,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selFontStyle}]),title:t.unref(D)(e.locale,"italic"),disabled:!e.hasSelection,onClick:p[18]||(p[18]=H=>ce("italic-toggle"))},[...p[64]||(p[64]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M730.143 127.714v64.286h-112.329l-166.521 621.429h128.871v64.286H276.286v-64.286h108.45l166.5-621.429H426.286V127.714h303.857z"})],-1)])],10,Ya)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("underline"),to:be.value},[t.createElementVNode("div",Xa,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selUnderline}]),title:t.unref(D)(e.locale,"underline"),disabled:!e.hasSelection,onClick:p[19]||(p[19]=H=>ce("underline-toggle"))},[...p[65]||(p[65]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M512 123.639a36.409 36.409 0 0 1 33.642 22.525l230.59 558.27a36.409 36.409 0 1 1-67.284 27.768L638.072 560.545H385.928l-70.876 171.656a36.409 36.409 0 1 1-67.332-27.768l230.59-558.27A36.409 36.409 0 0 1 512 123.639z m-95.974 364.089h191.948L512 255.439l-95.974 232.289zM769.289 827.544c19.418 0 38.836 14.564 38.836 38.836 0 19.418-14.564 33.982-29.127 33.982H259.565c-19.418 0-38.836-14.564-38.836-38.836 0-19.418 14.564-33.982 29.127-33.982h519.433z"})],-1)])],10,ja)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("strike"),to:be.value},[t.createElementVNode("div",Za,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selStrikethrough}]),title:t.unref(D)(e.locale,"strikethrough"),disabled:!e.hasSelection,onClick:p[20]||(p[20]=H=>ce("strikethrough-toggle"))},[...p[66]||(p[66]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M182.044 490.667h659.911a34.133 34.133 0 0 1 4.642 67.948l-4.597 0.319h-135.395c40.05 37 60.803 81.601 60.803 133.575 0 128.569-147.092 211.171-307.382 192.512-101.717-11.833-173.352-52.565-210.944-122.971a34.133 34.133 0 0 1 60.211-32.176c25.942 48.606 77.46 77.915 158.606 87.381 124.837 14.473 231.242-45.283 231.242-124.746 0-53.339-36.636-96.802-116.736-131.345l-5.279-2.23H182.044a34.133 34.133 0 0 1-33.815-29.492L147.911 524.8a34.133 34.133 0 0 1 29.491-33.815l4.642-0.318z m68.767-176.447c6.918-128.796 128.432-203.343 287.812-184.82 99.579 11.56 175.81 47.923 226.737 109.636a34.133 34.133 0 1 1-52.657 43.463c-38.775-47.013-98.759-75.639-181.999-85.288-123.654-14.381-211.627 36.591-211.627 117.009 0 35.135 10.65 61.349 37.774 90.203l5.826 6.007c4.278 4.369 8.966 8.875 11.377 10.923l1.411 0.91H288.085l-1.092-1.729c-6.508-9.376-38.958-54.386-36.182-106.314z"})],-1)])],10,qa)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep3"),to:be.value},[p[67]||(p[67]=t.createElementVNode("div",{class:"tb-item","data-key":"sep3"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("textColor"),to:be.value},[t.createElementVNode("div",Ja,[t.createElementVNode("div",Qa,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(D)(e.locale,"fontColor"),disabled:!e.hasSelection,onClick:p[21]||(p[21]=H=>ce("apply-text-color"))},[(t.openBlock(),t.createElementBlock("svg",ti,[p[68]||(p[68]=t.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[t.createElementVNode("path",{d:"M663.120842 529.946947H364.759579l-84.07579 212.884211a53.894737 53.894737 0 0 1-50.122105 34.169263h-14.551579a34.869895 34.869895 0 0 1-32.498526-47.696842L443.715368 70.063158a53.894737 53.894737 0 0 1 50.122106-34.115369h41.768421a53.894737 53.894737 0 0 1 50.176 34.277053l257.670737 659.078737a34.977684 34.977684 0 0 1-32.552421 47.696842h-14.389895a53.894737 53.894737 0 0 1-50.229895-34.277053l-83.159579-212.776421z m-35.139368-89.788631l-113.340632-289.953684-114.472421 289.953684h227.813053z"})],-1)),t.createElementVNode("path",{d:"M62.895 844.369m53.895 0l790.474 0q53.895 0 53.895 53.895l0 26.947q0 53.895-53.895 53.895l-790.474 0q-53.895 0-53.895-53.895l0-26.947q0-53.895 53.895-53.895z",fill:e.cachedTextColor||"#000000"},null,8,li)]))],8,ei),t.createElementVNode("button",{ref_key:"textColorArrowRef",ref:w,class:"toolbar-btn toolbar-split__arrow",title:t.unref(D)(e.locale,"fontColor"),disabled:!e.hasSelection,onClick:p[22]||(p[22]=H=>ce("update:text-color-menu-open",!e.textColorMenuOpen))},[...p[69]||(p[69]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,ni),t.createVNode(Ho,{"model-open":e.textColorMenuOpen,"color-key":"text","current-color":e.selTextColor,locale:e.locale,"trigger-el":w.value,"onUpdate:modelOpen":p[23]||(p[23]=H=>ce("update:text-color-menu-open",H)),onChange:p[24]||(p[24]=H=>ce("text-color-change",H))},null,8,["model-open","current-color","locale","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("fillColor"),to:be.value},[t.createElementVNode("div",oi,[t.createElementVNode("div",ri,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(D)(e.locale,"fillColor"),disabled:!e.hasSelection,onClick:p[25]||(p[25]=H=>ce("apply-fill-color"))},[(t.openBlock(),t.createElementBlock("svg",ii,[p[70]||(p[70]=t.createElementVNode("path",{d:"M447.018667 37.952l352.298666 352.298667c6.613333 6.613333 6.613333 17.344 0 23.957333L446.101333 767.424a16.938667 16.938667 0 0 1-23.957333 0L121.429333 466.688a16.938667 16.938667 0 0 1 0-23.957333L428.608 135.552 388.992 96a8.469333 8.469333 0 0 1 0-11.989333l46.058667-46.037334a8.469333 8.469333 0 0 1 11.968 0z m346.325333 517.461333l57.514667 60.074667c31.744 33.194667 31.744 86.997333 0 120.192a78.869333 78.869333 0 0 1-115.008 0c-31.765333-33.194667-31.765333-86.997333 0-120.192l57.493333-60.074667zM486.101333 193.066667l-261.12 261.12 20.458667 20.458666 380.16-1.728 70.186667-70.186666-209.706667-209.664z"},null,-1)),t.createElementVNode("path",{d:"M85.333333 853.333333m8.896 0l835.541334 0q8.896 0 8.896 8.896l0 110.208q0 8.896-8.896 8.896l-835.541334 0q-8.896 0-8.896-8.896l0-110.208q0-8.896 8.896-8.896Z",fill:e.cachedFillColor||"currentColor"},null,8,ci)]))],8,ai),t.createElementVNode("button",{ref_key:"fillColorArrowRef",ref:v,class:"toolbar-btn toolbar-split__arrow",title:t.unref(D)(e.locale,"fillColor"),disabled:!e.hasSelection,onClick:p[26]||(p[26]=H=>ce("update:fill-color-menu-open",!e.fillColorMenuOpen))},[...p[71]||(p[71]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,si),t.createVNode(Ho,{"model-open":e.fillColorMenuOpen,"color-key":"fill","current-color":e.selFillColor,locale:e.locale,"trigger-el":v.value,"onUpdate:modelOpen":p[27]||(p[27]=H=>ce("update:fill-color-menu-open",H)),onChange:p[28]||(p[28]=H=>ce("fill-color-change",H))},null,8,["model-open","current-color","locale","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("border"),to:be.value},[t.createElementVNode("div",ui,[t.createElementVNode("div",di,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(D)(e.locale,"borders"),disabled:!e.hasSelection,onClick:p[29]||(p[29]=H=>ce("apply-border"))},[(t.openBlock(),t.createElementBlock("svg",mi,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(o,H=>t.createElementVNode("line",{key:H.name,x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,"stroke-width":i(e.cachedBorder,H.name)==="thick"?3:1.5,"stroke-dasharray":i(e.cachedBorder,H.name)==="dashed"?"0 4":"none","stroke-linecap":i(e.cachedBorder,H.name)==="dashed"?"round":"square"},null,8,pi)),64))]))],8,fi),t.createElementVNode("button",{ref_key:"borderArrowRef",ref:R,class:"toolbar-btn toolbar-split__arrow",title:t.unref(D)(e.locale,"borders"),disabled:!e.hasSelection,onClick:p[30]||(p[30]=H=>ce("update:border-menu-open",!e.borderMenuOpen))},[...p[72]||(p[72]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,hi),t.createVNode(ha,{"model-open":e.borderMenuOpen,locale:e.locale,"current-border":e.cachedBorder,"trigger-el":R.value,"onUpdate:modelOpen":p[31]||(p[31]=H=>ce("update:border-menu-open",H)),onChange:p[32]||(p[32]=H=>ce("border-change",H))},null,8,["model-open","locale","current-border","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep4"),to:be.value},[p[73]||(p[73]=t.createElementVNode("div",{class:"tb-item","data-key":"sep4"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("hAlign"),to:be.value},[t.createElementVNode("div",gi,[t.createVNode(ll,{class:"toolbar-align","model-value":e.selHAlign,options:e.hAlignOptions,width:Ge("hAlign")?"100%":44,"menu-width":Ge("hAlign")?120:void 0,"visible-count":3,align:"right",title:t.unref(D)(e.locale,"hAlign"),onChange:p[33]||(p[33]=H=>ce("h-align-change",H))},null,8,["model-value","options","width","menu-width","title"])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("vAlign"),to:be.value},[t.createElementVNode("div",yi,[t.createVNode(ll,{class:"toolbar-align","model-value":e.selVAlign,options:e.vAlignOptions,width:Ge("vAlign")?"100%":44,"menu-width":Ge("vAlign")?120:void 0,"visible-count":3,align:"right",title:t.unref(D)(e.locale,"vAlign"),onChange:p[34]||(p[34]=H=>ce("v-align-change",H))},null,8,["model-value","options","width","menu-width","title"])]),t.createElementVNode("div",bi,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.selWrap}]),type:"button",title:t.unref(D)(e.locale,"wrap"),onClick:p[35]||(p[35]=H=>ce("wrap-toggle"))},[...p[74]||(p[74]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M896 179.2a38.4 38.4 0 0 0-76.8 0v665.6a38.4 38.4 0 0 0 76.8 0v-665.6zM204.8 281.6A38.4 38.4 0 0 0 204.8 358.4h179.2a38.4 38.4 0 0 0 0-76.8H204.8zM550.4 281.6a38.4 38.4 0 0 0 0 76.8h51.2c35.328 0 64 28.672 64 64v179.2c0 35.328-28.672 64-64 64H246.272l36.864-36.864a38.4 38.4 0 1 0-54.272-54.272l-102.4 102.4a38.4 38.4 0 0 0 0 54.272l102.4 102.4a38.4 38.4 0 0 0 54.272-54.272l-36.864-36.864h355.328a140.8 140.8 0 0 0 140.8-140.8v-179.2a140.8 140.8 0 0 0-140.8-140.8h-51.2z"})],-1)])],10,Ci)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("merge"),to:be.value},[t.createElementVNode("div",wi,[t.createElementVNode("div",vi,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(D)(e.locale,"mergeCenter"),disabled:!e.hasSelection,onClick:p[36]||(p[36]=H=>ce("apply-merge"))},[...p[75]||(p[75]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M709.952 465.92l88-76.032C801.92 385.984 806.656 384 812.032 384s10.048 1.984 14.08 5.952C830.08 393.92 832 398.656 832 403.968L832 448l32 0C881.664 448 896 462.336 896 480S881.664 512 864 512L832 512l0 44.032c0 5.376-1.92 10.112-5.952 14.08C822.08 574.08 817.344 576 812.032 576s-10.048-1.92-14.08-5.952L709.952 494.08C705.984 490.112 704 485.376 704 480S705.984 469.952 709.952 465.92zM378.048 465.92 290.048 389.952C286.08 385.984 281.344 384 275.968 384s-10.048 1.984-14.08 5.952C257.92 393.92 256 398.656 256 403.968L256 448 224 448C206.336 448 192 462.336 192 480S206.336 512 224 512L256 512l0 44.032c0 5.376 1.92 10.112 5.952 14.08C265.92 574.08 270.656 576 275.968 576s10.048-1.92 14.08-5.952L378.048 494.08C382.016 490.112 384 485.376 384 480S382.016 469.952 378.048 465.92zM448 128 128 128l0 704 320 0 0-128 64 0 0 128c0 35.392-28.608 64-64 64L128 896c-35.392 0-64-28.608-64-64L64 128c0-35.392 28.608-64 64-64l320 0 0 0c35.392 0 64 28.608 64 64l0 128L448 256 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128M722.304 642.304c0 8.512-3.52 16.32-10.496 23.36s-15.424 10.624-25.344 10.624c-5.76 0-10.688-1.088-14.72-3.136-4.096-2.048-7.616-4.928-10.432-8.512s-5.824-9.088-9.024-16.512-5.952-13.952-8.32-19.648l-17.28-46.016L479.36 582.464 462.08 629.568c-6.72 18.304-12.48 30.656-17.344 37.12s-12.544 9.6-23.424 9.6c-9.28 0-17.408-3.456-24.512-10.24s-10.624-14.592-10.624-23.232c0-4.992 0.896-10.176 2.496-15.488S393.024 614.592 396.8 605.056l92.672-238.016C492.096 360.256 495.296 352 499.008 342.464s7.68-17.536 11.904-23.872 9.664-11.456 16.576-15.36c6.784-3.968 15.232-5.888 25.344-5.888 10.176 0 18.752 1.92 25.472 5.888 6.848 3.968 12.352 8.96 16.64 15.104 4.096 6.208 7.744 12.8 10.624 19.904s6.528 16.576 11.008 28.352l94.656 236.48C718.592 621.056 722.304 634.112 722.304 642.304zM606.912 526.784 552.32 375.552 498.624 526.784 606.912 526.784z"})],-1)])],8,ki),t.createElementVNode("button",{ref_key:"mergeArrowRef",ref:te,class:"toolbar-btn toolbar-split__arrow",title:t.unref(D)(e.locale,"mergeCells"),disabled:!e.hasSelection,onClick:p[37]||(p[37]=H=>ce("update:merge-menu-open",!e.mergeMenuOpen))},[...p[76]||(p[76]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,Ei),t.createVNode(Ra,{"model-open":e.mergeMenuOpen,locale:e.locale,"trigger-el":te.value,"onUpdate:modelOpen":p[38]||(p[38]=H=>ce("update:merge-menu-open",H)),onChange:p[39]||(p[39]=H=>ce("merge-change",H))},null,8,["model-open","locale","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep6"),to:be.value},[p[77]||(p[77]=t.createElementVNode("div",{class:"tb-item","data-key":"sep6"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("numFmt"),to:be.value},[t.createElementVNode("div",Si,[t.createElementVNode("div",Ri,[t.createVNode(ll,{class:"toolbar-number-format","model-value":e.selNumberFormat,options:e.nfOptions,width:Ge("numFmt")?"auto":92,"menu-width":(Ge("numFmt"),150),"visible-count":8,title:t.unref(D)(e.locale,"numberFormat"),"fallback-label":V.value,align:"right",onChange:p[40]||(p[40]=H=>ce("number-format-change",String(H)))},null,8,["model-value","options","width","menu-width","title","fallback-label"]),t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn toolbar-number-format__btn",{"toolbar-btn--disabled":!e.canIncreaseDecimals}]),title:t.unref(D)(e.locale,"nfIncreaseDecimals"),disabled:!e.canIncreaseDecimals,onClick:p[41]||(p[41]=H=>ce("increase-decimals"))},[...p[78]||(p[78]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[t.createElementVNode("text",{x:"0.5",y:"16","font-size":"9","font-weight":"700","font-family":"Arial, sans-serif"},".00"),t.createElementVNode("path",{d:"M19 5.5l4.2 5.2h-2.7v7.8h-3v-7.8h-2.7z"})],-1)])],10,Mi),t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn toolbar-number-format__btn",{"toolbar-btn--disabled":!e.canDecreaseDecimals}]),title:t.unref(D)(e.locale,"nfDecreaseDecimals"),disabled:!e.canDecreaseDecimals,onClick:p[42]||(p[42]=H=>ce("decrease-decimals"))},[...p[79]||(p[79]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[t.createElementVNode("text",{x:"0.5",y:"16","font-size":"9","font-weight":"700","font-family":"Arial, sans-serif"},".00"),t.createElementVNode("path",{d:"M19 18.5l-4.2-5.2h2.7V5.5h3v7.8h2.7z"})],-1)])],10,xi)])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sep7"),to:be.value},[p[80]||(p[80]=t.createElementVNode("div",{class:"tb-item","data-key":"sep7"},[t.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("calc"),to:be.value},[t.createElementVNode("div",Bi,[t.createElementVNode("div",Ti,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:t.unref(D)(e.locale,"sum"),disabled:!e.hasSelection||e.isSingleCell,onClick:p[43]||(p[43]=H=>ce("calc-sum"))},[...p[81]||(p[81]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[t.createElementVNode("path",{d:"M19 3H5l7 9-7 9h14v-2H8l5.5-7L8 5h11z"})],-1)])],8,Di),t.createElementVNode("button",{ref_key:"calcArrowRef",ref:Y,class:"toolbar-btn toolbar-split__arrow",title:t.unref(D)(e.locale,"calculate"),disabled:!e.hasSelection,onClick:p[44]||(p[44]=H=>ce("update:calc-menu-open",!e.calcMenuOpen))},[...p[82]||(p[82]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,Ni),t.createVNode(Ba,{"model-open":e.calcMenuOpen,locale:e.locale,"trigger-el":Y.value,disabled:e.isSingleCell,"onUpdate:modelOpen":p[45]||(p[45]=H=>ce("update:calc-menu-open",H)),onChange:p[46]||(p[46]=H=>ce(`calc-${H}`))},null,8,["model-open","locale","trigger-el","disabled"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("sort"),to:be.value},[t.createElementVNode("div",Fi,[t.createElementVNode("div",Ii,[t.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:e.cachedSortOrder==="asc"?t.unref(D)(e.locale,"sortAsc"):t.unref(D)(e.locale,"sortDesc"),disabled:!e.canSort,onClick:p[47]||(p[47]=H=>ce("apply-sort"))},[(t.openBlock(),t.createElementBlock("svg",Vi,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,H=>t.createElementVNode("line",{key:H.name,x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2},null,8,Hi)),64)),t.createElementVNode("path",{d:f[e.cachedSortOrder]},null,8,Oi)]))],8,Ai),t.createElementVNode("button",{ref_key:"sortArrowRef",ref:G,class:"toolbar-btn toolbar-split__arrow",title:t.unref(D)(e.locale,"sort"),disabled:!e.canSort,onClick:p[48]||(p[48]=H=>ce("update:sort-menu-open",!e.sortMenuOpen))},[...p[83]||(p[83]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,Li),t.createVNode(va,{"model-open":e.sortMenuOpen,locale:e.locale,"current-sort":e.cachedSortOrder,"trigger-el":G.value,"onUpdate:modelOpen":p[49]||(p[49]=H=>ce("update:sort-menu-open",H)),onChange:p[50]||(p[50]=H=>ce("sort-change",H))},null,8,["model-open","locale","current-sort","trigger-el"])])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("filter"),to:be.value},[t.createElementVNode("div",zi,[t.createElementVNode("button",{class:t.normalizeClass(["toolbar-btn",{"toolbar-btn--active":e.filterActive}]),disabled:!e.canFilter,title:e.filterActive?t.unref(D)(e.locale,"clearFilter"):t.unref(D)(e.locale,"filter"),onClick:re},[...p[84]||(p[84]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M96 192c0-17.6 14.4-32 32-32h768c17.6 0 32 14.4 32 32 0 9.6-4.8 19.2-12.8 25.6L608 480v320c0 19.2-12.8 35.2-32 40-4.8 1.6-9.6 1.6-14.4 1.6-12.8 0-24-4.8-33.6-12.8l-128-108.8c-8-6.4-12.8-16-12.8-25.6V480L108.8 217.6C100.8 211.2 96 201.6 96 192z"})],-1)])],10,_i)])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("freeze"),to:be.value},[t.createElementVNode("div",$i,[t.createVNode(ll,{class:"toolbar-freeze","model-value":"",options:c.value,width:Ge("freeze")?"100%":44,"menu-width":Ge("freeze")?120:void 0,"visible-count":4,align:"right",title:t.unref(D)(e.locale,"freezePane"),"trigger-icon":Oo,onChange:p[51]||(p[51]=H=>ce("freeze-change",String(H)))},null,8,["options","width","menu-width","title"])])],8,["disabled","to"])),(t.openBlock(),t.createBlock(t.Teleport,{disabled:ve("find"),to:be.value},[t.createElementVNode("div",Wi,[t.createElementVNode("button",{class:"toolbar-btn",title:t.unref(D)(e.locale,"find"),onClick:ie},[...p[85]||(p[85]=[t.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M448 128a320 320 0 0 1 251.2 516.8l171.2 171.2a32 32 0 0 1-45.2 45.2L654 689.9A320 320 0 1 1 448 128zm0 64a256 256 0 1 0 0 512 256 256 0 0 0 0-512z"})],-1)])],8,Pi)])],8,["disabled","to"])),Qe.value?(t.openBlock(),t.createElementBlock("button",{key:0,ref_key:"moreBtnEl",ref:d,class:t.normalizeClass(["toolbar-more",{"toolbar-more--active":j.value}]),type:"button",onClick:ee},[...p[86]||(p[86]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("circle",{cx:"512",cy:"160",r:"96"}),t.createElementVNode("circle",{cx:"512",cy:"512",r:"96"}),t.createElementVNode("circle",{cx:"512",cy:"864",r:"96"})],-1)])],2)):t.createCommentVNode("",!0)],544),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref_key:"overflowMenuEl",ref:k,key:se.value,class:t.normalizeClass(["overflow-menu",{"no-anim":q.value}]),style:t.normalizeStyle(A.value),onMousedown:p[53]||(p[53]=t.withModifiers(()=>{},["prevent"]))},null,38)),[[t.vShow,j.value]])]),_:1})]))],64))}}),[["__scopeId","data-v-0d0b0e86"]]),Zi=["title"],qi={class:"tab-list"},Ji=["onClick","onDblclick","onContextmenu","onTouchstart"],Qi=["value"],ec={key:1,class:"tab-item__name"},tc=["title"],lc=["disabled"],nc=["title","onClick"],oc={class:"tab-list-menu__name"},rc=["title","disabled","onClick"],ac=["disabled"],ic=8,Lo=450,Yn=8,cc=tl(t.defineComponent({__name:"tabbar",props:{locale:{},sheets:{},activeSheetIndex:{},renTab:{},renTabVal:{}},emits:["tab-click","tab-dblclick","delete-sheet","tab-contextmenu","tab-rename-input","tab-rename-keydown","tab-rename-commit","add-sheet","tabbar-contextmenu"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(null),i=t.ref(!1),r=t.ref(0),f=t.ref({left:0,bottom:0}),m=t.ref(null),y=t.computed(()=>Math.min(ic,o.sheets.length)),k=t.computed(()=>o.sheets.slice(r.value,r.value+y.value)),d=t.computed(()=>r.value>0),w=t.computed(()=>r.value+y.value<o.sheets.length),v=t.computed(()=>o.sheets.length>y.value),R=t.computed(()=>o.sheets.length>1);t.watch(()=>o.sheets.length,()=>{if(!i.value)return;const V=Math.max(0,o.sheets.length-y.value);r.value>V&&(r.value=V)});function G(V){r.value=Math.max(0,Math.min(o.sheets.length-y.value,r.value+V))}function te(){if(i.value){i.value=!1;return}const V=a.value;if(!V)return;const c=V.getBoundingClientRect();f.value={left:c.left,bottom:window.innerHeight-c.top+4};const u=o.activeSheetIndex;r.value=u>=0?Math.max(0,Math.min(u-Math.floor(y.value/2),o.sheets.length-y.value)):0,i.value=!0}function Y(V){n("tab-click",V),i.value=!1}function K(V){R.value&&n("delete-sheet",V)}function C(V){var p;if(!i.value)return;const c=V.target;if((p=a.value)!=null&&p.contains(c))return;const u=document.querySelector(".tab-list-menu");u!=null&&u.contains(c)||(i.value=!1)}function j(V){i.value&&V.key==="Escape"&&(i.value=!1)}function q(V){i.value&&(V.preventDefault(),G(V.deltaY>0?1:-1))}function se(){i.value=!1}function Fe(V){!i.value||V.target===m.value||se()}const Qe=t.ref(0),Ge=t.ref(!1);function be(V){i.value&&(Qe.value=V.touches[0].clientY,Ge.value=!0)}function ve(V){if(!i.value||!Ge.value)return;const c=V.touches[0].clientY-Qe.value;Math.abs(c)>5&&(G(c<0?1:-1),Qe.value=V.touches[0].clientY)}function Xe(){Ge.value=!1}let Je=null,gt=-1,Ze=0,lt=0,et=!1,oe=null,pe=0,g=0;function A(V,c,u){return{clientX:V,clientY:c,target:u,preventDefault(){},stopPropagation(){}}}function L(V,c){const u=V.touches[0];if(!u)return;Ze=u.clientX,lt=u.clientY,gt=c,Je!==null&&clearTimeout(Je);const p=V.target;Je=window.setTimeout(()=>{et=!0;const H=A(Ze,lt,p);n("tab-contextmenu",{ev:H,i:gt})},Lo)}function $(V){const c=V.touches[0];!c||Je===null||(Math.abs(c.clientX-Ze)>Yn||Math.abs(c.clientY-lt)>Yn)&&(clearTimeout(Je),Je=null)}function ee(){Je!==null&&(clearTimeout(Je),Je=null)}function ie(V){if(et){et=!1;return}n("tab-click",V)}function re(V){const c=V.touches[0];if(!c)return;const u=V.target;if(u.closest(".tab-item")||u.closest(".tab-bar__add-btn")||u.closest(".tab-bar__list-btn"))return;pe=c.clientX,g=c.clientY,oe!==null&&clearTimeout(oe);const p=u;oe=window.setTimeout(()=>{const H=A(pe,g,p);n("tabbar-contextmenu",H)},Lo)}function he(V){const c=V.touches[0];!c||oe===null||(Math.abs(c.clientX-pe)>Yn||Math.abs(c.clientY-g)>Yn)&&(clearTimeout(oe),oe=null)}function ce(){oe!==null&&(clearTimeout(oe),oe=null)}return t.watch(i,V=>{t.nextTick(()=>{var c,u;V?(c=m.value)==null||c.addEventListener("wheel",q,{passive:!1}):(u=m.value)==null||u.removeEventListener("wheel",q)})}),t.onMounted(()=>{document.addEventListener("pointerdown",C),document.addEventListener("keydown",j),window.addEventListener("resize",se),window.addEventListener("scroll",Fe,!0)}),t.onBeforeUnmount(()=>{Je!==null&&clearTimeout(Je),oe!==null&&clearTimeout(oe),document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",j),window.removeEventListener("resize",se),window.removeEventListener("scroll",Fe,!0)}),(V,c)=>(t.openBlock(),t.createElementBlock("div",{class:"tab-bar",onContextmenu:c[8]||(c[8]=u=>n("tabbar-contextmenu",u)),onTouchstart:re,onTouchmove:he,onTouchend:ce,onTouchcancel:ce},[t.createElementVNode("button",{ref_key:"listBtnRef",ref:a,class:t.normalizeClass(["tab-bar__list-btn",{"tab-bar__list-btn--active":i.value}]),type:"button",title:t.unref(D)(e.locale,"sheetList"),onClick:te},[...c[9]||(c[9]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M128 256h768a32 32 0 0 0 0-64H128a32 32 0 0 0 0 64z m0 256h768a32 32 0 0 0 0-64H128a32 32 0 0 0 0 64z m0 256h768a32 32 0 0 0 0-64H128a32 32 0 0 0 0 64z"})],-1)])],10,Zi),t.createElementVNode("div",qi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.sheets,(u,p)=>(t.openBlock(),t.createElementBlock("div",{key:u.id,class:t.normalizeClass(["tab-item",{"tab-item--active":p===e.activeSheetIndex}]),onClick:H=>ie(p),onDblclick:t.withModifiers(H=>n("tab-dblclick",p),["prevent"]),onContextmenu:H=>n("tab-contextmenu",{ev:H,i:p}),onTouchstart:H=>L(H,p),onTouchmove:$,onTouchend:ee,onTouchcancel:ee},[e.renTab===p?(t.openBlock(),t.createElementBlock("input",{key:0,class:"tab-rename-input",value:e.renTabVal,onInput:c[0]||(c[0]=H=>n("tab-rename-input",H.target.value)),onKeydown:c[1]||(c[1]=H=>n("tab-rename-keydown",H)),onBlur:c[2]||(c[2]=H=>n("tab-rename-commit")),onClick:c[3]||(c[3]=t.withModifiers(()=>{},["stop"]))},null,40,Qi)):(t.openBlock(),t.createElementBlock("span",ec,t.toDisplayString(u.name),1))],42,Ji))),128))]),t.createElementVNode("button",{class:"tab-bar__add-btn",title:t.unref(D)(e.locale,"addSheet"),onClick:c[4]||(c[4]=u=>n("add-sheet"))}," + ",8,tc),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[i.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"tab-list-menu",style:t.normalizeStyle({left:f.value.left+"px",bottom:f.value.bottom+"px"}),onMousedown:c[7]||(c[7]=t.withModifiers(()=>{},["prevent"]))},[v.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["tab-list-menu__nav",{"tab-list-menu__nav--disabled":!d.value}]),disabled:!d.value,onClick:c[5]||(c[5]=u=>G(-1))},[...c[10]||(c[10]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z"})],-1)])],10,lc)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"listRef",ref:m,class:"tab-list-menu__list",onTouchstart:be,onTouchmove:ve,onTouchend:Xe},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,u=>(t.openBlock(),t.createElementBlock("div",{key:u.id,class:t.normalizeClass(["tab-list-menu__item",{"tab-list-menu__item--active":e.sheets.indexOf(u)===e.activeSheetIndex}]),title:u.name,onClick:p=>Y(e.sheets.indexOf(u))},[t.createElementVNode("span",oc,t.toDisplayString(u.name),1),t.createElementVNode("button",{type:"button",class:"tab-list-menu__del",title:t.unref(D)(e.locale,"delete"),disabled:!R.value,onClick:t.withModifiers(p=>K(e.sheets.indexOf(u)),["stop"])},[...c[11]||(c[11]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])],8,rc)],10,nc))),128))],544),v.value?(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["tab-list-menu__nav",{"tab-list-menu__nav--disabled":!w.value}]),disabled:!w.value,onClick:c[6]||(c[6]=u=>G(1))},[...c[12]||(c[12]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],10,ac)):t.createCommentVNode("",!0)],36)):t.createCommentVNode("",!0)]),_:1})]))],32))}}),[["__scopeId","data-v-e00401ad"]]),sc=["placeholder","value"],uc=["placeholder","value"],dc={class:"find-bar__chk"},fc=["checked"],mc={class:"find-bar__chk"},pc=["checked"],hc={class:"find-bar__count"},gc=["title","disabled"],yc=["title","disabled"],bc=["disabled"],Cc=["disabled"],wc=["title"],vc=tl(t.defineComponent({__name:"find-replace-bar",props:{open:{type:Boolean},findText:{},replaceText:{},scope:{},matchCase:{type:Boolean},matchEntireCell:{type:Boolean},currentIndex:{},total:{},message:{},focusToken:{},locale:{},themeVars:{}},emits:["update:findText","update:replaceText","update:scope","update:matchCase","update:matchEntireCell","prev","next","replace","replace-all","close"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(null),i=t.computed(()=>o.total>0?`${o.currentIndex+1}/${o.total}`:o.message||""),r=t.computed(()=>[{label:D(o.locale,"scopeSheet"),value:"sheet"},{label:D(o.locale,"scopeWorkbook"),value:"workbook"},{label:D(o.locale,"scopeSelection"),value:"selection"}]);t.watch(()=>o.focusToken,()=>{t.nextTick(()=>{var m;return(m=a.value)==null?void 0:m.focus()})});function f(m){m.key==="Enter"?(m.preventDefault(),m.shiftKey?n("prev"):n("next")):m.key==="Escape"&&(m.preventDefault(),n("close"))}return(m,y)=>e.open?(t.openBlock(),t.createElementBlock("div",{key:0,class:"find-bar",style:t.normalizeStyle(e.themeVars)},[t.createElementVNode("input",{ref_key:"findInputRef",ref:a,class:"find-bar__input",placeholder:t.unref(D)(e.locale,"findPlaceholder"),value:e.findText,onInput:y[0]||(y[0]=k=>n("update:findText",k.target.value)),onKeydown:f},null,40,sc),t.createElementVNode("input",{class:"find-bar__input",placeholder:t.unref(D)(e.locale,"replacePlaceholder"),value:e.replaceText,onInput:y[1]||(y[1]=k=>n("update:replaceText",k.target.value)),onKeydown:f},null,40,uc),t.createVNode(ll,{class:"find-bar__dropdown","model-value":e.scope,options:r.value,title:t.unref(D)(e.locale,"findScope"),"onUpdate:modelValue":y[2]||(y[2]=k=>m.$emit("update:scope",k))},null,8,["model-value","options","title"]),t.createElementVNode("label",dc,[t.createElementVNode("input",{class:"find-bar__chk-input",type:"checkbox",checked:e.matchCase,onChange:y[3]||(y[3]=k=>n("update:matchCase",k.target.checked))},null,40,fc),y[10]||(y[10]=t.createElementVNode("span",{class:"find-bar__chk-box"},[t.createElementVNode("svg",{class:"find-bar__chk-tick",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M405 697L195 487l58-58 152 152 304-304 58 58z"})])],-1)),t.createTextVNode(t.toDisplayString(t.unref(D)(e.locale,"matchCase")),1)]),t.createElementVNode("label",mc,[t.createElementVNode("input",{class:"find-bar__chk-input",type:"checkbox",checked:e.matchEntireCell,onChange:y[4]||(y[4]=k=>n("update:matchEntireCell",k.target.checked))},null,40,pc),y[11]||(y[11]=t.createElementVNode("span",{class:"find-bar__chk-box"},[t.createElementVNode("svg",{class:"find-bar__chk-tick",viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M405 697L195 487l58-58 152 152 304-304 58 58z"})])],-1)),t.createTextVNode(t.toDisplayString(t.unref(D)(e.locale,"matchEntireCell")),1)]),t.createElementVNode("span",hc,t.toDisplayString(i.value),1),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--icon",title:t.unref(D)(e.locale,"findPrev"),disabled:e.total===0,onClick:y[5]||(y[5]=k=>n("prev"))},[...y[12]||(y[12]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M512 320a32 32 0 0 1 45.254 0l288 288a32 32 0 0 1-45.254 45.254L512 410.51 214.254 653.254A32 32 0 0 1 169 608l288-288z"})],-1)])],8,gc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--icon",title:t.unref(D)(e.locale,"findNext"),disabled:e.total===0,onClick:y[6]||(y[6]=k=>n("next"))},[...y[13]||(y[13]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M512 704a32 32 0 0 1-45.254 0l-288-288A32 32 0 0 1 214.254 370.746L512 613.49 809.746 370.746A32 32 0 0 1 855 416l-288 288z"})],-1)])],8,yc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--text",disabled:e.total===0,onClick:y[7]||(y[7]=k=>n("replace"))},t.toDisplayString(t.unref(D)(e.locale,"replace")),9,bc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--text",disabled:e.total===0,onClick:y[8]||(y[8]=k=>n("replace-all"))},t.toDisplayString(t.unref(D)(e.locale,"replaceAll")),9,Cc),t.createElementVNode("button",{class:"find-bar__btn find-bar__btn--close",title:t.unref(D)(e.locale,"findClose"),onClick:y[9]||(y[9]=k=>n("close"))},[...y[14]||(y[14]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])],8,wc)],4)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-3120909b"]]),kc={class:"nf-dialog__header"},Ec={class:"nf-dialog__title"},Sc={class:"nf-dialog__body"},Rc={class:"nf-field"},Mc={class:"nf-field__label"},xc={key:0,class:"nf-field"},Bc={class:"nf-field__label"},Tc={key:1,class:"nf-field nf-field--inline"},Dc={class:"nf-checkbox"},Nc={key:2,class:"nf-field"},Fc={class:"nf-field__label"},Ic={key:3,class:"nf-field"},Ac={class:"nf-field__label"},Vc={key:4,class:"nf-field"},Hc={class:"nf-field__label"},Oc={key:5,class:"nf-field"},Lc={class:"nf-field__label"},zc={key:6,class:"nf-field"},_c={class:"nf-field__label"},$c={class:"nf-field"},Wc={class:"nf-field__label"},Pc={class:"nf-dialog__footer"},Uc={class:"nf-preview"},Kc={class:"nf-preview__label"},Gc={class:"nf-preview__value"},Yc={class:"nf-dialog__actions"},Xc=tl(t.defineComponent({__name:"numberFormatDialog",props:{modelOpen:{type:Boolean,default:!1},locale:{default:"zh-CN"},currentFormat:{default:""},isCustom:{type:Boolean,default:!1},sampleValue:{default:"1234.5"}},emits:["update:modelOpen","apply"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref("general"),r=t.ref(2),f=t.ref(!1),m=t.ref("$"),y=t.ref("m/d/yyyy"),k=t.ref("h:mm:ss"),d=t.ref("m/d/yyyy h:mm:ss"),w=t.ref("[h]:mm:ss"),v=t.ref(""),R=t.ref(null),G=[{label:"¥",value:"¥"},{label:"$",value:"$"},{label:"€",value:"€"},{label:"£",value:"£"}],te=['yyyy"年"m"月"d"日"',"yyyy-mm-dd","yyyy/m/d",'m"月"d"日"'],Y=["m/d/yyyy","mm/dd/yyyy","d-mmm-yyyy","mmmm d, yyyy"],K=['yyyy"年"m"月"d"日" h:mm:ss','yyyy"年"m"月"d"日" hh:mm',"yyyy-mm-dd hh:mm:ss","yyyy/m/d h:mm"],C=["m/d/yyyy h:mm:ss","m/d/yyyy hh:mm","mm/dd/yyyy h:mm AM/PM","d-mmm-yyyy hh:mm:ss"],j=t.computed(()=>o.locale==="zh-CN"?[...te,...Y]:[...Y,...te]),q=["h:mm:ss","h:mm","hh:mm:ss","h:mm AM/PM",'hh"时"mm"分"ss"秒"',"H:mm:ss"],se=t.computed(()=>o.locale==="zh-CN"?[...K,...C]:[...C,...K]),Fe=["[h]:mm:ss","[h]:mm","mm:ss",'[h]"小时"mm"分"ss"秒"',"[h]:mm:ss.00",'d"天"h:mm:ss'],Qe={general:"nfGeneral",text:"nfText",number:"nfNumber",percent:"nfPercent",scientific:"nfScientific",accounting:"nfAccounting",financial:"nfFinancial",currency:"nfCurrency",currencyRounded:"nfCurrencyRounded",date:"nfDate",time:"nfTime",dateTime:"nfDateTime",duration:"nfDuration",custom:"nfCatCustom"},Ge=t.computed(()=>Ur.map(ae=>({label:D(o.locale,Qe[ae]),value:ae}))),be=G.map(ae=>({label:ae.label,value:ae.value})),ve=t.computed(()=>j.value.map(ae=>({label:ae,value:ae}))),Xe=q.map(ae=>({label:ae,value:ae})),Je=t.computed(()=>se.value.map(ae=>({label:ae,value:ae}))),gt=Fe.map(ae=>({label:ae,value:ae})),Ze=t.computed(()=>["number","currency","currencyRounded","accounting","financial"].includes(i.value)),lt=t.computed(()=>["currency","currencyRounded","accounting"].includes(i.value)),et=t.computed(()=>i.value==="date"),oe=t.computed(()=>i.value==="time"),pe=t.computed(()=>i.value==="dateTime"),g=t.computed(()=>i.value==="duration"),A=t.computed(()=>["number","currency","accounting","financial","percent","scientific"].includes(i.value));function L(){if(i.value==="general")return Wl;if(i.value==="text")return ul;if(i.value==="custom")return v.value;if(i.value==="date")return y.value;if(i.value==="time")return k.value;if(i.value==="dateTime")return d.value;if(i.value==="duration")return w.value;const ae=Math.max(0,Math.min(30,r.value));return i.value==="currency"||i.value==="currencyRounded"||i.value==="accounting"?$(i.value,ae,f.value,m.value):Jr(o.locale,i.value,ae,f.value)}function $(ae,Pe,at,Mt){const St=at?"#,##0":"0";if(ae==="currencyRounded")return Mt+St;const Rt=Pe>0?"."+"0".repeat(Pe):"",Ft=St+Rt;return ae==="currency"?Mt+Ft:`${Mt}${Ft};(${Mt}${Ft});${Mt}"-"`}function ee(ae){if(v.value=ae,dl(ae)){i.value="general";return}if(ae==="@"){i.value="text";return}const Pe=ae.replace(/\[[^\]]*\]/gi,Rt=>/\[h\]/i.test(Rt)?Rt:"");if(/\[h\]/i.test(Pe)&&!/[yd]/i.test(Pe)){i.value="duration",Fe.includes(ae)&&(w.value=ae);return}const at=/[yd]/i.test(Pe),Mt=/h|s|AM\/PM/i.test(Pe);if(at&&Mt){i.value="dateTime",se.value.includes(ae)&&(d.value=ae);return}if(at||/AM\/PM/i.test(Pe)){Mt&&!at?(i.value="time",q.includes(ae)&&(k.value=ae)):(i.value="date",j.value.includes(ae)&&(y.value=ae));return}if(ae.includes("%")){i.value="percent",r.value=ie(ae);return}if(/E[+-]/i.test(ae)){i.value="scientific",r.value=ie(ae);return}const St=G.find(Rt=>ae.startsWith(Rt.value));if(ae.includes("[Red](")){i.value="financial",f.value=ae.includes(","),r.value=ie(ae);return}if(St){ae.includes("(")?(i.value="accounting",m.value=St.value,f.value=ae.includes(","),r.value=ie(ae)):/\.\d/.test(ae.slice(St.value.length))?(i.value="currency",m.value=St.value,f.value=ae.includes(","),r.value=ie(ae)):(i.value="currencyRounded",m.value=St.value,f.value=ae.includes(","));return}i.value="number",f.value=ae.includes(","),r.value=ie(ae)}function ie(ae){const Pe=ae.match(/\.([0#?]+)/);return Pe?Pe[1].length:0}function re(){i.value!=="custom"&&(v.value=L())}function he(){}function ce(){y.value=j.value[0],k.value=q[0],d.value=se.value[0],w.value=Fe[0]}function V(){a.value=!0,o.modelOpen!==void 0&&n("update:modelOpen",!0),ce(),ee(o.currentFormat??""),o.isCustom&&(i.value="custom"),t.nextTick(()=>{var ae;return(ae=R.value)==null?void 0:ae.focus()})}function c(){a.value=!1,o.modelOpen!==void 0&&n("update:modelOpen",!1)}function u(){n("apply",v.value),c()}function p(){c()}function H(ae){ae.key==="Escape"&&c()}t.watch(()=>o.modelOpen,ae=>{ae&&!a.value?V():!ae&&a.value&&c()});const ct=t.computed(()=>bl(o.sampleValue,v.value,o.locale));return(ae,Pe)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"nf-dialog"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"nf-dialog__mask",onMousedown:p,onKeydown:H},[t.createElementVNode("div",{class:t.normalizeClass(["nf-dialog",{"nf-dialog--zh":e.locale==="zh-CN"}]),onMousedown:Pe[9]||(Pe[9]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",kc,[t.createElementVNode("span",Ec,t.toDisplayString(t.unref(D)(e.locale,"nfDialogTitle")),1),t.createElementVNode("button",{class:"nf-dialog__close",type:"button",onClick:c},[...Pe[10]||(Pe[10]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])])]),t.createElementVNode("div",Sc,[t.createElementVNode("div",Rc,[t.createElementVNode("label",Mc,t.toDisplayString(t.unref(D)(e.locale,"nfCategory")),1),t.createVNode(ll,{class:"nf-field__dropdown","model-value":i.value,options:Ge.value,"onUpdate:modelValue":Pe[0]||(Pe[0]=at=>i.value=at),onChange:re},null,8,["model-value","options"])]),A.value?(t.openBlock(),t.createElementBlock("div",xc,[t.createElementVNode("label",Bc,t.toDisplayString(t.unref(D)(e.locale,"nfDecimals")),1),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pe[1]||(Pe[1]=at=>r.value=at),class:"nf-field__input",type:"number",min:"0",max:"30",onInput:re},null,544),[[t.vModelText,r.value,void 0,{number:!0}]])])):t.createCommentVNode("",!0),Ze.value?(t.openBlock(),t.createElementBlock("div",Tc,[t.createElementVNode("label",Dc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pe[2]||(Pe[2]=at=>f.value=at),type:"checkbox",onChange:re},null,544),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",null,t.toDisplayString(t.unref(D)(e.locale,"nfThousands")),1)])])):t.createCommentVNode("",!0),lt.value?(t.openBlock(),t.createElementBlock("div",Nc,[t.createElementVNode("label",Fc,t.toDisplayString(t.unref(D)(e.locale,"nfSymbol")),1),t.createVNode(ll,{class:"nf-field__dropdown","model-value":m.value,options:t.unref(be),"onUpdate:modelValue":Pe[3]||(Pe[3]=at=>m.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),et.value?(t.openBlock(),t.createElementBlock("div",Ic,[t.createElementVNode("label",Ac,t.toDisplayString(t.unref(D)(e.locale,"nfDateFormat")),1),t.createVNode(ll,{class:"nf-field__dropdown","model-value":y.value,options:ve.value,"onUpdate:modelValue":Pe[4]||(Pe[4]=at=>y.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),oe.value?(t.openBlock(),t.createElementBlock("div",Vc,[t.createElementVNode("label",Hc,t.toDisplayString(t.unref(D)(e.locale,"nfTimeFormat")),1),t.createVNode(ll,{class:"nf-field__dropdown","model-value":k.value,options:t.unref(Xe),"onUpdate:modelValue":Pe[5]||(Pe[5]=at=>k.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),pe.value?(t.openBlock(),t.createElementBlock("div",Oc,[t.createElementVNode("label",Lc,t.toDisplayString(t.unref(D)(e.locale,"nfDateTime")),1),t.createVNode(ll,{class:"nf-field__dropdown","model-value":d.value,options:Je.value,"onUpdate:modelValue":Pe[6]||(Pe[6]=at=>d.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),g.value?(t.openBlock(),t.createElementBlock("div",zc,[t.createElementVNode("label",_c,t.toDisplayString(t.unref(D)(e.locale,"nfDuration")),1),t.createVNode(ll,{class:"nf-field__dropdown","model-value":w.value,options:t.unref(gt),"onUpdate:modelValue":Pe[7]||(Pe[7]=at=>w.value=at),onChange:re},null,8,["model-value","options"])])):t.createCommentVNode("",!0),t.createElementVNode("div",$c,[t.createElementVNode("label",Wc,t.toDisplayString(t.unref(D)(e.locale,"nfCustomCode")),1),t.withDirectives(t.createElementVNode("textarea",{ref_key:"customCodeRef",ref:R,"onUpdate:modelValue":Pe[8]||(Pe[8]=at=>v.value=at),class:"nf-field__textarea",rows:"2",spellcheck:"false",onInput:he},null,544),[[t.vModelText,v.value]])])]),t.createElementVNode("div",Pc,[t.createElementVNode("div",Uc,[t.createElementVNode("span",Kc,t.toDisplayString(t.unref(D)(e.locale,"nfPreview")),1),t.createElementVNode("span",Gc,t.toDisplayString(ct.value||"—"),1)]),t.createElementVNode("div",Yc,[t.createElementVNode("button",{class:"nf-btn nf-btn--primary",type:"button",onClick:u},t.toDisplayString(t.unref(D)(e.locale,"ok")),1),t.createElementVNode("button",{class:"nf-btn",type:"button",onClick:c},t.toDisplayString(t.unref(D)(e.locale,"cancel")),1)])])],34)],32)):t.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-39792a0b"]]),jc={class:"sort-confirm__header"},Zc={class:"sort-confirm__title"},qc={class:"sort-confirm__body"},Jc={class:"sort-confirm__message"},Qc={class:"sort-confirm__options"},es={class:"sort-confirm__option"},ts={class:"sort-confirm__option"},ls={class:"sort-confirm__footer"},ns=tl(t.defineComponent({__name:"sortConfirmDialog",props:{modelOpen:{type:Boolean,default:!1},locale:{default:"zh-CN"}},emits:["update:modelOpen","confirm","cancel"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref(!0),r=t.ref(null);t.watch(()=>o.modelOpen,v=>{v&&!a.value?f():!v&&a.value&&m()});function f(){i.value=!0,a.value=!0,o.modelOpen!==void 0&&n("update:modelOpen",!0),t.nextTick(()=>{var R;const v=(R=r.value)==null?void 0:R.querySelector(".sort-confirm__btn--primary");v==null||v.focus()})}function m(){a.value=!1,o.modelOpen!==void 0&&n("update:modelOpen",!1)}function y(){w()}function k(v){v.key==="Escape"&&w()}function d(){n("confirm",i.value),m()}function w(){n("cancel"),m()}return(v,R)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"sort-confirm"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"sort-confirm__mask",onMousedown:y,onKeydown:k},[t.createElementVNode("div",{ref_key:"dialogRef",ref:r,class:"sort-confirm",onMousedown:R[2]||(R[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",jc,[t.createElementVNode("span",Zc,t.toDisplayString(t.unref(D)(e.locale,"sortReminderTitle")),1),t.createElementVNode("button",{class:"sort-confirm__close",type:"button",onClick:w},[...R[3]||(R[3]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])])]),t.createElementVNode("div",qc,[t.createElementVNode("p",Jc,t.toDisplayString(t.unref(D)(e.locale,"sortReminderMessage")),1),t.createElementVNode("div",Qc,[t.createElementVNode("label",es,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":R[0]||(R[0]=G=>i.value=G),type:"radio",value:!0},null,512),[[t.vModelRadio,i.value]]),t.createElementVNode("span",null,t.toDisplayString(t.unref(D)(e.locale,"sortExpandSelection")),1)]),t.createElementVNode("label",ts,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":R[1]||(R[1]=G=>i.value=G),type:"radio",value:!1},null,512),[[t.vModelRadio,i.value]]),t.createElementVNode("span",null,t.toDisplayString(t.unref(D)(e.locale,"sortCurrentSelection")),1)])])]),t.createElementVNode("div",ls,[t.createElementVNode("button",{class:"sort-confirm__btn sort-confirm__btn--primary",type:"button",onClick:d},t.toDisplayString(t.unref(D)(e.locale,"sort")),1),t.createElementVNode("button",{class:"sort-confirm__btn",type:"button",onClick:w},t.toDisplayString(t.unref(D)(e.locale,"cancel")),1)])],544)],32)):t.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-d26d5917"]]);function ht(e){let l="",o=e;do l=String.fromCharCode(65+o%26)+l,o=Math.floor(o/26)-1;while(o>=0);return l}function mo(e){let l=0;for(let o=0;o<e.length;o++)l=l*26+(e.toUpperCase().charCodeAt(o)-64);return l-1}function wn(e){if(e==null)return null;if(typeof e=="number")return e;if(typeof e=="string"){const l=parseFloat(e);return e.endsWith("%")||isNaN(l)?null:l}return null}function po(e){navigator.clipboard.writeText(e).catch(()=>{const l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l)})}function Nn(e,l){return`${e},${l}`}function Ln(e,l,o){const n=e.match(/^\$?([A-Z]+)\$?(\d+)$/i);if(!n)return null;const a=mo(n[1]),i=parseInt(n[2],10)-1;return a<0||a>=l||i<0||i>=o?null:{col:a,row:i}}function an(e,l){if(!l)return{x:0,y:0};const o=l.getBoundingClientRect();return{x:e.clientX-o.left,y:e.clientY-o.top}}const zo=[{name:"SUM",snippet:"SUM(A1:A10)"},{name:"AVERAGE",snippet:"AVERAGE(A1:A10)"},{name:"COUNT",snippet:"COUNT(A1:A10)"},{name:"IF",snippet:"IF(A1>0, B1, C1)"},{name:"VLOOKUP",snippet:"VLOOKUP(A1, B1:C10, 2, FALSE)"},{name:"CONCATENATE",snippet:"CONCATENATE(A1, B1)"},{name:"MAX",snippet:"MAX(A1:A10)"},{name:"MIN",snippet:"MIN(A1:A10)"},{name:"SIN",snippet:"SIN(A1)"},{name:"SUMIF",snippet:'SUMIF(A1:A10, ">0", B1:B10)'},{name:"PMT",snippet:"PMT(0.05/12, 360, 100000)"},{name:"STDEV",snippet:"STDEV(A1:A10)"}],os={SUM:{min:1,max:1},AVERAGE:{min:1,max:1},COUNT:{min:1,max:1},IF:{min:3,max:3},VLOOKUP:{min:3,max:4},CONCATENATE:{min:1,max:1/0},MAX:{min:1,max:1},MIN:{min:1,max:1},SIN:{min:1,max:1},SUMIF:{min:2,max:3},PMT:{min:3,max:5},STDEV:{min:1,max:1}};function rs(e){let l=0,o=null;for(let n=0;n<e.length;n++){const a=e[n];if(o){a===o&&(e[n+1]===o?n++:o=null);continue}if(a==='"'||a==="'"){o=a;continue}if(a==="(")l++;else if(a===")"&&(l--,l<0))return!1}return l===0}function as(e){const l=e.trim();if(!l.startsWith("="))return{ok:!1,name:null};const o=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(l.slice(1).trim());if(!o)return{ok:!1,name:null};const n=o[1].toUpperCase(),a=os[n];if(!a)return{ok:!1,name:n};const i=o[2];if(!rs(i))return{ok:!1,name:n};const r=vn(i),f=r.length===1&&r[0].trim()===""?0:r.length;return f<a.min||f>a.max?{ok:!1,name:n}:r.some(m=>m.trim()==="")?{ok:!1,name:n}:{ok:!0,name:n}}function Fn(e,l,o){const n=e.split(":");if(n.length!==2)return null;const a=Ln(n[0],l,o),i=Ln(n[1],l,o);return!a||!i?null:{sc:Math.min(a.col,i.col),sr:Math.min(a.row,i.row),ec:Math.max(a.col,i.col),er:Math.max(a.row,i.row)}}function _o(e){const l=e.trim();if(l==="")return"";const o=Number(l);return!isNaN(o)&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(l)?o:e}function Tl(e,l,o,n,a){const i=o[Nn(e,l)];if(!i)return"";const r=i.value;return r.startsWith("=")?Wo(Nn(e,l),o,n,a):_o(r)}function $o(e,l,o,n,a){const i=Tl(e,l,o,n,a);if(i===null)return 0;if(typeof i=="number")return i;const r=parseFloat(String(i));return isNaN(r)?0:r}const zn=new Map,Xn=new Set;function _n(){zn.clear(),Xn.clear()}function Wo(e,l,o,n){return is(e,l,o,n,0)}function is(e,l,o,n,a){if(Xn.has(e))return null;if(zn.has(e))return zn.get(e);Xn.add(e);const i=l[e];let r;if(!i)r=null;else{const f=i.value;if(!f.startsWith("="))r=_o(f);else{const m=f.slice(1).trim(),y=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(m);r=y?Go(y[1].toUpperCase(),y[2],l,o,n,a+1):Wt(m,l,o,n,a+1)}}return Xn.delete(e),zn.set(e,r),r}function ho(e){return e===null||e===""?!1:typeof e=="number"?e!==0:!0}function Po(e,l){return typeof e=="number"&&typeof l=="number"?e===l:String(e??"")===String(l??"")}function Uo(e,l,o){let n;if(typeof e=="number"&&typeof l=="number")n=e<l?-1:e>l?1:0;else{const a=String(e??""),i=String(l??"");n=a<i?-1:a>i?1:0}switch(o){case"=":return n===0;case"<>":return n!==0;case"<":return n<0;case">":return n>0;case"<=":return n<=0;case">=":return n>=0}return!1}function Ko(e,l,o,n){const a=e.trim();if(a.length>=2&&(a[0]==='"'&&a[a.length-1]==='"'||a[0]==="'"&&a[a.length-1]==="'"))return a.slice(1,-1);const i=Number(a);return!isNaN(i)&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(a)?i:a}function cs(e,l,o,n,a,i){let f=l.trim();f.length>=2&&(f[0]==='"'&&f[f.length-1]==='"'||f[0]==="'"&&f[f.length-1]==="'")&&(f=f.slice(1,-1));const m=/^([<>=]+)([\s\S]*)$/.exec(f);if(m){const k=m[1],d=Ko(m[2]);return Uo(e,d,k)}const y=Ko(f);return Po(e,y)}function ss(e,l,o,n,a){const i=e.trim(),r=["<=",">=","<>"];let f=null,m=-1,y=null,k=0;for(let w=0;w<i.length;w++){const v=i[w];if(y){v===y&&(i[w+1]===y?w++:y=null);continue}if(v==='"'||v==="'"){y=v;continue}if(v==="("&&k++,v===")"&&k--,k===0&&(v==="<"||v===">"||v==="=")){const R=i.slice(w,w+2);f=r.includes(R)?R:v,m=w;break}}if(f&&m>=0){const w=i.slice(0,m).trim(),v=i.slice(m+f.length).trim(),R=Wt(w,l,o,n,a),G=Wt(v,l,o,n,a);return Uo(R,G,f)}const d=Wt(i,l,o,n,a);return ho(d)}function vn(e){const l=[];let o=0,n=null,a="";for(let i=0;i<e.length;i++){const r=e[i];if(n){a+=r,r===n&&(e[i+1]===n?(i++,a+=n):n=null);continue}if(r==='"'||r==="'"){n=r,a+=r;continue}if(r==="("&&o++,r===")"&&o--,r===","&&o===0){l.push(a),a="";continue}a+=r}return l.push(a),l}function Wt(e,l,o,n,a){if(a>20)return null;const i=e.trim();if(i==="")return null;const r=i.toUpperCase();if(r==="TRUE")return 1;if(r==="FALSE")return 0;const f=us(i);if(f.length===0)return null;let m=0;const y=()=>{let v=k();for(;m<f.length;){const R=f[m];if(R.type==="op"&&(R.val==="+"||R.val==="-"))m++,v=go(v,k(),R.val);else break}return v},k=()=>{let v=d();for(;m<f.length;){const R=f[m];if(R.type==="op"&&(R.val==="*"||R.val==="/"))m++,v=go(v,d(),R.val);else break}return v},d=()=>{const v=f[m];return v&&v.type==="op"&&v.val==="-"?(m++,go(0,d(),"-")):v&&v.type==="op"&&v.val==="+"?(m++,d()):w()},w=()=>{const v=f[m];if(!v)return null;if(v.type==="num")return m++,Number(v.val);if(v.type==="str")return m++,v.val;if(v.type==="lp"){m++;const R=y();return f[m]&&f[m].type==="rp"&&m++,R}if(v.type==="ref"){m++;const R=Ln(v.val,o,n);return R?Tl(R.col,R.row,l,o,n):null}if(v.type==="func"){const R=v.val.toUpperCase();if(m++,f[m]&&f[m].type==="lp"){const G=f[m];let te=0,Y=null,K=m;for(;K<f.length;K++)if(f[K].type==="lp")te++;else if(f[K].type==="rp"&&(te--,te===0)){Y=f[K];break}if(Y){const C=i.slice(G.start+1,Y.start);return m=K+1,Go(R,C,l,o,n,a+1)}}return null}return m++,null};return y()}function us(e){const l=[];let o=0;for(;o<e.length;){const n=e[o];if(/\s/.test(n)){o++;continue}if(n==='"'||n==="'"){const a=n,i=o;o++;let r="";for(;o<e.length;){if(e[o]===a){if(e[o+1]===a){r+=a,o+=2;continue}o++;break}r+=e[o],o++}l.push({type:"str",val:r,start:i});continue}if(/[0-9]/.test(n)||n==="."){const a=o;let i="";for(n==="."&&(i+=".",o++);o<e.length&&/[0-9]/.test(e[o]);)i+=e[o],o++;if(e[o]===".")for(i+=".",o++;o<e.length&&/[0-9]/.test(e[o]);)i+=e[o],o++;if(e[o]==="e"||e[o]==="E")for(i+=e[o],o++,(e[o]==="+"||e[o]==="-")&&(i+=e[o],o++);o<e.length&&/[0-9]/.test(e[o]);)i+=e[o],o++;l.push({type:"num",val:i,start:a});continue}if(/[A-Za-z_]/.test(n)){const a=o;let i="";for(;o<e.length&&/[A-Za-z0-9_]/.test(e[o]);)i+=e[o],o++;e[o]==="("?l.push({type:"func",val:i,start:a}):l.push({type:"ref",val:i,start:a});continue}if(n==="("){l.push({type:"lp",val:n,start:o}),o++;continue}if(n===")"){l.push({type:"rp",val:n,start:o}),o++;continue}if(n===","){l.push({type:"comma",val:n,start:o}),o++;continue}if(n==="+"||n==="-"||n==="*"||n==="/"){l.push({type:"op",val:n,start:o}),o++;continue}o++}return l}function go(e,l,o){if(typeof e!="number"||typeof l!="number")return null;switch(o){case"+":return e+l;case"-":return e-l;case"*":return e*l;case"/":return l===0?null:e/l}return null}function Go(e,l,o,n,a,i){switch(e){case"SUM":case"AVERAGE":case"COUNT":{const r=Fn(l.trim(),n,a);if(!r)return null;if(e==="COUNT"){let m=0;for(let y=r.sc;y<=r.ec;y++)for(let k=r.sr;k<=r.er;k++)typeof Tl(y,k,o,n,a)=="number"&&m++;return m}let f=0;for(let m=r.sc;m<=r.ec;m++)for(let y=r.sr;y<=r.er;y++)f+=$o(m,y,o,n,a);if(isNaN(f))return null;if(e==="AVERAGE"){const m=(r.ec-r.sc+1)*(r.er-r.sr+1);return m===0?null:f/m}return f}case"IF":{const r=vn(l);if(r.length<3)return null;const f=ss(r[0],o,n,a,i);return Wt(f?r[1]:r[2],o,n,a,i)}case"VLOOKUP":{const r=vn(l);if(r.length<3)return null;const f=Wt(r[0],o,n,a,i),m=Fn(r[1].trim(),n,a);if(!m)return null;const y=Wt(r[2],o,n,a,i),k=typeof y=="number"?y:parseFloat(String(y));if(isNaN(k))return null;const d=m.sc+(k-1);if(d<m.sc||d>m.ec)return null;if(r.length>=4?ho(Wt(r[3],o,n,a,i)):!1){let v=-1,R=-1/0;for(let G=m.sr;G<=m.er;G++){const te=Tl(m.sc,G,o,n,a);typeof te=="number"&&typeof f=="number"&&te<=f&&te>R&&(R=te,v=G)}return v>=0?Tl(d,v,o,n,a):null}for(let v=m.sr;v<=m.er;v++){const R=Tl(m.sc,v,o,n,a);if(Po(R,f))return Tl(d,v,o,n,a)}return null}case"CONCATENATE":{const r=vn(l);let f="";for(const m of r){const y=Wt(m,o,n,a,i);f+=y===null?"":typeof y=="number"?String(y):y}return f}case"MAX":case"MIN":{const r=Fn(l.trim(),n,a);if(!r)return null;const f=[];for(let m=r.sc;m<=r.ec;m++)for(let y=r.sr;y<=r.er;y++){const k=Tl(m,y,o,n,a);typeof k=="number"&&f.push(k)}return f.length===0?null:e==="MAX"?Math.max(...f):Math.min(...f)}case"STDEV":{const r=Fn(l.trim(),n,a);if(!r)return null;const f=[];for(let d=r.sc;d<=r.ec;d++)for(let w=r.sr;w<=r.er;w++){const v=Tl(d,w,o,n,a);typeof v=="number"&&f.push(v)}const m=f.length;if(m<2)return null;const y=f.reduce((d,w)=>d+w,0)/m,k=f.reduce((d,w)=>d+Math.pow(w-y,2),0)/(m-1);return Math.sqrt(k)}case"SIN":{const r=vn(l);if(r.length!==1)return null;const f=Wt(r[0],o,n,a,i);return typeof f!="number"?null:Math.sin(f)}case"SUMIF":{const r=vn(l);if(r.length<2||r.length>3)return null;const f=Fn(r[0].trim(),n,a);if(!f)return null;const m=r.length===3?Fn(r[2].trim(),n,a):f;if(!m)return null;let y=0;for(let k=f.sr;k<=f.er;k++)for(let d=f.sc;d<=f.ec;d++){const w=Tl(d,k,o,n,a);cs(w,r[1])&&(y+=$o(m.sc+(d-f.sc),m.sr+(k-f.sr),o,n,a))}return y}case"PMT":{const r=vn(l);if(r.length<3||r.length>5)return null;const f=Wt(r[0],o,n,a,i),m=Wt(r[1],o,n,a,i),y=Wt(r[2],o,n,a,i);if(typeof f!="number"||typeof m!="number"||typeof y!="number")return null;const k=r.length>=4?Wt(r[3],o,n,a,i):0,d=typeof k=="number"?k:0,w=r.length>=5?Wt(r[4],o,n,a,i):0,v=ho(w)?1:0;if(f===0)return m===0?null:-(y+d)/m;const R=Math.pow(1+f,m);return-(d+y*R)*f/((1+f*v)*(R-1))}default:return null}}function jn(e,l,o){const n=[],a=/(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;let i;for(;(i=a.exec(e))!==null;){const r=Ln(i[1],l,o);if(r)if(i[2]){const f=Ln(i[2],l,o);if(!f)continue;for(let m=Math.min(r.col,f.col);m<=Math.max(r.col,f.col);m++)for(let y=Math.min(r.row,f.row);y<=Math.max(r.row,f.row);y++)n.push(Nn(m,y))}else n.push(Nn(r.col,r.row))}return n}function Yo(e,l,o,n,a){const i=o[Nn(e,l)];if(!i)return"";const r=i.value;if(!r.startsWith("="))return r;const f=Wo(Nn(e,l),o,n,a);return f===null?"#ERROR":String(f)}function Xo(e,l,o,n,a,i){return l===0&&o===0?e:e.replace(/(\$?)([A-Z]+)(\$?)(\d+)/gi,(r,f,m,y,k)=>{const d=f?mo(m):mo(m)+l,w=y?parseInt(k,10)-1:parseInt(k,10)-1+o;let v;d<0?v="A":d>=n?v=i(n-1):v=i(d);let R;return w<0?R="1":w>=a?R=String(a):R=String(w+1),(f||"")+v+(y||"")+R})}class ds{constructor(){this.deps=new Map,this.rev=new Map,this.dirty=new Set}clear(l){var n;const o=this.deps.get(l);if(o){for(const a of o)(n=this.rev.get(a))==null||n.delete(l);this.deps.delete(l)}}set(l,o){if(this.clear(l),o.length!==0){this.deps.set(l,o);for(const n of o)this.rev.has(n)||this.rev.set(n,new Set),this.rev.get(n).add(l)}}markDirty(l){const o=[l];for(;o.length>0;){const n=o.pop(),a=this.rev.get(n);if(a)for(const i of a)this.dirty.has(i)||(this.dirty.add(i),o.push(i))}}getDirtyAndClear(){const l=this.dirty;return this.dirty=new Set,l}rebuild(l,o,n){this.deps.clear(),this.rev.clear(),this.dirty.clear(),zn.clear();for(const[a,i]of Object.entries(l))if(i.value.startsWith("=")){const r=jn(i.value.slice(1),o,n);this.set(a,r)}}}const fs={class:"ifn-dialog__header"},ms={class:"ifn-dialog__title"},ps={class:"ifn-dialog__body"},hs={class:"ifn-dialog__field"},gs={class:"ifn-dialog__label"},ys={key:0,class:"ifn-dialog__desc"},bs={class:"ifn-dialog__field"},Cs={class:"ifn-dialog__label"},ws={class:"ifn-dialog__footer"},vs=["disabled"],ks=tl(t.defineComponent({__name:"insertFunctionDialog",props:{modelOpen:{type:Boolean,default:!1},locale:{default:"zh-CN"}},emits:["update:modelOpen","insert","cancel"],setup(e,{emit:l}){const o=e,n=l,a=t.ref(!1),i=t.ref(""),r=t.ref(""),f=t.ref(null),m=t.ref(null),y={SUM:"fnDescSum",AVERAGE:"fnDescAverage",COUNT:"fnDescCount",IF:"fnDescIf",VLOOKUP:"fnDescVlookup",CONCATENATE:"fnDescConcatenate",MAX:"fnDescMax",MIN:"fnDescMin",SIN:"fnDescSin",SUMIF:"fnDescSumif",PMT:"fnDescPmt",STDEV:"fnDescStdev"},k=t.computed(()=>zo.map(q=>({label:q.name,value:q.name}))),d=t.computed(()=>{const q=String(i.value??"");return q?D(o.locale,y[q]??""):""}),w=t.computed(()=>as(r.value)),v=t.computed(()=>i.value===""||i.value===null||!r.value.trim()||!w.value.ok?!1:w.value.name===String(i.value).toUpperCase());t.watch(()=>o.modelOpen,q=>{q&&!a.value?R():!q&&a.value&&G()});function R(){r.value="",i.value="",a.value=!0,o.modelOpen!==void 0&&n("update:modelOpen",!0),t.nextTick(()=>{const q=f.value;if(q)try{q.focus({preventScroll:!0}),q.setSelectionRange(q.value.length,q.value.length)}catch{}})}function G(){a.value=!1,o.modelOpen!==void 0&&n("update:modelOpen",!1)}function te(q){i.value=q;const se=zo.find(Fe=>Fe.name===String(q));se&&(r.value="",Y(se.snippet))}function Y(q){const se=r.value,Fe=f.value,Qe=Fe?Fe.selectionStart??se.length:se.length,Ge=Fe?Fe.selectionEnd??se.length:se.length,be=se.trim()?q:"="+q;r.value=se.slice(0,Qe)+be+se.slice(Ge),t.nextTick(()=>{const ve=f.value;if(!ve)return;const Xe=Qe+be.length;try{ve.focus({preventScroll:!0}),ve.setSelectionRange(Xe,Xe)}catch{}})}function K(){n("insert",r.value),G()}function C(){n("cancel"),G()}function j(q){q.key==="Escape"&&(q.stopPropagation(),C())}return(q,se)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"ifn-dialog"},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"ifn-dialog__mask",onMousedown:t.withModifiers(C,["self"]),onKeydown:j},[t.createElementVNode("div",{ref_key:"dialogRef",ref:m,class:"ifn-dialog",onMousedown:se[1]||(se[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",fs,[t.createElementVNode("span",ms,t.toDisplayString(t.unref(D)(e.locale,"insertFunctionTitle")),1),t.createElementVNode("button",{class:"ifn-dialog__close",type:"button",onClick:C},[...se[2]||(se[2]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[t.createElementVNode("path",{d:"M571.733333 512l288.533334-288.533333c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0L512 452.266667 223.466667 164.266667c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333L452.266667 512 164.266667 800c-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 19.2 12.8 29.866666 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8L512 571.733333l288.533333 288.533334c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8 17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z"})],-1)])])]),t.createElementVNode("div",ps,[t.createElementVNode("div",hs,[t.createElementVNode("label",gs,t.toDisplayString(t.unref(D)(e.locale,"insertFunctionSelectLabel")),1),t.createVNode(ll,{class:"ifn-dialog__dropdown","model-value":i.value,options:k.value,searchable:!0,"search-placeholder":t.unref(D)(e.locale,"insertFunctionSearchPlaceholder"),"fallback-label":t.unref(D)(e.locale,"insertFunctionPlaceholder"),title:t.unref(D)(e.locale,"insertFunctionSelectLabel"),"onUpdate:modelValue":te},null,8,["model-value","options","search-placeholder","fallback-label","title"]),d.value?(t.openBlock(),t.createElementBlock("div",ys,t.toDisplayString(d.value),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",bs,[t.createElementVNode("label",Cs,t.toDisplayString(t.unref(D)(e.locale,"insertFunctionFormulaLabel")),1),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textareaRef",ref:f,"onUpdate:modelValue":se[0]||(se[0]=Fe=>r.value=Fe),class:"ifn-dialog__textarea",spellcheck:"false"},null,512),[[t.vModelText,r.value]])])]),t.createElementVNode("div",ws,[t.createElementVNode("button",{class:"ifn-dialog__btn ifn-dialog__btn--primary",type:"button",disabled:!v.value,onClick:K},t.toDisplayString(t.unref(D)(e.locale,"insertFunctionBtn")),9,vs),t.createElementVNode("button",{class:"ifn-dialog__btn",type:"button",onClick:C},t.toDisplayString(t.unref(D)(e.locale,"cancel")),1)])],544)],32)):t.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-f4e459b6"]]),$n="__filter_blank__";function yo(e,l,o,n){if(Ul(e))return Number(e);if(n==="date"){const a=Dn(e,o);if(a)return a.serial}return null}function Zn(e,l,o){if(e==null)return null;if(Ul(e))return Number(e);if(l==="date"){const n=Dn(e,o);if(n)return n.serial}return null}function Es(e,l,o,n,a){const i=bl(l,o,n);switch(e.operator){case"blank":return l.trim()==="";case"notBlank":return l.trim()!=="";case"equals":case"notEquals":{const r=e.operator==="equals";if(a==="number"||a==="date"){const m=yo(l,o,n,a),y=Zn(e.value,a,n);return m==null||y==null?!1:r?m===y:m!==y}const f=i.toLowerCase()===(e.value??"").toLowerCase();return r?f:!f}case"contains":return i.toLowerCase().includes((e.value??"").toLowerCase());case"notContains":return!i.toLowerCase().includes((e.value??"").toLowerCase());case"startsWith":return i.toLowerCase().startsWith((e.value??"").toLowerCase());case"endsWith":return i.toLowerCase().endsWith((e.value??"").toLowerCase());case"gt":case"gte":case"lt":case"lte":{const r=yo(l,o,n,a),f=Zn(e.value,a,n);return r==null||f==null?!1:e.operator==="gt"?r>f:e.operator==="gte"?r>=f:e.operator==="lt"?r<f:r<=f}case"between":{const r=yo(l,o,n,a),f=Zn(e.value,a,n),m=Zn(e.value2,a,n);if(r==null||f==null||m==null)return!1;const y=Math.min(f,m),k=Math.max(f,m);return r>=y&&r<=k}}return!0}function jo(e,l,o,n){if(e.type==="values"){const a=e.values??[];if(a.length===0)return!0;if(l.trim()==="")return a.includes($n);const i=bl(l,o,n);return a.includes(l)||a.includes(i)}return e.condition?Es(e.condition,l,o,n,e.type):!0}function Ss(e,l,o,n){if(!e)return!0;const{columns:a,range:i}=e;for(const r in a){const f=Number(r);if(f<i.startCol||f>i.endCol)continue;const m=a[r],y=o.getValue(f,l),k=o.getFormat(f,l);if(!jo(m,y,k,n))return!1}return!0}function Rs(e,l,o,n){const a=new Set,i=[];let r=!1;const{range:f,columns:m}=e;for(let k=f.startRow+1;k<=f.endRow;k++){let d=!0;for(const R in m){const G=Number(R);if(G===l)continue;const te=m[R];if(!jo(te,o.getValue(G,k),o.getFormat(G,k),n)){d=!1;break}}if(!d)continue;const w=o.getValue(l,k),v=bl(w,o.getFormat(l,k),n);if(w.trim()===""){r=!0;continue}a.has(v)||(a.add(v),i.push(v))}return i.length>0&&i.every(k=>Ul(k))?i.sort((k,d)=>Number(k)-Number(d)):i.sort((k,d)=>k.localeCompare(d,n,{numeric:!0})),{values:i,hasBlank:r}}function Zo(e){var l;return e?e.type==="values"?(((l=e.values)==null?void 0:l.length)??0)>0:!!e.condition:!1}const Ms={class:"filter-popup__head"},xs={class:"filter-popup__head-label"},Bs={key:0,class:"filter-popup__head-badge"},Ts={class:"filter-popup__search"},Ds=["placeholder"],Ns={class:"filter-popup__tools"},Fs={class:"filter-popup__count"},Is=["checked","onChange"],As={class:"filter-popup__item-label"},Vs={key:0,class:"filter-popup__item-note"},Hs={key:0,class:"filter-popup__empty"},Os={class:"filter-popup__modes"},Ls={key:1,class:"filter-popup__cond"},zs={class:"filter-popup__cond-row"},_s=["value"],$s={key:0,class:"filter-popup__cond-row"},Ws={class:"filter-popup__cond-and"},Ps={key:1,class:"filter-popup__cond-row"},Us=["placeholder"],Ks={class:"filter-popup__footer"},bo=248,qn=28,Gs=252,Ys=tl(t.defineComponent({__name:"filter-popup",props:{col:{},anchor:{},locale:{default:"zh-CN"},headerLabel:{},getFilter:{},setFilter:{},setFilterColumn:{},clearFilterColumn:{},getColumnCandidates:{},close:{}},setup(e){const l=e,o=t.ref(null),n=t.ref(null),a=t.ref(null),i=t.ref({left:0,top:0}),r=t.ref("values"),f=t.ref(""),m=t.ref(new Set),y=t.ref(!1),k=t.ref(0),d=t.ref(null),w=t.ref("equals"),v=t.ref(""),R=t.ref(""),G=t.computed(()=>l.getColumnCandidates(l.col)),te=t.computed(()=>f.value.trim()!==""),Y=t.computed(()=>{const V=f.value.trim().toLowerCase();return V?G.value.values.filter(c=>c.toLowerCase().includes(V)):G.value.values}),K=t.computed(()=>{const V=Y.value.map(c=>({key:c,label:c,isBlank:!1}));return G.value.hasBlank&&!te.value&&V.push({key:$n,label:D(l.locale,"filterBlank"),isBlank:!0}),V}),C=Math.ceil(Gs/qn),j=t.computed(()=>Math.max(0,Math.floor(k.value/qn)-2)),q=t.computed(()=>Math.min(K.value.length,j.value+C+4)),se=t.computed(()=>K.value.slice(j.value,q.value)),Fe=t.computed(()=>j.value*qn),Qe=t.computed(()=>Math.max(0,(K.value.length-q.value)*qn));function Ge(V){k.value=V.target.scrollTop}const be=["equals","notEquals","contains","notContains","startsWith","endsWith"],ve=["equals","notEquals","gt","gte","lt","lte","between"],Xe={equals:"filterEquals",notEquals:"filterNotEquals",contains:"filterContains",notContains:"filterNotContains",startsWith:"filterStartsWith",endsWith:"filterEndsWith",gt:"filterGreaterThan",gte:"filterGreaterThanOrEqual",lt:"filterLessThan",lte:"filterLessThanOrEqual",between:"filterBetween",blank:"filterBlank",notBlank:"filterNonBlank"},Je=t.computed(()=>r.value==="text"?be:ve),gt=t.computed(()=>{var u;const V=l.getFilter(),c=V==null?void 0:V.columns[l.col];return c?c.type==="values"?(((u=c.values)==null?void 0:u.length)??0)>0:!!c.condition:!1});function Ze(){const V=l.getFilter(),c=V==null?void 0:V.columns[l.col];c&&c.type==="values"?(m.value=new Set((c.values??[]).filter(u=>u!==$n)),y.value=(c.values??[]).includes($n)):c&&c.condition?(r.value=c.type,w.value=c.condition.operator,v.value=c.condition.value??"",R.value=c.condition.value2??""):(m.value=new Set(G.value.values),y.value=G.value.hasBlank)}function lt(){if(!l.getFilter())return;const c=G.value.values,u=G.value.hasBlank;if(m.value.size===c.length&&c.every(H=>m.value.has(H))&&y.value===u)l.setFilterColumn(l.col,null);else{const H=[...m.value];y.value&&H.push($n),l.setFilterColumn(l.col,{type:"values",values:H})}}function et(V){const c=new Set(m.value);c.has(V)?c.delete(V):c.add(V),m.value=c}function oe(){y.value=!y.value}function pe(){const V=te.value?Y.value:G.value.values,c=new Set(m.value);V.forEach(u=>c.add(u)),m.value=c,y.value=!0}function g(){m.value=new Set,y.value=!1}function A(V){r.value=V,w.value=V==="text"?"contains":"equals",v.value="",R.value=""}function L(){r.value="values",Ze()}function $(){const V={operator:w.value,value:v.value};r.value!=="text"&&w.value==="between"&&(V.value2=R.value),v.value.trim()!==""&&(l.setFilterColumn(l.col,{type:r.value,condition:V}),l.close())}function ee(){m.value=new Set(G.value.values),y.value=G.value.hasBlank}function ie(){lt(),l.close()}function re(){d.value&&l.setFilter(d.value),l.close()}function he(V){const c=o.value;c&&V.target instanceof Node&&c.contains(V.target)||l.close()}function ce(V){V.key==="Escape"&&re()}return t.onMounted(async()=>{var p,H;d.value=l.getFilter()?JSON.parse(JSON.stringify(l.getFilter())):null,Ze(),await t.nextTick();const V=((p=o.value)==null?void 0:p.offsetHeight)??400;let c=l.anchor.x+15-bo,u=l.anchor.y+24;c<4&&(c=Math.max(4,l.anchor.x)),c+bo>window.innerWidth-4&&(c=Math.max(4,window.innerWidth-bo-4)),u+V>window.innerHeight-4&&(u=Math.max(4,l.anchor.y-V-4)),i.value={left:c,top:u},(H=a.value)==null||H.focus(),document.addEventListener("pointerdown",he,!0),document.addEventListener("keydown",ce,!0)}),t.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",he,!0),document.removeEventListener("keydown",ce,!0)}),(V,c)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createElementVNode("div",{ref_key:"rootRef",ref:o,class:"filter-popup",style:t.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onPointerdown:c[9]||(c[9]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",Ms,[t.createElementVNode("span",xs,t.toDisplayString(e.headerLabel||t.unref(ht)(e.col)),1),gt.value?(t.openBlock(),t.createElementBlock("span",Bs,t.toDisplayString(t.unref(D)(e.locale,"filterActive")),1)):t.createCommentVNode("",!0)]),r.value==="values"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",Ts,[t.withDirectives(t.createElementVNode("input",{ref_key:"searchInputRef",ref:a,"onUpdate:modelValue":c[0]||(c[0]=u=>f.value=u),class:"filter-popup__search-input",type:"text",placeholder:t.unref(D)(e.locale,"filterSearchPlaceholder")},null,8,Ds),[[t.vModelText,f.value]])]),t.createElementVNode("div",Ns,[t.createElementVNode("button",{class:"filter-popup__tool",onClick:pe},t.toDisplayString(t.unref(D)(e.locale,"filterSelectAll")),1),t.createElementVNode("button",{class:"filter-popup__tool",onClick:g},t.toDisplayString(t.unref(D)(e.locale,"filterClearAll")),1),t.createElementVNode("span",Fs,t.toDisplayString(t.unref(D)(e.locale,"filterFilteredCount").replace("{n}",String(G.value.values.length))),1)]),t.createElementVNode("div",{ref_key:"listRef",ref:n,class:"filter-popup__list",onScroll:Ge},[t.createElementVNode("div",{style:t.normalizeStyle({height:Fe.value+"px"})},null,4),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(se.value,u=>(t.openBlock(),t.createElementBlock("label",{key:u.key,class:"filter-popup__item"},[t.createElementVNode("input",{type:"checkbox",checked:u.isBlank?y.value:m.value.has(u.key),onChange:p=>u.isBlank?oe():et(u.key)},null,40,Is),t.createElementVNode("span",As,t.toDisplayString(u.label),1),u.isBlank?(t.openBlock(),t.createElementBlock("span",Vs,"("+t.toDisplayString(t.unref(D)(e.locale,"filterBlank"))+")",1)):t.createCommentVNode("",!0)]))),128)),t.createElementVNode("div",{style:t.normalizeStyle({height:Qe.value+"px"})},null,4),K.value.length===0?(t.openBlock(),t.createElementBlock("div",Hs,t.toDisplayString(t.unref(D)(e.locale,"filterNoData")),1)):t.createCommentVNode("",!0)],544),t.createElementVNode("div",Os,[t.createElementVNode("button",{class:"filter-popup__mode",onClick:c[1]||(c[1]=u=>A("text"))},t.toDisplayString(t.unref(D)(e.locale,"filterText")),1),t.createElementVNode("button",{class:"filter-popup__mode",onClick:c[2]||(c[2]=u=>A("number"))},t.toDisplayString(t.unref(D)(e.locale,"filterNumber")),1),t.createElementVNode("button",{class:"filter-popup__mode",onClick:c[3]||(c[3]=u=>A("date"))},t.toDisplayString(t.unref(D)(e.locale,"filterDate")),1)])],64)):(t.openBlock(),t.createElementBlock("div",Ls,[t.createElementVNode("button",{class:"filter-popup__cond-back",onClick:L},"← "+t.toDisplayString(t.unref(D)(e.locale,"filterCustom")),1),t.createElementVNode("div",zs,[t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":c[4]||(c[4]=u=>w.value=u),class:"filter-popup__cond-select"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Je.value,u=>(t.openBlock(),t.createElementBlock("option",{key:u,value:u},t.toDisplayString(t.unref(D)(e.locale,Xe[u])),9,_s))),128))],512),[[t.vModelSelect,w.value]])]),w.value==="between"?(t.openBlock(),t.createElementBlock("div",$s,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":c[5]||(c[5]=u=>v.value=u),class:"filter-popup__cond-input",type:"text"},null,512),[[t.vModelText,v.value]]),t.createElementVNode("span",Ws,t.toDisplayString(t.unref(D)(e.locale,"filterAnd")),1),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":c[6]||(c[6]=u=>R.value=u),class:"filter-popup__cond-input",type:"text"},null,512),[[t.vModelText,R.value]])])):(t.openBlock(),t.createElementBlock("div",Ps,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":c[7]||(c[7]=u=>v.value=u),class:"filter-popup__cond-input",type:"text",placeholder:r.value==="date"?"2024-01-01":"",onKeydown:t.withKeys($,["enter"])},null,40,Us),[[t.vModelText,v.value]])]))])),t.createElementVNode("div",Ks,[t.createElementVNode("button",{class:"filter-popup__btn filter-popup__btn--clear",onClick:ee},t.toDisplayString(t.unref(D)(e.locale,"clearFilter")),1),c[10]||(c[10]=t.createElementVNode("span",{class:"filter-popup__footer-spacer"},null,-1)),t.createElementVNode("button",{class:"filter-popup__btn",onClick:re},t.toDisplayString(t.unref(D)(e.locale,"cancelFilter")),1),t.createElementVNode("button",{class:"filter-popup__btn filter-popup__btn--primary",onClick:c[8]||(c[8]=u=>r.value==="values"?ie():$())},t.toDisplayString(t.unref(D)(e.locale,"filterOk")),1)])],36)]))}}),[["__scopeId","data-v-ec90eb74"]]);function cn(e,l){return`${e},${l}`}function qo(e,l){if(e.startsWith("="))return{kind:"formula",formula:e};const o=Dn(e,l);if(o)return{kind:"date",serial:o.serial};const n=/^(.*?)(\d+)$/.exec(e);if(n){const a=n[1],i=n[2];if(a!==""&&/^\d+$/.test(i))return{kind:"text-number",prefix:a,num:parseInt(i,10),digits:i.length}}return Ul(e)?{kind:"number",num:parseFloat(e)}:{kind:"text",text:e}}function Co(e,l){for(let o=2;o<e.length;o++)if(e[o]-e[o-1]!==l)return!1;return!0}function Jo(e){const l=e.length;if(l===0)return{kind:"copy",sourceValues:[]};if(e.some(o=>o.kind==="formula"))return{kind:"formula"};if(e.every(o=>o.kind==="date")){const o=e[0],n=l>=2?e[1].serial-o.serial:1;return{kind:"date-linear",baseSerial:o.serial,step:n,sourceLen:l}}if(e.every(o=>o.kind==="number")){if(l===1)return{kind:"copy",sourceValues:[...e]};const o=e.map(a=>a.num),n=o[1]-o[0];return Co(o,n)?{kind:"linear",step:n,base:o[0],sourceLen:l}:{kind:"copy",sourceValues:[...e]}}if(e.every(o=>o.kind==="text-number")){const o=e[0];if(e.every(a=>a.kind==="text-number"&&a.prefix===o.prefix)){if(l===1)return{kind:"copy",sourceValues:[...e]};const a=e.map(r=>r.num),i=a[1]-a[0];if(Co(a,i))return{kind:"text-number",prefix:o.prefix,step:i,base:o.num,digits:o.digits,sourceLen:l}}return{kind:"copy",sourceValues:[...e]}}if(e.every(o=>o.kind==="text")){const o=e.every(n=>n.text.length===1&&/[a-zA-Z]/.test(n.text));if(l>=2&&o){const n=e.map(i=>i.text.charCodeAt(0)),a=n[1]-n[0];if(a!==0&&Co(n,a))return{kind:"text-series",step:a,baseCharCode:n[0],sourceLen:l}}return{kind:"copy",sourceValues:[...e]}}return{kind:"copy",sourceValues:[...e]}}function Qo(e,l,o){switch(e.kind){case"copy":{const n=e.sourceValues.length;return n===0?{kind:"text",text:""}:e.sourceValues[l%n]}case"linear":return{kind:"number",num:e.base+e.step*(o+l)};case"text-number":return{kind:"text-number",prefix:e.prefix,num:e.base+e.step*(o+l),digits:e.digits};case"date-linear":return{kind:"date",serial:e.baseSerial+e.step*(o+l)};case"text-series":return{kind:"text",text:String.fromCharCode(e.baseCharCode+e.step*(o+l))};case"formula":return{kind:"formula",formula:""}}}function er(e,l){switch(e.kind){case"copy":{const o=e.sourceValues.length;return o===0?{kind:"text",text:""}:e.sourceValues[o-1-l%o]}case"linear":return{kind:"number",num:e.base-e.step*(l+1)};case"text-number":return{kind:"text-number",prefix:e.prefix,num:e.base-e.step*(l+1),digits:e.digits};case"date-linear":return{kind:"date",serial:e.baseSerial-e.step*(l+1)};case"text-series":return{kind:"text",text:String.fromCharCode(e.baseCharCode-e.step*(l+1))};case"formula":return{kind:"formula",formula:""}}}function Jn(e,l){switch(e.kind){case"formula":return{value:e.formula,styleId:l};case"number":return{value:String(e.num),styleId:l};case"text":return{value:e.text,styleId:l};case"text-number":return{value:e.prefix+String(e.num).padStart(e.digits,"0"),styleId:l};case"date":return{value:String(e.serial),styleId:l}}}function tr(e,l){const o=l.row<e.startRow?e.startRow-l.row:l.row>e.endRow?l.row-e.endRow:0,n=l.col<e.startCol?e.startCol-l.col:l.col>e.endCol?l.col-e.endCol:0;if(o===0&&n===0)return null;const a=o>=n?l.row<e.startRow?"up":"down":l.col<e.startCol?"left":"right";let i;switch(a){case"down":i={startCol:e.startCol,startRow:e.endRow+1,endCol:e.endCol,endRow:l.row};break;case"up":i={startCol:e.startCol,startRow:l.row,endCol:e.endCol,endRow:e.startRow-1};break;case"right":i={startCol:e.endCol+1,startRow:e.startRow,endCol:l.col,endRow:e.endRow};break;case"left":i={startCol:l.col,startRow:e.startRow,endCol:e.startCol-1,endRow:e.endRow};break}return{targetRange:i,direction:a}}function lr(e,l,o,n,a,i){return Xo(e,o.col-l.col,o.row-l.row,n,a,i)}function nr(e,l){return!(e.endCol<l.startCol||e.startCol>l.endCol||e.endRow<l.startRow||e.startRow>l.endRow)}function Xs(e,l){return l.startCol>=e.startCol&&l.endCol<=e.endCol&&l.startRow>=e.startRow&&l.endRow<=e.endRow}function wo(e,l,o){const n=Object.keys(o);for(const a of n){const i=o[a];if(nr(e,i)&&!Xs(e,i))return!1}for(const a of n){const i=o[a];if(nr(l,i))return!1}return!0}function or(e,l,o,n){const a=l.length;if(a!==0){if(e.kind==="copy"){const i=n?a-1-o%a:o%a;return l[i]}return n?l[0]:l[a-1]}}function js(e,l,o,n,a,i,r,f){const m={cells:{},merges:{}},y=n==="up"||n==="down",k=n==="up"||n==="left";if(y){const d=e.endRow-e.startRow+1;for(let w=e.startCol;w<=e.endCol;w++){const v=[],R=[];for(let Y=e.startRow;Y<=e.endRow;Y++){const K=o.cells[cn(w,Y)];v.push(K?qo(K.value,a):{kind:"text",text:""}),R.push(K==null?void 0:K.styleId)}const G=Jo(v),te=v.length;for(let Y=l.startRow;Y<=l.endRow;Y++){const K=k?l.endRow-Y:Y-l.startRow;if(G.kind==="formula"){const C=k?e.endRow-((l.endRow-Y)%d+d)%d:e.startRow+((Y-e.startRow)%d+d)%d,j=o.cells[cn(w,C)],q=j?j.value:"",se=lr(q,{col:w,row:C},{col:w,row:Y},i,r,f);m.cells[cn(w,Y)]=Jn({kind:"formula",formula:se},j==null?void 0:j.styleId)}else{const C=k?er(G,K):Qo(G,K,te),j=or(G,R,K,k);m.cells[cn(w,Y)]=Jn(C,j)}}}}else{const d=e.endCol-e.startCol+1;for(let w=e.startRow;w<=e.endRow;w++){const v=[],R=[];for(let Y=e.startCol;Y<=e.endCol;Y++){const K=o.cells[cn(Y,w)];v.push(K?qo(K.value,a):{kind:"text",text:""}),R.push(K==null?void 0:K.styleId)}const G=Jo(v),te=v.length;for(let Y=l.startCol;Y<=l.endCol;Y++){const K=k?l.endCol-Y:Y-l.startCol;if(G.kind==="formula"){const C=k?e.endCol-((l.endCol-Y)%d+d)%d:e.startCol+((Y-e.startCol)%d+d)%d,j=o.cells[cn(C,w)],q=j?j.value:"",se=lr(q,{col:C,row:w},{col:Y,row:w},i,r,f);m.cells[cn(Y,w)]=Jn({kind:"formula",formula:se},j==null?void 0:j.styleId)}else{const C=k?er(G,K):Qo(G,K,te),j=or(G,R,K,k);m.cells[cn(Y,w)]=Jn(C,j)}}}}return m}class Zs{constructor(l){if(l&&l.length>0){this.styles=l,this.index=new Map;for(let o=0;o<this.styles.length;o++){const n=this.stableKey(this.styles[o]);this.index.set(n,o)}}else this.styles=[{}],this.index=new Map,this.index.set(this.stableKey({}),0)}stableKey(l){const o=Object.keys(l).sort(),n={};for(const a of o)n[a]=l[a];return JSON.stringify(n)}get(l){const o=this.styles[l];return o?l===0?o:Object.freeze(o):{}}getId(l){if(!l||Object.keys(l).length===0)return 0;const o=this.stableKey(l),n=this.index.get(o);if(n!==void 0)return n;const a=this.styles.length,i=Object.freeze({...l});return this.styles.push(i),this.index.set(o,a),a}getStyles(){return[...this.styles]}setStyles(l){this.styles=l,this.index=new Map;for(let o=0;o<this.styles.length;o++){const n=this.stableKey(this.styles[o]);this.index.set(n,o)}}compactStyles(l){const o=new Set;o.add(0);for(const r in l){const f=l[r].styleId??0;o.add(f)}const n=new Map,a=[{}];n.set(0,0);const i=Array.from(o).sort((r,f)=>r-f);for(const r of i)if(r!==0&&r<this.styles.length){const f=a.length;n.set(r,f),a.push(this.styles[r])}for(const r in l){const f=l[r],m=f.styleId??0,y=n.get(m);y!==void 0&&y!==m&&(f.styleId=y)}this.styles=a,this.index=new Map;for(let r=0;r<this.styles.length;r++){const f=this.stableKey(this.styles[r]);this.index.set(f,r)}return a}}function qs(e,l){if(!e)return null;const o=e.styleId;return o===void 0||o===0?null:l[o]??null}function rr(e){const l=new Zs,o={};for(const[n,a]of Object.entries(e)){const i={value:a.value};a.styleId!==void 0&&a.styleId>0&&(i.styleId=a.styleId),a.style&&Object.keys(a.style).length>0&&(i.styleId=l.getId(a.style)),i.styleId===0&&delete i.styleId,o[n]=i}return{cells:o,styles:l.getStyles()}}function Js(e){const l={};for(const[o,n]of Object.entries(e)){const a={value:n.value};n.styleId!==void 0&&n.styleId>0&&(a.styleId=n.styleId),l[o]=a}return l}class Qs{constructor(l){if(l&&l.length>0){this.borders=l,this.index=new Map;for(let o=0;o<this.borders.length;o++){const n=this.stableKey(this.borders[o]);this.index.set(n,o)}}else this.borders=[{}],this.index=new Map,this.index.set(this.stableKey({}),0)}stableKey(l){const o=["top","right","bottom","left"],n={};for(const a of o){const i=l[a];if(i&&(i.width!==void 0||i.color!==void 0||i.style!==void 0)){const r={};i.width!==void 0&&(r.width=i.width),i.color!==void 0&&(r.color=i.color),i.style!==void 0&&(r.style=i.style),n[a]=r}}return JSON.stringify(n)}get(l){const o=this.borders[l];return o?l===0?o:Object.freeze(o):{}}getId(l){if(!l||this.isEmptyBorder(l))return 0;const o=this.stableKey(l),n=this.index.get(o);if(n!==void 0)return n;const a=this.borders.length,i=Object.freeze(this.deepCloneBorder(l));return this.borders.push(i),this.index.set(o,a),a}isEmptyBorder(l){return!l.top&&!l.right&&!l.bottom&&!l.left}deepCloneBorder(l){const o={};return l.top&&(o.top={...l.top}),l.right&&(o.right={...l.right}),l.bottom&&(o.bottom={...l.bottom}),l.left&&(o.left={...l.left}),o}getBorders(){return[...this.borders]}setBorders(l){this.borders=l,this.index=new Map;for(let o=0;o<this.borders.length;o++){const n=this.stableKey(this.borders[o]);this.index.set(n,o)}}compactBorders(l){const o=new Set;o.add(0);for(const r of l){const f=r.borderId??0;o.add(f)}const n=new Map,a=[{}];n.set(0,0);const i=Array.from(o).sort((r,f)=>r-f);for(const r of i)if(r!==0&&r<this.borders.length){const f=a.length;n.set(r,f),a.push(this.borders[r])}for(const r of l){const f=r.borderId??0,m=n.get(f);m!==void 0&&m!==f&&(r.borderId=m)}this.borders=a,this.index=new Map;for(let r=0;r<this.borders.length;r++){const f=this.stableKey(this.borders[r]);this.index.set(f,r)}return a}}function eu(e,l,o,n){if(!e)return;const a=e.styleId??0,i=o[a];if(!i)return;const r=i.borderId??0;if(r===0)return;const f=n.get(r);if(f)return f[l]}function tu(e,l,o,n,a,i){const r=n[e.styleId??0]??{},f=r.borderId??0,m=f>0?a.get(f):{},y={top:m.top?{...m.top}:void 0,right:m.right?{...m.right}:void 0,bottom:m.bottom?{...m.bottom}:void 0,left:m.left?{...m.left}:void 0};o?y[l]={...o}:y[l]=void 0;const k=a.getId(y),d={...r};k===0?delete d.borderId:d.borderId=k,delete d.borderTopWidth,delete d.borderBottomWidth,delete d.borderLeftWidth,delete d.borderRightWidth,delete d.borderColor,Object.keys(d).length===0?e.styleId=0:e.styleId=i(d)}function ar(e){const l=new Qs,o=[];for(const n of e){if(!(n.borderTopWidth!==void 0||n.borderBottomWidth!==void 0||n.borderLeftWidth!==void 0||n.borderRightWidth!==void 0)){o.push(n);continue}const i=typeof n.borderColor=="string"?n.borderColor:void 0,r={};n.borderTopWidth!==void 0&&n.borderTopWidth>0&&(r.top={width:n.borderTopWidth,color:i}),n.borderBottomWidth!==void 0&&n.borderBottomWidth>0&&(r.bottom={width:n.borderBottomWidth,color:i}),n.borderLeftWidth!==void 0&&n.borderLeftWidth>0&&(r.left={width:n.borderLeftWidth,color:i}),n.borderRightWidth!==void 0&&n.borderRightWidth>0&&(r.right={width:n.borderRightWidth,color:i});const f=l.getId(r),m={...n};delete m.borderTopWidth,delete m.borderBottomWidth,delete m.borderLeftWidth,delete m.borderRightWidth,delete m.borderColor,f>0?m.borderId=f:delete m.borderId,o.push(m)}return{styles:o,borders:l.getBorders()}}function lu(e,l){const o=t.reactive({rowCount:e.rowCount??l.rowCount,colCount:e.colCount??l.colCount,width:e.width,height:e.height,theme:e.theme??l.theme,locale:e.locale??l.locale});t.watchEffect(()=>{o.rowCount=e.rowCount??l.rowCount,o.colCount=e.colCount??l.colCount,o.width=e.width,o.height=e.height,o.theme=e.theme??l.theme,o.locale=e.locale??l.locale});const n=t.computed(()=>o.locale==="zh-CN"?"zh-CN":"en-US"),a=o.colCount,i=o.rowCount,r=t.reactive({colCount:a,rowCount:i}),f=8,m=32,y=t.reactive({}),k=t.reactive([{}]),d=t.reactive([{}]);let w=new Map;w.set("{}",0);let v=new Map;v.set("{}",0);function R(h){const S=Object.keys(h).sort(),B={};for(const W of S)B[W]=h[W];return JSON.stringify(B)}function G(h){const S=["top","right","bottom","left"],B={};for(const W of S){const X=h[W];if(X&&(X.width!==void 0||X.color!==void 0||X.style!==void 0)){const Ce={};X.width!==void 0&&(Ce.width=X.width),X.color!==void 0&&(Ce.color=X.color),X.style!==void 0&&(Ce.style=X.style),B[W]=Ce}}return JSON.stringify(B)}function te(h){if(!h||Object.keys(h).length===0)return 0;const S=R(h),B=w.get(S);if(B!==void 0)return B;const W=k.length;return k.push(Object.freeze({...h})),w.set(S,W),W}function Y(h){return qs(h,k)}function K(){w=new Map;for(let h=0;h<k.length;h++)w.set(R(k[h]),h)}function C(h){k.splice(0,k.length,...h),K()}function j(h){if(!h||!h.top&&!h.right&&!h.bottom&&!h.left)return 0;const S=G(h),B=v.get(S);if(B!==void 0)return B;const W=d.length;return d.push(Object.freeze({top:h.top?Object.freeze({...h.top}):void 0,right:h.right?Object.freeze({...h.right}):void 0,bottom:h.bottom?Object.freeze({...h.bottom}):void 0,left:h.left?Object.freeze({...h.left}):void 0})),v.set(S,W),W}function q(h){return d[h]??{}}function se(){v=new Map;for(let h=0;h<d.length;h++)v.set(G(d[h]),h)}function Fe(h){d.splice(0,d.length,...h),se()}function Qe(h,S){return eu(h,S,k,{get:B=>d[B]??{}})}function Ge(h,S){const B=p(h,S);return B?B.anchor:null}function be(h,S,B,W){const X=p(h,S),Ce=p(B,W);return!X||!Ce?!1:X.anchor===Ce.anchor}const ve=t.reactive({}),Xe=new ds,Je=t.ref(null),gt=t.ref("cell"),Ze=t.ref({col:0,row:0}),lt=t.ref(null),et=t.ref(""),oe=t.ref(new Array(r.colCount).fill(100)),pe=t.ref(new Array(r.rowCount).fill(void 0)),g=t.ref(0),A=t.ref(0),L=t.reactive({rows:0,cols:0}),$=t.ref(null),ee=t.shallowRef({active:!1,sourceRange:null,targetRange:null,direction:null,preview:!1}),ie=new Map;let re=null;function he(h,S,B,W){const X=`${W} ${B} ${S}px ${h}`,Ce=ie.get(X);if(Ce)return Ce;if(!re){if(typeof document>"u")return{ascent:S*.88,descent:S*.28};re=document.createElement("canvas")}const xe=re.getContext("2d");if(!xe)return{ascent:S*.88,descent:S*.28};xe.font=X;const Ie=xe.measureText(" "),Ve=Ie.fontBoundingBoxAscent,Le=Ie.fontBoundingBoxDescent;if(typeof Ve=="number"&&typeof Le=="number"&&Ve>0&&Le>0){const El={ascent:Ve,descent:Le};return ie.set(X,El),El}const Ue=["M","中","y","Ä","0"];let mt=0,je=0;for(const El of Ue){const mn=xe.measureText(El),Rn=mn.actualBoundingBoxAscent||0,Zl=mn.actualBoundingBoxDescent||0;Rn>mt&&(mt=Rn),Zl>je&&(je=Zl)}const pt=Math.max(mt,S*.88),Ot=Math.max(je,S*.28),Sn={ascent:pt,descent:Ot};return ie.set(X,Sn),Sn}const ce=he(Cn,_l,"normal","normal"),V=ce.ascent+ce.descent,c=Math.max(0,(24-V)/2);let u=(h,S)=>`${h},${S}`,p=()=>null,H=()=>_l,ct=t.computed(()=>[0]),ae=()=>24,Pe=(h,S,B,W)=>({startCol:Math.min(h,B),startRow:Math.min(S,W),endCol:Math.max(h,B),endRow:Math.max(S,W)});function at(h,S){const B=Y(y[u(h,S)]),W=H(h,S),X=typeof(B==null?void 0:B.fontFamily)=="string"&&B.fontFamily?B.fontFamily:Cn,Ce=(B==null?void 0:B.fontWeight)==="bold"?"bold":"normal",xe=(B==null?void 0:B.fontStyle)==="italic"?"italic":"normal";return he(X,W,Ce,xe)}function Mt(h,S,B,W){if(!S)return[""];const X=S.split(`
|
|
2
|
+
`),Ce=[];for(const xe of X)if(!W||B<=0)Ce.push(xe);else{let Ie="";for(let Ve=0;Ve<xe.length;Ve++){const Le=xe[Ve],Ue=Ie+Le;h.measureText(Ue).width>B&&Ie?(Ce.push(Ie),Ie=Le):Ie=Ue}Ce.push(Ie)}return Ce}function St(h,S){const B=Y(y[u(h,S)]);return typeof(B==null?void 0:B.fontSize)=="number"&&B.fontSize>0?B.fontSize:_l}H=St;const Rt=t.computed(()=>{const h=[0];for(let S=0;S<r.colCount;S++)h.push(h[S]+oe.value[S]);return h});ct=Rt;const Ft={w:800,h:600};let Yt=()=>{};const nl=t.computed(()=>{const h=new Set;for(const S in y){const B=S.indexOf(",");if(B<0)continue;const W=parseInt(S.substring(B+1),10),X=y[S];X&&(X.value!==""||X.styleId!==void 0)&&h.add(W)}for(let S=0;S<pe.value.length;S++)pe.value[S]!==void 0&&h.add(S);for(const S in ve){const B=S.indexOf(",");if(B<0)continue;const W=parseInt(S.substring(B+1),10);h.add(W)}return h});function Cl(h){if($.value&&wl.value.has(h))return 0;const S=pe.value[h];if(S!=null&&S>0)return S;if(!nl.value.has(h))return 24;let B,W,X=1;const Ce=re?re.getContext("2d"):null,xe=he(Cn,_l,"normal","normal");B=xe.ascent,W=xe.descent;for(let Ue=0;Ue<r.colCount;Ue++){const mt=St(Ue,h),je=Y(y[u(Ue,h)]),pt=typeof(je==null?void 0:je.fontFamily)=="string"&&je.fontFamily?je.fontFamily:Cn,Ot=(je==null?void 0:je.fontWeight)==="bold"?"bold":"normal",Sn=(je==null?void 0:je.fontStyle)==="italic"?"italic":"normal",El=he(pt,mt,Ot,Sn);El.ascent>B&&(B=El.ascent),El.descent>W&&(W=El.descent);const mn=typeof(je==null?void 0:je.numberFormat)=="string"?je.numberFormat:"",Rn=Pt(Ue,h),Zl=bl(Rn,mn,n.value);if(Zl){const Wn=(je==null?void 0:je.wrap)==="wrap";let Il;if(Wn&&Ce){Ce.font=`${Sn} ${Ot} ${mt}px ${pt}`;const Vn=p(Ue,h);let Pn;Vn&&Ue===Vn.range.startCol&&h===Vn.range.startRow?Pn=ct.value[Vn.range.endCol+1]-ct.value[Ue]:Pn=oe.value[Ue],Il=Mt(Ce,Zl,Math.max(0,Pn-10),!0).length,Il>X&&(X=Il)}else Il=Zl.split(`
|
|
3
|
+
`).length,Il>X&&(X=Il)}}const Ie=B+W,Ve=c*2+X*Ie;return Math.min(500,Math.max(24,Math.round(Ve)))}ae=Cl;function Dl(h){return pe.value[h]===void 0}const cl={getValue:(h,S)=>Pt(h,S),getFormat:(h,S)=>{var B;return(B=Y(y[u(h,S)]))==null?void 0:B.numberFormat}},wl=t.computed(()=>{const h=new Set,S=$.value;if(!S)return h;const{range:B}=S;for(let W=B.startRow+1;W<=B.endRow;W++)ol(W)||h.add(W);return h});function ol(h){return Ss($.value,h,cl,n.value)}function fl(){return wl.value}function Xt(h){return $.value?wl.value.has(h):!1}function Kl(){return $.value?r.rowCount-wl.value.size:r.rowCount}function Gl(h){let S=-1;for(let B=0;B<r.rowCount;B++)if(!Xt(B)&&(S++,S===h))return B;return-1}function Yl(h){if(Xt(h))return-1;let S=0;for(let B=0;B<h;B++)Xt(B)||S++;return S}function sn(){return $.value}function I(h,S=!1){var B,W;$.value=h,!S&&(Yt(g.value,A.value),(B=De.scheduleRender)==null||B.call(De),(W=De.emitModelData)==null||W.call(De))}function N(h){var B,W;const S={range:{startCol:Math.min(h.startCol,h.endCol),endCol:Math.max(h.startCol,h.endCol),startRow:Math.min(h.startRow,h.endRow),endRow:Math.max(h.startRow,h.endRow)},columns:{}};$.value=S,Yt(g.value,A.value),(B=De.scheduleRender)==null||B.call(De),(W=De.emitModelData)==null||W.call(De)}function O(){var h,S;$.value&&($.value=null,Yt(g.value,A.value),(h=De.scheduleRender)==null||h.call(De),(S=De.emitModelData)==null||S.call(De))}function de(h){var B,W;if(!$.value)return;const S={...$.value,columns:{...$.value.columns}};delete S.columns[h],$.value=S,(B=De.scheduleRender)==null||B.call(De),(W=De.emitModelData)==null||W.call(De)}function ge(h,S){var W,X;if(!$.value)return;const B={...$.value,columns:{...$.value.columns}};S?B.columns[h]=S:delete B.columns[h],$.value=B,(W=De.scheduleRender)==null||W.call(De),(X=De.emitModelData)==null||X.call(De)}function Me(h){const S=$.value;return S?Rs(S,h,cl,n.value):{values:[],hasBlank:!1}}function Ee(h,S){const B=r.colCount,W=r.rowCount,X=(mt,je)=>{const pt=y[ue(mt,je)];return!!pt&&(pt.value!==""||pt.styleId!==void 0)};if(!X(h,S))return null;const Ce=mt=>{for(let je=0;je<B;je++)if(X(je,mt))return!0;return!1},xe=(mt,je,pt)=>{for(let Ot=je;Ot<=pt;Ot++)if(X(mt,Ot))return!0;return!1};let Ie=S;for(;Ie>0&&Ce(Ie-1);)Ie--;let Ve=S;for(;Ve<W-1&&Ce(Ve+1);)Ve++;let Le=h;for(;Le>0&&xe(Le-1,Ie,Ve);)Le--;let Ue=h;for(;Ue<B-1&&xe(Ue+1,Ie,Ve);)Ue++;return{startCol:Le,startRow:Ie,endCol:Ue,endRow:Ve}}function fe(){const h=Je.value;if(!!h&&h.startRow!==h.endRow)return{startCol:Math.min(h.startCol,h.endCol),endCol:Math.max(h.startCol,h.endCol),startRow:Math.min(h.startRow,h.endRow),endRow:Math.max(h.startRow,h.endRow)};const B=Ze.value,W=h?h.startCol:B.col,X=h?h.startRow:B.row,Ce=(Le,Ue)=>{const mt=y[ue(Le,Ue)];return!!mt&&(mt.value!==""||mt.styleId!==void 0)};let xe,Ie;h?(xe=Math.min(h.startCol,h.endCol),Ie=Math.max(h.startCol,h.endCol)):(xe=B.col,Ie=B.col);let Ve=X;for(;Ve<r.rowCount-1;){const Le=Ve+1;let Ue=!1,mt=!1;for(let je=xe;je<=Ie;je++){Ce(je,Le)&&(Ue=!0);const pt=zt(je,Le);pt&&(pt.range.startCol!==pt.range.endCol||pt.range.startRow!==pt.range.endRow)&&(mt=!0)}if(mt||!Ue)break;Ve++}return!Ce(W,X)&&Ve===X?ft():{startCol:xe,endCol:Ie,startRow:X,endRow:Ve}}function Z(){if($.value){O();return}const h=fe();h&&N(h)}function ze(h){const S=$.value;return S?h>=S.range.startCol&&h<=S.range.endCol:!1}function $e(){return $.value?{...$.value.range}:null}function le(){return!!$.value}function Ke(h){const S=$.value;return S?Zo(S.columns[h]):!1}function ft(){let h=1/0,S=1/0,B=-1,W=-1;for(const X in y){const Ce=X.indexOf(",");if(Ce<0)continue;const xe=parseInt(X.substring(0,Ce),10),Ie=parseInt(X.substring(Ce+1),10),Ve=y[X];Ve&&(Ve.value!==""||Ve.styleId!==void 0)&&(xe<h&&(h=xe),Ie<S&&(S=Ie),xe>B&&(B=xe),Ie>W&&(W=Ie))}return B<0?null:{startCol:h,startRow:S,endCol:B,endRow:W}}const E=t.computed(()=>{const h=[0];for(let S=0;S<r.rowCount;S++)h.push(h[S]+ae(S));return h}),U=t.computed(()=>Rt.value[r.colCount]),J=t.computed(()=>E.value[r.rowCount]);function ue(h,S){return`${h},${S}`}u=ue;function ye(h){Reflect.deleteProperty(y,h)}function me(h,S){gt.value="cell";const B=p(h,S);B?(Ze.value={col:B.range.startCol,row:B.range.startRow},Je.value={...B.range}):(Ze.value={col:h,row:S},Je.value={startCol:h,startRow:S,endCol:h,endRow:S})}function Se(h,S,B,W,X="cell"){const Ce=p(h,S);if(Ze.value=Ce?{col:Ce.range.startCol,row:Ce.range.startRow}:{col:h,row:S},gt.value=X,X==="row"||X==="col"){const xe=Math.min(h,B),Ie=Math.max(h,B),Ve=Math.min(S,W),Le=Math.max(S,W);Je.value={startCol:xe,startRow:Ve,endCol:Ie,endRow:Le}}else Je.value=Pe(h,S,B,W)}function We(){Se(0,0,r.colCount-1,r.rowCount-1,"all")}function st(h,S){const B=Je.value;return B?(gt.value==="cell"||gt.value==="all",h>=B.startCol&&h<=B.endCol&&S>=B.startRow&&S<=B.endRow):!1}function Bt(h,S){return st(h,S)}function zt(h,S){for(const B in ve){const W=ve[B];if(W&&h>=W.startCol&&h<=W.endCol&&S>=W.startRow&&S<=W.endRow)return{range:W,anchor:B}}return null}p=zt;function jt(h,S){return ve[ue(h,S)]!==void 0}function Vt(h,S){const B=p(h,S);if(B&&h===B.range.startCol&&S===B.range.startRow){const W=Rt.value[B.range.endCol+1]-Rt.value[h],X=E.value[B.range.endRow+1]-E.value[S];return{w:W,h:X}}return{w:oe.value[h],h:ae(S)}}function Ht(h,S,B,W){let X=Math.min(h,B),Ce=Math.max(h,B),xe=Math.min(S,W),Ie=Math.max(S,W),Ve=!0;for(;Ve;){Ve=!1;for(const Le in ve){const Ue=ve[Le];if(!Ue)continue;Ue.startCol<=Ce&&Ue.endCol>=X&&Ue.startRow<=Ie&&Ue.endRow>=xe&&(Ue.startCol<X&&(X=Ue.startCol,Ve=!0),Ue.endCol>Ce&&(Ce=Ue.endCol,Ve=!0),Ue.startRow<xe&&(xe=Ue.startRow,Ve=!0),Ue.endRow>Ie&&(Ie=Ue.endRow,Ve=!0))}}return{startCol:X,startRow:xe,endCol:Ce,endRow:Ie}}Pe=Ht;function _t(h,S){var B;return((B=y[ue(h,S)])==null?void 0:B.value)??""}function Pt(h,S){return _n(),Yo(h,S,y,r.colCount,r.rowCount)}function Xl(h,S,B){var Ie,Ve;h>=0&&S>=0&&Zt(h,S);const W=ue(h,S);if(_n(),B===""||B==null){Xe.clear(W);const Le=(Ie=y[W])==null?void 0:Ie.styleId;Le!==void 0&&Le>0?y[W]={value:"",styleId:Le}:ye(W),Xe.markDirty(W);return}const X=String(B);if(!X.startsWith("=")){const Le=Y(y[W]),Ue=typeof(Le==null?void 0:Le.numberFormat)=="string"?Le.numberFormat:"";if(dl(Ue)){const mt=Dn(X,n.value);if(mt){const pt={...Le??{},numberFormat:mt.format};y[W]={value:String(mt.serial),styleId:te(pt)},Xe.clear(W),Xe.markDirty(W);return}const je=qr(X,n.value);if(je){const pt={...Le??{},numberFormat:je.format};y[W]={value:String(je.num),styleId:te(pt)},Xe.clear(W),Xe.markDirty(W);return}}}const Ce=(Ve=y[W])==null?void 0:Ve.styleId,xe={value:X};Ce!==void 0&&Ce>0&&(xe.styleId=Ce),y[W]=xe,X.startsWith("=")?Xe.set(W,jn(X.slice(1),r.colCount,r.rowCount)):Xe.clear(W),Xe.markDirty(W)}function un(h,S,B,W){for(let X=h;X<=S;X++)for(let Ce=B;Ce<=W;Ce++){const xe=ue(X,Ce);Xe.clear(xe),ye(xe),Xe.markDirty(xe)}}let vl=()=>{};function Nl(h){lt.value||(lt.value={...Ze.value},h!==void 0?et.value=h:et.value||(et.value=_t(Ze.value.col,Ze.value.row)))}function kn(){lt.value&&(vl(),Xl(lt.value.col,lt.value.row,et.value),lt.value=null,et.value="")}function En(){lt.value=null,et.value=""}function In(h,S){const B=Ze.value;let W=Math.max(0,B.col+h),X=Math.max(0,B.row+S);(W>=r.colCount||X>=r.rowCount)&&Zt(W,X);const Ce=p(B.col,B.row),xe=p(W,X);Ce&&xe&&Ce.anchor===xe.anchor&&(h>0?W=Ce.range.endCol+1:h<0&&(W=Ce.range.startCol-1),S>0?X=Ce.range.endRow+1:S<0&&(X=Ce.range.startRow-1),(W>=r.colCount||X>=r.rowCount)&&Zt(W,X)),W=Math.max(0,Math.min(r.colCount-1,W)),X=Math.max(0,Math.min(r.rowCount-1,X)),me(W,X)}function An(h,S){ml(S,h)}function Ut(h){const S=Rt.value;if(h<0||h>=S[r.colCount])return-1;let B=0,W=r.colCount-1;for(;B<W;){const X=B+W+1>>1;S[X]<=h?B=X:W=X-1}return B}function Fl(h){const S=E.value;if(h<0||h>=S[r.rowCount])return-1;let B=0,W=r.rowCount-1;for(;B<W;){const X=B+W+1>>1;S[X]<=h?B=X:W=X-1}return B}function bt(h,S){var X,Ce;const B=Math.max(0,Math.min(Math.floor(h),r.rowCount)),W=Math.max(0,Math.min(Math.floor(S),r.colCount));L.rows=B,L.cols=W,(X=De.scheduleRender)==null||X.call(De),(Ce=De.emitModelData)==null||Ce.call(De)}function Ct(){var h,S;L.rows=0,L.cols=0,(h=De.scheduleRender)==null||h.call(De),(S=De.emitModelData)==null||S.call(De)}function Kt(){return{rows:L.rows,cols:L.cols}}function dn(){let h=0,S=0;if(L.cols>0){const B=oe.value,W=Math.min(L.cols,B.length);for(let X=0;X<W;X++)h+=B[X]}if(L.rows>0)for(let B=0;B<L.rows;B++)S+=ae(B);return{frozenRowsHeight:S,frozenColumnsWidth:h}}function Qn(){const{frozenColumnsWidth:h,frozenRowsHeight:S}=dn(),B=52+h,W=24+S,X=Math.max(0,Ft.w-52-11-h),Ce=Math.max(0,Ft.h-24-11-S),xe=[];return S>0&&h>0&&xe.push({kind:"corner",x:52,y:24,width:h,height:S,scrollLeft:0,scrollTop:0}),S>0&&xe.push({kind:"rows",x:B,y:24,width:X,height:S,scrollLeft:g.value,scrollTop:0}),h>0&&xe.push({kind:"columns",x:52,y:W,width:h,height:Ce,scrollLeft:0,scrollTop:A.value}),xe.push({kind:"body",x:B,y:W,width:X,height:Ce,scrollLeft:g.value,scrollTop:A.value}),xe}function eo(h,S){const B=Rt.value,W=E.value,X=oe.value,Ce=B[S]??0,xe=W[h]??0,Ie=p(S,h),Ve=Ie?(B[Ie.range.endCol+1]??Ce)-Ce:X[S]??0,Le=Ie?(W[Ie.range.endRow+1]??xe)-xe:ae(h),Ue=S<L.cols,mt=h<L.rows,je=Ue?52+Ce:52+Ce-g.value,pt=mt?24+xe:24+xe-A.value;return{x:je,y:pt,width:Ve,height:Le}}function rl(h,S){const{frozenColumnsWidth:B,frozenRowsHeight:W}=dn();if(h<52||S<24)return null;const X=B>0&&h<52+B,Ce=W>0&&S<24+W,xe=X?h-52:h-52+g.value,Ie=Ce?S-24:S-24+A.value,Ve=Ut(xe),Le=Fl(Ie);return Ve<0||Le<0?null:{col:Ve,row:Le}}function kl(h,S){return h<L.rows||S<L.cols}function ml(h,S){if(kl(h,S))return;const{frozenColumnsWidth:B,frozenRowsHeight:W}=dn(),X=Math.max(0,Ft.w-52-11-B),Ce=Math.max(0,Ft.h-24-11-W),xe=Rt.value,Ie=E.value,Ve=(xe[S]??0)-B,Le=(Ie[h]??0)-W,Ue=p(S,h),mt=Ue?(xe[Ue.range.endCol+1]??0)-(xe[S]??0):oe.value[S]??0,je=Ue?(Ie[Ue.range.endRow+1]??0)-(Ie[h]??0):ae(h);let pt=g.value,Ot=A.value;Ve<pt?pt=Ve:Ve+mt>pt+X&&(pt=Ve+mt-X),Le<Ot?Ot=Le:Le+je>Ot+Ce&&(Ot=Le+je-Ce),pt=Math.max(0,pt),Ot=Math.max(0,Ot),Yt(pt,Ot)}function Zt(h,S){var Ce;const B=h+1,W=S+1;let X=!1;if(B>=r.colCount){const xe=Math.max(r.colCount+f,B),Ie=xe-r.colCount,Ve=oe.value;for(let Le=0;Le<Ie;Le++)Ve.push(100);r.colCount=xe,X=!0}if(W>=r.rowCount){const xe=Math.max(r.rowCount+m,W),Ie=xe-r.rowCount,Ve=pe.value;for(let Le=0;Le<Ie;Le++)Ve.push(void 0);r.rowCount=xe,X=!0}X&&((Ce=De.scheduleRender)==null||Ce.call(De))}function jl(){return r.colCount!==a||r.rowCount!==i}function pl(h,S,B){var Ce,xe,Ie;if(!wo(h,S,ve))return;(Ce=De.saveUndo)==null||Ce.call(De),Zt(S.endCol,S.endRow);const W=js(h,S,{cells:y},B,n.value,r.colCount,r.rowCount,ht);_n();for(const[Ve,Le]of Object.entries(W.cells)){const Ue=Le.value;Ue===""&&(Le.styleId===void 0||Le.styleId===0)?(Xe.clear(Ve),ye(Ve)):(y[Ve]={value:Ue,...Le.styleId!==void 0&&Le.styleId>0?{styleId:Le.styleId}:{}},Ue.startsWith("=")?Xe.set(Ve,jn(Ue.slice(1),r.colCount,r.rowCount)):Xe.clear(Ve)),Xe.markDirty(Ve)}const X={startCol:Math.min(h.startCol,S.startCol),startRow:Math.min(h.startRow,S.startRow),endCol:Math.max(h.endCol,S.endCol),endRow:Math.max(h.endRow,S.endRow)};Se(X.startCol,X.startRow,X.endCol,X.endRow),(xe=De.scheduleRender)==null||xe.call(De),(Ie=De.emitModelData)==null||Ie.call(De)}function fn(h,S){var Ce;let B=!1;const W=Math.max(1,Math.floor(h)),X=Math.max(1,Math.floor(S));if(W!==r.colCount){if(W>r.colCount){const xe=oe.value;for(let Ie=r.colCount;Ie<W;Ie++)xe.push(100)}else oe.value=oe.value.slice(0,W);r.colCount=W,B=!0}if(X!==r.rowCount){if(X>r.rowCount){const xe=pe.value;for(let Ie=r.rowCount;Ie<X;Ie++)xe.push(void 0)}else pe.value=pe.value.slice(0,X);r.rowCount=X,B=!0}B&&((Ce=De.scheduleRender)==null||Ce.call(De))}const De={props:o,locale:n,get colCount(){return r.colCount},get rowCount(){return r.rowCount},ensureCapacity:Zt,hasDynamicDims:jl,setDims:fn,cells:y,styles:k,borders:d,merges:ve,formulaDeps:Xe,selection:Je,activeCell:Ze,editingCell:lt,editValue:et,colWidths:oe,rowHeights:pe,scrollX:g,scrollY:A,freeze:L,setFreeze:bt,clearFreeze:Ct,getFreeze:Kt,getFrozenMetrics:dn,filter:$,getFilter:sn,setFilter:I,enableFilter:N,clearFilter:O,clearFilterColumn:de,setFilterColumn:ge,getColumnCandidates:Me,getDataRange:ft,getCurrentRegion:Ee,detectFilterRange:fe,toggleAutoFilter:Z,isColumnInFilterRange:ze,getFilterRange:$e,isFilterEnabled:le,isFilterColumnActive:Ke,isRowHidden:Xt,getFilteredOutRows:fl,getVisibleRowCount:Kl,getVisibleRowAt:Gl,getVisibleRowIndex:Yl,getViewportRegions:Qn,cellToScreenRect:eo,screenToCell:rl,isCellFrozen:kl,scrollCellIntoView:ml,BASE_CELL_VPAD:c,fontMetricsCache:ie,fontMetricsCanvas:re,measureFontMetrics:he,_getFontMetricsForCell:at,getWrappedLines:Mt,cellFontSize:St,colPositions:Rt,getRowHeight:Cl,_isAutoRow:Dl,rowPositions:E,totalWidth:U,totalHeight:J,selectCell:me,selectRange:Se,selectAll:We,isSelected:st,isCellSelected:Bt,selectionMode:gt,cellKey:ue,delCell:ye,findMerge:zt,_isMergeAnchor:jt,_mergedSpan:Vt,expandSelectionForMerges:Ht,getCellRaw:_t,getCellValue:Pt,setCellValue:Xl,clearCellsInRange:un,startEdit:Nl,commitEdit:kn,cancelEdit:En,moveActive:In,ensureVisible:An,hitCol:Ut,hitRow:Fl,registerStyle:te,resolveStyle:Y,rebuildStyleIndex:K,syncStyles:C,registerBorder:j,resolveBorder:q,rebuildBorderIndex:se,syncBorders:Fe,getCellBorderSide:Qe,getMergeOwner:Ge,isSameMergeInternal:be,viewSize:Ft,findHighlight:(h,S)=>null,autoFillState:ee,applyAutoFill:pl};return vl=()=>{var h;return(h=De.saveUndo)==null?void 0:h.call(De)},Yt=(h,S)=>{var B;return(B=De.clampScroll)==null?void 0:B.call(De,h,S)},De}function nu(e,l){const o=t.ref([]),n=t.ref([]);function a(E){return Js(E)}function i(){return l.saveSheet(),{sheets:l.sheets.value.map(E=>({id:E.id,name:E.name,cells:a(E.cells),styles:[...E.styles],borders:E.borders?[...E.borders]:[{}],merges:E.merges?{...E.merges}:{},selection:E.selection?{...E.selection}:null,activeCell:E.activeCell?{...E.activeCell}:{col:0,row:0},scrollX:E.scrollX,scrollY:E.scrollY,colWidths:[...E.colWidths],rowHeights:[...E.rowHeights],colCount:E.colCount,rowCount:E.rowCount,freeze:{...E.freeze},filter:E.filter?JSON.parse(JSON.stringify(E.filter)):null})),styles:[...e.styles],activeSheetIndex:l.activeSheetIndex.value}}function r(E){const U=l.sheets.value;l.sheets.value=E.sheets.map((J,ue)=>{var me;const ye=((me=U[ue])==null?void 0:me.freeze)??{rows:0,cols:0};return{...J,cells:a(J.cells),styles:[...J.styles],borders:J.borders?[...J.borders]:[{}],freeze:{rows:ye.rows,cols:ye.cols}}}),l.loadSheet(Math.max(0,Math.min(E.activeSheetIndex,l.sheets.value.length-1))),e.formulaDeps.rebuild(e.cells,e.colCount,e.rowCount)}function f(){const E=i(),U=o.value[o.value.length-1];U&&JSON.stringify(U)===JSON.stringify(E)||(o.value.push(E),n.value=[],o.value.length>50&&o.value.shift())}e.saveUndo=f;function m(){var E;o.value.length&&(n.value.push(i()),r(o.value.pop()),(E=e.scheduleRender)==null||E.call(e),t.nextTick(()=>{var U;return(U=e.emitModelData)==null?void 0:U.call(e)}))}function y(){var E;n.value.length&&(o.value.push(i()),r(n.value.pop()),(E=e.scheduleRender)==null||E.call(e),t.nextTick(()=>{var U;return(U=e.emitModelData)==null?void 0:U.call(e)}))}const k=t.computed(()=>o.value.length>0),d=t.computed(()=>n.value.length>0),w=t.computed(()=>!!e.selection.value),v=t.ref(null);function R(){var J;const E=e.selection.value;if(!E)return;const U={};for(let ue=E.startCol;ue<=E.endCol;ue++)for(let ye=E.startRow;ye<=E.endRow;ye++)U[`${ue-E.startCol},${ye-E.startRow}`]=((J=e.cells[e.cellKey(ue,ye)])==null?void 0:J.styleId)??0;v.value={styles:U}}function G(){var J,ue,ye;const E=v.value,U=e.selection.value;if(!(!E||!U)){f();for(let me=U.startCol;me<=U.endCol;me++)for(let Se=U.startRow;Se<=U.endRow;Se++){const We=e.findMerge(me,Se);if(We&&(me!==We.range.startCol||Se!==We.range.startRow))continue;const st=E.styles[`${me-U.startCol},${Se-U.startRow}`]??0,Bt=e.cellKey(me,Se),zt=((J=e.cells[Bt])==null?void 0:J.value)??"";if(zt===""&&st===0)e.delCell(Bt);else{const jt={value:zt};st>0&&(jt.styleId=st),e.cells[Bt]=jt}}v.value=null,(ue=e.scheduleRender)==null||ue.call(e),(ye=e.emitModelData)==null||ye.call(e)}}function te(){var U,J,ue;const E=e.selection.value;if(E){f();for(let ye=E.startCol;ye<=E.endCol;ye++)for(let me=E.startRow;me<=E.endRow;me++){const Se=e.findMerge(ye,me);if(Se&&(ye!==Se.range.startCol||me!==Se.range.startRow))continue;const We=e.cellKey(ye,me),st=((U=e.cells[We])==null?void 0:U.value)??"";st===""?e.delCell(We):e.cells[We]={value:st}}(J=e.scheduleRender)==null||J.call(e),(ue=e.emitModelData)==null||ue.call(e)}}const Y=t.computed(()=>br.map(E=>({...E,label:E.value===""?D(e.locale.value,"fontDefault"):E.label}))),K=t.computed(()=>Cr.map(E=>({...E,label:String(E.value)}))),C="\0",j=t.computed(()=>{const E=e.selection.value;if(!E)return"";let U,J=!1;for(let ue=E.startCol;ue<=E.endCol&&!J;ue++)for(let ye=E.startRow;ye<=E.endRow&&!J;ye++){const me=e.findMerge(ue,ye);if(me&&(ue!==me.range.startCol||ye!==me.range.startRow))continue;const Se=e.resolveStyle(e.cells[e.cellKey(ue,ye)]),We=typeof(Se==null?void 0:Se.fontFamily)=="string"?Se.fontFamily:"";U===void 0?U=We:We!==U&&(J=!0)}return J?C:U??""}),q=t.computed(()=>{const E=e.selection.value;if(!E)return _l;let U,J=!1;for(let ue=E.startCol;ue<=E.endCol&&!J;ue++)for(let ye=E.startRow;ye<=E.endRow&&!J;ye++){const me=e.findMerge(ue,ye);if(me&&(ue!==me.range.startCol||ye!==me.range.startRow))continue;const Se=e.cellFontSize(ue,ye);U===void 0?U=Se:Se!==U&&(J=!0)}return J?0:U??_l});function se(E,U){var ue,ye,me;const J=e.selection.value;if(J){f();for(let Se=J.startCol;Se<=J.endCol;Se++)for(let We=J.startRow;We<=J.endRow;We++){const st=e.findMerge(Se,We);if(st&&(Se!==st.range.startCol||We!==st.range.startRow))continue;const Bt=e.cellKey(Se,We),zt=((ue=e.cells[Bt])==null?void 0:ue.value)??"";let Vt={...e.resolveStyle(e.cells[Bt])??{}};if(U===""||U===null||U===void 0||U===0){const{[E]:_t,...Pt}=Vt;Vt=Pt}else Vt[E]=U;const Ht=Object.keys(Vt).length?e.registerStyle(Vt):0;if(zt===""&&Ht===0)e.delCell(Bt);else{const _t={value:zt};Ht>0&&(_t.styleId=Ht),e.cells[Bt]=_t}}(ye=e.scheduleRender)==null||ye.call(e),(me=e.emitModelData)==null||me.call(e)}}function Fe(E){se("fontFamily",E===""?"":E)}const Qe=t.ref(!1),Ge=t.ref(!1),be=t.ref(!1),ve=t.ref(!1),Xe=t.ref(!1);function Je(E){se("fontSize",E),Qe.value=!1}const gt=t.computed(()=>Mr.map(E=>({label:D(e.locale.value,E.labelKey),value:E.value,icon:E.icon}))),Ze=t.computed(()=>xr.map(E=>({label:D(e.locale.value,E.labelKey),value:E.value,icon:E.icon}))),lt=t.computed(()=>{const E=e.selection.value;if(!E)return"left";const U=e.resolveStyle(e.cells[e.cellKey(E.startCol,E.startRow)]),J=typeof(U==null?void 0:U.textAlign)=="string"?U.textAlign:"";return J==="center"||J==="right"?J:"left"}),et=t.computed(()=>{const E=e.selection.value;if(!E)return"top";const U=e.resolveStyle(e.cells[e.cellKey(E.startCol,E.startRow)]),J=typeof(U==null?void 0:U.verticalAlign)=="string"?U.verticalAlign:"";return J==="middle"||J==="bottom"?J:"top"}),oe=t.computed(()=>{const E=e.selection.value;if(!E)return!1;const U=e.resolveStyle(e.cells[e.cellKey(E.startCol,E.startRow)]);return(U==null?void 0:U.wrap)==="wrap"});function pe(E){se("textAlign",E)}function g(E){se("verticalAlign",E)}function A(){if(!e.selection.value)return;const U=oe.value;se("wrap",U?void 0:"wrap")}const L=t.ref(""),$=Qe;t.watch(q,E=>{L.value=E===0?"":String(E)},{immediate:!0});function ee(E){const U=E.replace(/[^\d]/g,"");L.value=U;const J=parseInt(U,10);!isNaN(J)&&J>=5&&J<=72&&J!==q.value&&se("fontSize",J)}function ie(){const E=L.value.trim();if(!E){L.value=q.value===0?"":String(q.value);return}let U=parseInt(E,10);isNaN(U)?U=q.value===0?_l:q.value:U=Math.max(5,Math.min(72,U)),L.value=String(U),U!==q.value&&se("fontSize",U)}function re(E){E.key==="Enter"&&E.target.blur()}function he(E){E&&E.preventDefault(),$.value=!$.value,$.value&&(be&&(be.value=!1),Ge&&(Ge.value=!1),ve.value=!1,Xe.value=!1)}function ce(){const E=q.value===0?_l:q.value,U=Math.min(72,E+1);se("fontSize",U),L.value=String(U),$.value=!1}function V(){const E=q.value===0?_l:q.value,U=Math.max(5,E-1);se("fontSize",U),L.value=String(U),$.value=!1}function c(E){const U=e.selection.value;if(!U)return!1;let J,ue=!1;for(let ye=U.startCol;ye<=U.endCol&&!ue;ye++)for(let me=U.startRow;me<=U.endRow&&!ue;me++){const Se=e.findMerge(ye,me);if(Se&&(ye!==Se.range.startCol||me!==Se.range.startRow))continue;const We=e.resolveStyle(e.cells[e.cellKey(ye,me)]),st=!!(We!=null&&We[E]);J===void 0?J=st:st!==J&&(ue=!0)}return!ue&&J===!0}const u=t.computed(()=>c("fontWeight")),p=t.computed(()=>c("fontStyle")),H=t.computed(()=>c("underline")),ct=t.computed(()=>c("strikethrough"));function ae(){se("fontWeight",u.value?"":"bold")}function Pe(){se("fontStyle",p.value?"":"italic")}function at(){se("underline",H.value?"":"underline")}function Mt(){se("strikethrough",ct.value?"":"line-through")}const St=t.ref(""),Rt=t.ref(""),Ft=ve,Yt=Xe;function nl(){Ft.value=!Ft.value,Yt.value=!1,Ge&&(Ge.value=!1),be&&(be.value=!1)}function Cl(){Yt.value=!Yt.value,Ft.value=!1,Ge&&(Ge.value=!1),be&&(be.value=!1)}function Dl(E){Ge&&(Ge.value=E),E&&(Ft.value=!1,Yt.value=!1,be&&(be.value=!1))}function cl(E){St.value=E,se("color",E===""?"":E)}function wl(E){Rt.value=E,se("backgroundColor",E===""?"":E)}function ol(){se("color",St.value===""?"":St.value)}function fl(){se("backgroundColor",Rt.value===""?"":Rt.value)}const Xt=t.computed(()=>{const E=e.selection.value;if(!E)return"";let U,J=!1;for(let ue=E.startCol;ue<=E.endCol&&!J;ue++)for(let ye=E.startRow;ye<=E.endRow&&!J;ye++){const me=e.findMerge(ue,ye);if(me&&(ue!==me.range.startCol||ye!==me.range.startRow))continue;const Se=e.resolveStyle(e.cells[e.cellKey(ue,ye)]),We=typeof(Se==null?void 0:Se.color)=="string"?Se.color:"";U===void 0?U=We:We!==U&&(J=!0)}return J?"":U??""}),Kl=t.computed(()=>{const E=e.selection.value;if(!E)return"";let U,J=!1;for(let ue=E.startCol;ue<=E.endCol&&!J;ue++)for(let ye=E.startRow;ye<=E.endRow&&!J;ye++){const me=e.findMerge(ue,ye);if(me&&(ue!==me.range.startCol||ye!==me.range.startRow))continue;const Se=e.resolveStyle(e.cells[e.cellKey(ue,ye)]),We=typeof(Se==null?void 0:Se.backgroundColor)=="string"?Se.backgroundColor:"";U===void 0?U=We:We!==U&&(J=!0)}return J?"":U??""}),Gl=t.computed(()=>Vo(e.locale.value)),Yl=t.ref(!1),sn=t.computed(()=>{const E=e.selection.value;if(!E)return Wl;let U,J=!1;for(let ue=E.startCol;ue<=E.endCol&&!J;ue++)for(let ye=E.startRow;ye<=E.endRow&&!J;ye++){const me=e.findMerge(ue,ye);if(me&&(ue!==me.range.startCol||ye!==me.range.startRow))continue;const Se=e.resolveStyle(e.cells[e.cellKey(ue,ye)]),We=(Se==null?void 0:Se.numberFormatCategory)==="custom"?$l:typeof(Se==null?void 0:Se.numberFormat)=="string"?Se.numberFormat:"";U===void 0?U=We:We!==U&&(J=!0)}return J?Bl:U??Wl});function I(E){if((E==null?void 0:E.numberFormatCategory)==="custom")return $l;const U=typeof(E==null?void 0:E.numberFormat)=="string"?E.numberFormat:"";return Ao(U,e.locale.value)}const N=t.computed(()=>{const E=sn.value;if(E!==Bl)return E===$l?$l:Ao(E,e.locale.value);const U=e.selection.value;if(!U)return Wl;let J,ue=!1;for(let ye=U.startCol;ye<=U.endCol&&!ue;ye++)for(let me=U.startRow;me<=U.endRow&&!ue;me++){const Se=e.findMerge(ye,me);if(Se&&(ye!==Se.range.startCol||me!==Se.range.startRow))continue;const We=I(e.resolveStyle(e.cells[e.cellKey(ye,me)]));J===void 0?J=We:We!==J&&(ue=!0)}return ue?Bl:J??Wl});function O(E){se("numberFormat",E),de()}function de(){const E=e.selection.value;if(E)for(let U=E.startCol;U<=E.endCol;U++)for(let J=E.startRow;J<=E.endRow;J++){const ue=e.findMerge(U,J);if(ue&&(U!==ue.range.startCol||J!==ue.range.startRow))continue;const ye=e.cellKey(U,J),me=e.cells[ye],Se=e.resolveStyle(me);if((Se==null?void 0:Se.numberFormatCategory)!=="custom")continue;const{numberFormatCategory:We,...st}=Se,Bt=Object.keys(st).length?e.registerStyle(st):0,zt=(me==null?void 0:me.value)??"";if(zt===""&&Bt===0)e.delCell(ye);else{const jt={value:zt};Bt>0&&(jt.styleId=Bt),e.cells[ye]=jt}}}function ge(E){if(E===$l){Yl.value=!0;return}O(E)}function Me(){Yl.value=!0}function Ee(){const E=e.selection.value;if(!E)return[];const U=[];for(let J=E.startCol;J<=E.endCol;J++)for(let ue=E.startRow;ue<=E.endRow;ue++){const ye=e.findMerge(J,ue);if(ye&&(J!==ye.range.startCol||ue!==ye.range.startRow))continue;const me=e.cellKey(J,ue),Se=e.cells[me],We=e.resolveStyle(Se),st=typeof(We==null?void 0:We.numberFormat)=="string"?We.numberFormat:Wl,Bt=(Se==null?void 0:Se.value)??"",zt=Bt.startsWith("=")?Yo(J,ue,e.cells,e.colCount,e.rowCount):Bt;Io(st,zt)&&U.push({key:me,nf:st,decimals:Gr(st,zt)})}return U}const fe=t.computed(()=>Ee().some(E=>E.decimals<co)),Z=t.computed(()=>Ee().some(E=>E.decimals>so));function ze(E,U,J){var We;const ue=((We=e.cells[E])==null?void 0:We.value)??"",me={...e.resolveStyle(e.cells[E])??{}};U===""?(delete me.numberFormat,delete me.numberFormatCategory):(me.numberFormat=U,J==="custom"&&(me.numberFormatCategory="custom"));const Se=Object.keys(me).length?e.registerStyle(me):0;if(ue===""&&Se===0)e.delCell(E);else{const st={value:ue};Se>0&&(st.styleId=Se),e.cells[E]=st}}function $e(E){var ue,ye;const U=Ee(),J=[];for(const me of U){const Se=me.decimals+E;if(Se<so||Se>co)continue;const We=Xr(me.nf,Se);We==null||We===me.nf||J.push({key:me.key,code:We,category:dl(me.nf)?"custom":void 0})}if(J.length){f();for(const me of J)ze(me.key,me.code,me.category);(ue=e.scheduleRender)==null||ue.call(e),(ye=e.emitModelData)==null||ye.call(e)}}function le(){$e(1)}function Ke(){$e(-1)}return{undoStack:o,redoStack:n,cloneCells:a,takeSnap:i,restoreSnap:r,saveUndo:f,undo:m,redo:y,canUndo:k,canRedo:d,hasSelection:w,paintFmt:v,onPaintFormat:R,applyPaintFormat:G,clearFormat:te,fontFamilyOptions:Y,fontSizeOptions:K,FONT_FAMILY_MIXED:C,selFontFamily:j,selFontSize:q,applyStyleToSelection:se,onFontFamilyChange:Fe,onFontSizeChange:Je,hAlignOptions:gt,vAlignOptions:Ze,selHAlign:lt,selVAlign:et,selWrap:oe,onHAlignChange:pe,onVAlignChange:g,onWrapToggle:A,fontSizeInput:L,fontSizeMenuOpen:$,onFontSizeInput:ee,onFontSizeBlur:ie,onFontSizeKeydown:re,toggleFontSizeMenu:he,onFontSizeStepUp:ce,onFontSizeStepDown:V,selFontWeight:u,selFontStyle:p,selUnderline:H,selStrikethrough:ct,toggleFontWeight:ae,toggleFontStyle:Pe,toggleUnderline:at,toggleStrikethrough:Mt,cachedTextColor:St,cachedFillColor:Rt,textColorMenuOpen:Ft,fillColorMenuOpen:Yt,_toggleTextColorMenu:nl,_toggleFillColorMenu:Cl,onBorderMenuToggle:Dl,onTextColorChange:cl,onFillColorChange:wl,applyCachedTextColor:ol,applyCachedFillColor:fl,selTextColor:Xt,selFillColor:Kl,nfOptions:Gl,selNumberFormat:sn,selNumberFormatDisplay:N,NF_NUMBER_FORMAT_MIXED:Bl,nfDialogOpen:Yl,onNumberFormatChange:ge,openNumberFormatDialog:Me,applyNumberFormatCode:O,canIncreaseDecimals:fe,canDecreaseDecimals:Z,onIncreaseDecimals:le,onDecreaseDecimals:Ke}}function ou(e,l){l.borderMenuOpen&&(e.borderMenuOpen=l.borderMenuOpen),l.mergeMenuOpen&&(e.mergeMenuOpen=l.mergeMenuOpen),(()=>{const n=e.borderMenuOpen,a=e.mergeMenuOpen;e.onBorderMenuToggle=i=>{n&&(n.value=i),i&&(e.textColorMenuOpen.value=!1,e.fillColorMenuOpen.value=!1,a&&(a.value=!1))},e.toggleFontSizeMenu=i=>{i&&i.preventDefault(),e.fontSizeMenuOpen.value=!e.fontSizeMenuOpen.value,e.fontSizeMenuOpen.value&&(a&&(a.value=!1),n&&(n.value=!1),e.textColorMenuOpen.value=!1,e.fillColorMenuOpen.value=!1)},e._toggleTextColorMenu=()=>{e.textColorMenuOpen.value=!e.textColorMenuOpen.value,e.fillColorMenuOpen.value=!1,n&&(n.value=!1),a&&(a.value=!1)},e._toggleFillColorMenu=()=>{e.fillColorMenuOpen.value=!e.fillColorMenuOpen.value,e.textColorMenuOpen.value=!1,n&&(n.value=!1),a&&(a.value=!1)}})()}function ru(e,l){const o=t.ref("none"),n=t.ref(!1),a="#444";function i(g,A,L,$){if(g<0||A<0||g>=e.colCount||A>=e.rowCount)return;const ee=e.findMerge(g,A),ie=ee?ee.anchor:e.cellKey(g,A);if(!e.cells[ie]){if(!$)return;e.cells[ie]={value:""}}tu(e.cells[ie],L,$,e.styles,{get:he=>e.resolveBorder(he),getId:he=>e.registerBorder(he)},e.registerStyle)}function r(g,A,L){var ce;const $=e.findMerge(g,A),ee=$?$.anchor:e.cellKey(g,A),ie=((ce=e.cells[ee])==null?void 0:ce.value)??"",re=e.resolveStyle(e.cells[ee])?{...e.resolveStyle(e.cells[ee])}:{},he=e.registerBorder(L);if(he>0?re.borderId=he:delete re.borderId,delete re.borderTopWidth,delete re.borderBottomWidth,delete re.borderLeftWidth,delete re.borderRightWidth,delete re.borderColor,ie===""&&!Object.keys(re).length)e.delCell(ee);else{const V=e.registerStyle(re);e.cells[ee]={value:ie,styleId:V||void 0}}}function f(g){var ce,V;o.value=g;const A=e.selection.value;if(!A)return;l.saveUndo();const{startCol:L,startRow:$,endCol:ee,endRow:ie}=A,re={width:1,color:a},he={width:2,color:a};if(g==="none")for(let c=L;c<=ee;c++)for(let u=$;u<=ie;u++){const p=e.findMerge(c,u);p&&(c!==p.range.startCol||u!==p.range.startRow)||r(c,u,{})}else if(g==="all")for(let c=L;c<=ee;c++)for(let u=$;u<=ie;u++){const p=e.findMerge(c,u);p&&(c!==p.range.startCol||u!==p.range.startRow)||r(c,u,{top:re,right:re,bottom:re,left:re})}else if(g==="outer"||g==="thickOuter"){const c=g==="thickOuter"?he:re;for(let u=L;u<=ee;u++)i(u,$,"top",c);for(let u=L;u<=ee;u++)i(u,ie,"bottom",c);for(let u=$;u<=ie;u++)i(L,u,"left",c);for(let u=$;u<=ie;u++)i(ee,u,"right",c)}else{const u={top:{side:"top",edgeCheck:(p,H)=>H===$},bottom:{side:"bottom",edgeCheck:(p,H)=>H===ie},left:{side:"left",edgeCheck:(p,H)=>p===L},right:{side:"right",edgeCheck:(p,H)=>p===ee}}[g];if(u)for(let p=L;p<=ee;p++)for(let H=$;H<=ie;H++)u.edgeCheck(p,H)&&i(p,H,u.side,re)}(ce=e.scheduleRender)==null||ce.call(e),(V=e.emitModelData)==null||V.call(e)}function m(){f(o.value)}function y(g,A,L){const $=L.toLowerCase(),ee=e.findMerge(g,A);if(ee){if($==="top"&&A!==ee.range.startRow||$==="bottom"&&A!==ee.range.endRow||$==="left"&&g!==ee.range.startCol||$==="right"&&g!==ee.range.endCol)return 0;const re=e.getCellBorderSide(e.cells[ee.anchor],$);return(re==null?void 0:re.width)??0}const ie=e.getCellBorderSide(e.cells[e.cellKey(g,A)],$);return(ie==null?void 0:ie.width)??0}const k=t.ref(!1);function d(g){k.value=g,g&&(l.textColorMenuOpen.value=!1,l.fillColorMenuOpen.value=!1,n.value=!1,l.fontSizeMenuOpen.value=!1)}function w(g,A,L,$){const ee=[];for(const ie in e.merges){const re=e.merges[ie];re&&re.startCol<=L&&re.endCol>=g&&re.startRow<=$&&re.endRow>=A&&ee.push(ie)}for(const ie of ee)Reflect.deleteProperty(e.merges,ie)}function v(){var ie,re,he;const g=e.selection.value;if(!g||g.startCol===g.endCol&&g.startRow===g.endRow)return;l.saveUndo(),w(g.startCol,g.startRow,g.endCol,g.endRow);const A=e.cellKey(g.startCol,g.startRow),L=((ie=e.cells[A])==null?void 0:ie.value)??"";for(let ce=g.startCol;ce<=g.endCol;ce++)for(let V=g.startRow;V<=g.endRow;V++)ce===g.startCol&&V===g.startRow||e.clearCellsInRange(ce,ce,V,V);const $=e.resolveStyle(e.cells[A])?{...e.resolveStyle(e.cells[A])}:{};$.textAlign="center";const ee=e.registerStyle($);e.cells[A]={value:L,styleId:ee||void 0},e.merges[A]={startCol:g.startCol,startRow:g.startRow,endCol:g.endCol,endRow:g.endRow},e.selectCell(g.startCol,g.startRow),(re=e.scheduleRender)==null||re.call(e),(he=e.emitModelData)==null||he.call(e)}function R(){var A,L,$;const g=e.selection.value;if(!(!g||g.startCol===g.endCol)){l.saveUndo();for(let ee=g.startRow;ee<=g.endRow;ee++){w(g.startCol,ee,g.endCol,ee);const ie=e.cellKey(g.startCol,ee);(A=e.cells[ie])==null||A.value;for(let re=g.startCol+1;re<=g.endCol;re++)e.clearCellsInRange(re,re,ee,ee);e.merges[ie]={startCol:g.startCol,startRow:ee,endCol:g.endCol,endRow:ee}}e.selectRange(g.startCol,g.startRow,g.endCol,g.endRow),(L=e.scheduleRender)==null||L.call(e),($=e.emitModelData)==null||$.call(e)}}function G(){var L,$,ee;const g=e.selection.value;if(!g||g.startCol===g.endCol&&g.startRow===g.endRow)return;l.saveUndo(),w(g.startCol,g.startRow,g.endCol,g.endRow);const A=e.cellKey(g.startCol,g.startRow);(L=e.cells[A])==null||L.value;for(let ie=g.startCol;ie<=g.endCol;ie++)for(let re=g.startRow;re<=g.endRow;re++)ie===g.startCol&&re===g.startRow||e.clearCellsInRange(ie,ie,re,re);e.merges[A]={startCol:g.startCol,startRow:g.startRow,endCol:g.endCol,endRow:g.endRow},e.selectCell(g.startCol,g.startRow),($=e.scheduleRender)==null||$.call(e),(ee=e.emitModelData)==null||ee.call(e)}function te(){var A,L;const g=e.selection.value;g&&(l.saveUndo(),w(g.startCol,g.startRow,g.endCol,g.endRow),(A=e.scheduleRender)==null||A.call(e),(L=e.emitModelData)==null||L.call(e))}function Y(){const g=e.selection.value;if(!g)return;const A=e.findMerge(g.startCol,g.startRow);A&&g.startCol===A.range.startCol&&g.startRow===A.range.startRow&&g.endCol===A.range.endCol&&g.endRow===A.range.endRow?te():v()}function K(g){switch(g){case"mergeCenter":v();break;case"mergeAcross":R();break;case"mergeCells":G();break;case"unmergeCells":te();break}}let C=null,j=[];function q(g,A,L,$){j=[];for(let ee=L;ee<=$;ee++){const ie=[];for(let re=g;re<=A;re++){const he=e.cells[e.cellKey(re,ee)];ie.push((he==null?void 0:he.styleId)??0)}j.push(ie)}}function se(g,A,L,$){const ee=e.cellKey(g,A);if(_n(),L===""||L==null){e.formulaDeps.clear(ee),$&&$>0?e.cells[ee]={value:"",styleId:$}:e.delCell(ee),e.formulaDeps.markDirty(ee);return}e.cells[ee]={value:L,styleId:$&&$>0?$:void 0},L.startsWith("=")?e.formulaDeps.set(ee,jn(L.slice(1),e.colCount,e.rowCount)):e.formulaDeps.clear(ee),e.formulaDeps.markDirty(ee)}function Fe(){const g=e.selection.value;if(!g)return;C={...g},q(g.startCol,g.endCol,g.startRow,g.endRow);const A=[];for(let L=g.startRow;L<=g.endRow;L++){const $=[];for(let ee=g.startCol;ee<=g.endCol;ee++)$.push(e.getCellRaw(ee,L));A.push($.join(" "))}po(A.join(`
|
|
4
|
+
`))}function Qe(){const g=e.selection.value;if(g){if(g.startCol===0&&g.endCol===e.colCount-1){C={...g},q(0,e.colCount-1,g.startRow,g.endRow);const A=[];for(let L=g.startRow;L<=g.endRow;L++){const $=[];for(let ee=0;ee<e.colCount;ee++)$.push(e.getCellRaw(ee,L));A.push($.join(" "))}po(A.join(`
|
|
5
|
+
`))}else if(g.startRow===0&&g.endRow===e.rowCount-1){C={...g},q(g.startCol,g.endCol,0,e.rowCount-1);const A=[];for(let L=0;L<e.rowCount;L++){const $=[];for(let ee=g.startCol;ee<=g.endCol;ee++)$.push(e.getCellRaw(ee,L));A.push($.join(" "))}po(A.join(`
|
|
6
|
+
`))}}}async function Ge(){var V;let g;try{g=await navigator.clipboard.readText()}catch{return}if(!g&&g!=="")return;const A=g.split(/\r?\n/),L=e.activeCell.value,$=C,ee=$&&j.length>0,ie=A.map(c=>c.split(" ").length),re=ie.length?Math.max(...ie):0,he=L.col+re-1,ce=L.row+A.length-1;he>=0&&ce>=0&&e.ensureCapacity(he,ce);for(let c=0;c<A.length;c++){const u=A[c].split(" ");for(let p=0;p<u.length;p++){const H=L.col+p,ct=L.row+c;let ae=u[p];if(ae.startsWith("=")&&$&&(ae=Xo(ae,H-($.startCol+p),ct-($.startRow+c),e.colCount,e.rowCount,ht)),ee&&c<j.length&&p<(((V=j[c])==null?void 0:V.length)??0)){const Pe=j[c][p]??null;se(H,ct,ae,Pe)}else e.setCellValue(H,ct,ae)}}}function be(){var g;if(l.saveUndo(),Fe(),e.selection.value){const A=e.selection.value;e.clearCellsInRange(A.startCol,A.endCol,A.startRow,A.endRow),(g=e.scheduleRender)==null||g.call(e)}}function ve(){var g;if(e.selection.value){const A=e.selection.value;e.clearCellsInRange(A.startCol,A.endCol,A.startRow,A.endRow),(g=e.scheduleRender)==null||g.call(e)}}function Xe(){var ie,re;const g=e.selection.value;if(!g)return;l.saveUndo();const A=g.startCol,L=g.startRow,$=g.endCol,ee=g.endRow;if(L===ee)if($+1<e.colCount){const he=`${ht(A)}${L+1}:${ht($)}${L+1}`;e.setCellValue($+1,L,`=SUM(${he})`)}else{const he=`${ht(A)}${L+1}:${ht($-1)}${L+1}`;e.setCellValue($,L,`=SUM(${he})`)}else for(let he=A;he<=$;he++)if(ee+1<e.rowCount){const ce=`${ht(he)}${L+1}:${ht(he)}${ee+1}`;e.setCellValue(he,ee+1,`=SUM(${ce})`)}else{const ce=`${ht(he)}${L+1}:${ht(he)}${ee}`;e.setCellValue(he,ee,`=SUM(${ce})`)}(ie=e.scheduleRender)==null||ie.call(e),(re=e.emitModelData)==null||re.call(e)}function Je(){var ie,re;const g=e.selection.value;if(!g)return;l.saveUndo();const A=g.startCol,L=g.startRow,$=g.endCol,ee=g.endRow;if(L===ee)if($+1<e.colCount){const he=`${ht(A)}${L+1}:${ht($)}${L+1}`;e.setCellValue($+1,L,`=AVERAGE(${he})`)}else{const he=`${ht(A)}${L+1}:${ht($-1)}${L+1}`;e.setCellValue($,L,`=AVERAGE(${he})`)}else for(let he=A;he<=$;he++)if(ee+1<e.rowCount){const ce=`${ht(he)}${L+1}:${ht(he)}${ee+1}`;e.setCellValue(he,ee+1,`=AVERAGE(${ce})`)}else{const ce=`${ht(he)}${L+1}:${ht(he)}${ee}`;e.setCellValue(he,ee,`=AVERAGE(${ce})`)}(ie=e.scheduleRender)==null||ie.call(e),(re=e.emitModelData)==null||re.call(e)}function gt(){var ie,re;const g=e.selection.value;if(!g)return;l.saveUndo();const A=g.startCol,L=g.startRow,$=g.endCol,ee=g.endRow;if(L===ee)if($+1<e.colCount){const he=`${ht(A)}${L+1}:${ht($)}${L+1}`;e.setCellValue($+1,L,`=COUNT(${he})`)}else{const he=`${ht(A)}${L+1}:${ht($-1)}${L+1}`;e.setCellValue($,L,`=COUNT(${he})`)}else for(let he=A;he<=$;he++)if(ee+1<e.rowCount){const ce=`${ht(he)}${L+1}:${ht(he)}${ee+1}`;e.setCellValue(he,ee+1,`=COUNT(${ce})`)}else{const ce=`${ht(he)}${L+1}:${ht(he)}${ee}`;e.setCellValue(he,ee,`=COUNT(${ce})`)}(ie=e.scheduleRender)==null||ie.call(e),(re=e.emitModelData)==null||re.call(e)}const Ze=t.ref(!1);function lt(g){Ze.value=g,g&&(l.textColorMenuOpen.value=!1,l.fillColorMenuOpen.value=!1,n.value=!1,l.fontSizeMenuOpen.value=!1,k.value=!1)}function et(){Xe(),Ze.value=!1}function oe(){Je(),Ze.value=!1}function pe(){gt(),Ze.value=!1}return{cachedBorder:o,borderMenuOpen:n,BORDER_COLOR:a,onBorderChange:f,setCellBorderSide:i,applyBorderToCell:r,applyCachedBorder:m,cellBorderWidth:y,mergeMenuOpen:k,onMergeMenuToggle:d,removeOverlappingMerges:w,mergeAndCenter:v,mergeAcross:R,mergeCells:G,unmergeCells:te,onApplyMerge:Y,onMergeChange:K,copySourceRange:null,copySourceStyles:[],captureStyles:q,setCellWithStyle:se,copyToClipboard:Fe,copyRowCol:Qe,pasteFromClipboard:Ge,cutSelected:be,clearSelected:ve,sumSelected:Xe,avgSelected:Je,countSelected:gt,calcMenuOpen:Ze,onCalcMenuToggle:lt,onCalcSum:et,onCalcAvg:oe,onCalcCount:pe}}function au(e,l,o,n){const a={},i=n(l),r=n(o);return i!=null&&(a.width=`${i}px`),r!=null&&(a.height=`${r}px`),a["--sp-formula-bar-bg"]=e.formulaBarBg,a["--sp-formula-bar-border"]=e.formulaBarBorder,a["--sp-formula-bar-label-color"]=e.formulaBarLabelText,a["--sp-formula-bar-label-bg"]=e.formulaBarLabelBg,a["--sp-formula-bar-label-border"]=e.formulaBarLabelBorder,a["--sp-formula-bar-input-bg"]=e.formulaBarInputBg,a["--sp-formula-bar-input-border"]=e.formulaBarInputBorder,a["--sp-formula-bar-input-color"]=e.formulaBarInputText,a["--sp-formula-bar-input-focus-border"]=e.formulaBarInputFocusBorder,a["--sp-formula-bar-input-focus-shadow"]=e.formulaBarInputFocusShadow,a["--sp-wrapper-bg"]=e.wrapperBg,a["--sp-cell-editor-border"]=e.cellEditorBorder,a["--sp-cell-editor-color"]=e.cellEditorText,a["--sp-cell-editor-bg"]=e.cellEditorBg,a["--sp-cell-editor-shadow"]=e.cellEditorShadow,a["--sp-tab-bar-bg"]=e.tabBarBg,a["--sp-tab-bar-border"]=e.tabBarBorder,a["--sp-tab-active-bg"]=e.tabActiveBg,a["--sp-tab-active-color"]=e.tabActiveText,a["--sp-tab-active-border"]=e.tabActiveBorder,a["--sp-tab-inactive-bg"]=e.tabInactiveBg,a["--sp-tab-inactive-color"]=e.tabInactiveText,a["--sp-tab-inactive-border"]=e.tabInactiveBorder,a["--sp-tab-hover-bg"]=e.tabHoverBg,a["--sp-tab-add-btn-color"]=e.tabAddBtnColor,a["--sp-tab-add-btn-hover-bg"]=e.tabAddBtnHoverBg,a["--sp-tab-scroll-btn-color"]=e.tabScrollBtnColor,a["--sp-tab-scroll-btn-hover-bg"]=e.tabScrollBtnHoverBg,a["--sp-scroll-thumb"]=e.scrollbarThumb,a["--sp-scroll-thumb-hover"]=e.scrollbarThumbHover,a["--sp-scroll-btn-bg"]=e.scrollBtnBg,a["--sp-scroll-btn-color"]=e.scrollBtnColor,a["--sp-scroll-btn-hover-bg"]=e.scrollBtnHoverBg,a["--sp-scroll-btn-active-bg"]=e.scrollBtnActiveBg,a["--sp-scroll-track-bg"]=e.scrollTrackBg,a["--sp-toolbar-bg"]=e.toolbarBg,a["--sp-toolbar-border"]=e.toolbarBorder,a["--sp-toolbar-btn-color"]=e.toolbarBtnColor,a["--sp-toolbar-btn-hover-bg"]=e.toolbarBtnHoverBg,a["--sp-toolbar-btn-disabled-color"]=e.toolbarBtnDisabledColor,a["--sp-toolbar-btn-active-color"]=e.toolbarBtnActiveColor,a}function ir(e){return e==="number"?0:1}function cr(e,l,o){var i;if(e==null||e.trim()==="")return{kind:"blank"};const n=l??"";if(n===ul||n==="@")return{kind:"text",text:e};if(dl(n)){if(Ul(e))return{kind:"number",num:Number(e)};const r=Dn(e,o);return r?{kind:"number",num:r.serial}:{kind:"text",text:bl(e,n,o)}}const a=Pl(n);if(a.kind==="date"||a.kind==="duration"){const r=Number(e);return Number.isFinite(r)?{kind:"number",num:r}:{kind:"text",text:bl(e,n,o)}}if(a.kind==="number"){const r=Number(e);if(Number.isFinite(r)){const f=((i=a.sections.find(m=>m.hasDigits))==null?void 0:i.scale)??1;return{kind:"number",num:r*f}}return{kind:"text",text:bl(e,n,o)}}return{kind:"text",text:bl(e,n,o)}}function iu(e,l,o,n){if(e.kind==="blank"||l.kind==="blank")return e.kind==="blank"&&l.kind==="blank"?0:e.kind==="blank"?1:-1;const a=ir(e.kind),i=ir(l.kind);if(a!==i)return o==="asc"?a-i:i-a;let r;return e.kind==="number"?r=(e.num??0)-(l.num??0):r=(e.text??"").localeCompare(l.text??"",n,{numeric:!0}),o==="asc"?r:-r}function cu(e,l,o){const n=e.map((a,i)=>i);return n.sort((a,i)=>{const r=iu(e[a],e[i],l,o);return r!==0?r:a-i}),n}function su(e){if(e.length<2||e[0].kind!=="text")return!1;for(let l=1;l<e.length;l++)if(e[l].kind==="number")return!0;return!1}function vo(e){return e?JSON.parse(JSON.stringify(e)):null}function sr(e,l,o,n){if(!e)return null;const a=o-l+1,i={...e.range};return n?l<=i.endRow&&(l<=i.startRow&&(i.startRow+=a),i.endRow+=a):o<i.startRow?(i.startRow-=a,i.endRow-=a):l<=i.endRow&&(i.endRow-=Math.min(a,i.endRow-l+1),i.endRow<i.startRow&&(i.endRow=i.startRow)),{range:i,columns:e.columns}}function ur(e,l,o,n){if(!e)return null;const a=o-l+1,i={...e.range},r={};if(n){l<=i.endCol&&(l<=i.startCol&&(i.startCol+=a),i.endCol+=a);for(const f in e.columns){const m=Number(f);r[m>=l?m+a:m]=e.columns[f]}}else{o<i.startCol?(i.startCol-=a,i.endCol-=a):l<=i.endCol&&(i.endCol-=Math.min(a,i.endCol-l+1),i.endCol<i.startCol&&(i.endCol=i.startCol));for(const f in e.columns){const m=Number(f);m>=l&&m<=o||(r[m>o?m-a:m]=e.columns[f])}}return{range:i,columns:r}}function uu(e,l,o,n,a){function i(I,N){const O=N-I+1,de=Xe(I,N),ge=[],Me=[];for(const Z in e.cells){const ze=Z.indexOf(",");if(ze<0)continue;const $e=parseInt(Z.substring(0,ze),10),le=parseInt(Z.substring(ze+1),10);le>=I&&le<=N?Me.push(Z):le>N&&ge.push({oldKey:Z,newKey:e.cellKey($e,le-O),cell:e.cells[Z]})}for(const Z of Me)Reflect.deleteProperty(e.cells,Z);for(const Z of ge)Reflect.deleteProperty(e.cells,Z.oldKey),e.cells[Z.newKey]=Z.cell;const Ee=e.rowHeights.value,fe=new Array(Ee.length);for(let Z=0;Z<I;Z++)fe[Z]=Ee[Z];for(let Z=I;Z<Ee.length-O;Z++)fe[Z]=Ee[Z+O];for(let Z=Ee.length-O;Z<Ee.length;Z++)fe[Z]=void 0;e.rowHeights.value=fe,ve(de),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(sr(e.getFilter(),I,N,!1))}function r(I,N){const O=N-I+1,de=e.rowCount,ge=e.colCount,{lastRow:Me}=y();Me>=I&&Me+O>=de&&e.ensureCapacity(ge-1,de-1+O);const Ee=e.rowCount,fe=gt(I,N),Z=[];for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const ft=parseInt(le.substring(0,Ke),10),E=parseInt(le.substring(Ke+1),10);E>=I&&Z.push({oldKey:le,newKey:e.cellKey(ft,E+O),cell:e.cells[le],oldRow:E})}Z.sort((le,Ke)=>Ke.oldRow-le.oldRow);for(const le of Z)Reflect.deleteProperty(e.cells,le.oldKey),e.cells[le.newKey]=le.cell;for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const ft=parseInt(le.substring(Ke+1),10);ft>=I&&ft<=N&&Reflect.deleteProperty(e.cells,le)}const ze=e.rowHeights.value,$e=new Array(Ee);for(let le=0;le<I;le++)$e[le]=ze[le];for(let le=I;le<=N;le++)$e[le]=void 0;for(let le=I;le<Ee;le++)$e[le+O]=ze[le];e.rowHeights.value=$e,ve(fe),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(sr(e.getFilter(),I,N,!0))}function f(I,N){const O=N-I+1,de=e.colCount,ge=e.rowCount,{lastCol:Me}=y();Me>=I&&Me+O>=de&&e.ensureCapacity(de-1+O,ge-1);const Ee=e.colCount,fe=Ze(I,N),Z=[];for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const ft=parseInt(le.substring(0,Ke),10),E=parseInt(le.substring(Ke+1),10);ft>=I&&Z.push({oldKey:le,newKey:e.cellKey(ft+O,E),cell:e.cells[le],oldCol:ft})}Z.sort((le,Ke)=>Ke.oldCol-le.oldCol);for(const le of Z)Reflect.deleteProperty(e.cells,le.oldKey),e.cells[le.newKey]=le.cell;for(const le in e.cells){const Ke=le.indexOf(",");if(Ke<0)continue;const ft=parseInt(le.substring(0,Ke),10);ft>=I&&ft<=N&&Reflect.deleteProperty(e.cells,le)}const ze=e.colWidths.value,$e=new Array(Ee);for(let le=0;le<I;le++)$e[le]=ze[le];for(let le=I;le<=N;le++)$e[le]=100;for(let le=I;le<Ee;le++)$e[le+O]=ze[le];e.colWidths.value=$e,ve(fe),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(ur(e.getFilter(),I,N,!0))}function m(I,N){const O=N-I+1,de=Je(I,N),ge=[],Me=[];for(const Z in e.cells){const ze=Z.indexOf(",");if(ze<0)continue;const $e=parseInt(Z.substring(0,ze),10),le=parseInt(Z.substring(ze+1),10);$e>=I&&$e<=N?Me.push(Z):$e>N&&ge.push({oldKey:Z,newKey:e.cellKey($e-O,le),cell:e.cells[Z]})}for(const Z of Me)Reflect.deleteProperty(e.cells,Z);for(const Z of ge)Reflect.deleteProperty(e.cells,Z.oldKey),e.cells[Z.newKey]=Z.cell;const Ee=e.colWidths.value,fe=new Array(Ee.length);for(let Z=0;Z<I;Z++)fe[Z]=Ee[Z];for(let Z=I;Z<Ee.length-O;Z++)fe[Z]=Ee[Z+O];for(let Z=Ee.length-O;Z<Ee.length;Z++)fe[Z]=100;e.colWidths.value=fe,ve(de),e.freeze.rows=Math.max(0,Math.min(e.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(e.freeze.cols,e.colCount)),e.setFilter(ur(e.getFilter(),I,N,!1))}function y(){let I=-1,N=-1;for(const O in e.cells){const de=O.split(",");if(de.length===2){const ge=parseInt(de[0],10),Me=parseInt(de[1],10),Ee=e.cells[O];Ee&&(Ee.value!==""||Ee.styleId!==void 0)&&(ge>I&&(I=ge),Me>N&&(N=Me))}}for(let O=e.colCount-1;O>=0;O--){const de=e.colWidths.value[O];if(de!==void 0&&de!==100){O>I&&(I=O);break}}for(let O=e.rowCount-1;O>=0;O--)if(e.rowHeights.value[O]!==void 0){O>N&&(N=O);break}return{lastCol:I,lastRow:N}}function k(I,N){const O=e.resolveStyle(e.cells[e.cellKey(I,N)]);return typeof(O==null?void 0:O.numberFormat)=="string"?O.numberFormat:""}function d(I,N,O){for(let de=N;de<=O;de++)if(e.getCellRaw(I,de).trim()!=="")return!0;return!1}function w(I){const{startRow:N,endRow:O,startCol:de,endCol:ge}=I;let Me=de,Ee=ge;for(;Me>0&&d(Me-1,N,O);)Me--;for(;Ee<e.colCount-1&&d(Ee+1,N,O);)Ee++;return{startRow:N,endRow:O,startCol:Me,endCol:Ee}}function v(I){const N=w(I);return N.startCol!==I.startCol||N.endCol!==I.endCol}function R(I,N,O,de=I){let ge,Me;if(O)ge=O.startRow,Me=O.endRow;else{const le=e.selection.value,Ke=!!le&&le.startRow===le.endRow&&le.startCol===le.endCol;ge=Ke||!le?0:le.startRow,Me=Ke||!le?e.rowCount-1:le.endRow}let Ee=-1,fe=-1;for(let le=ge;le<=Me;le++){let Ke=!1;for(let ft=I;ft<=N;ft++)if(e.getCellRaw(ft,le).trim()!==""){Ke=!0;break}Ke&&(Ee<0&&(Ee=le),fe=le)}if(Ee<0)return null;const Z=[];for(let le=Ee;le<=fe;le++){const Ke=e.getCellRaw(de,le);Z.push(cr(Ke,k(de,le),e.locale.value))}const ze=su(Z)?Ee+1:Ee;let $e=!1;for(let le=Ee;le<=fe&&!$e;le++)for(let Ke=I;Ke<=N;Ke++){const ft=e.cells[e.cellKey(Ke,le)];if(ft&&ft.value.startsWith("=")){$e=!0;break}}if(!$e)for(const le in e.merges){const Ke=e.merges[le];if(Ke&&Ke.startCol<=N&&Ke.endCol>=I&&Ke.startRow<=Me&&Ke.endRow>=ge){$e=!0;break}}return{firstRow:Ee,lastRow:fe,sortStart:ze,blocked:$e}}function G(I,N){const O=R(I,N);return!!O&&!O.blocked&&O.sortStart<O.lastRow}function te(I,N,O){var E,U;const de=N??e.selection.value;if(!de)return;const ge=de.startCol,Me=de.endCol,Ee=O??ge,fe=R(ge,Me,{startRow:de.startRow,endRow:de.endRow},Ee);if(!fe||fe.blocked||fe.sortStart>=fe.lastRow)return;const Z=Me-ge+1,ze=fe.lastRow-fe.sortStart+1,$e=[],le=[];for(let J=fe.sortStart;J<=fe.lastRow;J++){const ue=new Array(Z);for(let me=ge;me<=Me;me++)ue[me-ge]=e.cells[e.cellKey(me,J)]??null;$e.push(ue);const ye=e.getCellRaw(Ee,J);le.push(cr(ye,k(Ee,J),e.locale.value))}const Ke=cu(le,I,e.locale.value);let ft=!1;for(let J=0;J<ze;J++)if(Ke[J]!==J){ft=!0;break}if(ft){l.saveUndo();for(let J=0;J<ze;J++){const ue=$e[Ke[J]],ye=fe.sortStart+J;for(let me=ge;me<=Me;me++){const Se=e.cellKey(me,ye),We=ue[me-ge],st=We?We.value:"",Bt=(E=e.cells[Se])==null?void 0:E.styleId;st!==""||Bt!==void 0?e.cells[Se]={value:st,styleId:Bt}:e.delCell(Se)}}_n();for(let J=fe.sortStart;J<=fe.lastRow;J++)for(let ue=ge;ue<=Me;ue++)e.formulaDeps.markDirty(e.cellKey(ue,J));(U=e.scheduleRender)==null||U.call(e),p()}}const Y=t.ref(!1),K=t.ref(null);function C(I){const N=e.selection.value;if(!N||!v(N))return!1;const O=w(N);return K.value={order:I,originalRange:N,expandedRange:O},Y.value=!0,!0}function j(I){const N=K.value;if(!N)return;const{order:O,originalRange:de,expandedRange:ge}=N;Y.value=!1,K.value=null,te(O,I?ge:de,de.startCol),Fe.value=O}function q(){Y.value=!1,K.value=null}const se=t.ref(!1),Fe=t.ref("asc");function Qe(I){se.value=I,I&&(l.textColorMenuOpen.value=!1,l.fillColorMenuOpen.value=!1,l.fontSizeMenuOpen.value=!1)}function Ge(I){C(I)||(Fe.value=I,te(I))}function be(){C(Fe.value)||te(Fe.value)}function ve(I){Object.keys(e.merges).forEach(N=>Reflect.deleteProperty(e.merges,N));for(const N of I)if(!(N.newRange.startCol>N.newRange.endCol||N.newRange.startRow>N.newRange.endRow)&&(e.merges[N.newAnchorKey]={...N.newRange},N.anchorCell)){const O=N.anchorCell.value,de=N.anchorCell.styleId;O===""&&!de||(e.cells[N.newAnchorKey]={value:O,styleId:de||void 0})}}function Xe(I,N){const O=N-I+1,de=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;const Ee=e.cells[ge]?{value:e.cells[ge].value,styleId:e.cells[ge].styleId??0}:{value:"",styleId:0},{startCol:fe,endCol:Z}=Me;let{startRow:ze,endRow:$e}=Me;if(ze>N){ze-=O,$e-=O,de.push({newAnchorKey:e.cellKey(fe,ze),newRange:{startCol:fe,startRow:ze,endCol:Z,endRow:$e}});continue}if($e<I){de.push({newAnchorKey:ge,newRange:{startCol:fe,startRow:ze,endCol:Z,endRow:$e}});continue}if(ze>=I&&$e<=N||(ze>=I&&ze<=N&&(ze=I),$e>=I&&$e<=N?$e=I-1:$e>N&&($e-=O),ze>$e))continue;const le=fe,Ke=ze,ft=e.cellKey(le,Ke),U=ge.split(",").map(Number)[1],J=U>=I&&U<=N||le!==Me.startCol||Ke!==U;de.push({newAnchorKey:ft,newRange:{startCol:fe,startRow:ze,endCol:Z,endRow:$e},anchorCell:J?Ee:void 0})}return de}function Je(I,N){const O=N-I+1,de=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;const Ee=e.cells[ge]?{value:e.cells[ge].value,styleId:e.cells[ge].styleId??0}:{value:"",styleId:0};let{startCol:fe,endCol:Z}=Me;const{startRow:ze,endRow:$e}=Me;if(fe>N){fe-=O,Z-=O,de.push({newAnchorKey:e.cellKey(fe,ze),newRange:{startCol:fe,startRow:ze,endCol:Z,endRow:$e}});continue}if(Z<I){de.push({newAnchorKey:ge,newRange:{startCol:fe,startRow:ze,endCol:Z,endRow:$e}});continue}if(fe>=I&&Z<=N||(fe>=I&&fe<=N&&(fe=I),Z>=I&&Z<=N?Z=I-1:Z>N&&(Z-=O),fe>Z))continue;const le=fe,Ke=ze,ft=e.cellKey(le,Ke),U=ge.split(",").map(Number)[0],J=U>=I&&U<=N||le!==U||Ke!==Me.startRow;de.push({newAnchorKey:ft,newRange:{startCol:fe,startRow:ze,endCol:Z,endRow:$e},anchorCell:J?Ee:void 0})}return de}function gt(I,N){const O=N-I+1,de=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;const{startCol:Ee,endCol:fe}=Me;let{startRow:Z,endRow:ze}=Me;ze<I?de.push({newAnchorKey:ge,newRange:{startCol:Ee,startRow:Z,endCol:fe,endRow:ze}}):Z>N?(Z+=O,ze+=O,de.push({newAnchorKey:e.cellKey(Ee,Z),newRange:{startCol:Ee,startRow:Z,endCol:fe,endRow:ze}})):(ze+=O,de.push({newAnchorKey:ge,newRange:{startCol:Ee,startRow:Z,endCol:fe,endRow:ze}}))}return de}function Ze(I,N){const O=N-I+1,de=[];for(const ge in e.merges){const Me=e.merges[ge];if(!Me)continue;let{startCol:Ee,endCol:fe}=Me;const{startRow:Z,endRow:ze}=Me;fe<I?de.push({newAnchorKey:ge,newRange:{startCol:Ee,startRow:Z,endCol:fe,endRow:ze}}):Ee>N?(Ee+=O,fe+=O,de.push({newAnchorKey:e.cellKey(Ee,Z),newRange:{startCol:Ee,startRow:Z,endCol:fe,endRow:ze}})):(fe+=O,de.push({newAnchorKey:ge,newRange:{startCol:Ee,startRow:Z,endCol:fe,endRow:ze}}))}return de}let lt=0;function et(){return lt++,`s_${lt}`}function oe(I,N){const O=Math.max(1,(N==null?void 0:N.colCount)??e.colCount),de=Math.max(1,(N==null?void 0:N.rowCount)??e.rowCount),ge=new Array(O).fill(100),Me=new Array(de).fill(void 0);return{id:et(),name:I,cells:{},merges:{},styles:[{}],borders:[{}],selection:{startCol:0,startRow:0,endCol:0,endRow:0},activeCell:{col:0,row:0},scrollX:0,scrollY:0,colWidths:ge,rowHeights:Me,colCount:O,rowCount:de,freeze:{rows:0,cols:0},filter:null}}const pe=t.ref([oe("Sheet1")]),g=t.ref(0);function A(){const I=pe.value[g.value];I&&(I.cells={...e.cells},I.merges={...e.merges},I.selection=e.selection.value?{...e.selection.value}:null,I.activeCell={...e.activeCell.value},I.scrollX=e.scrollX.value,I.scrollY=e.scrollY.value,I.colWidths=[...e.colWidths.value],I.rowHeights=[...e.rowHeights.value],I.styles=[...e.styles],I.borders=[...e.borders],I.colCount=e.colCount,I.rowCount=e.rowCount,I.freeze={rows:e.freeze.rows,cols:e.freeze.cols},I.filter=vo(e.getFilter()))}function L(I){var fe;const N=pe.value[I];if(!N)return;Object.keys(e.cells).forEach(Z=>e.delCell(Z)),Object.assign(e.cells,N.cells),Object.keys(e.merges).forEach(Z=>Reflect.deleteProperty(e.merges,Z)),N.merges&&Object.assign(e.merges,N.merges),e.selection.value=N.selection?{...N.selection}:null,e.activeCell.value={...N.activeCell};const O=e.activeCell.value,de=e.selection.value,ge=e.findMerge(O.col,O.row);ge&&ge.anchor===e.cellKey(O.col,O.row)&&(!de||de.startCol===O.col&&de.startRow===O.row&&de.endCol===O.col&&de.endRow===O.row)&&e.selectCell(O.col,O.row),e.scrollX.value=N.scrollX,e.scrollY.value=N.scrollY,e.colWidths.value=[...N.colWidths],e.rowHeights.value=[...N.rowHeights];const Me=Math.max(1,N.colCount??e.colCount),Ee=Math.max(1,N.rowCount??e.rowCount);if((fe=e.setDims)==null||fe.call(e,Me,Ee),e.freeze.rows=Math.max(0,Math.min(N.freeze.rows,e.rowCount)),e.freeze.cols=Math.max(0,Math.min(N.freeze.cols,e.colCount)),N.filter){const Z=N.filter.range;e.setFilter({range:{startCol:Math.max(0,Math.min(Z.startCol,e.colCount-1)),endCol:Math.max(0,Math.min(Z.endCol,e.colCount-1)),startRow:Math.max(0,Math.min(Z.startRow,e.rowCount-1)),endRow:Math.max(0,Math.min(Z.endRow,e.rowCount-1))},columns:{...N.filter.columns}},!0)}else e.setFilter(null,!0);e.syncStyles(N.styles),e.syncBorders(N.borders??[{}]),g.value=I}function $(I){I===g.value||I<0||I>=pe.value.length||(e.cancelEdit(),A(),L(I))}function ee(I){return l.saveUndo(),e.cancelEdit(),A(),pe.value.push(oe(I??`Sheet${pe.value.length+1}`)),L(pe.value.length-1),pe.value.length-1}function ie(I){return pe.value.length<=1||(l.saveUndo(),e.cancelEdit(),pe.value.splice(I,1),L(Math.min(I,pe.value.length-1))),g.value}function re(I,N){pe.value[I]&&N.trim()&&(l.saveUndo(),pe.value[I].name=N.trim())}function he(I){l.saveUndo(),e.cancelEdit(),A();const N=pe.value[I];if(!N)return I;let O=N.name;const de=O.match(/^(.*?)\s*\((\d+)\)$/);let ge=de?parseInt(de[2],10)+1:2;de&&(O=de[1]);let Me=`${O} (${ge})`;const Ee=new Set(pe.value.map(Z=>Z.name));for(;Ee.has(Me);)ge++,Me=`${O} (${ge})`;const fe={id:et(),name:Me,cells:{...N.cells},merges:N.merges?{...N.merges}:{},styles:[...N.styles],borders:N.borders?[...N.borders]:[{}],selection:N.selection?{...N.selection}:null,activeCell:N.activeCell?{...N.activeCell}:{col:0,row:0},scrollX:N.scrollX,scrollY:N.scrollY,colWidths:[...N.colWidths],rowHeights:[...N.rowHeights],colCount:N.colCount,rowCount:N.rowCount,freeze:{...N.freeze},filter:vo(N.filter)};return pe.value.splice(I+1,0,fe),L(I+1),I+1}function ce(I,N){var Me;const O=I+N;if(O<0||O>=pe.value.length)return;l.saveUndo();const de=g.value,ge=pe.value.splice(I,1)[0];pe.value.splice(O,0,ge),de===I?g.value=O:I<de&&O>=de?g.value=de-1:I>de&&O<=de&&(g.value=de+1),(Me=e.scheduleRender)==null||Me.call(e)}const V=t.computed(()=>pe.value.length);let c="";const u=o;function p(){A();const I=pe.value.map(O=>{const de={};for(const[fe,Z]of Object.entries(O.cells))de[fe]={value:Z.value},Z.styleId&&Z.styleId>0&&(de[fe].styleId=Z.styleId);const ge={name:O.name,cells:de};O.styles&&O.styles.length>1&&(ge.styles=[...O.styles]),O.borders&&O.borders.length>1&&(ge.borders=[...O.borders]),O.merges&&Object.keys(O.merges).length&&(ge.merges={...O.merges});const Me={};for(let fe=0;fe<O.colWidths.length;fe++)O.colWidths[fe]!==100&&(Me[fe]=O.colWidths[fe]);Object.keys(Me).length&&(ge.colWidths=Me);const Ee={};for(let fe=0;fe<O.rowHeights.length;fe++){const Z=O.rowHeights[fe];Z!=null&&(Ee[fe]=Z)}return Object.keys(Ee).length&&(ge.rowHeights=Ee),O.colCount!==26&&(ge.colCount=O.colCount),O.rowCount!==200&&(ge.rowCount=O.rowCount),(O.freeze.rows!==0||O.freeze.cols!==0)&&(ge.freeze={rows:O.freeze.rows,cols:O.freeze.cols}),O.filter&&(ge.filter=vo(O.filter)),ge}),N=JSON.stringify(I);N!==c&&(c=N,u.value=I,a&&(a.value=N))}e.emitModelData=p;let H=!1;function ct(){H||(H=!0,Promise.resolve().then(()=>{H=!1,p()}))}const ae=t.computed(()=>e.props.theme==="dark"?Tr:Br),Pe=t.computed(()=>au(ae.value,e.props.width,e.props.height,wn)),at=t.computed(()=>{const I={};for(const[N,O]of Object.entries(Pe.value))N.startsWith("--")&&(I[N]=O);return I}),Mt=t.ref(null),St=t.ref(null),Rt=t.ref(null),Ft=t.ref(null),Yt=t.ref(null),nl=t.reactive({w:800,h:600});e.viewSize&&t.watch(nl,I=>{e.viewSize&&(e.viewSize.w=I.w,e.viewSize.h=I.h)},{deep:!0});const Cl=48,Dl=28,cl=11,wl=t.computed(()=>Math.max(0,e.totalWidth.value-Math.max(0,nl.w-Cl-cl))),ol=t.computed(()=>Math.max(0,e.totalHeight.value-Math.max(0,nl.h-Dl-cl)));function fl(I,N){const O=Math.max(0,nl.w-Cl-cl),de=Math.max(0,nl.h-Dl-cl),ge=I??e.scrollX.value,Me=N??e.scrollY.value,Ee=40,fe=Math.max(0,e.totalWidth.value-O),Z=Math.max(0,e.totalHeight.value-de);if(ge>=fe-Ee&&ge>e.scrollX.value||Me>=Z-Ee&&Me>e.scrollY.value){const ze=Math.max(0,Math.ceil((ge+O)/100)+2),$e=Math.max(0,Math.ceil((Me+de)/24)+2);e.ensureCapacity(ze,$e)}e.scrollX.value=Math.max(0,Math.min(ge,Math.max(0,e.totalWidth.value-O))),e.scrollY.value=Math.max(0,Math.min(Me,Math.max(0,e.totalHeight.value-de)))}e.clampScroll=fl;function Xt(){var I;return typeof window>"u"?!1:!((I=window.matchMedia)!=null&&I.call(window,"(hover: none) and (pointer: coarse)").matches)}function Kl(I=!1){t.nextTick(()=>{const N=Ft.value;if(N){if(!e.editingCell.value&&!Xt()){document.activeElement===N&&N.blur();return}N.focus({preventScroll:!0}),I&&N.select()}})}function Gl(){Kl()}function Yl(){var N;const I=e.selection.value;if(I){l.saveUndo();for(let O=I.startRow;O<=I.endRow;O++)e.rowHeights.value[O]=void 0;(N=e.scheduleRender)==null||N.call(e),p()}}function sn(){var N;const I=e.selection.value;if(I){l.saveUndo();for(let O=I.startCol;O<=I.endCol;O++)e.colWidths.value[O]=100;(N=e.scheduleRender)==null||N.call(e),p()}}return{deleteRows:i,insertRows:r,insertCols:f,deleteCols:m,sortSelectedColumns:te,canSortColumns:G,sortMenuOpen:se,cachedSortOrder:Fe,onSortMenuToggle:Qe,onSortChange:Ge,applyCachedSort:be,sortConfirmOpen:Y,prepareSortConfirmation:C,confirmSort:j,cancelSortConfirmation:q,sheets:pe,activeSheetIndex:g,saveSheet:A,loadSheet:L,switchSheet:$,addSheet:ee,removeSheet:ie,renameSheet:re,dupSheet:he,moveSheet:ce,sheetCount:V,mkSheet:oe,emitModelData:p,scheduleOptEmit:ct,themeColors:ae,outerStyle:Pe,toolbarThemeVars:at,wrapperRef:Mt,canvasRef:St,freezeCanvasRef:Rt,editInputRef:Ft,formulaBarRef:Yt,viewSize:nl,maxScrollX:wl,maxScrollY:ol,clampScroll:fl,canFocusHiddenEditor:Xt,focusEditInput:Kl,onCanvasFocus:Gl,resetRowHeight:Yl,resetColWidth:sn,modelData:u}}function dr(e){return!!e&&e.width!==void 0&&e.width>0}function Nt(e,l,o,n){const a=dr(e),i=dr(l);if(!a&&!i)return;if(a&&!i)return e;if(!a&&i)return l;const r=e.width??0,f=l.width??0;return r>f?e:f>r?l:e}function fr(e,l){if(!e||typeof e!="object")return null;const o=e,n=o.columns??{},a=Object.keys(n).map(r=>Number(r)).filter(r=>!Number.isNaN(r));if(!o.range||typeof o.range.startRow!="number"){let r=a.length?Math.min(...a):0,f=a.length?Math.max(...a):0,m=0;for(const y in l){const k=y.indexOf(",");if(k<0)continue;const d=parseInt(y.substring(k+1),10);d>m&&(m=d)}return{range:{startCol:r,startRow:0,endCol:f,endRow:Math.max(0,m)},columns:n}}const i={...o.range};for(const r of a)r<i.startCol&&(i.startCol=r),r>i.endCol&&(i.endCol=r);return{range:i,columns:n}}function du(e,l,o,n,a){let i=!1,r=null,f=1,m=()=>{},y=()=>{},k=()=>{};function d(){i||(i=!0,requestAnimationFrame(()=>{i=!1,G(),te()}))}e.scheduleRender=d;function w(s){const{frozenColumnsWidth:b}=e.getFrozenMetrics(),M=b>0&&s<52+b?s-52:s-52+e.scrollX.value;return e.hitCol(M)}function v(s){const{frozenRowsHeight:b}=e.getFrozenMetrics(),M=b>0&&s<24+b?s-24:s-24+e.scrollY.value;return e.hitRow(M)}const R="#444";function G(){const s=n.wrapperRef.value,b=n.canvasRef.value;if(!s||!b||(r=b.getContext("2d"),!r))return;f=window.devicePixelRatio||1;const M=s.getBoundingClientRect(),_=M.width,x=M.height;n.viewSize.w=_,n.viewSize.h=x,b.width=_*f,b.height=x*f,b.style.width=_+"px",b.style.height=x+"px",r.setTransform(f,0,0,f,0,0);const P=e.scrollX.value,z=e.scrollY.value,F=52,Q=24,ke=n.themeColors.value,Ne=e.getFilter(),tt=e.colPositions.value,ut=e.rowPositions.value,yt=e.colWidths.value,{frozenRowsHeight:Tt,frozenColumnsWidth:qt}=e.getFrozenMetrics(),al=F+qt,Sl=Q+Tt,ql=Math.max(0,_-F-11-qt),pn=Math.max(0,x-Q-11-Tt),hn=Math.max(0,e.freeze.cols-1),gn=Math.max(0,e.freeze.rows-1),Jl=Math.max(e.freeze.cols,e.hitCol(qt+P));let yn=Jl;for(let T=Jl;T<e.colCount&&!(F+tt[T]-P>=_);T++)yn=T;const gl=Math.max(e.freeze.rows,e.hitRow(Tt+z));let Al=gl;for(let T=gl;T<e.rowCount&&!(Q+ut[T]-z>=x);T++)Al=T;let Jt=Jl,Qt=yn,il=gl,Vl=Al;qt>0&&(Jt=0,Qt=Math.max(Qt,hn)),Tt>0&&(il=0,Vl=Math.max(Vl,gn));let Hl=Jt,Ql=il;for(const T in e.merges){const Be=e.merges[T];Be&&(Be.startRow>Vl||Be.endRow<il||Be.startCol>Qt||Be.endCol<Jt||(Be.startCol<Hl&&(Hl=Be.startCol),Be.startRow<Ql&&(Ql=Be.startRow)))}const Ol=new Array(Ql);for(let T=Ql;T<=Vl;T++)Ol[T]=ut[T+1]-ut[T];r.fillStyle=ke.bg,r.fillRect(0,0,_,x),r.fillStyle=ke.gridBg,r.fillRect(F,Q,_-F,x-Q);const vt=e.selection.value,Mn=e.editingCell.value;m=(T,Be,He,wt,Lt,Dt)=>{for(let qe=wt;qe<=Lt;qe++)for(let Re=Be;Re<=He;Re++){if(e.findMerge(Re,qe))continue;const nt=e.cellToScreenRect(qe,Re),_e=nt.x,Oe=nt.y,rt=nt.width,it=nt.height;if(_e+rt<F||Oe+it<Q||_e>_||Oe>x)continue;const kt=e.findHighlight?e.findHighlight(Re,qe):null,Et=e.resolveStyle(e.cells[e.cellKey(Re,qe)]),At=typeof(Et==null?void 0:Et.backgroundColor)=="string"?Et.backgroundColor:"";if(At&&(T.fillStyle=At,T.fillRect(_e,Oe,rt,it)),kt&&(T.fillStyle=kt==="active"?ke.findActiveBg:ke.findMatchBg,T.fillRect(_e,Oe,rt,it)),e.isSelected(Re,qe)&&(T.fillStyle=ke.selectionBg,e.selectionMode.value==="row"||e.selectionMode.value==="col"?T.fillRect(_e,Oe,yt[Re],Dt[qe]):T.fillRect(_e,Oe,rt,it)),e.activeCell.value.col===Re&&e.activeCell.value.row===qe&&(T.strokeStyle=ke.activeCellBorder,T.lineWidth=2,T.strokeRect(_e+1,Oe+1,rt-2,it-2)),kt==="active"&&(T.strokeStyle=ke.findActiveBg,T.lineWidth=2,T.strokeRect(_e+1,Oe+1,rt-2,it-2)),T.strokeStyle=ke.gridLine,T.lineWidth=.5,T.strokeRect(_e+.25,Oe+.25,rt-.5,it-.5),!(Mn&&Mn.col===Re&&Mn.row===qe)){const we=e.resolveStyle(e.cells[e.cellKey(Re,qe)]),ne=e.getCellValue(Re,qe),Te=typeof(we==null?void 0:we.numberFormat)=="string"?we.numberFormat:"",Ae=ne?bl(ne,Te,e.locale.value):"";if(Ae){const ot=e.cellFontSize(Re,qe),xt=typeof(we==null?void 0:we.fontFamily)=="string"&&we.fontFamily?we.fontFamily:Cn,Gt=(we==null?void 0:we.fontWeight)==="bold"?"bold":"normal",$t=(we==null?void 0:we.fontStyle)==="italic"?"italic":"normal",Ll=(we==null?void 0:we.underline)==="underline",en=(we==null?void 0:we.strikethrough)==="line-through",zl=typeof(we==null?void 0:we.color)=="string"?we.color:"",tn=typeof(we==null?void 0:we.textAlign)=="string"?we.textAlign:io(ne,Te)?"right":"left",Hn=typeof(we==null?void 0:we.verticalAlign)=="string"?we.verticalAlign:"top";T.fillStyle=zl||ke.cellText,T.font=`${$t} ${Gt} ${ot}px ${xt}`,T.textBaseline="alphabetic",T.save(),T.beginPath(),T.rect(_e+5,Oe+1,rt-10,it-2),T.clip();const ln=(we==null?void 0:we.wrap)==="wrap";let el=rt-10;Ne&&qe===Ne.range.startRow&&Re>=Ne.range.startCol&&Re<=Ne.range.endCol&&(el=rt-10-ie);let Ml=Ae;const xl=!ln&&No(Te),nn=Ae===Gn||Fo(ne,Te);if(nn||xl){if(nn){const Bn=Math.max(1,T.measureText("#").width),Kn=Math.max(1,Math.floor(el/Bn));Ml="#".repeat(Kn)}else if(e.getWrappedLines(T,Ae,1e9,!1).some(on=>on&&T.measureText(on).width>el)){const on=Math.max(1,T.measureText("#").width),On=Math.max(1,Math.floor(el/on));Ml="#".repeat(On)}}const sl=e.getWrappedLines(T,Ml,el,ln),{ascent:xn,descent:to}=e.measureFontMetrics(xt,ot,Gt,$t),lo=xn+to,Lu=sl.length*lo;let no;Hn==="middle"?no=Oe+(it-Lu)/2+xn:Hn==="bottom"?no=Oe+it-e.BASE_CELL_VPAD-to-(sl.length-1)*lo:no=Oe+e.BASE_CELL_VPAD+xn;for(let Bn=0;Bn<sl.length;Bn++){const Kn=sl[Bn],on=no+Bn*lo,On=T.measureText(Kn);let bn;if(tn==="center"?bn=_e+rt/2-On.width/2:tn==="right"?bn=_e+rt-5-On.width:bn=_e+5,T.fillText(Kn,bn,on),Ll&&(T.strokeStyle=zl||ke.cellText,T.lineWidth=1,T.beginPath(),T.moveTo(bn,on+to+1),T.lineTo(bn+On.width,on+to+1),T.stroke()),en){T.strokeStyle=zl||ke.cellText,T.lineWidth=1;const gr=on-xn+lo*.42;T.beginPath(),T.moveTo(bn,gr),T.lineTo(bn+On.width,gr),T.stroke()}}T.restore()}}Ne&&qe===Ne.range.startRow&&Re>=Ne.range.startCol&&Re<=Ne.range.endCol&&c(T,_e,Oe,rt,it,Zo(Ne.columns[Re]),ke)}};const Ye=(T,Be,He)=>{const wt=e.findMerge(T,Be);return wt?e.getCellBorderSide(e.cells[wt.anchor],He):e.getCellBorderSide(e.cells[e.cellKey(T,Be)],He)};y=(T,Be,He,wt,Lt,Dt)=>{T.fillStyle=R;for(let qe=wt;qe<=Lt;qe++)for(let Re=Be;Re<=He;Re++){if(e.findMerge(Re,qe))continue;const nt=e.cellToScreenRect(qe,Re),_e=nt.x,Oe=nt.y,rt=nt.width,it=nt.height;if(_e+rt<F||Oe+it<Q||_e>_||Oe>x)continue;const kt=e.cells[e.cellKey(Re,qe)],Et={top:e.getCellBorderSide(kt,"top"),right:e.getCellBorderSide(kt,"right"),bottom:e.getCellBorderSide(kt,"bottom"),left:e.getCellBorderSide(kt,"left")},At={top:Ye(Re,qe-1,"bottom"),left:Ye(Re-1,qe,"right"),bottom:Ye(Re,qe+1,"top"),right:Ye(Re+1,qe,"left")},we=Nt(At.top,Et.top),ne=Nt(At.left,Et.left),Te=Nt(Et.bottom,At.bottom),Ae=Nt(Et.right,At.right),ot=(we==null?void 0:we.width)??0,xt=(ne==null?void 0:ne.width)??0,Gt=(Te==null?void 0:Te.width)??0,$t=(Ae==null?void 0:Ae.width)??0;ot>0&&(T.fillStyle=(we==null?void 0:we.color)||R,T.fillRect(_e,Oe,rt,ot)),Gt>0&&(T.fillStyle=(Te==null?void 0:Te.color)||R,T.fillRect(_e,Oe+it-Gt,rt,Gt)),xt>0&&(T.fillStyle=(ne==null?void 0:ne.color)||R,T.fillRect(_e,Oe,xt,it)),$t>0&&(T.fillStyle=(Ae==null?void 0:Ae.color)||R,T.fillRect(_e+rt-$t,Oe,$t,it)),ot>0&&xt>0&&(T.fillStyle=(we==null?void 0:we.color)||(ne==null?void 0:ne.color)||R,T.fillRect(_e-xt,Oe-ot,xt,ot)),ot>0&&$t>0&&(T.fillStyle=(we==null?void 0:we.color)||(Ae==null?void 0:Ae.color)||R,T.fillRect(_e+rt,Oe-ot,$t,ot)),Gt>0&&xt>0&&(T.fillStyle=(Te==null?void 0:Te.color)||(ne==null?void 0:ne.color)||R,T.fillRect(_e-xt,Oe+it,xt,Gt)),Gt>0&&$t>0&&(T.fillStyle=(Te==null?void 0:Te.color)||(Ae==null?void 0:Ae.color)||R,T.fillRect(_e+rt,Oe+it,$t,Gt))}};const It=(T,Be,He,wt,Lt,Dt,qe)=>{const Re=e.resolveStyle(e.cells[e.cellKey(Be,He)]),dt=e.getCellValue(Be,He),nt=typeof(Re==null?void 0:Re.numberFormat)=="string"?Re.numberFormat:"",_e=dt?bl(dt,nt,e.locale.value):"";if(!_e)return;const Oe=e.cellFontSize(Be,He),rt=typeof(Re==null?void 0:Re.fontFamily)=="string"&&Re.fontFamily?Re.fontFamily:Cn,it=(Re==null?void 0:Re.fontWeight)==="bold"?"bold":"normal",kt=(Re==null?void 0:Re.fontStyle)==="italic"?"italic":"normal",Et=(Re==null?void 0:Re.underline)==="underline",At=(Re==null?void 0:Re.strikethrough)==="line-through",we=typeof(Re==null?void 0:Re.color)=="string"?Re.color:"",ne=typeof(Re==null?void 0:Re.textAlign)=="string"?Re.textAlign:io(dt,nt)?"right":"left",Te=typeof(Re==null?void 0:Re.verticalAlign)=="string"?Re.verticalAlign:"top";T.fillStyle=we||ke.cellText,T.font=`${kt} ${it} ${Oe}px ${rt}`,T.textBaseline="alphabetic",T.save(),T.beginPath(),T.rect(Dt+5,qe+1,wt-10,Lt-2),T.clip();const Ae=(Re==null?void 0:Re.wrap)==="wrap",ot=wt-10;let xt=_e;const Gt=!Ae&&No(nt),$t=_e===Gn||Fo(dt,nt);if($t||Gt){if($t){const el=Math.max(1,T.measureText("#").width),Ml=Math.max(1,Math.floor(ot/el));xt="#".repeat(Ml)}else if(e.getWrappedLines(T,_e,1e9,!1).some(xl=>xl&&T.measureText(xl).width>ot)){const xl=Math.max(1,T.measureText("#").width),nn=Math.max(1,Math.floor(ot/xl));xt="#".repeat(nn)}}const Ll=e.getWrappedLines(T,xt,ot,Ae),{ascent:en,descent:zl}=e.measureFontMetrics(rt,Oe,it,kt),tn=en+zl,Hn=Ll.length*tn;let ln;Te==="middle"?ln=qe+(Lt-Hn)/2+en:Te==="bottom"?ln=qe+Lt-e.BASE_CELL_VPAD-zl-(Ll.length-1)*tn:ln=qe+e.BASE_CELL_VPAD+en;for(let el=0;el<Ll.length;el++){const Ml=Ll[el],xl=ln+el*tn,nn=T.measureText(Ml);let sl;if(ne==="center"?sl=Dt+wt/2-nn.width/2:ne==="right"?sl=Dt+wt-5-nn.width:sl=Dt+5,T.fillText(Ml,sl,xl),Et&&(T.strokeStyle=we||ke.cellText,T.lineWidth=1,T.beginPath(),T.moveTo(sl,xl+zl+1),T.lineTo(sl+nn.width,xl+zl+1),T.stroke()),At){T.strokeStyle=we||ke.cellText,T.lineWidth=1;const xn=xl-en+tn*.42;T.beginPath(),T.moveTo(sl,xn),T.lineTo(sl+nn.width,xn),T.stroke()}}T.restore()},Rl=(T,Be,He,wt,Lt,Dt,qe,Re)=>{const dt=Be.startCol,nt=Be.endCol,_e=Be.startRow,Oe=Be.endRow,rt=wt,it=Dt,kt=qe&&nt>=e.freeze.cols,Et=Re&&Oe>=e.freeze.rows,At=e.cells[e.cellKey(dt,_e)],we={top:e.getCellBorderSide(At,"top"),right:e.getCellBorderSide(At,"right"),bottom:e.getCellBorderSide(At,"bottom"),left:e.getCellBorderSide(At,"left")};T.fillStyle=R;for(let ne=dt;ne<=nt;ne++){if(qe&&ne>=e.freeze.cols||e.isSameMergeInternal(ne,_e-1,ne,_e))continue;const Te=Ye(ne,_e-1,"bottom"),Ae=Nt(Te,we.top);if(Ae&&Ae.width&&Ae.width>0){const ot=ne<e.freeze.cols?F+tt[ne]:F+tt[ne]-P;T.fillStyle=Ae.color||R,T.fillRect(ot,rt,yt[ne],Ae.width)}}if(!Et)for(let ne=dt;ne<=nt;ne++){if(qe&&ne>=e.freeze.cols||e.isSameMergeInternal(ne,Oe,ne,Oe+1))continue;const Te=Ye(ne,Oe+1,"top"),Ae=Nt(we.bottom,Te);if(Ae&&Ae.width&&Ae.width>0){const ot=ne<e.freeze.cols?F+tt[ne]:F+tt[ne]-P;T.fillStyle=Ae.color||R,T.fillRect(ot,rt+it-Ae.width,yt[ne],Ae.width)}}for(let ne=_e;ne<=Oe;ne++){if(Re&&ne>=e.freeze.rows||e.isSameMergeInternal(dt-1,ne,dt,ne))continue;const Te=Ye(dt-1,ne,"right"),Ae=Nt(Te,we.left);if(Ae&&Ae.width&&Ae.width>0){const ot=ne<e.freeze.rows?Q+ut[ne]:Q+ut[ne]-z,xt=ut[ne+1]-ut[ne];T.fillStyle=Ae.color||R,T.fillRect(He,ot,Ae.width,xt)}}if(!kt)for(let ne=_e;ne<=Oe;ne++){if(Re&&ne>=e.freeze.rows||e.isSameMergeInternal(nt,ne,nt+1,ne))continue;const Te=Ye(nt+1,ne,"left"),Ae=Nt(we.right,Te);if(Ae&&Ae.width&&Ae.width>0){const ot=ne<e.freeze.rows?Q+ut[ne]:Q+ut[ne]-z,xt=ut[ne+1]-ut[ne];T.fillStyle=Ae.color||R,T.fillRect(He+Lt-Ae.width,ot,Ae.width,xt)}}{const ne=e.isSameMergeInternal(dt,_e-1,dt,_e)?we.top:Nt(Ye(dt,_e-1,"bottom"),we.top),Te=e.isSameMergeInternal(dt-1,_e,dt,_e)?we.left:Nt(Ye(dt-1,_e,"right"),we.left),Ae=(ne==null?void 0:ne.width)??0,ot=(Te==null?void 0:Te.width)??0;Ae>0&&ot>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(He-ot,wt-Ae,ot,Ae))}if(!kt){const ne=e.isSameMergeInternal(nt,_e-1,nt,_e)?we.top:Nt(Ye(nt,_e-1,"bottom"),we.top),Te=e.isSameMergeInternal(nt,_e,nt+1,_e)?we.right:Nt(we.right,Ye(nt+1,_e,"left")),Ae=(ne==null?void 0:ne.width)??0,ot=(Te==null?void 0:Te.width)??0;Ae>0&&ot>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(He+Lt,wt-Ae,ot,Ae))}if(!Et){const ne=e.isSameMergeInternal(dt,Oe,dt,Oe+1)?we.bottom:Nt(we.bottom,Ye(dt,Oe+1,"top")),Te=e.isSameMergeInternal(dt-1,Oe,dt,Oe)?we.left:Nt(Ye(dt-1,Oe,"right"),we.left),Ae=(ne==null?void 0:ne.width)??0,ot=(Te==null?void 0:Te.width)??0;Ae>0&&ot>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(He-ot,wt+Dt,ot,Ae))}if(!kt&&!Et){const ne=e.isSameMergeInternal(nt,Oe,nt,Oe+1)?we.bottom:Nt(we.bottom,Ye(nt,Oe+1,"top")),Te=e.isSameMergeInternal(nt,Oe,nt+1,Oe)?we.right:Nt(we.right,Ye(nt+1,Oe,"left")),Ae=(ne==null?void 0:ne.width)??0,ot=(Te==null?void 0:Te.width)??0;Ae>0&&ot>0&&(T.fillStyle=(ne==null?void 0:ne.color)||(Te==null?void 0:Te.color)||R,T.fillRect(He+Lt,wt+Dt,ot,Ae))}};k=(T,Be,He,wt,Lt)=>{var nt;const Dt=Be+wt,qe=He+Lt,Re=Be<al,dt=He<Sl;for(const _e in e.merges){const Oe=e.merges[_e];if(!Oe)continue;const rt=Oe.startCol,it=Oe.startRow,kt=Oe.endCol,Et=Oe.endRow,At=e.cellToScreenRect(it,rt),we=e.cellToScreenRect(Et,kt),ne=At.x,Te=At.y,Ae=we.x+we.width-ne,ot=we.y+we.height-Te,xt=Re&&kt>=e.freeze.cols?Math.min(Dt,al):Math.min(ne+Ae,Dt),Gt=dt&&Et>=e.freeze.rows?Math.min(qe,Sl):Math.min(Te+ot,qe),$t=Math.max(ne,Be),Ll=Math.max(Te,He);if(xt<=$t||Gt<=Ll)continue;const en=(nt=e.resolveStyle(e.cells[e.cellKey(rt,it)]))==null?void 0:nt.backgroundColor;if(en&&(T.fillStyle=en,T.fillRect($t,Ll,xt-$t,Gt-Ll)),T.strokeStyle=ke.gridLine,T.lineWidth=.5,T.strokeRect(ne+.25,Te+.25,xt-ne-.5,Gt-Te-.5),Rl(T,Oe,ne,Te,Ae,ot,Re,dt),!(e.editingCell.value&&e.editingCell.value.col===rt&&e.editingCell.value.row===it)){const zl=tt[kt+1]-tt[rt],tn=ut[Et+1]-ut[it],Hn=rt<e.freeze.cols,ln=it<e.freeze.rows,el=Re?ne:Hn?ne-P:ne,Ml=dt?Te:ln?Te-z:Te;It(T,rt,it,zl,tn,el,Ml)}}},r.save(),r.beginPath(),r.rect(al,Sl,ql,pn),r.clip(),m(r,Hl,Qt,Ql,Vl,Ol),y(r,Hl,Qt,Ql,Vl,Ol),k(r,al,Sl,ql,pn),r.restore(),qt>0&&(r.strokeStyle=ke.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(al+.5,Q),r.lineTo(al+.5,x),r.stroke()),Tt>0&&(r.strokeStyle=ke.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(F,Sl+.5),r.lineTo(_,Sl+.5),r.stroke()),r.fillStyle=ke.headerBg,r.fillRect(F,0,_-F,Q);for(let T=Jl;T<=yn;T++){const Be=F+tt[T]-P,He=yt[T];Be+He<F||Be>_||(vt&&T>=vt.startCol&&T<=vt.endCol&&(r.fillStyle=ke.selectionBg,r.fillRect(Be,0,He,Q)),r.strokeStyle=ke.headerBorder,r.lineWidth=.5,r.strokeRect(Be+.25,.25,He-.5,Q-.5),vt&&T>=vt.startCol&&T<=vt.endCol&&(r.strokeStyle=ke.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(Be,Q-1),r.lineTo(Be+He,Q-1),r.stroke()),r.fillStyle=ke.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(ht(T),Be+He/2,Q/2))}if(qt>0){r.fillStyle=ke.headerBg,r.fillRect(F,0,qt,Q);for(let T=0;T<=hn;T++){const Be=F+tt[T],He=yt[T];Be+He<F||Be>_||(vt&&T>=vt.startCol&&T<=vt.endCol&&(r.fillStyle=ke.selectionBg,r.fillRect(Be,0,He,Q)),r.strokeStyle=ke.headerBorder,r.lineWidth=.5,r.strokeRect(Be+.25,.25,He-.5,Q-.5),vt&&T>=vt.startCol&&T<=vt.endCol&&(r.strokeStyle=ke.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(Be,Q-1),r.lineTo(Be+He,Q-1),r.stroke()),r.fillStyle=ke.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(ht(T),Be+He/2,Q/2))}}r.strokeStyle=ke.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(F,Q+.5),r.lineTo(_,Q+.5),r.stroke(),r.fillStyle=ke.headerBg,r.fillRect(0,Q,F,x-Q);for(let T=gl;T<=Al;T++){if(e.isRowHidden(T))continue;const Be=Q+ut[T]-z,He=Ol[T];Be+He<Q||Be>x||(vt&&T>=vt.startRow&&T<=vt.endRow&&(r.fillStyle=ke.selectionBg,r.fillRect(0,Be,F,He)),r.strokeStyle=ke.headerBorder,r.lineWidth=.5,r.strokeRect(.25,Be+.25,F-.5,He-.5),vt&&T>=vt.startRow&&T<=vt.endRow&&(r.strokeStyle=ke.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(F-1,Be),r.lineTo(F-1,Be+He),r.stroke()),r.fillStyle=ke.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(String(T+1),F/2,Be+He/2+.5))}if(Tt>0){r.fillStyle=ke.headerBg,r.fillRect(0,Q,F,Tt);for(let T=0;T<=gn;T++){if(e.isRowHidden(T))continue;const Be=Q+ut[T],He=Ol[T];Be+He<Q||Be>x||(vt&&T>=vt.startRow&&T<=vt.endRow&&(r.fillStyle=ke.selectionBg,r.fillRect(0,Be,F,He)),r.strokeStyle=ke.headerBorder,r.lineWidth=.5,r.strokeRect(.25,Be+.25,F-.5,He-.5),vt&&T>=vt.startRow&&T<=vt.endRow&&(r.strokeStyle=ke.activeCellBorder,r.lineWidth=2,r.beginPath(),r.moveTo(F-1,Be),r.lineTo(F-1,Be+He),r.stroke()),r.fillStyle=ke.headerText,r.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',r.textAlign="center",r.textBaseline="middle",r.fillText(String(T+1),F/2,Be+He/2+.5))}}r.strokeStyle=ke.headerSep,r.lineWidth=1,r.beginPath(),r.moveTo(F+.5,Q),r.lineTo(F+.5,x),r.stroke(),r.fillStyle=ke.headerBg,r.fillRect(0,0,F,Q),r.strokeStyle=ke.headerSep,r.lineWidth=1,r.strokeRect(.5,.5,F-1,Q-1);const yl=Math.min(F,Q)*.32;r.fillStyle=ke.activeCellBorder,r.beginPath(),r.moveTo(F-1,Q-1-yl),r.lineTo(F-1-yl,Q-1),r.lineTo(F-1,Q-1),r.closePath(),r.fill(),Y(r,ke),K(r,ke)}function te(){const s=n.freezeCanvasRef.value,b=n.wrapperRef.value;if(!s||!b)return;const M=s.getContext("2d");if(!M)return;const _=b.getBoundingClientRect(),x=_.width,P=_.height,z=52,F=24,Q=n.themeColors.value,ke=e.colPositions.value,Ne=e.rowPositions.value,tt=e.scrollX.value,ut=e.scrollY.value;s.width=x*f,s.height=P*f,s.style.width=x+"px",s.style.height=P+"px",M.setTransform(f,0,0,f,0,0),M.clearRect(0,0,x,P);const{frozenRowsHeight:yt,frozenColumnsWidth:Tt}=e.getFrozenMetrics();if(yt<=0&&Tt<=0)return;const qt=z+Tt,al=F+yt,Sl=Math.max(0,x-z-11-Tt),ql=Math.max(0,P-F-11-yt),pn=Math.max(0,e.freeze.cols-1),hn=Math.max(0,e.freeze.rows-1),gn=Math.max(e.freeze.cols,e.hitCol(Tt+tt));let Jl=gn;for(let Ye=gn;Ye<e.colCount&&!(z+ke[Ye]-tt>=x);Ye++)Jl=Ye;const yn=Math.max(e.freeze.rows,e.hitRow(yt+ut));let gl=yn;for(let Ye=yn;Ye<e.rowCount&&!(F+Ne[Ye]-ut>=P);Ye++)gl=Ye;let Al=gn,Jt=Jl,Qt=yn,il=gl;Tt>0&&(Al=0,Jt=Math.max(Jt,pn)),yt>0&&(Qt=0,il=Math.max(il,hn));let Vl=Al,Hl=Qt;for(const Ye in e.merges){const It=e.merges[Ye];It&&(It.startRow>il||It.endRow<Qt||It.startCol>Jt||It.endCol<Al||(It.startCol<Vl&&(Vl=It.startCol),It.startRow<Hl&&(Hl=It.startRow)))}const Ql=new Array(Hl);for(let Ye=Hl;Ye<=il;Ye++)Ql[Ye]=Ne[Ye+1]-Ne[Ye];const Ol=(Ye,It,Rl)=>{const yl=e.findMerge(Ye,It);return yl?e.getCellBorderSide(e.cells[yl.anchor],Rl):e.getCellBorderSide(e.cells[e.cellKey(Ye,It)],Rl)},vt=(Ye,It,Rl,yl,T)=>{Ye.fillStyle="#444";for(let Be=yl;Be<=T;Be++)for(let He=It;He<=Rl;He++){const wt=e.findMerge(He,Be);if(wt&&!(He===wt.range.startCol&&Be===wt.range.startRow))continue;const Lt=e.cellToScreenRect(Be,He),Dt=Lt.x,qe=Lt.y,Re=Lt.width,dt=Lt.height;if(Dt+Re<z||qe+dt<F||Dt>x||qe>P)continue;const nt=e.cells[e.cellKey(He,Be)],_e={top:e.getCellBorderSide(nt,"top"),right:e.getCellBorderSide(nt,"right"),bottom:e.getCellBorderSide(nt,"bottom"),left:e.getCellBorderSide(nt,"left")};if(wt)continue;const Oe={top:Ol(He,Be-1,"bottom"),left:Ol(He-1,Be,"right"),bottom:Ol(He,Be+1,"top"),right:Ol(He+1,Be,"left")},rt=Nt(Oe.top,_e.top),it=Nt(Oe.left,_e.left),kt=Nt(_e.bottom,Oe.bottom),Et=Nt(_e.right,Oe.right),At=(rt==null?void 0:rt.width)??0,we=(it==null?void 0:it.width)??0,ne=(kt==null?void 0:kt.width)??0,Te=(Et==null?void 0:Et.width)??0;At>0&&(Ye.fillStyle=(rt==null?void 0:rt.color)||"#444",Ye.fillRect(Dt,qe,Re,At)),ne>0&&(Ye.fillStyle=(kt==null?void 0:kt.color)||"#444",Ye.fillRect(Dt,qe+dt-ne,Re,ne)),we>0&&(Ye.fillStyle=(it==null?void 0:it.color)||"#444",Ye.fillRect(Dt,qe,we,dt)),Te>0&&(Ye.fillStyle=(Et==null?void 0:Et.color)||"#444",Ye.fillRect(Dt+Re-Te,qe,Te,dt))}},Mn=(Ye,It,Rl,yl,T,Be,He,wt)=>{Rl<=0||yl<=0||(M.save(),M.beginPath(),M.rect(Ye,It,Rl,yl),M.clip(),M.fillStyle=Q.gridBg,M.fillRect(Ye,It,Rl,yl),m(M,T,Be,He,wt,Ql),vt(M,T,Be,He,wt),k(M,Ye,It,Rl,yl),M.restore())};Tt>0&&yt>0&&Mn(z,F,Tt,yt,0,pn,0,hn),yt>0&&Mn(qt,F,Sl,yt,Vl,Jt,0,hn),Tt>0&&Mn(z,al,Tt,ql,0,pn,Hl,il),M.strokeStyle=Q.headerSep,M.lineWidth=1,Tt>0&&(M.beginPath(),M.moveTo(qt+.5,F),M.lineTo(qt+.5,P),M.stroke()),yt>0&&(M.beginPath(),M.moveTo(z,al+.5),M.lineTo(x,al+.5),M.stroke()),M.fillStyle=Q.headerBg,M.fillRect(0,0,z,F),M.strokeStyle=Q.headerSep,M.lineWidth=1,M.strokeRect(.5,.5,z-.5,F-.5),Y(M,Q),K(M,Q)}function Y(s,b){const M=e.selection.value;if(!M||e.editingCell.value)return;const _=e.cellToScreenRect(M.endRow,M.endCol),x=wo(M,M,e.merges),P=_.x+_.width-6/2,z=_.y+_.height-6/2;s.fillStyle=x?b.activeCellBorder:b.scrollTrack,s.fillRect(P,z,6,6),s.strokeStyle="#fff",s.lineWidth=1,s.strokeRect(P+.5,z+.5,6-1,6-1)}function K(s,b){const M=e.autoFillState.value;if(!M.active||!M.preview||!M.targetRange)return;const _=M.targetRange,x=e.cellToScreenRect(_.startRow,_.startCol),P=e.cellToScreenRect(_.endRow,_.endCol),z=x.x,F=x.y,Q=P.x+P.width-z,ke=P.y+P.height-F;s.fillStyle=b.selectionBg,s.fillRect(z,F,Q,ke),s.strokeStyle=b.activeCellBorder,s.lineWidth=1.5,s.setLineDash([4,3]),s.strokeRect(z+.5,F+.5,Q-1,ke-1),s.setLineDash([])}const C=t.computed(()=>ht(e.activeCell.value.col)+String(e.activeCell.value.row+1)),j=t.ref(""),q=t.ref(!1),se=t.computed(()=>e.editingCell.value?j.value:e.getCellRaw(e.activeCell.value.col,e.activeCell.value.row));t.watch(()=>e.editingCell.value,(s,b)=>{if(s&&!b){const M=e.editValue.value||e.getCellRaw(s.col,s.row)||"";j.value=M,ve=!1}else!s&&b&&(j.value="",q.value=!1,ve=!1)},{immediate:!0}),t.watch(()=>[e.activeCell.value.col,e.activeCell.value.row],()=>{e.editingCell.value||(j.value="",ve=!1)});function Fe(){e.editingCell.value||(e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(),d())}function Qe(s){const b=s.target.value;e.editingCell.value?e.editValue.value=b:e.startEdit(b),j.value=b,ve=!0}function Ge(s){var M,_;const b={...e.activeCell.value};e.editingCell.value?(e.editValue.value=s,e.commitEdit()):((M=e.saveUndo)==null||M.call(e),e.setCellValue(b.col,b.row,s)),j.value="",ve=!1,d(),(_=n.emitModelData)==null||_.call(n)}let be=!1,ve=!1;function Xe(){var P,z,F,Q,ke,Ne,tt,ut,yt;if(be)return;const s=n.formulaBarRef.value,b=!!(s&&typeof document<"u"&&document.activeElement===s);if(!e.editingCell.value&&!b&&!ve)return;const M={...e.activeCell.value},_=e.editingCell.value?e.editingCell.value.col:M.col,x=e.editingCell.value?e.editingCell.value.row:M.row;if(!e.editingCell.value){const Tt=e.getCellRaw(_,x),qt=j.value!==Tt;if(!ve)return;be=!0,qt&&((P=e.saveUndo)==null||P.call(e),e.setCellValue(_,x,j.value),d(),(z=n.emitModelData)==null||z.call(n)),(F=n.formulaBarRef.value)==null||F.blur(),j.value="",q.value=!1,ve=!1,t.nextTick(()=>{be=!1});return}be=!0,ve?(e.editValue.value=j.value,e.commitEdit(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),(Q=n.formulaBarRef.value)==null||Q.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),(ke=n.emitModelData)==null||ke.call(n),t.nextTick(()=>{be=!1})):b?(j.value=e.editValue.value,e.commitEdit(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),(Ne=n.formulaBarRef.value)==null||Ne.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),(tt=n.emitModelData)==null||tt.call(n),t.nextTick(()=>{be=!1})):(e.commitEdit(),(ut=n.formulaBarRef.value)==null||ut.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),(yt=n.emitModelData)==null||yt.call(n),t.nextTick(()=>{be=!1}))}function Je(){var s;be||(be=!0,e.editingCell.value&&e.cancelEdit(),(s=n.formulaBarRef.value)==null||s.blur(),j.value="",q.value=!1,ve=!1,d(),n.focusEditInput(),t.nextTick(()=>{be=!1}))}function gt(s){if(!s.isComposing){if(s.key==="Enter"&&(s.altKey||s.metaKey)&&!s.ctrlKey){s.preventDefault(),s.stopPropagation();const b=s.target;if(!b)return;e.editingCell.value||e.startEdit();const M=b.selectionStart??b.value.length,_=b.selectionEnd??b.value.length,x=b.value,P=x.substring(0,M)+`
|
|
7
|
+
`+x.substring(_),z=M+1;j.value=P,q.value||(q.value=!0),t.nextTick(()=>{try{b.setSelectionRange(z,z)}catch{}if(q.value)try{b.scrollTop=b.scrollHeight}catch{}try{b.focus({preventScroll:!0})}catch{}});return}s.key==="Enter"?(s.preventDefault(),Xe()):s.key==="Escape"&&(s.preventDefault(),Je())}}function Ze(){Xe()}const lt=t.ref(null),et=t.ref("");function oe(s){lt.value===null&&(n.switchSheet(s),d())}function pe(s){s!==n.activeSheetIndex.value&&(n.saveSheet(),n.loadSheet(s),d()),lt.value=s,et.value=n.sheets.value[s].name,t.nextTick(()=>{const b=document.querySelector(".tab-rename-input");b==null||b.focus(),b==null||b.select()})}function g(){lt.value!==null&&(n.renameSheet(lt.value,et.value),t.nextTick(()=>n.emitModelData())),lt.value=null,et.value=""}function A(){lt.value=null,et.value=""}function L(s){s.key==="Enter"?(s.preventDefault(),g()):s.key==="Escape"&&(s.preventDefault(),A())}const $=t.ref(null);t.watch($,s=>{s===null&&Pe()});const ee=t.ref(null),ie=18,re=2,he=2,ce=new Path2D("M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z");function V(s,b,M,_,x,P){const z=Math.min(P,_/2,x/2);s.beginPath(),s.moveTo(b+z,M),s.arcTo(b+_,M,b+_,M+x,z),s.arcTo(b+_,M+x,b,M+x,z),s.arcTo(b,M+x,b,M,z),s.arcTo(b,M,b+_,M,z),s.closePath()}function c(s,b,M,_,x,P,z){const F=Math.min(_,ie)-re,Q=b+_-F-re,ke=M+re,Ne=x-2*re;s.save(),s.fillStyle=P?z.activeCellBorder:"#ececec",V(s,Q,ke,F,Ne,he),s.fill();const tt=Math.min(F,Ne)*.72;s.translate(Q+F/2,ke+Ne/2),s.scale(tt/1024,tt/1024),s.translate(-512,-512),s.fillStyle=P?"#ffffff":"#5a5a5a",s.fill(ce),s.restore()}function u(s,b){const M=e.getFilter();if(!M)return-1;const _=e.screenToCell(s,b);if(!_)return-1;const{col:x,row:P}=_;if(P!==M.range.startRow||x<M.range.startCol||x>M.range.endCol)return-1;const z=e.cellToScreenRect(P,x),F=Math.min(z.width,ie)-re,Q=z.x+z.width-F-re,ke=z.x+z.width-re;return s>=Q&&s<=ke&&b>=z.y+re&&b<=z.y+z.height-re?x:-1}function p(s){const b=e.getFilter();if(!b)return;const M=n.canvasRef.value;if(!M)return;const _=M.getBoundingClientRect(),x=e.cellToScreenRect(b.range.startRow,s);ee.value={col:s,x:_.left+x.x+x.width-ie,y:_.top+x.y+2}}function H(){ee.value=null}let ct=null,ae=null;function Pe(){ct&&(document.removeEventListener("click",ct),ct=null),ae&&(document.removeEventListener("touchstart",ae,{capture:!0}),ae=null)}function at(s,b,M){Pe();const _=140,x=M.length*28+8,P=window.innerWidth,z=window.innerHeight;s+_>P&&(s-=_),b+x>z&&(b-=x),Mt.value=!1,$.value={x:s,y:b,items:M},t.nextTick(()=>Rt()),ct=()=>{$.value=null,Pe()},ae=F=>{const Q=F.target;Q&&Q.closest(".context-menu")||($.value=null,Pe())},setTimeout(()=>{document.addEventListener("click",ct,{once:!0}),document.addEventListener("touchstart",ae,{capture:!0})},0)}const Mt=t.ref(!1);function St(s,b){}function Rt(){const b=document.querySelector(".context-menu"),M=$.value,_=n.wrapperRef.value;if(!b||!M||!_){Mt.value=!1;return}const x=M.x+140;M.x;const P=_.getBoundingClientRect(),z=b.style.transform;b.style.transform="none";let F=0;if(b.querySelectorAll(".context-menu__item").forEach(ke=>{const Ne=ke.querySelector(":scope > .context-submenu");if(!Ne)return;const tt=Ne.style.display;Ne.style.display="block";const ut=Ne.getBoundingClientRect().width;Ne.style.display=tt,ut>F&&(F=ut)}),b.style.transform=z,F===0){Mt.value=!0;return}const Q=P.right-x;Mt.value=Q<F+8}function Ft(s,b){s.preventDefault(),s.stopPropagation(),at(s.clientX,s.clientY,[{label:D(e.locale.value,"insert"),action:()=>{n.addSheet(),d()}},{label:D(e.locale.value,"copy"),action:()=>{n.dupSheet(b)}},{label:D(e.locale.value,"rename"),action:()=>{pe(b)}},{label:D(e.locale.value,"delete"),action:()=>{n.removeSheet(b),d()},disabled:n.sheetCount.value<=1},{label:D(e.locale.value,"moveSheetLeft"),action:()=>{n.moveSheet(b,-1)},disabled:b===0},{label:D(e.locale.value,"moveSheetRight"),action:()=>{n.moveSheet(b,1)},disabled:b===n.sheets.value.length-1}])}function Yt(s){s.preventDefault(),!(s.target.closest(".tab-item")||s.target.closest(".tab-bar__add-btn"))&&at(s.clientX,s.clientY,[{label:D(e.locale.value,"insert"),action:()=>{n.addSheet(),d()}}])}function nl(s){s.preventDefault(),e.selectAll(),d(),at(s.clientX,s.clientY,[{label:D(e.locale.value,"cut"),action:()=>{o.cutSelected(),n.emitModelData()}},{label:D(e.locale.value,"copy"),action:()=>o.copyToClipboard()},{label:D(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:D(e.locale.value,"delete"),action:()=>{l.saveUndo(),o.clearSelected();for(let b=0;b<e.colCount;b++)e.colWidths.value[b]=100;for(let b=0;b<e.rowCount;b++)e.rowHeights.value[b]=void 0;d(),n.emitModelData()}}])}function Cl(s,b){s.preventDefault();const M=s.clientX,_=s.clientY,x=e.selection.value;x&&x.startCol===0&&x.endCol===e.colCount-1&&b>=x.startRow&&b<=x.endRow||(e.selectRange(0,b,e.colCount-1,b,"row"),d());const P=e.selection.value;at(s.clientX,s.clientY,[{label:D(e.locale.value,"insert"),action:()=>{l.saveUndo(),n.insertRows(P.startRow,P.endRow),d(),n.emitModelData()}},{label:D(e.locale.value,"cut"),action:()=>{l.saveUndo(),o.copyRowCol(),e.clearCellsInRange(0,e.colCount-1,P.startRow,P.endRow),d(),n.emitModelData()}},{label:D(e.locale.value,"copy"),action:()=>o.copyRowCol()},{label:D(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:D(e.locale.value,"delete"),action:()=>{l.saveUndo(),n.deleteRows(P.startRow,P.endRow),d(),n.emitModelData()}},{label:`${D(e.locale.value,"rowHeight")}...`,action:()=>Gl("row",M,_)},{label:D(e.locale.value,"autoRowHeight"),action:()=>n.resetRowHeight()},{label:D(e.locale.value,"freezeToRow"),action:()=>{e.setFreeze(b+1,e.freeze.cols),d()}}])}function Dl(s,b){s.preventDefault();const M=s.clientX,_=s.clientY,x=e.selection.value;x&&x.startRow===0&&x.endRow===e.rowCount-1&&b>=x.startCol&&b<=x.endCol||(e.selectRange(b,0,b,e.rowCount-1,"col"),d());const P=e.selection.value,z=!n.canSortColumns(P.startCol,P.endCol);at(s.clientX,s.clientY,[{label:D(e.locale.value,"insert"),action:()=>{l.saveUndo(),n.insertCols(P.startCol,P.endCol),d(),n.emitModelData()}},{label:D(e.locale.value,"cut"),action:()=>{l.saveUndo(),o.copyRowCol(),e.clearCellsInRange(P.startCol,P.endCol,0,e.rowCount-1),d(),n.emitModelData()}},{label:D(e.locale.value,"copy"),action:()=>o.copyRowCol()},{label:D(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:D(e.locale.value,"delete"),action:()=>{l.saveUndo(),n.deleteCols(P.startCol,P.endCol),d(),n.emitModelData()}},{label:D(e.locale.value,"sort"),disabled:z,children:[{label:D(e.locale.value,"sortAsc"),action:()=>{n.prepareSortConfirmation("asc")||n.sortSelectedColumns("asc")},disabled:z},{label:D(e.locale.value,"sortDesc"),action:()=>{n.prepareSortConfirmation("desc")||n.sortSelectedColumns("desc")},disabled:z}]},{label:`${D(e.locale.value,"colWidth")}...`,action:()=>Gl("col",M,_)},{label:D(e.locale.value,"defaultColWidth"),action:()=>n.resetColWidth()},{label:D(e.locale.value,"freezeToCol"),action:()=>{e.setFreeze(e.freeze.rows,b+1),d()}}])}function cl(s,b,M){s.preventDefault(),e.isSelected(b,M)||(e.selectCell(b,M),d());const _=e.selection.value,x=!!(_&&_.startCol===_.endCol&&_.startRow===_.endRow);at(s.clientX,s.clientY,[{label:D(e.locale.value,"cut"),action:()=>{o.cutSelected(),n.emitModelData()}},{label:D(e.locale.value,"copy"),action:()=>o.copyToClipboard()},{label:D(e.locale.value,"paste"),action:()=>{l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())})}},{label:D(e.locale.value,"delete"),action:()=>{l.saveUndo(),o.clearSelected(),d(),n.emitModelData()}},{label:D(e.locale.value,"calculate"),children:[{label:D(e.locale.value,"sum"),action:o.sumSelected,disabled:x},{label:D(e.locale.value,"avg"),action:o.avgSelected,disabled:x},{label:D(e.locale.value,"count"),action:o.countSelected,disabled:x}]}])}const wl=t.ref(null),ol=t.ref(null);let fl=null,Xt=null;function Kl(){fl&&(document.removeEventListener("mousedown",fl),fl=null),Xt&&(document.removeEventListener("touchstart",Xt),Xt=null)}function Gl(s,b,M){Kl();const _=e.selection.value;let x="";if(_){const ke=s==="row"?e.getRowHeight(_.startRow):e.colWidths.value[_.startCol];x=ke!=null&&ke>0?String(Math.round(ke)):""}const P=220,z=118;let F=b,Q=M;F+P>window.innerWidth&&(F=window.innerWidth-P-8),Q+z>window.innerHeight&&(Q=window.innerHeight-z-8),F<8&&(F=8),Q<8&&(Q=8),ol.value={type:s,x:F,y:Q,value:x,error:""},fl=()=>{ol.value=null},Xt=()=>{ol.value=null},setTimeout(()=>{document.addEventListener("mousedown",fl,{once:!0}),document.addEventListener("touchstart",Xt,{once:!0})},0),t.nextTick(()=>{const ke=wl.value;ke&&(ke.focus(),ke.select())})}function Yl(s){const b=ol.value;if(!b)return;const M=s.target,_=M.value,x=_.replace(/[^\d]/g,"");b.value=x,_!==x&&(M.value=x),b.error=""}function sn(s){s.key==="Enter"?(s.preventDefault(),N()):s.key==="Escape"&&(s.preventDefault(),O())}function I(){const s=ol.value;if(!s)return;const b=s.value.trim(),M=Number(b),_=s.type==="row",x=_?24:30,P=_?500:1e3;if(b===""||!Number.isFinite(M)){O();return}const z=Math.max(x,Math.min(P,Math.round(M)));s.value=String(z),s.error=""}function N(){const s=ol.value,b=e.selection.value;if(!s||!b)return;const M=s.value.trim(),_=Number(M),x=s.type==="row",P=x?24:30,z=x?500:1e3;if(M===""||!Number.isFinite(_)){s.error=D(e.locale.value,"dimNumberError");return}if(_<P||_>z){s.error=D(e.locale.value,"dimRangeError").replace("{min}",String(P)).replace("{max}",String(z));return}const F=_;if(l.saveUndo(),x)for(let Q=b.startRow;Q<=b.endRow;Q++)e.rowHeights.value[Q]=F;else for(let Q=b.startCol;Q<=b.endCol;Q++)e.colWidths.value[Q]=F;d(),n.emitModelData(),O()}function O(){Kl(),ol.value=null}const de=t.computed(()=>{const s=!e.editingCell.value,b=e.editingCell.value??e.activeCell.value,M=b.col,_=b.row,x=e.resolveStyle(e.cells[e.cellKey(M,_)]),P=e.cellFontSize(M,_),z=typeof(x==null?void 0:x.fontFamily)=="string"&&x.fontFamily?x.fontFamily:Cn,F=(x==null?void 0:x.fontWeight)==="bold"?"bold":"normal",Q=(x==null?void 0:x.fontStyle)==="italic"?"italic":"normal",ke=(x==null?void 0:x.underline)==="underline"?"underline":(x==null?void 0:x.strikethrough)==="line-through"?"line-through":"none",Ne=(x==null?void 0:x.underline)==="underline"&&(x==null?void 0:x.strikethrough)==="line-through"?"underline line-through":ke,tt=typeof(x==null?void 0:x.color)=="string"?x.color:void 0,ut=typeof(x==null?void 0:x.backgroundColor)=="string"?x.backgroundColor:void 0,yt=typeof(x==null?void 0:x.numberFormat)=="string"?x.numberFormat:"",Tt=e.editValue.value??e.getCellValue(M,_),qt=typeof(x==null?void 0:x.textAlign)=="string"?x.textAlign:io(Tt,yt)?"right":"left",al=typeof(x==null?void 0:x.verticalAlign)=="string"?x.verticalAlign:"top",Sl=e.findMerge(M,_),ql=Sl?e.rowPositions.value[Sl.range.endRow+1]-e.rowPositions.value[_]:e.getRowHeight(_),pn=2,{ascent:hn,descent:gn}=e.measureFontMetrics(z,P,F,Q),Jl=hn+gn,gl=(e.editValue.value?e.editValue.value.split(`
|
|
8
|
+
`).length:1)*Jl,Al=e.BASE_CELL_VPAD-pn;let Jt=0,Qt=0;al==="middle"?(Jt=Math.floor((ql-gl)/2),Qt=Math.max(0,ql-gl-Jt)):al==="top"?(Jt=Al,Qt=Math.max(0,ql-gl-Jt)):al==="bottom"&&(Qt=Al,Jt=Math.max(0,ql-gl-Qt));const il=e.cellToScreenRect(_,M);return{left:`${il.x}px`,top:`${il.y}px`,width:`${il.width}px`,height:`${il.height}px`,fontFamily:z,fontSize:`${P}px`,lineHeight:1,fontWeight:F,fontStyle:Q,textDecoration:Ne,textAlign:qt,paddingTop:`${Jt}px`,paddingRight:"3px",paddingBottom:`${Qt}px`,paddingLeft:"3px",opacity:s?0:1,pointerEvents:s?"none":"auto",color:s?"transparent":tt,caretColor:s?"transparent":void 0,borderColor:s?"transparent":void 0,background:s?"transparent":ut,boxShadow:s?"none":void 0}});function ge(){return Math.max(0,n.viewSize.w-52-11)}function Me(){return Math.max(0,n.viewSize.h-24-11)}const Ee=t.computed(()=>Math.max(0,ge()-e.getFrozenMetrics().frozenColumnsWidth)),fe=t.computed(()=>Math.max(0,Me()-e.getFrozenMetrics().frozenRowsHeight)),Z=t.computed(()=>52+e.getFrozenMetrics().frozenColumnsWidth),ze=t.computed(()=>24+e.getFrozenMetrics().frozenRowsHeight),$e=t.computed(()=>Math.max(0,Ee.value-11*2)),le=t.computed(()=>Math.max(0,fe.value-11*2)),Ke=t.computed(()=>n.maxScrollX.value<=0?$e.value:Math.max(24,Ee.value/e.totalWidth.value*$e.value)),ft=t.computed(()=>n.maxScrollX.value<=0?0:e.scrollX.value/n.maxScrollX.value*($e.value-Ke.value)),E=t.computed(()=>n.maxScrollY.value<=0?le.value:Math.max(24,fe.value/e.totalHeight.value*le.value)),U=t.computed(()=>n.maxScrollY.value<=0?0:e.scrollY.value/n.maxScrollY.value*(le.value-E.value));let J=null,ue=0,ye=0;function me(s){s.preventDefault(),J="v",ue=s.clientY,ye=e.scrollY.value,document.addEventListener("mousemove",We),document.addEventListener("mouseup",st)}function Se(s){s.preventDefault(),J="h",ue=s.clientX,ye=e.scrollX.value,document.addEventListener("mousemove",We),document.addEventListener("mouseup",st)}function We(s){if(J==="v"){const M=(s.clientY-ue)/(le.value-E.value);n.clampScroll(null,ye+M*n.maxScrollY.value),d()}else if(J==="h"){const M=(s.clientX-ue)/($e.value-Ke.value);n.clampScroll(ye+M*n.maxScrollX.value,null),d()}}function st(){J=null,document.removeEventListener("mousemove",We),document.removeEventListener("mouseup",st)}function Bt(s){if(J)return;const b=s.currentTarget.getBoundingClientRect(),M=s.clientY-b.top;M<U.value?n.clampScroll(null,e.scrollY.value-Me()):M>U.value+E.value&&n.clampScroll(null,e.scrollY.value+Me()),d()}function zt(s){if(J)return;const b=s.currentTarget.getBoundingClientRect(),M=s.clientX-b.left;M<ft.value?n.clampScroll(e.scrollX.value-ge(),null):M>ft.value+Ke.value&&n.clampScroll(e.scrollX.value+ge(),null),d()}let jt=!1,Vt=0,Ht=0,_t=!1,Pt=!1,Xl=0,un=0,vl=0,Nl=0,kn=0,En=0,In=0,An=0,Ut=!1,Fl=!1,bt=0,Ct=0,Kt="cell",dn=0,Qn=-1,eo=-1,rl=null,kl=!1,ml=0,Zt=0,jl=!1,pl=null,fn=null,De=0,h=0;function S(s,b){const M=e.selection.value;if(!M||e.editingCell.value||!wo(M,M,e.merges))return!1;const _=e.cellToScreenRect(M.endRow,M.endCol),x=_.x+_.width-6,P=_.y+_.height-6,z=4;return s>=x-z&&s<=x+6+z&&b>=P-z&&b<=P+6+z}function B(){pl=requestAnimationFrame(W)}function W(){if(!e.autoFillState.value.active||!fn){pl=null;return}const s=8;n.clampScroll(e.scrollX.value+fn.x*s*.1,e.scrollY.value+fn.y*s*.1);const b=e.screenToCell(De,h),M=e.autoFillState.value.sourceRange;if(b&&M){const _=tr(M,{col:b.col,row:b.row});_?e.autoFillState.value={...e.autoFillState.value,targetRange:_.targetRange,direction:_.direction}:e.autoFillState.value={...e.autoFillState.value,targetRange:null,direction:null}}d(),pl=requestAnimationFrame(W)}function X(){pl!==null&&(cancelAnimationFrame(pl),pl=null),fn=null}function Ce(s,b){De=s,h=b;const M=e.screenToCell(s,b),_=e.autoFillState.value.sourceRange;if(M&&_){const ke=tr(_,{col:M.col,row:M.row});ke?e.autoFillState.value={...e.autoFillState.value,targetRange:ke.targetRange,direction:ke.direction}:e.autoFillState.value={...e.autoFillState.value,targetRange:null,direction:null}}const x=30,P=n.viewSize.w,z=n.viewSize.h;let F=0,Q=0;s<52+x?F=-(52+x-s):s>P-11-x&&(F=s-(P-11-x)),b<24+x?Q=-(24+x-b):b>z-11-x&&(Q=b-(z-11-x)),F!==0||Q!==0?(fn={x:F,y:Q},pl===null&&B()):(fn=null,pl!==null&&(cancelAnimationFrame(pl),pl=null)),d()}function xe(){X();const s=e.autoFillState.value;s.targetRange&&s.direction&&s.sourceRange&&e.applyAutoFill(s.sourceRange,s.targetRange,s.direction),e.autoFillState.value={active:!1,sourceRange:null,targetRange:null,direction:null,preview:!1}}function Ie(s){if(s.button!==0)return;s.preventDefault(),$.value=null;const b=an(s,n.canvasRef.value),M=u(b.x,b.y);if(M>=0){p(M);return}if(b.y<24&&b.x>=52){const z=b.x-52+e.scrollX.value,F=w(b.x),Q=F>=0?e.cellToScreenRect(0,F).x+e.colWidths.value[F]:-1;if(F>=0&&Math.abs(b.x-Q)<=4){l.saveUndo(),_t=!0,Xl=F,vl=e.colWidths.value[F],Nl=z,d();return}}if(b.x<52&&b.y>=24){const z=b.y-24+e.scrollY.value,F=v(b.y),Q=F>=0?e.cellToScreenRect(F,0).y+e.getRowHeight(F):-1;if(F>=0&&Math.abs(b.y-Q)<=4){l.saveUndo(),Pt=!0,un=F,vl=e.getRowHeight(F),Nl=z,d();return}}if(S(b.x,b.y)){const z=e.selection.value;z&&(e.autoFillState.value={active:!0,sourceRange:{...z},targetRange:null,direction:null,preview:!0},d());return}if(b.x<52||b.y<24){{const z=n.formulaBarRef.value,F=!!(z&&typeof document<"u"&&document.activeElement===z);(e.editingCell.value||F||ve)&&Xe()}if(b.y<24&&b.x>=52){const z=w(b.x);z>=0&&(e.selectRange(z,0,z,e.rowCount-1,"col"),jt=!0,Vt=z,Ht=0)}else if(b.x<52&&b.y>=24){const z=v(b.y);z>=0&&(e.selectRange(0,z,e.colCount-1,z,"row"),jt=!0,Vt=0,Ht=z)}else b.x<52&&b.y<24&&e.selectAll();d();return}const _=e.screenToCell(b.x,b.y);if(!_)return;const x=_.col,P=_.row;{const z=n.formulaBarRef.value,F=!!(z&&typeof document<"u"&&document.activeElement===z);(e.editingCell.value||F||ve)&&Xe()}if(s.shiftKey&&e.selection.value){const z=e.selection.value;e.selectRange(z.startCol,z.startRow,x,P)}else e.selectCell(x,P);jt=!0,Vt=x,Ht=P,n.focusEditInput(),d()}function Ve(s){if(_t){const z=an(s,n.canvasRef.value).x-52+e.scrollX.value-Nl,F=vl+z;F>=30&&F<=1e3?e.colWidths.value[Xl]=F:F<30?e.colWidths.value[Xl]=30:e.colWidths.value[Xl]=1e3,d();return}if(Pt){const z=an(s,n.canvasRef.value).y-24+e.scrollY.value-Nl,F=vl+z;F>=24&&F<=500?e.rowHeights.value[un]=F:F<24?e.rowHeights.value[un]=24:e.rowHeights.value[un]=500,d();return}if(e.autoFillState.value.active){const P=an(s,n.canvasRef.value);Ce(P.x,P.y);return}if(!jt){const P=n.canvasRef.value;if(!P)return;if(l.paintFmt.value){P.style.cursor="copy";return}const z=an(s,P);if(u(z.x,z.y)>=0){P.style.cursor="pointer";return}if(z.y<24&&z.x>=52){const F=w(z.x),Q=F>=0?e.cellToScreenRect(0,F).x+e.colWidths.value[F]:-1;if(F>=0&&Math.abs(z.x-Q)<=4){P.style.cursor="col-resize";return}}if(z.x<52&&z.y>=24){const F=v(z.y),Q=F>=0?e.cellToScreenRect(F,0).y+e.getRowHeight(F):-1;if(F>=0&&Math.abs(z.y-Q)<=4){P.style.cursor="row-resize";return}}if(S(z.x,z.y)){P.style.cursor="crosshair";return}P.style.cursor="cell";return}const b=an(s,n.canvasRef.value);if(Vt<0||Ht<0)return;if(b.x<52||b.y<24){if(b.y<24&&b.x>=52){const P=w(b.x);P>=0&&e.selectRange(Math.min(Vt,P),0,Math.max(Vt,P),e.rowCount-1,"col")}else if(b.x<52&&b.y>=24){const P=v(b.y);P>=0&&e.selectRange(0,Math.min(Ht,P),e.colCount-1,Math.max(Ht,P),"row")}d();return}const M=e.screenToCell(b.x,b.y);if(!M)return;const _=M.col,x=M.row;Ht===0&&Vt>=0&&e.selection.value&&e.selection.value.startRow===0&&e.selection.value.endRow===e.rowCount-1?e.selectRange(Math.min(Vt,_),0,Math.max(Vt,_),e.rowCount-1,"col"):Vt===0&&Ht>=0&&e.selection.value&&e.selection.value.startCol===0&&e.selection.value.endCol===e.colCount-1?e.selectRange(0,Math.min(Ht,x),e.colCount-1,Math.max(Ht,x),"row"):e.selectRange(Vt,Ht,_,x),d()}function Le(s){const b=_t||Pt;if(jt=!1,_t=!1,Pt=!1,b&&n.scheduleOptEmit(),e.autoFillState.value.active){xe();return}l.paintFmt.value&&l.applyPaintFormat()}function Ue(){X();const s=_t||Pt;jt=!1,_t=!1,Pt=!1,s&&n.scheduleOptEmit()}function mt(s){s.preventDefault();const b=an(s,n.canvasRef.value);if(b.x<52&&b.y<24){nl(s);return}if(b.y<24&&b.x>=52){const M=w(b.x);M>=0&&Dl(s,M);return}if(b.x<52&&b.y>=24){const M=v(b.y);M>=0&&Cl(s,M);return}if(b.x>=52&&b.y>=24){const M=e.screenToCell(b.x,b.y);M&&cl(s,M.col,M.row)}}function je(s){const b=an(s,n.canvasRef.value);if(b.x<52||b.y<24)return;const M=e.screenToCell(b.x,b.y);if(!M)return;const _=M.col,x=M.row;{const P=n.formulaBarRef.value,z=!!(P&&typeof document<"u"&&document.activeElement===P);(e.editingCell.value||z||ve)&&Xe()}e.selectCell(_,x),e.ensureVisible(_,x),e.startEdit(),d(),n.focusEditInput()}function pt(s){const b=e.scrollX.value+s.deltaX,M=e.scrollY.value+s.deltaY,_=40,x=n.maxScrollX.value,P=n.maxScrollY.value;if(b>=x-_&&s.deltaX>0||M>=P-_&&s.deltaY>0){const z=Math.max(0,n.viewSize.w-28-11),F=Math.max(0,n.viewSize.h-28-11),Q=Math.max(0,Math.ceil((b+z)/100)+2),ke=Math.max(0,Math.ceil((M+F)/24)+2);e.ensureCapacity(Q,ke)}n.clampScroll(b,M),d()}function Ot(s){if(s.touches.length!==1){Ut=!1;return}const b=s.touches[0],M=n.canvasRef.value;if(!M)return;const _=M.getBoundingClientRect(),x=b.clientX-_.left,P=b.clientY-_.top,z=b.clientX,F=b.clientY,Q=(Ne,tt)=>({clientX:Ne,clientY:tt,preventDefault(){}});{const Ne=n.formulaBarRef.value,tt=!!(Ne&&typeof document<"u"&&document.activeElement===Ne);(e.editingCell.value||tt||ve)&&Xe()}if(S(x,P)){s.preventDefault();const Ne=e.selection.value;Ne&&(e.autoFillState.value={active:!0,sourceRange:{...Ne},targetRange:null,direction:null,preview:!0},Ut=!0,Fl=!1,Kt="cell",kn=x,En=P,In=e.scrollX.value,An=e.scrollY.value);return}const ke=u(x,P);if(ke>=0){s.preventDefault(),p(ke);return}if(P<24&&x>=52){const Ne=w(x);if(Ne>=0){const tt=e.cellToScreenRect(0,Ne).x+e.colWidths.value[Ne];if(Math.abs(x-tt)<=8){s.preventDefault(),l.saveUndo(),_t=!0,Xl=Ne,vl=e.colWidths.value[Ne],Nl=x-52+e.scrollX.value,Ut=!0,Fl=!1;return}}}if(x<52&&P>=24){const Ne=v(P);if(Ne>=0){const tt=e.cellToScreenRect(Ne,0).y+e.getRowHeight(Ne);if(Math.abs(P-tt)<=8){s.preventDefault(),l.saveUndo(),Pt=!0,un=Ne,vl=e.getRowHeight(Ne),Nl=P-24+e.scrollY.value,Ut=!0,Fl=!1;return}}}x>=52&&P>=24?(s.preventDefault(),Ut=!0,Fl=!1,kl=!1,jl=!1,Kt="cell",kn=x,En=P,In=e.scrollX.value,An=e.scrollY.value,bt=w(x),Ct=v(P),rl!==null&&clearTimeout(rl),rl=window.setTimeout(()=>{const Ne=e.selection.value;if(!!Ne&&bt>=Ne.startCol&&bt<=Ne.endCol&&Ct>=Ne.startRow&&Ct<=Ne.endRow){jl=!0,cl(Q(z,F),bt,Ct);return}kl=!0,ml=bt,Zt=Ct,bt>=0&&Ct>=0&&(e.selectCell(bt,Ct),d())},450)):x>=0&&P>=0&&(x<52||P<24)&&(s.preventDefault(),Ut=!0,Fl=!1,kl=!1,kn=x,En=P,In=e.scrollX.value,An=e.scrollY.value,P<24&&x>=52?(Kt="col",bt=w(x),Ct=-1):x<52&&P>=24?(Kt="row",Ct=v(P),bt=-1):(Kt="all",bt=-1,Ct=-1),(Kt==="col"||Kt==="row"||Kt==="all")&&(rl!==null&&clearTimeout(rl),rl=window.setTimeout(()=>{const Ne=e.selection.value;if(Kt==="all"){jl=!0,nl(Q(z,F));return}if(Kt==="col"){if(!!Ne&&Ne.startRow===0&&Ne.endRow===e.rowCount-1&&bt>=Ne.startCol&&bt<=Ne.endCol){jl=!0,Dl(Q(z,F),bt);return}kl=!0,ml=bt,Zt=-1,bt>=0&&(e.selectRange(bt,0,bt,e.rowCount-1,"col"),d())}else{if(!!Ne&&Ne.startCol===0&&Ne.endCol===e.colCount-1&&Ct>=Ne.startRow&&Ct<=Ne.endRow){jl=!0,Cl(Q(z,F),Ct);return}kl=!0,ml=-1,Zt=Ct,Ct>=0&&(e.selectRange(0,Ct,e.colCount-1,Ct,"row"),d())}},450)))}function Sn(s){if(!Ut||s.touches.length!==1)return;const b=s.touches[0],M=n.canvasRef.value;if(!M)return;const _=M.getBoundingClientRect(),x=b.clientX-_.left,P=b.clientY-_.top;if(e.autoFillState.value.active){s.preventDefault(),Ce(x,P);return}if(_t){const z=x-52+e.scrollX.value-Nl;let F=vl+z;F=F<30?30:F>1e3?1e3:F,e.colWidths.value[Xl]=F,s.preventDefault(),d();return}if(Pt){const z=P-24+e.scrollY.value-Nl;let F=vl+z;F=F<24?24:F>500?500:F,e.rowHeights.value[un]=F,s.preventDefault(),d();return}if(kl){if(s.preventDefault(),ml>=0&&Zt>=0){const z=w(x),F=v(P);z>=0&&F>=0&&(e.selectRange(ml,Zt,z,F),d())}else if(Zt===-1&&ml>=0){const z=w(x);z>=0&&(e.selectRange(Math.min(ml,z),0,Math.max(ml,z),e.rowCount-1,"col"),d())}else if(ml===-1&&Zt>=0){const z=v(P);z>=0&&(e.selectRange(0,Math.min(Zt,z),e.colCount-1,Math.max(Zt,z),"row"),d())}return}rl!==null&&(clearTimeout(rl),rl=null),(Math.abs(x-kn)>8||Math.abs(P-En)>8)&&(Fl=!0,s.preventDefault(),n.clampScroll(In+(kn-x),An+(En-P)),d())}function El(){if(Ut){if(rl!==null&&(clearTimeout(rl),rl=null),jl){jl=!1,Ut=!1;return}if(e.autoFillState.value.active){xe(),Ut=!1;return}if(_t||Pt){_t=!1,Pt=!1,n.scheduleOptEmit(),l.paintFmt.value&&l.applyPaintFormat(),Ut=!1;return}if(kl){kl=!1,l.paintFmt.value&&l.applyPaintFormat(),Ut=!1;return}if(Ut=!1,!Fl){if(Kt==="cell"&&bt>=0&&Ct>=0){const s=Date.now();bt===Qn&&Ct===eo&&s-dn<300?(e.selectCell(bt,Ct),e.startEdit(),d(),n.focusEditInput(),dn=0):(e.commitEdit(),e.selectCell(bt,Ct),d(),dn=s),Qn=bt,eo=Ct,n.focusEditInput()}else Kt==="col"&&bt>=0?(e.commitEdit(),e.selectRange(bt,0,bt,e.rowCount-1,"col"),d()):Kt==="row"&&Ct>=0?(e.commitEdit(),e.selectRange(0,Ct,e.colCount-1,Ct,"row"),d()):Kt==="all"&&(e.commitEdit(),e.selectAll(),d());l.paintFmt.value&&!e.editingCell.value&&l.applyPaintFormat()}}}function mn(s){return s.isComposing||s.key==="Process"||s.keyCode===229}function Rn(s){return s.key.length===1&&!s.ctrlKey&&!s.metaKey&&!s.altKey}function Zl(s){if(e.autoFillState.value.active){s.key==="Escape"&&(s.preventDefault(),X(),e.autoFillState.value={active:!1,sourceRange:null,targetRange:null,direction:null,preview:!1},d());return}if(e.editingCell.value)return;const b=s.ctrlKey||s.metaKey,M=s.shiftKey;switch(!0){case(b&&(s.key==="c"||s.key==="C")):s.preventDefault(),o.copyToClipboard();return;case(b&&(s.key==="x"||s.key==="X")):s.preventDefault(),o.cutSelected();return;case(b&&(s.key==="z"||s.key==="Z")):s.preventDefault(),l.undo();return;case(b&&(s.key==="y"||s.key==="Y")):s.preventDefault(),l.redo();return;case(b&&(s.key==="v"||s.key==="V")):s.preventDefault(),l.saveUndo(),o.pasteFromClipboard().then(()=>{d(),t.nextTick(()=>n.emitModelData())});return;case(b&&(s.key==="a"||s.key==="A")):s.preventDefault(),e.selectAll(),d();return;case(b&&M&&(s.key==="l"||s.key==="L")):s.preventDefault(),e.toggleAutoFilter(),d();return;case(b&&s.key==="Home"):s.preventDefault(),e.selectCell(0,0),e.ensureVisible(0,0),d();return;case(b&&s.key==="End"):s.preventDefault(),e.selectCell(e.colCount-1,e.rowCount-1),e.ensureVisible(e.colCount-1,e.rowCount-1),d();return;case s.key==="Home":s.preventDefault(),e.selectCell(0,e.activeCell.value.row),e.ensureVisible(0,e.activeCell.value.row),d();return;case s.key==="End":s.preventDefault(),e.selectCell(e.colCount-1,e.activeCell.value.row),e.ensureVisible(e.colCount-1,e.activeCell.value.row),d();return;case s.key==="ArrowUp":s.preventDefault(),e.moveActive(0,-1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="ArrowDown":s.preventDefault(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="ArrowLeft":s.preventDefault(),e.moveActive(-1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="ArrowRight":s.preventDefault(),e.moveActive(1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="Tab":s.preventDefault(),e.moveActive(M?-1:1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="Enter":s.preventDefault(),e.moveActive(0,M?-1:1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d();return;case s.key==="F2":s.preventDefault(),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(),d(),n.focusEditInput();return;case s.key==="Delete":case s.key==="Backspace":s.preventDefault(),l.saveUndo(),o.clearSelected(),d();return;case s.key==="Escape":s.preventDefault(),e.cancelEdit(),l.paintFmt.value=null,d();return;case Rn(s):if(mn(s)){e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(""),d(),n.focusEditInput();return}s.preventDefault(),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(s.key),d(),t.nextTick(()=>{const _=n.editInputRef.value;_&&(_.focus(),_.setSelectionRange(1,1))});return}}let Wn=!1,Il=!1;function Vn(s){const b=s.target.value;if(!e.editingCell.value){e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(b),j.value=b,d();return}e.editValue.value=b,j.value=b}function Pn(){Wn=!0,e.editingCell.value||(e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),e.startEdit(""),j.value="",d())}function hr(s){Wn=!1,Il=!0,setTimeout(()=>{Il=!1},0);const b=s.target.value;e.editValue.value=b,j.value=b}function Au(s){if(!e.editingCell.value){if(Rn(s)||mn(s))return;Zl(s);return}if(!(Wn||mn(s))&&!(Il&&(s.key==="Enter"||s.key==="Escape")))if(s.key==="Enter"&&(s.altKey||s.metaKey)){s.preventDefault();const b=n.editInputRef.value;if(!b)return;const M=b.selectionStart??b.value.length,_=b.selectionEnd??b.value.length,x=b.value,P=x.slice(0,M)+`
|
|
9
|
+
`+x.slice(_);e.editValue.value=P,b.value=P,b.selectionStart=b.selectionEnd=M+1,d()}else s.key==="Enter"?(s.preventDefault(),e.commitEdit(),e.moveActive(0,1),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d(),n.focusEditInput()):s.key==="Tab"?(s.preventDefault(),e.commitEdit(),e.moveActive(s.shiftKey?-1:1,0),e.ensureVisible(e.activeCell.value.col,e.activeCell.value.row),d(),n.focusEditInput()):s.key==="Escape"&&(s.preventDefault(),e.cancelEdit(),d(),n.focusEditInput())}function Vu(s){e.editingCell.value}function Hu(){setTimeout(()=>{e.editingCell.value&&(e.commitEdit(),d())},0)}let hl=null;function Un(){var b;const s=(b=n.wrapperRef.value)==null?void 0:b.getBoundingClientRect();if(s){const M=wn(e.props.width),_=wn(e.props.height);M!=null?n.viewSize.w=M:n.viewSize.w=s.width,_!=null?n.viewSize.h=_:n.viewSize.h=s.height}n.clampScroll(null,null),d()}function Ou(){t.onMounted(()=>{const s=wn(e.props.width),b=wn(e.props.height);(s==null||b==null)&&(hl=new ResizeObserver(()=>Un()),n.wrapperRef.value&&hl.observe(n.wrapperRef.value)),t.nextTick(()=>{Un(),n.focusEditInput()}),e.selectCell(0,0),n.modelData.value&&n.modelData.value.length>0&&(a.value=JSON.stringify(n.modelData.value),n.sheets.value=n.modelData.value.map(M=>{const _=n.mkSheet(M.name,{colCount:M.colCount,rowCount:M.rowCount}),{cells:x,styles:P}=rr(M.cells);if(Object.assign(_.cells,x),_.styles=M.styles??P,M.borders)_.borders=M.borders;else{const z=ar(_.styles);_.styles=z.styles,_.borders=z.borders}if(M.colWidths)for(const[z,F]of Object.entries(M.colWidths)){const Q=Number(z);Q>=0&&Q<(_.colCount??e.colCount)&&F>=30&&(_.colWidths[Q]=F)}if(M.rowHeights)for(const[z,F]of Object.entries(M.rowHeights)){const Q=Number(z);Q>=0&&Q<(_.rowCount??e.rowCount)&&F>=24&&(_.rowHeights[Q]=F)}if(M.merges)for(const[z,F]of Object.entries(M.merges))_.merges[z]={...F};return _.freeze=M.freeze?{rows:M.freeze.rows,cols:M.freeze.cols}:{rows:0,cols:0},_.filter=fr(M.filter,_.cells),_}),n.sheets.value.length>0&&n.loadSheet(0))}),t.watch(()=>[e.props.width,e.props.height],()=>{const s=wn(e.props.width),b=wn(e.props.height);s!=null&&b!=null?(hl==null||hl.disconnect(),hl=null):!hl&&n.wrapperRef.value&&(hl=new ResizeObserver(()=>Un()),hl.observe(n.wrapperRef.value)),t.nextTick(()=>Un())}),t.watch(()=>e.props.theme,()=>d()),t.watch(()=>({...e.cells}),()=>t.nextTick(()=>n.emitModelData()),{deep:!1}),t.watch(()=>({...e.merges}),()=>{t.nextTick(()=>n.emitModelData()),d()},{deep:!1}),t.watch(n.activeSheetIndex,()=>t.nextTick(()=>n.emitModelData())),t.watch(()=>n.modelData.value,s=>{if(!s||s.length===0)return;const b=JSON.stringify(s);if(b===a.value)return;a.value=b;const M=e.selection.value?{...e.selection.value}:null,_={...e.activeCell.value};n.sheets.value=s.map(F=>{const Q=n.mkSheet(F.name),{cells:ke,styles:Ne}=rr(F.cells);if(Object.assign(Q.cells,ke),Q.styles=F.styles??Ne,F.borders)Q.borders=F.borders;else{const tt=ar(Q.styles);Q.styles=tt.styles,Q.borders=tt.borders}if(F.colWidths)for(const[tt,ut]of Object.entries(F.colWidths)){const yt=Number(tt);yt>=0&&yt<e.colCount&&ut>=30&&(Q.colWidths[yt]=ut)}if(F.rowHeights)for(const[tt,ut]of Object.entries(F.rowHeights)){const yt=Number(tt);yt>=0&&yt<e.rowCount&&ut>=24&&(Q.rowHeights[yt]=ut)}if(F.merges)for(const[tt,ut]of Object.entries(F.merges))Q.merges[tt]={...ut};return Q.freeze=F.freeze?{rows:F.freeze.rows,cols:F.freeze.cols}:{rows:0,cols:0},Q.filter=fr(F.filter,Q.cells),Q}),n.sheets.value.length>0&&n.loadSheet(0),M&&(e.selection.value=M),e.activeCell.value=_;const x=e.activeCell.value,P=e.selection.value,z=e.findMerge(x.col,x.row);z&&z.anchor===e.cellKey(x.col,x.row)&&(!P||P.startCol===x.col&&P.startRow===x.row&&P.endCol===x.col&&P.endRow===x.row)&&e.selectCell(x.col,x.row),d()},{deep:!0}),t.onBeforeUnmount(()=>{hl==null||hl.disconnect()})}return{scheduleRender:d,render:G,renderFrozenOverlay:te,activeCellLabel:C,formulaBarDisplay:se,formulaBarDraft:j,formulaBarExpanded:q,onFormulaBarFocus:Fe,onFormulaBarInput:Qe,onFormulaBarKeydown:gt,onFormulaBarBlur:Ze,acceptFormulaBarEdit:Xe,cancelFormulaBarEdit:Je,insertFunctionIntoCell:Ge,renTab:lt,renTabVal:et,onTabClick:oe,onTabDblClick:pe,commitTabRename:g,cclTabRename:A,onTabRenameKd:L,ctxMenu:$,ctxSubmenuLeft:Mt,filterPopup:ee,isFilterButtonHit:u,openFilterPopup:p,closeFilterPopup:H,onCtxItemEnter:St,onTabCtxMenu:Ft,onTabBarCtx:Yt,onCornerCtx:nl,onRowHdrCtx:Cl,onColHdrCtx:Dl,onCellCtx:cl,dimInputRef:wl,dimPanel:ol,openDimPanel:Gl,onDimInput:Yl,onDimKeydown:sn,onDimBlur:I,applyDimPanel:N,closeDimPanel:O,editInputStyle:de,hScrollbarW:Ee,vScrollbarH:fe,hScrollbarLeft:Z,vScrollbarTop:ze,hTrackW:$e,vTrackH:le,hThumbW:Ke,hThumbL:ft,vThumbH:E,vThumbT:U,onVStart:me,onHStart:Se,onSbMove:We,onSbUp:st,onVTrk:Bt,onHTrk:zt,onMouseDown:Ie,onMouseMove:Ve,onMouseUp:Le,onMouseLeave:Ue,onCanvasCtx:mt,onDblClick:je,onWheel:pt,onTouchStart:Ot,onTouchMove:Sn,onTouchEnd:El,onKeydown:Zl,onEditInput:Vn,onEditCompositionStart:Pn,onEditCompositionEnd:hr,onEditKd:Au,onEditPaste:Vu,onEditBlur:Hu,applySize:Un,setupLifecycle:Ou}}function fu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mr(e,l,o,n){return l?n?o?e===l:e.toLowerCase()===l.toLowerCase():o?e.includes(l):e.toLowerCase().includes(l.toLowerCase()):!1}function mu(e,l,o,n){if(!l)return e;if(n){const i=e.indexOf(l);return i<0?e:e.slice(0,i)+o+e.slice(i+l.length)}const a=e.toLowerCase().indexOf(l.toLowerCase());return a<0?e:e.slice(0,a)+o+e.slice(a+l.length)}function pu(e,l,o,n){return l?n?e.indexOf(l)<0?e:e.split(l).join(o):e.toLowerCase().indexOf(l.toLowerCase())<0?e:e.replace(new RegExp(fu(l),"gi"),()=>o):e}function ko(e,l,o,n,a,i,r){const f=[];if(r){for(let m=r.startRow;m<=r.endRow;m++)for(let y=r.startCol;y<=r.endCol;y++){const k=e[o(y,m)];k&&mr(k.value,n,a,i)&&f.push({sheetIndex:l,col:y,row:m})}return f}for(const m in e){const y=e[m];if(y&&mr(y.value,n,a,i)){const k=m.split(","),d=Number(k[0]),w=Number(k[1]);!Number.isNaN(d)&&!Number.isNaN(w)&&f.push({sheetIndex:l,col:d,row:w})}}return f}function hu(e,l,o,n){const a=t.ref(!1),i=t.ref(""),r=t.ref(""),f=t.ref("sheet"),m=t.ref(!1),y=t.ref(!1),k=t.ref(-1),d=t.ref([]),w=t.ref(""),v=t.ref(0),R=t.ref(""),G=t.computed(()=>{const oe=new Set,pe=o.activeSheetIndex.value;for(const g of d.value)g.sheetIndex===pe&&oe.add(`${g.col},${g.row}`);return oe}),te=t.computed(()=>{if(k.value<0||k.value>=d.value.length)return null;const oe=d.value[k.value];return oe.sheetIndex!==o.activeSheetIndex.value?null:`${oe.col},${oe.row}`});e.findHighlight=(oe,pe)=>{const g=`${oe},${pe}`;return te.value===g?"active":G.value.has(g)?"match":null};function Y(oe){var A,L;const pe=e.cellKey(oe.col,oe.row);if(oe.sheetIndex===o.activeSheetIndex.value)return((A=e.cells[pe])==null?void 0:A.value)??"";const g=o.sheets.value[oe.sheetIndex];return((L=g==null?void 0:g.cells[pe])==null?void 0:L.value)??""}function K(oe,pe){const g=e.cellKey(oe.col,oe.row);if(oe.sheetIndex===o.activeSheetIndex.value)e.setCellValue(oe.col,oe.row,pe);else{const A=o.sheets.value[oe.sheetIndex];if(!A)return;const L=A.cells[g];A.cells[g]={value:String(pe),styleId:L==null?void 0:L.styleId}}}function C(){if(R.value){w.value=R.value;return}if(!i.value){w.value="";return}if(f.value==="selection"&&!e.selection.value){w.value=D(e.locale.value,"findNeedSelection");return}if(d.value.length===0){w.value=D(e.locale.value,"findNoResult");return}w.value=""}function j(){const oe=i.value,pe=[];if(oe)if(f.value==="workbook")o.sheets.value.forEach((g,A)=>{pe.push(...ko(g.cells,A,e.cellKey,oe,m.value,y.value))});else if(f.value==="selection"){const g=e.selection.value;g&&pe.push(...ko(e.cells,o.activeSheetIndex.value,e.cellKey,oe,m.value,y.value,g))}else pe.push(...ko(e.cells,o.activeSheetIndex.value,e.cellKey,oe,m.value,y.value));d.value=pe,pe.length===0?k.value=-1:k.value>=pe.length?k.value=pe.length-1:k.value<0&&(k.value=0),C()}function q(){if(k.value<0||k.value>=d.value.length)return;const oe=d.value[k.value];oe.sheetIndex!==o.activeSheetIndex.value&&o.switchSheet(oe.sheetIndex),f.value==="selection"?e.activeCell.value={col:oe.col,row:oe.row}:e.selectCell(oe.col,oe.row),e.ensureVisible(oe.col,oe.row)}const se=typeof requestAnimationFrame=="function"?requestAnimationFrame:oe=>setTimeout(oe,16);let Fe=!1,Qe=!1;function Ge(oe){if(Fe){Qe=Qe||oe;return}Fe=!0,Qe=oe,se(()=>{var pe;Fe=!1,j(),Qe&&d.value.length>0&&k.value>=0&&q(),Qe=!1,(pe=e.scheduleRender)==null||pe.call(e)})}function be(){var oe;a.value=!0,v.value++,j(),d.value.length>0&&(k.value=0,q()),(oe=e.scheduleRender)==null||oe.call(e)}function ve(){be()}function Xe(){var oe;a.value=!1,d.value=[],k.value=-1,R.value="",w.value="",(oe=e.scheduleRender)==null||oe.call(e)}function Je(){var oe;d.value.length!==0&&(k.value=(k.value+1)%d.value.length,q(),(oe=e.scheduleRender)==null||oe.call(e))}function gt(){var oe;d.value.length!==0&&(k.value=(k.value-1+d.value.length)%d.value.length,q(),(oe=e.scheduleRender)==null||oe.call(e))}function Ze(){var L,$;if(k.value<0||k.value>=d.value.length)return;const oe=d.value[k.value],pe=Y(oe),g=mu(pe,i.value,r.value,m.value);if(g===pe)return;l.saveUndo(),K(oe,g);const A=k.value;j(),d.value.length>0?(k.value=Math.min(A,d.value.length-1),Je()):k.value=-1,(L=e.emitModelData)==null||L.call(e),($=e.scheduleRender)==null||$.call(e)}function lt(){var A,L;const oe=i.value;if(!oe||d.value.length===0)return;l.saveUndo();let pe=0;const g=d.value.slice();for(const $ of g){const ee=Y($),ie=pu(ee,oe,r.value,m.value);ie!==ee&&(K($,ie),pe++)}d.value=[],k.value=-1,R.value=D(e.locale.value,"findReplacedAll").replace("{n}",String(pe)),C(),(A=e.emitModelData)==null||A.call(e),(L=e.scheduleRender)==null||L.call(e)}function et(){const oe=pe=>{if(!(pe.ctrlKey||pe.metaKey))return;const A=pe.key.toLowerCase();(A==="f"||A==="h")&&(pe.preventDefault(),be())};window.addEventListener("keydown",oe),t.onBeforeUnmount(()=>window.removeEventListener("keydown",oe))}return t.watch(i,()=>{a.value&&(R.value="",k.value=0,Ge(!0))}),t.watch([f,m,y],()=>{a.value&&(R.value="",k.value=0,Ge(!0))}),t.watch(e.cells,()=>{a.value&&Ge(!1)},{deep:!0}),t.watch(()=>e.selection.value,()=>{a.value&&f.value==="selection"&&(k.value=0,Ge(!0))}),t.watch([()=>l.undoStack.value.length,()=>l.redoStack.value.length],()=>{a.value&&Ge(!1)}),{open:a,findText:i,replaceText:r,scope:f,matchCase:m,matchEntireCell:y,currentIndex:k,results:d,message:w,focusToken:v,activeSheetMatches:G,activeMatchKey:te,openFind:be,openReplace:ve,close:Xe,recompute:j,findNext:Je,findPrev:gt,replace:Ze,replaceAll:lt,setupLifecycle:et}}const gu={class:"formula-bar__cell-label"},yu={class:"formula-bar__buttons"},bu=["title","aria-label"],Cu=["rows","value"],wu=["title"],vu={key:0,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},ku={key:1,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},Eu=["value"],Su={key:2,class:"sb-corner"},Ru=["onClick","onMouseenter"],Mu={class:"context-menu__label"},xu={key:0,class:"context-menu__arrow",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"22869"},Bu=["onClick"],Tu={class:"dim-panel__title"},Du={class:"dim-panel__body"},Nu=["value"],Fu={key:0,class:"dim-panel__error"},Iu={class:"dim-panel__footer"},pr=tl(t.defineComponent({__name:"spreader",props:t.mergeModels({rowCount:{default:200},colCount:{default:26},width:{},height:{},theme:{default:"light"},locale:{default:"zh-CN"}},{data:{default:()=>[]},dataModifiers:{}}),emits:["update:data"],setup(e){const l=e,o=t.useModel(e,"data"),n={value:""},a=lu(l,{rowCount:l.rowCount,colCount:l.colCount,theme:l.theme,locale:l.locale}),i={sheets:t.ref([]),activeSheetIndex:t.ref(0),saveSheet:()=>{},loadSheet:V=>{},mkSheet:V=>({id:"",name:V,cells:{},merges:{},styles:[{}],borders:[{}],selection:null,activeCell:{col:0,row:0},scrollX:0,scrollY:0,colWidths:[],rowHeights:[],colCount:0,rowCount:0,freeze:{rows:0,cols:0},filter:null})},r=nu(a,i),f=ru(a,r);ou(r,{borderMenuOpen:f.borderMenuOpen,mergeMenuOpen:f.mergeMenuOpen});const m=uu(a,r,o,void 0,n);i.sheets=m.sheets,i.activeSheetIndex=m.activeSheetIndex,i.saveSheet=m.saveSheet,i.loadSheet=m.loadSheet,i.mkSheet=m.mkSheet;const y=du(a,r,f,m,n);y.setupLifecycle();const k=hu(a,r,m);k.setupLifecycle();const d=t.reactive(a),w=t.reactive(r),v=t.reactive(f),R=t.reactive(m),G=m.sheets,te=m.activeSheetIndex,Y=m.sortMenuOpen,K=m.cachedSortOrder,C=t.reactive(y),j=t.reactive(k),q=t.computed(()=>{const V=d.selection;return!!V&&V.startCol===V.endCol&&V.startRow===V.endRow}),se=t.computed(()=>{const V=d.selection;return V?m.canSortColumns(V.startCol,V.endCol):!1}),Fe=t.computed(()=>{if(d.getFilter()!==null)return!0;const V=d.selection;if(!V)return!0;const c=Math.min(V.startCol,V.endCol),u=Math.max(V.startCol,V.endCol),p=Math.min(V.startRow,V.endRow),H=Math.max(V.startRow,V.endRow);for(const ct in d.merges){const ae=d.merges[ct];if(!(ae.startCol===ae.endCol&&ae.startRow===ae.endRow)&&c<=ae.endCol&&u>=ae.startCol&&p<=ae.endRow&&H>=ae.startRow)return!1}return!0}),Qe=t.computed(()=>{const V=w.selNumberFormat;if(V!==Bl&&V!==$l)return V;const c=d.activeCell,u=a.resolveStyle(d.cells[d.cellKey(c.col,c.row)]);return typeof(u==null?void 0:u.numberFormat)=="string"?u.numberFormat:""});function Ge(V){r.nfDialogOpen.value=V}const be=t.ref(!1);function ve(){be.value=!0}function Xe(V){be.value=V}function Je(V){y.insertFunctionIntoCell(V)}function gt(){d.toggleAutoFilter(),C.scheduleRender()}function Ze(V){const c=d.getFilter();return c?d.getCellValue(V,c.range.startRow):""}function lt(V){const c=d.freeze;if(V==="panes"){const u=d.selection,p=u?u.startRow:d.activeCell.row,H=u?u.startCol:d.activeCell.col;d.setFreeze(p,H)}else V==="firstRow"?d.setFreeze(1,c.cols):V==="firstCol"?d.setFreeze(c.rows,1):V==="unfreeze"&&d.clearFreeze();C.scheduleRender()}function et(V){r.fontSizeMenuOpen.value=V}function oe(V){r.textColorMenuOpen.value=V}function pe(V){r.fillColorMenuOpen.value=V}function g(V){y.renTabVal.value=V}function A(){y.ctxMenu.value=null}const L=V=>{m.formulaBarRef.value=V};function $(){y.formulaBarExpanded.value=!y.formulaBarExpanded.value}const ee=V=>{m.wrapperRef.value=V},ie=V=>{m.canvasRef.value=V},re=V=>{m.freezeCanvasRef.value=V},he=V=>{m.editInputRef.value=V},ce=V=>{y.dimInputRef.value=V};return(V,c)=>(t.openBlock(),t.createElementBlock("div",{class:"spreadsheet-outer",style:t.normalizeStyle(R.outerStyle)},[t.createVNode(ji,{locale:d.locale,"can-undo":w.canUndo,"can-redo":w.canRedo,"paint-fmt-active":w.paintFmt!==null,"has-selection":w.hasSelection,"font-family-options":w.fontFamilyOptions,"font-size-options":w.fontSizeOptions,"sel-font-family":w.selFontFamily,"sel-font-size":w.selFontSize,"font-size-input":w.fontSizeInput,"font-size-menu-open":w.fontSizeMenuOpen,"sel-font-weight":w.selFontWeight,"sel-font-style":w.selFontStyle,"sel-underline":w.selUnderline,"sel-strikethrough":w.selStrikethrough,"sel-text-color":w.selTextColor,"text-color-menu-open":w.textColorMenuOpen,"sel-fill-color":w.selFillColor,"fill-color-menu-open":w.fillColorMenuOpen,"cached-text-color":w.cachedTextColor,"cached-fill-color":w.cachedFillColor,"border-menu-open":v.borderMenuOpen,"cached-border":v.cachedBorder,"sort-menu-open":t.unref(Y),"cached-sort-order":t.unref(K),"can-sort":se.value,"can-filter":Fe.value,"filter-active":d.getFilter()!==null,"h-align-options":w.hAlignOptions,"v-align-options":w.vAlignOptions,"sel-h-align":w.selHAlign,"sel-v-align":w.selVAlign,"sel-wrap":w.selWrap,"merge-menu-open":v.mergeMenuOpen,"calc-menu-open":v.calcMenuOpen,"is-single-cell":q.value,"has-freeze":d.freeze.rows>0||d.freeze.cols>0,"sel-number-format":w.selNumberFormatDisplay,"nf-options":w.nfOptions,"can-increase-decimals":w.canIncreaseDecimals,"can-decrease-decimals":w.canDecreaseDecimals,"theme-vars":R.toolbarThemeVars,onUndo:c[0]||(c[0]=u=>w.undo()),onRedo:c[1]||(c[1]=u=>w.redo()),onPaintFormat:w.onPaintFormat,onClearFormat:c[2]||(c[2]=u=>w.clearFormat()),onNumberFormatChange:c[3]||(c[3]=u=>w.onNumberFormatChange(u)),onIncreaseDecimals:w.onIncreaseDecimals,onDecreaseDecimals:w.onDecreaseDecimals,onFontFamilyChange:c[4]||(c[4]=u=>w.onFontFamilyChange(u)),onFontSizeInput:c[5]||(c[5]=u=>w.onFontSizeInput(u)),onFontSizeBlur:w.onFontSizeBlur,onFontSizeKeydown:c[6]||(c[6]=u=>w.onFontSizeKeydown(u)),onFontSizeChange:c[7]||(c[7]=u=>w.onFontSizeChange(u)),"onUpdate:fontSizeMenuOpen":c[8]||(c[8]=u=>et(u)),onFontSizeToggle:c[9]||(c[9]=u=>w.toggleFontSizeMenu()),onFontSizeStepUp:w.onFontSizeStepUp,onFontSizeStepDown:w.onFontSizeStepDown,onBoldToggle:w.toggleFontWeight,onItalicToggle:w.toggleFontStyle,onUnderlineToggle:w.toggleUnderline,onStrikethroughToggle:w.toggleStrikethrough,onTextColorChange:c[10]||(c[10]=u=>w.onTextColorChange(u)),"onUpdate:textColorMenuOpen":c[11]||(c[11]=u=>oe(u)),onFillColorChange:c[12]||(c[12]=u=>w.onFillColorChange(u)),"onUpdate:fillColorMenuOpen":c[13]||(c[13]=u=>pe(u)),onApplyTextColor:w.applyCachedTextColor,onApplyFillColor:w.applyCachedFillColor,"onUpdate:borderMenuOpen":c[14]||(c[14]=u=>w.onBorderMenuToggle(u)),onBorderChange:c[15]||(c[15]=u=>v.onBorderChange(u)),onApplyBorder:v.applyCachedBorder,"onUpdate:sortMenuOpen":c[16]||(c[16]=u=>R.onSortMenuToggle(u)),onSortChange:c[17]||(c[17]=u=>R.onSortChange(u)),onApplySort:R.applyCachedSort,onToggleFilter:gt,onFreezeChange:c[18]||(c[18]=u=>lt(u)),onHAlignChange:c[19]||(c[19]=u=>w.onHAlignChange(u)),onVAlignChange:c[20]||(c[20]=u=>w.onVAlignChange(u)),onWrapToggle:w.onWrapToggle,"onUpdate:mergeMenuOpen":c[21]||(c[21]=u=>v.onMergeMenuToggle(u)),onMergeChange:c[22]||(c[22]=u=>v.onMergeChange(u)),onApplyMerge:v.onApplyMerge,"onUpdate:calcMenuOpen":c[23]||(c[23]=u=>v.onCalcMenuToggle(u)),onCalcSum:v.onCalcSum,onCalcAvg:v.onCalcAvg,onCalcCount:v.onCalcCount,onFind:c[24]||(c[24]=u=>t.unref(k).openFind())},null,8,["locale","can-undo","can-redo","paint-fmt-active","has-selection","font-family-options","font-size-options","sel-font-family","sel-font-size","font-size-input","font-size-menu-open","sel-font-weight","sel-font-style","sel-underline","sel-strikethrough","sel-text-color","text-color-menu-open","sel-fill-color","fill-color-menu-open","cached-text-color","cached-fill-color","border-menu-open","cached-border","sort-menu-open","cached-sort-order","can-sort","can-filter","filter-active","h-align-options","v-align-options","sel-h-align","sel-v-align","sel-wrap","merge-menu-open","calc-menu-open","is-single-cell","has-freeze","sel-number-format","nf-options","can-increase-decimals","can-decrease-decimals","theme-vars","onPaintFormat","onIncreaseDecimals","onDecreaseDecimals","onFontSizeBlur","onFontSizeStepUp","onFontSizeStepDown","onBoldToggle","onItalicToggle","onUnderlineToggle","onStrikethroughToggle","onApplyTextColor","onApplyFillColor","onApplyBorder","onApplySort","onWrapToggle","onApplyMerge","onCalcSum","onCalcAvg","onCalcCount"]),t.createVNode(vc,{open:j.open,"find-text":j.findText,"replace-text":j.replaceText,scope:j.scope,"match-case":j.matchCase,"match-entire-cell":j.matchEntireCell,"current-index":j.currentIndex,total:j.results.length,message:j.message,"focus-token":j.focusToken,locale:d.locale,"theme-vars":R.toolbarThemeVars,"onUpdate:findText":c[25]||(c[25]=u=>t.unref(k).findText.value=u),"onUpdate:replaceText":c[26]||(c[26]=u=>t.unref(k).replaceText.value=u),"onUpdate:scope":c[27]||(c[27]=u=>t.unref(k).scope.value=u),"onUpdate:matchCase":c[28]||(c[28]=u=>t.unref(k).matchCase.value=u),"onUpdate:matchEntireCell":c[29]||(c[29]=u=>t.unref(k).matchEntireCell.value=u),onPrev:c[30]||(c[30]=u=>t.unref(k).findPrev()),onNext:c[31]||(c[31]=u=>t.unref(k).findNext()),onReplace:c[32]||(c[32]=u=>t.unref(k).replace()),onReplaceAll:c[33]||(c[33]=u=>t.unref(k).replaceAll()),onClose:c[34]||(c[34]=u=>t.unref(k).close())},null,8,["open","find-text","replace-text","scope","match-case","match-entire-cell","current-index","total","message","focus-token","locale","theme-vars"]),t.createVNode(Xc,{"model-open":w.nfDialogOpen,locale:d.locale,"current-format":Qe.value,"is-custom":w.selNumberFormat===t.unref($l),"onUpdate:modelOpen":c[35]||(c[35]=u=>Ge(u)),onApply:c[36]||(c[36]=u=>w.applyNumberFormatCode(u))},null,8,["model-open","locale","current-format","is-custom"]),t.createVNode(ns,{"model-open":R.sortConfirmOpen,locale:d.locale,"onUpdate:modelOpen":c[37]||(c[37]=u=>R.sortConfirmOpen=u),onConfirm:c[38]||(c[38]=u=>R.confirmSort(u)),onCancel:c[39]||(c[39]=u=>R.cancelSortConfirmation())},null,8,["model-open","locale"]),t.createVNode(ks,{"model-open":be.value,locale:d.locale,"onUpdate:modelOpen":c[40]||(c[40]=u=>Xe(u)),onInsert:c[41]||(c[41]=u=>Je(u))},null,8,["model-open","locale"]),t.createElementVNode("div",{class:t.normalizeClass(["formula-bar",{"formula-bar--expanded":C.formulaBarExpanded}])},[t.createElementVNode("div",gu,t.toDisplayString(C.activeCellLabel),1),t.createElementVNode("div",yu,[t.createElementVNode("button",{type:"button",class:"formula-bar__btn formula-bar__btn--cancel",title:"取消(Esc)","aria-label":"取消",onMousedown:c[42]||(c[42]=t.withModifiers(()=>{},["prevent"])),onClick:c[43]||(c[43]=t.withModifiers((...u)=>C.cancelFormulaBarEdit&&C.cancelFormulaBarEdit(...u),["stop"]))},[...c[95]||(c[95]=[t.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true"},[t.createElementVNode("path",{d:"M3 3l8 8M11 3l-8 8",fill:"none",stroke:"#e53935","stroke-width":"1.8","stroke-linecap":"round"})],-1)])],32),t.createElementVNode("button",{type:"button",class:"formula-bar__btn formula-bar__btn--accept",title:"接受(Enter)","aria-label":"接受",onMousedown:c[44]||(c[44]=t.withModifiers(()=>{},["prevent"])),onClick:c[45]||(c[45]=t.withModifiers((...u)=>C.acceptFormulaBarEdit&&C.acceptFormulaBarEdit(...u),["stop"]))},[...c[96]||(c[96]=[t.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true"},[t.createElementVNode("path",{d:"M2.5 7.5l3.5 3.5L12 3.5",fill:"none",stroke:"#2e7d32","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],32),t.createElementVNode("button",{type:"button",class:"formula-bar__btn formula-bar__btn--fx",title:t.unref(D)(d.locale,"insertFunctionTitle"),"aria-label":t.unref(D)(d.locale,"insertFunctionTitle"),onMousedown:c[46]||(c[46]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers(ve,["stop"])},[...c[97]||(c[97]=[t.createElementVNode("span",{class:"formula-bar__fx-label"},"fx",-1)])],40,bu)]),t.createElementVNode("textarea",{ref:L,class:t.normalizeClass(["formula-bar__input",{"formula-bar__input--expanded":C.formulaBarExpanded}]),rows:C.formulaBarExpanded?3:1,value:C.formulaBarDisplay,spellcheck:"false",onFocus:c[47]||(c[47]=(...u)=>C.onFormulaBarFocus&&C.onFormulaBarFocus(...u)),onInput:c[48]||(c[48]=(...u)=>C.onFormulaBarInput&&C.onFormulaBarInput(...u)),onKeydown:c[49]||(c[49]=(...u)=>C.onFormulaBarKeydown&&C.onFormulaBarKeydown(...u)),onBlur:c[50]||(c[50]=(...u)=>C.onFormulaBarBlur&&C.onFormulaBarBlur(...u))},null,42,Cu),t.createElementVNode("button",{type:"button",class:"formula-bar__toggle",title:C.formulaBarExpanded?"折叠为1行":"展开为3行",onMousedown:c[51]||(c[51]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers($,["stop"])},[C.formulaBarExpanded?(t.openBlock(),t.createElementBlock("svg",ku,[...c[99]||(c[99]=[t.createElementVNode("path",{d:"M2 8l4-4 4 4",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(t.openBlock(),t.createElementBlock("svg",vu,[...c[98]||(c[98]=[t.createElementVNode("path",{d:"M2 4l4 4 4-4",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],40,wu)],2),t.createElementVNode("div",{ref:ee,class:"spreadsheet-wrapper"},[t.createElementVNode("canvas",{ref:ie,class:"grid-canvas",tabindex:"0",onMousedown:c[52]||(c[52]=(...u)=>C.onMouseDown&&C.onMouseDown(...u)),onMousemove:c[53]||(c[53]=(...u)=>C.onMouseMove&&C.onMouseMove(...u)),onMouseup:c[54]||(c[54]=(...u)=>C.onMouseUp&&C.onMouseUp(...u)),onMouseleave:c[55]||(c[55]=(...u)=>C.onMouseLeave&&C.onMouseLeave(...u)),onDblclick:c[56]||(c[56]=(...u)=>C.onDblClick&&C.onDblClick(...u)),onWheel:c[57]||(c[57]=t.withModifiers((...u)=>C.onWheel&&C.onWheel(...u),["prevent"])),onFocus:c[58]||(c[58]=(...u)=>R.onCanvasFocus&&R.onCanvasFocus(...u)),onKeydown:c[59]||(c[59]=(...u)=>C.onKeydown&&C.onKeydown(...u)),onContextmenu:c[60]||(c[60]=(...u)=>C.onCanvasCtx&&C.onCanvasCtx(...u)),onTouchstart:c[61]||(c[61]=t.withModifiers((...u)=>C.onTouchStart&&C.onTouchStart(...u),["prevent"])),onTouchmove:c[62]||(c[62]=t.withModifiers((...u)=>C.onTouchMove&&C.onTouchMove(...u),["prevent"])),onTouchend:c[63]||(c[63]=(...u)=>C.onTouchEnd&&C.onTouchEnd(...u))},null,32),t.createElementVNode("canvas",{ref:re,class:"grid-canvas grid-canvas--freeze","aria-hidden":"true"}),t.createElementVNode("textarea",{ref:he,class:"cell-editor",value:d.editValue,style:t.normalizeStyle(C.editInputStyle),onInput:c[64]||(c[64]=(...u)=>C.onEditInput&&C.onEditInput(...u)),onKeydown:c[65]||(c[65]=(...u)=>C.onEditKd&&C.onEditKd(...u)),onCompositionstart:c[66]||(c[66]=(...u)=>C.onEditCompositionStart&&C.onEditCompositionStart(...u)),onCompositionend:c[67]||(c[67]=(...u)=>C.onEditCompositionEnd&&C.onEditCompositionEnd(...u)),onBlur:c[68]||(c[68]=(...u)=>C.onEditBlur&&C.onEditBlur(...u)),onPaste:c[69]||(c[69]=(...u)=>C.onEditPaste&&C.onEditPaste(...u))},null,44,Eu),R.maxScrollY>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"v-scrollbar",style:t.normalizeStyle({top:C.vScrollbarTop+"px",height:`calc(100% - ${C.vScrollbarTop+t.unref(11)}px)`})},[t.createElementVNode("button",{class:"sb-btn sb-btn--up",title:"",onMousedown:c[70]||(c[70]=t.withModifiers(u=>{R.clampScroll(null,d.scrollY-50),C.scheduleRender()},["prevent"]))},[...c[100]||(c[100]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--up"},null,-1)])],32),t.createElementVNode("div",{class:"sb-track sb-track--v",onMousedown:c[72]||(c[72]=(...u)=>C.onVTrk&&C.onVTrk(...u))},[t.createElementVNode("div",{class:"sb-thumb sb-thumb--v",style:t.normalizeStyle({top:C.vThumbT+"px",height:C.vThumbH+"px"}),onMousedown:c[71]||(c[71]=(...u)=>C.onVStart&&C.onVStart(...u))},null,36)],32),t.createElementVNode("button",{class:"sb-btn sb-btn--down",onMousedown:c[73]||(c[73]=t.withModifiers(u=>{R.clampScroll(null,d.scrollY+50),C.scheduleRender()},["prevent"]))},[...c[101]||(c[101]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--down"},null,-1)])],32)],4)):t.createCommentVNode("",!0),R.maxScrollX>0?(t.openBlock(),t.createElementBlock("div",{key:1,class:"h-scrollbar",style:t.normalizeStyle({left:C.hScrollbarLeft+"px",width:`calc(100% - ${C.hScrollbarLeft+t.unref(11)}px)`})},[t.createElementVNode("button",{class:"sb-btn sb-btn--left",onMousedown:c[74]||(c[74]=t.withModifiers(u=>{R.clampScroll(d.scrollX-50,null),C.scheduleRender()},["prevent"]))},[...c[102]||(c[102]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--left"},null,-1)])],32),t.createElementVNode("div",{class:"sb-track sb-track--h",onMousedown:c[76]||(c[76]=(...u)=>C.onHTrk&&C.onHTrk(...u))},[t.createElementVNode("div",{class:"sb-thumb sb-thumb--h",style:t.normalizeStyle({left:C.hThumbL+"px",width:C.hThumbW+"px"}),onMousedown:c[75]||(c[75]=(...u)=>C.onHStart&&C.onHStart(...u))},null,36)],32),t.createElementVNode("button",{class:"sb-btn sb-btn--right",onMousedown:c[77]||(c[77]=t.withModifiers(u=>{R.clampScroll(d.scrollX+50,null),C.scheduleRender()},["prevent"]))},[...c[103]||(c[103]=[t.createElementVNode("span",{class:"sb-arrow sb-arrow--right"},null,-1)])],32)],4)):t.createCommentVNode("",!0),R.maxScrollX>0&&R.maxScrollY>0?(t.openBlock(),t.createElementBlock("div",Su)):t.createCommentVNode("",!0)]),t.createVNode(cc,{locale:d.locale,sheets:t.unref(G),"active-sheet-index":t.unref(te),"ren-tab":C.renTab,"ren-tab-val":C.renTabVal,onTabClick:c[78]||(c[78]=u=>C.onTabClick(u)),onTabDblclick:c[79]||(c[79]=u=>C.onTabDblClick(u)),onTabContextmenu:c[80]||(c[80]=u=>C.onTabCtxMenu(u.ev,u.i)),onTabRenameInput:c[81]||(c[81]=u=>g(u)),onTabRenameKeydown:c[82]||(c[82]=u=>C.onTabRenameKd(u)),onTabRenameCommit:C.commitTabRename,onTabbarContextmenu:c[83]||(c[83]=u=>C.onTabBarCtx(u)),onDeleteSheet:c[84]||(c[84]=u=>{R.removeSheet(u),C.scheduleRender()}),onAddSheet:c[85]||(c[85]=u=>{R.addSheet(),C.scheduleRender()})},null,8,["locale","sheets","active-sheet-index","ren-tab","ren-tab-val","onTabRenameCommit"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[C.ctxMenu?(t.openBlock(),t.createElementBlock("div",{key:0,class:"context-menu",style:t.normalizeStyle({left:C.ctxMenu.x+"px",top:C.ctxMenu.y+"px"}),onClick:c[86]||(c[86]=t.withModifiers(()=>{},["stop"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.ctxMenu.items,(u,p)=>(t.openBlock(),t.createElementBlock("div",{key:p,class:t.normalizeClass(["context-menu__item",{"context-menu__item--disabled":u.disabled}]),onClick:H=>!u.disabled&&u.action&&(u.action(),A()),onMouseenter:H=>C.onCtxItemEnter(H,u)},[t.createElementVNode("span",Mu,t.toDisplayString(u.label),1),u.children?(t.openBlock(),t.createElementBlock("svg",xu,[...c[104]||(c[104]=[t.createElementVNode("path",{d:"M361.386667 180.053333a32 32 0 0 0 0 45.226667L648.106667 512l-286.72 286.72a32 32 0 1 0 45.226666 45.226667l309.333334-309.333334a32 32 0 0 0 0-45.226666L406.613333 180.053333a32 32 0 0 0-45.226666 0z","p-id":"22870"},null,-1)])])):t.createCommentVNode("",!0),u.children?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["context-submenu",{"context-submenu--left":C.ctxSubmenuLeft}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.children,(H,ct)=>(t.openBlock(),t.createElementBlock("div",{key:ct,class:t.normalizeClass(["context-menu__item",{"context-menu__item--disabled":H.disabled}]),onClick:t.withModifiers(ae=>!H.disabled&&H.action&&(H.action(),A()),["stop"])},t.toDisplayString(H.label),11,Bu))),128))],2)):t.createCommentVNode("",!0)],42,Ru))),128))],4)):t.createCommentVNode("",!0)]),_:1})])),C.filterPopup?(t.openBlock(),t.createBlock(Ys,{key:C.filterPopup.col,col:C.filterPopup.col,"header-label":Ze(C.filterPopup.col),anchor:{x:C.filterPopup.x,y:C.filterPopup.y},locale:d.locale,"get-filter":d.getFilter,"set-filter":d.setFilter,"set-filter-column":d.setFilterColumn,"clear-filter-column":d.clearFilterColumn,"get-column-candidates":d.getColumnCandidates,close:C.closeFilterPopup},null,8,["col","header-label","anchor","locale","get-filter","set-filter","set-filter-column","clear-filter-column","get-column-candidates","close"])):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"menu-pop"},{default:t.withCtx(()=>[C.dimPanel?(t.openBlock(),t.createElementBlock("div",{key:0,class:"dim-panel",style:t.normalizeStyle({left:C.dimPanel.x+"px",top:C.dimPanel.y+"px"}),onMousedown:c[92]||(c[92]=t.withModifiers(()=>{},["stop"])),onTouchstart:c[93]||(c[93]=t.withModifiers(()=>{},["stop"])),onClick:c[94]||(c[94]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",Tu,t.toDisplayString(C.dimPanel.type==="row"?"行高":"列宽"),1),t.createElementVNode("div",Du,[t.createElementVNode("input",{ref:ce,class:t.normalizeClass(["dim-panel__input",{"dim-panel__input--error":C.dimPanel.error}]),type:"number",step:"1",min:"1",inputmode:"numeric",value:C.dimPanel.value,onInput:c[87]||(c[87]=(...u)=>C.onDimInput&&C.onDimInput(...u)),onKeydown:c[88]||(c[88]=(...u)=>C.onDimKeydown&&C.onDimKeydown(...u)),onBlur:c[89]||(c[89]=(...u)=>C.onDimBlur&&C.onDimBlur(...u))},null,42,Nu)]),C.dimPanel.error?(t.openBlock(),t.createElementBlock("div",Fu,t.toDisplayString(C.dimPanel.error),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Iu,[t.createElementVNode("button",{class:"dim-panel__btn dim-panel__btn--primary",onClick:c[90]||(c[90]=(...u)=>C.applyDimPanel&&C.applyDimPanel(...u))}," 确定 "),t.createElementVNode("button",{class:"dim-panel__btn",onClick:c[91]||(c[91]=(...u)=>C.closeDimPanel&&C.closeDimPanel(...u))}," 取消 ")])],36)):t.createCommentVNode("",!0)]),_:1})]))],4))}}),[["__scopeId","data-v-17b333fa"]]);rn.Spreader=pr,rn.default=pr,Object.defineProperties(rn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|